diff --git a/FileSets/VersionIndependent/DetailBattery.qml b/FileSets/VersionIndependent/DetailBattery.qml index b54beb35..3fa79202 100644 --- a/FileSets/VersionIndependent/DetailBattery.qml +++ b/FileSets/VersionIndependent/DetailBattery.qml @@ -41,11 +41,13 @@ MbPage property string batteryService: batteryServiceItem.valid ? batteryServiceItem.value : "" VBusItem { id: capacityItem; bind: Utils.path(batteryService,"/Capacity") } - VBusItem { id: installedCapacityItem; bind: Utils.path(batteryService, "/InstalledCapacity") } - property real capacity: capacityItem.valid ? capacityItem.value : ( installedCapacityItem.valid ? installedCapacityItem.value : 0 ) VBusItem { id: consumedItem; bind: Utils.path(systemPrefix,"/Dc/Battery/ConsumedAmphours") } - property bool showCapacity: capacity != 0 - property bool showAhRemaining: showCapacity && consumedItem.valid + property real consumed: capacityItem.valid ? capacityItem.value : ( consumedItem.valid ? consumedItem.value : undefined ) + property bool showConsumed: consumed != undefined + + VBusItem { id: installedCapacityItem; bind: Utils.path(batteryService, "/InstalledCapacity") } + property bool showRemaining: showConsumed && installedCapacityItem.valid + property real remaining: installedCapacityItem.value - consumed VBusItem { id: minimumCellVoltageItem; bind: Utils.path(batteryService, "/System/MinCellVoltage") } VBusItem { id: maximumCellVoltageItem; bind: Utils.path(batteryService, "/System/MaxCellVoltage") } @@ -122,16 +124,16 @@ MbPage { Text { font.pixelSize: 12; font.bold: true; color: "black" width: rowTitleWidth; horizontalAlignment: Text.AlignRight - text: showCapacity ? qsTr ("Consumed") : ""} + text: showConsumed ? qsTr ("Consumed") : ""} Text { font.pixelSize: 12; font.bold: true; color: "black" width: tableColumnWidth; horizontalAlignment: Text.AlignHCenter - text: showCapacity ? EnhFmt.formatValue (capacity, "AH") : "" } + text: showConsumed ? EnhFmt.formatValue (consumed, "AH") : "" } Text { font.pixelSize: 12; font.bold: true; color: "black" width: rowTitleWidth; horizontalAlignment: Text.AlignRight - text: showAhRemaining ? qsTr ("Remaining") : "" } + text: showRemaining ? qsTr ("Remaining") : "" } Text { font.pixelSize: 12; font.bold: true; color: "black" width: tableColumnWidth; horizontalAlignment: Text.AlignHCenter; - text: showAhRemaining ? EnhFmt.formatValue (capacity - consumedItem.value, "AH") : "" + text: showRemaining ? EnhFmt.formatValue (remaining, "AH") : "" } } diff --git a/changes b/changes index c866472b..e39a20c4 100644 --- a/changes +++ b/changes @@ -1,3 +1,6 @@ +v10.61: + another cut at battery detail consumed remaining + v10.60: fixed (maybe): battery detail not showing consumed and remaining with some batteries diff --git a/version b/version index a6d774f6..4c825bd7 100644 --- a/version +++ b/version @@ -1 +1 @@ -v10.60 +v10.61