Skip to content

Commit

Permalink
QtQuick version for GUIv1 changed
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-manuel committed Jan 31, 2025
1 parent 866daa0 commit 43f0c2f
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 11 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@
* Removed: The setting `SOC_RESET_TIME` was removed in the `config.default.ini` by @mr-manuel


## v1.6.20250123

### What's Changed

* Changed: GUIv1 updated QtQuick from 1.1 to 2 with Venus OS v3.60~20. Make sure to update to this driver version before you update Venus OS to v3.60~20 or later by @mr-manuel


## v1.5.20241215

### What's Changed
Expand Down
26 changes: 22 additions & 4 deletions dbus-serialbattery/custom-gui-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,32 @@ if [ -d "$pathGuiV1" ]; then
versionStringToNumber $(head -n 1 /opt/victronenergy/version)
((venusVersionNumber = $versionNumber))

# QtQick version changed with this Venus OS version
versionStringToNumber "v3.60~18"

# change files in the destination folder, else the files are "broken" if upgrading to a the newer Venus OS version
qmlDir="$pathGuiV1/qml"

if (( $venusVersionNumber < $versionNumber )); then
echo "Venus OS $(head -n 1 /opt/victronenergy/version) is older than v3.60~18. Fixing QtQuick version... "
fileList="$qmlDir/PageBattery.qml"
fileList+=" $qmlDir/PageBatteryCellVoltages.qml"
fileList+=" $qmlDir/PageBatteryParameters.qml"
fileList+=" $qmlDir/PageBatterySettings.qml"
fileList+=" $qmlDir/PageLynxIonIo.qml"
for file in $fileList ; do
sed -i -e 's/QtQuick 2/QtQuick 1.1/' "$file"
done
fi

# Some class names changed with this Venus OS version
versionStringToNumber "v3.00~14"

# change files in the destination folder, else the files are "broken" if upgrading to a the newer Venus OS version
qmlDir="$pathGuiV1/qml"

if (( $venusVersionNumber < $versionNumber )); then
echo -n "Venus OS $(head -n 1 /opt/victronenergy/version) is older than v3.00~14. Fixing class names... "
echo "Venus OS $(head -n 1 /opt/victronenergy/version) is older than v3.00~14. Fixing class names... "
fileList="$qmlDir/PageBattery.qml"
fileList+=" $qmlDir/PageBatteryCellVoltages.qml"
fileList+=" $qmlDir/PageBatteryParameters.qml"
Expand Down Expand Up @@ -204,7 +222,7 @@ if [ -d "$pathGuiV2" ]; then
qmlDir="$pathGuiV2/Victron/VenusOS/pages/settings/devicelist/battery"

if (( $venusVersionNumber < $versionNumber )); then
echo -n "Venus OS $(head -n 1 /opt/victronenergy/version) is older than v3.60~8. Fixing class names... "
echo "Venus OS $(head -n 1 /opt/victronenergy/version) is older than v3.60~8. Fixing class names... "
fileList="$qmlDir/PageBattery.qml"
fileList+=" $qmlDir/PageBatteryCellVoltages.qml"
fileList+=" $qmlDir/PageBatteryParameters.qml"
Expand All @@ -227,7 +245,7 @@ if [ -d "$pathGuiV2" ]; then
qmlDir="$pathGuiV2/Victron/VenusOS/pages/settings/devicelist/battery"

if (( $venusVersionNumber < $versionNumber )); then
echo -n "Venus OS $(head -n 1 /opt/victronenergy/version) is older than v3.60~18. Fixing property names... "
echo "Venus OS $(head -n 1 /opt/victronenergy/version) is older than v3.60~18. Fixing property names... "
fileList="$qmlDir/PageBattery.qml"
fileList+=" $qmlDir/PageBatteryCellVoltages.qml"
fileList+=" $qmlDir/PageBatteryParameters.qml"
Expand All @@ -237,7 +255,7 @@ if [ -d "$pathGuiV2" ]; then
sed -i -e 's/preferredVisible:/allowed: defaultAllowed \&\&/' "$file"
done

echo -n "Venus OS $(head -n 1 /opt/victronenergy/version) is older than v3.60~18. Fixing battery object... "
echo "Venus OS $(head -n 1 /opt/victronenergy/version) is older than v3.60~18. Fixing battery object... "
sed -i -e 's/required property string bindPrefix/property string bindPrefix: battery.serviceUid/' "$qmlDir/PageBattery.qml"
sed -i -e '/Device {/{N;N;N;s/Device {\n\t\tid: battery\n\t\tserviceUid: root.bindPrefix\n\t}/property var battery/}' "$qmlDir/PageBattery.qml"
fi
Expand Down
2 changes: 1 addition & 1 deletion dbus-serialbattery/qml/gui-v1/PageBattery.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import QtQuick 1.1
import QtQuick 2
import com.victron.velib 1.0

MbPage {
Expand Down
2 changes: 1 addition & 1 deletion dbus-serialbattery/qml/gui-v1/PageBatteryCellVoltages.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import QtQuick 1.1
import QtQuick 2
import com.victron.velib 1.0

MbPage {
Expand Down
2 changes: 1 addition & 1 deletion dbus-serialbattery/qml/gui-v1/PageBatteryParameters.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import QtQuick 1.1
import QtQuick 2
import com.victron.velib 1.0

MbPage {
Expand Down
4 changes: 2 additions & 2 deletions dbus-serialbattery/qml/gui-v1/PageBatterySettings.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import QtQuick 1.1
import QtQuick 2
import com.victron.velib 1.0
import "utils.js" as Utils

Expand Down Expand Up @@ -57,7 +57,7 @@ MbPage {
show: valid
}


MbSpinBox {
description: "Reset SoC to"
item.bind: Utils.path(bindPrefix, "/Settings/ResetSoc")
Expand Down
2 changes: 1 addition & 1 deletion dbus-serialbattery/qml/gui-v1/PageLynxIonIo.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import QtQuick 1.1
import QtQuick 2
import "utils.js" as Utils

MbPage {
Expand Down
2 changes: 1 addition & 1 deletion dbus-serialbattery/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


# CONSTANTS
DRIVER_VERSION: str = "2.0.20250120dev"
DRIVER_VERSION: str = "2.0.20250131dev"
"""
current version of the driver
"""
Expand Down

0 comments on commit 43f0c2f

Please sign in to comment.