Ioniq bat.fan status + display 1 - autommode (speed>20kph,chargin>1kW graph, else main screen)

This commit is contained in:
Lubos Petrovic
2020-10-18 10:58:45 +02:00
parent c324bd8227
commit 26c78af293
3 changed files with 55 additions and 23 deletions

View File

@@ -118,6 +118,8 @@ bool parseRowMergedHyundaiIoniq() {
params.cumulativeEnergyDischargedKWh = float(strtol(responseRowMerged.substring(88, 96).c_str(), 0, 16)) / 10.0;
if (params.cumulativeEnergyDischargedKWhStart == -1)
params.cumulativeEnergyDischargedKWhStart = params.cumulativeEnergyDischargedKWh;
params.batFanStatus = hexToDec(responseRowMerged.substring(58, 60).c_str(), 2, true);
params.batFanFeedbackHz = hexToDec(responseRowMerged.substring(60, 62).c_str(), 2, true);
params.auxVoltage = hexToDec(responseRowMerged.substring(62, 64).c_str(), 2, true) / 10.0;
params.batPowerAmp = - hexToDec(responseRowMerged.substring(24, 28).c_str(), 2, true) / 10.0;
params.batVoltage = hexToDec(responseRowMerged.substring(28, 32).c_str(), 2, false) / 10.0;

View File

@@ -81,8 +81,8 @@ char tmpStr3[20];
char tmpStr4[20];
// Screens, buttons
#define displayScreenCount 5
byte displayScreen = 1; // 0 - blank screen, 1 - dash board (default), 2 - big speed + kwh/100, 3 - battery cells, 4 - charging graph, 5 - soc10% CED table
#define displayScreenCount 6
byte displayScreen = 1; // 0 - blank screen, 1 - automatic mode, 2 - dash board (default), 3 - big speed + kwh/100, 4 - battery cells, 5 - charging graph, 6 - soc10% CED table
bool btnLeftPressed = true;
bool btnMiddlePressed = true;
bool btnRightPressed = true;
@@ -271,6 +271,8 @@ bool initStructure() {
params.batTempC = -1;
params.batHeaterC = -1;
params.batInletC = -1;
params.batFanStatus = -1;
params.batFanFeedbackHz = -1;
params.batMinC = -1;
params.batMaxC = -1;
for (int i = 0; i < 12; i++) {
@@ -827,20 +829,36 @@ bool drawSceneChargingGraph(bool force) {
tft.setTextColor((params.batModuleTempC[3] >= 15) ? ((params.batModuleTempC[3] >= 25) ? TFT_GREEN : TFT_BLUE) : TFT_RED, TFT_TEMP);
tft.drawString(tmpStr1, zeroX + (10 * 10 * mulX), zeroY - (maxKw * mulY) + (posy * 15), 2);
posy++;
if (params.coolingWaterTempC != 0) {
if (params.coolingWaterTempC != -1) {
sprintf(tmpStr1, ((settings.temperatureUnit == 'c') ? "W:%01.00fC" : "W:%01.00fF"), celsius2temperature(params.coolingWaterTempC));
tft.setTextColor(TFT_CYAN, TFT_TEMP);
tft.drawString(tmpStr1, zeroX + (10 * 10 * mulX), zeroY - (maxKw * mulY) + (posy * 15), 2);
posy++;
}
if (params.batFanFeedbackHz != -1) {
sprintf(tmpStr1, "FF:%01.00fHz", params.batFanFeedbackHz);
tft.setTextColor(TFT_CYAN, TFT_TEMP);
tft.drawString(tmpStr1, zeroX + (10 * 10 * mulX), zeroY - (maxKw * mulY) + (posy * 15), 2);
posy++;
}
if (params.batFanStatus != -1) {
sprintf(tmpStr1, "FS:%01.00f", params.batFanStatus);
tft.setTextColor(TFT_CYAN, TFT_TEMP);
tft.drawString(tmpStr1, zeroX + (10 * 10 * mulX), zeroY - (maxKw * mulY) + (posy * 15), 2);
posy++;
}
if (params.coolantTemp1C != -1) {
sprintf(tmpStr1, ((settings.temperatureUnit == 'c') ? "C1:%01.00fC" : "C1:%01.00fF"), celsius2temperature(params.coolantTemp1C));
tft.setTextColor(TFT_CYAN, TFT_TEMP);
tft.drawString(tmpStr1, zeroX + (10 * 10 * mulX), zeroY - (maxKw * mulY) + (posy * 15), 2);
posy++;
}
if (params.coolantTemp2C != -1) {
sprintf(tmpStr1, ((settings.temperatureUnit == 'c') ? "C2:%01.00fC" : "C2:%01.00fF"), celsius2temperature(params.coolantTemp2C));
tft.setTextColor(TFT_CYAN, TFT_TEMP);
tft.drawString(tmpStr1, zeroX + (10 * 10 * mulX), zeroY - (maxKw * mulY) + (posy * 15), 2);
posy++;
}
return true;
}
@@ -1107,24 +1125,34 @@ bool redrawScreen(bool force) {
tft.fillScreen(TFT_BLACK);
}
// 1. Main screen
// 1. Auto mode = >20kpm Screen 3 - speed, other wise basic Screen2 - Main screen, if charging then Screen 5 Graph
if (displayScreen == 1) {
if (params.speedKmh > 20) {
drawSceneSpeed(force);
} else if (params.batPowerKw > 1) {
drawSceneChargingGraph(force);
} else {
drawSceneMain(force);
}
// 2. Big speed + kwh/100km
}
// 2. Main screen
if (displayScreen == 2) {
drawSceneMain(force);
}
// 3. Big speed + kwh/100km
if (displayScreen == 3) {
drawSceneSpeed(force);
}
// 3. Battery cells
if (displayScreen == 3) {
// 4. Battery cells
if (displayScreen == 4) {
drawSceneBatteryCells(force);
}
// 4. Charging graph
if (displayScreen == 4) {
// 5. Charging graph
if (displayScreen == 5) {
drawSceneChargingGraph(force);
}
// 5. SOC10% table (CEC-CED)
if (displayScreen == 5) {
// 6. SOC10% table (CEC-CED)
if (displayScreen == 6) {
drawSceneSoc10Table(force);
}

View File

@@ -37,6 +37,8 @@ typedef struct {
float batTempC;
float batHeaterC;
float batInletC;
float batFanStatus;
float batFanFeedbackHz;
float batMinC;
float batMaxC;
uint16_t batModuleTempCount;