Skip to content

Commit

Permalink
fixed (maybe): battery detail not showing consumed and remaining with…
Browse files Browse the repository at this point in the history
… some batteries
  • Loading branch information
kwindrem committed Jul 29, 2024
1 parent 444e54e commit 24855ef
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
17 changes: 11 additions & 6 deletions FileSets/VersionIndependent/DetailBattery.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ MbPage
property real essDimOpacity: 0.2

VBusItem { id: timeToGo; bind: Utils.path(systemPrefix,"/Dc/Battery/TimeToGo") }
VBusItem { id: consumedAh; bind: Utils.path(systemPrefix,"/Dc/Battery/ConsumedAmphours") }

VBusItem { id: systemType; bind: Utils.path(systemPrefix, "/SystemType") }
VBusItem { id: lowSoc; bind: Utils.path(systemPrefix, "/SystemState/LowSoc") }
Expand All @@ -40,8 +39,14 @@ MbPage
VBusItem { id: batteryServiceItem; bind: Utils.path(systemPrefix, "/Dc/Battery/BatteryService") }

property string batteryService: batteryServiceItem.valid ? batteryServiceItem.value : ""
VBusItem { id: batteryCapacityItem; bind: Utils.path(batteryService, "/InstalledCapacity") }
property bool showAhRemaining: batteryCapacityItem.valid

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

VBusItem { id: minimumCellVoltageItem; bind: Utils.path(batteryService, "/System/MinCellVoltage") }
VBusItem { id: maximumCellVoltageItem; bind: Utils.path(batteryService, "/System/MaxCellVoltage") }
property bool showCellVoltages: minimumCellVoltageItem.valid && maximumCellVoltageItem.valid
Expand Down Expand Up @@ -117,16 +122,16 @@ MbPage
{
Text { font.pixelSize: 12; font.bold: true; color: "black"
width: rowTitleWidth; horizontalAlignment: Text.AlignRight
text: qsTr ("Consumed") }
text: showCapacity ? qsTr ("Consumed") : ""}
Text { font.pixelSize: 12; font.bold: true; color: "black"
width: tableColumnWidth; horizontalAlignment: Text.AlignHCenter
text: EnhFmt.formatVBusItemAbs (consumedAh, "AH") }
text: showCapacity ? EnhFmt.formatValue (capacity, "AH") : "" }
Text { font.pixelSize: 12; font.bold: true; color: "black"
width: rowTitleWidth; horizontalAlignment: Text.AlignRight
text: showAhRemaining ? qsTr ("Remaining") : "" }
Text { font.pixelSize: 12; font.bold: true; color: "black"
width: tableColumnWidth; horizontalAlignment: Text.AlignHCenter;
text: showAhRemaining ? EnhFmt.formatValue (batteryCapacityItem.value - consumedAh.value, "AH") : ""
text: showAhRemaining ? EnhFmt.formatValue (capacity - consumedItem.value, "AH") : ""

}
}
Expand Down
6 changes: 6 additions & 0 deletions changes
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
v10.60:
fixed (maybe): battery detail not showing consumed and remaining with some batteries

v10.59:
add support for v3.50~5
add support for v3.50~7

v10.59:
add support for v3.50~3

10.56/10.57: (10.56 had a version of v10.5)
add support for v3.40
dropping support for firmware earlier than v3.10
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v10.59
v10.60

0 comments on commit 24855ef

Please sign in to comment.