Drop basicTags support, it's deprecated and has never been used
This commit is contained in:
parent
d7a4179d78
commit
bec8e233c5
@ -58,8 +58,6 @@ public:
|
|||||||
|
|
||||||
void clearModel();
|
void clearModel();
|
||||||
|
|
||||||
DeviceClass::BasicTags basicTags() const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QHash<int, QByteArray> roleNames() const;
|
QHash<int, QByteArray> roleNames() const;
|
||||||
|
|
||||||
|
|||||||
@ -82,7 +82,6 @@ DeviceClass *JsonTypes::unpackDeviceClass(const QVariantMap &deviceClassMap, QOb
|
|||||||
}
|
}
|
||||||
deviceClass->setCreateMethods(createMethods);
|
deviceClass->setCreateMethods(createMethods);
|
||||||
deviceClass->setSetupMethod(stringToSetupMethod(deviceClassMap.value("setupMethod").toString()));
|
deviceClass->setSetupMethod(stringToSetupMethod(deviceClassMap.value("setupMethod").toString()));
|
||||||
deviceClass->setBasicTags(stringListToBasicTags(deviceClassMap.value("basicTags").toStringList()));
|
|
||||||
deviceClass->setInterfaces(deviceClassMap.value("interfaces").toStringList());
|
deviceClass->setInterfaces(deviceClassMap.value("interfaces").toStringList());
|
||||||
|
|
||||||
// ParamTypes
|
// ParamTypes
|
||||||
@ -463,50 +462,6 @@ DeviceClass::SetupMethod JsonTypes::stringToSetupMethod(const QString &setupMeth
|
|||||||
return DeviceClass::SetupMethodJustAdd;
|
return DeviceClass::SetupMethodJustAdd;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<DeviceClass::BasicTag> JsonTypes::stringListToBasicTags(const QStringList &basicTagsStringList)
|
|
||||||
{
|
|
||||||
QList<DeviceClass::BasicTag> ret;
|
|
||||||
if (basicTagsStringList.contains("BasicTagService"))
|
|
||||||
ret << DeviceClass::BasicTagService;
|
|
||||||
if (basicTagsStringList.contains("BasicTagDevice"))
|
|
||||||
ret << DeviceClass::BasicTagDevice;
|
|
||||||
if (basicTagsStringList.contains("BasicTagSensor"))
|
|
||||||
ret << DeviceClass::BasicTagSensor;
|
|
||||||
if (basicTagsStringList.contains("BasicTagActuator"))
|
|
||||||
ret << DeviceClass::BasicTagActuator;
|
|
||||||
if (basicTagsStringList.contains("BasicTagLighting"))
|
|
||||||
ret << DeviceClass::BasicTagLighting;
|
|
||||||
if (basicTagsStringList.contains("BasicTagEnergy"))
|
|
||||||
ret << DeviceClass::BasicTagEnergy;
|
|
||||||
if (basicTagsStringList.contains("BasicTagMultimedia"))
|
|
||||||
ret << DeviceClass::BasicTagMultimedia;
|
|
||||||
if (basicTagsStringList.contains("BasicTagWeather"))
|
|
||||||
ret << DeviceClass::BasicTagWeather;
|
|
||||||
if (basicTagsStringList.contains("BasicTagGateway"))
|
|
||||||
ret << DeviceClass::BasicTagGateway;
|
|
||||||
if (basicTagsStringList.contains("BasicTagHeating"))
|
|
||||||
ret << DeviceClass::BasicTagHeating;
|
|
||||||
if (basicTagsStringList.contains("BasicTagCooling"))
|
|
||||||
ret << DeviceClass::BasicTagCooling;
|
|
||||||
if (basicTagsStringList.contains("BasicTagNotification"))
|
|
||||||
ret << DeviceClass::BasicTagNotification;
|
|
||||||
if (basicTagsStringList.contains("BasicTagSecurity"))
|
|
||||||
ret << DeviceClass::BasicTagSecurity;
|
|
||||||
if (basicTagsStringList.contains("BasicTagTime"))
|
|
||||||
ret << DeviceClass::BasicTagTime;
|
|
||||||
if (basicTagsStringList.contains("BasicTagShading"))
|
|
||||||
ret << DeviceClass::BasicTagShading;
|
|
||||||
if (basicTagsStringList.contains("BasicTagAppliance"))
|
|
||||||
ret << DeviceClass::BasicTagAppliance;
|
|
||||||
if (basicTagsStringList.contains("BasicTagCamera"))
|
|
||||||
ret << DeviceClass::BasicTagCamera;
|
|
||||||
if (basicTagsStringList.contains("BasicTagLock"))
|
|
||||||
ret << DeviceClass::BasicTagLock;
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
QPair<Types::Unit, QString> JsonTypes::stringToUnit(const QString &unitString)
|
QPair<Types::Unit, QString> JsonTypes::stringToUnit(const QString &unitString)
|
||||||
{
|
{
|
||||||
if (unitString == "UnitNone") {
|
if (unitString == "UnitNone") {
|
||||||
|
|||||||
@ -77,7 +77,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static DeviceClass::SetupMethod stringToSetupMethod(const QString &setupMethodString);
|
static DeviceClass::SetupMethod stringToSetupMethod(const QString &setupMethodString);
|
||||||
static QList<DeviceClass::BasicTag> stringListToBasicTags(const QStringList &basicTagsStringList);
|
|
||||||
static QPair<Types::Unit, QString> stringToUnit(const QString &unitString);
|
static QPair<Types::Unit, QString> stringToUnit(const QString &unitString);
|
||||||
static Types::InputType stringToInputType(const QString &inputTypeString);
|
static Types::InputType stringToInputType(const QString &inputTypeString);
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,6 @@
|
|||||||
DeviceClass::DeviceClass(QObject *parent) :
|
DeviceClass::DeviceClass(QObject *parent) :
|
||||||
QObject(parent)
|
QObject(parent)
|
||||||
{
|
{
|
||||||
qRegisterMetaType<BasicTags>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QUuid DeviceClass::id() const
|
QUuid DeviceClass::id() const
|
||||||
@ -101,25 +100,6 @@ void DeviceClass::setSetupMethod(DeviceClass::SetupMethod setupMethod)
|
|||||||
m_setupMethod = setupMethod;
|
m_setupMethod = setupMethod;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<DeviceClass::BasicTag> DeviceClass::basicTags() const
|
|
||||||
{
|
|
||||||
return m_basicTags;
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList DeviceClass::basicTagNames() const
|
|
||||||
{
|
|
||||||
QStringList ret;
|
|
||||||
foreach (DeviceClass::BasicTag tag, m_basicTags) {
|
|
||||||
ret << basicTagToString(tag);
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DeviceClass::setBasicTags(QList<DeviceClass::BasicTag> basicTags)
|
|
||||||
{
|
|
||||||
m_basicTags = basicTags;
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList DeviceClass::interfaces() const
|
QStringList DeviceClass::interfaces() const
|
||||||
{
|
{
|
||||||
return m_interfaces;
|
return m_interfaces;
|
||||||
@ -251,48 +231,3 @@ bool DeviceClass::hasActionType(const QString &actionTypeId)
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString DeviceClass::basicTagToString(DeviceClass::BasicTag basicTag)
|
|
||||||
{
|
|
||||||
switch (basicTag) {
|
|
||||||
case DeviceClass::BasicTagActuator:
|
|
||||||
return "Actuators";
|
|
||||||
case DeviceClass::BasicTagAppliance:
|
|
||||||
return "Apliances";
|
|
||||||
case DeviceClass::BasicTagCamera:
|
|
||||||
return "Cameras";
|
|
||||||
case DeviceClass::BasicTagCooling:
|
|
||||||
return "Cooling";
|
|
||||||
case DeviceClass::BasicTagDevice:
|
|
||||||
return "Devices";
|
|
||||||
case DeviceClass::BasicTagEnergy:
|
|
||||||
return "Energy";
|
|
||||||
case DeviceClass::BasicTagGateway:
|
|
||||||
return "Gateways";
|
|
||||||
case DeviceClass::BasicTagHeating:
|
|
||||||
return "Heating";
|
|
||||||
case DeviceClass::BasicTagLighting:
|
|
||||||
return "Lighting";
|
|
||||||
case DeviceClass::BasicTagLock:
|
|
||||||
return "Locks";
|
|
||||||
case DeviceClass::BasicTagMultimedia:
|
|
||||||
return "Multimedia";
|
|
||||||
case DeviceClass::BasicTagNotification:
|
|
||||||
return "Notifications";
|
|
||||||
case DeviceClass::BasicTagSecurity:
|
|
||||||
return "Security";
|
|
||||||
case DeviceClass::BasicTagSensor:
|
|
||||||
return "Sensors";
|
|
||||||
case DeviceClass::BasicTagService:
|
|
||||||
return "Services";
|
|
||||||
case DeviceClass::BasicTagShading:
|
|
||||||
return "Shading";
|
|
||||||
case DeviceClass::BasicTagTime:
|
|
||||||
return "Time";
|
|
||||||
case DeviceClass::BasicTagWeather:
|
|
||||||
return "Weather";
|
|
||||||
default:
|
|
||||||
return "Unknown";
|
|
||||||
}
|
|
||||||
return "Unknown";
|
|
||||||
}
|
|
||||||
|
|||||||
@ -44,7 +44,6 @@ class DeviceClass : public QObject
|
|||||||
Q_PROPERTY(QUuid vendorId READ vendorId CONSTANT)
|
Q_PROPERTY(QUuid vendorId READ vendorId CONSTANT)
|
||||||
Q_PROPERTY(QStringList createMethods READ createMethods CONSTANT)
|
Q_PROPERTY(QStringList createMethods READ createMethods CONSTANT)
|
||||||
Q_PROPERTY(SetupMethod setupMethod READ setupMethod CONSTANT)
|
Q_PROPERTY(SetupMethod setupMethod READ setupMethod CONSTANT)
|
||||||
Q_PROPERTY(QStringList basicTags READ basicTagNames CONSTANT)
|
|
||||||
Q_PROPERTY(QStringList interfaces READ interfaces CONSTANT)
|
Q_PROPERTY(QStringList interfaces READ interfaces CONSTANT)
|
||||||
Q_PROPERTY(QString baseInterface READ baseInterface CONSTANT)
|
Q_PROPERTY(QString baseInterface READ baseInterface CONSTANT)
|
||||||
Q_PROPERTY(ParamTypes *paramTypes READ paramTypes NOTIFY paramTypesChanged)
|
Q_PROPERTY(ParamTypes *paramTypes READ paramTypes NOTIFY paramTypesChanged)
|
||||||
@ -63,32 +62,7 @@ public:
|
|||||||
};
|
};
|
||||||
Q_ENUM(SetupMethod)
|
Q_ENUM(SetupMethod)
|
||||||
|
|
||||||
enum BasicTag {
|
DeviceClass(QObject *parent = nullptr);
|
||||||
BasicTagNone = 0,
|
|
||||||
BasicTagService = 1 << 0,
|
|
||||||
BasicTagDevice = 1 << 1,
|
|
||||||
BasicTagSensor = 1 << 2,
|
|
||||||
BasicTagActuator = 1 << 3,
|
|
||||||
BasicTagLighting = 1 << 4,
|
|
||||||
BasicTagEnergy = 1 << 5,
|
|
||||||
BasicTagMultimedia = 1 << 6,
|
|
||||||
BasicTagWeather = 1 << 7,
|
|
||||||
BasicTagGateway = 1 << 8,
|
|
||||||
BasicTagHeating = 1 << 9,
|
|
||||||
BasicTagCooling = 1 << 10,
|
|
||||||
BasicTagNotification = 1 << 11,
|
|
||||||
BasicTagSecurity = 1 << 12,
|
|
||||||
BasicTagTime = 1 << 13,
|
|
||||||
BasicTagShading = 1 << 14,
|
|
||||||
BasicTagAppliance = 1 << 15,
|
|
||||||
BasicTagCamera = 1 << 16,
|
|
||||||
BasicTagLock = 1 << 17
|
|
||||||
};
|
|
||||||
Q_ENUM(BasicTag)
|
|
||||||
Q_DECLARE_FLAGS(BasicTags, BasicTag)
|
|
||||||
Q_FLAGS(BasicTags)
|
|
||||||
|
|
||||||
DeviceClass(QObject *parent = 0);
|
|
||||||
|
|
||||||
QString name() const;
|
QString name() const;
|
||||||
void setName(const QString &name);
|
void setName(const QString &name);
|
||||||
@ -111,10 +85,6 @@ public:
|
|||||||
SetupMethod setupMethod() const;
|
SetupMethod setupMethod() const;
|
||||||
void setSetupMethod(SetupMethod setupMethod);
|
void setSetupMethod(SetupMethod setupMethod);
|
||||||
|
|
||||||
QList<BasicTag> basicTags() const;
|
|
||||||
QStringList basicTagNames() const;
|
|
||||||
void setBasicTags(QList<BasicTag> basicTag);
|
|
||||||
|
|
||||||
QStringList interfaces() const;
|
QStringList interfaces() const;
|
||||||
void setInterfaces(const QStringList &interfaces);
|
void setInterfaces(const QStringList &interfaces);
|
||||||
|
|
||||||
@ -137,8 +107,6 @@ public:
|
|||||||
|
|
||||||
Q_INVOKABLE bool hasActionType(const QString &actionTypeId);
|
Q_INVOKABLE bool hasActionType(const QString &actionTypeId);
|
||||||
|
|
||||||
static QString basicTagToString(BasicTag basicTag);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QUuid m_id;
|
QUuid m_id;
|
||||||
QUuid m_vendorId;
|
QUuid m_vendorId;
|
||||||
@ -147,7 +115,6 @@ private:
|
|||||||
QString m_displayName;
|
QString m_displayName;
|
||||||
QStringList m_createMethods;
|
QStringList m_createMethods;
|
||||||
SetupMethod m_setupMethod;
|
SetupMethod m_setupMethod;
|
||||||
QList<BasicTag> m_basicTags;
|
|
||||||
QStringList m_interfaces;
|
QStringList m_interfaces;
|
||||||
|
|
||||||
ParamTypes *m_paramTypes;
|
ParamTypes *m_paramTypes;
|
||||||
@ -163,7 +130,4 @@ signals:
|
|||||||
void eventTypesChanged();
|
void eventTypesChanged();
|
||||||
void actionTypesChanged();
|
void actionTypesChanged();
|
||||||
};
|
};
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(DeviceClass::BasicTags)
|
|
||||||
Q_DECLARE_METATYPE(DeviceClass::BasicTags)
|
|
||||||
Q_DECLARE_METATYPE(DeviceClass::BasicTag)
|
|
||||||
#endif // DEVICECLASS_H
|
#endif // DEVICECLASS_H
|
||||||
|
|||||||
Reference in New Issue
Block a user