Implemented tdStop() in our devicewidget

This commit is contained in:
Micke Prag 2011-02-25 16:33:55 +00:00
parent f82768b7b6
commit fc0f379af8
2 changed files with 8 additions and 6 deletions

View file

@ -13,7 +13,7 @@ inline double round(double x) {
} }
#endif #endif
const int SUPPORTED_METHODS = TELLSTICK_TURNON | TELLSTICK_TURNOFF | TELLSTICK_BELL | TELLSTICK_DIM | TELLSTICK_LEARN | TELLSTICK_EXECUTE | TELLSTICK_UP | TELLSTICK_DOWN; const int SUPPORTED_METHODS = TELLSTICK_TURNON | TELLSTICK_TURNOFF | TELLSTICK_BELL | TELLSTICK_DIM | TELLSTICK_LEARN | TELLSTICK_EXECUTE | TELLSTICK_UP | TELLSTICK_DOWN | TELLSTICK_STOP;
DeviceModel::DeviceModel(QObject *parent) DeviceModel::DeviceModel(QObject *parent)
@ -69,6 +69,8 @@ QVariant DeviceModel::data(const QModelIndex &index, int role) const {
return tr("up"); return tr("up");
case TELLSTICK_DOWN: case TELLSTICK_DOWN:
return tr("down"); return tr("down");
case TELLSTICK_STOP:
return tr("stopped");
case TELLSTICK_DIM: case TELLSTICK_DIM:
int value = (int)round(device->lastSentValue().toFloat()/255*100); int value = (int)round(device->lastSentValue().toFloat()/255*100);
return tr("%1%").arg(value); return tr("%1%").arg(value);

View file

@ -12,7 +12,7 @@ class MethodWidget::PrivateData {
public: public:
Device *device; Device *device;
QToolButton *turnOff, *turnOn, *bell, *learn, QToolButton *turnOff, *turnOn, *bell, *learn,
*dim25, *dim50, *dim75, *dim25, *dim50, *dim75,
*execute, *up, *down, *stop; *execute, *up, *down, *stop;
}; };
@ -96,7 +96,7 @@ MethodWidget::MethodWidget( Device *device, QWidget *parent )
connect(d->execute, SIGNAL(clicked()), device, SLOT(execute())); connect(d->execute, SIGNAL(clicked()), device, SLOT(execute()));
connect(d->up, SIGNAL(clicked()), device, SLOT(up())); connect(d->up, SIGNAL(clicked()), device, SLOT(up()));
connect(d->down, SIGNAL(clicked()), device, SLOT(down())); connect(d->down, SIGNAL(clicked()), device, SLOT(down()));
connect(d->stop, SIGNAL(clicked()), device, SLOT(turnOff())); connect(d->stop, SIGNAL(clicked()), device, SLOT(stop()));
updateMethods(device->methods()); updateMethods(device->methods());