Fix broken white page and add logo feature
This commit is contained in:
parent
b9356c9ae8
commit
464d6879a3
|
@ -2,15 +2,34 @@
|
|||
|
||||
#include "Pagedata.h"
|
||||
#include "OBP60Extensions.h"
|
||||
#include "MFD_OBP60_400x300_sw.h" // MFD with logo
|
||||
#include "Logo_OBP_400x300_sw.h" // OBP Logo
|
||||
|
||||
class PageWhite : public Page
|
||||
{
|
||||
public:
|
||||
char mode = 'W'; // display mode (W)hite | (L)ogo | (M)FD logo
|
||||
|
||||
public:
|
||||
PageWhite(CommonData &common){
|
||||
commonData = &common;
|
||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageWhite");
|
||||
}
|
||||
|
||||
virtual int handleKey(int key) {
|
||||
// Change display mode
|
||||
if (key == 1) {
|
||||
if (mode == 'W') {
|
||||
mode = 'L';
|
||||
} else if (mode == 'L') {
|
||||
mode = 'M';
|
||||
} else {
|
||||
mode = 'W';
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
virtual void displayPage(PageData &pageData){
|
||||
GwConfigHandler *config = commonData->config;
|
||||
GwLog *logger = commonData->logger;
|
||||
|
@ -36,6 +55,12 @@ class PageWhite : public Page
|
|||
// Set display in partial refresh mode
|
||||
getdisplay().setPartialWindow(0, 0, getdisplay().width(), getdisplay().height()); // Set partial update
|
||||
|
||||
if (mode == 'L') {
|
||||
getdisplay().drawBitmap(0, 0, gImage_Logo_OBP_400x300_sw, getdisplay().width(), getdisplay().height(), commonData->fgcolor);
|
||||
} else if (mode == 'M') {
|
||||
getdisplay().drawBitmap(0, 0, gImage_MFD_OBP60_400x300_sw, getdisplay().width(), getdisplay().height(), commonData->fgcolor);
|
||||
}
|
||||
|
||||
// Update display
|
||||
getdisplay().nextPage(); // Partial update (fast)
|
||||
|
||||
|
|
|
@ -938,7 +938,7 @@
|
|||
"ThreeValues",
|
||||
"TwoValues",
|
||||
"Voltage",
|
||||
"White",
|
||||
"WhitePage",
|
||||
"Wind",
|
||||
"WindRose",
|
||||
"WindRoseFlex",
|
||||
|
@ -1198,7 +1198,7 @@
|
|||
"ThreeValues",
|
||||
"TwoValues",
|
||||
"Voltage",
|
||||
"White",
|
||||
"WhitePage",
|
||||
"Wind",
|
||||
"WindRose",
|
||||
"WindRoseFlex",
|
||||
|
@ -1456,7 +1456,7 @@
|
|||
"ThreeValues",
|
||||
"TwoValues",
|
||||
"Voltage",
|
||||
"White",
|
||||
"WhitePage",
|
||||
"Wind",
|
||||
"WindRose",
|
||||
"WindRoseFlex",
|
||||
|
@ -1710,7 +1710,7 @@
|
|||
"ThreeValues",
|
||||
"TwoValues",
|
||||
"Voltage",
|
||||
"White",
|
||||
"WhitePage",
|
||||
"Wind",
|
||||
"WindRose",
|
||||
"WindRoseFlex",
|
||||
|
@ -1961,7 +1961,7 @@
|
|||
"ThreeValues",
|
||||
"TwoValues",
|
||||
"Voltage",
|
||||
"White",
|
||||
"WhitePage",
|
||||
"Wind",
|
||||
"WindRose",
|
||||
"WindRoseFlex",
|
||||
|
@ -2209,7 +2209,7 @@
|
|||
"ThreeValues",
|
||||
"TwoValues",
|
||||
"Voltage",
|
||||
"White",
|
||||
"WhitePage",
|
||||
"Wind",
|
||||
"WindRose",
|
||||
"WindRoseFlex",
|
||||
|
@ -2454,7 +2454,7 @@
|
|||
"ThreeValues",
|
||||
"TwoValues",
|
||||
"Voltage",
|
||||
"White",
|
||||
"WhitePage",
|
||||
"Wind",
|
||||
"WindRose",
|
||||
"WindRoseFlex",
|
||||
|
@ -2696,7 +2696,7 @@
|
|||
"ThreeValues",
|
||||
"TwoValues",
|
||||
"Voltage",
|
||||
"White",
|
||||
"WhitePage",
|
||||
"Wind",
|
||||
"WindRose",
|
||||
"WindRoseFlex",
|
||||
|
@ -2935,7 +2935,7 @@
|
|||
"ThreeValues",
|
||||
"TwoValues",
|
||||
"Voltage",
|
||||
"White",
|
||||
"WhitePage",
|
||||
"Wind",
|
||||
"WindRose",
|
||||
"WindRoseFlex",
|
||||
|
@ -3171,7 +3171,7 @@
|
|||
"ThreeValues",
|
||||
"TwoValues",
|
||||
"Voltage",
|
||||
"White",
|
||||
"WhitePage",
|
||||
"Wind",
|
||||
"WindRose",
|
||||
"WindRoseFlex",
|
||||
|
|
|
@ -953,7 +953,7 @@
|
|||
"ThreeValues",
|
||||
"TwoValues",
|
||||
"Voltage",
|
||||
"White",
|
||||
"WhitePage",
|
||||
"Wind",
|
||||
"WindRose",
|
||||
"WindRoseFlex",
|
||||
|
@ -1213,7 +1213,7 @@
|
|||
"ThreeValues",
|
||||
"TwoValues",
|
||||
"Voltage",
|
||||
"White",
|
||||
"WhitePage",
|
||||
"Wind",
|
||||
"WindRose",
|
||||
"WindRoseFlex",
|
||||
|
@ -1471,7 +1471,7 @@
|
|||
"ThreeValues",
|
||||
"TwoValues",
|
||||
"Voltage",
|
||||
"White",
|
||||
"WhitePage",
|
||||
"Wind",
|
||||
"WindRose",
|
||||
"WindRoseFlex",
|
||||
|
@ -1725,7 +1725,7 @@
|
|||
"ThreeValues",
|
||||
"TwoValues",
|
||||
"Voltage",
|
||||
"White",
|
||||
"WhitePage",
|
||||
"Wind",
|
||||
"WindRose",
|
||||
"WindRoseFlex",
|
||||
|
@ -1976,7 +1976,7 @@
|
|||
"ThreeValues",
|
||||
"TwoValues",
|
||||
"Voltage",
|
||||
"White",
|
||||
"WhitePage",
|
||||
"Wind",
|
||||
"WindRose",
|
||||
"WindRoseFlex",
|
||||
|
@ -2224,7 +2224,7 @@
|
|||
"ThreeValues",
|
||||
"TwoValues",
|
||||
"Voltage",
|
||||
"White",
|
||||
"WhitePage",
|
||||
"Wind",
|
||||
"WindRose",
|
||||
"WindRoseFlex",
|
||||
|
@ -2469,7 +2469,7 @@
|
|||
"ThreeValues",
|
||||
"TwoValues",
|
||||
"Voltage",
|
||||
"White",
|
||||
"WhitePage",
|
||||
"Wind",
|
||||
"WindRose",
|
||||
"WindRoseFlex",
|
||||
|
@ -2711,7 +2711,7 @@
|
|||
"ThreeValues",
|
||||
"TwoValues",
|
||||
"Voltage",
|
||||
"White",
|
||||
"WhitePage",
|
||||
"Wind",
|
||||
"WindRose",
|
||||
"WindRoseFlex",
|
||||
|
@ -2950,7 +2950,7 @@
|
|||
"ThreeValues",
|
||||
"TwoValues",
|
||||
"Voltage",
|
||||
"White",
|
||||
"WhitePage",
|
||||
"Wind",
|
||||
"WindRose",
|
||||
"WindRoseFlex",
|
||||
|
@ -3186,7 +3186,7 @@
|
|||
"ThreeValues",
|
||||
"TwoValues",
|
||||
"Voltage",
|
||||
"White",
|
||||
"WhitePage",
|
||||
"Wind",
|
||||
"WindRose",
|
||||
"WindRoseFlex",
|
||||
|
|
|
@ -28,7 +28,7 @@ no_of_fields_per_page = {
|
|||
"ThreeValues": 3,
|
||||
"TwoValues": 2,
|
||||
"Voltage": 0,
|
||||
"White": 0,
|
||||
"WhitePage": 0,
|
||||
"WindRose": 0,
|
||||
"WindRoseFlex": 6,
|
||||
# "SixValues" : 6,
|
||||
|
@ -127,4 +127,4 @@ json_output = json.dumps(output, indent=4)
|
|||
#print(json_output[1:-1])
|
||||
# print omitting first line containing [ of JSON array
|
||||
print(json_output[1:])
|
||||
# print(",")
|
||||
# print(",")
|
||||
|
|
Loading…
Reference in New Issue