Bugfix units and display function
This commit is contained in:
parent
d3e7aae21a
commit
1d1f8ef0db
|
@ -118,10 +118,18 @@ void displayHeader(CommonData &commonData, GwApi::BoatValue *hdop, GwApi::BoatVa
|
|||
static unsigned long tcpClTxOld = 0;
|
||||
static unsigned long n2kRxOld = 0;
|
||||
static unsigned long n2kTxOld = 0;
|
||||
int textcolor = GxEPD_BLACK;
|
||||
|
||||
if(commonData.config->getString(commonData.config->displaycolor) == "Normal"){
|
||||
textcolor = GxEPD_BLACK;
|
||||
}
|
||||
else{
|
||||
textcolor = GxEPD_WHITE;
|
||||
}
|
||||
|
||||
// Show status info
|
||||
display.setTextColor(textcolor);
|
||||
display.setFont(&Ubuntu_Bold8pt7b);
|
||||
display.setTextColor(GxEPD_BLACK);
|
||||
display.setCursor(0, 15);
|
||||
if(commonData.status.wifiApOn){
|
||||
display.print(" AP ");
|
||||
|
@ -155,6 +163,7 @@ void displayHeader(CommonData &commonData, GwApi::BoatValue *hdop, GwApi::BoatVa
|
|||
usbTxOld = commonData.status.usbTx;
|
||||
|
||||
// Heartbeat as dot
|
||||
display.setTextColor(textcolor);
|
||||
display.setFont(&Ubuntu_Bold32pt7b);
|
||||
display.setCursor(205, 14);
|
||||
if(heartbeat == true){
|
||||
|
@ -166,6 +175,7 @@ void displayHeader(CommonData &commonData, GwApi::BoatValue *hdop, GwApi::BoatVa
|
|||
heartbeat = !heartbeat;
|
||||
|
||||
// Date and time
|
||||
display.setTextColor(textcolor);
|
||||
display.setFont(&Ubuntu_Bold8pt7b);
|
||||
display.setCursor(230, 15);
|
||||
if(hdop->valid == true && hdop->value <= 50){
|
||||
|
|
|
@ -126,11 +126,11 @@ FormatedData formatValue(GwApi::BoatValue *value, CommonData &commondata){
|
|||
else{
|
||||
speed = 4.0 + float(random(0, 40));
|
||||
}
|
||||
if(String(speedFormat) == "km/h" || String(windspeedFormat) == "km/h"){
|
||||
if((String(speedFormat) == "km/h" || String(windspeedFormat) == "km/h") && String(windspeedFormat) != "bft"){
|
||||
speed = speed * 3.6; // Unit conversion form m/s to km/h
|
||||
result.unit = "m/s";
|
||||
}
|
||||
else if(String(speedFormat) == "kn" || String(windspeedFormat) == "kn"){
|
||||
else if((String(speedFormat) == "kn" || String(windspeedFormat) == "kn") && String(windspeedFormat) != "bft"){
|
||||
speed = speed * 1.94384; // Unit conversion form m/s to kn
|
||||
result.unit = "kn";
|
||||
}
|
||||
|
|
|
@ -105,6 +105,7 @@ public:
|
|||
// Clear display by call in obp60task.cpp in main loop
|
||||
|
||||
// Show values AWS
|
||||
display.setTextColor(textcolor);
|
||||
display.setFont(&Ubuntu_Bold20pt7b);
|
||||
display.setCursor(20, 50);
|
||||
if(holdvalues == false){
|
||||
|
@ -123,6 +124,7 @@ public:
|
|||
}
|
||||
|
||||
// Show values AWD
|
||||
display.setTextColor(textcolor);
|
||||
display.setFont(&Ubuntu_Bold20pt7b);
|
||||
display.setCursor(20, 260);
|
||||
if(holdvalues == false){
|
||||
|
@ -162,6 +164,7 @@ public:
|
|||
display.drawLine(x1, y1, x2, y2, pixelcolor);
|
||||
|
||||
// Key Layout
|
||||
display.setTextColor(textcolor);
|
||||
display.setFont(&Ubuntu_Bold8pt7b);
|
||||
display.setCursor(115, 290);
|
||||
if(keylock == false){
|
||||
|
|
|
@ -71,11 +71,13 @@ class PageOneValue : public Page{
|
|||
// Clear display by call in obp60task.cpp in main loop
|
||||
|
||||
// Show name
|
||||
display.setTextColor(textcolor);
|
||||
display.setFont(&Ubuntu_Bold32pt7b);
|
||||
display.setCursor(20, 100);
|
||||
display.print(name1); // Page name
|
||||
|
||||
// Show unit
|
||||
display.setTextColor(textcolor);
|
||||
display.setFont(&Ubuntu_Bold20pt7b);
|
||||
display.setCursor(270, 100);
|
||||
if(holdvalues == false){
|
||||
|
@ -112,6 +114,7 @@ class PageOneValue : public Page{
|
|||
}
|
||||
|
||||
// Key Layout
|
||||
display.setTextColor(textcolor);
|
||||
display.setFont(&Ubuntu_Bold8pt7b);
|
||||
display.setCursor(115, 290);
|
||||
if(keylock == false){
|
||||
|
|
|
@ -72,16 +72,19 @@ public:
|
|||
//Clear display in obp60task.cpp in main loop
|
||||
|
||||
// Show name
|
||||
display.setTextColor(textcolor);
|
||||
display.setFont(&Ubuntu_Bold32pt7b);
|
||||
display.setCursor(20, 100);
|
||||
display.print(name1); // Page name
|
||||
|
||||
// Show unit
|
||||
display.setTextColor(textcolor);
|
||||
display.setFont(&Ubuntu_Bold20pt7b);
|
||||
display.setCursor(270, 100);
|
||||
display.print("V");
|
||||
|
||||
// Reading bus data or using simulation data
|
||||
display.setTextColor(textcolor);
|
||||
display.setFont(&DSEG7Classic_BoldItalic60pt7b);
|
||||
display.setCursor(20, 240);
|
||||
if(simulation == true){
|
||||
|
@ -114,18 +117,19 @@ public:
|
|||
}
|
||||
|
||||
// Key Layout
|
||||
display.setTextColor(textcolor);
|
||||
display.setFont(&Ubuntu_Bold8pt7b);
|
||||
display.setCursor(115, 290);
|
||||
if(keylock == false){
|
||||
display.print(" [ <<<<<< >>>>>> ]");
|
||||
if(String(backlightMode) == "Control by Key"){ // Key for illumination
|
||||
display.setCursor(343, 290);
|
||||
display.print("[ILUM]");
|
||||
}
|
||||
}
|
||||
else{
|
||||
display.print(" [ Keylock active ]");
|
||||
}
|
||||
if(String(backlightMode) == "Control by Key"){ // Key for illumination
|
||||
display.setCursor(343, 290);
|
||||
display.print("[ILUM]");
|
||||
}
|
||||
|
||||
// Update display
|
||||
display.updateWindow(0, 0, GxEPD_WIDTH, GxEPD_HEIGHT, true); // Partial update (fast)
|
||||
|
|
Loading…
Reference in New Issue