diff --git a/qml/Controls/RadioButton.qml b/qml/Controls/RadioButton.qml new file mode 100644 index 0000000..fcc20e1 --- /dev/null +++ b/qml/Controls/RadioButton.qml @@ -0,0 +1,42 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.12 + +import Utils 1.0 + +RadioButton { + id: control + implicitHeight: 30 + spacing: 15 + leftPadding: 0 + + indicator: Rectangle { + implicitWidth: control.implicitHeight + implicitHeight: control.implicitHeight + x: control.leftPadding + y: parent.height / 2 - height / 2 + radius: implicitWidth / 2 + border.color: Palette.borderColor + + Rectangle { + property int spacing: 10 + width: parent.implicitWidth - spacing + height: parent.implicitHeight - spacing + x: spacing / 2 + y: spacing / 2 + radius: width / 2 + color: Palette.alternativeBackgroundColor + visible: control.checked + } + } + + contentItem: Text { + text: control.text + font.pixelSize: 18 + font.weight: Font.Bold + color: Palette.textColor + maximumLineCount: 2 + wrapMode: Text.WordWrap + verticalAlignment: Text.AlignVCenter + leftPadding: control.indicator.width + control.spacing + } +} diff --git a/qml/Controls/qmldir b/qml/Controls/qmldir index aa01916..7d617f7 100644 --- a/qml/Controls/qmldir +++ b/qml/Controls/qmldir @@ -26,3 +26,4 @@ ScrollIndicator 1.0 ScrollIndicator.qml OutlineImageButton 1.0 OutlineImageButton.qml ImageButton 1.0 ImageButton.qml ProgressBar 1.0 ProgressBar.qml +RadioButton 1.0 RadioButton.qml diff --git a/qml/Screens/BmsSettingsScreen.qml b/qml/Screens/BmsSettingsScreen.qml index 96454d9..98fb45a 100644 --- a/qml/Screens/BmsSettingsScreen.qml +++ b/qml/Screens/BmsSettingsScreen.qml @@ -393,7 +393,8 @@ RowLayout { } Controls.CheckBox { - text: qsTr("Use for storage management") + id: chargeBatteryOutputCheckBox + text: qsTr("Use to control charger") Layout.fillWidth: true Layout.preferredHeight: outputSettingsFrame.outputNumberSize } @@ -417,7 +418,8 @@ RowLayout { } Controls.CheckBox { - text: qsTr("Normally closed") + id: brushOrShuntOutputCheckBox + text: qsTr("Active") Layout.fillWidth: true Layout.preferredHeight: outputSettingsFrame.outputNumberSize } @@ -426,20 +428,48 @@ RowLayout { Layout.columnSpan: 2 } + Controls.RadioButton { + id: brushControlRadioButton + text: qsTr("Brush control") + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.RadioButton { + id: shuntChargingContactorRadioButton + text: qsTr("Shunt charging contactor") + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + Controls.SubtitleLabel { - text: qsTr("Change in value during SOC") + text: qsTr("SOC threshold, %") + maximumLineCount: 2 + wrapMode: Text.WordWrap + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.SubtitleLabel { + text: qsTr("Delay, s") maximumLineCount: 2 wrapMode: Text.WordWrap Layout.fillWidth: true Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 - Layout.columnSpan: 2 } Controls.TextField { - id: changeValueSocField + id: brushUsageSocThresholdField + validator: IntValidator { bottom: 0; top: 100 } + Layout.fillWidth: true + Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 + } + + Controls.TextField { + id: shuntChargingContactorDelayField + validator: IntValidator { bottom: 0; top: 65535 } Layout.fillWidth: true Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 - Layout.columnSpan: 2 } Controls.LineSeparator { @@ -457,6 +487,8 @@ RowLayout { } Controls.CheckBox { + id: coolingOutputCheckBox + text: qsTr("Cooling activation") Layout.fillWidth: true Layout.preferredHeight: outputSettingsFrame.outputNumberSize } @@ -478,13 +510,15 @@ RowLayout { } Controls.TextField { - id: closesBelowTemperatureThirdField + id: coolingStartThresholdField + validator: IntValidator { bottom: -32768; top: 32768 } Layout.fillWidth: true Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 } Controls.TextField { - id: opensGreaterTemperatureThirdField + id: coolingStopThresholdField + validator: IntValidator { bottom: -32768; top: 32768 } Layout.fillWidth: true Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 } @@ -504,6 +538,8 @@ RowLayout { } Controls.CheckBox { + id: heatingOutputCheckBox + text: qsTr("Heating activation") Layout.fillWidth: true Layout.preferredHeight: outputSettingsFrame.outputNumberSize } @@ -525,13 +561,15 @@ RowLayout { } Controls.TextField { - id: closesBelowTemperatureFourthField + id: heatingStartThresholdField + validator: IntValidator { bottom: -32768; top: 32768 } Layout.fillWidth: true Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 } Controls.TextField { - id: opensGreaterTemperatureFourthField + id: heatingStopThresholdField + validator: IntValidator { bottom: -32768; top: 32768 } Layout.fillWidth: true Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2 } @@ -756,6 +794,21 @@ RowLayout { BmsInterface.bmsConfig().setParamValue("cellBalanceUpdateInterval", parseInt(balancingCellIntervalField.text)) BmsInterface.bmsConfig().setParamValue("shuntLCFactor", parseFloat(zeroSensorValueField.text)) + + BmsInterface.bmsConfig().setParamValue("chargeBatteryOutputChecked", chargeBatteryOutputCheckBox.checked) + + BmsInterface.bmsConfig().setParamValue("brushOrShuntOutputChecked", brushOrShuntOutputCheckBox.checked) + BmsInterface.bmsConfig().setParamValue("brushOrShuntMode", shuntChargingContactorRadioButton.checked) + BmsInterface.bmsConfig().setParamValue("brushUsageSocThreshold", parseInt(brushUsageSocThresholdField.text)) + BmsInterface.bmsConfig().setParamValue("shuntChargingContactorDelay", parseInt(shuntChargingContactorDelayField.text)) + + BmsInterface.bmsConfig().setParamValue("coolingOutputChecked", coolingOutputCheckBox.checked) + BmsInterface.bmsConfig().setParamValue("coolingStartThreshold", parseInt(coolingStartThresholdField.text)) + BmsInterface.bmsConfig().setParamValue("coolingStopThreshold", parseInt(coolingStopThresholdField.text)) + + BmsInterface.bmsConfig().setParamValue("heatingOutputChecked", heatingOutputCheckBox.checked) + BmsInterface.bmsConfig().setParamValue("heatingStartThreshold", parseInt(heatingStartThresholdField.text)) + BmsInterface.bmsConfig().setParamValue("heatingStopThreshold", parseInt(heatingStopThresholdField.text)) } Connections { @@ -783,6 +836,22 @@ RowLayout { balancingCellIntervalField.text = BmsInterface.bmsConfig().getParamInt("cellBalanceUpdateInterval") zeroSensorValueField.text = MathHelper.roundDouble(BmsInterface.bmsConfig().getParamDouble("shuntLCFactor")) + + chargeBatteryOutputCheckBox.checked = BmsInterface.bmsConfig().getParamBool("chargeBatteryOutputChecked") + + brushOrShuntOutputCheckBox.checked = BmsInterface.bmsConfig().getParamBool("brushOrShuntOutputChecked") + brushControlRadioButton.checked = !BmsInterface.bmsConfig().getParamBool("brushOrShuntMode") + shuntChargingContactorRadioButton.checked = BmsInterface.bmsConfig().getParamBool("brushOrShuntMode") + brushUsageSocThresholdField.text = BmsInterface.bmsConfig().getParamInt("brushUsageSocThreshold") + shuntChargingContactorDelayField.text = BmsInterface.bmsConfig().getParamInt("shuntChargingContactorDelay") + + coolingOutputCheckBox.checked = BmsInterface.bmsConfig().getParamBool("coolingOutputChecked") + coolingStartThresholdField.text = BmsInterface.bmsConfig().getParamInt("coolingStartThreshold") + coolingStopThresholdField.text = BmsInterface.bmsConfig().getParamInt("coolingStopThreshold") + + heatingOutputCheckBox.checked = BmsInterface.bmsConfig().getParamBool("heatingOutputChecked") + heatingStartThresholdField.text = BmsInterface.bmsConfig().getParamInt("heatingStartThreshold") + heatingStopThresholdField.text = BmsInterface.bmsConfig().getParamInt("heatingStopThreshold") } } } diff --git a/qml/qml_items.qrc b/qml/qml_items.qrc index 18f98ef..69e18f8 100644 --- a/qml/qml_items.qrc +++ b/qml/qml_items.qrc @@ -46,5 +46,6 @@ Controls/ProgressBar.qml Screens/NetworkSettingsScreen.qml Screens/TimeSettingsScreen.qml + Controls/RadioButton.qml diff --git a/res/config.xml b/res/config.xml index 03d8c5d..64ec9e8 100644 --- a/res/config.xml +++ b/res/config.xml @@ -2486,6 +2486,142 @@ p, li { white-space: pre-wrap; } ms 5 + + Charge Battery Output Checked + 5 + 1 + Charge Battery Output Checked Description + CHARGE_BATTERY_OUTPUT_CHECKED + 0 + + + Brush Or Shunt Output Checked + 5 + 1 + Brush Or Shunt Output Checked Description + BRUSH_OR_SHUNT_OUTPUT_CHECKED + 0 + + + Brush Or Shunt Mode + 5 + 1 + Brush Or Shunt Mode Description + BRUSH_OR_SHUNT_MODE + 1 + + + Brush Usage Soc Threshold + 2 + 1 + Brush Usage Soc Threshold Description + BRUSH_USAGE_SOC_THRESHOLD + 1 + 0 + 100 + 0 + 0 + 1 + 10 + °C + 3 + + + Shunt Charging Contactor Delay + 2 + 1 + Shunt Charging Contactor Delay Description + SHUNT_CHARGING_CONTRACTOR_DELAY + 1 + 0 + 65535 + 0 + 0 + 1 + 10 + Sec + 3 + + + Cooling Output Checked + 5 + 1 + Cooling Output Checked Description + COOLING_OUTPUT_CHECKED + 0 + + + Cooling Start Threshold + 2 + 1 + Cooling Start Threshold Description + COOLING_START_THRESHOLD + 1 + 0 + 32767 + -32768 + 0 + 1 + 50 + °C + 4 + + + Cooling Stop Threshold + 2 + 1 + Cooling Stop Threshold Description + COOLING_STOP_THRESHOLD + 1 + 0 + 32767 + -32768 + 0 + 1 + 40 + °C + 4 + + + Heating Output Checked + 5 + 1 + Heating Output Checked Description + HEATING_OUTPUT_CHECKED + 0 + + + Heating Start Threshold + 2 + 1 + Heating Start Threshold Description + HEATING_START_THRESHOLD + 1 + 0 + 32767 + -32768 + 0 + 1 + 0 + °C + 4 + + + Heating Stop Threshold + 2 + 1 + Heating Stop Threshold Description + HEATING_STOP_THRESHOLD + 1 + 0 + 32767 + -32768 + 0 + 1 + 20 + °C + 4 + noOfCellsSeries @@ -2582,5 +2718,16 @@ p, li { white-space: pre-wrap; } chargeEnableState powerDownDelay humidityICType + chargeBatteryOutputChecked + brushOrShuntOutputChecked + brushOrShuntMode + brushUsageSocThreshold + shuntChargingContactorDelay + coolingOutputChecked + coolingStartThreshold + coolingStopThreshold + heatingOutputChecked + heatingStartThreshold + heatingStopThreshold diff --git a/translations/cubo_en.ts b/translations/cubo_en.ts index 40de71b..34a5ac1 100644 --- a/translations/cubo_en.ts +++ b/translations/cubo_en.ts @@ -233,13 +233,13 @@ BmsSettingsScreen - + Serial number - + Configuration @@ -255,7 +255,7 @@ - + SOC @@ -271,7 +271,7 @@ - + Limits @@ -292,7 +292,7 @@ - + Cell configuration @@ -318,7 +318,7 @@ - + Balancing configuration @@ -339,7 +339,7 @@ - + Output settings @@ -349,114 +349,139 @@ - - Use for storage management - - - - + # 2 + + + Active + + + + + Brush control + + + + + Shunt charging contactor + + + + + SOC threshold, % + + + Delay, s + + + + # 3 - + + Cooling activation + + + + # 4 - + + Heating activation + + + + BMS configuration saved to file - + Read default settings - + The settings are written to non-volatile memory. Wait, please. - - Normally closed - - - - - Change in value during SOC - - - - - + + Closes at t<, °C - - + + Use to control charger + + + + + Opens at t>, °C - - + + Current sensor value "0" - + Calibrate "0" - + Load settings from file - - + + Select configuration file - - + + Configuration files (*.xml) - - + + All files (*) - + Save settings to file - + Read current settings from BMS - + Write to non-volatile memory of BMS - + Write current values to BMS diff --git a/translations/cubo_it.ts b/translations/cubo_it.ts index 384f204..3848412 100644 --- a/translations/cubo_it.ts +++ b/translations/cubo_it.ts @@ -233,13 +233,13 @@ BmsSettingsScreen - + Serial number - + Configuration @@ -255,7 +255,7 @@ - + SOC @@ -271,7 +271,7 @@ - + Limits @@ -292,7 +292,7 @@ - + Cell configuration @@ -318,7 +318,7 @@ - + Balancing configuration @@ -339,7 +339,7 @@ - + Output settings @@ -349,114 +349,139 @@ - - Use for storage management - - - - + # 2 + + + Active + + + + + Brush control + + + + + Shunt charging contactor + + + + + SOC threshold, % + + + Delay, s + + + + # 3 - + + Cooling activation + + + + # 4 - + + Heating activation + + + + BMS configuration saved to file - + Read default settings - + The settings are written to non-volatile memory. Wait, please. - - Normally closed - - - - - Change in value during SOC - - - - - + + Closes at t<, °C - - + + Use to control charger + + + + + Opens at t>, °C - - + + Current sensor value "0" - + Calibrate "0" - + Load settings from file - - + + Select configuration file - - + + Configuration files (*.xml) - - + + All files (*) - + Save settings to file - + Read current settings from BMS - + Write to non-volatile memory of BMS - + Write current values to BMS diff --git a/translations/cubo_ru.qm b/translations/cubo_ru.qm index 6ad37d3..e604c23 100644 Binary files a/translations/cubo_ru.qm and b/translations/cubo_ru.qm differ diff --git a/translations/cubo_ru.ts b/translations/cubo_ru.ts index 9014c28..0dde5cd 100644 --- a/translations/cubo_ru.ts +++ b/translations/cubo_ru.ts @@ -245,13 +245,13 @@ BmsSettingsScreen - + Serial number Серийный номер - + Configuration Конфигурация @@ -267,7 +267,7 @@ - + SOC SOC @@ -283,7 +283,7 @@ - + Limits Ограничения @@ -304,7 +304,7 @@ - + Cell configuration Конфигурация ячеек @@ -330,7 +330,7 @@ - + Balancing configuration Конфигурация балансировки @@ -351,7 +351,7 @@ - + Output settings Настройка выходов @@ -361,100 +361,137 @@ № 1 - - Use for storage management + + Use to control charger Использовать для управления ЗУ - + Use for storage management + Использовать для управления ЗУ + + + # 2 № 2 + + + Active + Активный + + + + Brush control + Управление щетками + + + + Shunt charging contactor + Шунтирование зарядного контактора + + + + SOC threshold, % + Уровень SOC, % + + Delay, s + Задержка, с + + + # 3 № 3 - + + Cooling activation + Активация охлаждения + + + # 4 № 4 - + + Heating activation + Активация обогрева + + + BMS configuration saved to file БМС конфигурация сохранена в файл - + Read default settings Загрузить настройки по-умолчанию - + The settings are written to non-volatile memory. Wait, please. Выполняется запись настроек в энергонезависимую память. Пожалуйста подождите. - Normally closed - Нормально замкнут + Нормально замкнут - Change in value during SOC - Изменение значения при SOC + Изменение значения при SOC - - + + Closes at t<, °C Замыкается при t<, °C - - + + Opens at t>, °C Размыкается при t>, °C - - + + Current sensor value "0" Значение датчика тока «0» - + Calibrate "0" Калибровать «0» - + Load settings from file Загрузить настройки из файла - - + + Select configuration file Выберите файл конфигурации - - + + Configuration files (*.xml) Файлы конфигурации (*.xml) - - + + All files (*) Все файлы (*) - + Save settings to file Сохранить настройки в файл @@ -463,17 +500,17 @@ Wait, please. Загрузить настройки из файла - + Read current settings from BMS Загрузить текущие настройки из BMS - + Write to non-volatile memory of BMS Записать в энергонезависимую память BMS - + Write current values to BMS Записать текущие значения в BMS