Add files via upload

This commit is contained in:
ManfredRad 2025-05-06 07:49:53 +02:00 committed by GitHub
parent 293b362ee4
commit 57684f77db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 1600 additions and 33 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,176 @@
#if defined BOARD_OBP60S3
#include "Pagedata.h"
#include "OBP60Extensions.h"
#include "DSEG7Classic-BoldItalic26pt7b.h"
extern const GFXfont DSEG7Classic_BoldItalic30pt7b;
const int SixValues_x1 = 5;
const int SixValues_DeltaX = 200;
const int SixValues_y1 = 23;
const int SixValues_DeltaY = 83;
const int HowManyValues = 6;
class PageSixValues : public Page
{
public:
PageSixValues(CommonData &common){
commonData = &common;
common.logger->logDebug(GwLog::LOG,"Instantiate PageSixValues");
}
virtual int handleKey(int key){
// Code for keylock
if(key == 11){
commonData->keylock = !commonData->keylock;
return 0; // Commit the key
}
return key;
}
virtual void displayPage(PageData &pageData){
GwConfigHandler *config = commonData->config;
GwLog *logger = commonData->logger;
// Old values for hold function
static String OldDataText[HowManyValues] = {"", "", "", "", "", ""};
static String OldDataUnits[HowManyValues] = {"", "", "", "", "", ""};
// Get config data
String lengthformat = config->getString(config->lengthFormat);
// bool simulation = config->getBool(config->useSimuData);
bool holdvalues = config->getBool(config->holdvalues);
String flashLED = config->getString(config->flashLED);
String backlightMode = config->getString(config->backlight);
GwApi::BoatValue *bvalue;
String DataName[HowManyValues];
double DataValue[HowManyValues];
bool DataValid[HowManyValues];
String DataText[HowManyValues];
String DataUnits[HowManyValues];
String DataFormat[HowManyValues];
for (int i = 0; i < HowManyValues; i++){
bvalue = pageData.values[i];
DataName[i] = xdrDelete(bvalue->getName());
DataName[i] = DataName[i].substring(0, 6); // String length limit for value name
DataValue[i] = bvalue->value; // Value as double in SI unit
DataValid[i] = bvalue->valid;
DataText[i] = formatValue(bvalue, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
DataUnits[i] = formatValue(bvalue, *commonData).unit;
DataFormat[i] = bvalue->getFormat(); // Unit of value
}
// Optical warning by limit violation (unused)
if(String(flashLED) == "Limit Violation"){
setBlinkingLED(false);
setFlashLED(false);
}
if (bvalue == NULL) return;
// Draw page
//***********************************************************
// Set display in partial refresh mode
getdisplay().setPartialWindow(0, 0, getdisplay().width(), getdisplay().height()); // Set partial update
getdisplay().setTextColor(commonData->fgcolor);
for (int i = 0; i < ( HowManyValues / 2 ); i++){
// Horizontal line 3 pix
getdisplay().fillRect(0, SixValues_y1+i*SixValues_DeltaY, 400, 3, commonData->fgcolor);
for (int j = 0; j < 2; j++){
int ValueIndex = i * 2 + j;
int x0 = SixValues_x1 + j * SixValues_DeltaX;
int y0 = SixValues_y1 + i * SixValues_DeltaY;
LOG_DEBUG(GwLog::LOG,"Drawing at PageSixValue: %d %s %f %s", ValueIndex, DataName[ValueIndex], DataValue[ValueIndex], DataFormat[ValueIndex] );
// Show name
getdisplay().setFont(&Ubuntu_Bold12pt7b);
getdisplay().setCursor(x0, y0+25);
getdisplay().print(DataName[ValueIndex]); // Page name
// Show unit
getdisplay().setFont(&Ubuntu_Bold8pt7b);
getdisplay().setCursor(x0, y0+72);
if(holdvalues == false){
getdisplay().print(DataUnits[ValueIndex]); // Unit
}
else{
getdisplay().print(OldDataUnits[ValueIndex]);
}
// Switch font if format for any values
if(DataFormat[ValueIndex] == "formatLatitude" || DataFormat[ValueIndex] == "formatLongitude"){
getdisplay().setFont(&Ubuntu_Bold12pt7b);
getdisplay().setCursor(x0+10, y0+60);
}
else if(DataFormat[ValueIndex] == "formatTime" || DataFormat[ValueIndex] == "formatDate"){
getdisplay().setFont(&Ubuntu_Bold16pt7b);
getdisplay().setCursor(x0+20,y0+55);
}
// pressure in hPa
else if(DataFormat[ValueIndex] == "formatXdr:P:P"){
getdisplay().setFont(&DSEG7Classic_BoldItalic26pt7b);
getdisplay().setCursor(x0+5, y0+70);
}
// RPM
else if(DataFormat[ValueIndex] == "formatXdr:T:R"){
getdisplay().setFont(&DSEG7Classic_BoldItalic16pt7b);
getdisplay().setCursor(x0+25, y0+70);
}
else{
getdisplay().setFont(&DSEG7Classic_BoldItalic26pt7b);
if ( DataText[ValueIndex][0] == '-' )
getdisplay().setCursor(x0+25, y0+70);
else
getdisplay().setCursor(x0+65, y0+70);
}
// Show bus data
if(holdvalues == false){
getdisplay().print(DataText[ValueIndex]); // Real value as formated string
}
else{
getdisplay().print(OldDataText[ValueIndex]); // Old value as formated string
}
if(DataValid[ValueIndex] == true){
OldDataText[ValueIndex] = DataText[ValueIndex]; // Save the old value
OldDataUnits[ValueIndex] = DataUnits[ValueIndex]; // Save the old unit
}
}
// Vertical line 3 pix
getdisplay().fillRect(SixValues_x1+SixValues_DeltaX-8, SixValues_y1+i*SixValues_DeltaY, 3, SixValues_DeltaY, commonData->fgcolor);
}
getdisplay().fillRect(0, SixValues_y1+3*SixValues_DeltaY, 400, 3, commonData->fgcolor);
// Update display
getdisplay().nextPage(); // Partial update (fast)
};
};
static Page *createPage(CommonData &common){
return new PageSixValues(common);
}/**
* with the code below we make this page known to the PageTask
* we give it a type (name) that can be selected in the config
* we define which function is to be called
* and we provide the number of user parameters we expect
* this will be number of BoatValue pointers in pageData.values
*/
PageDescription registerPageSixValues(
"SixValues", // Page name
createPage, // Action
6, // Number of bus values depends on selection in Web configuration
true // Show display header on/off
);
#endif

View File

@ -968,6 +968,7 @@
"obp60":"true"
}
},
{
"name": "page1type",
"label": "Type",
@ -988,6 +989,7 @@
"OneValue",
"RollPitch",
"RudderPosition",
"SixValues",
"Solar",
"ThreeValues",
"TwoValues",
@ -1046,6 +1048,9 @@
"obp60": "true"
},
"condition": [
{
"page1type": "Fluid"
},
{
"page1type": "FourValues"
},
@ -1058,6 +1063,9 @@
{
"page1type": "RollPitch"
},
{
"page1type": "SixValues"
},
{
"page1type": "ThreeValues"
},
@ -1066,9 +1074,6 @@
},
{
"page1type": "WindRoseFlex"
},
{
"page1type": "Fluid"
}
]
},
@ -1092,6 +1097,9 @@
{
"page1type": "RollPitch"
},
{
"page1type": "SixValues"
},
{
"page1type": "ThreeValues"
},
@ -1120,6 +1128,9 @@
{
"page1type": "FourValues2"
},
{
"page1type": "SixValues"
},
{
"page1type": "ThreeValues"
},
@ -1145,6 +1156,9 @@
{
"page1type": "FourValues2"
},
{
"page1type": "SixValues"
},
{
"page1type": "WindRoseFlex"
}
@ -1161,6 +1175,9 @@
"obp60": "true"
},
"condition": [
{
"page1type": "SixValues"
},
{
"page1type": "WindRoseFlex"
}
@ -1177,6 +1194,9 @@
"obp60": "true"
},
"condition": [
{
"page1type": "SixValues"
},
{
"page1type": "WindRoseFlex"
}
@ -1248,6 +1268,7 @@
"OneValue",
"RollPitch",
"RudderPosition",
"SixValues",
"Solar",
"ThreeValues",
"TwoValues",
@ -1303,6 +1324,9 @@
"obp60": "true"
},
"condition": [
{
"page2type": "Fluid"
},
{
"page2type": "FourValues"
},
@ -1315,6 +1339,9 @@
{
"page2type": "RollPitch"
},
{
"page2type": "SixValues"
},
{
"page2type": "ThreeValues"
},
@ -1323,11 +1350,7 @@
},
{
"page2type": "WindRoseFlex"
},
{
"page2type": "Fluid"
}
]
},
{
@ -1350,6 +1373,9 @@
{
"page2type": "RollPitch"
},
{
"page2type": "SixValues"
},
{
"page2type": "ThreeValues"
},
@ -1378,6 +1404,9 @@
{
"page2type": "FourValues2"
},
{
"page2type": "SixValues"
},
{
"page2type": "ThreeValues"
},
@ -1403,6 +1432,9 @@
{
"page2type": "FourValues2"
},
{
"page2type": "SixValues"
},
{
"page2type": "WindRoseFlex"
}
@ -1419,6 +1451,9 @@
"obp60": "true"
},
"condition": [
{
"page2type": "SixValues"
},
{
"page2type": "WindRoseFlex"
}
@ -1435,6 +1470,9 @@
"obp60": "true"
},
"condition": [
{
"page2type": "SixValues"
},
{
"page2type": "WindRoseFlex"
}
@ -1506,6 +1544,7 @@
"OneValue",
"RollPitch",
"RudderPosition",
"SixValues",
"Solar",
"ThreeValues",
"TwoValues",
@ -1558,6 +1597,9 @@
"obp60": "true"
},
"condition": [
{
"page3type": "Fluid"
},
{
"page3type": "FourValues"
},
@ -1570,6 +1612,9 @@
{
"page3type": "RollPitch"
},
{
"page3type": "SixValues"
},
{
"page3type": "ThreeValues"
},
@ -1578,9 +1623,6 @@
},
{
"page3type": "WindRoseFlex"
},
{
"page3type": "Fluid"
}
]
},
@ -1604,6 +1646,9 @@
{
"page3type": "RollPitch"
},
{
"page3type": "SixValues"
},
{
"page3type": "ThreeValues"
},
@ -1632,6 +1677,9 @@
{
"page3type": "FourValues2"
},
{
"page3type": "SixValues"
},
{
"page3type": "ThreeValues"
},
@ -1657,6 +1705,9 @@
{
"page3type": "FourValues2"
},
{
"page3type": "SixValues"
},
{
"page3type": "WindRoseFlex"
}
@ -1673,6 +1724,9 @@
"obp60": "true"
},
"condition": [
{
"page3type": "SixValues"
},
{
"page3type": "WindRoseFlex"
}
@ -1689,6 +1743,9 @@
"obp60": "true"
},
"condition": [
{
"page3type": "SixValues"
},
{
"page3type": "WindRoseFlex"
}
@ -1760,6 +1817,7 @@
"OneValue",
"RollPitch",
"RudderPosition",
"SixValues",
"Solar",
"ThreeValues",
"TwoValues",
@ -1809,6 +1867,9 @@
"obp60": "true"
},
"condition": [
{
"page4type": "Fluid"
},
{
"page4type": "FourValues"
},
@ -1821,6 +1882,9 @@
{
"page4type": "RollPitch"
},
{
"page4type": "SixValues"
},
{
"page4type": "ThreeValues"
},
@ -1829,9 +1893,6 @@
},
{
"page4type": "WindRoseFlex"
},
{
"page4type": "Fluid"
}
]
},
@ -1855,6 +1916,9 @@
{
"page4type": "RollPitch"
},
{
"page4type": "SixValues"
},
{
"page4type": "ThreeValues"
},
@ -1883,6 +1947,9 @@
{
"page4type": "FourValues2"
},
{
"page4type": "SixValues"
},
{
"page4type": "ThreeValues"
},
@ -1908,6 +1975,9 @@
{
"page4type": "FourValues2"
},
{
"page4type": "SixValues"
},
{
"page4type": "WindRoseFlex"
}
@ -1924,6 +1994,9 @@
"obp60": "true"
},
"condition": [
{
"page4type": "SixValues"
},
{
"page4type": "WindRoseFlex"
}
@ -1940,6 +2013,9 @@
"obp60": "true"
},
"condition": [
{
"page4type": "SixValues"
},
{
"page4type": "WindRoseFlex"
}
@ -2011,6 +2087,7 @@
"OneValue",
"RollPitch",
"RudderPosition",
"SixValues",
"Solar",
"ThreeValues",
"TwoValues",
@ -2057,6 +2134,9 @@
"obp60": "true"
},
"condition": [
{
"page5type": "Fluid"
},
{
"page5type": "FourValues"
},
@ -2069,6 +2149,9 @@
{
"page5type": "RollPitch"
},
{
"page5type": "SixValues"
},
{
"page5type": "ThreeValues"
},
@ -2077,9 +2160,6 @@
},
{
"page5type": "WindRoseFlex"
},
{
"page5type": "Fluid"
}
]
},
@ -2103,6 +2183,9 @@
{
"page5type": "RollPitch"
},
{
"page5type": "SixValues"
},
{
"page5type": "ThreeValues"
},
@ -2131,6 +2214,9 @@
{
"page5type": "FourValues2"
},
{
"page5type": "SixValues"
},
{
"page5type": "ThreeValues"
},
@ -2156,6 +2242,9 @@
{
"page5type": "FourValues2"
},
{
"page5type": "SixValues"
},
{
"page5type": "WindRoseFlex"
}
@ -2172,6 +2261,9 @@
"obp60": "true"
},
"condition": [
{
"page5type": "SixValues"
},
{
"page5type": "WindRoseFlex"
}
@ -2188,6 +2280,9 @@
"obp60": "true"
},
"condition": [
{
"page5type": "SixValues"
},
{
"page5type": "WindRoseFlex"
}
@ -2259,6 +2354,7 @@
"OneValue",
"RollPitch",
"RudderPosition",
"SixValues",
"Solar",
"ThreeValues",
"TwoValues",
@ -2302,6 +2398,9 @@
"obp60": "true"
},
"condition": [
{
"page6type": "Fluid"
},
{
"page6type": "FourValues"
},
@ -2314,6 +2413,9 @@
{
"page6type": "RollPitch"
},
{
"page6type": "SixValues"
},
{
"page6type": "ThreeValues"
},
@ -2322,9 +2424,6 @@
},
{
"page6type": "WindRoseFlex"
},
{
"page6type": "Fluid"
}
]
},
@ -2348,6 +2447,9 @@
{
"page6type": "RollPitch"
},
{
"page6type": "SixValues"
},
{
"page6type": "ThreeValues"
},
@ -2376,6 +2478,9 @@
{
"page6type": "FourValues2"
},
{
"page6type": "SixValues"
},
{
"page6type": "ThreeValues"
},
@ -2401,6 +2506,9 @@
{
"page6type": "FourValues2"
},
{
"page6type": "SixValues"
},
{
"page6type": "WindRoseFlex"
}
@ -2417,6 +2525,9 @@
"obp60": "true"
},
"condition": [
{
"page6type": "SixValues"
},
{
"page6type": "WindRoseFlex"
}
@ -2433,6 +2544,9 @@
"obp60": "true"
},
"condition": [
{
"page6type": "SixValues"
},
{
"page6type": "WindRoseFlex"
}
@ -2504,6 +2618,7 @@
"OneValue",
"RollPitch",
"RudderPosition",
"SixValues",
"Solar",
"ThreeValues",
"TwoValues",
@ -2544,6 +2659,9 @@
"obp60": "true"
},
"condition": [
{
"page7type": "Fluid"
},
{
"page7type": "FourValues"
},
@ -2556,6 +2674,9 @@
{
"page7type": "RollPitch"
},
{
"page7type": "SixValues"
},
{
"page7type": "ThreeValues"
},
@ -2564,9 +2685,6 @@
},
{
"page7type": "WindRoseFlex"
},
{
"page7type": "Fluid"
}
]
},
@ -2590,6 +2708,9 @@
{
"page7type": "RollPitch"
},
{
"page7type": "SixValues"
},
{
"page7type": "ThreeValues"
},
@ -2618,6 +2739,9 @@
{
"page7type": "FourValues2"
},
{
"page7type": "SixValues"
},
{
"page7type": "ThreeValues"
},
@ -2643,6 +2767,9 @@
{
"page7type": "FourValues2"
},
{
"page7type": "SixValues"
},
{
"page7type": "WindRoseFlex"
}
@ -2659,6 +2786,9 @@
"obp60": "true"
},
"condition": [
{
"page7type": "SixValues"
},
{
"page7type": "WindRoseFlex"
}
@ -2675,6 +2805,9 @@
"obp60": "true"
},
"condition": [
{
"page7type": "SixValues"
},
{
"page7type": "WindRoseFlex"
}
@ -2746,6 +2879,7 @@
"OneValue",
"RollPitch",
"RudderPosition",
"SixValues",
"Solar",
"ThreeValues",
"TwoValues",
@ -2783,6 +2917,9 @@
"obp60": "true"
},
"condition": [
{
"page8type": "Fluid"
},
{
"page8type": "FourValues"
},
@ -2795,6 +2932,9 @@
{
"page8type": "RollPitch"
},
{
"page8type": "SixValues"
},
{
"page8type": "ThreeValues"
},
@ -2803,9 +2943,6 @@
},
{
"page8type": "WindRoseFlex"
},
{
"page8type": "Fluid"
}
]
},
@ -2829,6 +2966,9 @@
{
"page8type": "RollPitch"
},
{
"page8type": "SixValues"
},
{
"page8type": "ThreeValues"
},
@ -2857,6 +2997,9 @@
{
"page8type": "FourValues2"
},
{
"page8type": "SixValues"
},
{
"page8type": "ThreeValues"
},
@ -2882,6 +3025,9 @@
{
"page8type": "FourValues2"
},
{
"page8type": "SixValues"
},
{
"page8type": "WindRoseFlex"
}
@ -2898,6 +3044,9 @@
"obp60": "true"
},
"condition": [
{
"page8type": "SixValues"
},
{
"page8type": "WindRoseFlex"
}
@ -2914,6 +3063,9 @@
"obp60": "true"
},
"condition": [
{
"page8type": "SixValues"
},
{
"page8type": "WindRoseFlex"
}
@ -2985,6 +3137,7 @@
"OneValue",
"RollPitch",
"RudderPosition",
"SixValues",
"Solar",
"ThreeValues",
"TwoValues",
@ -3019,6 +3172,9 @@
"obp60": "true"
},
"condition": [
{
"page9type": "Fluid"
},
{
"page9type": "FourValues"
},
@ -3031,6 +3187,9 @@
{
"page9type": "RollPitch"
},
{
"page9type": "SixValues"
},
{
"page9type": "ThreeValues"
},
@ -3039,9 +3198,6 @@
},
{
"page9type": "WindRoseFlex"
},
{
"page9type": "Fluid"
}
]
},
@ -3065,6 +3221,9 @@
{
"page9type": "RollPitch"
},
{
"page9type": "SixValues"
},
{
"page9type": "ThreeValues"
},
@ -3093,6 +3252,9 @@
{
"page9type": "FourValues2"
},
{
"page9type": "SixValues"
},
{
"page9type": "ThreeValues"
},
@ -3118,6 +3280,9 @@
{
"page9type": "FourValues2"
},
{
"page9type": "SixValues"
},
{
"page9type": "WindRoseFlex"
}
@ -3134,6 +3299,9 @@
"obp60": "true"
},
"condition": [
{
"page9type": "SixValues"
},
{
"page9type": "WindRoseFlex"
}
@ -3150,6 +3318,9 @@
"obp60": "true"
},
"condition": [
{
"page9type": "SixValues"
},
{
"page9type": "WindRoseFlex"
}
@ -3221,6 +3392,7 @@
"OneValue",
"RollPitch",
"RudderPosition",
"SixValues",
"Solar",
"ThreeValues",
"TwoValues",
@ -3252,6 +3424,9 @@
"obp60": "true"
},
"condition": [
{
"page10type": "Fluid"
},
{
"page10type": "FourValues"
},
@ -3264,6 +3439,9 @@
{
"page10type": "RollPitch"
},
{
"page10type": "SixValues"
},
{
"page10type": "ThreeValues"
},
@ -3272,9 +3450,6 @@
},
{
"page10type": "WindRoseFlex"
},
{
"page10type": "Fluid"
}
]
},
@ -3298,6 +3473,9 @@
{
"page10type": "RollPitch"
},
{
"page10type": "SixValues"
},
{
"page10type": "ThreeValues"
},
@ -3326,6 +3504,9 @@
{
"page10type": "FourValues2"
},
{
"page10type": "SixValues"
},
{
"page10type": "ThreeValues"
},
@ -3351,6 +3532,9 @@
{
"page10type": "FourValues2"
},
{
"page10type": "SixValues"
},
{
"page10type": "WindRoseFlex"
}
@ -3367,6 +3551,9 @@
"obp60": "true"
},
"condition": [
{
"page10type": "SixValues"
},
{
"page10type": "WindRoseFlex"
}
@ -3383,6 +3570,9 @@
"obp60": "true"
},
"condition": [
{
"page10type": "SixValues"
},
{
"page10type": "WindRoseFlex"
}
@ -3435,3 +3625,4 @@
]
}
]

View File

@ -31,7 +31,7 @@ no_of_fields_per_page = {
"WhitePage": 0,
"WindRose": 0,
"WindRoseFlex": 6,
# "SixValues" : 6,
"SixValues" : 6,
}
# No changes needed beyond this point

View File

@ -266,6 +266,8 @@ void registerAllPages(PageList &list){
list.add(&registerPageTwoValues);
extern PageDescription registerPageThreeValues;
list.add(&registerPageThreeValues);
extern PageDescription registerPageSixValues;
list.add(&registerPageSixValues);
extern PageDescription registerPageFourValues;
list.add(&registerPageFourValues);
extern PageDescription registerPageFourValues2;

View File

@ -5,7 +5,7 @@
default_envs =
obp60_s3
obp40_s3
# obp40_s3
[env:obp60_s3]
platform = espressif32@6.8.1