Fix eventdescriptor params in edit rule page
This commit is contained in:
parent
bef59fbdd7
commit
3d9e0904da
@ -54,7 +54,7 @@ EventType *EventTypes::getEventType(const QUuid &eventTypeId) const
|
|||||||
return eventType;
|
return eventType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EventTypes::rowCount(const QModelIndex &parent) const
|
int EventTypes::rowCount(const QModelIndex &parent) const
|
||||||
|
|||||||
@ -81,9 +81,9 @@ NymeaSwipeDelegate {
|
|||||||
operatorString = " ? ";
|
operatorString = " ? ";
|
||||||
}
|
}
|
||||||
|
|
||||||
var paramType = paramDescriptor.paramTypeId
|
var paramType = paramDescriptor.paramName
|
||||||
? root.eventType.paramTypes.getParamType(paramDescriptor.paramTypeId)
|
? root.eventType.paramTypes.findByName(paramDescriptor.paramName)
|
||||||
: root.eventType.paramTypes.findByName(paramDescriptor.paramName)
|
: root.eventType.paramTypes.getParamType(paramDescriptor.paramTypeId)
|
||||||
|
|
||||||
if (i === 0) {
|
if (i === 0) {
|
||||||
// TRANSLATORS: example: "only if temperature > 5"
|
// TRANSLATORS: example: "only if temperature > 5"
|
||||||
|
|||||||
@ -391,6 +391,7 @@ Page {
|
|||||||
// has the template a value for this? If so, set it, otherwise flag as needsParams
|
// has the template a value for this? If so, set it, otherwise flag as needsParams
|
||||||
print("template:", paramType.id, eventDescriptorTemplate.paramDescriptors.count)
|
print("template:", paramType.id, eventDescriptorTemplate.paramDescriptors.count)
|
||||||
if (paramDescriptorTemplate && paramDescriptorTemplate.value !== undefined) {
|
if (paramDescriptorTemplate && paramDescriptorTemplate.value !== undefined) {
|
||||||
|
print("filling in param descriptor:", paramDescriptorTemplate.value)
|
||||||
eventDescriptor.paramDescriptors.setParamDescriptorByName(paramDescriptorTemplate.paramName, paramDescriptorTemplate.value, paramDescriptorTemplate.operatorType);
|
eventDescriptor.paramDescriptors.setParamDescriptorByName(paramDescriptorTemplate.paramName, paramDescriptorTemplate.value, paramDescriptorTemplate.operatorType);
|
||||||
} else {
|
} else {
|
||||||
needsParams = true;
|
needsParams = true;
|
||||||
|
|||||||
@ -94,6 +94,7 @@ Page {
|
|||||||
for (var i = 0; i < delegateRepeater.count; i++) {
|
for (var i = 0; i < delegateRepeater.count; i++) {
|
||||||
var paramDelegate = delegateRepeater.itemAt(i);
|
var paramDelegate = delegateRepeater.itemAt(i);
|
||||||
if (paramDelegate.considerParam) {
|
if (paramDelegate.considerParam) {
|
||||||
|
print("adding param descriptor")
|
||||||
if (root.device) {
|
if (root.device) {
|
||||||
root.eventDescriptor.paramDescriptors.setParamDescriptor(paramDelegate.paramType.id, paramDelegate.value, paramDelegate.operatorType)
|
root.eventDescriptor.paramDescriptors.setParamDescriptor(paramDelegate.paramType.id, paramDelegate.value, paramDelegate.operatorType)
|
||||||
} else if (root.iface) {
|
} else if (root.iface) {
|
||||||
|
|||||||
Reference in New Issue
Block a user