Skip to content

Commit

Permalink
Merge pull request #3 from powelllens/FollowEVCCRename
Browse files Browse the repository at this point in the history
Bugfix - SoC Values not updated since EVCC v0.110
  • Loading branch information
powelllens authored Jan 21, 2023
2 parents 227c89a + a9e7c8f commit eee4e4e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
20 changes: 10 additions & 10 deletions src/MonitorTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,24 +335,24 @@ void MonitorTask::MainScreen()
paint.Clear(UNCOLORED);

paint.DrawRectangle(50, 5, 360, 41, COLORED);
// Rectangle for Loadingstatus and targetSoc (in black if vehicleCapacity >= vehicleSoC )
if (this->evccapidataptr->globalapidata.loadPointData[0].vehicleSoC >= this->evccapidataptr->globalapidata.loadPointData[0].minSoC)
// Rectangle for Loadingstatus and targetSoc (in black if vehicleCapacity >= vehicleSoc )
if (this->evccapidataptr->globalapidata.loadPointData[0].vehicleSoc >= this->evccapidataptr->globalapidata.loadPointData[0].minSoc)
{
paint.DrawFilledRectangle(52, 7, percentToXposition(this->evccapidataptr->globalapidata.loadPointData[0].vehicleSoC), 39, COLORED);
paint.DrawFilledRectangle(52, 7, percentToXposition(this->evccapidataptr->globalapidata.loadPointData[0].vehicleSoc), 39, COLORED);
}
int positionX = percentToXposition(this->evccapidataptr->globalapidata.loadPointData[0].targetSoC);
int positionX = percentToXposition(this->evccapidataptr->globalapidata.loadPointData[0].targetSoc);
paint.DrawFilledRectangle(positionX - 4, 0, positionX + 4, 48, COLORED);
this->epd.SetPartialWindowBlack(paint.GetImage(), 0, 163, 400, 50);

// Ladestand
this->DrawStringToDisplay(&paint, 12, 215, txtvehicleCapacity, &Font16, COLORED, BLACK);
sprintf(buffer_char, "%d %s", this->evccapidataptr->globalapidata.loadPointData[0].vehicleSoC, "%");
sprintf(buffer_char, "%d %s", this->evccapidataptr->globalapidata.loadPointData[0].vehicleSoc, "%");
this->DrawStringToDisplay(&paint, 12, 230, buffer_char, &Font16, COLORED, BLACK);
sprintf(buffer_char, "%d %s", this->evccapidataptr->globalapidata.loadPointData[0].vehicleRange, "km");
this->DrawStringToDisplay(&paint, 12, 245, buffer_char, &Font16, COLORED, BLACK);
// Ladeziel
this->DrawStringToDisplay(&paint, 310, 215, txttargetSoC, &Font16, COLORED, BLACK);
sprintf(buffer_char, "%d %s", this->evccapidataptr->globalapidata.loadPointData[0].targetSoC, "%");
this->DrawStringToDisplay(&paint, 310, 215, txttargetSoc, &Font16, COLORED, BLACK);
sprintf(buffer_char, "%d %s", this->evccapidataptr->globalapidata.loadPointData[0].targetSoc, "%");
this->DrawStringToDisplay(&paint, 310, 230, buffer_char, &Font16, COLORED, BLACK);

// Modus
Expand Down Expand Up @@ -384,13 +384,13 @@ void MonitorTask::MainScreen()
this->DrawImageToDisplay(&paint, 12, 165, &Image_Strike, BLACK);
}

// Ladestand - in red due to vehicleCapacity < vehicleSoC
if (this->evccapidataptr->globalapidata.loadPointData[0].vehicleSoC < this->evccapidataptr->globalapidata.loadPointData[0].minSoC)
// Ladestand - in red due to vehicleCapacity < vehicleSoc
if (this->evccapidataptr->globalapidata.loadPointData[0].vehicleSoc < this->evccapidataptr->globalapidata.loadPointData[0].minSoc)
{
paint.SetWidth(400);
paint.SetHeight(50);
paint.Clear(UNCOLORED);
paint.DrawFilledRectangle(52, 7, percentToXposition(this->evccapidataptr->globalapidata.loadPointData[0].vehicleSoC), 39, COLORED);
paint.DrawFilledRectangle(52, 7, percentToXposition(this->evccapidataptr->globalapidata.loadPointData[0].vehicleSoc), 39, COLORED);
this->epd.SetPartialWindowBlack(paint.GetImage(), 0, 163, 400, 50);
}

Expand Down
2 changes: 1 addition & 1 deletion src/MonitorTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const char txtchargedEnergy[] = "GELADEN";
const char txtchargeRemainingDuration[] = "RESTZEIT";
const char txtchargechargeDuration[] = "DAUER";
const char txtvehicleCapacity[] = "LADESTAND";
const char txttargetSoC[] = "LADEZIEL";
const char txttargetSoc[] = "LADEZIEL";
const char txtmode[] = "Modus";
const char txtmodeoff[] = "Aus";
const char txtmodepv[] = "PV";
Expand Down
10 changes: 5 additions & 5 deletions src/RestTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ void RestTask::updateData()
bool boolbuffer;

loadpointdata.activePhases = result_loadpoints_0["activePhases"];
intbuffer = loadpointdata.targetSoC;
loadpointdata.targetSoC = result_loadpoints_0["targetSoC"];
tmp_updateavaliable = (tmp_updateavaliable) || (intbuffer != loadpointdata.targetSoC);
loadpointdata.vehicleSoC = result_loadpoints_0["vehicleSoC"];
loadpointdata.minSoC = result_loadpoints_0["minSoC"];
intbuffer = loadpointdata.targetSoc;
loadpointdata.targetSoc = result_loadpoints_0["targetSoc"];
tmp_updateavaliable = (tmp_updateavaliable) || (intbuffer != loadpointdata.targetSoc);
loadpointdata.vehicleSoc = result_loadpoints_0["vehicleSoc"];
loadpointdata.minSoc = result_loadpoints_0["minSoc"];
loadpointdata.vehicleRange = result_loadpoints_0["vehicleRange"];
loadpointdata.chargePower = result_loadpoints_0["chargePower"];
loadpointdata.chargedEnergy = result_loadpoints_0["chargedEnergy"];
Expand Down
6 changes: 3 additions & 3 deletions src/evccDataClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ struct AvgData
struct LoadpointData
{
int activePhases; // 1P|3P
int targetSoC; // %
int minSoC; //%
int vehicleSoC; // %
int targetSoc; // %
int minSoc; //%
int vehicleSoc; // %
int vehicleRange; // km
int chargePower; // Watts
double chargedEnergy; // Watts
Expand Down

0 comments on commit eee4e4e

Please sign in to comment.