import QtQuick 1.1 import "utils.js" as Utils MbPage { id: root title: "Relay 2" model: VisualItemModel { MbItemOptions { id: relay1Func description: qsTr("Relay 2 function") bind: "com.victronenergy.settings/Settings/Relay1/Relay1Function" userHasWriteAccess: true possibleValues: [ MbOption { description: qsTr("None"); value: "none" }, MbOption { description: qsTr("Alarm"); value: "alarm" }, MbOption { description: qsTr("Connect Load"); value: "load" } ] } MbItemText { text: qsTr("The alarm will trigger when the SOC drops below the configured minimum, or when the battery reports an alarm.") wrapMode: Text.WordWrap horizontalAlignment: Text.AlignLeft show: relay1Func.value=="alarm" style.fontPixelSize : 12 } MbItemText { text: qsTr("The relay will trigger when the power surplus exceeds the configured value.") wrapMode: Text.WordWrap horizontalAlignment: Text.AlignLeft show: relay1Func.value=="load" style.fontPixelSize : 12 } MbItemOptions { id: relay1polarity description: qsTr("Relay 2 Polarity") userHasWriteAccess: true bind: "com.victronenergy.settings/Settings/Relay1/Relay1Polarity" possibleValues: [ MbOption { description: qsTr("Normally Closed"); value: "nc" }, MbOption { description: qsTr("Normally Open"); value: "no" } ] show: relay1Func.value!="none" } MbSpinBox { id: debounceTime description: qsTr("Debounce time") userHasWriteAccess: true //bind: "com.victronenergy.settings/Settings/Relay1/DebounceFilterTime" //numOfDecimals: 0 //unit: "s" //min: 0 //max: 600 //stepSize: 5 show: relay1Func.value!="none" } MbItemText { text: qsTr("Use debounce to filter transitory effects. The relay will only trigger when its value has been constant for the configured timespan.") wrapMode: Text.WordWrap horizontalAlignment: Text.AlignLeft style.fontPixelSize : 12 show: debounceTime.show } MbSpinBox { id: connectLoadThreshold description: qsTr("Connected load threshold (excess power)") userHasWriteAccess: true //bind: "com.victronenergy.settings/Settings/Relay1/ConnectLoadThreshold" //numOfDecimals: 0 //unit: "W" //min: 0 //max: 50000 //stepSize: 100 show: relay1Func.value=="load" } MbSpinBox { id: nominalPowerOfLoad description: qsTr("Nominal power of switched load") userHasWriteAccess: true //bind: "com.victronenergy.settings/Settings/Relay1/NominalPowerOfLoad" //numOfDecimals: 0 //unit: "W" //min: 0 //max: 50000 //stepSize: 100 show: relay1Func.value=="load" } MbItemText { text: "WARNING!
"+qsTr("If the value entered above is lower than the effective power of the load, the relay will switch incessantly. This will wear it, and possibly break it in a short time. It is adviced to leave 10% of margin.") wrapMode: Text.WordWrap horizontalAlignment: Text.AlignLeft show: relay1Func.value=="load" } MbItemRow { description: qsTr("Soc") userHasWriteAccess: true values: [ MbTextBlock { item.text: qsTr("Minimum"); color: "white"}, MbTextBlock { item.bind: "com.victronenergy.settings/Settings/CGwacs/BatteryLife/MinimumSocLimit"; item.unit: " %"}, MbTextBlock { item.text: qsTr("Current"); color: "white"}, MbTextBlock { item.bind: "com.victronenergy.system/Dc/Battery/Soc"} ] show: relay1Func.value=="alarm" } MbItemOptions { description: qsTr("Alarm is currently") userHasWriteAccess: true bind: "com.victronenergy.relay1/LogicalState" readonly: true possibleValues: [ MbOption { description: qsTr("On"); value: true }, MbOption { description: qsTr("Off"); value: false } ] show: relay1Func.value=="alarm" } MbItemOptions { description: qsTr("Load is currently") userHasWriteAccess: true bind: "com.victronenergy.relay1/LogicalState" readonly: true possibleValues: [ MbOption { description: qsTr("Connected"); value: true }, MbOption { description: qsTr("Disconnected"); value: false } ] show: relay1Func.value=="load" } MbItemOptions { description: qsTr("Relay is currently") userHasWriteAccess: true bind: "com.victronenergy.system/Relay/1/State" readonly: true possibleValues: [ MbOption { description: qsTr("Energized"); value: 1 }, MbOption { description: qsTr("De-energized"); value: 0 } ] } MbItemOptions { description: qsTr("Test Alarm Relay") userHasWriteAccess: true bind: "com.victronenergy.relay1/TestRelay1" possibleValues: [ MbOption { description: qsTr("Not Testing"); value: -1 }, MbOption { description: qsTr("Test Alarm Active"); value: 1 }, MbOption { description: qsTr("Test No Alarm Active"); value: 0 } ] show: relay1Func.value=="alarm" } MbItemText { text: qsTr("Use this option to test the alarm relay state. Observe changes in |Alarm is currently| and |Relay is currently| options. After testing, set this back to |Not Testing|. This is just a test and will not affect the expected relay performance.") wrapMode: Text.WordWrap horizontalAlignment: Text.AlignLeft show: relay1Func.value=="alarm" style.fontPixelSize : 12 } MbItemOptions { description: qsTr("Test Load Relay") userHasWriteAccess: true bind: "com.victronenergy.relay1/TestRelay1" possibleValues: [ MbOption { description: qsTr("Not Testing"); value: -1 }, MbOption { description: qsTr("Test Load Connected"); value: 1 }, MbOption { description: qsTr("Test Load Disconnected"); value: 0 } ] show: relay1Func.value=="load" } MbItemText { text: qsTr("Use this option to test the load state. Observe changes in |Load is currently| and |Relay is currently| options. After testing, set this back to |Not Testing|. This is just a test and will not affect the expected relay performance.") wrapMode: Text.WordWrap horizontalAlignment: Text.AlignLeft show: relay1Func.value=="load" style.fontPixelSize : 12 } } }