diff --git a/FileSets/v3.30/PageSettingsGuiMods.qml b/FileSets/v3.30/PageSettingsGuiMods.qml index 191ce2c0..d970729b 120000 --- a/FileSets/v3.30/PageSettingsGuiMods.qml +++ b/FileSets/v3.30/PageSettingsGuiMods.qml @@ -1 +1 @@ -../v3.40/PageSettingsGuiMods.qml \ No newline at end of file +../v3.41/PageSettingsGuiMods.qml \ No newline at end of file diff --git a/FileSets/v3.31/PageSettingsGuiMods.qml b/FileSets/v3.31/PageSettingsGuiMods.qml index 191ce2c0..d970729b 120000 --- a/FileSets/v3.31/PageSettingsGuiMods.qml +++ b/FileSets/v3.31/PageSettingsGuiMods.qml @@ -1 +1 @@ -../v3.40/PageSettingsGuiMods.qml \ No newline at end of file +../v3.41/PageSettingsGuiMods.qml \ No newline at end of file diff --git a/FileSets/v3.33/OverviewGeneratorEnhanced.qml b/FileSets/v3.33/OverviewGeneratorEnhanced.qml index 5d2ad08e..78f519a0 120000 --- a/FileSets/v3.33/OverviewGeneratorEnhanced.qml +++ b/FileSets/v3.33/OverviewGeneratorEnhanced.qml @@ -1 +1 @@ -../v3.40/OverviewGeneratorEnhanced.qml \ No newline at end of file +../v3.41/OverviewGeneratorEnhanced.qml \ No newline at end of file diff --git a/FileSets/v3.33/PageGenerator.qml b/FileSets/v3.33/PageGenerator.qml index 4c7f9a19..3ba5a567 120000 --- a/FileSets/v3.33/PageGenerator.qml +++ b/FileSets/v3.33/PageGenerator.qml @@ -1 +1 @@ -../v3.40/PageGenerator.qml \ No newline at end of file +../v3.41/PageGenerator.qml \ No newline at end of file diff --git a/FileSets/v3.33/PageSettingsGuiMods.qml b/FileSets/v3.33/PageSettingsGuiMods.qml index 191ce2c0..d970729b 120000 --- a/FileSets/v3.33/PageSettingsGuiMods.qml +++ b/FileSets/v3.33/PageSettingsGuiMods.qml @@ -1 +1 @@ -../v3.40/PageSettingsGuiMods.qml \ No newline at end of file +../v3.41/PageSettingsGuiMods.qml \ No newline at end of file diff --git a/FileSets/v3.34/OverviewGeneratorEnhanced.qml b/FileSets/v3.34/OverviewGeneratorEnhanced.qml index 5d2ad08e..78f519a0 120000 --- a/FileSets/v3.34/OverviewGeneratorEnhanced.qml +++ b/FileSets/v3.34/OverviewGeneratorEnhanced.qml @@ -1 +1 @@ -../v3.40/OverviewGeneratorEnhanced.qml \ No newline at end of file +../v3.41/OverviewGeneratorEnhanced.qml \ No newline at end of file diff --git a/FileSets/v3.34/PageGenerator.qml b/FileSets/v3.34/PageGenerator.qml index 4c7f9a19..3ba5a567 120000 --- a/FileSets/v3.34/PageGenerator.qml +++ b/FileSets/v3.34/PageGenerator.qml @@ -1 +1 @@ -../v3.40/PageGenerator.qml \ No newline at end of file +../v3.41/PageGenerator.qml \ No newline at end of file diff --git a/FileSets/v3.34/PageSettingsGuiMods.qml b/FileSets/v3.34/PageSettingsGuiMods.qml index 191ce2c0..d970729b 120000 --- a/FileSets/v3.34/PageSettingsGuiMods.qml +++ b/FileSets/v3.34/PageSettingsGuiMods.qml @@ -1 +1 @@ -../v3.40/PageSettingsGuiMods.qml \ No newline at end of file +../v3.41/PageSettingsGuiMods.qml \ No newline at end of file diff --git a/FileSets/v3.40/LINKS_ONLY b/FileSets/v3.40/LINKS_ONLY new file mode 100644 index 00000000..e69de29b diff --git a/FileSets/v3.40/OverviewGeneratorEnhanced.qml b/FileSets/v3.40/OverviewGeneratorEnhanced.qml deleted file mode 100644 index 0c189315..00000000 --- a/FileSets/v3.40/OverviewGeneratorEnhanced.qml +++ /dev/null @@ -1,547 +0,0 @@ -// GuiMods enhanced generator overview -// This file has been modified to: -// add Auto Start display and control -// show voltage, current, frequency, and power gauge in AC input tile -// show the generator running state inside the icon top left -// show a warning when the generator digital input and expected generator state disagree -// move current run time to separate tile - -import QtQuick 1.1 -import "utils.js" as Utils -import "enhancedFormat.js" as EnhFmt - -OverviewPage { - id: root - - property string settingsBindPrefix - property string bindPrefix - property variant sys: theSystem -//////// added to show alternator in place of inactive genset - property string guiModsPrefix: "com.victronenergy.settings/Settings/GuiMods" - VBusItem { id: replaceAcInItem; bind: Utils.path(guiModsPrefix, "/ReplaceInactiveAcIn") } - property bool hasAlternator: sys.alternator.power.valid - property bool showAlternator: replaceAcInItem.valid && replaceAcInItem.value == 1 && hasAlternator && ! sys.genset.power.valid - property bool showAcIn: ! showAlternator - - property string icon: "overview-generator" - property VBusItem state: VBusItem { bind: Utils.path(bindPrefix, "/State") } - property VBusItem error: VBusItem { bind: Utils.path(bindPrefix, "/Error") } - property VBusItem runningTime: VBusItem { bind: Utils.path(bindPrefix, "/Runtime") } - property VBusItem runningBy: VBusItem { bind: Utils.path(bindPrefix, "/RunningByConditionCode") } - VBusItem { id: totalAcummulatedTime; bind: Utils.path(settingsBindPrefix, "/AccumulatedTotal") } - VBusItem { id: totalAccumulatedTimeOffset; bind: Utils.path(settingsBindPrefix, "/AccumulatedTotalOffset") } - property VBusItem quietHours: VBusItem { bind: Utils.path(bindPrefix, "/QuietHours") } - property VBusItem testRunDuration: VBusItem { bind: Utils.path(settingsBindPrefix, "/TestRun/Duration") } - property VBusItem nextTestRun: VBusItem { bind: Utils.path(bindPrefix, "/NextTestRun") } - property VBusItem skipTestRun: VBusItem { bind: Utils.path(bindPrefix, "/SkipTestRun") } - - property VBusItem todayRuntime: VBusItem { bind: Utils.path(bindPrefix, "/TodayRuntime") } - property VBusItem manualTimer: VBusItem { bind: Utils.path(bindPrefix, "/ManualStartTimer") } - property VBusItem autoStart: VBusItem { bind: Utils.path(settingsBindPrefix, "/AutoStartEnabled") } - - property bool errors: ! state.valid || state.value == 10 - - property VBusItem externalOverrideItem: VBusItem { bind: Utils.path(bindPrefix, "/ExternalOverride") } - property bool externalOverride: externalOverrideItem.valid && externalOverrideItem.value == 1 && ! errors - property VBusItem runningState: VBusItem { bind: Utils.path(bindPrefix, "/GeneratorRunningState") } - - VBusItem { id: showGaugesItem; bind: Utils.path(guiModsPrefix, "/ShowGauges") } - property bool showGauges: showGaugesItem.valid ? showGaugesItem.value === 1 ? true : false : false - property bool editMode: autoRunTile.editMode || manualTile.editMode - - VBusItem { id: serviceInterval; bind: Utils.path(settingsBindPrefix, "/ServiceInterval") } - VBusItem { id: serviceCounterItem; bind: Utils.path(bindPrefix, "/ServiceCounter") } - property bool showServiceInfo: serviceCounterItem.valid && serviceInterval.valid && serviceInterval.value > 0 - property bool serviceOverdue: showServiceInfo && serviceCounterItem.value < 0 - -//////// add to display AC input ignored - VBusItem { id: ignoreAcInput1; bind: Utils.path(sys.vebusPrefix, "/Ac/State/IgnoreAcIn1") } - VBusItem { id: ignoreAcInput2; bind: Utils.path(sys.vebusPrefix, "/Ac/State/IgnoreAcIn2") } - VBusItem { id: acActiveInput; bind: Utils.path(sys.vebusPrefix, "/Ac/ActiveIn/ActiveInput") } - VBusItem { id: ac1source; bind: Utils.path("com.victronenergy.settings", "/Settings/SystemSetup/AcInput1") } - VBusItem { id: ac2source; bind: Utils.path("com.victronenergy.settings", "/Settings/SystemSetup/AcInput2") } - - title: qsTr("Generator") - - property bool autoStartSelected: false - - Component.onCompleted: - { - setFocusManual () - } - - Keys.forwardTo: [keyHandler] - Item - { - id: keyHandler - Keys.onUpPressed: - { - setFocusAuto () - event.accepted = true - } - Keys.onDownPressed: - { - setFocusManual () - event.accepted = true - } - // prevents page changes while timers are running - //// Keys.onReturnPressed: event.accepted = manualTile.startCountdown || autoRunTile.startCountdown - //// Keys.onEscapePressed: event.accepted = manualTile.startCountdown || autoRunTile.startCountdown - } - - function setFocusManual () - { - autoStartSelected = false - } - - function setFocusAuto () - { - autoStartSelected = true - } - - function formatTime (time) - { - if (time >= 3600) - return (time / 3600).toFixed(0) + " h" - else - return (time / 60).toFixed(0) + " m" - } - - function stateDescription() - { - if (!state.valid) - return qsTr ("") - else if (state.value === 10) - { - switch(error.value) - { - case 1: - return qsTr("Error: Remote switch control disabled") - case 2: - return qsTr("Error: Generator in fault condition") - case 3: - return qsTr("Error: Generator not detected at AC input") - default: - return qsTr("Error") - } - } - else - { - var condition = "" - var running = true - var manual = false - switch (runningBy.value) - { - case 0: // stopped - condition = "" - running = false - break;; - case 1: - manual = true - condition = "" - break;; - case 2: - condition = qsTr("Test run") - break;; - case 3: - condition = qsTr("Loss of communication") - break;; - case 4: - condition = qsTr("SOC") - break;; - case 5: - condition = qsTr("AC load") - break;; - case 6: - condition = qsTr("Battery current") - break;; - case 7: - condition = qsTr("Battery voltage") - break;; - case 8: - condition = qsTr("Inverter temperature") - break;; - case 9: - condition = qsTr("Inverter overload") - break;; - default: - condition = qsTr("???") - break;; - } - - if (externalOverride) - { - if (running && ! manual) - return qsTr ("auto pending: ") + condition - else - return " " - } - else if (manual) - { - if (manualTimer.valid && manualTimer.value > 0) - return qsTr("Timed run") - else - return qsTr("Manual run") - } - else if (running) - return qsTr ("auto run: ") + condition - else - return " " - } - } - - function getNextTestRun() - { - if ( ! root.state.valid) - return "" - if (!nextTestRun.value) - return qsTr("No test run programmed") - - var todayDate = new Date() - var nextDate = new Date(nextTestRun.value * 1000) - var nextDateEnd = new Date(nextDate.getTime()) - var message = "" - // blank "next run" if test run is active - if (runningBy.value == 2) - return " " - else if (todayDate.getDate() == nextDate.getDate() && todayDate.getMonth() == nextDate.getMonth()) - { - message = qsTr("Next test run today %1").arg( - Qt.formatDateTime(nextDate, "hh:mm").toString()) - } - else - { - message = qsTr("Next test run on %1").arg( - Qt.formatDateTime(nextDate, "dd/MM/yyyy").toString()) - nextDateEnd.setSeconds(testRunDuration.value) } - - if (skipTestRun.value === 1) - message += qsTr(" \(skipped\)") - - return message - } - - Tile { - id: imageTile - width: 180 - height: 136 - MbIcon { - id: generator - iconId: icon - anchors.centerIn: parent - } - anchors { top: parent.top; left: parent.left } - values: [ - // spacer - TileText { - width: imageTile.width - 5 - text: " " - font.pixelSize: 62 - }, - TileText { - width: imageTile.width - 5 - text: runningState.valid ? runningState.value == "R" ? "Running " : runningState.value == "S" ? "Stopped " : "" : "" - } - ] - } - - Tile { - id: statusTile - height: imageTile.height - color: "#4789d0" - anchors { top: parent.top; left: imageTile.right; right: root.right } - title: qsTr("STATUS") - values: [ - TileText - { - width: statusTile.width - 5 - color: externalOverride ? "yellow" : "white" - text: - { - var runPrefix - var message - if ( ! root.state.valid) - return qsTr ("Generator not connected") - else if (root.state.value === 2) - runPrefix = qsTr("Warming up for ") - else - runPrefix = qsTr ("Running for ") - if (!root.state.valid) - message = "" - else if (externalOverride) - message = qsTr("External Override - stopped") - else if (root.state.value === 3) - message = qsTr("Cool-down") - else if (root.state.value === 4) - message = qsTr("Stopping") - else if (runningBy.value == 0) - message = qsTr ("Stopped") - else if ( ! runningTime.valid) - message = runPrefix + "??" - else - { - message = runPrefix + formatTime (runningTime.value) - if (manualTimer.valid && manualTimer.value > 0) - message += qsTr (" ends in ") + formatTime (manualTimer.value) - } - return message - } - }, - Rectangle - { - width: parent.width - height: 3 - color: "transparent" - }, - TileTextMultiLine - { - text: stateDescription() - width: statusTile.width - 5 - }, - Rectangle - { - width: parent.width - height: 3 - color: "transparent" - }, - TileText - { - text: qsTr("\nQuiet hours"); - width: statusTile.width - 5 - font.bold: runningBy.valid && runningBy.value != 0 - color: font.bold ? "yellow" : "white" - visible: quietHours.value === 1 - }, - Rectangle - { - width: parent.width - height: 3 - color: "transparent" - }, - TileTextMultiLine - { - width: statusTile.width - 5 - text: getNextTestRun() - } - ] - } - - Tile { - id: acInTile - title: qsTr("GENERATOR POWER") - width: 150 - height: 136 - color: "#82acde" - anchors { top: imageTile.bottom; left: parent.left } - visible: showAcIn - values: - [ - OverviewAcValuesEnhanced - { - connection: sys.genset - visible: sys.genset.power.valid - }, - TileText - { - width: acInTile.width - 5 - text: - { - if (ac1source.valid && ac1source.value == 2) - { - if (ignoreAcInput1.valid && ignoreAcInput1.value == 1) - return qsTr ("\nAC In Ignored\nduring\ngenerator\nstart / stop") - else - return "" - } - else if (ac2source.valid && ac2source.value == 2) - { - if (ignoreAcInput2.valid && ignoreAcInput2.value == 1) - return qsTr ("\nAC In Ignored\nduring\ngenerator\nstart / stop") - else - return "" - } - else - return qsTr ("\nAC In\nis not\ngenerator") - } - visible: !sys.genset.power.valid - } - ] -////// add power bar graph - PowerGauge - { - id: acInBar - width: parent.width - height: 12 - anchors - { - top: parent.top; topMargin: 20 - horizontalCenter: parent.horizontalCenter - } - connection: sys.genset - useInputCurrentLimit: true - maxForwardPowerParameter: "" - maxReversePowerParameter: "" - visible: showGauges && sys.genset.power.valid - } - } - -//////// added to show alternator in place of AC generator - Tile { - id: alternatorTile - title: qsTr("ALTERNATOR POWER") - color: "#157894" - anchors.fill: acInTile - visible: showAlternator - values: - [ - TileText - { - text: EnhFmt.formatVBusItem (sys.alternator.power, "W") - font.pixelSize: 22 - } - ] -////// add power bar graph - PowerGauge - { - id: alternatorGauge - width: parent.width - height: 12 - anchors - { - top: parent.top; topMargin: 20 - horizontalCenter: parent.horizontalCenter - } - connection: sys.alternator - maxForwardPowerParameter: "com.victronenergy.settings/Settings/GuiMods/GaugeLimits/MaxAlternatorPower" - visible: showGauges && showAlternator - } - } - - Tile { - id: runTimeTile - title: qsTr("RUN TIMES") - width: 140 - anchors { top: acInTile.top; bottom: parent.bottom; left: acInTile.right } - values: [ - TileText - { - width: runTimeTile.width - 5 - text: qsTr ("Today") - }, - TileText { - width: runTimeTile.width - 5 - text: todayRuntime.valid ? formatTime (todayRuntime.value) : "--" - }, - Rectangle - { - width: parent.width - height: 3 - color: "transparent" - }, - TileText - { - width: runTimeTile.width - 5 - text: qsTr ("Accumulated") - }, - TileText - { - width: runTimeTile.width - 5 - text: - { - if ( ! totalAcummulatedTime.valid) - return "--" - else if (totalAccumulatedTimeOffset.valid ) - return formatTime (totalAcummulatedTime.value - totalAccumulatedTimeOffset.value) - else - return formatTime (totalAcummulatedTime.value) - } - }, - Rectangle - { - width: parent.width - height: 3 - color: "transparent" - }, - TileText - { - width: runTimeTile.width - 5 - visible: showServiceInfo - color: serviceOverdue ? "red" : "white" - text: serviceOverdue ? qsTr ("Service OVERDUE") : qsTr ("Service in") - }, - TileText - { - width: runTimeTile.width - 5 - visible: showServiceInfo - color: serviceOverdue ? "red" : "white" - text: formatTime (Math.abs (serviceCounterItem.value)) - } - ] - } - - TileAutoRunEnhanced - { - id: autoRunTile - bindPrefix: root.bindPrefix - focus: root.active && autoStartSelected - connected: state.valid - tileHeight: acInTile.height / 2 - anchors { - bottom: parent.bottom; bottomMargin: tileHeight - left: runTimeTile.right - right: parent.right - } - } - - TileManualStartEnhanced - { - id: manualTile - bindPrefix: root.bindPrefix - focus: root.active && ! autoStartSelected - connected: state.valid - tileHeight: acInTile.height / 2 - anchors { - bottom: parent.bottom - left: runTimeTile.right - right: parent.right - } - } - - // mouse areas must be AFTER their associated objects so those objects can catch mouse events - // rejected by these areas - // mouse targets need to be disabled while changes are pending - MouseArea { - id: autoRunTarget - anchors.fill: autoRunTile - enabled: root.active && ! editMode - onPressed: - { - if ( ! root.autoStartSelected ) - { - setFocusAuto () - mouse.accepted = true - } - else - { - mouse.accepted = false - } - } - } - MouseArea { - id: manualStartTarget - anchors.fill: manualTile - enabled: root.active && ! editMode - onPressed: - { - if ( root.autoStartSelected ) - { - setFocusManual () - mouse.accepted = true - } - else - { - mouse.accepted = false - } - } - } -} diff --git a/FileSets/v3.40/OverviewGeneratorEnhanced.qml b/FileSets/v3.40/OverviewGeneratorEnhanced.qml new file mode 120000 index 00000000..78f519a0 --- /dev/null +++ b/FileSets/v3.40/OverviewGeneratorEnhanced.qml @@ -0,0 +1 @@ +../v3.41/OverviewGeneratorEnhanced.qml \ No newline at end of file diff --git a/FileSets/v3.40/PageGenerator.qml b/FileSets/v3.40/PageGenerator.qml deleted file mode 100644 index edad721c..00000000 --- a/FileSets/v3.40/PageGenerator.qml +++ /dev/null @@ -1,159 +0,0 @@ -//// changed total time to hours (from varilable format) - -import QtQuick 1.1 -import com.victron.velib 1.0 -import "utils.js" as Utils - -MbPage { - id: generator - title: qsTr("Generator start/stop") - property string settingsBindPrefix - property string startStopBindPrefix - property alias startStopModel: _startStopModel - property VBusItem activeCondition: VBusItem { bind: Utils.path(startStopBindPrefix, "/RunningByCondition") } - property VBusItem generatorState: VBusItem { bind: Utils.path(startStopBindPrefix, "/State") } - property VBusItem runningTime: VBusItem { bind: Utils.path(startStopBindPrefix, "/Runtime") } - property VBusItem historicalData: VBusItem { bind: Utils.path(settingsBindPrefix, "/AccumulatedDaily") } - - FnGeneratorStates { - id: genState - } - -//// changed total time to hours (from varilable format) - function formatTime (time) - { - if (time >= 3600) - return (time / 3600).toFixed(0) + " h" - else - return (time / 60).toFixed(0) + " m" - } - - model: startStopModel - - function formatError(text, value) - { - return "#" + value.toString() + " " + text - } - - VisibleItemModel { - id: _startStopModel - - MbItemValue { - description: qsTr("State") - show: startStopBindPrefix === "com.victronenergy.generator.startstop0" - item.text: activeCondition.valid ? genState.getState(generatorState.value, activeCondition.value) : '---' - } - - MbItemOptions { - id: _gensetStatus - description: qsTr("Error") - bind: Utils.path(startStopBindPrefix, "/Error") - readonly: true - show: valid && startStopBindPrefix === "com.victronenergy.generator.startstop0" - possibleValues: [ - MbOption { description: qsTr("No error"); value: 0 }, - MbOption { description: formatError(qsTr("Remote switch control disabled"), 1); value: 1 }, - MbOption { description: formatError(qsTr("Generator in fault condition"), 2); value: 2 }, - MbOption { description: formatError(qsTr("Generator not detected at AC input"), 3); value: 3 } - ] - } - - MbItemValue { - description: qsTr("Run time") - item.text: runningTime.valid ? Utils.secondsToNoSecsString(runningTime.value) : "0" - show: generatorState.value in [1, 2, 3] // Running, Warm-up, Cool-down - } - - MbItemValue { - description: qsTr("Total run time") - item { - bind: Utils.path(settingsBindPrefix, "/AccumulatedTotal") - //// changed total time to hours (from varilable format) - text: formatTime (item.value - accumulatedTotalOffset.value) - } - VBusItem { - id: accumulatedTotalOffset - bind: Utils.path(settingsBindPrefix, "/AccumulatedTotalOffset") - } - } - - MbItemValue { - description: qsTr("Time to service") - show: item.valid - item { - bind: Utils.path(startStopBindPrefix, "/ServiceCounter") - text: qsTr("%1h").arg((item.value / 60 / 60).toFixed(0)) - } - } - - MbItemValue { - description: qsTr("Accumulated running time since last test run") - show: user.accessLevel >= User.AccessService && nextTestRun.show - backgroundColor: style.backgroundColorService - item { - text: Utils.secondsToNoSecsString(item.value) - bind: Utils.path(startStopBindPrefix, "/TestRunIntervalRuntime") - } - } - - MbItemValue { - id: nextTestRun - description: qsTr("Time to next test run") - show: item.valid && item.value > 0 - item { - text: { - var remainingTime = item.value - new Date().getTime() / 1000 - if (remainingTime > 0) - return Utils.secondsToNoSecsString(remainingTime).toString() - return qsTr("Running now") - } - bind: Utils.path(startStopBindPrefix, "/NextTestRun") - } - } - - MbSwitch { - name: qsTr("Auto start functionality") - bind: Utils.path(startStopBindPrefix, "/AutoStartEnabled") - show: startStopBindPrefix === "com.victronenergy.generator.startstop0" - } - - MbSubMenu { - description: qsTr("Manual start") - show: startStopBindPrefix === "com.victronenergy.generator.startstop0" - subpage: - Component { - PageGeneratorManualStart { - startStopBindPrefix: generator.startStopBindPrefix - } - } - } - - MbSubMenu { - description: qsTr("Daily run time") - subpage: MbPage { - // Invert the order - property variant keys: historicalData.valid ? - Object.keys(JSON.parse(historicalData.value)).reverse() : 0 - - title: qsTr("Daily run time") - focus: active - model: keys - delegate: MbItemValue { - description: Qt.formatDate(new Date(parseInt(keys[index]) * 1000), "dd-MM-yyyy"); - item.text: Utils.secondsToNoSecsString(JSON.parse(historicalData.value)[keys[index]]) - } - } - } - - MbSubMenu { - id: conditions - description: qsTr("Settings") - subpage: Component { - PageSettingsGenerator { - settingsBindPrefix: generator.settingsBindPrefix - startStopBindPrefix: generator.startStopBindPrefix - } - } - } - } -} diff --git a/FileSets/v3.40/PageGenerator.qml b/FileSets/v3.40/PageGenerator.qml new file mode 120000 index 00000000..3ba5a567 --- /dev/null +++ b/FileSets/v3.40/PageGenerator.qml @@ -0,0 +1 @@ +../v3.41/PageGenerator.qml \ No newline at end of file diff --git a/FileSets/v3.40/PageSettingsGuiMods.qml b/FileSets/v3.40/PageSettingsGuiMods.qml deleted file mode 100644 index 420a42ac..00000000 --- a/FileSets/v3.40/PageSettingsGuiMods.qml +++ /dev/null @@ -1,290 +0,0 @@ -/////// new menu for all Gui Mods - -import QtQuick 1.1 -import "utils.js" as Utils -import com.victron.velib 1.0 - -MbPage { - id: root - title: qsTr("Gui Mods") - property string bindPrefixGuiMods: "com.victronenergy.settings/Settings/GuiMods" - property string bindPrefix: "com.victronenergy.settings/Settings/Gui" - property VBusItem systemScaleItem: VBusItem { bind: "com.victronenergy.settings/Settings/System/Units/Temperature" } - - property bool showFlowParams: flowOverview.item.valid && flowOverview.item.value >= 1 - property bool showComplexParams: flowOverview.item.valid && flowOverview.item.value >= 2 - property bool showAcCoupledParams: flowOverview.item.valid && flowOverview.item.value == 3 - - model: VisibleItemModel - { - MbSwitch - { - id: showTileOverview - bind: Utils.path (bindPrefixGuiMods, "/ShowTileOverview") - name: qsTr ("Show Tile Overview") - writeAccessLevel: User.AccessUser - } - - MbSwitch - { - id: moveSettings - bind: Utils.path (bindPrefixGuiMods, "/MoveSettings") - name: qsTr ("Move Settings to top of Device List") - writeAccessLevel: User.AccessUser - } - - MbSwitch { - id: relayOverview - bind: Utils.path (bindPrefixGuiMods, "/ShowRelayOverview") - name: qsTr ("Show Relay overview") - writeAccessLevel: User.AccessUser - } - MbSwitch { - id: tanksTempsOverview - bind: Utils.path (bindPrefixGuiMods, "/ShowTanksTempsDigIn") - name: qsTr ("Show Tanks, Temps, Digital Input overview") - writeAccessLevel: User.AccessUser - } - - MbSwitch - { - id: useEnhGeneratorOverview - bind: Utils.path (bindPrefixGuiMods, "/UseEnhancedGeneratorOverview") - name: qsTr ("Use Enhanced Generator Overview") - writeAccessLevel: User.AccessUser - } - - // duplicate mobile overview on/off here for convenience - MbSwitch { - id: mobileOverview - bind: Utils.path (bindPrefix, "/MobileOverview") - name: qsTr ("Show boat & motorhome overview") - writeAccessLevel: User.AccessUser - } - MbSwitch - { - id: useEnhMobileOverview - bind: Utils.path (bindPrefixGuiMods, "/UseEnhancedMobileOverview") - name: qsTr ("Use Enhanced Mobile Overview") - // When enabled set Enhanced OverviewMobile as default overview - onClicked: - { - if (!checked) - { - // also enable Mobile Overview when turning on use enhanced Mobile Overview - showMobileOverview.setValue (1) - } - } - VBusItem { id: showMobileOverview; bind: Utils.path (bindPrefix, "/MobileOverview") } - writeAccessLevel: User.AccessUser - } - MbItemOptions - { - id: flowOverview - description: qsTr("Flow overview") - bind: Utils.path (bindPrefixGuiMods, "/FlowOverview") - possibleValues: - [ - MbOption {description: qsTr("Victron stock"); value: 0}, - MbOption {description: qsTr("GuiMods simple"); value: 1}, - MbOption {description: qsTr("GuiMods DC Coupled"); value: 2}, - MbOption {description: qsTr("GuiMods AC Coupled"); value: 3} - ] - } - - MbSwitch - { - id: combineLoads - bind: Utils.path (bindPrefixGuiMods, "/EnhancedFlowCombineLoads") - name: qsTr ("Combine AC input/ouput loads") - show: root.showAcCoupledParams - writeAccessLevel: User.AccessInstaller - } - MbSwitch - { - id: showLoadsOnInput - bind: Utils.path (bindPrefixGuiMods, "/ShowEnhancedFlowLoadsOnInput") - name: qsTr ("Show Loads On Input") - show: root.showAcCoupledParams && ! combineLoads.checked - writeAccessLevel: User.AccessInstaller - } - - MbSwitch - { - id: showTanks - bind: Utils.path (bindPrefixGuiMods, "/ShowEnhancedFlowOverviewTanks") - name: qsTr ("Show tanks on Flow Overview") - show: root.showFlowParams - writeAccessLevel: User.AccessUser - } - MbItemOptions - { - id: tankFormat - description: qsTr("Tank bar format") - bind: Utils.path (bindPrefixGuiMods, "/TankBarFormat") - possibleValues: - [ - MbOption {description: qsTr("%"); value: 1}, - MbOption {description: qsTr("units"); value: 2}, - MbOption {description: qsTr("% + units"); value: 0} - ] - } - MbSwitch - { - id: showTemps - bind: Utils.path (bindPrefixGuiMods, "/ShowEnhancedFlowOverviewTemps") - name: qsTr ("Show temperatures on Flow Overview") - show: root.showFlowParams - writeAccessLevel: User.AccessUser - } - MbSwitch - { - id: showBatteryTemps - bind: Utils.path (bindPrefixGuiMods, "/ShowBatteryTempOnFlows") - name: qsTr ("Show battery temperature on Flow Overview") - show: showTemps.item.value == 1 - writeAccessLevel: User.AccessUser - } - MbSwitch - { - id: shortenTankNames - bind: Utils.path (bindPrefixGuiMods, "/ShortenTankNames") - name: qsTr ("Shorten tank names") - writeAccessLevel: User.AccessUser - } - MbEditBox { - id: dcSystemName - description: qsTr("DC System tile name") - item.bind: Utils.path (bindPrefixGuiMods, "/CustomDcSystemName") - maximumLength: 32 - enableSpaceBar: true - } - - MbSwitch - { - id: replaceInactiveAcIn - bind: Utils.path (bindPrefixGuiMods, "/ReplaceInactiveAcIn") - name: qsTr ("Replace AC in if inactive") - writeAccessLevel: User.AccessUser - } - - MbSpinBox { - description: qsTr ("AC Input Limit Preset 1") - item - { - bind: Utils.path (bindPrefixGuiMods, "/AcCurrentLimit/Preset1") - unit: "A" - decimals: 0 - step: 1 - min: 0 - max: 999 - } - writeAccessLevel: User.AccessUser - } - - MbSpinBox { - description: qsTr ("AC Input Limit Preset 2") - item - { - bind: Utils.path (bindPrefixGuiMods, "/AcCurrentLimit/Preset2") - unit: "A" - decimals: 0 - step: 1 - min: 0 - max: 999 - } - writeAccessLevel: User.AccessUser - } - - MbSpinBox { - description: qsTr ("AC Input Limit Preset 3") - item - { - bind: Utils.path (bindPrefixGuiMods, "/AcCurrentLimit/Preset3") - unit: "A" - decimals: 0 - step: 1 - min: 0 - max: 999 - } - writeAccessLevel: User.AccessUser - } - - MbSpinBox { - description: qsTr ("AC Input Limit Preset 4") - item - { - bind: Utils.path (bindPrefixGuiMods, "/AcCurrentLimit/Preset4") - unit: "A" - decimals: 0 - step: 1 - min: 0 - max: 999 - } - writeAccessLevel: User.AccessUser - } - - MbItemOptions - { - id: tempScale - description: qsTr ("Temperature scale") - bind: Utils.path (bindPrefixGuiMods, "/TemperatureScale") - show: ! systemScaleItem.valid - possibleValues: - [ - MbOption { description: "°C"; value: 1 }, - MbOption { description: "°F"; value: 2 }, - MbOption { description: qsTr("both °C & °F"); value: 0 } - ] - writeAccessLevel: User.AccessUser - } - - MbSpinBox { - description: qsTr ("Watt / Kilowatt threshold") - item - { - bind: Utils.path (bindPrefixGuiMods, "/KilowattThreshold") - unit: "W" - decimals: 0 - step: 100 - min: 1000 - max: 10000 - } - writeAccessLevel: User.AccessUser - } - - MbItemOptions - { - id: timeFormat - description: qsTr ("Time format") - bind: Utils.path (bindPrefixGuiMods, "/TimeFormat") - possibleValues: - [ - MbOption { description: qsTr("24 hour"); value: 1 }, - MbOption { description: qsTr("12 hour AM/PM"); value: 2 }, - MbOption { description: qsTr("don't show time"); value: 0 } - ] - writeAccessLevel: User.AccessUser - } - MbItemOptions - { - id: inactiveFlowTiles - description: qsTr ("Inactive Tiles on Flow Overview") - bind: Utils.path (bindPrefixGuiMods, "/ShowInactiveFlowTiles") - show: root.showFlowParams - possibleValues: - [ - MbOption { description: qsTr("Show Dimmed"); value: 1 }, - MbOption { description: qsTr("Show Full"); value: 2 }, - MbOption { description: qsTr("Hide"); value: 0 } - ] - writeAccessLevel: User.AccessUser - } - MbSubMenu - { - description: qsTr("Power Gauges") - subpage: Component { PageSettingsGuiModsGauges {} } - show: root.showFlowParams - } - } -} diff --git a/FileSets/v3.40/PageSettingsGuiMods.qml b/FileSets/v3.40/PageSettingsGuiMods.qml new file mode 120000 index 00000000..d970729b --- /dev/null +++ b/FileSets/v3.40/PageSettingsGuiMods.qml @@ -0,0 +1 @@ +../v3.41/PageSettingsGuiMods.qml \ No newline at end of file diff --git a/FileSets/v3.41/COMPLETE b/FileSets/v3.41/COMPLETE new file mode 100644 index 00000000..e69de29b diff --git a/FileSets/v3.41/DetailAcInput.qml b/FileSets/v3.41/DetailAcInput.qml new file mode 120000 index 00000000..4c0205bc --- /dev/null +++ b/FileSets/v3.41/DetailAcInput.qml @@ -0,0 +1 @@ +../v3.50~7/DetailAcInput.qml \ No newline at end of file diff --git a/FileSets/v3.41/DetailInverter.qml b/FileSets/v3.41/DetailInverter.qml new file mode 120000 index 00000000..12fb0ff6 --- /dev/null +++ b/FileSets/v3.41/DetailInverter.qml @@ -0,0 +1 @@ +../v3.50~7/DetailInverter.qml \ No newline at end of file diff --git a/FileSets/v3.41/DetailLoadsCombined.qml b/FileSets/v3.41/DetailLoadsCombined.qml new file mode 120000 index 00000000..99514bae --- /dev/null +++ b/FileSets/v3.41/DetailLoadsCombined.qml @@ -0,0 +1 @@ +../v3.50~7/DetailLoadsCombined.qml \ No newline at end of file diff --git a/FileSets/v3.41/DetailLoadsOnInput.qml b/FileSets/v3.41/DetailLoadsOnInput.qml new file mode 120000 index 00000000..25aa84cb --- /dev/null +++ b/FileSets/v3.41/DetailLoadsOnInput.qml @@ -0,0 +1 @@ +../v3.50~7/DetailLoadsOnInput.qml \ No newline at end of file diff --git a/FileSets/v3.41/DetailLoadsOnOutput.qml b/FileSets/v3.41/DetailLoadsOnOutput.qml new file mode 120000 index 00000000..fb137bef --- /dev/null +++ b/FileSets/v3.41/DetailLoadsOnOutput.qml @@ -0,0 +1 @@ +../v3.50~7/DetailLoadsOnOutput.qml \ No newline at end of file diff --git a/FileSets/v3.41/HubData.qml b/FileSets/v3.41/HubData.qml new file mode 120000 index 00000000..297cdc18 --- /dev/null +++ b/FileSets/v3.41/HubData.qml @@ -0,0 +1 @@ +../v3.50~7/HubData.qml \ No newline at end of file diff --git a/FileSets/v3.41/ObjectAcConnection.qml b/FileSets/v3.41/ObjectAcConnection.qml new file mode 120000 index 00000000..4c0842ba --- /dev/null +++ b/FileSets/v3.41/ObjectAcConnection.qml @@ -0,0 +1 @@ +../v3.50~7/ObjectAcConnection.qml \ No newline at end of file diff --git a/FileSets/v3.41/OverviewAcValuesEnhanced.qml b/FileSets/v3.41/OverviewAcValuesEnhanced.qml new file mode 120000 index 00000000..4bcb9023 --- /dev/null +++ b/FileSets/v3.41/OverviewAcValuesEnhanced.qml @@ -0,0 +1 @@ +../v3.50~7/OverviewAcValuesEnhanced.qml \ No newline at end of file diff --git a/FileSets/v3.41/OverviewFlowComplex.qml b/FileSets/v3.41/OverviewFlowComplex.qml new file mode 120000 index 00000000..06ea3fee --- /dev/null +++ b/FileSets/v3.41/OverviewFlowComplex.qml @@ -0,0 +1 @@ +../v3.50~7/OverviewFlowComplex.qml \ No newline at end of file diff --git a/FileSets/v3.41/OverviewGeneratorEnhanced.qml b/FileSets/v3.41/OverviewGeneratorEnhanced.qml new file mode 100644 index 00000000..0c189315 --- /dev/null +++ b/FileSets/v3.41/OverviewGeneratorEnhanced.qml @@ -0,0 +1,547 @@ +// GuiMods enhanced generator overview +// This file has been modified to: +// add Auto Start display and control +// show voltage, current, frequency, and power gauge in AC input tile +// show the generator running state inside the icon top left +// show a warning when the generator digital input and expected generator state disagree +// move current run time to separate tile + +import QtQuick 1.1 +import "utils.js" as Utils +import "enhancedFormat.js" as EnhFmt + +OverviewPage { + id: root + + property string settingsBindPrefix + property string bindPrefix + property variant sys: theSystem +//////// added to show alternator in place of inactive genset + property string guiModsPrefix: "com.victronenergy.settings/Settings/GuiMods" + VBusItem { id: replaceAcInItem; bind: Utils.path(guiModsPrefix, "/ReplaceInactiveAcIn") } + property bool hasAlternator: sys.alternator.power.valid + property bool showAlternator: replaceAcInItem.valid && replaceAcInItem.value == 1 && hasAlternator && ! sys.genset.power.valid + property bool showAcIn: ! showAlternator + + property string icon: "overview-generator" + property VBusItem state: VBusItem { bind: Utils.path(bindPrefix, "/State") } + property VBusItem error: VBusItem { bind: Utils.path(bindPrefix, "/Error") } + property VBusItem runningTime: VBusItem { bind: Utils.path(bindPrefix, "/Runtime") } + property VBusItem runningBy: VBusItem { bind: Utils.path(bindPrefix, "/RunningByConditionCode") } + VBusItem { id: totalAcummulatedTime; bind: Utils.path(settingsBindPrefix, "/AccumulatedTotal") } + VBusItem { id: totalAccumulatedTimeOffset; bind: Utils.path(settingsBindPrefix, "/AccumulatedTotalOffset") } + property VBusItem quietHours: VBusItem { bind: Utils.path(bindPrefix, "/QuietHours") } + property VBusItem testRunDuration: VBusItem { bind: Utils.path(settingsBindPrefix, "/TestRun/Duration") } + property VBusItem nextTestRun: VBusItem { bind: Utils.path(bindPrefix, "/NextTestRun") } + property VBusItem skipTestRun: VBusItem { bind: Utils.path(bindPrefix, "/SkipTestRun") } + + property VBusItem todayRuntime: VBusItem { bind: Utils.path(bindPrefix, "/TodayRuntime") } + property VBusItem manualTimer: VBusItem { bind: Utils.path(bindPrefix, "/ManualStartTimer") } + property VBusItem autoStart: VBusItem { bind: Utils.path(settingsBindPrefix, "/AutoStartEnabled") } + + property bool errors: ! state.valid || state.value == 10 + + property VBusItem externalOverrideItem: VBusItem { bind: Utils.path(bindPrefix, "/ExternalOverride") } + property bool externalOverride: externalOverrideItem.valid && externalOverrideItem.value == 1 && ! errors + property VBusItem runningState: VBusItem { bind: Utils.path(bindPrefix, "/GeneratorRunningState") } + + VBusItem { id: showGaugesItem; bind: Utils.path(guiModsPrefix, "/ShowGauges") } + property bool showGauges: showGaugesItem.valid ? showGaugesItem.value === 1 ? true : false : false + property bool editMode: autoRunTile.editMode || manualTile.editMode + + VBusItem { id: serviceInterval; bind: Utils.path(settingsBindPrefix, "/ServiceInterval") } + VBusItem { id: serviceCounterItem; bind: Utils.path(bindPrefix, "/ServiceCounter") } + property bool showServiceInfo: serviceCounterItem.valid && serviceInterval.valid && serviceInterval.value > 0 + property bool serviceOverdue: showServiceInfo && serviceCounterItem.value < 0 + +//////// add to display AC input ignored + VBusItem { id: ignoreAcInput1; bind: Utils.path(sys.vebusPrefix, "/Ac/State/IgnoreAcIn1") } + VBusItem { id: ignoreAcInput2; bind: Utils.path(sys.vebusPrefix, "/Ac/State/IgnoreAcIn2") } + VBusItem { id: acActiveInput; bind: Utils.path(sys.vebusPrefix, "/Ac/ActiveIn/ActiveInput") } + VBusItem { id: ac1source; bind: Utils.path("com.victronenergy.settings", "/Settings/SystemSetup/AcInput1") } + VBusItem { id: ac2source; bind: Utils.path("com.victronenergy.settings", "/Settings/SystemSetup/AcInput2") } + + title: qsTr("Generator") + + property bool autoStartSelected: false + + Component.onCompleted: + { + setFocusManual () + } + + Keys.forwardTo: [keyHandler] + Item + { + id: keyHandler + Keys.onUpPressed: + { + setFocusAuto () + event.accepted = true + } + Keys.onDownPressed: + { + setFocusManual () + event.accepted = true + } + // prevents page changes while timers are running + //// Keys.onReturnPressed: event.accepted = manualTile.startCountdown || autoRunTile.startCountdown + //// Keys.onEscapePressed: event.accepted = manualTile.startCountdown || autoRunTile.startCountdown + } + + function setFocusManual () + { + autoStartSelected = false + } + + function setFocusAuto () + { + autoStartSelected = true + } + + function formatTime (time) + { + if (time >= 3600) + return (time / 3600).toFixed(0) + " h" + else + return (time / 60).toFixed(0) + " m" + } + + function stateDescription() + { + if (!state.valid) + return qsTr ("") + else if (state.value === 10) + { + switch(error.value) + { + case 1: + return qsTr("Error: Remote switch control disabled") + case 2: + return qsTr("Error: Generator in fault condition") + case 3: + return qsTr("Error: Generator not detected at AC input") + default: + return qsTr("Error") + } + } + else + { + var condition = "" + var running = true + var manual = false + switch (runningBy.value) + { + case 0: // stopped + condition = "" + running = false + break;; + case 1: + manual = true + condition = "" + break;; + case 2: + condition = qsTr("Test run") + break;; + case 3: + condition = qsTr("Loss of communication") + break;; + case 4: + condition = qsTr("SOC") + break;; + case 5: + condition = qsTr("AC load") + break;; + case 6: + condition = qsTr("Battery current") + break;; + case 7: + condition = qsTr("Battery voltage") + break;; + case 8: + condition = qsTr("Inverter temperature") + break;; + case 9: + condition = qsTr("Inverter overload") + break;; + default: + condition = qsTr("???") + break;; + } + + if (externalOverride) + { + if (running && ! manual) + return qsTr ("auto pending: ") + condition + else + return " " + } + else if (manual) + { + if (manualTimer.valid && manualTimer.value > 0) + return qsTr("Timed run") + else + return qsTr("Manual run") + } + else if (running) + return qsTr ("auto run: ") + condition + else + return " " + } + } + + function getNextTestRun() + { + if ( ! root.state.valid) + return "" + if (!nextTestRun.value) + return qsTr("No test run programmed") + + var todayDate = new Date() + var nextDate = new Date(nextTestRun.value * 1000) + var nextDateEnd = new Date(nextDate.getTime()) + var message = "" + // blank "next run" if test run is active + if (runningBy.value == 2) + return " " + else if (todayDate.getDate() == nextDate.getDate() && todayDate.getMonth() == nextDate.getMonth()) + { + message = qsTr("Next test run today %1").arg( + Qt.formatDateTime(nextDate, "hh:mm").toString()) + } + else + { + message = qsTr("Next test run on %1").arg( + Qt.formatDateTime(nextDate, "dd/MM/yyyy").toString()) + nextDateEnd.setSeconds(testRunDuration.value) } + + if (skipTestRun.value === 1) + message += qsTr(" \(skipped\)") + + return message + } + + Tile { + id: imageTile + width: 180 + height: 136 + MbIcon { + id: generator + iconId: icon + anchors.centerIn: parent + } + anchors { top: parent.top; left: parent.left } + values: [ + // spacer + TileText { + width: imageTile.width - 5 + text: " " + font.pixelSize: 62 + }, + TileText { + width: imageTile.width - 5 + text: runningState.valid ? runningState.value == "R" ? "Running " : runningState.value == "S" ? "Stopped " : "" : "" + } + ] + } + + Tile { + id: statusTile + height: imageTile.height + color: "#4789d0" + anchors { top: parent.top; left: imageTile.right; right: root.right } + title: qsTr("STATUS") + values: [ + TileText + { + width: statusTile.width - 5 + color: externalOverride ? "yellow" : "white" + text: + { + var runPrefix + var message + if ( ! root.state.valid) + return qsTr ("Generator not connected") + else if (root.state.value === 2) + runPrefix = qsTr("Warming up for ") + else + runPrefix = qsTr ("Running for ") + if (!root.state.valid) + message = "" + else if (externalOverride) + message = qsTr("External Override - stopped") + else if (root.state.value === 3) + message = qsTr("Cool-down") + else if (root.state.value === 4) + message = qsTr("Stopping") + else if (runningBy.value == 0) + message = qsTr ("Stopped") + else if ( ! runningTime.valid) + message = runPrefix + "??" + else + { + message = runPrefix + formatTime (runningTime.value) + if (manualTimer.valid && manualTimer.value > 0) + message += qsTr (" ends in ") + formatTime (manualTimer.value) + } + return message + } + }, + Rectangle + { + width: parent.width + height: 3 + color: "transparent" + }, + TileTextMultiLine + { + text: stateDescription() + width: statusTile.width - 5 + }, + Rectangle + { + width: parent.width + height: 3 + color: "transparent" + }, + TileText + { + text: qsTr("\nQuiet hours"); + width: statusTile.width - 5 + font.bold: runningBy.valid && runningBy.value != 0 + color: font.bold ? "yellow" : "white" + visible: quietHours.value === 1 + }, + Rectangle + { + width: parent.width + height: 3 + color: "transparent" + }, + TileTextMultiLine + { + width: statusTile.width - 5 + text: getNextTestRun() + } + ] + } + + Tile { + id: acInTile + title: qsTr("GENERATOR POWER") + width: 150 + height: 136 + color: "#82acde" + anchors { top: imageTile.bottom; left: parent.left } + visible: showAcIn + values: + [ + OverviewAcValuesEnhanced + { + connection: sys.genset + visible: sys.genset.power.valid + }, + TileText + { + width: acInTile.width - 5 + text: + { + if (ac1source.valid && ac1source.value == 2) + { + if (ignoreAcInput1.valid && ignoreAcInput1.value == 1) + return qsTr ("\nAC In Ignored\nduring\ngenerator\nstart / stop") + else + return "" + } + else if (ac2source.valid && ac2source.value == 2) + { + if (ignoreAcInput2.valid && ignoreAcInput2.value == 1) + return qsTr ("\nAC In Ignored\nduring\ngenerator\nstart / stop") + else + return "" + } + else + return qsTr ("\nAC In\nis not\ngenerator") + } + visible: !sys.genset.power.valid + } + ] +////// add power bar graph + PowerGauge + { + id: acInBar + width: parent.width + height: 12 + anchors + { + top: parent.top; topMargin: 20 + horizontalCenter: parent.horizontalCenter + } + connection: sys.genset + useInputCurrentLimit: true + maxForwardPowerParameter: "" + maxReversePowerParameter: "" + visible: showGauges && sys.genset.power.valid + } + } + +//////// added to show alternator in place of AC generator + Tile { + id: alternatorTile + title: qsTr("ALTERNATOR POWER") + color: "#157894" + anchors.fill: acInTile + visible: showAlternator + values: + [ + TileText + { + text: EnhFmt.formatVBusItem (sys.alternator.power, "W") + font.pixelSize: 22 + } + ] +////// add power bar graph + PowerGauge + { + id: alternatorGauge + width: parent.width + height: 12 + anchors + { + top: parent.top; topMargin: 20 + horizontalCenter: parent.horizontalCenter + } + connection: sys.alternator + maxForwardPowerParameter: "com.victronenergy.settings/Settings/GuiMods/GaugeLimits/MaxAlternatorPower" + visible: showGauges && showAlternator + } + } + + Tile { + id: runTimeTile + title: qsTr("RUN TIMES") + width: 140 + anchors { top: acInTile.top; bottom: parent.bottom; left: acInTile.right } + values: [ + TileText + { + width: runTimeTile.width - 5 + text: qsTr ("Today") + }, + TileText { + width: runTimeTile.width - 5 + text: todayRuntime.valid ? formatTime (todayRuntime.value) : "--" + }, + Rectangle + { + width: parent.width + height: 3 + color: "transparent" + }, + TileText + { + width: runTimeTile.width - 5 + text: qsTr ("Accumulated") + }, + TileText + { + width: runTimeTile.width - 5 + text: + { + if ( ! totalAcummulatedTime.valid) + return "--" + else if (totalAccumulatedTimeOffset.valid ) + return formatTime (totalAcummulatedTime.value - totalAccumulatedTimeOffset.value) + else + return formatTime (totalAcummulatedTime.value) + } + }, + Rectangle + { + width: parent.width + height: 3 + color: "transparent" + }, + TileText + { + width: runTimeTile.width - 5 + visible: showServiceInfo + color: serviceOverdue ? "red" : "white" + text: serviceOverdue ? qsTr ("Service OVERDUE") : qsTr ("Service in") + }, + TileText + { + width: runTimeTile.width - 5 + visible: showServiceInfo + color: serviceOverdue ? "red" : "white" + text: formatTime (Math.abs (serviceCounterItem.value)) + } + ] + } + + TileAutoRunEnhanced + { + id: autoRunTile + bindPrefix: root.bindPrefix + focus: root.active && autoStartSelected + connected: state.valid + tileHeight: acInTile.height / 2 + anchors { + bottom: parent.bottom; bottomMargin: tileHeight + left: runTimeTile.right + right: parent.right + } + } + + TileManualStartEnhanced + { + id: manualTile + bindPrefix: root.bindPrefix + focus: root.active && ! autoStartSelected + connected: state.valid + tileHeight: acInTile.height / 2 + anchors { + bottom: parent.bottom + left: runTimeTile.right + right: parent.right + } + } + + // mouse areas must be AFTER their associated objects so those objects can catch mouse events + // rejected by these areas + // mouse targets need to be disabled while changes are pending + MouseArea { + id: autoRunTarget + anchors.fill: autoRunTile + enabled: root.active && ! editMode + onPressed: + { + if ( ! root.autoStartSelected ) + { + setFocusAuto () + mouse.accepted = true + } + else + { + mouse.accepted = false + } + } + } + MouseArea { + id: manualStartTarget + anchors.fill: manualTile + enabled: root.active && ! editMode + onPressed: + { + if ( root.autoStartSelected ) + { + setFocusManual () + mouse.accepted = true + } + else + { + mouse.accepted = false + } + } + } +} diff --git a/FileSets/v3.40/OverviewGeneratorEnhanced.qml.orig b/FileSets/v3.41/OverviewGeneratorEnhanced.qml.orig similarity index 100% rename from FileSets/v3.40/OverviewGeneratorEnhanced.qml.orig rename to FileSets/v3.41/OverviewGeneratorEnhanced.qml.orig diff --git a/FileSets/v3.41/OverviewGeneratorRelayEnhanced.qml b/FileSets/v3.41/OverviewGeneratorRelayEnhanced.qml new file mode 120000 index 00000000..ef81c93d --- /dev/null +++ b/FileSets/v3.41/OverviewGeneratorRelayEnhanced.qml @@ -0,0 +1 @@ +../v3.50~7/OverviewGeneratorRelayEnhanced.qml \ No newline at end of file diff --git a/FileSets/v3.41/OverviewGridParallel.qml b/FileSets/v3.41/OverviewGridParallel.qml new file mode 120000 index 00000000..30314fed --- /dev/null +++ b/FileSets/v3.41/OverviewGridParallel.qml @@ -0,0 +1 @@ +../v3.50~7/OverviewGridParallel.qml \ No newline at end of file diff --git a/FileSets/v3.41/OverviewHub.qml b/FileSets/v3.41/OverviewHub.qml new file mode 120000 index 00000000..8ad81f58 --- /dev/null +++ b/FileSets/v3.41/OverviewHub.qml @@ -0,0 +1 @@ +../v3.50~7/OverviewHub.qml \ No newline at end of file diff --git a/FileSets/v3.41/OverviewHubEnhanced.qml b/FileSets/v3.41/OverviewHubEnhanced.qml new file mode 120000 index 00000000..69e0ee88 --- /dev/null +++ b/FileSets/v3.41/OverviewHubEnhanced.qml @@ -0,0 +1 @@ +../v3.50~7/OverviewHubEnhanced.qml \ No newline at end of file diff --git a/FileSets/v3.41/OverviewMobileEnhanced.qml b/FileSets/v3.41/OverviewMobileEnhanced.qml new file mode 120000 index 00000000..69b3f0d9 --- /dev/null +++ b/FileSets/v3.41/OverviewMobileEnhanced.qml @@ -0,0 +1 @@ +../v3.50~5/OverviewMobileEnhanced.qml \ No newline at end of file diff --git a/FileSets/v3.41/OverviewTanksTempsDigInputs.qml b/FileSets/v3.41/OverviewTanksTempsDigInputs.qml new file mode 120000 index 00000000..4fa05bdf --- /dev/null +++ b/FileSets/v3.41/OverviewTanksTempsDigInputs.qml @@ -0,0 +1 @@ +../v3.50~5/OverviewTanksTempsDigInputs.qml \ No newline at end of file diff --git a/FileSets/v3.41/PageGenerator.qml b/FileSets/v3.41/PageGenerator.qml new file mode 100644 index 00000000..edad721c --- /dev/null +++ b/FileSets/v3.41/PageGenerator.qml @@ -0,0 +1,159 @@ +//// changed total time to hours (from varilable format) + +import QtQuick 1.1 +import com.victron.velib 1.0 +import "utils.js" as Utils + +MbPage { + id: generator + title: qsTr("Generator start/stop") + property string settingsBindPrefix + property string startStopBindPrefix + property alias startStopModel: _startStopModel + property VBusItem activeCondition: VBusItem { bind: Utils.path(startStopBindPrefix, "/RunningByCondition") } + property VBusItem generatorState: VBusItem { bind: Utils.path(startStopBindPrefix, "/State") } + property VBusItem runningTime: VBusItem { bind: Utils.path(startStopBindPrefix, "/Runtime") } + property VBusItem historicalData: VBusItem { bind: Utils.path(settingsBindPrefix, "/AccumulatedDaily") } + + FnGeneratorStates { + id: genState + } + +//// changed total time to hours (from varilable format) + function formatTime (time) + { + if (time >= 3600) + return (time / 3600).toFixed(0) + " h" + else + return (time / 60).toFixed(0) + " m" + } + + model: startStopModel + + function formatError(text, value) + { + return "#" + value.toString() + " " + text + } + + VisibleItemModel { + id: _startStopModel + + MbItemValue { + description: qsTr("State") + show: startStopBindPrefix === "com.victronenergy.generator.startstop0" + item.text: activeCondition.valid ? genState.getState(generatorState.value, activeCondition.value) : '---' + } + + MbItemOptions { + id: _gensetStatus + description: qsTr("Error") + bind: Utils.path(startStopBindPrefix, "/Error") + readonly: true + show: valid && startStopBindPrefix === "com.victronenergy.generator.startstop0" + possibleValues: [ + MbOption { description: qsTr("No error"); value: 0 }, + MbOption { description: formatError(qsTr("Remote switch control disabled"), 1); value: 1 }, + MbOption { description: formatError(qsTr("Generator in fault condition"), 2); value: 2 }, + MbOption { description: formatError(qsTr("Generator not detected at AC input"), 3); value: 3 } + ] + } + + MbItemValue { + description: qsTr("Run time") + item.text: runningTime.valid ? Utils.secondsToNoSecsString(runningTime.value) : "0" + show: generatorState.value in [1, 2, 3] // Running, Warm-up, Cool-down + } + + MbItemValue { + description: qsTr("Total run time") + item { + bind: Utils.path(settingsBindPrefix, "/AccumulatedTotal") + //// changed total time to hours (from varilable format) + text: formatTime (item.value - accumulatedTotalOffset.value) + } + VBusItem { + id: accumulatedTotalOffset + bind: Utils.path(settingsBindPrefix, "/AccumulatedTotalOffset") + } + } + + MbItemValue { + description: qsTr("Time to service") + show: item.valid + item { + bind: Utils.path(startStopBindPrefix, "/ServiceCounter") + text: qsTr("%1h").arg((item.value / 60 / 60).toFixed(0)) + } + } + + MbItemValue { + description: qsTr("Accumulated running time since last test run") + show: user.accessLevel >= User.AccessService && nextTestRun.show + backgroundColor: style.backgroundColorService + item { + text: Utils.secondsToNoSecsString(item.value) + bind: Utils.path(startStopBindPrefix, "/TestRunIntervalRuntime") + } + } + + MbItemValue { + id: nextTestRun + description: qsTr("Time to next test run") + show: item.valid && item.value > 0 + item { + text: { + var remainingTime = item.value - new Date().getTime() / 1000 + if (remainingTime > 0) + return Utils.secondsToNoSecsString(remainingTime).toString() + return qsTr("Running now") + } + bind: Utils.path(startStopBindPrefix, "/NextTestRun") + } + } + + MbSwitch { + name: qsTr("Auto start functionality") + bind: Utils.path(startStopBindPrefix, "/AutoStartEnabled") + show: startStopBindPrefix === "com.victronenergy.generator.startstop0" + } + + MbSubMenu { + description: qsTr("Manual start") + show: startStopBindPrefix === "com.victronenergy.generator.startstop0" + subpage: + Component { + PageGeneratorManualStart { + startStopBindPrefix: generator.startStopBindPrefix + } + } + } + + MbSubMenu { + description: qsTr("Daily run time") + subpage: MbPage { + // Invert the order + property variant keys: historicalData.valid ? + Object.keys(JSON.parse(historicalData.value)).reverse() : 0 + + title: qsTr("Daily run time") + focus: active + model: keys + delegate: MbItemValue { + description: Qt.formatDate(new Date(parseInt(keys[index]) * 1000), "dd-MM-yyyy"); + item.text: Utils.secondsToNoSecsString(JSON.parse(historicalData.value)[keys[index]]) + } + } + } + + MbSubMenu { + id: conditions + description: qsTr("Settings") + subpage: Component { + PageSettingsGenerator { + settingsBindPrefix: generator.settingsBindPrefix + startStopBindPrefix: generator.startStopBindPrefix + } + } + } + } +} diff --git a/FileSets/v3.40/PageGenerator.qml.orig b/FileSets/v3.41/PageGenerator.qml.orig similarity index 100% rename from FileSets/v3.40/PageGenerator.qml.orig rename to FileSets/v3.41/PageGenerator.qml.orig diff --git a/FileSets/v3.41/PageSettingsGenerator.qml b/FileSets/v3.41/PageSettingsGenerator.qml new file mode 120000 index 00000000..b45ccc13 --- /dev/null +++ b/FileSets/v3.41/PageSettingsGenerator.qml @@ -0,0 +1 @@ +../v3.50~7/PageSettingsGenerator.qml \ No newline at end of file diff --git a/FileSets/v3.41/PageSettingsGuiMods.qml b/FileSets/v3.41/PageSettingsGuiMods.qml new file mode 100644 index 00000000..420a42ac --- /dev/null +++ b/FileSets/v3.41/PageSettingsGuiMods.qml @@ -0,0 +1,290 @@ +/////// new menu for all Gui Mods + +import QtQuick 1.1 +import "utils.js" as Utils +import com.victron.velib 1.0 + +MbPage { + id: root + title: qsTr("Gui Mods") + property string bindPrefixGuiMods: "com.victronenergy.settings/Settings/GuiMods" + property string bindPrefix: "com.victronenergy.settings/Settings/Gui" + property VBusItem systemScaleItem: VBusItem { bind: "com.victronenergy.settings/Settings/System/Units/Temperature" } + + property bool showFlowParams: flowOverview.item.valid && flowOverview.item.value >= 1 + property bool showComplexParams: flowOverview.item.valid && flowOverview.item.value >= 2 + property bool showAcCoupledParams: flowOverview.item.valid && flowOverview.item.value == 3 + + model: VisibleItemModel + { + MbSwitch + { + id: showTileOverview + bind: Utils.path (bindPrefixGuiMods, "/ShowTileOverview") + name: qsTr ("Show Tile Overview") + writeAccessLevel: User.AccessUser + } + + MbSwitch + { + id: moveSettings + bind: Utils.path (bindPrefixGuiMods, "/MoveSettings") + name: qsTr ("Move Settings to top of Device List") + writeAccessLevel: User.AccessUser + } + + MbSwitch { + id: relayOverview + bind: Utils.path (bindPrefixGuiMods, "/ShowRelayOverview") + name: qsTr ("Show Relay overview") + writeAccessLevel: User.AccessUser + } + MbSwitch { + id: tanksTempsOverview + bind: Utils.path (bindPrefixGuiMods, "/ShowTanksTempsDigIn") + name: qsTr ("Show Tanks, Temps, Digital Input overview") + writeAccessLevel: User.AccessUser + } + + MbSwitch + { + id: useEnhGeneratorOverview + bind: Utils.path (bindPrefixGuiMods, "/UseEnhancedGeneratorOverview") + name: qsTr ("Use Enhanced Generator Overview") + writeAccessLevel: User.AccessUser + } + + // duplicate mobile overview on/off here for convenience + MbSwitch { + id: mobileOverview + bind: Utils.path (bindPrefix, "/MobileOverview") + name: qsTr ("Show boat & motorhome overview") + writeAccessLevel: User.AccessUser + } + MbSwitch + { + id: useEnhMobileOverview + bind: Utils.path (bindPrefixGuiMods, "/UseEnhancedMobileOverview") + name: qsTr ("Use Enhanced Mobile Overview") + // When enabled set Enhanced OverviewMobile as default overview + onClicked: + { + if (!checked) + { + // also enable Mobile Overview when turning on use enhanced Mobile Overview + showMobileOverview.setValue (1) + } + } + VBusItem { id: showMobileOverview; bind: Utils.path (bindPrefix, "/MobileOverview") } + writeAccessLevel: User.AccessUser + } + MbItemOptions + { + id: flowOverview + description: qsTr("Flow overview") + bind: Utils.path (bindPrefixGuiMods, "/FlowOverview") + possibleValues: + [ + MbOption {description: qsTr("Victron stock"); value: 0}, + MbOption {description: qsTr("GuiMods simple"); value: 1}, + MbOption {description: qsTr("GuiMods DC Coupled"); value: 2}, + MbOption {description: qsTr("GuiMods AC Coupled"); value: 3} + ] + } + + MbSwitch + { + id: combineLoads + bind: Utils.path (bindPrefixGuiMods, "/EnhancedFlowCombineLoads") + name: qsTr ("Combine AC input/ouput loads") + show: root.showAcCoupledParams + writeAccessLevel: User.AccessInstaller + } + MbSwitch + { + id: showLoadsOnInput + bind: Utils.path (bindPrefixGuiMods, "/ShowEnhancedFlowLoadsOnInput") + name: qsTr ("Show Loads On Input") + show: root.showAcCoupledParams && ! combineLoads.checked + writeAccessLevel: User.AccessInstaller + } + + MbSwitch + { + id: showTanks + bind: Utils.path (bindPrefixGuiMods, "/ShowEnhancedFlowOverviewTanks") + name: qsTr ("Show tanks on Flow Overview") + show: root.showFlowParams + writeAccessLevel: User.AccessUser + } + MbItemOptions + { + id: tankFormat + description: qsTr("Tank bar format") + bind: Utils.path (bindPrefixGuiMods, "/TankBarFormat") + possibleValues: + [ + MbOption {description: qsTr("%"); value: 1}, + MbOption {description: qsTr("units"); value: 2}, + MbOption {description: qsTr("% + units"); value: 0} + ] + } + MbSwitch + { + id: showTemps + bind: Utils.path (bindPrefixGuiMods, "/ShowEnhancedFlowOverviewTemps") + name: qsTr ("Show temperatures on Flow Overview") + show: root.showFlowParams + writeAccessLevel: User.AccessUser + } + MbSwitch + { + id: showBatteryTemps + bind: Utils.path (bindPrefixGuiMods, "/ShowBatteryTempOnFlows") + name: qsTr ("Show battery temperature on Flow Overview") + show: showTemps.item.value == 1 + writeAccessLevel: User.AccessUser + } + MbSwitch + { + id: shortenTankNames + bind: Utils.path (bindPrefixGuiMods, "/ShortenTankNames") + name: qsTr ("Shorten tank names") + writeAccessLevel: User.AccessUser + } + MbEditBox { + id: dcSystemName + description: qsTr("DC System tile name") + item.bind: Utils.path (bindPrefixGuiMods, "/CustomDcSystemName") + maximumLength: 32 + enableSpaceBar: true + } + + MbSwitch + { + id: replaceInactiveAcIn + bind: Utils.path (bindPrefixGuiMods, "/ReplaceInactiveAcIn") + name: qsTr ("Replace AC in if inactive") + writeAccessLevel: User.AccessUser + } + + MbSpinBox { + description: qsTr ("AC Input Limit Preset 1") + item + { + bind: Utils.path (bindPrefixGuiMods, "/AcCurrentLimit/Preset1") + unit: "A" + decimals: 0 + step: 1 + min: 0 + max: 999 + } + writeAccessLevel: User.AccessUser + } + + MbSpinBox { + description: qsTr ("AC Input Limit Preset 2") + item + { + bind: Utils.path (bindPrefixGuiMods, "/AcCurrentLimit/Preset2") + unit: "A" + decimals: 0 + step: 1 + min: 0 + max: 999 + } + writeAccessLevel: User.AccessUser + } + + MbSpinBox { + description: qsTr ("AC Input Limit Preset 3") + item + { + bind: Utils.path (bindPrefixGuiMods, "/AcCurrentLimit/Preset3") + unit: "A" + decimals: 0 + step: 1 + min: 0 + max: 999 + } + writeAccessLevel: User.AccessUser + } + + MbSpinBox { + description: qsTr ("AC Input Limit Preset 4") + item + { + bind: Utils.path (bindPrefixGuiMods, "/AcCurrentLimit/Preset4") + unit: "A" + decimals: 0 + step: 1 + min: 0 + max: 999 + } + writeAccessLevel: User.AccessUser + } + + MbItemOptions + { + id: tempScale + description: qsTr ("Temperature scale") + bind: Utils.path (bindPrefixGuiMods, "/TemperatureScale") + show: ! systemScaleItem.valid + possibleValues: + [ + MbOption { description: "°C"; value: 1 }, + MbOption { description: "°F"; value: 2 }, + MbOption { description: qsTr("both °C & °F"); value: 0 } + ] + writeAccessLevel: User.AccessUser + } + + MbSpinBox { + description: qsTr ("Watt / Kilowatt threshold") + item + { + bind: Utils.path (bindPrefixGuiMods, "/KilowattThreshold") + unit: "W" + decimals: 0 + step: 100 + min: 1000 + max: 10000 + } + writeAccessLevel: User.AccessUser + } + + MbItemOptions + { + id: timeFormat + description: qsTr ("Time format") + bind: Utils.path (bindPrefixGuiMods, "/TimeFormat") + possibleValues: + [ + MbOption { description: qsTr("24 hour"); value: 1 }, + MbOption { description: qsTr("12 hour AM/PM"); value: 2 }, + MbOption { description: qsTr("don't show time"); value: 0 } + ] + writeAccessLevel: User.AccessUser + } + MbItemOptions + { + id: inactiveFlowTiles + description: qsTr ("Inactive Tiles on Flow Overview") + bind: Utils.path (bindPrefixGuiMods, "/ShowInactiveFlowTiles") + show: root.showFlowParams + possibleValues: + [ + MbOption { description: qsTr("Show Dimmed"); value: 1 }, + MbOption { description: qsTr("Show Full"); value: 2 }, + MbOption { description: qsTr("Hide"); value: 0 } + ] + writeAccessLevel: User.AccessUser + } + MbSubMenu + { + description: qsTr("Power Gauges") + subpage: Component { PageSettingsGuiModsGauges {} } + show: root.showFlowParams + } + } +} diff --git a/FileSets/v3.40/PageSettingsGuiMods.qml.orig b/FileSets/v3.41/PageSettingsGuiMods.qml.orig similarity index 100% rename from FileSets/v3.40/PageSettingsGuiMods.qml.orig rename to FileSets/v3.41/PageSettingsGuiMods.qml.orig diff --git a/FileSets/v3.41/PageSettingsRelay.qml b/FileSets/v3.41/PageSettingsRelay.qml new file mode 120000 index 00000000..ad115c4e --- /dev/null +++ b/FileSets/v3.41/PageSettingsRelay.qml @@ -0,0 +1 @@ +../v3.50~7/PageSettingsRelay.qml \ No newline at end of file diff --git a/FileSets/v3.41/PowerGauge.qml b/FileSets/v3.41/PowerGauge.qml new file mode 120000 index 00000000..ab067a4c --- /dev/null +++ b/FileSets/v3.41/PowerGauge.qml @@ -0,0 +1 @@ +../v3.50~7/PowerGauge.qml \ No newline at end of file diff --git a/FileSets/v3.41/TileDigIn.qml b/FileSets/v3.41/TileDigIn.qml new file mode 120000 index 00000000..92f40050 --- /dev/null +++ b/FileSets/v3.41/TileDigIn.qml @@ -0,0 +1 @@ +../v3.50~7/TileDigIn.qml \ No newline at end of file diff --git a/FileSets/v3.41/TileRelay.qml b/FileSets/v3.41/TileRelay.qml new file mode 120000 index 00000000..6be11230 --- /dev/null +++ b/FileSets/v3.41/TileRelay.qml @@ -0,0 +1 @@ +../v3.50~7/TileRelay.qml \ No newline at end of file diff --git a/FileSets/v3.41/dbus_digitalinputs.py b/FileSets/v3.41/dbus_digitalinputs.py new file mode 120000 index 00000000..d656bf0c --- /dev/null +++ b/FileSets/v3.41/dbus_digitalinputs.py @@ -0,0 +1 @@ +../v3.50~7/dbus_digitalinputs.py \ No newline at end of file diff --git a/FileSets/v3.41/startstop.py b/FileSets/v3.41/startstop.py new file mode 120000 index 00000000..49585d77 --- /dev/null +++ b/FileSets/v3.41/startstop.py @@ -0,0 +1 @@ +../v3.50~7/startstop.py \ No newline at end of file diff --git a/changes b/changes index 09db2664..92e6fe9f 100644 --- a/changes +++ b/changes @@ -1,3 +1,6 @@ +c10.63: + add support for v3.41 + v10.62: fixed: battery detail consumed and remaining incorrect diff --git a/version b/version index 85944178..87e10d15 100644 --- a/version +++ b/version @@ -1 +1 @@ -v10.62 +v10.63