clean up debug outputs
This commit is contained in:
parent
434f1599a1
commit
1766cec6b6
@ -492,24 +492,24 @@ QList<DeviceClass> DevicePlugin::supportedDevices() const
|
|||||||
StateType stateType = stateTypes.findByName(stateVariant.toMap().value("name").toString());
|
StateType stateType = stateTypes.findByName(stateVariant.toMap().value("name").toString());
|
||||||
QVariantMap stateMap = stateVariant.toMap();
|
QVariantMap stateMap = stateVariant.toMap();
|
||||||
if (stateType.id().isNull()) {
|
if (stateType.id().isNull()) {
|
||||||
//qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but doesn't implement state" << stateMap.value("name").toString();
|
qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but doesn't implement state" << stateMap.value("name").toString();
|
||||||
valid = false;
|
valid = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (QVariant::nameToType(stateMap.value("type").toByteArray().data()) != stateType.type()) {
|
if (QVariant::nameToType(stateMap.value("type").toByteArray().data()) != stateType.type()) {
|
||||||
//qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "has not matching type" << stateMap.value("type").toString();
|
qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "has not matching type" << stateMap.value("type").toString();
|
||||||
valid = false;
|
valid = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (stateMap.contains("minimumValue")) {
|
if (stateMap.contains("minimumValue")) {
|
||||||
if (stateMap.value("minimumValue").toString() == "any") {
|
if (stateMap.value("minimumValue").toString() == "any") {
|
||||||
if (stateType.minValue().isNull()) {
|
if (stateType.minValue().isNull()) {
|
||||||
//qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "has no minimum value defined.";
|
qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "has no minimum value defined.";
|
||||||
valid = false;
|
valid = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else if (stateMap.value("minimumValue") != stateType.minValue()) {
|
} else if (stateMap.value("minimumValue") != stateType.minValue()) {
|
||||||
//qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "has not matching minimum value:" << stateMap.value("minimumValue") << "!=" << stateType.minValue();
|
qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "has not matching minimum value:" << stateMap.value("minimumValue") << "!=" << stateType.minValue();
|
||||||
valid = false;
|
valid = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -517,23 +517,23 @@ QList<DeviceClass> DevicePlugin::supportedDevices() const
|
|||||||
if (stateMap.contains("maximumValue")) {
|
if (stateMap.contains("maximumValue")) {
|
||||||
if (stateMap.value("maximumValue").toString() == "any") {
|
if (stateMap.value("maximumValue").toString() == "any") {
|
||||||
if (stateType.maxValue().isNull()) {
|
if (stateType.maxValue().isNull()) {
|
||||||
//qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "has no maximum value defined.";
|
qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "has no maximum value defined.";
|
||||||
valid = false;
|
valid = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else if (stateMap.value("maximumValue") != stateType.maxValue()) {
|
} else if (stateMap.value("maximumValue") != stateType.maxValue()) {
|
||||||
//qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "has not matching maximum value:" << stateMap.value("maximumValue") << "!=" << stateType.minValue();
|
qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "has not matching maximum value:" << stateMap.value("maximumValue") << "!=" << stateType.minValue();
|
||||||
valid = false;
|
valid = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (stateMap.contains("allowedValues") && stateMap.value("allowedValues") != stateType.possibleValues()) {
|
if (stateMap.contains("allowedValues") && stateMap.value("allowedValues") != stateType.possibleValues()) {
|
||||||
//qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "has not matching allowed values" << stateMap.value("allowedValues") << "!=" << stateType.possibleValues();
|
qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "has not matching allowed values" << stateMap.value("allowedValues") << "!=" << stateType.possibleValues();
|
||||||
valid = false;
|
valid = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (stateMap.contains("writable") && stateMap.value("writable").toBool() && actionTypes.findById(ActionTypeId(stateType.id().toString())).id().isNull()) {
|
if (stateMap.contains("writable") && stateMap.value("writable").toBool() && actionTypes.findById(ActionTypeId(stateType.id().toString())).id().isNull()) {
|
||||||
//qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "is not writable while it should be";
|
qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but state" << stateMap.value("name").toString() << "is not writable while it should be";
|
||||||
valid = false;
|
valid = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -543,14 +543,14 @@ QList<DeviceClass> DevicePlugin::supportedDevices() const
|
|||||||
QVariantMap actionMap = actionVariant.toMap();
|
QVariantMap actionMap = actionVariant.toMap();
|
||||||
ActionType actionType = actionTypes.findByName(actionMap.value("name").toString());
|
ActionType actionType = actionTypes.findByName(actionMap.value("name").toString());
|
||||||
if (actionType.id().isNull()) {
|
if (actionType.id().isNull()) {
|
||||||
//qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but doesn't implement action" << actionMap.value("name").toString();
|
qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but doesn't implement action" << actionMap.value("name").toString();
|
||||||
valid = false;
|
valid = false;
|
||||||
}
|
}
|
||||||
QVariantList params = actionMap.value("params").toList();
|
QVariantList params = actionMap.value("params").toList();
|
||||||
foreach (const QVariant ¶mVariant, params) {
|
foreach (const QVariant ¶mVariant, params) {
|
||||||
ParamType paramType = actionType.paramTypes().findByName(paramVariant.toMap().value("name").toString());
|
ParamType paramType = actionType.paramTypes().findByName(paramVariant.toMap().value("name").toString());
|
||||||
if (!paramType.isValid()) {
|
if (!paramType.isValid()) {
|
||||||
//qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but doesn't implement action param" << actionMap.value("name").toString() << ":" << paramVariant.toMap().value("name").toString();
|
qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but doesn't implement action param" << actionMap.value("name").toString() << ":" << paramVariant.toMap().value("name").toString();
|
||||||
valid = false;
|
valid = false;
|
||||||
} else {
|
} else {
|
||||||
if (paramType.type() != QVariant::nameToType(paramVariant.toMap().value("type").toString().toLatin1())) {
|
if (paramType.type() != QVariant::nameToType(paramVariant.toMap().value("type").toString().toLatin1())) {
|
||||||
@ -565,18 +565,18 @@ QList<DeviceClass> DevicePlugin::supportedDevices() const
|
|||||||
QVariantMap eventMap = eventVariant.toMap();
|
QVariantMap eventMap = eventVariant.toMap();
|
||||||
EventType eventType = eventTypes.findByName(eventMap.value("name").toString());
|
EventType eventType = eventTypes.findByName(eventMap.value("name").toString());
|
||||||
if (eventType.isValid()) {
|
if (eventType.isValid()) {
|
||||||
//qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but doesn't implement event" << eventMap.value("name").toString();
|
qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but doesn't implement event" << eventMap.value("name").toString();
|
||||||
valid = false;
|
valid = false;
|
||||||
}
|
}
|
||||||
QVariantList params = eventMap.value("params").toList();
|
QVariantList params = eventMap.value("params").toList();
|
||||||
foreach (const QVariant ¶mVariant, params) {
|
foreach (const QVariant ¶mVariant, params) {
|
||||||
ParamType paramType = eventType.paramTypes().findByName(paramVariant.toMap().value("name").toString());
|
ParamType paramType = eventType.paramTypes().findByName(paramVariant.toMap().value("name").toString());
|
||||||
if (!paramType.isValid()) {
|
if (!paramType.isValid()) {
|
||||||
//qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but doesn't implement action param" << eventMap.value("name").toString() << ":" << paramVariant.toMap().value("name").toString();
|
qCWarning(dcDeviceManager) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but doesn't implement action param" << eventMap.value("name").toString() << ":" << paramVariant.toMap().value("name").toString();
|
||||||
valid = false;
|
valid = false;
|
||||||
} else {
|
} else {
|
||||||
if (paramType.type() != QVariant::nameToType(paramVariant.toMap().value("type").toString().toLatin1())) {
|
if (paramType.type() != QVariant::nameToType(paramVariant.toMap().value("type").toString().toLatin1())) {
|
||||||
//qCWarning(dcDeviceManager()) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but param" << paramType.name() << "is of wrong type:" << QVariant::typeToName(paramType.type()) << "expected:" << paramVariant.toMap().value("type").toString();
|
qCWarning(dcDeviceManager()) << "DeviceClass" << deviceClass.name() << "claims to implement interface" << value.toString() << "but param" << paramType.name() << "is of wrong type:" << QVariant::typeToName(paramType.type()) << "expected:" << paramVariant.toMap().value("type").toString();
|
||||||
valid = false;
|
valid = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,3 +20,4 @@ SUBDIRS = versioning \
|
|||||||
#coap \ # temporary removed until fixed
|
#coap \ # temporary removed until fixed
|
||||||
configurations \
|
configurations \
|
||||||
timemanager \
|
timemanager \
|
||||||
|
settings \
|
||||||
|
|||||||
@ -61,9 +61,6 @@ private slots:
|
|||||||
void emptyRule();
|
void emptyRule();
|
||||||
void getInvalidRule();
|
void getInvalidRule();
|
||||||
|
|
||||||
void testChildEvaluator_data();
|
|
||||||
void testChildEvaluator();
|
|
||||||
|
|
||||||
void addRemoveRules_data();
|
void addRemoveRules_data();
|
||||||
void addRemoveRules();
|
void addRemoveRules();
|
||||||
|
|
||||||
@ -87,6 +84,9 @@ private slots:
|
|||||||
void testStateEvaluator2_data();
|
void testStateEvaluator2_data();
|
||||||
void testStateEvaluator2();
|
void testStateEvaluator2();
|
||||||
|
|
||||||
|
void testChildEvaluator_data();
|
||||||
|
void testChildEvaluator();
|
||||||
|
|
||||||
void testStateChange();
|
void testStateChange();
|
||||||
|
|
||||||
void enableDisableRule();
|
void enableDisableRule();
|
||||||
|
|||||||
Reference in New Issue
Block a user