- Introdotta l'implementazione JavaScript per la comunicazione BMS in bmscore.js, inclusi i metodi per il recupero dati e la gestione degli errori. - Creato errors.js per mappare i codici di errore dal formato Python a quello JavaScript.
67 lines
2.5 KiB
Python
67 lines
2.5 KiB
Python
"""
|
|
The error messages are taken from the "Part 4_ Daly RS485+UART Protocol.pdf",
|
|
so the translation quality isn't that great yet.
|
|
"""
|
|
|
|
ERROR_CODES = {
|
|
0: [
|
|
"one stage warning of unit over voltage",
|
|
"one stage warning of unit over voltage",
|
|
"one stage warning of unit over voltage",
|
|
"two stage warning of unit over voltage",
|
|
"Total voltage is too high One alarm",
|
|
"Total voltage is too high Level two alarm",
|
|
"Total voltage is too low One alarm",
|
|
"Total voltage is too low Level two alarm"
|
|
],
|
|
1: ["Charging temperature too high. One alarm",
|
|
"Charging temperature too high. Level two alarm",
|
|
"Charging temperature too low. One alarm",
|
|
"Charging temperature's too low. Level two alarm",
|
|
"Discharge temperature is too high. One alarm",
|
|
"Discharge temperature is too high. Level two alarm",
|
|
"Discharge temperature is too low. One alarm",
|
|
"Discharge temperature is too low. Level two alarm",
|
|
],
|
|
2: ["Charge over current. Level one alarm",
|
|
"Charge over current, level two alarm",
|
|
"Discharge over current. Level one alarm",
|
|
"Discharge overcurrent, level two alarm",
|
|
"SOC is too high an alarm",
|
|
"SOC is too high. Alarm Two",
|
|
"SOC is too low. level one alarm",
|
|
"SOC is too low. level two alarm",
|
|
],
|
|
3: ["Excessive differential pressure level one alarm",
|
|
"Excessive differential pressure level two alarm",
|
|
"Excessive temperature difference level one alarm",
|
|
"Excessive temperature difference level two alarm",
|
|
],
|
|
4: ["charging MOS overtemperature warning",
|
|
"discharge MOS overtemperature warning",
|
|
"charging MOS temperature detection sensor failure",
|
|
"discharge MOS temperature detection sensor failure",
|
|
"charging MOS adhesion failure",
|
|
"discharge MOS adhesion failure",
|
|
"charging MOS breaker failure",
|
|
"discharge MOS breaker failure",
|
|
],
|
|
5: ["AFE acquisition chip malfunction",
|
|
"monomer collect drop off",
|
|
"Single Temperature Sensor Fault",
|
|
"EEPROM storage failures",
|
|
"RTC clock malfunction",
|
|
"Precharge Failure",
|
|
"vehicle communications malfunction",
|
|
"intranet communication module malfunction",
|
|
],
|
|
6: ["Current Module Failure",
|
|
"main pressure detection module",
|
|
"Short circuit protection failure",
|
|
"Low Voltage No Charging",
|
|
"RESERVED",
|
|
"RESERVED",
|
|
"RESERVED",
|
|
"RESERVED",
|
|
],
|
|
} |