Skip to content

Commit

Permalink
motor temp warning
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno3634-gif committed Aug 30, 2024
1 parent 550a10f commit 5291a58
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ int main(int argc, char *argv[]){
m.show();
//QMessageBox::information(nullptr, "ERRO", "bateria baixa !!!");

msgBox->close();
msgBox->hide();

// VoidsterdebugWindow debugWindow;
// debugWindow.show();
Expand Down
15 changes: 14 additions & 1 deletion src/store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ qint64 store::scribeError(QString error, error_severity severity){
}catch(...){
//TODO handle exception graphically
qDebug() << "An exception occurred while trying to write to the error log";
QMessageBox *msgBox = new QMessageBox(QMessageBox::Warning, "Warning", error, QMessageBox::NoButton);
msgBox->setStandardButtons(QMessageBox::NoButton);
}

return ret;
Expand Down Expand Up @@ -411,10 +413,21 @@ void store::parseBson(std::vector<std::uint8_t> v){
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];
scribeError("Low voltage SOC warning",WARNING);
}
else{
if(error_map.find("Low voltage SOC warning") == error_map.end()){
error_map.erase("Low voltage SOC warning");
}



}
if(j.contains(BSON_MOTORTEMPERATURE)){
this->setmotorTemperature(j[BSON_MOTORTEMPERATURE]);
if(j[BSON_MOTORTEMPERATURE]>= 75 && error_map.find("Motor temperature warning") != error_map.end()){
if(j[BSON_MOTORTEMPERATURE]>= MOTOR_TEMPERATURE_WARNING && error_map.find("Motor temperature warning") != error_map.end()){
error_map["Motor temperature warning"] = j[BSON_MOTORTEMPERATURE];
scribeError("Motor temperature warning",WARNING);
}
Expand Down
4 changes: 4 additions & 0 deletions src/store.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ class store: public QObject{

#endif
#ifdef __LART_T24__
#define MOTOR_TEMPERATURE_WARNING 75
#define LV_SOC_WARNING 30
#define HV_SOC_WARNING 30

float getSoc() const;
float getLV_Soc() const;
float getPowerLimit() const;
Expand Down

0 comments on commit 5291a58

Please sign in to comment.