mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-04 18:29:48 +02:00
Improve secondary battery visualization
This commit is contained in:
parent
1645c5b337
commit
5888457926
2 changed files with 5 additions and 51 deletions
|
@ -55,7 +55,7 @@ const int OFF = 0;
|
||||||
#define OFF 1
|
#define OFF 1
|
||||||
#endif //NC_CONTACTORS
|
#endif //NC_CONTACTORS
|
||||||
|
|
||||||
#define MAX_ALLOWED_FAULT_TICKS 1000
|
#define MAX_ALLOWED_FAULT_TICKS 1000 //1000 = 10 seconds
|
||||||
#define NEGATIVE_CONTACTOR_TIME_MS \
|
#define NEGATIVE_CONTACTOR_TIME_MS \
|
||||||
500 // Time after negative contactor is turned on, to start precharge (not actual precharge time!)
|
500 // Time after negative contactor is turned on, to start precharge (not actual precharge time!)
|
||||||
#define PRECHARGE_COMPLETED_TIME_MS \
|
#define PRECHARGE_COMPLETED_TIME_MS \
|
||||||
|
|
|
@ -1222,47 +1222,6 @@ String processor(const String& var) {
|
||||||
} else { // > 0
|
} else { // > 0
|
||||||
content += "<h4>Battery charging!</h4>";
|
content += "<h4>Battery charging!</h4>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (contactor_control_enabled) {
|
|
||||||
content += "<h4>Contactors controlled by emulator, state: ";
|
|
||||||
if (datalayer.system.status.contactors_battery2_engaged) {
|
|
||||||
content += "<span style='color: green;'>ON</span>";
|
|
||||||
} else {
|
|
||||||
content += "<span style='color: red;'>OFF</span>";
|
|
||||||
}
|
|
||||||
content += "</h4>";
|
|
||||||
|
|
||||||
if (contactor_control_enabled_double_battery) {
|
|
||||||
content += "<h4>Cont. Neg.: ";
|
|
||||||
if (pwm_contactor_control) {
|
|
||||||
if (datalayer.system.status.contactors_battery2_engaged) {
|
|
||||||
content += "<span style='color: green;'>Economized</span>";
|
|
||||||
content += " Cont. Pos.: ";
|
|
||||||
content += "<span style='color: green;'>Economized</span>";
|
|
||||||
} else {
|
|
||||||
content += "<span style='color: red;'>✕</span>";
|
|
||||||
content += " Cont. Pos.: ";
|
|
||||||
content += "<span style='color: red;'>✕</span>";
|
|
||||||
}
|
|
||||||
} else { // No PWM_CONTACTOR_CONTROL , we can read the pin and see feedback. Helpful if channel overloaded
|
|
||||||
#if defined(SECOND_POSITIVE_CONTACTOR_PIN) && defined(SECOND_NEGATIVE_CONTACTOR_PIN)
|
|
||||||
if (digitalRead(SECOND_NEGATIVE_CONTACTOR_PIN) == HIGH) {
|
|
||||||
content += "<span style='color: green;'>✓</span>";
|
|
||||||
} else {
|
|
||||||
content += "<span style='color: red;'>✕</span>";
|
|
||||||
}
|
|
||||||
|
|
||||||
content += " Cont. Pos.: ";
|
|
||||||
if (digitalRead(SECOND_POSITIVE_CONTACTOR_PIN) == HIGH) {
|
|
||||||
content += "<span style='color: green;'>✓</span>";
|
|
||||||
} else {
|
|
||||||
content += "<span style='color: red;'>✕</span>";
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
content += "</h4>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
content += "</div>";
|
content += "</div>";
|
||||||
content += "</div>";
|
content += "</div>";
|
||||||
}
|
}
|
||||||
|
@ -1320,25 +1279,20 @@ String processor(const String& var) {
|
||||||
}
|
}
|
||||||
content += "</h4></div>";
|
content += "</h4></div>";
|
||||||
if (contactor_control_enabled_double_battery) {
|
if (contactor_control_enabled_double_battery) {
|
||||||
|
content += "<h4>Secondary battery contactor, state: ";
|
||||||
if (pwm_contactor_control) {
|
if (pwm_contactor_control) {
|
||||||
content += "<h4>Cont. Neg.: ";
|
|
||||||
if (datalayer.system.status.contactors_battery2_engaged) {
|
if (datalayer.system.status.contactors_battery2_engaged) {
|
||||||
content += "<span style='color: green;'>Economized</span>";
|
content += "<span style='color: green;'>Economized</span>";
|
||||||
content += " Cont. Pos.: ";
|
|
||||||
content += "<span style='color: green;'>Economized</span>";
|
|
||||||
} else {
|
} else {
|
||||||
content += "<span style='color: red;'>✕</span>";
|
content += "<span style='color: red;'>OFF</span>";
|
||||||
content += " Cont. Pos.: ";
|
|
||||||
content += "<span style='color: red;'>✕</span>";
|
|
||||||
}
|
}
|
||||||
} else if (
|
} else if (
|
||||||
esp32hal->SECOND_BATTERY_CONTACTORS_PIN() !=
|
esp32hal->SECOND_BATTERY_CONTACTORS_PIN() !=
|
||||||
GPIO_NUM_NC) { // No PWM_CONTACTOR_CONTROL , we can read the pin and see feedback. Helpful if channel overloaded
|
GPIO_NUM_NC) { // No PWM_CONTACTOR_CONTROL , we can read the pin and see feedback. Helpful if channel overloaded
|
||||||
content += "<h4>Cont. Neg.: ";
|
|
||||||
if (digitalRead(esp32hal->SECOND_BATTERY_CONTACTORS_PIN()) == HIGH) {
|
if (digitalRead(esp32hal->SECOND_BATTERY_CONTACTORS_PIN()) == HIGH) {
|
||||||
content += "<span style='color: green;'>✓</span>";
|
content += "<span style='color: green;'>ON</span>";
|
||||||
} else {
|
} else {
|
||||||
content += "<span style='color: red;'>✕</span>";
|
content += "<span style='color: red;'>OFF</span>";
|
||||||
}
|
}
|
||||||
} //no PWM_CONTACTOR_CONTROL
|
} //no PWM_CONTACTOR_CONTROL
|
||||||
content += "</h4>";
|
content += "</h4>";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue