Don't show a positive currentPower for producers in thing page
This commit is contained in:
parent
e86d06f862
commit
f126da61e8
@ -63,9 +63,11 @@ ThingPageBase {
|
|||||||
|
|
||||||
property bool isProduction: currentPowerState.value < 0
|
property bool isProduction: currentPowerState.value < 0
|
||||||
property bool isConsumption: currentPowerState.value > 0
|
property bool isConsumption: currentPowerState.value > 0
|
||||||
property double absValue: Math.abs(currentPowerState.value)
|
property double normalizedValue: isProducer
|
||||||
property double cleanVale: (absValue / (absValue > 1000 ? 1000 : 1)).toFixed(1)
|
? Math.max(0, -currentPowerState.value)
|
||||||
property string unit: absValue > 1000 ? "kW" : "W"
|
: Math.abs(currentPowerState.value)
|
||||||
|
property double cleanValue: (normalizedValue / (normalizedValue > 1000 ? 1000 : 1)).toFixed(1)
|
||||||
|
property string unit: normalizedValue > 1000 ? "kW" : "W"
|
||||||
|
|
||||||
readonly property bool isCharging: root.chargingState && root.chargingState.value === "charging"
|
readonly property bool isCharging: root.chargingState && root.chargingState.value === "charging"
|
||||||
readonly property bool isDischarging: root.chargingState && root.chargingState.value === "discharging"
|
readonly property bool isDischarging: root.chargingState && root.chargingState.value === "discharging"
|
||||||
@ -159,7 +161,7 @@ ThingPageBase {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
font: Style.largeFont
|
font: Style.largeFont
|
||||||
text: "%1 %2".arg(root.cleanVale).arg(root.unit)
|
text: "%1 %2".arg(root.cleanValue).arg(root.unit)
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
@ -177,7 +179,7 @@ ThingPageBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (root.isProducer) {
|
if (root.isProducer) {
|
||||||
return qsTr("Producing")
|
return root.currentPowerState.value < 0 ? qsTr("Producing") : qsTr("Idle")
|
||||||
}
|
}
|
||||||
if (root.isConsumer) {
|
if (root.isConsumer) {
|
||||||
return qsTr("Consuming")
|
return qsTr("Consuming")
|
||||||
|
|||||||
@ -118,7 +118,7 @@ MainViewBase {
|
|||||||
energyManager: energyManager
|
energyManager: energyManager
|
||||||
visible: rootMeter != null || producers.count > 0
|
visible: rootMeter != null || producers.count > 0
|
||||||
animationsEnabled: Qt.application.active && root.isCurrentItem && flickable.contentY < height
|
animationsEnabled: Qt.application.active && root.isCurrentItem && flickable.contentY < height
|
||||||
onAnimationsEnabledChanged: print("animations for power balance chart", animationsEnabled ? "enabled" : "disabled")
|
// onAnimationsEnabledChanged: print("animations for power balance chart", animationsEnabled ? "enabled" : "disabled")
|
||||||
}
|
}
|
||||||
|
|
||||||
PowerBalanceHistory {
|
PowerBalanceHistory {
|
||||||
|
|||||||
Reference in New Issue
Block a user