diff --git a/Software/USER_SETTINGS.h b/Software/USER_SETTINGS.h index 59973c2a..a1d246fa 100644 --- a/Software/USER_SETTINGS.h +++ b/Software/USER_SETTINGS.h @@ -171,6 +171,12 @@ // 3000 = 300.0V, Target discharge voltage (Value can be tuned on the fly via webserver). Not used unless BATTERY_USE_VOLTAGE_LIMITS = true #define BATTERY_MAX_DISCHARGE_VOLTAGE 3000 +/* Pack/cell voltage limits for custom-BMS batteries (RJXZS, Daly, etc.) */ +//#define MAX_CUSTOM_PACK_VOLTAGE_DV 5000 // 5000 = 500.0V , Maximum pack voltage in decivolts +//#define MIN_CUSTOM_PACK_VOLTAGE_DV 2500 // 2500 = 250.0V , Minimum pack voltage in decivolts +//#define MAX_CUSTOM_CELL_VOLTAGE_MV 4250 // 4250 = 4.250V , Maximum cell voltage in millivolts (4250 = 4.250V) +//#define MIN_CUSTOM_CELL_VOLTAGE_MV 2650 // 2650 = 2.650V , Minimum cell voltage in millivolts (2650 = 2.650V) + /* LED settings. Optional customization for how the blinking pattern on the LED should behave. * CLASSIC - Slow up/down ramp. If CLASSIC, then a ramp up and ramp down will finish in LED_PERIOD_MS milliseconds * FLOW - Ramp up/down depending on flow of energy diff --git a/Software/src/battery/BATTERIES.cpp b/Software/src/battery/BATTERIES.cpp index f138c488..1aa07bc6 100644 --- a/Software/src/battery/BATTERIES.cpp +++ b/Software/src/battery/BATTERIES.cpp @@ -312,3 +312,23 @@ void setup_battery() { #endif } #endif + +/* User-selected voltages used for custom-BMS batteries (RJXZS etc.) */ +#if defined(MAX_CUSTOM_PACK_VOLTAGE_DV) && defined(MIN_CUSTOM_PACK_VOLTAGE_DV) && \ + defined(MAX_CUSTOM_CELL_VOLTAGE_MV) && defined(MIN_CUSTOM_CELL_VOLTAGE_MV) +// Use USER_SETTINGS.h values for cell/pack voltage defaults +uint16_t user_selected_max_pack_voltage_default_dV = MAX_CUSTOM_PACK_VOLTAGE_DV; +uint16_t user_selected_min_pack_voltage_default_dV = MIN_CUSTOM_PACK_VOLTAGE_DV; +uint16_t user_selected_max_cell_voltage_default_mV = MAX_CUSTOM_CELL_VOLTAGE_MV; +uint16_t user_selected_min_cell_voltage_default_mV = MIN_CUSTOM_CELL_VOLTAGE_MV; +#else +// Use 0V for user selected cell/pack voltage defaults (COMMON_IMAGE will replace with saved values from NVM) +uint16_t user_selected_max_pack_voltage_default_dV = 0; +uint16_t user_selected_min_pack_voltage_default_dV = 0; +uint16_t user_selected_max_cell_voltage_default_mV = 0; +uint16_t user_selected_min_cell_voltage_default_mV = 0; +#endif +uint16_t user_selected_max_pack_voltage_dV = user_selected_max_pack_voltage_default_dV; +uint16_t user_selected_min_pack_voltage_dV = user_selected_min_pack_voltage_default_dV; +uint16_t user_selected_max_cell_voltage_mV = user_selected_max_cell_voltage_default_mV; +uint16_t user_selected_min_cell_voltage_mV = user_selected_min_cell_voltage_default_mV; diff --git a/Software/src/battery/BATTERIES.h b/Software/src/battery/BATTERIES.h index 1f357a93..3e89149c 100644 --- a/Software/src/battery/BATTERIES.h +++ b/Software/src/battery/BATTERIES.h @@ -55,4 +55,9 @@ void setup_can_shunt(); void setup_battery(void); +extern uint16_t user_selected_max_pack_voltage_dV; +extern uint16_t user_selected_min_pack_voltage_dV; +extern uint16_t user_selected_max_cell_voltage_mV; +extern uint16_t user_selected_min_cell_voltage_mV; + #endif diff --git a/Software/src/battery/CELLPOWER-BMS.cpp b/Software/src/battery/CELLPOWER-BMS.cpp index 04407fc4..baa375d6 100644 --- a/Software/src/battery/CELLPOWER-BMS.cpp +++ b/Software/src/battery/CELLPOWER-BMS.cpp @@ -1,4 +1,5 @@ #include "CELLPOWER-BMS.h" +#include "../battery/BATTERIES.h" #include "../communication/can/comm_can.h" #include "../datalayer/datalayer.h" #include "../datalayer/datalayer_extended.h" //For "More battery info" webpage @@ -231,8 +232,8 @@ void CellPowerBms::setup(void) { // Performs one time setup at startup strncpy(datalayer.system.info.battery_protocol, Name, 63); datalayer.system.info.battery_protocol[63] = '\0'; datalayer.system.status.battery_allows_contactor_closing = true; - datalayer.battery.info.max_design_voltage_dV = MAX_PACK_VOLTAGE_DV; - datalayer.battery.info.min_design_voltage_dV = MIN_PACK_VOLTAGE_DV; - datalayer.battery.info.max_cell_voltage_mV = MAX_CELL_VOLTAGE_MV; - datalayer.battery.info.min_cell_voltage_mV = MIN_CELL_VOLTAGE_MV; + datalayer.battery.info.max_design_voltage_dV = user_selected_max_pack_voltage_dV; + datalayer.battery.info.min_design_voltage_dV = user_selected_min_pack_voltage_dV; + datalayer.battery.info.max_cell_voltage_mV = user_selected_max_cell_voltage_mV; + datalayer.battery.info.min_cell_voltage_mV = user_selected_min_cell_voltage_mV; } diff --git a/Software/src/battery/CELLPOWER-BMS.h b/Software/src/battery/CELLPOWER-BMS.h index 3a22c732..ba8be709 100644 --- a/Software/src/battery/CELLPOWER-BMS.h +++ b/Software/src/battery/CELLPOWER-BMS.h @@ -22,11 +22,6 @@ class CellPowerBms : public CanBattery { private: CellpowerHtmlRenderer renderer; - /* Tweak these according to your battery build */ - static const int MAX_PACK_VOLTAGE_DV = 5000; //5000 = 500.0V - static const int MIN_PACK_VOLTAGE_DV = 1500; - static const int MAX_CELL_VOLTAGE_MV = 4250; //Battery is put into emergency stop if one cell goes over this value - static const int MIN_CELL_VOLTAGE_MV = 2700; //Battery is put into emergency stop if one cell goes below this value unsigned long previousMillis1s = 0; // will store last time a 1s CAN Message was sent diff --git a/Software/src/battery/DALY-BMS.cpp b/Software/src/battery/DALY-BMS.cpp index 9eb2e577..49d0314a 100644 --- a/Software/src/battery/DALY-BMS.cpp +++ b/Software/src/battery/DALY-BMS.cpp @@ -1,6 +1,7 @@ #include "DALY-BMS.h" #include #include +#include "../battery/BATTERIES.h" #include "../datalayer/datalayer.h" #include "../devboard/hal/hal.h" #include "../devboard/utils/events.h" @@ -67,10 +68,10 @@ void DalyBms::update_values() { void DalyBms::setup(void) { // Performs one time setup at startup strncpy(datalayer.system.info.battery_protocol, Name, 63); datalayer.system.info.battery_protocol[63] = '\0'; - datalayer.battery.info.max_design_voltage_dV = MAX_PACK_VOLTAGE_DV; - datalayer.battery.info.min_design_voltage_dV = MIN_PACK_VOLTAGE_DV; - datalayer.battery.info.max_cell_voltage_mV = MAX_CELL_VOLTAGE_MV; - datalayer.battery.info.min_cell_voltage_mV = MIN_CELL_VOLTAGE_MV; + datalayer.battery.info.max_design_voltage_dV = user_selected_max_pack_voltage_dV; + datalayer.battery.info.min_design_voltage_dV = user_selected_min_pack_voltage_dV; + datalayer.battery.info.max_cell_voltage_mV = user_selected_max_cell_voltage_mV; + datalayer.battery.info.min_cell_voltage_mV = user_selected_min_cell_voltage_mV; datalayer.battery.info.total_capacity_Wh = BATTERY_WH_MAX; datalayer.system.status.battery_allows_contactor_closing = true; diff --git a/Software/src/battery/DALY-BMS.h b/Software/src/battery/DALY-BMS.h index 27ec018d..4b9c6998 100644 --- a/Software/src/battery/DALY-BMS.h +++ b/Software/src/battery/DALY-BMS.h @@ -17,11 +17,6 @@ class DalyBms : public RS485Battery { private: /* Tweak these according to your battery build */ - static const int CELL_COUNT = 14; - static const int MAX_PACK_VOLTAGE_DV = 580; //580 = 58.0V - static const int MIN_PACK_VOLTAGE_DV = 460; //480 = 48.0V - static const int MAX_CELL_VOLTAGE_MV = 4200; //Battery is put into emergency stop if one cell goes over this value - static const int MIN_CELL_VOLTAGE_MV = 3200; //Battery is put into emergency stop if one cell goes below this value static const int POWER_PER_PERCENT = 50; // below 20% and above 80% limit power to 50W * SOC (i.e. 150W at 3%, 500W at 10%, ...) static const int POWER_PER_DEGREE_C = 60; // max power added/removed per degree above/below 0°C diff --git a/Software/src/battery/ORION-BMS.cpp b/Software/src/battery/ORION-BMS.cpp index bf23ded6..e99d03db 100644 --- a/Software/src/battery/ORION-BMS.cpp +++ b/Software/src/battery/ORION-BMS.cpp @@ -1,4 +1,5 @@ #include "ORION-BMS.h" +#include "../battery/BATTERIES.h" #include "../communication/can/comm_can.h" #include "../datalayer/datalayer.h" #include "../devboard/utils/events.h" @@ -115,9 +116,9 @@ void OrionBms::transmit_can(unsigned long currentMillis) { void OrionBms::setup(void) { // Performs one time setup at startup strncpy(datalayer.system.info.battery_protocol, Name, 63); datalayer.system.info.battery_protocol[63] = '\0'; - datalayer.battery.info.max_design_voltage_dV = MAX_PACK_VOLTAGE_DV; - datalayer.battery.info.min_design_voltage_dV = MIN_PACK_VOLTAGE_DV; - datalayer.battery.info.max_cell_voltage_mV = MAX_CELL_VOLTAGE_MV; - datalayer.battery.info.min_cell_voltage_mV = MIN_CELL_VOLTAGE_MV; + datalayer.battery.info.max_design_voltage_dV = user_selected_max_pack_voltage_dV; + datalayer.battery.info.min_design_voltage_dV = user_selected_min_pack_voltage_dV; + datalayer.battery.info.max_cell_voltage_mV = user_selected_max_cell_voltage_mV; + datalayer.battery.info.min_cell_voltage_mV = user_selected_min_cell_voltage_mV; datalayer.system.status.battery_allows_contactor_closing = true; } diff --git a/Software/src/battery/ORION-BMS.h b/Software/src/battery/ORION-BMS.h index d93d3ae3..eaf03c59 100644 --- a/Software/src/battery/ORION-BMS.h +++ b/Software/src/battery/ORION-BMS.h @@ -17,13 +17,6 @@ class OrionBms : public CanBattery { static constexpr const char* Name = "DIY battery with Orion BMS (Victron setting)"; private: - /* Change the following to suit your battery */ - static const int MAX_PACK_VOLTAGE_DV = 5000; //5000 = 500.0V - static const int MIN_PACK_VOLTAGE_DV = 1500; - static const int MAX_CELL_VOLTAGE_MV = 4250; //Battery is put into emergency stop if one cell goes over this value - static const int MIN_CELL_VOLTAGE_MV = 2700; //Battery is put into emergency stop if one cell goes below this value - static const int MAX_CELL_DEVIATION_MV = 150; - uint16_t cellvoltages[MAX_AMOUNT_CELLS]; //array with all the cellvoltages uint16_t Maximum_Cell_Voltage = 3700; uint16_t Minimum_Cell_Voltage = 3700; diff --git a/Software/src/battery/PYLON-BATTERY.cpp b/Software/src/battery/PYLON-BATTERY.cpp index c2a8ac40..e03b8393 100644 --- a/Software/src/battery/PYLON-BATTERY.cpp +++ b/Software/src/battery/PYLON-BATTERY.cpp @@ -1,4 +1,5 @@ #include "PYLON-BATTERY.h" +#include "../battery/BATTERIES.h" #include "../communication/can/comm_can.h" #include "../datalayer/datalayer.h" #include "../devboard/utils/events.h" @@ -131,10 +132,10 @@ void PylonBattery::setup(void) { // Performs one time setup at startup strncpy(datalayer.system.info.battery_protocol, "Pylon compatible battery", 63); datalayer.system.info.battery_protocol[63] = '\0'; datalayer_battery->info.number_of_cells = 2; - datalayer_battery->info.max_design_voltage_dV = MAX_PACK_VOLTAGE_DV; - datalayer_battery->info.min_design_voltage_dV = MIN_PACK_VOLTAGE_DV; - datalayer_battery->info.max_cell_voltage_mV = MAX_CELL_VOLTAGE_MV; - datalayer_battery->info.min_cell_voltage_mV = MIN_CELL_VOLTAGE_MV; + datalayer_battery->info.max_design_voltage_dV = user_selected_max_pack_voltage_dV; + datalayer_battery->info.min_design_voltage_dV = user_selected_min_pack_voltage_dV; + datalayer_battery->info.max_cell_voltage_mV = user_selected_max_cell_voltage_mV; + datalayer_battery->info.min_cell_voltage_mV = user_selected_min_cell_voltage_mV; datalayer.battery2.info.max_cell_voltage_deviation_mV = MAX_CELL_DEVIATION_MV; diff --git a/Software/src/battery/PYLON-BATTERY.h b/Software/src/battery/PYLON-BATTERY.h index 71963e83..bc88ba99 100644 --- a/Software/src/battery/PYLON-BATTERY.h +++ b/Software/src/battery/PYLON-BATTERY.h @@ -32,11 +32,6 @@ class PylonBattery : public CanBattery { static constexpr const char* Name = "Pylon compatible battery"; private: - /* Change the following to suit your battery */ - static const int MAX_PACK_VOLTAGE_DV = 5000; //5000 = 500.0V - static const int MIN_PACK_VOLTAGE_DV = 1500; - static const int MAX_CELL_VOLTAGE_MV = 4250; //Battery is put into emergency stop if one cell goes over this value - static const int MIN_CELL_VOLTAGE_MV = 2700; //Battery is put into emergency stop if one cell goes below this value static const int MAX_CELL_DEVIATION_MV = 150; DATALAYER_BATTERY_TYPE* datalayer_battery; diff --git a/Software/src/battery/RJXZS-BMS.cpp b/Software/src/battery/RJXZS-BMS.cpp index 61358e96..6bbb4fe8 100644 --- a/Software/src/battery/RJXZS-BMS.cpp +++ b/Software/src/battery/RJXZS-BMS.cpp @@ -1,4 +1,5 @@ #include "RJXZS-BMS.h" +#include "../battery/BATTERIES.h" #include "../communication/can/comm_can.h" #include "../datalayer/datalayer.h" #include "../devboard/utils/events.h" @@ -511,9 +512,9 @@ void RjxzsBms::transmit_can(unsigned long currentMillis) { void RjxzsBms::setup(void) { // Performs one time setup at startup strncpy(datalayer.system.info.battery_protocol, Name, 63); datalayer.system.info.battery_protocol[63] = '\0'; - datalayer.battery.info.max_design_voltage_dV = MAX_PACK_VOLTAGE_DV; - datalayer.battery.info.min_design_voltage_dV = MIN_PACK_VOLTAGE_DV; - datalayer.battery.info.max_cell_voltage_mV = MAX_CELL_VOLTAGE_MV; - datalayer.battery.info.min_cell_voltage_mV = MIN_CELL_VOLTAGE_MV; + datalayer.battery.info.max_design_voltage_dV = user_selected_max_pack_voltage_dV; + datalayer.battery.info.min_design_voltage_dV = user_selected_min_pack_voltage_dV; + datalayer.battery.info.max_cell_voltage_mV = user_selected_max_cell_voltage_mV; + datalayer.battery.info.min_cell_voltage_mV = user_selected_min_cell_voltage_mV; datalayer.system.status.battery_allows_contactor_closing = true; } diff --git a/Software/src/battery/RJXZS-BMS.h b/Software/src/battery/RJXZS-BMS.h index d6f4c53b..d616f31a 100644 --- a/Software/src/battery/RJXZS-BMS.h +++ b/Software/src/battery/RJXZS-BMS.h @@ -20,11 +20,6 @@ class RjxzsBms : public CanBattery { private: /* Tweak these according to your battery build */ - static const int MAX_PACK_VOLTAGE_DV = 5000; //5000 = 500.0V - static const int MIN_PACK_VOLTAGE_DV = 1500; - static const int MAX_CELL_VOLTAGE_MV = 4250; //Battery is put into emergency stop if one cell goes over this value - static const int MIN_CELL_VOLTAGE_MV = 2700; //Battery is put into emergency stop if one cell goes below this value - static const int MAX_CELL_DEVIATION_MV = 250; static const int MAX_DISCHARGE_POWER_ALLOWED_W = 5000; static const int MAX_CHARGE_POWER_ALLOWED_W = 5000; static const int MAX_CHARGE_POWER_WHEN_TOPBALANCING_W = 500; diff --git a/Software/src/battery/SIMPBMS-BATTERY.cpp b/Software/src/battery/SIMPBMS-BATTERY.cpp index 502faf8c..bc58c580 100644 --- a/Software/src/battery/SIMPBMS-BATTERY.cpp +++ b/Software/src/battery/SIMPBMS-BATTERY.cpp @@ -1,4 +1,5 @@ #include "SIMPBMS-BATTERY.h" +#include "../battery/BATTERIES.h" #include "../datalayer/datalayer.h" #include "../devboard/utils/events.h" @@ -93,9 +94,9 @@ void SimpBmsBattery::transmit_can(unsigned long currentMillis) { void SimpBmsBattery::setup(void) { // Performs one time setup at startup strncpy(datalayer.system.info.battery_protocol, Name, 63); datalayer.system.info.battery_protocol[63] = '\0'; - datalayer.battery.info.max_design_voltage_dV = MAX_PACK_VOLTAGE_DV; - datalayer.battery.info.min_design_voltage_dV = MIN_PACK_VOLTAGE_DV; - datalayer.battery.info.max_cell_voltage_mV = MAX_CELL_VOLTAGE_MV; - datalayer.battery.info.min_cell_voltage_mV = MIN_CELL_VOLTAGE_MV; + datalayer.battery.info.max_design_voltage_dV = user_selected_max_pack_voltage_dV; + datalayer.battery.info.min_design_voltage_dV = user_selected_min_pack_voltage_dV; + datalayer.battery.info.max_cell_voltage_mV = user_selected_max_cell_voltage_mV; + datalayer.battery.info.min_cell_voltage_mV = user_selected_min_cell_voltage_mV; datalayer.system.status.battery_allows_contactor_closing = true; } diff --git a/Software/src/battery/SIMPBMS-BATTERY.h b/Software/src/battery/SIMPBMS-BATTERY.h index 914bd58f..9295c635 100644 --- a/Software/src/battery/SIMPBMS-BATTERY.h +++ b/Software/src/battery/SIMPBMS-BATTERY.h @@ -16,13 +16,6 @@ class SimpBmsBattery : public CanBattery { static constexpr const char* Name = "SIMPBMS battery"; private: - /* DEFAULT VALUES BMS will send configured */ - static const int MAX_PACK_VOLTAGE_DV = 5000; //5000 = 500.0V - static const int MIN_PACK_VOLTAGE_DV = 1500; - static const int MAX_CELL_VOLTAGE_MV = 4250; //Battery is put into emergency stop if one cell goes over this value - static const int MIN_CELL_VOLTAGE_MV = 2700; //Battery is put into emergency stop if one cell goes below this value - static const int MAX_CELL_DEVIATION_MV = 500; - static const int SIMPBMS_MAX_CELLS = 128; unsigned long previousMillis1000 = 0; // will store last time a 1s CAN Message was sent diff --git a/Software/src/communication/nvm/comm_nvm.cpp b/Software/src/communication/nvm/comm_nvm.cpp index a7ec7e2d..582316d8 100644 --- a/Software/src/communication/nvm/comm_nvm.cpp +++ b/Software/src/communication/nvm/comm_nvm.cpp @@ -1,4 +1,5 @@ #include "comm_nvm.h" +#include "../../battery/BATTERIES.h" #include "../../battery/Battery.h" #include "../../battery/Shunt.h" #include "../../charger/CanCharger.h" @@ -91,6 +92,10 @@ void init_stored_settings() { user_selected_inverter_protocol = (InverterProtocolType)settings.getUInt("INVTYPE", (int)InverterProtocolType::None); user_selected_charger_type = (ChargerType)settings.getUInt("CHGTYPE", (int)ChargerType::None); user_selected_shunt_type = (ShuntType)settings.getUInt("SHUNTTYPE", (int)ShuntType::None); + user_selected_max_pack_voltage_dV = settings.getUInt("BATTPVMAX", 0); + user_selected_min_pack_voltage_dV = settings.getUInt("BATTPVMIN", 0); + user_selected_max_cell_voltage_mV = settings.getUInt("BATTCVMAX", 0); + user_selected_min_cell_voltage_mV = settings.getUInt("BATTCVMIN", 0); auto readIf = [](const char* settingName) { auto batt1If = (comm_interface)settings.getUInt(settingName, (int)comm_interface::CanNative); diff --git a/Software/src/devboard/webserver/index_html.h b/Software/src/devboard/webserver/index_html.h index cd867244..8cd4d5b3 100644 --- a/Software/src/devboard/webserver/index_html.h +++ b/Software/src/devboard/webserver/index_html.h @@ -17,6 +17,9 @@ function reboot() { var xhr = new XMLHttpRequest(); xhr.open('GET', '/reboot', true); xhr.send(); + setTimeout(function() { + window.location = "/"; + }, 3000); } )rawliteral" diff --git a/Software/src/devboard/webserver/settings_html.cpp b/Software/src/devboard/webserver/settings_html.cpp index 8e866a48..e9e52804 100644 --- a/Software/src/devboard/webserver/settings_html.cpp +++ b/Software/src/devboard/webserver/settings_html.cpp @@ -306,6 +306,22 @@ String settings_processor(const String& var, BatteryEmulatorSettingsStore& setti } } + if (var == "BATTPVMAX") { + return String(static_cast(settings.getUInt("BATTPVMAX", 0)) / 10.0, 1); + } + + if (var == "BATTPVMIN") { + return String(static_cast(settings.getUInt("BATTPVMIN", 0)) / 10.0, 1); + } + + if (var == "BATTCVMAX") { + return String(settings.getUInt("BATTCVMAX", 0)); + } + + if (var == "BATTCVMIN") { + return String(settings.getUInt("BATTCVMIN", 0)); + } + if (var == "BATTERY_WH_MAX") { return String(datalayer.battery.info.total_capacity_Wh); } @@ -593,23 +609,13 @@ const char* getCANInterfaceName(CAN_Interface interface) { function goToMainPage() { window.location.href = '/'; } - function toggleMqtt() { - var mqttEnabled = document.querySelector('input[name="MQTTENABLED"]').checked; - document.querySelectorAll('.mqtt-settings').forEach(function (el) { - el.style.display = mqttEnabled ? 'contents' : 'none'; - }); - } - - document.addEventListener('DOMContentLoaded', toggleMqtt); - - function toggleTopics() { - var topicsEnabled = document.querySelector('input[name="MQTTTOPICS"]').checked; - document.querySelectorAll('.mqtt-topics').forEach(function (el) { - el.style.display = topicsEnabled ? 'contents' : 'none'; - }); - } - - document.addEventListener('DOMContentLoaded', toggleTopics); + document.querySelectorAll('select,input').forEach(function(sel) { + function ch() { + sel.closest('form').setAttribute('data-' + sel.name?.toLowerCase(), sel.type=='checkbox'?sel.checked:sel.value); + } + sel.addEventListener('change', ch); + ch(); + }); )rawliteral" @@ -621,7 +627,7 @@ const char* getCANInterfaceName(CAN_Interface interface) { cursor: pointer; border-radius: 10px; } button:hover { background-color: #3A4A52; } h4 { margin: 0.6em 0; line-height: 1.2; } - select { max-width: 250px; } + select, input { max-width: 250px; box-sizing: border-box; } .hidden { display: none; } @@ -641,6 +647,32 @@ const char* getCANInterfaceName(CAN_Interface interface) { grid-column: span 2; } + form .if-battery, form .if-inverter, form .if-charger, form .if-shunt { display: contents; } + form[data-battery="0"] .if-battery { display: none; } + form[data-inverter="0"] .if-inverter { display: none; } + form[data-charger="0"] .if-charger { display: none; } + form[data-shunt="0"] .if-shunt { display: none; } + + form .if-cbms { display: none; } + form[data-battery="6"] .if-cbms, form[data-battery="11"] .if-cbms, form[data-battery="22"] .if-cbms, form[data-battery="23"] .if-cbms, form[data-battery="24"] .if-cbms, form[data-battery="31"] .if-cbms { + display: contents; + } + + form .if-dblbtr { display: none; } + form[data-dblbtr="true"] .if-dblbtr { + display: contents; + } + + form .if-mqtt { display: none; } + form[data-mqttenabled="true"] .if-mqtt { + display: contents; + } + + form .if-topics { display: none; } + form[data-mqtttopics="true"] .if-topics { + display: contents; + } + )rawliteral" @@ -654,13 +686,13 @@ const char* getCANInterfaceName(CAN_Interface interface) {
-
+ +
@@ -668,30 +700,51 @@ const char* getCANInterfaceName(CAN_Interface interface) { +
+ +
+ + + + + + + + + + + +
+
+
+
+
+
+
+
+
+
+
@@ -726,26 +783,26 @@ const char* getCANInterfaceName(CAN_Interface interface) { - + - + -
- - - - +
+ + + + - + -
+
- - - - + + + +
@@ -754,10 +811,10 @@ const char* getCANInterfaceName(CAN_Interface interface) {
-
+
-

Settings saved. Reboot to take the settings into use.

+

Settings saved. Reboot to take the settings into use.

diff --git a/Software/src/devboard/webserver/webserver.cpp b/Software/src/devboard/webserver/webserver.cpp index 174efc78..4949bd86 100644 --- a/Software/src/devboard/webserver/webserver.cpp +++ b/Software/src/devboard/webserver/webserver.cpp @@ -445,6 +445,18 @@ void init_webserver() { } else if (p->name() == "BATTCOMM") { auto type = static_cast(atoi(p->value().c_str())); settings.saveUInt("BATTCOMM", (int)type); + } else if (p->name() == "BATTPVMAX") { + auto type = p->value().toFloat() * 10.0; + settings.saveUInt("BATTPVMAX", (int)type); + } else if (p->name() == "BATTPVMIN") { + auto type = p->value().toFloat() * 10.0; + settings.saveUInt("BATTPVMIN", (int)type); + } else if (p->name() == "BATTCVMAX") { + auto type = atoi(p->value().c_str()); + settings.saveUInt("BATTCVMAX", type); + } else if (p->name() == "BATTCVMIN") { + auto type = atoi(p->value().c_str()); + settings.saveUInt("BATTCVMIN", type); } else if (p->name() == "charger") { auto type = static_cast(atoi(p->value().c_str())); settings.saveUInt("CHGTYPE", (int)type);