mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 09:49:32 +02:00
Further improve dialogue boxes and texts
This commit is contained in:
parent
8444855f24
commit
1645c5b337
4 changed files with 26 additions and 19 deletions
|
@ -192,7 +192,7 @@ void handle_contactors() {
|
|||
set(negPin, OFF, PWM_OFF_DUTY);
|
||||
set(posPin, OFF, PWM_OFF_DUTY);
|
||||
set_event(EVENT_ERROR_OPEN_CONTACTOR, 0);
|
||||
datalayer.system.status.contactors_engaged = false;
|
||||
datalayer.system.status.contactors_engaged = 2;
|
||||
return; // A fault scenario latches the contactor control. It is not possible to recover without a powercycle (and investigation why fault occured)
|
||||
}
|
||||
|
||||
|
@ -201,10 +201,9 @@ void handle_contactors() {
|
|||
set(prechargePin, OFF);
|
||||
set(negPin, OFF, PWM_OFF_DUTY);
|
||||
set(posPin, OFF, PWM_OFF_DUTY);
|
||||
datalayer.system.status.contactors_engaged = false;
|
||||
datalayer.system.status.contactors_engaged = 0;
|
||||
|
||||
if (datalayer.system.status.battery_allows_contactor_closing &&
|
||||
datalayer.system.status.inverter_allows_contactor_closing &&
|
||||
if (datalayer.system.status.inverter_allows_contactor_closing &&
|
||||
!datalayer.system.settings.equipment_stop_active) {
|
||||
contactorStatus = START_PRECHARGE;
|
||||
}
|
||||
|
@ -263,7 +262,7 @@ void handle_contactors() {
|
|||
set(posPin, ON, PWM_HOLD_DUTY);
|
||||
dbg_contactors("PRECHARGE_OFF");
|
||||
contactorStatus = COMPLETED;
|
||||
datalayer.system.status.contactors_engaged = true;
|
||||
datalayer.system.status.contactors_engaged = 1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -310,8 +310,8 @@ struct DATALAYER_SYSTEM_STATUS_TYPE {
|
|||
/** True if the inverter allows for the contactors to close */
|
||||
bool inverter_allows_contactor_closing = true;
|
||||
|
||||
/** True if the contactor controlled by battery-emulator is closed */
|
||||
bool contactors_engaged = false;
|
||||
/** 0 if starting up, 1 if contactors engaged, 2 if the contactors controlled by battery-emulator is opened */
|
||||
uint8_t contactors_engaged = 0;
|
||||
/** True if the contactor controlled by battery-emulator is closed. Determined by check_interconnect_available(); if voltage is OK */
|
||||
bool contactors_battery2_engaged = false;
|
||||
|
||||
|
|
|
@ -270,8 +270,8 @@ String get_event_message_string(EVENTS_ENUM_TYPE event) {
|
|||
case EVENT_INTERFACE_MISSING:
|
||||
return "Configuration trying to use CAN interface not baked into the software. Recompile software!";
|
||||
case EVENT_ERROR_OPEN_CONTACTOR:
|
||||
return "Too much time spent in error state. Opening contactors, not safe to continue charging. "
|
||||
"Check other error code for reason!";
|
||||
return "Too much time spent in error state. Opening contactors, not safe to continue. "
|
||||
"Check other active ERROR code for reason. Reboot emulator after problem is solved!";
|
||||
case EVENT_MODBUS_INVERTER_MISSING:
|
||||
return "Modbus inverter has not sent any data. Inspect communication wiring!";
|
||||
case EVENT_NO_ENABLE_DETECTED:
|
||||
|
|
|
@ -1277,7 +1277,7 @@ String processor(const String& var) {
|
|||
content += "<h4 style='color: red;'>Power status: " + String(get_emulator_pause_status().c_str()) + " </h4>";
|
||||
}
|
||||
|
||||
content += "<h4>Battery allows contactor closing: ";
|
||||
content += "<h4>Emulator allows contactor closing: ";
|
||||
if (datalayer.battery.status.bms_status == FAULT) {
|
||||
content += "<span style='color: red;'>✕</span>";
|
||||
} else {
|
||||
|
@ -1289,12 +1289,14 @@ String processor(const String& var) {
|
|||
} else {
|
||||
content += "<span style='color: red;'>✕</span></h4>";
|
||||
}
|
||||
if (battery2) {
|
||||
content += "<h4>Secondary battery allowed to join ";
|
||||
if (datalayer.system.status.battery2_allowed_contactor_closing == true) {
|
||||
content += "<span>✓</span>";
|
||||
} else {
|
||||
content += "<span style='color: red;'>✕ (voltage mismatch)</span>";
|
||||
}
|
||||
}
|
||||
|
||||
if (!contactor_control_enabled) {
|
||||
content += "<div class=\"tooltip\">";
|
||||
|
@ -1304,13 +1306,19 @@ String processor(const String& var) {
|
|||
"powering the contactors. Battery-Emulator will have limited amount of control over the contactors!</span>";
|
||||
content += "</div>";
|
||||
} else { //contactor_control_enabled TRUE
|
||||
content += "<h4>Contactors controlled by emulator, state: ";
|
||||
if (datalayer.system.status.contactors_engaged) {
|
||||
content += "<div class=\"tooltip\"><h4>Contactors controlled by emulator, state: ";
|
||||
if (datalayer.system.status.contactors_engaged == 0) {
|
||||
content += "<span style='color: green;'>PRECHARGE</span>";
|
||||
} else if (datalayer.system.status.contactors_engaged == 1) {
|
||||
content += "<span style='color: green;'>ON</span>";
|
||||
} else {
|
||||
} else if (datalayer.system.status.contactors_engaged == 2) {
|
||||
content += "<span style='color: red;'>OFF</span>";
|
||||
content += "<span class=\"tooltip-icon\"> [!]</span>";
|
||||
content +=
|
||||
"<span class=\"tooltiptext\">Emulator spent too much time in critical FAULT event. Investigate event "
|
||||
"causing this via Events page. Reboot required to resume operation!</span>";
|
||||
}
|
||||
content += "</h4>";
|
||||
content += "</h4></div>";
|
||||
if (contactor_control_enabled_double_battery) {
|
||||
if (pwm_contactor_control) {
|
||||
content += "<h4>Cont. Neg.: ";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue