drop ruleRelevant, eventRuleRelevant and graphRelevant
This commit is contained in:
parent
bab59f6754
commit
7893328534
@ -230,8 +230,6 @@ See also: \l{ParamDescriptor}
|
||||
"id": "Uuid",
|
||||
"index": "Int",
|
||||
"name": "String",
|
||||
"o:graphRelevant": "Bool",
|
||||
"o:ruleRelevant": "Bool",
|
||||
"paramTypes": [
|
||||
"$ref:ParamType"
|
||||
]
|
||||
@ -580,13 +578,11 @@ See also: \l{StateEvaluator}, \l{StateDescriptor}, \l{StateOperator}
|
||||
"id": "Uuid",
|
||||
"index": "Int",
|
||||
"name": "String",
|
||||
"o:graphRelevant": "Bool",
|
||||
"o:maxValue": "Variant",
|
||||
"o:minValue": "Variant",
|
||||
"o:possibleValues": [
|
||||
"Variant"
|
||||
],
|
||||
"o:ruleRelevant": "Bool",
|
||||
"o:unit": "$ref:Unit",
|
||||
"type": "$ref:BasicType"
|
||||
}
|
||||
@ -3491,8 +3487,6 @@ See also: \l{Tag}
|
||||
"id": "Uuid",
|
||||
"index": "Int",
|
||||
"name": "String",
|
||||
"o:graphRelevant": "Bool",
|
||||
"o:ruleRelevant": "Bool",
|
||||
"paramTypes": [
|
||||
"$ref:ParamType"
|
||||
]
|
||||
@ -3742,13 +3736,11 @@ See also: \l{Tag}
|
||||
"id": "Uuid",
|
||||
"index": "Int",
|
||||
"name": "String",
|
||||
"o:graphRelevant": "Bool",
|
||||
"o:maxValue": "Variant",
|
||||
"o:minValue": "Variant",
|
||||
"o:possibleValues": [
|
||||
"Variant"
|
||||
],
|
||||
"o:ruleRelevant": "Bool",
|
||||
"o:unit": "$ref:Unit",
|
||||
"type": "$ref:BasicType"
|
||||
},
|
||||
|
||||
@ -431,9 +431,6 @@ A \l{StateType} has following parameters:
|
||||
"type": "DataType",
|
||||
"defaultValue": "The state will be initialized with this value."
|
||||
"o:cached": "bool",
|
||||
"o:ruleRelevant": "bool",
|
||||
"o:eventRuleRelevant": "bool",
|
||||
"o:graphRelevant": "bool",
|
||||
"o:unit": "The unit of the state value.",
|
||||
"o:minValue": "Numeric minimum value for this state.",
|
||||
"o:maxValue": "Numeric maximum value for this state.",
|
||||
@ -492,23 +489,6 @@ A \l{StateType} has following parameters:
|
||||
\li Indicates if a state value should be cached over reboot of the server. The value will be initialized with the last known value.
|
||||
By default all states get chached. If you want to disable that behaviour you can set this property to \tt{false}. In that case the
|
||||
value will be initialized with the default value of the State.
|
||||
\row
|
||||
\li \tt ruleRelevant
|
||||
\li \b O
|
||||
\li bool
|
||||
\li Since not all \l{State}{States} make sense for the user in a rule, with this flag can be specified if this state should be visible
|
||||
in the rule engine for the user or not. This flag has no effect to the ruleengine mechanism and is only ment to filter out not
|
||||
interesting \l{State}{States}. By default, every state is rule relevant.
|
||||
\row
|
||||
\li \tt eventRuleRelevant
|
||||
\li \b O
|
||||
\li bool
|
||||
\li Deprecated: please use \l{Interfaces for DeviceClasses}{interfaces} instead.
|
||||
\row
|
||||
\li \tt graphRelevant
|
||||
\li \b O
|
||||
\li bool
|
||||
\li Deprecated: please use \l{Interfaces for DeviceClasses}{interfaces} instead.
|
||||
\row
|
||||
\li \tt unit
|
||||
\li \b O
|
||||
@ -665,8 +645,6 @@ A \l{StateType} has following parameters:
|
||||
"id": "uuid",
|
||||
"name": "eventName",
|
||||
"displayName": "Name of the event (translatable)",
|
||||
"o:ruleRelevant": "bool",
|
||||
"o:graphRelevant": "bool",
|
||||
"o:paramTypes": [
|
||||
...
|
||||
]
|
||||
@ -700,18 +678,6 @@ A \l{StateType} has following parameters:
|
||||
\li A list of \l{ParamType}{ParamTypes} which define the parameters of this event \unicode{0x2192} \l{EventType::paramTypes()}.
|
||||
|
||||
\b{See also:} \l{The ParamType definition}"
|
||||
\row
|
||||
\li \tt ruleRelevant
|
||||
\li \b O
|
||||
\li bool
|
||||
\li Since not all \l{Event}{Events} make sense for the user in a rule, with this flag can be specidied if this event should be visible in the rule engine
|
||||
for the user or not. This flag has no effect to the ruleengine mechanism and is only ment to filter out not interesting \l{Event}{Events}. By default,
|
||||
every event is rule relevant.
|
||||
\row
|
||||
\li \tt graphRelevant
|
||||
\li \b O
|
||||
\li bool
|
||||
\li Deprecated: please use \l{Interfaces for DeviceClasses}{interfaces} instead.
|
||||
\endtable
|
||||
|
||||
*/
|
||||
|
||||
@ -199,8 +199,6 @@ void JsonTypes::init()
|
||||
s_stateType.insert("index", basicTypeToString(Int));
|
||||
s_stateType.insert("defaultValue", basicTypeToString(Variant));
|
||||
s_stateType.insert("o:unit", unitRef());
|
||||
s_stateType.insert("o:ruleRelevant", basicTypeToString(Bool));
|
||||
s_stateType.insert("o:graphRelevant", basicTypeToString(Bool));
|
||||
s_stateType.insert("o:minValue", basicTypeToString(Variant));
|
||||
s_stateType.insert("o:maxValue", basicTypeToString(Variant));
|
||||
s_stateType.insert("o:possibleValues", QVariantList() << basicTypeToString(Variant));
|
||||
@ -229,8 +227,6 @@ void JsonTypes::init()
|
||||
s_eventType.insert("displayName", basicTypeToString(String));
|
||||
s_eventType.insert("index", basicTypeToString(Int));
|
||||
s_eventType.insert("paramTypes", QVariantList() << paramTypeRef());
|
||||
s_eventType.insert("o:ruleRelevant", basicTypeToString(Bool));
|
||||
s_eventType.insert("o:graphRelevant", basicTypeToString(Bool));
|
||||
|
||||
// Event
|
||||
s_event.insert("eventTypeId", basicTypeToString(Uuid));
|
||||
@ -496,11 +492,6 @@ QVariantMap JsonTypes::packEventType(const EventType &eventType, const PluginId
|
||||
variant.insert("name", eventType.name());
|
||||
variant.insert("displayName", NymeaCore::instance()->deviceManager()->translator()->translate(pluginId, eventType.displayName(), locale));
|
||||
variant.insert("index", eventType.index());
|
||||
if (!eventType.ruleRelevant())
|
||||
variant.insert("ruleRelevant", false);
|
||||
|
||||
if (eventType.graphRelevant())
|
||||
variant.insert("graphRelevant", true);
|
||||
|
||||
QVariantList paramTypes;
|
||||
foreach (const ParamType ¶mType, eventType.paramTypes())
|
||||
@ -631,12 +622,6 @@ QVariantMap JsonTypes::packStateType(const StateType &stateType, const PluginId
|
||||
variantMap.insert("type", basicTypeToString(stateType.type()));
|
||||
variantMap.insert("defaultValue", stateType.defaultValue());
|
||||
|
||||
if (!stateType.ruleRelevant())
|
||||
variantMap.insert("ruleRelevant", false);
|
||||
|
||||
if (stateType.graphRelevant())
|
||||
variantMap.insert("graphRelevant", true);
|
||||
|
||||
if (stateType.maxValue().isValid())
|
||||
variantMap.insert("maxValue", stateType.maxValue());
|
||||
|
||||
|
||||
@ -698,12 +698,6 @@ void DevicePlugin::loadMetaData()
|
||||
if (st.contains("maxValue"))
|
||||
stateType.setMaxValue(st.value("maxValue").toVariant());
|
||||
|
||||
if (st.contains("ruleRelevant"))
|
||||
stateType.setRuleRelevant(st.value("ruleRelevant").toBool());
|
||||
|
||||
if (st.contains("graphRelevant"))
|
||||
stateType.setGraphRelevant(st.value("graphRelevant").toBool());
|
||||
|
||||
if (st.contains("possibleValues")) {
|
||||
QVariantList possibleValues;
|
||||
foreach (const QJsonValue &possibleValueJson, st.value("possibleValues").toArray()) {
|
||||
@ -726,9 +720,6 @@ void DevicePlugin::loadMetaData()
|
||||
|
||||
// Events for state changed
|
||||
EventType eventType(EventTypeId(stateType.id().toString()));
|
||||
if (st.contains("eventRuleRelevant"))
|
||||
eventType.setRuleRelevant(st.value("eventRuleRelevant").toBool());
|
||||
|
||||
eventType.setName(st.value("name").toString());
|
||||
eventType.setDisplayName(st.value("displayNameEvent").toString());
|
||||
ParamType paramType(ParamTypeId(stateType.id().toString()), st.value("name").toString(), stateType.type());
|
||||
@ -816,11 +807,6 @@ void DevicePlugin::loadMetaData()
|
||||
eventType.setName(et.value("name").toString());
|
||||
eventType.setDisplayName(et.value("displayName").toString());
|
||||
eventType.setIndex(index++);
|
||||
if (et.contains("ruleRelevant"))
|
||||
eventType.setRuleRelevant(et.value("ruleRelevant").toBool());
|
||||
|
||||
if (et.contains("graphRelevant"))
|
||||
eventType.setGraphRelevant(et.value("graphRelevant").toBool());
|
||||
|
||||
QPair<bool, QList<ParamType> > paramVerification = parseParamTypes(et.value("paramTypes").toArray());
|
||||
if (!paramVerification.first) {
|
||||
|
||||
@ -36,9 +36,7 @@
|
||||
/*! Constructs a EventType object with the given \a id. */
|
||||
EventType::EventType(const EventTypeId &id):
|
||||
m_id(id),
|
||||
m_index(0),
|
||||
m_ruleRelevant(true),
|
||||
m_graphRelevant(false)
|
||||
m_index(0)
|
||||
{
|
||||
|
||||
}
|
||||
@ -100,30 +98,6 @@ void EventType::setParamTypes(const ParamTypes ¶mTypes)
|
||||
m_paramTypes = paramTypes;
|
||||
}
|
||||
|
||||
/*! Returns true if this EventType is relevant for the rule from a user perspective. */
|
||||
bool EventType::ruleRelevant() const
|
||||
{
|
||||
return m_ruleRelevant;
|
||||
}
|
||||
|
||||
/*! Sets this EventType relevant for the rule from a user perspective to \a ruleRelevant. */
|
||||
void EventType::setRuleRelevant(const bool &ruleRelevant)
|
||||
{
|
||||
m_ruleRelevant = ruleRelevant;
|
||||
}
|
||||
|
||||
/*! Returns true if this EventType is interesting to visualize the logs in a graph/chart from a user perspective. */
|
||||
bool EventType::graphRelevant() const
|
||||
{
|
||||
return m_graphRelevant;
|
||||
}
|
||||
|
||||
/*! Sets this EventType \a graphRelevant to inform the client application if this \l{EventType} is interesting to visualize the logs in a graph/chart. */
|
||||
void EventType::setGraphRelevant(const bool &graphRelevant)
|
||||
{
|
||||
m_graphRelevant = graphRelevant;
|
||||
}
|
||||
|
||||
/*! Returns true if this EventType has a valid id and name */
|
||||
bool EventType::isValid() const
|
||||
{
|
||||
@ -133,7 +107,7 @@ bool EventType::isValid() const
|
||||
/*! Returns a list of all valid JSON properties a EventType JSON definition can have. */
|
||||
QStringList EventType::typeProperties()
|
||||
{
|
||||
return QStringList() << "id" << "name" << "displayName" << "paramTypes" << "ruleRelevant" << "graphRelevant";
|
||||
return QStringList() << "id" << "name" << "displayName" << "paramTypes";
|
||||
}
|
||||
|
||||
/*! Returns a list of mandatory JSON properties a EventType JSON definition must have. */
|
||||
|
||||
@ -49,12 +49,6 @@ public:
|
||||
ParamTypes paramTypes() const;
|
||||
void setParamTypes(const ParamTypes ¶mTypes);
|
||||
|
||||
bool ruleRelevant() const;
|
||||
void setRuleRelevant(const bool &ruleRelevant);
|
||||
|
||||
bool graphRelevant() const;
|
||||
void setGraphRelevant(const bool &graphRelevant);
|
||||
|
||||
bool isValid() const;
|
||||
|
||||
static QStringList typeProperties();
|
||||
@ -66,8 +60,6 @@ private:
|
||||
QString m_displayName;
|
||||
int m_index;
|
||||
QList<ParamType> m_paramTypes;
|
||||
bool m_ruleRelevant;
|
||||
bool m_graphRelevant;
|
||||
};
|
||||
|
||||
class EventTypes: public QList<EventType>
|
||||
|
||||
@ -160,30 +160,6 @@ void StateType::setUnit(const Types::Unit &unit)
|
||||
m_unit = unit;
|
||||
}
|
||||
|
||||
/*! Returns true if this StateType is relevant for the rule from a user perspective. */
|
||||
bool StateType::ruleRelevant() const
|
||||
{
|
||||
return m_ruleRelevant;
|
||||
}
|
||||
|
||||
/*! Sets this StateType relevant for the rule from a user perspective to \a ruleRelevant. */
|
||||
void StateType::setRuleRelevant(const bool &ruleRelevant)
|
||||
{
|
||||
m_ruleRelevant = ruleRelevant;
|
||||
}
|
||||
|
||||
/*! Returns true if this StateType is interesting to visualize the logs in a graph/chart from a user perspective. */
|
||||
bool StateType::graphRelevant() const
|
||||
{
|
||||
return m_graphRelevant;
|
||||
}
|
||||
|
||||
/*! Sets this StateType \a graphRelevant to inform the client application if this \l{StateType} is interesting to visualize the logs in a graph/chart. */
|
||||
void StateType::setGraphRelevant(const bool &graphRelevant)
|
||||
{
|
||||
m_graphRelevant = graphRelevant;
|
||||
}
|
||||
|
||||
/*! Returns true if this StateType is to be cached. This means, the last state value will be stored to disk upon shutdown and restored on reboot. If this is false, states will be initialized with the default value on each boot. By default all states are cached by the system. */
|
||||
bool StateType::cached() const
|
||||
{
|
||||
@ -200,8 +176,8 @@ void StateType::setCached(bool cached)
|
||||
QStringList StateType::typeProperties()
|
||||
{
|
||||
return QStringList() << "id" << "name" << "displayName" << "displayNameEvent" << "type" << "defaultValue"
|
||||
<< "cached" << "ruleRelevant" << "eventRuleRelevant" << "graphRelevant" << "unit"
|
||||
<< "minValue" << "maxValue" << "possibleValues" << "writable" << "displayNameAction";
|
||||
<< "cached" << "unit" << "minValue" << "maxValue" << "possibleValues" << "writable"
|
||||
<< "displayNameAction";
|
||||
}
|
||||
|
||||
/*! Returns a list of mandatory properties a DeviceClass definition must have. */
|
||||
|
||||
@ -64,12 +64,6 @@ public:
|
||||
Types::Unit unit() const;
|
||||
void setUnit(const Types::Unit &unit);
|
||||
|
||||
bool ruleRelevant() const;
|
||||
void setRuleRelevant(const bool &ruleRelevant);
|
||||
|
||||
bool graphRelevant() const;
|
||||
void setGraphRelevant(const bool &graphRelevant);
|
||||
|
||||
bool cached() const;
|
||||
void setCached(bool cached);
|
||||
|
||||
@ -87,8 +81,6 @@ private:
|
||||
QVariant m_maxValue;
|
||||
QVariantList m_possibleValues;
|
||||
Types::Unit m_unit = Types::UnitNone;
|
||||
bool m_ruleRelevant = true;
|
||||
bool m_graphRelevant = false;
|
||||
bool m_cached = true;
|
||||
};
|
||||
|
||||
|
||||
@ -72,7 +72,6 @@
|
||||
"displayName": "Dummy int state",
|
||||
"displayNameEvent": "Dummy int state changed",
|
||||
"defaultValue": 10,
|
||||
"graphRelevant": true,
|
||||
"type": "int"
|
||||
},
|
||||
{
|
||||
@ -128,8 +127,7 @@
|
||||
{
|
||||
"id": "45bf3752-0fc6-46b9-89fd-ffd878b5b22b",
|
||||
"name": "mockEvent1",
|
||||
"displayName": "Mock Event 1",
|
||||
"graphRelevant": true
|
||||
"displayName": "Mock Event 1"
|
||||
},
|
||||
{
|
||||
"id": "863d5920-b1cf-4eb9-88bd-8f7b8583b1cf",
|
||||
@ -224,7 +222,6 @@
|
||||
"displayName": "Dummy int state",
|
||||
"displayNameEvent": "Dummy int state changed",
|
||||
"defaultValue": 10,
|
||||
"graphRelevant": true,
|
||||
"type": "int"
|
||||
},
|
||||
{
|
||||
@ -328,8 +325,6 @@
|
||||
"displayNameAction": "Set color",
|
||||
"type": "QColor",
|
||||
"defaultValue": "#000000",
|
||||
"ruleRelevant": false,
|
||||
"eventRuleRelevant": false,
|
||||
"writable": true
|
||||
},
|
||||
{
|
||||
@ -341,7 +336,6 @@
|
||||
"type": "int",
|
||||
"unit": "Percentage",
|
||||
"defaultValue": 0,
|
||||
"ruleRelevant": false,
|
||||
"minValue": 0,
|
||||
"maxValue": 100,
|
||||
"writable": true
|
||||
@ -431,8 +425,6 @@
|
||||
"displayNameAction": "Set color",
|
||||
"type": "QColor",
|
||||
"defaultValue": "#000000",
|
||||
"ruleRelevant": false,
|
||||
"eventRuleRelevant": false,
|
||||
"writable": true
|
||||
},
|
||||
{
|
||||
@ -444,7 +436,6 @@
|
||||
"type": "int",
|
||||
"unit": "Percentage",
|
||||
"defaultValue": 0,
|
||||
"ruleRelevant": false,
|
||||
"minValue": 0,
|
||||
"maxValue": 100,
|
||||
"writable": true
|
||||
|
||||
Reference in New Issue
Block a user