Skip to content

Commit 98d2b7f

Browse files
committed
Add new global variable for isGxDevice, and mock toggle
1 parent fe66b20 commit 98d2b7f

File tree

6 files changed

+13
-6
lines changed

6 files changed

+13
-6
lines changed

ApplicationContent.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Item {
9898
id: loader
9999

100100
asynchronous: true
101-
active: Qt.platform.os == "linux" && !Global.isDesktop
101+
active: Global.isGxDevice
102102
source: "qrc:/qt/qml/Victron/VenusOS/components/InputPanel.qml"
103103
onLoaded: {
104104
item.mainViewItem = mainView

Global.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ QtObject {
6060
property string firmwareInstalledBuild // don't clear this on UI reload. it needs to survive reconnection.
6161
property bool firmwareInstalledBuildUpdated // as above.
6262
property bool isDesktop
63+
property bool isGxDevice: Qt.platform.os === "linux" && !isDesktop
6364
property real scalingRatio: 1.0
6465

6566
property bool animationEnabled: true // for mock mode only.

components/ThreePhaseBarGauge.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Flow {
5858
anchors.right: parent.right
5959
width: parent.width - (phaseLabel.visible ? phaseLabel.width : 0)
6060
height: parent.height
61-
sourceComponent: (Qt.platform.os === "linux" && !Global.isDesktop) ? cheapGauge : prettyGauge
61+
sourceComponent: Global.isGxDevice ? cheapGauge : prettyGauge
6262
readonly property bool feedingToGrid: root.inputMode
6363
&& (model.power || 0) < 0
6464
&& Global.systemSettings.essFeedbackToGridEnabled

data/mock/config/MockDataSimulator.qml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ QtObject {
120120
Theme.colorScheme = Theme.colorScheme == Theme.Dark ? Theme.Light : Theme.Dark
121121
event.accepted = true
122122
break
123+
case Qt.Key_E:
124+
if (!!Global) {
125+
Global.isGxDevice = !Global.isGxDevice
126+
event.accepted = true
127+
}
128+
break
123129
case Qt.Key_F:
124130
{
125131
// Toggle ESS feed-in

pages/BriefSidePanel.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ exported power v 0.4 | /
205205
onNextValueRequested: addValue(dcInputRange.valueAsRatio)
206206
}
207207

208-
bottomComponent: (Qt.platform.os === "linux" && !Global.isDesktop) ? cheapGaugeDcInput : prettyGaugeDcInput
208+
bottomComponent: Global.isGxDevice ? cheapGaugeDcInput : prettyGaugeDcInput
209209

210210
ValueRange {
211211
id: dcInputRange
@@ -272,7 +272,7 @@ exported power v 0.4 | /
272272
onNextValueRequested: addValue(dcLoadRange.valueAsRatio)
273273
}
274274

275-
bottomComponent: (Qt.platform.os === "linux" && !Global.isDesktop) ? cheapGaugeDcLoad : prettyGaugeDcLoad
275+
bottomComponent: Global.isGxDevice ? cheapGaugeDcLoad : prettyGaugeDcLoad
276276

277277
ValueRange {
278278
id: dcLoadRange

pages/OverviewPage.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,9 +566,9 @@ SwipeViewPage {
566566

567567
// Limit the frame rate of widget connector animations
568568
// to 20fps on the GX products
569-
property bool notLimitFps: Qt.platform.os !== "linux" || Global.isDesktop
569+
property bool limitFps: Global.isGxDevice
570570
property real animationElapsed
571-
onTriggered: if (notLimitFps || (currentFrame % 3 == 0)) animationElapsed = elapsedTime
571+
onTriggered: if (!limitFps || (currentFrame % 3 == 0)) animationElapsed = elapsedTime
572572

573573
onRunningChanged: {
574574
if (!running) {

0 commit comments

Comments
 (0)