mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-04 02:09:30 +02:00
Add target voltage setting, configurable
This commit is contained in:
parent
b35635676f
commit
3653ff6449
8 changed files with 183 additions and 27 deletions
|
@ -67,6 +67,21 @@ String settings_processor(const String& var) {
|
|||
content += "<h4 style='color: white;'>Max discharge speed: " +
|
||||
String(datalayer.battery.settings.max_user_set_discharge_dA / 10.0, 1) +
|
||||
" A </span> <button onclick='editMaxDischargeA()'>Edit</button></h4>";
|
||||
content += "<h4 style='color: white;'>Manual charge voltage limits: <span id='BATTERY_USE_VOLTAGE_LIMITS'>" +
|
||||
String(datalayer.battery.settings.user_set_voltage_limits_active
|
||||
? "<span>✓</span>"
|
||||
: "<span style='color: red;'>✕</span>") +
|
||||
"</span> <button onclick='editUseVoltageLimit()'>Edit</button></h4>";
|
||||
content +=
|
||||
"<h4 style='color: " +
|
||||
String(datalayer.battery.settings.user_set_voltage_limits_active ? "white" : "darkgrey") +
|
||||
";'>Target charge voltage: " + String(datalayer.battery.settings.max_user_set_charge_voltage_dV / 10.0, 1) +
|
||||
" V </span> <button onclick='editMaxChargeVoltage()'>Edit</button></h4>";
|
||||
content += "<h4 style='color: " +
|
||||
String(datalayer.battery.settings.user_set_voltage_limits_active ? "white" : "darkgrey") +
|
||||
";'>Target discharge voltage: " +
|
||||
String(datalayer.battery.settings.max_user_set_discharge_voltage_dV / 10.0, 1) +
|
||||
" V </span> <button onclick='editMaxDischargeVoltage()'>Edit</button></h4>";
|
||||
// Close the block
|
||||
content += "</div>";
|
||||
|
||||
|
@ -130,7 +145,9 @@ String settings_processor(const String& var) {
|
|||
"updateBatterySize?value='+value,true);xhr.send();}else{alert('Invalid value. Please enter a value between 1 "
|
||||
"and 120000.');}}}";
|
||||
content +=
|
||||
"function editUseScaledSOC(){var value=prompt('Should SOC% be scaled? (0 = No, 1 = "
|
||||
"function editUseScaledSOC(){var value=prompt('Extends battery life by rescaling the SOC within the configured "
|
||||
"minimum "
|
||||
"and maximum percentage. Should SOC scaling be applied? (0 = No, 1 = "
|
||||
"Yes):');if(value!==null){if(value==0||value==1){var xhr=new "
|
||||
"XMLHttpRequest();xhr.onload=editComplete;xhr.onerror=editError;xhr.open('GET','/"
|
||||
"updateUseScaledSOC?value='+value,true);xhr.send();}else{alert('Invalid value. Please enter a value between 0 "
|
||||
|
@ -161,6 +178,33 @@ String settings_processor(const String& var) {
|
|||
"XMLHttpRequest();xhr.onload=editComplete;xhr.onerror=editError;xhr.open('GET','/"
|
||||
"updateMaxDischargeA?value='+value,true);xhr.send();}else{alert('Invalid value. Please enter a value between 0 "
|
||||
"and 1000.0');}}}";
|
||||
content +=
|
||||
"function editUseVoltageLimit(){var value=prompt('Enable this option to manually restrict charge/discharge to "
|
||||
"a specific voltage set below."
|
||||
"If disabled the emulator automatically determines this based on battery limits. Restrict manually? (0 = No, 1 "
|
||||
"= Yes)"
|
||||
":');if(value!==null){if(value==0||value==1){var xhr=new "
|
||||
"XMLHttpRequest();xhr.onload=editComplete;xhr.onerror=editError;xhr.open('GET','/"
|
||||
"updateUseVoltageLimit?value='+value,true);xhr.send();}else{alert('Invalid value. Please enter a value between "
|
||||
"0 "
|
||||
"and 1.');}}}";
|
||||
content +=
|
||||
"function editMaxChargeVoltage(){var value=prompt('Some inverters needs to be artificially limited. Enter new "
|
||||
"voltage setpoint batttery should charge to (0-1000.0):');if(value!==null){if(value>=0&&value<=1000){var "
|
||||
"xhr=new "
|
||||
"XMLHttpRequest();xhr.onload=editComplete;xhr.onerror=editError;xhr.open('GET','/"
|
||||
"updateMaxChargeVoltage?value='+value,true);xhr.send();}else{alert('Invalid value. Please enter a value "
|
||||
"between 0 "
|
||||
"and 1000.0');}}}";
|
||||
content +=
|
||||
"function editMaxDischargeVoltage(){var value=prompt('Some inverters needs to be artificially limited. Enter "
|
||||
"new "
|
||||
"voltage setpoint batttery should discharge to (0-1000.0):');if(value!==null){if(value>=0&&value<=1000){var "
|
||||
"xhr=new "
|
||||
"XMLHttpRequest();xhr.onload=editComplete;xhr.onerror=editError;xhr.open('GET','/"
|
||||
"updateMaxDischargeVoltage?value='+value,true);xhr.send();}else{alert('Invalid value. Please enter a value "
|
||||
"between 0 "
|
||||
"and 1000.0');}}}";
|
||||
|
||||
#ifdef TEST_FAKE_BATTERY
|
||||
content +=
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue