Skip to content

Commit

Permalink
commit to banana
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno3634-gif committed Aug 31, 2024
1 parent eaac1c7 commit 407e52f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
24 changes: 20 additions & 4 deletions src/store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,11 @@ void store::parseBson(std::vector<std::uint8_t> v){


case 1:
QMainWindow* temp_ref;
QMainWindow* temp_ref;
if(ref_windows[1] == nullptr){
VoidsterdebugWindow temp;
temp_ref = &temp;
ref_windows[1] = temp_ref;
temp_ref = &temp;
ref_windows[1] = temp_ref;
}else{
temp_ref = ref_windows[1];
}
Expand All @@ -394,13 +394,21 @@ void store::parseBson(std::vector<std::uint8_t> v){
EncodingUnion t;
t.encoded=j[BSON_SOC];
this->setSoc(t.decoded);
if(t.decoded<= HV_SOC_WARNING && error_map.find("SOC warning") != error_map.end()){
error_map["SOC warning"] = t.decoded;
scribeError("SOC warning",WARNING);
}
else{
if(error_map.find("SOC warning") == error_map.end()){
error_map.erase("SOC warning");
}
}
if(j.contains(BSON_LV_SOC)){
EncodingUnion t;
t.encoded=j[BSON_LV_SOC];
this->setLV_Soc(t.decoded);
if(t.decoded<= LV_SOC_WARNING && error_map.find("Low voltage SOC warning") != error_map.end()){
error_map["Low voltage SOC warning"] = j[BSON_MOTORTEMPERATURE];
error_map["Low voltage SOC warning"] = t.decoded;
scribeError("Low voltage SOC warning",WARNING);
}
else{
Expand Down Expand Up @@ -456,6 +464,14 @@ void store::parseBson(std::vector<std::uint8_t> v){
if(j.contains(BSON_INVERTERTEMPERATURE)){
int temp = j[BSON_INVERTERTEMPERATURE];
this->setInverterTemperature(temp);
if(t.decoded<= INVERTER_TEMPERATURE_WARNING && error_map.find("Inverter temperature warning") != error_map.end()){
error_map["Inverter temperature warning"] = t.decoded;
scribeError("Inverter temperature warning",WARNING);
}
else{
if(error_map.find("Inverter temperature warning") == error_map.end()){
error_map.erase("Inverter temperature warning");
}
}
if(j.contains(BSON_POWER)){
short temp = j[BSON_POWER];
Expand Down
1 change: 1 addition & 0 deletions src/store.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ class store: public QObject{
#endif
#ifdef __LART_T24__
#define MOTOR_TEMPERATURE_WARNING 75
#define INVERTER_TEMPERATURE_WARNING 50
#define LV_SOC_WARNING 30
#define HV_SOC_WARNING 30

Expand Down

0 comments on commit 407e52f

Please sign in to comment.