Skip to content

Commit

Permalink
Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
norbert-walter committed Apr 26, 2024
1 parent 1b6625d commit 972d7f3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
1 change: 0 additions & 1 deletion lib/obp60task/PageBattery2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ double raw = 0;
}

// Logging voltage value
if (raw == NULL) return;
LOG_DEBUG(GwLog::LOG,"Drawing at PageBattery2, Type:%s %s:=%f", batType, name1, raw);

// Draw page
Expand Down
24 changes: 17 additions & 7 deletions lib/obp60task/PageSolar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,31 @@ double raw = 0;
int solPower = config->getInt(config->solarPower);
String batType = config->getString(config->batteryType);
String backlightMode = config->getString(config->backlight);
String powerSensor = config->getString(config->usePowSensor1);
String powerSensor = config->getString(config->usePowSensor2);

double value1 = 0; // Solar voltage
double value2 = 0; // Solar current
double value3 = 0; // Solar output power
double valueTrend = 0; // Average over 10 values
double solPercentage = 0; // Solar load
int solPercentage = 0; // Solar load

// Get voltage value
String name1 = "VSol";

// Get raw value for trend indicator
value1 = commonData.data.solarVoltage; // Live data
if(powerSensor != "off"){
value1 = commonData.data.solarVoltage; // Use voltage from external sensor
}
else{
value1 = commonData.data.batteryVoltage; // Use internal voltage sensor
}
value2 = commonData.data.solarCurrent;
value3 = commonData.data.solarPower;
solPercentage = value3 * 100 / (double)solPower; // Load value
solPercentage = value3 * 100 / (double)solPower; // Load value
// Limits for battery level
if(solPercentage < 0) solPercentage = 0;
if(solPercentage > 99) solPercentage = 99;

bool valid1 = true;

// Optical warning by limit violation
Expand Down Expand Up @@ -134,7 +143,7 @@ double raw = 0;
if(solPower <= 999) getdisplay().print(solPower, 0);
if(solPower > 999) getdisplay().print(float(solPower/1000.0), 1);
getdisplay().setFont(&Ubuntu_Bold16pt7b);
if(solPower <= 999) getdisplay().print("w");
if(solPower <= 999) getdisplay().print("W");
if(solPower > 999) getdisplay().print("kW");

// Show info
Expand All @@ -154,6 +163,9 @@ double raw = 0;
getdisplay().print(solPercentage);
getdisplay().setFont(&Ubuntu_Bold16pt7b);
getdisplay().print("%");
getdisplay().setFont(&Ubuntu_Bold8pt7b);
getdisplay().setCursor(150, 235);
getdisplay().print("Load");

// Show sensor type info
String i2cAddr = "";
Expand Down Expand Up @@ -231,8 +243,6 @@ double raw = 0;
getdisplay().setTextColor(textcolor);
getdisplay().setFont(&Ubuntu_Bold8pt7b);
if(keylock == false){
getdisplay().setCursor(10, 290);
getdisplay().print("[AVG]");
getdisplay().setCursor(130, 290);
getdisplay().print("[ <<<< " + String(commonData.data.actpage) + "/" + String(commonData.data.maxpage) + " >>>> ]");
if(String(backlightMode) == "Control by Key"){ // Key for illumination
Expand Down

0 comments on commit 972d7f3

Please sign in to comment.