From 66488d80fb5eebca1f4c2725dfa442e4738da539 Mon Sep 17 00:00:00 2001 From: Manuel Date: Thu, 31 Oct 2024 09:26:55 +0100 Subject: [PATCH] Added GUIv2 to the installation process --- CHANGELOG.md | 1 + etc/dbus-serialbattery/install-qml.sh | 273 ++++-- .../qml/PageBatterySetup.qml | 133 --- .../qml/{ => gui-v1}/PageBattery.qml | 0 .../{ => gui-v1}/PageBatteryCellVoltages.qml | 0 .../{ => gui-v1}/PageBatteryParameters.qml | 0 .../qml/{ => gui-v1}/PageBatterySettings.qml | 0 .../qml/{ => gui-v1}/PageLynxIonIo.qml | 0 .../qml/gui-v2/PageBattery.qml | 532 ++++++++++++ .../qml/gui-v2/PageBatteryCells.qml | 820 ++++++++++++++++++ .../qml/gui-v2/PageBatteryParameters.qml | 129 +++ .../qml/gui-v2/PageBatterySettings.qml | 124 +++ .../qml/gui-v2/PageLynxIonIo.qml | 80 ++ etc/dbus-serialbattery/reinstall-local.sh | 8 +- etc/dbus-serialbattery/utils.py | 2 +- 15 files changed, 1891 insertions(+), 211 deletions(-) delete mode 100644 etc/dbus-serialbattery/qml/PageBatterySetup.qml rename etc/dbus-serialbattery/qml/{ => gui-v1}/PageBattery.qml (100%) rename etc/dbus-serialbattery/qml/{ => gui-v1}/PageBatteryCellVoltages.qml (100%) rename etc/dbus-serialbattery/qml/{ => gui-v1}/PageBatteryParameters.qml (100%) rename etc/dbus-serialbattery/qml/{ => gui-v1}/PageBatterySettings.qml (100%) rename etc/dbus-serialbattery/qml/{ => gui-v1}/PageLynxIonIo.qml (100%) create mode 100644 etc/dbus-serialbattery/qml/gui-v2/PageBattery.qml create mode 100644 etc/dbus-serialbattery/qml/gui-v2/PageBatteryCells.qml create mode 100644 etc/dbus-serialbattery/qml/gui-v2/PageBatteryParameters.qml create mode 100644 etc/dbus-serialbattery/qml/gui-v2/PageBatterySettings.qml create mode 100644 etc/dbus-serialbattery/qml/gui-v2/PageLynxIonIo.qml diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e631d3f..42c05700 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,7 @@ ## v1.5.x * Added: Daly BMS - Connect multiple BMS to the same RS485 port by @CaptKrisp +* Added: GUIv2 by @mr-manuel * Added: Possibility to change the CAN bus speed by @mr-manuel * Added: Threshold, if `CCL = 0` or `DCL = 0` is reached to prevent flapping @mr-manuel * Changed: Calculate Time-to-Go until ESS -> Minimum SOC (unless grid fails), Active SOC limit or `SOC_LOW_WARNING` from `config.ini` by @mr-manuel diff --git a/etc/dbus-serialbattery/install-qml.sh b/etc/dbus-serialbattery/install-qml.sh index 3f842e05..fec7c179 100755 --- a/etc/dbus-serialbattery/install-qml.sh +++ b/etc/dbus-serialbattery/install-qml.sh @@ -32,93 +32,220 @@ function versionStringToNumber () fi } -# backup old PageBattery.qml once. New firmware upgrade will remove the backup -if [ ! -f /opt/victronenergy/gui/qml/PageBattery.qml.backup ]; then - cp /opt/victronenergy/gui/qml/PageBattery.qml /opt/victronenergy/gui/qml/PageBattery.qml.backup -fi -# backup old PageBatteryParameters.qml once. New firmware upgrade will remove the backup -if [ ! -f /opt/victronenergy/gui/qml/PageBatteryParameters.qml.backup ]; then - cp /opt/victronenergy/gui/qml/PageBatteryParameters.qml /opt/victronenergy/gui/qml/PageBatteryParameters.qml.backup -fi -# backup old PageBatterySettings.qml once. New firmware upgrade will remove the backup -if [ ! -f /opt/victronenergy/gui/qml/PageBatterySettings.qml.backup ]; then - cp /opt/victronenergy/gui/qml/PageBatterySettings.qml /opt/victronenergy/gui/qml/PageBatterySettings.qml.backup -fi -# backup old PageLynxIonIo.qml once. New firmware upgrade will remove the backup -if [ ! -f /opt/victronenergy/gui/qml/PageLynxIonIo.qml.backup ]; then - cp /opt/victronenergy/gui/qml/PageLynxIonIo.qml /opt/victronenergy/gui/qml/PageLynxIonIo.qml.backup -fi # count changed files filesChanged=0 -# copy new PageBattery.qml if changed -if ! cmp -s /data/etc/dbus-serialbattery/qml/PageBattery.qml /opt/victronenergy/gui/qml/PageBattery.qml -then - cp /data/etc/dbus-serialbattery/qml/PageBattery.qml /opt/victronenergy/gui/qml/ - ((filesChanged++)) -fi -# copy new PageBatteryCellVoltages if changed -if ! cmp -s /data/etc/dbus-serialbattery/qml/PageBatteryCellVoltages.qml /opt/victronenergy/gui/qml/PageBatteryCellVoltages.qml -then - cp /data/etc/dbus-serialbattery/qml/PageBatteryCellVoltages.qml /opt/victronenergy/gui/qml/ - ((filesChanged++)) -fi +# GUI V1 +if [ -d /opt/victronenergy/gui ]; then -# copy new PageBatteryParameters.qml if changed -if ! cmp -s /data/etc/dbus-serialbattery/qml/PageBatteryParameters.qml /opt/victronenergy/gui/qml/PageBatteryParameters.qml -then - cp /data/etc/dbus-serialbattery/qml/PageBatteryParameters.qml /opt/victronenergy/gui/qml/ - ((filesChanged++)) -fi + echo "" + echo "Installing QML files for GUI V1..." -# copy new PageBatterySettings.qml if changed -if ! cmp -s /data/etc/dbus-serialbattery/qml/PageBatterySettings.qml /opt/victronenergy/gui/qml/PageBatterySettings.qml -then - cp /data/etc/dbus-serialbattery/qml/PageBatterySettings.qml /opt/victronenergy/gui/qml/ - ((filesChanged++)) -fi + # backup old PageBattery.qml once. New firmware upgrade will remove the backup + if [ ! -f /opt/victronenergy/gui/qml/PageBattery.qml.backup ]; then + cp /opt/victronenergy/gui/qml/PageBattery.qml /opt/victronenergy/gui/qml/PageBattery.qml.backup + fi + # backup old PageBatteryParameters.qml once. New firmware upgrade will remove the backup + if [ ! -f /opt/victronenergy/gui/qml/PageBatteryParameters.qml.backup ]; then + cp /opt/victronenergy/gui/qml/PageBatteryParameters.qml /opt/victronenergy/gui/qml/PageBatteryParameters.qml.backup + fi + # backup old PageBatterySettings.qml once. New firmware upgrade will remove the backup + if [ ! -f /opt/victronenergy/gui/qml/PageBatterySettings.qml.backup ]; then + cp /opt/victronenergy/gui/qml/PageBatterySettings.qml /opt/victronenergy/gui/qml/PageBatterySettings.qml.backup + fi + # backup old PageLynxIonIo.qml once. New firmware upgrade will remove the backup + if [ ! -f /opt/victronenergy/gui/qml/PageLynxIonIo.qml.backup ]; then + cp /opt/victronenergy/gui/qml/PageLynxIonIo.qml /opt/victronenergy/gui/qml/PageLynxIonIo.qml.backup + fi -# copy new PageBatterySetup if changed -if ! cmp -s /data/etc/dbus-serialbattery/qml/PageBatterySetup.qml /opt/victronenergy/gui/qml/PageBatterySetup.qml -then - cp /data/etc/dbus-serialbattery/qml/PageBatterySetup.qml /opt/victronenergy/gui/qml/ - ((filesChanged++)) -fi + # copy new PageBattery.qml if changed + if ! cmp -s /data/etc/dbus-serialbattery/qml/gui-v1/PageBattery.qml /opt/victronenergy/gui/qml/PageBattery.qml + then + cp /data/etc/dbus-serialbattery/qml/gui-v1/PageBattery.qml /opt/victronenergy/gui/qml/ + ((filesChanged++)) + fi + + # copy new PageBatteryCellVoltages if changed + if ! cmp -s /data/etc/dbus-serialbattery/qml/gui-v1/PageBatteryCellVoltages.qml /opt/victronenergy/gui/qml/PageBatteryCellVoltages.qml + then + cp /data/etc/dbus-serialbattery/qml/gui-v1/PageBatteryCellVoltages.qml /opt/victronenergy/gui/qml/ + ((filesChanged++)) + fi + + # copy new PageBatteryParameters.qml if changed + if ! cmp -s /data/etc/dbus-serialbattery/qml/gui-v1/PageBatteryParameters.qml /opt/victronenergy/gui/qml/PageBatteryParameters.qml + then + cp /data/etc/dbus-serialbattery/qml/gui-v1/PageBatteryParameters.qml /opt/victronenergy/gui/qml/ + ((filesChanged++)) + fi + + # copy new PageBatterySettings.qml if changed + if ! cmp -s /data/etc/dbus-serialbattery/qml/gui-v1/PageBatterySettings.qml /opt/victronenergy/gui/qml/PageBatterySettings.qml + then + cp /data/etc/dbus-serialbattery/qml/gui-v1/PageBatterySettings.qml /opt/victronenergy/gui/qml/ + ((filesChanged++)) + fi + + # copy new PageLynxIonIo.qml if changed + if ! cmp -s /data/etc/dbus-serialbattery/qml/gui-v1/PageLynxIonIo.qml /opt/victronenergy/gui/qml/PageLynxIonIo.qml + then + cp /data/etc/dbus-serialbattery/qml/gui-v1/PageLynxIonIo.qml /opt/victronenergy/gui/qml/ + ((filesChanged++)) + fi + + + # get current Venus OS version + versionStringToNumber $(head -n 1 /opt/victronenergy/version) + ((venusVersionNumber = $versionNumber)) + + # revert to VisualItemModel, if Venus OS older than v3.00~14 (v3.00~14 uses VisibleItemModel) + versionStringToNumber "v3.00~14" + + # change in Victron directory, else the files are "broken" if upgrading from v2 to v3 + qmlDir="/opt/victronenergy/gui/qml" + + if (( $venusVersionNumber < $versionNumber )); then + echo -n "Venus OS $(head -n 1 /opt/victronenergy/version) is older than v3.00~14. Replacing VisibleItemModel with VisualItemModel... " + fileList="$qmlDir/PageBattery.qml" + fileList+=" $qmlDir/PageBatteryCellVoltages.qml" + fileList+=" $qmlDir/PageBatteryParameters.qml" + fileList+=" $qmlDir/PageBatterySettings.qml" + fileList+=" $qmlDir/PageBatterySetup.qml" + fileList+=" $qmlDir/PageLynxIonIo.qml" + for file in $fileList ; do + sed -i -e 's/VisibleItemModel/VisualItemModel/' "$file" + done + echo "done." + fi -# copy new PageLynxIonIo.qml if changed -if ! cmp -s /data/etc/dbus-serialbattery/qml/PageLynxIonIo.qml /opt/victronenergy/gui/qml/PageLynxIonIo.qml -then - cp /data/etc/dbus-serialbattery/qml/PageLynxIonIo.qml /opt/victronenergy/gui/qml/ - ((filesChanged++)) fi -# get current Venus OS version -versionStringToNumber $(head -n 1 /opt/victronenergy/version) -((venusVersionNumber = $versionNumber)) - -# revert to VisualItemModel, if Venus OS older than v3.00~14 (v3.00~14 uses VisibleItemModel) -versionStringToNumber "v3.00~14" - -# change in Victron directory, else the files are "broken" if upgrading from v2 to v3 -qmlDir="/opt/victronenergy/gui/qml" - -if (( $venusVersionNumber < $versionNumber )); then - echo -n "Venus OS $(head -n 1 /opt/victronenergy/version) is older than v3.00~14. Replacing VisibleItemModel with VisualItemModel... " - fileList="$qmlDir/PageBattery.qml" - fileList+=" $qmlDir/PageBatteryCellVoltages.qml" - fileList+=" $qmlDir/PageBatteryParameters.qml" - fileList+=" $qmlDir/PageBatterySettings.qml" - fileList+=" $qmlDir/PageBatterySetup.qml" - fileList+=" $qmlDir/PageLynxIonIo.qml" - for file in $fileList ; do - sed -i -e 's/VisibleItemModel/VisualItemModel/' "$file" - done - echo "done." +# GUI V2 +if [ -d /opt/victronenergy/gui-v2 ]; then + + # COPY QML FILES for device screen + echo "" + echo "Installing QML files for GUI V2..." + + # backup old PageBattery.qml once. New firmware upgrade will remove the backup + if [ ! -f /opt/victronenergy/gui-v2/Victron/VenusOS/pages/settings/devicelist/battery/PageBattery.qml.backup ]; then + cp /opt/victronenergy/gui-v2/Victron/VenusOS/pages/settings/devicelist/battery/PageBattery.qml /opt/victronenergy/gui-v2/Victron/VenusOS/pages/settings/devicelist/battery/PageBattery.qml.backup + fi + # backup old PageBatteryParameters.qml once. New firmware upgrade will remove the backup + if [ ! -f /opt/victronenergy/gui-v2/Victron/VenusOS/pages/settings/devicelist/battery/PageBatteryParameters.qml.backup ]; then + cp /opt/victronenergy/gui-v2/Victron/VenusOS/pages/settings/devicelist/battery/PageBatteryParameters.qml /opt/victronenergy/gui-v2/Victron/VenusOS/pages/settings/devicelist/battery/PageBatteryParameters.qml.backup + fi + # backup old PageBatterySettings.qml once. New firmware upgrade will remove the backup + if [ ! -f /opt/victronenergy/gui-v2/Victron/VenusOS/pages/settings/devicelist/battery/PageBatterySettings.qml.backup ]; then + cp /opt/victronenergy/gui-v2/Victron/VenusOS/pages/settings/devicelist/battery/PageBatterySettings.qml /opt/victronenergy/gui-v2/Victron/VenusOS/pages/settings/devicelist/battery/PageBatterySettings.qml.backup + fi + # backup old PageLynxIonIo.qml once. New firmware upgrade will remove the backup + if [ ! -f /opt/victronenergy/gui-v2/Victron/VenusOS/pages/settings/devicelist/battery/PageLynxIonIo.qml.backup ]; then + cp /opt/victronenergy/gui-v2/Victron/VenusOS/pages/settings/devicelist/battery/PageLynxIonIo.qml /opt/victronenergy/gui-v2/Victron/VenusOS/pages/settings/devicelist/battery/PageLynxIonIo.qml.backup + fi + + # copy new PageBattery.qml if changed + if ! cmp -s /data/etc/dbus-serialbattery/qml/gui-v2/PageBattery.qml /opt/victronenergy/gui-v2/Victron/VenusOS/pages/settings/devicelist/battery/PageBattery.qml + then + cp /data/etc/dbus-serialbattery/qml/gui-v2/PageBattery.qml /opt/victronenergy/gui-v2/Victron/VenusOS/pages/settings/devicelist/battery/ + ((filesChanged++)) + fi + + # copy new PageBatteryCellVoltages if changed + if ! cmp -s /data/etc/dbus-serialbattery/qml/gui-v2/PageBatteryCellVoltages.qml /opt/victronenergy/gui-v2/Victron/VenusOS/pages/settings/devicelist/PageBatteryCellVoltages.qml + then + cp /data/etc/dbus-serialbattery/qml/gui-v2/PageBatteryCellVoltages.qml /opt/victronenergy/gui-v2/Victron/VenusOS/pages/settings/devicelist/ + ((filesChanged++)) + fi + + # copy new PageBatteryParameters.qml if changed + if ! cmp -s /data/etc/dbus-serialbattery/qml/gui-v2/PageBatteryParameters.qml /opt/victronenergy/gui-v2/Victron/VenusOS/pages/settings/devicelist/PageBatteryParameters.qml + then + cp /data/etc/dbus-serialbattery/qml/gui-v2/PageBatteryParameters.qml /opt/victronenergy/gui-v2/Victron/VenusOS/pages/settings/devicelist/ + ((filesChanged++)) + fi + + # copy new PageBatterySettings.qml if changed + if ! cmp -s /data/etc/dbus-serialbattery/qml/gui-v2/PageBatterySettings.qml /opt/victronenergy/gui-v2/Victron/VenusOS/pages/settings/devicelist/PageBatterySettings.qml + then + cp /data/etc/dbus-serialbattery/qml/gui-v2/PageBatterySettings.qml /opt/victronenergy/gui-v2/Victron/VenusOS/pages/settings/devicelist/ + ((filesChanged++)) + fi + + # copy new PageLynxIonIo.qml if changed + if ! cmp -s /data/etc/dbus-serialbattery/qml/gui-v2/PageLynxIonIo.qml /opt/victronenergy/gui-v2/Victron/VenusOS/pages/settings/devicelist/PageLynxIonIo.qml + then + cp /data/etc/dbus-serialbattery/qml/gui-v2/PageLynxIonIo.qml /opt/victronenergy/gui-v2/Victron/VenusOS/pages/settings/devicelist/ + ((filesChanged++)) + fi + + + # DOWNLOAD AND INSTALL WASM BUILD + if [ -f "/var/www/venus/gui-v2/commit-sha" ]; then + # check if latest version is already installed + hash_local=$(cat /var/www/venus/gui-v2/commit-sha) + hash_online=$(curl -s https://api.github.com/repos/mr-manuel/venus-os_dbus-serialbattery_gui-v2/commits?path=venus-webassembly.zip | grep "sha" | head -n 1 | cut -d : -f 2,3 | tr -d "\ " | tr -d \" | tr -d \,) + + if [ "$hash_local" != "$hash_online" ]; then + install_wasm=1 + else + install_wasm=0 + fi + else + install_wasm=1 + fi + + if [ $install_wasm -eq 1 ]; then + + echo "" + echo "Installing GUIv2 WASM build..." + + wget -q -O /tmp/venus-webassembly.zip https://raw.githubusercontent.com/mr-manuel/venus-os_dbus-serialbattery_gui-v2/master/venus-webassembly.zip + + # check if download was successful + if [ ! -f "/tmp/venus-webassembly.zip" ]; then + echo "** Download of GUIv2 failed! Skip installation. **" + echo "For offline installing see https://github.com/mr-manuel/venus-os_dbus-serialbattery_gui-v2" + else + + unzip -o /data/venus-os_TailscaleGX/FileSets/venus-webassembly.zip -d /tmp > /dev/null + + # remove unneeded files + if [ -f "/tmp/wasm/Makefile" ]; then + rm -f /tmp/wasm/Makefile + fi + + # add commit-sha file + echo $hash_online > /tmp/wasm/commit-sha + + # move original wasm build, if it's a folder + if [ -d "/var/www/venus/gui-v2" ] && [ ! -L "/var/www/venus/gui-v2" ]; then + mv /var/www/venus/gui-v2 /var/www/venus/gui-v2.bak + # remove if it's a symlink + elif [ -L "/var/www/venus/gui-v2" ]; then + rm -f /var/www/venus/gui-v2 + fi + mv /tmp/wasm /var/www/venus/gui-v2 + + # create missing files for VRM portal check + echo "GZip WASM build..." + cd /var/www/venus/gui-v2 || return + gzip -k venus-gui-v2.wasm + echo "Create SHA256 checksum..." + sha256sum /var/www/venus/gui-v2/venus-gui-v2.wasm > /var/www/venus/gui-v2/venus-gui-v2.wasm.sha256 + + rm -f /tmp/venus-webassembly.zip + + fi + + fi + fi + # if files changed, restart gui if [ $filesChanged -gt 0 ]; then diff --git a/etc/dbus-serialbattery/qml/PageBatterySetup.qml b/etc/dbus-serialbattery/qml/PageBatterySetup.qml deleted file mode 100644 index 4d8e8fe1..00000000 --- a/etc/dbus-serialbattery/qml/PageBatterySetup.qml +++ /dev/null @@ -1,133 +0,0 @@ -import QtQuick 1.1 -import com.victron.velib 1.0 -import "utils.js" as Utils - -MbPage { - id: root - property string bindPrefix: "com.victronenergy.settings//Settings/Devices/serialbattery/" - - property VBusItem cellVoltageMin: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/CellVoltageMin")} - property VBusItem cellVoltageMax: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/CellVoltageMax")} - property VBusItem cellVoltageFloat: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/CellVoltageFloat")} - property VBusItem voltageMaxTime: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/VoltageMaxTime")} - property VBusItem voltageResetSocLimit: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/VoltageResetSocLimit")} - property VBusItem maxCurrentCharge: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/MaxCurrentCharge")} - property VBusItem maxCurrentDischarge: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/MaxCurrentDischarge")} - property VBusItem allowDynamicChargeCurrent: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/AllowDynamicChargeCurrent")} - property VBusItem allowDynamicDischargeCurrent: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/AllowDynamicDischargeCurrent")} - property VBusItem allowDynamicChargeVoltage: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/AllowDynamicChargeVoltage")} - property VBusItem socLowWarning: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/SocLowWarning")} - property VBusItem socLowAlarm: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/SocLowAlarm")} - property VBusItem capacity: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/Capacity")} - property VBusItem enableInvertedCurrent: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/EnableInvertedCurrent")} - - property VBusItem ccmSocLimitCharge1: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/CCMSocLimitCharge1")} - property VBusItem ccmSocLimitCharge2: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/CCMSocLimitCharge2")} - property VBusItem ccmSocLimitCharge3: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/CCMSocLimitCharge3")} - property VBusItem ccmSocLimitDischarge1: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/CCMSocLimitDischarge1")} - property VBusItem ccmSocLimitDischarge2: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/CCMSocLimitDischarge2")} - property VBusItem ccmSocLimitDischarge3: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/CCMSocLimitDischarge3")} - property VBusItem ccmCurrentLimitCharge1: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/CCMCurrentLimitCharge1")} - property VBusItem ccmCurrentLimitCharge2: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/CCMCurrentLimitCharge2")} - property VBusItem ccmCurrentLimitCharge3: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/CCMCurrentLimitCharge3")} - property VBusItem ccmCurrentLimitDischarge1: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/CCMCurrentLimitDischarge1")} - property VBusItem ccmCurrentLimitDischarge2: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/CCMCurrentLimitDischarge2")} - property VBusItem ccmCurrentLimitDischarge3: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/Devices/serialbattery/CCMCurrentLimitDischarge3")} - - title: service.description + " | Cell Voltages" - - model: VisibleItemModel { - - MbSpinBox { - description: qsTr("Maximum charge current") - item { - bind: maxCurrentCharge.bind - unit: "A" - decimals: 0 - step: 1 - min: 0 - } - } - MbSpinBox { - description: qsTr("Maximum discharge current") - item { - bind: maxCurrentDischarge.bind - unit: "A" - decimals: 0 - step: 1 - min: 0 - } - } - - MbSpinBox { - description: qsTr("Maximum cell voltage") - item { - bind: cellVoltageMax.bind - unit: "V" - decimals: 2 - step: 0.05 - } - } - MbSpinBox { - description: qsTr("Minimum cell voltage") - item { - bind: cellVoltageMin.bind - unit: "V" - decimals: 2 - step: 0.05 - } - } - - MbSwitch { - id: allowDynamicChargeCurrentSwitch - name: qsTr("Dynamic charge current") - bind: allowDynamicChargeCurrent.bind - } - MbSwitch { - id: allowDynamicDischargeCurrentSwitch - name: qsTr("Dynamic discharge current") - bind: allowDynamicDischargeCurrent.bind - } - - MbSwitch { - id: allowDynamicChargeVoltageSwitch - name: qsTr("Dynamic charge voltage") - bind : allowDynamicChargeVoltage.bind - } - - MbSpinBox { - description: qsTr("Float cell voltage") - item { - bind: cellVoltageFloat.bind - unit: "V" - decimals: 2 - step: 0.05 - } - show: allowDynamicChargeVoltageSwitch.checked - } - - MbSpinBox { - description: qsTr("Low SOC Warning") - item { - bind: socLowWarning.bind - unit: "%" - decimals: 0 - step: 1 - } - } - MbSpinBox { - description: qsTr("Low SOC Alarm") - item { - bind: socLowAlarm.bind - unit: "%" - decimals: 0 - step: 1 - } - } - - - - - - } -} diff --git a/etc/dbus-serialbattery/qml/PageBattery.qml b/etc/dbus-serialbattery/qml/gui-v1/PageBattery.qml similarity index 100% rename from etc/dbus-serialbattery/qml/PageBattery.qml rename to etc/dbus-serialbattery/qml/gui-v1/PageBattery.qml diff --git a/etc/dbus-serialbattery/qml/PageBatteryCellVoltages.qml b/etc/dbus-serialbattery/qml/gui-v1/PageBatteryCellVoltages.qml similarity index 100% rename from etc/dbus-serialbattery/qml/PageBatteryCellVoltages.qml rename to etc/dbus-serialbattery/qml/gui-v1/PageBatteryCellVoltages.qml diff --git a/etc/dbus-serialbattery/qml/PageBatteryParameters.qml b/etc/dbus-serialbattery/qml/gui-v1/PageBatteryParameters.qml similarity index 100% rename from etc/dbus-serialbattery/qml/PageBatteryParameters.qml rename to etc/dbus-serialbattery/qml/gui-v1/PageBatteryParameters.qml diff --git a/etc/dbus-serialbattery/qml/PageBatterySettings.qml b/etc/dbus-serialbattery/qml/gui-v1/PageBatterySettings.qml similarity index 100% rename from etc/dbus-serialbattery/qml/PageBatterySettings.qml rename to etc/dbus-serialbattery/qml/gui-v1/PageBatterySettings.qml diff --git a/etc/dbus-serialbattery/qml/PageLynxIonIo.qml b/etc/dbus-serialbattery/qml/gui-v1/PageLynxIonIo.qml similarity index 100% rename from etc/dbus-serialbattery/qml/PageLynxIonIo.qml rename to etc/dbus-serialbattery/qml/gui-v1/PageLynxIonIo.qml diff --git a/etc/dbus-serialbattery/qml/gui-v2/PageBattery.qml b/etc/dbus-serialbattery/qml/gui-v2/PageBattery.qml new file mode 100644 index 00000000..087452cc --- /dev/null +++ b/etc/dbus-serialbattery/qml/gui-v2/PageBattery.qml @@ -0,0 +1,532 @@ +/* +** Copyright (C) 2023 Victron Energy B.V. +** See LICENSE.txt for license information. +*/ + +import QtQuick +import Victron.VenusOS + +Page { + id: root + + property var battery + + readonly property bool isFiamm48TL: productId.value === ProductInfo.ProductId_Battery_Fiamm48TL + readonly property bool isParallelBms: nrOfBmses.dataItem.isValid + + title: battery.name + + GradientListView { + model: ObjectModel { + ListRadioButtonGroup { + text: CommonWords.switch_mode + dataItem.uid: root.battery.serviceUid + "/Mode" + allowed: defaultAllowed && dataItem.isValid + optionModel: [ + { display: CommonWords.off, value: 4, readOnly: true }, + { display: CommonWords.standby, value: 0xfc }, + { display: CommonWords.on, value: 3 }, + ] + } + + ListTextItem { + text: CommonWords.state + dataItem.uid: root.battery.serviceUid + "/State" + allowed: defaultAllowed && dataItem.isValid + secondaryText: { + if (!dataItem.isValid) { + return "" + } + if (dataItem.value >= 0 && dataItem.value <= 8) { + //% "Initializing" + return qsTrId("devicelist_battery_initializing") + } + switch (dataItem.value) { + case VenusOS.Battery_State_Running: + return CommonWords.running_status + case VenusOS.Battery_State_Error: + return CommonWords.error + // case Battery_State_Unknown is omitted + case VenusOS.Battery_State_Shutdown: + //: Status is 'Shutdown' + //% "Shutdown" + return qsTrId("devicelist_battery_shutdown") + case VenusOS.Battery_State_Updating: + //: Status is 'Updating' + //% "Updating" + return qsTrId("devicelist_battery_updating") + case VenusOS.Battery_State_Standby: + return CommonWords.standby + case VenusOS.Battery_State_GoingToRun: + //: Status is 'Going to run' + //% "Going to run" + return qsTrId("devicelist_battery_going_to_run") + case VenusOS.Battery_State_Precharging: + //: Status is 'Pre-Charging' + //% "Pre-Charging" + return qsTrId("devicelist_battery_pre_charging") + case VenusOS.Battery_State_ContactorCheck: + //: Status is 'Contactor check' + //% "Contactor check" + return qsTrId("devicelist_battery_contactor_check") + case VenusOS.Battery_State_Pending: + return CommonWords.pending + default: + return "" + } + } + } + + ListTextItem { + text: CommonWords.error + dataItem.uid: root.battery.serviceUid + "/ErrorCode" + allowed: defaultAllowed && dataItem.isValid + secondaryText: BmsError.description(dataItem.value) + } + + ListTextItem { + //% "Battery bank error" + text: qsTrId("battery_bank_error") + dataItem.uid: root.battery.serviceUid + "/ErrorCode" + allowed: defaultAllowed && (errorComm.isValid || errorVoltage.isValid || errorNrOfBatteries.isValid || errorInvalidConfig.isValid) + secondaryText: { + if (errorComm.isValid && errorComm.value) { + //% "Communication error" + return qsTrId("battery_bank_error_communication") + } else if (errorVoltage.isValid && errorVoltage.value) { + //% "Battery voltage not supported" + return qsTrId("battery_bank_error_voltage_not_supported") + } else if (errorNrOfBatteries.isValid && errorNrOfBatteries.value) { + //% "Incorrect number of batteries" + return qsTrId("battery_bank_error_incorrect_number_of_batteries") + } else if (errorInvalidConfig.isValid && errorInvalidConfig.value) { + //% "Invalid battery configuration" + return qsTrId("battery_bank_error_invalid_configuration") + } else { + return CommonWords.none_errors + } + } + + VeQuickItem { id: errorComm; uid: root.battery.serviceUid + "/Errors/SmartLithium/Communication" } + VeQuickItem { id: errorVoltage; uid: root.battery.serviceUid + "/Errors/SmartLithium/Voltage" } + VeQuickItem { id: errorNrOfBatteries; uid: root.battery.serviceUid + "/Errors/SmartLithium/NrOfBatteries" } + VeQuickItem { id: errorInvalidConfig; uid: root.battery.serviceUid + "/Errors/SmartLithium/InvalidConfiguration" } + } + + ListQuantityGroup { + text: CommonWords.battery + textModel: [ + { value: root.battery.voltage, unit: VenusOS.Units_Volt_DC }, + { value: root.battery.current, unit: VenusOS.Units_Amp }, + { value: root.battery.power, unit: VenusOS.Units_Watt } + ] + } + + ListQuantityItem { + text: "Current (last 5 minutes avg.)" + dataItem.uid: root.battery.serviceUid + "/CurrentAvg" + allowed: defaultAllowed && dataItem.isValid + unit: VenusOS.Units_Amp + } + + ListQuantityItem { + //% "Total Capacity" + text: qsTrId("devicelist_battery_total_capacity") + dataItem.uid: root.battery.serviceUid + "/Capacity" + allowed: defaultAllowed && root.isParallelBms + unit: VenusOS.Units_AmpHour + } + + ListQuantityItem { + readonly property VeQuickItem _n2kDeviceInstance: VeQuickItem { + uid: battery.serviceUid + "/N2kDeviceInstance" + } + + //% "System voltage" + text: qsTrId("devicelist_battery_system_voltage") + dataItem.uid: BackendConnection.serviceUidFromName("com.victronenergy.battery.lynxparallel" + _n2kDeviceInstance.value, _n2kDeviceInstance.value) + "/Dc/0/Voltage" + allowed: defaultAllowed && !root.isParallelBms && root.battery.state === VenusOS.Battery_State_Pending + unit: VenusOS.Units_Volt_DC + } + + ListTextItem { + id: nrOfBmses + //% "Number of BMSes" + text: qsTrId("devicelist_battery_number_of_bmses") + dataItem.uid: root.battery.serviceUid + "/NumberOfBmses" + allowed: defaultAllowed && root.isParallelBms + } + + ListQuantityItem { + text: CommonWords.state_of_charge + value: root.battery.stateOfCharge + unit: VenusOS.Units_Percentage + } + + ListQuantityItem { + //% "State of health" + text: qsTrId("battery_state_of_health") + dataItem.uid: root.battery.serviceUid + "/Soh" + allowed: defaultAllowed && dataItem.isValid + unit: VenusOS.Units_Percentage + } + + ListTemperatureItem { + text: CommonWords.battery_temperature + dataItem.uid: root.battery.serviceUid + "/Dc/0/Temperature" + allowed: defaultAllowed && dataItem.isValid + unit: Global.systemSettings.temperatureUnit + } + + ListTemperatureItem { + text: "MOSFET Temperature" + dataItem.uid: root.battery.serviceUid + "/System/MOSTemperature" + allowed: defaultAllowed && dataItem.isValid + unit: Global.systemSettings.temperatureUnit + } + + ListTemperatureItem { + //% "Air temperature" + text: qsTrId("battery_air_temp") + dataItem.uid: root.battery.serviceUid + "/AirTemperature" + allowed: defaultAllowed && dataItem.isValid + } + + ListQuantityItem { + //% "Starter voltage" + text: qsTrId("battery_starter_voltage") + dataItem.uid: root.battery.serviceUid + "/Dc/1/Voltage" + allowed: defaultAllowed && dataItem.isValid + unit: VenusOS.Units_Volt_DC + } + + ListQuantityItem { + //% "Bus voltage" + text: qsTrId("battery_bus_voltage") + dataItem.uid: root.battery.serviceUid + "/BusVoltage" + allowed: defaultAllowed && dataItem.isValid + unit: VenusOS.Units_Volt_DC + } + + ListQuantityItem { + //% "Top section voltage" + text: qsTrId("battery_top_section_voltage") + allowed: midVoltage.isValid + value: midVoltage.isValid && !isNaN(root.battery.voltage) ? root.battery.voltage - midVoltage.value : NaN + unit: VenusOS.Units_Volt_DC + } + + ListQuantityItem { + //% "Bottom section voltage" + text: qsTrId("battery_bottom_section_voltage") + value: midVoltage.value === undefined ? NaN : midVoltage.value + allowed: midVoltage.isValid + unit: VenusOS.Units_Volt_DC + } + + ListQuantityItem { + //% "Mid-point deviation" + text: qsTrId("battery_mid_point_deviation") + dataItem.uid: root.battery.serviceUid + "/Dc/0/MidVoltageDeviation" + allowed: defaultAllowed && dataItem.isValid + unit: VenusOS.Units_Percentage + } + + ListQuantityItem { + //% "Consumed AmpHours" + text: qsTrId("battery_consumed_amphours") + dataItem.uid: root.battery.serviceUid + "/ConsumedAmphours" + allowed: defaultAllowed && dataItem.isValid + unit: VenusOS.Units_AmpHour + } + + ListQuantityItem { + //% "Bus voltage" + text: qsTrId("battery_buss_voltage") + dataItem.uid: root.battery.serviceUid + "/BussVoltage" + allowed: defaultAllowed && dataItem.isValid + unit: VenusOS.Units_Volt_DC + } + + ListTextItem { + //% "Time-to-go" + text: qsTrId("battery_time_to_go") + dataItem.uid: root.battery.serviceUid + "/TimeToGo" + allowed: defaultAllowed && dataItem.seen + secondaryText: Utils.secondsToString(root.battery.timeToGo) + } + + ListTextItem { + //% "Time-to-SoC 0%" + text: "Time-to-SoC 0%" + allowed: defaultAllowed && dataItem.seen + dataItem.uid: root.battery.serviceUid + "/TimeToSoC/0" + secondaryText: dataItem.isValid && dataItem.value != "" > 0 ? dataItem.value : "--" + } + + ListTextItem { + //% "Time-to-SoC 10%" + text: "Time-to-SoC 10%" + allowed: defaultAllowed && dataItem.seen + dataItem.uid: root.battery.serviceUid + "/TimeToSoC/10" + secondaryText: dataItem.isValid && dataItem.value != "" > 0 ? dataItem.value : "--" + } + + ListTextItem { + //% "Time-to-SoC 20%" + text: "Time-to-SoC 20%" + allowed: defaultAllowed && dataItem.seen + dataItem.uid: root.battery.serviceUid + "/TimeToSoC/20" + secondaryText: dataItem.isValid && dataItem.value != "" > 0 ? dataItem.value : "--" + } + + ListTextItem { + //% "Time-to-SoC 80%" + text: "Time-to-SoC 80%" + allowed: defaultAllowed && dataItem.seen + dataItem.uid: root.battery.serviceUid + "/TimeToSoC/80" + secondaryText: dataItem.isValid && dataItem.value != "" > 0 ? dataItem.value : "--" + } + + ListTextItem { + //% "Time-to-SoC 90%" + text: "Time-to-SoC 90%" + allowed: defaultAllowed && dataItem.seen + dataItem.uid: root.battery.serviceUid + "/TimeToSoC/90" + secondaryText: dataItem.isValid && dataItem.value != "" > 0 ? dataItem.value : "--" + } + + ListTextItem { + //% "Time-to-SoC 100%" + text: "Time-to-SoC 100%" + allowed: defaultAllowed && dataItem.seen + dataItem.uid: root.battery.serviceUid + "/TimeToSoC/100" + secondaryText: dataItem.isValid && dataItem.value != "" > 0 ? dataItem.value : "--" + } + + ListRelayState { + dataItem.uid: root.battery.serviceUid + "/Relay/0/State" + } + + ListAlarmState { + dataItem.uid: root.battery.serviceUid + "/Alarms/Alarm" + } + + ListNavigationItem { + //% "Details" + text: qsTrId("battery_details") + allowed: defaultAllowed && batteryDetails.hasAllowedItem + onClicked: { + Global.pageManager.pushPage("/pages/settings/devicelist/battery/PageBatteryDetails.qml", + { "title": text, "bindPrefix": root.battery.serviceUid, "details": batteryDetails }) + } + + BatteryDetails { + id: batteryDetails + bindPrefix: root.battery.serviceUid + } + } + + ListNavigationItem { + text: "Cell Voltages" + onClicked: { + Global.pageManager.pushPage("/pages/settings/devicelist/battery/PageBatteryCells.qml", + { "title": text, "bindPrefix": root.battery.serviceUid }) + } + } + + ListNavigationItem { + text: CommonWords.alarms + allowed: !root.isParallelBms + onClicked: { + Global.pageManager.pushPage("/pages/settings/devicelist/battery/PageBatteryAlarms.qml", + { "title": text, "bindPrefix": root.battery.serviceUid }) + } + } + + ListNavigationItem { + //% "Module level alarms" + text: qsTrId("battery_module_level_alarms") + allowed: moduleAlarmModel.rowCount > 0 + onClicked: { + Global.pageManager.pushPage("/pages/settings/devicelist/battery/PageBatteryModuleAlarms.qml", + { "title": text, "bindPrefix": root.battery.serviceUid, alarmModel: moduleAlarmModel }) + } + } + + ListNavigationItem { + text: CommonWords.history + allowed: !isFiamm48TL && batteryHistory.hasAllowedItem + onClicked: { + Global.pageManager.pushPage("/pages/settings/devicelist/battery/PageBatteryHistory.qml", + { "title": text, "bindPrefix": root.battery.serviceUid, "history": batteryHistory }) + } + + BatteryHistory { + id: batteryHistory + bindPrefix: root.battery.serviceUid + } + } + + ListNavigationItem { + text: CommonWords.settings + allowed: hasSettings.value === 1 + onClicked: { + Global.pageManager.pushPage("/pages/settings/devicelist/battery/PageBatterySettings.qml", + { "title": text, "bindPrefix": root.battery.serviceUid }) + } + } + + ListNavigationItem { + id: lynxIonDiagnostics + + //% "Diagnostics" + text: qsTrId("battery_settings_diagnostics") + allowed: lastError.isValid + onClicked: { + Global.pageManager.pushPage("/pages/settings/devicelist/battery/PageLynxIonDiagnostics.qml", + { "title": text, "bindPrefix": root.battery.serviceUid }) + } + + VeQuickItem { + id: lastError + uid: root.battery.serviceUid + "/Diagnostics/LastErrors/1/Error" + } + } + + ListNavigationItem { + text: lynxIonDiagnostics.text + allowed: isFiamm48TL + + onClicked: { + Global.pageManager.pushPage("/pages/settings/devicelist/battery/Page48TlDiagnostics.qml", + { "title": text, "bindPrefix": root.battery.serviceUid }) + } + } + + ListNavigationItem { + //% "Fuses" + text: qsTrId("battery_settings_fuses") + allowed: nrOfDistributors.isValid && nrOfDistributors.value > 0 + + onClicked: { + Global.pageManager.pushPage("/pages/settings/devicelist/battery/PageLynxDistributorList.qml", + { "title": text, "bindPrefix": root.battery.serviceUid }) + } + + VeQuickItem { + id: nrOfDistributors + uid: root.battery.serviceUid + "/NrOfDistributors" + } + } + + ListNavigationItem { + //% "IO" + text: qsTrId("battery_settings_io") + allowed: allowToCharge.isValid + onClicked: { + Global.pageManager.pushPage("/pages/settings/devicelist/battery/PageLynxIonIo.qml", + { "title": text, "bindPrefix": root.battery.serviceUid }) + } + + VeQuickItem { + id: allowToCharge + uid: root.battery.serviceUid + "/Io/AllowToCharge" + } + } + + ListNavigationItem { + //% "System" + text: qsTrId("battery_settings_system") + allowed: nrOfBatteries.isValid + onClicked: { + Global.pageManager.pushPage("/pages/settings/devicelist/battery/PageLynxIonSystem.qml", + { "title": text, "bindPrefix": root.battery.serviceUid }) + } + + VeQuickItem { + id: nrOfBatteries + uid: root.battery.serviceUid +"/System/NrOfBatteries" + } + } + + ListNavigationItem { + text: CommonWords.device_info_title + onClicked: { + Global.pageManager.pushPage("/pages/settings/PageDeviceInfo.qml", + { "title": text, "bindPrefix": root.battery.serviceUid }) + } + } + + ListNavigationItem { + //% "Parameters" + text: qsTrId("battery_settings_parameters") + allowed: cvl.isValid || ccl.isValid || dcl.isValid + onClicked: { + Global.pageManager.pushPage("/pages/settings/devicelist/battery/PageBatteryParameters.qml", + { "title": text, "bindPrefix": root.battery.serviceUid }) + } + + VeQuickItem { + id: cvl + uid: root.battery.serviceUid + "/Info/MaxChargeVoltage" + } + + VeQuickItem { + id: ccl + uid: root.battery.serviceUid + "/Info/MaxChargeCurrent" + } + + VeQuickItem { + id: dcl + uid: root.battery.serviceUid + "/Info/MaxDischargeCurrent" + } + } + + ListButton { + //% "Redetect Battery" + text: qsTrId("battery_redetect_battery") + //% "Press to redetect" + secondaryText: qsTrId("battery_press_to_redetect") + enabled: redetect.value === 0 + allowed: redetect.isValid + writeAccessLevel: VenusOS.User_AccessType_User + onClicked: { + redetect.setValue(1) + //% "Redetecting the battery may take up time 60 seconds. Meanwhile the name of the battery may be incorrect." + Global.showToastNotification(VenusOS.Notification_Info, qsTrId("battery_redetecting_the_battery_note"), 10000) + } + + VeQuickItem { + id: redetect + uid: root.battery.serviceUid + "/Redetect" + } + } + } + } + + VeQuickItem { + id: midVoltage + uid: root.battery.serviceUid + "/Dc/0/MidVoltage" + } + + VeQuickItem { + id: productId + uid: root.battery.serviceUid + "/ProductId" + } + + VeQuickItem { + id: hasSettings + uid: root.battery.serviceUid + "/Settings/HasSettings" + } + + VeQItemSortTableModel { + id: moduleAlarmModel + + filterRegExp: "\/Module[0-9]\/Id$" + filterFlags: VeQItemSortTableModel.FilterInvalid + model: VeQItemTableModel { + uids: [root.battery.serviceUid + "/Diagnostics"] + } + } +} diff --git a/etc/dbus-serialbattery/qml/gui-v2/PageBatteryCells.qml b/etc/dbus-serialbattery/qml/gui-v2/PageBatteryCells.qml new file mode 100644 index 00000000..c2503466 --- /dev/null +++ b/etc/dbus-serialbattery/qml/gui-v2/PageBatteryCells.qml @@ -0,0 +1,820 @@ +/* +** Copyright (C) 2023 Victron Energy B.V. +** See LICENSE.txt for license information. +*/ + +import QtQuick +import Victron.VenusOS + +Page { + id: root + + property string bindPrefix + + readonly property string batteryCellVoltageSum: _batteryCellVoltageSum.isValid ? _batteryCellVoltageSum.value.toFixed(2) : "--" + readonly property string batteryCellVoltageDiff: _batteryCellVoltageDiff.isValid ? _batteryCellVoltageDiff.value.toFixed(3) : "--" + readonly property string batteryMinCellVoltage: _batteryMinCellVoltage.isValid ? _batteryMinCellVoltage.value.toFixed(3) : "--" + readonly property string batteryMaxCellVoltage: _batteryMaxCellVoltage.isValid ? _batteryMaxCellVoltage.value.toFixed(3) : "--" + + + readonly property VeQuickItem _batteryVoltagesCell_1: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell1" } + readonly property VeQuickItem _batteryVoltagesCell_2: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell2" } + readonly property VeQuickItem _batteryVoltagesCell_3: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell3" } + readonly property VeQuickItem _batteryVoltagesCell_4: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell4" } + readonly property VeQuickItem _batteryVoltagesCell_5: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell5" } + readonly property VeQuickItem _batteryVoltagesCell_6: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell6" } + readonly property VeQuickItem _batteryVoltagesCell_7: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell7" } + readonly property VeQuickItem _batteryVoltagesCell_8: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell8" } + readonly property VeQuickItem _batteryVoltagesCell_9: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell9" } + readonly property VeQuickItem _batteryVoltagesCell_10: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell10" } + readonly property VeQuickItem _batteryVoltagesCell_11: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell11" } + readonly property VeQuickItem _batteryVoltagesCell_12: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell12" } + readonly property VeQuickItem _batteryVoltagesCell_13: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell13" } + readonly property VeQuickItem _batteryVoltagesCell_14: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell14" } + readonly property VeQuickItem _batteryVoltagesCell_15: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell15" } + readonly property VeQuickItem _batteryVoltagesCell_16: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell16" } + readonly property VeQuickItem _batteryVoltagesCell_17: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell17" } + readonly property VeQuickItem _batteryVoltagesCell_18: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell18" } + readonly property VeQuickItem _batteryVoltagesCell_19: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell19" } + readonly property VeQuickItem _batteryVoltagesCell_20: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell20" } + readonly property VeQuickItem _batteryVoltagesCell_21: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell21" } + readonly property VeQuickItem _batteryVoltagesCell_22: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell22" } + readonly property VeQuickItem _batteryVoltagesCell_23: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell23" } + readonly property VeQuickItem _batteryVoltagesCell_24: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell24" } + readonly property VeQuickItem _batteryVoltagesCell_25: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell25" } + readonly property VeQuickItem _batteryVoltagesCell_26: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell26" } + readonly property VeQuickItem _batteryVoltagesCell_27: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell27" } + readonly property VeQuickItem _batteryVoltagesCell_28: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell28" } + readonly property VeQuickItem _batteryVoltagesCell_29: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell29" } + readonly property VeQuickItem _batteryVoltagesCell_30: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell30" } + readonly property VeQuickItem _batteryVoltagesCell_31: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell31" } + readonly property VeQuickItem _batteryVoltagesCell_32: VeQuickItem { uid: root.bindPrefix + "/Voltages/Cell32" } + + + readonly property string batteryVoltagesCell_1: _batteryVoltagesCell_1.isValid ? _batteryVoltagesCell_1.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_2: _batteryVoltagesCell_2.isValid ? _batteryVoltagesCell_2.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_3: _batteryVoltagesCell_3.isValid ? _batteryVoltagesCell_3.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_4: _batteryVoltagesCell_4.isValid ? _batteryVoltagesCell_4.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_5: _batteryVoltagesCell_5.isValid ? _batteryVoltagesCell_5.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_6: _batteryVoltagesCell_6.isValid ? _batteryVoltagesCell_6.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_7: _batteryVoltagesCell_7.isValid ? _batteryVoltagesCell_7.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_8: _batteryVoltagesCell_8.isValid ? _batteryVoltagesCell_8.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_9: _batteryVoltagesCell_9.isValid ? _batteryVoltagesCell_9.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_10: _batteryVoltagesCell_10.isValid ? _batteryVoltagesCell_10.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_11: _batteryVoltagesCell_11.isValid ? _batteryVoltagesCell_11.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_12: _batteryVoltagesCell_12.isValid ? _batteryVoltagesCell_12.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_13: _batteryVoltagesCell_13.isValid ? _batteryVoltagesCell_13.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_14: _batteryVoltagesCell_14.isValid ? _batteryVoltagesCell_14.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_15: _batteryVoltagesCell_15.isValid ? _batteryVoltagesCell_15.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_16: _batteryVoltagesCell_16.isValid ? _batteryVoltagesCell_16.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_17: _batteryVoltagesCell_17.isValid ? _batteryVoltagesCell_17.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_18: _batteryVoltagesCell_18.isValid ? _batteryVoltagesCell_18.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_19: _batteryVoltagesCell_19.isValid ? _batteryVoltagesCell_19.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_20: _batteryVoltagesCell_20.isValid ? _batteryVoltagesCell_20.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_21: _batteryVoltagesCell_21.isValid ? _batteryVoltagesCell_21.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_22: _batteryVoltagesCell_22.isValid ? _batteryVoltagesCell_22.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_23: _batteryVoltagesCell_23.isValid ? _batteryVoltagesCell_23.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_24: _batteryVoltagesCell_24.isValid ? _batteryVoltagesCell_24.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_25: _batteryVoltagesCell_25.isValid ? _batteryVoltagesCell_25.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_26: _batteryVoltagesCell_26.isValid ? _batteryVoltagesCell_26.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_27: _batteryVoltagesCell_27.isValid ? _batteryVoltagesCell_27.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_28: _batteryVoltagesCell_28.isValid ? _batteryVoltagesCell_28.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_29: _batteryVoltagesCell_29.isValid ? _batteryVoltagesCell_29.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_30: _batteryVoltagesCell_30.isValid ? _batteryVoltagesCell_30.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_31: _batteryVoltagesCell_31.isValid ? _batteryVoltagesCell_31.value.toFixed(3) : "--" + readonly property string batteryVoltagesCell_32: _batteryVoltagesCell_32.isValid ? _batteryVoltagesCell_32.value.toFixed(3) : "--" + + + readonly property VeQuickItem _batteryBalancesCell_1: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell1" } + readonly property VeQuickItem _batteryBalancesCell_2: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell2" } + readonly property VeQuickItem _batteryBalancesCell_3: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell3" } + readonly property VeQuickItem _batteryBalancesCell_4: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell4" } + readonly property VeQuickItem _batteryBalancesCell_5: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell5" } + readonly property VeQuickItem _batteryBalancesCell_6: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell6" } + readonly property VeQuickItem _batteryBalancesCell_7: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell7" } + readonly property VeQuickItem _batteryBalancesCell_8: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell8" } + readonly property VeQuickItem _batteryBalancesCell_9: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell9" } + readonly property VeQuickItem _batteryBalancesCell_10: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell10" } + readonly property VeQuickItem _batteryBalancesCell_11: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell11" } + readonly property VeQuickItem _batteryBalancesCell_12: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell12" } + readonly property VeQuickItem _batteryBalancesCell_13: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell13" } + readonly property VeQuickItem _batteryBalancesCell_14: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell14" } + readonly property VeQuickItem _batteryBalancesCell_15: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell15" } + readonly property VeQuickItem _batteryBalancesCell_16: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell16" } + readonly property VeQuickItem _batteryBalancesCell_17: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell17" } + readonly property VeQuickItem _batteryBalancesCell_18: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell18" } + readonly property VeQuickItem _batteryBalancesCell_19: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell19" } + readonly property VeQuickItem _batteryBalancesCell_20: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell20" } + readonly property VeQuickItem _batteryBalancesCell_21: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell21" } + readonly property VeQuickItem _batteryBalancesCell_22: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell22" } + readonly property VeQuickItem _batteryBalancesCell_23: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell23" } + readonly property VeQuickItem _batteryBalancesCell_24: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell24" } + readonly property VeQuickItem _batteryBalancesCell_25: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell25" } + readonly property VeQuickItem _batteryBalancesCell_26: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell26" } + readonly property VeQuickItem _batteryBalancesCell_27: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell27" } + readonly property VeQuickItem _batteryBalancesCell_28: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell28" } + readonly property VeQuickItem _batteryBalancesCell_29: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell29" } + readonly property VeQuickItem _batteryBalancesCell_30: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell30" } + readonly property VeQuickItem _batteryBalancesCell_31: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell31" } + readonly property VeQuickItem _batteryBalancesCell_32: VeQuickItem { uid: root.bindPrefix + "/Balances/Cell32" } + + + readonly property string cellTextColor1: _batteryBalancesCell_1.isValid && _batteryBalancesCell_1.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_1 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor2: _batteryBalancesCell_2.isValid && _batteryBalancesCell_2.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_2 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor3: _batteryBalancesCell_3.isValid && _batteryBalancesCell_3.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_3 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor4: _batteryBalancesCell_4.isValid && _batteryBalancesCell_4.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_4 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor5: _batteryBalancesCell_5.isValid && _batteryBalancesCell_5.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_5 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor6: _batteryBalancesCell_6.isValid && _batteryBalancesCell_6.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_6 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor7: _batteryBalancesCell_7.isValid && _batteryBalancesCell_7.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_7 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor8: _batteryBalancesCell_8.isValid && _batteryBalancesCell_8.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_8 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor9: _batteryBalancesCell_9.isValid && _batteryBalancesCell_9.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_9 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor10: _batteryBalancesCell_10.isValid && _batteryBalancesCell_10.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_10 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor11: _batteryBalancesCell_11.isValid && _batteryBalancesCell_11.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_11 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor12: _batteryBalancesCell_12.isValid && _batteryBalancesCell_12.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_12 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor13: _batteryBalancesCell_13.isValid && _batteryBalancesCell_13.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_13 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor14: _batteryBalancesCell_14.isValid && _batteryBalancesCell_14.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_14 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor15: _batteryBalancesCell_15.isValid && _batteryBalancesCell_15.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_15 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor16: _batteryBalancesCell_16.isValid && _batteryBalancesCell_16.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_16 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor17: _batteryBalancesCell_17.isValid && _batteryBalancesCell_17.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_17 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor18: _batteryBalancesCell_18.isValid && _batteryBalancesCell_18.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_18 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor19: _batteryBalancesCell_19.isValid && _batteryBalancesCell_19.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_19 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor20: _batteryBalancesCell_20.isValid && _batteryBalancesCell_20.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_20 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor21: _batteryBalancesCell_21.isValid && _batteryBalancesCell_21.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_21 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor22: _batteryBalancesCell_22.isValid && _batteryBalancesCell_22.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_22 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor23: _batteryBalancesCell_23.isValid && _batteryBalancesCell_23.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_23 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor24: _batteryBalancesCell_24.isValid && _batteryBalancesCell_24.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_24 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor25: _batteryBalancesCell_25.isValid && _batteryBalancesCell_25.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_25 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor26: _batteryBalancesCell_26.isValid && _batteryBalancesCell_26.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_26 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor27: _batteryBalancesCell_27.isValid && _batteryBalancesCell_27.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_27 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor28: _batteryBalancesCell_28.isValid && _batteryBalancesCell_28.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_28 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor29: _batteryBalancesCell_29.isValid && _batteryBalancesCell_29.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_29 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor30: _batteryBalancesCell_30.isValid && _batteryBalancesCell_30.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_30 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor31: _batteryBalancesCell_31.isValid && _batteryBalancesCell_31.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_31 ? "#387DC5" : "#b80101") : Theme.color_font_primary + readonly property string cellTextColor32: _batteryBalancesCell_32.isValid && _batteryBalancesCell_32.value == "1" ? (batteryMinCellVoltage == batteryVoltagesCell_32 ? "#387DC5" : "#b80101") : Theme.color_font_primary + + VeQuickItem { + id: _batteryCellVoltageSum + uid: root.bindPrefix + "/Voltages/Sum" + } + VeQuickItem { + id: _batteryCellVoltageDiff + uid: root.bindPrefix + "/Voltages/Diff" + } + VeQuickItem { + id: _batteryMinCellVoltage + uid: root.bindPrefix + "/System/MinCellVoltage" + } + VeQuickItem { + id: _batteryMaxCellVoltage + uid: root.bindPrefix + "/System/MaxCellVoltage" + } + + GradientListView { + model: ObjectModel { + + ListItem { + text: "Overview" + content.children: [ + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryCellVoltageSum != "--" ? batteryCellVoltageSum + "V" : "--" + color: Theme.color_font_primary + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Sum" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryCellVoltageDiff != "--" ? batteryCellVoltageDiff + "V" : "--" + color: Theme.color_font_primary + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Diff" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryMaxCellVoltage != "--" ? batteryMaxCellVoltage + "V" : "--" + color: Theme.color_font_primary + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Max" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryMinCellVoltage != "--" ? batteryMinCellVoltage + "V" : "--" + color: Theme.color_font_primary + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Min" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + } + ] + + } + + ListItem { + text: "Cells 1-4" + content.children: [ + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_1 != "--" ? batteryVoltagesCell_1 + "V" : "--" + color: cellTextColor1 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 1" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_2 != "--" ? batteryVoltagesCell_2 + "V" : "--" + color: cellTextColor2 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 2" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_3 != "--" ? batteryVoltagesCell_3 + "V" : "--" + color: cellTextColor3 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 3" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_4 != "--" ? batteryVoltagesCell_4 + "V" : "--" + color: cellTextColor4 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 4" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + } + ] + } + + ListItem { + text: "Cells 5-8" + allowed: batteryVoltagesCell_5 != "--" + content.children: [ + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_5 != "--" ? batteryVoltagesCell_5 + "V" : "--" + color: cellTextColor5 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 5" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_6 != "--" ? batteryVoltagesCell_6 + "V" : "--" + color: cellTextColor6 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 6" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_7 != "--" ? batteryVoltagesCell_7 + "V" : "--" + color: cellTextColor7 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 7" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_8 != "--" ? batteryVoltagesCell_8 + "V" : "--" + color: cellTextColor8 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 8" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + } + ] + } + + ListItem { + text: "Cells 9-12" + allowed: batteryVoltagesCell_9 != "--" + content.children: [ + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_9 != "--" ? batteryVoltagesCell_9 + "V" : "--" + color: cellTextColor9 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 9" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_10 != "--" ? batteryVoltagesCell_10 + "V" : "--" + color: cellTextColor10 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 10" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_11 != "--" ? batteryVoltagesCell_11 + "V" : "--" + color: cellTextColor11 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 11" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_12 != "--" ? batteryVoltagesCell_12 + "V" : "--" + color: cellTextColor12 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 12" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + } + ] + } + + ListItem { + text: "Cells 13-16" + allowed: batteryVoltagesCell_13 != "--" + content.children: [ + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_13 != "--" ? batteryVoltagesCell_13 + "V" : "--" + color: cellTextColor13 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 13" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_14 != "--" ? batteryVoltagesCell_14 + "V" : "--" + color: cellTextColor14 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 14" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_15 != "--" ? batteryVoltagesCell_15 + "V" : "--" + color: cellTextColor15 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 15" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_16 != "--" ? batteryVoltagesCell_16 + "V" : "--" + color: cellTextColor16 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 16" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + } + ] + } + + ListItem { + text: "Cells 17-20" + allowed: batteryVoltagesCell_17 != "--" + content.children: [ + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_17 != "--" ? batteryVoltagesCell_17 + "V" : "--" + color: cellTextColor17 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 17" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_18 != "--" ? batteryVoltagesCell_18 + "V" : "--" + color: cellTextColor18 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 18" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_19 != "--" ? batteryVoltagesCell_19 + "V" : "--" + color: cellTextColor19 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 19" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_20 != "--" ? batteryVoltagesCell_20 + "V" : "--" + color: cellTextColor20 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 20" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + } + ] + } + + ListItem { + text: "Cells 21-24" + allowed: batteryVoltagesCell_21 != "--" + content.children: [ + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_21 != "--" ? batteryVoltagesCell_21 + "V" : "--" + color: cellTextColor21 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 21" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_22 != "--" ? batteryVoltagesCell_22 + "V" : "--" + color: cellTextColor22 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 22" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_23 != "--" ? batteryVoltagesCell_23 + "V" : "--" + color: cellTextColor23 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 23" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_24 != "--" ? batteryVoltagesCell_24 + "V" : "--" + color: cellTextColor24 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 24" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + } + ] + } + + ListItem { + text: "Cells 25-28" + allowed: batteryVoltagesCell_25 != "--" + content.children: [ + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_25 != "--" ? batteryVoltagesCell_25 + "V" : "--" + color: cellTextColor25 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 25" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_26 != "--" ? batteryVoltagesCell_26 + "V" : "--" + color: cellTextColor26 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 26" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_27 != "--" ? batteryVoltagesCell_27 + "V" : "--" + color: cellTextColor27 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 27" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_28 != "--" ? batteryVoltagesCell_28 + "V" : "--" + color: cellTextColor28 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 28" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + } + ] + } + + ListItem { + text: "Cells 29-32" + allowed: batteryVoltagesCell_29 != "--" + content.children: [ + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_29 != "--" ? batteryVoltagesCell_29 + "V" : "--" + color: cellTextColor29 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 29" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_30 != "--" ? batteryVoltagesCell_30 + "V" : "--" + color: cellTextColor30 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 30" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_31 != "--" ? batteryVoltagesCell_31 + "V" : "--" + color: cellTextColor31 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 31" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + }, + Column { + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + text: batteryVoltagesCell_32 != "--" ? batteryVoltagesCell_32 + "V" : "--" + color: cellTextColor32 + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + text: "Cell 32" + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + } + ] + } + + } + } +} + + +/* + +Component { + id: cellColumn + Column { + property alias cellNumber: cellNumber.text + property alias cellVoltage: cellVoltage.text + property alias cellColor: cellVoltage.color + + width: ( parent.width - Theme.geometry_page_content_horizontalMargin ) / 4 + Text { + id: cellVoltage + font.pixelSize: 22 + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + id: cellNumber + color: Theme.color_font_secondary + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } + } +} + +ListModel { + id: cellModel + // Add ListElements for each cell with properties: number, voltage, color +} + +Repeater { + model: cellModel + delegate: cellColumn { + cellNumber: "Cell " + model.number + cellVoltage: model.voltage != "--" ? model.voltage + "V" : "--" + cellColor: model.color + } +} + +*/ diff --git a/etc/dbus-serialbattery/qml/gui-v2/PageBatteryParameters.qml b/etc/dbus-serialbattery/qml/gui-v2/PageBatteryParameters.qml new file mode 100644 index 00000000..a3cd1f58 --- /dev/null +++ b/etc/dbus-serialbattery/qml/gui-v2/PageBatteryParameters.qml @@ -0,0 +1,129 @@ +/* +** Copyright (C) 2023 Victron Energy B.V. +** See LICENSE.txt for license information. +*/ + +import QtQuick +import Victron.VenusOS + +Page { + id: root + + property string bindPrefix + + GradientListView { + model: ObjectModel { + + ListTextItem { + text: "Charge Mode" + dataItem.uid: root.bindPrefix + "/Info/ChargeMode" + allowed: defaultAllowed && dataItem.isValid + } + + ListQuantityItem { + //% "Charge Voltage Limit (CVL)" + text: qsTrId("batteryparameters_charge_voltage_limit_cvl") + dataItem.uid: root.bindPrefix + "/Info/MaxChargeVoltage" + unit: VenusOS.Units_Volt_DC + } + + ListTextItem { + text: "Charge Limitation" + dataItem.uid: root.bindPrefix + "/Info/ChargeLimitation" + allowed: defaultAllowed && dataItem.isValid + } + + ListQuantityItem { + //% "Charge Current Limit (CCL)" + text: qsTrId("batteryparameters_charge_current_limit_ccl") + dataItem.uid: root.bindPrefix + "/Info/MaxChargeCurrent" + unit: VenusOS.Units_Amp + } + + ListTextItem { + text: "Discharge Limitation" + dataItem.uid: root.bindPrefix + "/Info/DischargeLimitation" + allowed: defaultAllowed && dataItem.isValid + } + + ListQuantityItem { + //% "Discharge Current Limit (DCL)" + text: qsTrId("batteryparameters_discharge_current_limit_dcl") + dataItem.uid: root.bindPrefix + "/Info/MaxDischargeCurrent" + unit: VenusOS.Units_Amp + } + + ListQuantityItem { + //% "Low Voltage Disconnect (always ignored)" + text: qsTrId("batteryparameters_low_voltage_disconnect_always_ignored") + dataItem.uid: root.bindPrefix + "/Info/BatteryLowVoltage" + showAccessLevel: VenusOS.User_AccessType_Service + unit: VenusOS.Units_Volt_DC + } + + ListItem { + text: "Driver Debug" + + VeQuickItem { + id: chargeModeDebug + uid: root.bindPrefix + "/Info/ChargeModeDebug" + } + + bottomContentChildren: [ + ListLabel { + topPadding: 0 + bottomPadding: 0 + color: Theme.color_font_secondary + text: chargeModeDebug.value + horizontalAlignment: Text.AlignHCenter + } + ] + + allowed: chargeModeDebug.value !== undefined && chargeModeDebug.value !== "" + } + + ListItem { + text: "Driver Debug - Float" + + VeQuickItem { + id: chargeModeDebugFloat + uid: root.bindPrefix + "/Info/ChargeModeDebugFloat" + } + + bottomContentChildren: [ + ListLabel { + topPadding: 0 + bottomPadding: 0 + color: Theme.color_font_secondary + text: chargeModeDebugFloat.value + horizontalAlignment: Text.AlignHCenter + } + ] + + allowed: chargeModeDebugFloat.value !== undefined && chargeModeDebugFloat.value !== "" + } + + ListItem { + text: "Driver Debug - Bulk" + + VeQuickItem { + id: chargeModeDebugBulk + uid: root.bindPrefix + "/Info/ChargeModeDebugBulk" + } + + bottomContentChildren: [ + ListLabel { + topPadding: 0 + bottomPadding: 0 + color: Theme.color_font_secondary + text: chargeModeDebugBulk.value + horizontalAlignment: Text.AlignHCenter + } + ] + + allowed: chargeModeDebugBulk.value !== undefined && chargeModeDebugBulk.value !== "" + } + + } + } +} diff --git a/etc/dbus-serialbattery/qml/gui-v2/PageBatterySettings.qml b/etc/dbus-serialbattery/qml/gui-v2/PageBatterySettings.qml new file mode 100644 index 00000000..7ce6e336 --- /dev/null +++ b/etc/dbus-serialbattery/qml/gui-v2/PageBatterySettings.qml @@ -0,0 +1,124 @@ +/* +** Copyright (C) 2023 Victron Energy B.V. +** See LICENSE.txt for license information. +*/ + +import QtQuick +import Victron.VenusOS + +Page { + id: root + + property string bindPrefix + + // Declare ObjectModelMonitor before the model that it is monitoring. See QTBUG-123496 + ObjectModelMonitor { + id: alarmSettingsMonitor + model: batterySettingsAlarmModel + } + ObjectModelMonitor { + id: relaySettingsMonitor + model: batterySettingsRelayModel + } + + BatterySettingsAlarmModel { + id: batterySettingsAlarmModel + bindPrefix: root.bindPrefix + } + + BatterySettingsRelayModel { + id: batterySettingsRelayModel + bindPrefix: root.bindPrefix + } + + GradientListView { + model: ObjectModel { + ListNavigationItem { + //% "Battery bank" + text: qsTrId("batterysettings_battery_bank") + onClicked: { + Global.pageManager.pushPage("/pages/settings/devicelist/battery/PageBatterySettingsBattery.qml", + { "title": text, "bindPrefix": root.bindPrefix }) + } + } + + ListNavigationItem { + text: CommonWords.alarms + allowed: alarmSettingsMonitor.hasVisibleItem + onClicked: { + Global.pageManager.pushPage(emptySettingsComponent, + { "title": text, "model": batterySettingsAlarmModel }) + } + } + + ListNavigationItem { + //% "Relay (on battery monitor)" + text: qsTrId("batterysettings_relay_on_battery_monitor") + allowed: relaySettingsMonitor.hasVisibleItem + onClicked: { + Global.pageManager.pushPage(emptySettingsComponent, + { "title": text, "model": batterySettingsRelayModel }) + } + } + + ListButton { + //% "Restore factory defaults" + text: qsTrId("batterysettings_restore_factory_defaults") + //% "Press to restore" + secondaryText: qsTrId("batterysettings_press_to_restore") + allowed: defaultAllowed && restoreDefaults.isValid + onClicked: Global.dialogLayer.open(confirmationDialogComponent) + + Component { + id: confirmationDialogComponent + + ModalWarningDialog { + dialogDoneOptions: VenusOS.ModalDialog_DoneOptions_OkAndCancel + + //% "Restore factory defaults?" + title: qsTrId("batterysettings_confirm_restore_factory_defaults") + + onAccepted: restoreDefaults.setValue(1) + } + } + + VeQuickItem { + id: restoreDefaults + uid: root.bindPrefix + "/Settings/RestoreDefaults" + } + } + + ListSwitch { + //% "Bluetooth Enabled" + text: qsTrId("batterysettings_bluetooth_enabled") + dataItem.uid: root.bindPrefix + "/Settings/BluetoothMode" + allowed: defaultAllowed && dataItem.isValid + } + + ListSpinBox { + //% "Reset SoC to" + text: "Reset SoC to" + dataItem.uid: root.bindPrefix + "/Settings/ResetSoc" + allowed: defaultAllowed && dataItem.isValid + suffix: "%" + from: 0 + to: 100 + stepSize: 1 + } + + } + } + + Component { + id: emptySettingsComponent + + Page { + property alias model: settingsListView.model + + GradientListView { + id: settingsListView + } + } + + } +} diff --git a/etc/dbus-serialbattery/qml/gui-v2/PageLynxIonIo.qml b/etc/dbus-serialbattery/qml/gui-v2/PageLynxIonIo.qml new file mode 100644 index 00000000..6cf0d0b3 --- /dev/null +++ b/etc/dbus-serialbattery/qml/gui-v2/PageLynxIonIo.qml @@ -0,0 +1,80 @@ +/* +** Copyright (C) 2023 Victron Energy B.V. +** See LICENSE.txt for license information. +*/ + +import QtQuick +import Victron.VenusOS + +Page { + id: root + + property string bindPrefix + + GradientListView { + model: ObjectModel { + ListTextItem { + //% "System Switch" + text: qsTrId("lynxionio_system_switch") + dataItem.uid: root.bindPrefix + "/SystemSwitch" + allowed: defaultAllowed && dataItem.isValid + secondaryText: CommonWords.enabledOrDisabled(dataItem.value) + } + + ListTextItem { + text: CommonWords.allow_to_charge + dataItem.uid: root.bindPrefix + "/Io/AllowToCharge" + allowed: defaultAllowed && dataItem.isValid + secondaryText: CommonWords.yesOrNo(dataItem.value) + } + + ListTextItem { + text: CommonWords.allow_to_discharge + dataItem.uid: root.bindPrefix + "/Io/AllowToDischarge" + allowed: defaultAllowed && dataItem.isValid + secondaryText: CommonWords.yesOrNo(dataItem.value) + } + + ListTextItem { + text: "Allow to balance" + dataItem.uid: root.bindPrefix + "/Io/AllowToBalance" + allowed: defaultAllowed && dataItem.isValid + secondaryText: CommonWords.yesOrNo(dataItem.value) + } + + ListSwitch { + text: "Force charging off" + dataItem.uid: root.bindPrefix + "/Io/ForceChargingOff" + allowed: defaultAllowed && dataItem.isValid + } + + ListSwitch { + text: "Force discharging off" + dataItem.uid: root.bindPrefix + "/Io/ForceDischargingOff" + allowed: defaultAllowed && dataItem.isValid + } + + ListSwitch { + text: "Turn balancing off" + dataItem.uid: root.bindPrefix + "/Io/TurnBalancingOff" + allowed: defaultAllowed && dataItem.isValid + } + + ListTextItem { + //% "External relay" + text: qsTrId("lynxionio_external_relay") + dataItem.uid: root.bindPrefix + "/Io/ExternalRelay" + allowed: defaultAllowed && dataItem.isValid + secondaryText: CommonWords.activeOrInactive(dataItem.value) + } + + ListTextItem { + //% "Programmable Contact" + text: qsTrId("lynxionio_programmable_contact") + dataItem.uid: root.bindPrefix + "/Io/ProgrammableContact" + allowed: defaultAllowed && dataItem.isValid + secondaryText: CommonWords.activeOrInactive(dataItem.value) + } + } + } +} diff --git a/etc/dbus-serialbattery/reinstall-local.sh b/etc/dbus-serialbattery/reinstall-local.sh index e7d2aba5..949420f7 100755 --- a/etc/dbus-serialbattery/reinstall-local.sh +++ b/etc/dbus-serialbattery/reinstall-local.sh @@ -60,18 +60,18 @@ fi # check if minimum required Venus OS is installed | end -# check if at least 8 MB free space is available on the system partition +# check if at least 28 MB free space is available on the system partition freeSpace=$(df -m / | awk 'NR==2 {print $4}') -if [ $freeSpace -lt 8 ]; then +if [ $freeSpace -lt 28 ]; then # try to expand system partition bash /opt/victronenergy/swupdate-scripts/resize2fs.sh freeSpace=$(df -m / | awk 'NR==2 {print $4}') - if [ $freeSpace -lt 8 ]; then + if [ $freeSpace -lt 28 ]; then echo echo - echo "ERROR: Not enough free space on the system partition. At least 8 MB are required." + echo "ERROR: Not enough free space on the system partition. At least 28 MB are required." echo echo " Please please try to execute this command" echo diff --git a/etc/dbus-serialbattery/utils.py b/etc/dbus-serialbattery/utils.py index 5ce91ec8..4eb4877a 100644 --- a/etc/dbus-serialbattery/utils.py +++ b/etc/dbus-serialbattery/utils.py @@ -14,7 +14,7 @@ # CONSTANTS -DRIVER_VERSION: str = "1.5.20241025dev" +DRIVER_VERSION: str = "1.5.20241031dev" """ current version of the driver """