Fix params for actions in the generic log page
This commit is contained in:
parent
3d08d722a1
commit
8168ed377e
@ -163,7 +163,7 @@ Page {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
||||||
property StateType stateType: model.source === LogEntry.LoggingSourceStates ? root.thing.thingClass.stateTypes.getStateType(model.typeId) : null
|
property StateType stateType: model.source === LogEntry.LoggingSourceStates ? root.thing.thingClass.stateTypes.getStateType(model.typeId) : null
|
||||||
property EventType eventType: model.source === LogEntry.LoggingSourceEvents || model.source === LogEntry.LoggingSourceStates ? root.thing.thingClass.eventTypes.getEventType(model.typeId) : null
|
property EventType eventType: model.source === LogEntry.LoggingSourceEvents ? root.thing.thingClass.eventTypes.getEventType(model.typeId) : null
|
||||||
property ActionType actionType: model.source === LogEntry.LoggingSourceActions ? root.thing.thingClass.actionTypes.getActionType(model.typeId) : null
|
property ActionType actionType: model.source === LogEntry.LoggingSourceActions ? root.thing.thingClass.actionTypes.getActionType(model.typeId) : null
|
||||||
|
|
||||||
contentItem: RowLayout {
|
contentItem: RowLayout {
|
||||||
@ -248,12 +248,7 @@ Page {
|
|||||||
|
|
||||||
}
|
}
|
||||||
case LogEntry.LoggingSourceActions:
|
case LogEntry.LoggingSourceActions:
|
||||||
switch (entryDelegate.stateType.type.toLowerCase()) {
|
return labelComponent;
|
||||||
case "bool":
|
|
||||||
return boolComponent;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
case LogEntry.LoggingSourceEvents:
|
case LogEntry.LoggingSourceEvents:
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -261,12 +256,54 @@ Page {
|
|||||||
|
|
||||||
return labelComponent
|
return labelComponent
|
||||||
}
|
}
|
||||||
Binding { target: valueLoader.item; property: "value"; value: entryDelegate.stateType ? Types.toUiValue(model.value, entryDelegate.stateType.unit) : model.value }
|
|
||||||
Binding {
|
Binding {
|
||||||
|
when: entryDelegate.stateType != null
|
||||||
|
target: valueLoader.item;
|
||||||
|
property: "value";
|
||||||
|
value: entryDelegate.stateType ? Types.toUiValue(model.value, entryDelegate.stateType.unit) : model.value
|
||||||
|
}
|
||||||
|
Binding {
|
||||||
|
when: entryDelegate.stateType != null
|
||||||
target: entryDelegate.stateType && valueLoader.item.hasOwnProperty("unitString") ? valueLoader.item : null;
|
target: entryDelegate.stateType && valueLoader.item.hasOwnProperty("unitString") ? valueLoader.item : null;
|
||||||
property: "unitString"
|
property: "unitString"
|
||||||
value: entryDelegate.stateType ? Types.toUiUnit(entryDelegate.stateType.unit) : ""
|
value: entryDelegate.stateType ? Types.toUiUnit(entryDelegate.stateType.unit) : ""
|
||||||
}
|
}
|
||||||
|
Binding {
|
||||||
|
when: entryDelegate.actionType != null
|
||||||
|
target: valueLoader.item;
|
||||||
|
property: "value";
|
||||||
|
value: {
|
||||||
|
if (entryDelegate.actionType == null) {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
var ret = ""
|
||||||
|
var values = model.value.split(",")
|
||||||
|
for (var i = 0; i < entryDelegate.actionType.paramTypes.count; i++) {
|
||||||
|
var paramType = entryDelegate.actionType.paramTypes.get(i)
|
||||||
|
ret += Types.toUiValue(values[i], paramType.unit) + " " + Types.toUiUnit(paramType.unit)
|
||||||
|
}
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Binding {
|
||||||
|
when: entryDelegate.eventType != null
|
||||||
|
target: valueLoader.item;
|
||||||
|
property: "value";
|
||||||
|
value: {
|
||||||
|
if (entryDelegate.eventType == null) {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
var ret = ""
|
||||||
|
var values = model.value.split(",")
|
||||||
|
for (var i = 0; i < entryDelegate.eventType.paramTypes.count; i++) {
|
||||||
|
var paramType = entryDelegate.eventType.paramTypes.get(i)
|
||||||
|
ret += Types.toUiValue(values[i], paramType.unit) + " " + Types.toUiUnit(paramType.unit)
|
||||||
|
}
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user