added arctech selflearning widget
This commit is contained in:
parent
b53c96e06f
commit
f3ede865e6
4 changed files with 113 additions and 1 deletions
|
@ -12,6 +12,7 @@ SOURCES += telldusgui.cpp \
|
|||
editgroupdialog.cpp \
|
||||
vendordevicemodel.cpp \
|
||||
vendordevicetreeitem.cpp \
|
||||
devicesettingarctechselflearning.cpp \
|
||||
devicesettingbrateck.cpp \
|
||||
devicesettingikea.cpp \
|
||||
devicesettingnexa.cpp \
|
||||
|
@ -30,6 +31,7 @@ HEADERS += telldusgui.h \
|
|||
editgroupdialog.h \
|
||||
vendordevicemodel.h \
|
||||
vendordevicetreeitem.h \
|
||||
devicesettingarctechselflearning.h \
|
||||
devicesettingbrateck.h \
|
||||
devicesettingikea.h \
|
||||
devicesettingnexa.h \
|
||||
|
|
68
telldus-gui/TelldusGui/devicesettingarctechselflearning.cpp
Normal file
68
telldus-gui/TelldusGui/devicesettingarctechselflearning.cpp
Normal file
|
@ -0,0 +1,68 @@
|
|||
//
|
||||
// C++ Implementation: devicesettingarctechselflearning
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
//
|
||||
// Author: Fredrik Jacobsson <fredrik.jacobsson@telldus.se>, (C) 2009
|
||||
//
|
||||
// Copyright: See COPYING file that comes with this distribution
|
||||
//
|
||||
//
|
||||
#include "devicesettingarctechselflearning.h"
|
||||
#include "device.h"
|
||||
#include <QGridLayout>
|
||||
#include <QSpinBox>
|
||||
#include <QLabel>
|
||||
|
||||
DeviceSettingArctechSelflearning::DeviceSettingArctechSelflearning(Device *device, QWidget *parent)
|
||||
: DeviceSetting(device, parent)
|
||||
{
|
||||
QGridLayout *gridLayout = new QGridLayout(this);
|
||||
gridLayout->setSpacing(6);
|
||||
gridLayout->setMargin(9);
|
||||
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
|
||||
|
||||
gridLayout->addItem( new QSpacerItem(20, 109, QSizePolicy::Minimum, QSizePolicy::Expanding), 0, 0 );
|
||||
|
||||
QLabel *labelRemotecodeTitle = new QLabel(this);
|
||||
labelRemotecodeTitle->setObjectName(QString::fromUtf8("labelRemotecodeTitle"));
|
||||
labelRemotecodeTitle->setAlignment(Qt::AlignCenter);
|
||||
labelRemotecodeTitle->setText( tr("Remote code") );
|
||||
gridLayout->addWidget(labelRemotecodeTitle, 1, 0);
|
||||
|
||||
QLabel *labelUnitcodeTitle = new QLabel(this);
|
||||
labelUnitcodeTitle->setObjectName(QString::fromUtf8("labelUnitcodeTitle"));
|
||||
labelUnitcodeTitle->setAlignment(Qt::AlignCenter);
|
||||
labelUnitcodeTitle->setText( tr("Unitcode") );
|
||||
gridLayout->addWidget(labelUnitcodeTitle, 1, 1);
|
||||
|
||||
spinRemotecode = new QSpinBox(this);
|
||||
spinRemotecode->setObjectName(QString::fromUtf8("unitcode"));
|
||||
spinRemotecode->setMinimum(1);
|
||||
spinRemotecode->setMaximum(67108863);
|
||||
gridLayout->addWidget(spinRemotecode, 2, 0);
|
||||
|
||||
spinUnitcode = new QSpinBox(this);
|
||||
spinUnitcode->setObjectName(QString::fromUtf8("unitcode"));
|
||||
spinUnitcode->setMinimum(1);
|
||||
spinUnitcode->setMaximum(16);
|
||||
gridLayout->addWidget(spinUnitcode, 2, 1);
|
||||
|
||||
gridLayout->addItem( new QSpacerItem(20, 109, QSizePolicy::Minimum, QSizePolicy::Expanding), 3, 0 );
|
||||
|
||||
spinRemotecode->setValue( device->parameter("house", "1").toInt() );
|
||||
spinUnitcode->setValue( device->parameter("unit", "1").toInt() );
|
||||
|
||||
}
|
||||
|
||||
|
||||
DeviceSettingArctechSelflearning::~DeviceSettingArctechSelflearning()
|
||||
{
|
||||
}
|
||||
|
||||
void DeviceSettingArctechSelflearning::saveParameters() {
|
||||
p_device->setParameter( "house", QString::number(spinRemotecode->value()) );
|
||||
p_device->setParameter( "unit", QString::number(spinUnitcode->value()) );
|
||||
|
||||
}
|
40
telldus-gui/TelldusGui/devicesettingarctechselflearning.h
Normal file
40
telldus-gui/TelldusGui/devicesettingarctechselflearning.h
Normal file
|
@ -0,0 +1,40 @@
|
|||
//
|
||||
// C++ Interface: devicesettingnexa
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
//
|
||||
// Author: Fredrik Jacobsson <fredrik.jacobsson@telldus.se>, (C) 2009
|
||||
//
|
||||
// Copyright: See COPYING file that comes with this distribution
|
||||
//
|
||||
//
|
||||
#ifndef DEVICESETTINGARCTECHSELFLEARNING_H
|
||||
#define DEVICESETTINGARCTECHSELFLEARNING_H
|
||||
|
||||
#include "devicesetting.h"
|
||||
|
||||
class QGridLayout;
|
||||
class QSpinBox;
|
||||
class QLabel;
|
||||
|
||||
/**
|
||||
@author Micke Prag <micke.prag@telldus.se>
|
||||
*/
|
||||
class DeviceSettingArctechSelflearning : public DeviceSetting
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
DeviceSettingArctechSelflearning(Device *device, QWidget *parent = 0);
|
||||
|
||||
virtual ~DeviceSettingArctechSelflearning();
|
||||
|
||||
public slots:
|
||||
virtual void saveParameters();
|
||||
|
||||
protected:
|
||||
QSpinBox *spinRemotecode;
|
||||
QSpinBox *spinUnitcode;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -3,6 +3,7 @@
|
|||
#include "vendordevicetreeitem.h"
|
||||
#include "device.h"
|
||||
|
||||
#include "devicesettingarctechselflearning.h"
|
||||
#include "devicesettingbrateck.h"
|
||||
#include "devicesettingikea.h"
|
||||
#include "devicesettingnexa.h"
|
||||
|
@ -104,7 +105,8 @@ EditDeviceDialog::EditDeviceDialog(Device *d, QWidget *parent, Qt::WFlags flags)
|
|||
deviceSettings[5] = new DeviceSettingRisingSun(device, this);
|
||||
deviceSettings[6] = new DeviceSettingBrateck(device, this);
|
||||
deviceSettings[7] = new DeviceSettingUpm(device, this);
|
||||
foreach( DeviceSetting *s, deviceSettings ) {
|
||||
deviceSettings[8] = new DeviceSettingArctechSelflearning(device, this);
|
||||
foreach( DeviceSetting *s, deviceSettings ) {
|
||||
settingsLayout->addWidget( s );
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue