Merge pull request #106 from TobiasE-github/master

PageWindRoseFlex where all Data fields can be configured
This commit is contained in:
Norbert Walter 2024-10-31 09:44:18 +01:00 committed by GitHub
commit 3a3f27c68f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 723 additions and 52 deletions

View File

@ -0,0 +1,412 @@
#ifdef BOARD_OBP60S3
#include "Pagedata.h"
#include "OBP60Extensions.h"
class PageWindRoseFlex : public Page
{
bool keylock = false; // Keylock
int16_t lp = 80; // Pointer length
public:
PageWindRoseFlex(CommonData &common){
common.logger->logDebug(GwLog::LOG,"Show PageWindRoseFlex");
}
// Key functions
virtual int handleKey(int key){
// Keylock function
if(key == 11){ // Code for keylock
keylock = !keylock; // Toggle keylock
return 0; // Commit the key
}
return key;
}
virtual void displayPage(CommonData &commonData, PageData &pageData)
{
GwConfigHandler *config = commonData.config;
GwLog *logger=commonData.logger;
static String svalue1old = "";
static String unit1old = "";
static String svalue2old = "";
static String unit2old = "";
static String svalue3old = "";
static String unit3old = "";
static String svalue4old = "";
static String unit4old = "";
static String svalue5old = "";
static String unit5old = "";
static String svalue6old = "";
static String unit6old = "";
// Get config data
String lengthformat = config->getString(config->lengthFormat);
bool simulation = config->getBool(config->useSimuData);
String displaycolor = config->getString(config->displaycolor);
bool holdvalues = config->getBool(config->holdvalues);
String flashLED = config->getString(config->flashLED);
String backlightMode = config->getString(config->backlight);
// Get boat values for AWA
GwApi::BoatValue *bvalue1 = pageData.values[0]; // First element in list (only one value by PageOneValue)
String name1 = xdrDelete(bvalue1->getName()); // Value name
name1 = name1.substring(0, 6); // String length limit for value name
double value1 = bvalue1->value; // Value as double in SI unit
bool valid1 = bvalue1->valid; // Valid information
value1 = formatValue(bvalue1, commonData).value;// Format only nesaccery for simulation data for pointer
String svalue1 = formatValue(bvalue1, commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
String unit1 = formatValue(bvalue1, commonData).unit; // Unit of value
if(valid1 == true){
svalue1old = svalue1; // Save old value
unit1old = unit1; // Save old unit
}
// Get boat values for AWS
GwApi::BoatValue *bvalue2 = pageData.values[1]; // First element in list (only one value by PageOneValue)
String name2 = xdrDelete(bvalue2->getName()); // Value name
name2 = name2.substring(0, 6); // String length limit for value name
double value2 = bvalue2->value; // Value as double in SI unit
bool valid2 = bvalue2->valid; // Valid information
String svalue2 = formatValue(bvalue2, commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
String unit2 = formatValue(bvalue2, commonData).unit; // Unit of value
if(valid2 == true){
svalue2old = svalue2; // Save old value
unit2old = unit2; // Save old unit
}
// Get boat values TWD
GwApi::BoatValue *bvalue3 = pageData.values[2]; // Second element in list (only one value by PageOneValue)
String name3 = xdrDelete(bvalue3->getName()); // Value name
name3 = name3.substring(0, 6); // String length limit for value name
double value3 = bvalue3->value; // Value as double in SI unit
bool valid3 = bvalue3->valid; // Valid information
String svalue3 = formatValue(bvalue3, commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
String unit3 = formatValue(bvalue3, commonData).unit; // Unit of value
if(valid3 == true){
svalue3old = svalue3; // Save old value
unit3old = unit3; // Save old unit
}
// Get boat values TWS
GwApi::BoatValue *bvalue4 = pageData.values[3]; // Second element in list (only one value by PageOneValue)
String name4 = xdrDelete(bvalue4->getName()); // Value name
name4 = name4.substring(0, 6); // String length limit for value name
double value4 = bvalue4->value; // Value as double in SI unit
bool valid4 = bvalue4->valid; // Valid information
String svalue4 = formatValue(bvalue4, commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
String unit4 = formatValue(bvalue4, commonData).unit; // Unit of value
if(valid4 == true){
svalue4old = svalue4; // Save old value
unit4old = unit4; // Save old unit
}
// Get boat values DBT
GwApi::BoatValue *bvalue5 = pageData.values[4]; // Second element in list (only one value by PageOneValue)
String name5 = xdrDelete(bvalue5->getName()); // Value name
name5 = name5.substring(0, 6); // String length limit for value name
double value5 = bvalue5->value; // Value as double in SI unit
bool valid5 = bvalue5->valid; // Valid information
String svalue5 = formatValue(bvalue5, commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
String unit5 = formatValue(bvalue5, commonData).unit; // Unit of value
if(valid5 == true){
svalue5old = svalue5; // Save old value
unit5old = unit5; // Save old unit
}
// Get boat values STW
GwApi::BoatValue *bvalue6 = pageData.values[5]; // Second element in list (only one value by PageOneValue)
String name6 = xdrDelete(bvalue6->getName()); // Value name
name6 = name6.substring(0, 6); // String length limit for value name
double value6 = bvalue6->value; // Value as double in SI unit
bool valid6 = bvalue6->valid; // Valid information
String svalue6 = formatValue(bvalue6, commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
String unit6 = formatValue(bvalue6, commonData).unit; // Unit of value
if(valid6 == true){
svalue6old = svalue6; // Save old value
unit6old = unit6; // Save old unit
}
// Optical warning by limit violation (unused)
if(String(flashLED) == "Limit Violation"){
setBlinkingLED(false);
setFlashLED(false);
}
// Logging boat values
if (bvalue1 == NULL) return;
LOG_DEBUG(GwLog::LOG,"Drawing at PageWindRoseFlex, %s:%f, %s:%f, %s:%f, %s:%f, %s:%f, %s:%f", name1.c_str(), value1, name2.c_str(), value2, name3.c_str(), value3, name4.c_str(), value4, name5.c_str(), value5, name6.c_str(), value6);
// Draw page
//***********************************************************
// Set background color and text color
int textcolor = GxEPD_BLACK;
int pixelcolor = GxEPD_BLACK;
int bgcolor = GxEPD_WHITE;
if(displaycolor == "Normal"){
textcolor = GxEPD_BLACK;
pixelcolor = GxEPD_BLACK;
bgcolor = GxEPD_WHITE;
}
else{
textcolor = GxEPD_WHITE;
pixelcolor = GxEPD_WHITE;
bgcolor = GxEPD_BLACK;
}
// Set display in partial refresh mode
getdisplay().setPartialWindow(0, 0, getdisplay().width(), getdisplay().height()); // Set partial update
// Show values AWA
getdisplay().setTextColor(textcolor);
getdisplay().setFont(&DSEG7Classic_BoldItalic20pt7b);
getdisplay().setCursor(10, 65);
getdisplay().print(svalue1); // Value
getdisplay().setFont(&Ubuntu_Bold12pt7b);
getdisplay().setCursor(10, 95);
getdisplay().print(name1); // Name
getdisplay().setFont(&Ubuntu_Bold8pt7b);
getdisplay().setCursor(10, 115);
getdisplay().print(" ");
if(holdvalues == false){
getdisplay().print(unit1); // Unit
}
else{
getdisplay().print(unit1old); // Unit
}
// Horizintal separator left
getdisplay().fillRect(0, 149, 60, 3, pixelcolor);
// Show values AWS
getdisplay().setTextColor(textcolor);
getdisplay().setFont(&DSEG7Classic_BoldItalic20pt7b);
getdisplay().setCursor(10, 270);
getdisplay().print(svalue2); // Value
getdisplay().setFont(&Ubuntu_Bold12pt7b);
getdisplay().setCursor(10, 220);
getdisplay().print(name2); // Name
getdisplay().setFont(&Ubuntu_Bold8pt7b);
getdisplay().setCursor(10, 190);
getdisplay().print(" ");
if(holdvalues == false){
getdisplay().print(unit2); // Unit
}
else{
getdisplay().print(unit2old); // Unit
}
// Show values TWD
getdisplay().setTextColor(textcolor);
getdisplay().setFont(&DSEG7Classic_BoldItalic20pt7b);
getdisplay().setCursor(295, 65);
if(valid3 == true){
getdisplay().print(abs(value3 * 180 / PI), 0); // Value
}
else{
getdisplay().print("---"); // Value
}
getdisplay().setFont(&Ubuntu_Bold12pt7b);
getdisplay().setCursor(335, 95);
getdisplay().print(name3); // Name
getdisplay().setFont(&Ubuntu_Bold8pt7b);
getdisplay().setCursor(335, 115);
getdisplay().print(" ");
if(holdvalues == false){
getdisplay().print(unit3); // Unit
}
else{
getdisplay().print(unit3old); // Unit
}
// Horizintal separator right
getdisplay().fillRect(340, 149, 80, 3, pixelcolor);
// Show values TWS
getdisplay().setTextColor(textcolor);
getdisplay().setFont(&DSEG7Classic_BoldItalic20pt7b);
getdisplay().setCursor(295, 270);
getdisplay().print(svalue4); // Value
getdisplay().setFont(&Ubuntu_Bold12pt7b);
getdisplay().setCursor(335, 220);
getdisplay().print(name4); // Name
getdisplay().setFont(&Ubuntu_Bold8pt7b);
getdisplay().setCursor(335, 190);
getdisplay().print(" ");
if(holdvalues == false){
getdisplay().print(unit4); // Unit
}
else{
getdisplay().print(unit4old); // Unit
}
//*******************************************************************************************
// Draw wind rose
int rInstrument = 110; // Radius of grafic instrument
float pi = 3.141592;
getdisplay().fillCircle(200, 150, rInstrument + 10, pixelcolor); // Outer circle
getdisplay().fillCircle(200, 150, rInstrument + 7, bgcolor); // Outer circle
getdisplay().fillCircle(200, 150, rInstrument - 10, pixelcolor); // Inner circle
getdisplay().fillCircle(200, 150, rInstrument - 13, bgcolor); // Inner circle
for(int i=0; i<360; i=i+10)
{
// Scaling values
float x = 200 + (rInstrument-30)*sin(i/180.0*pi); // x-coordinate dots
float y = 150 - (rInstrument-30)*cos(i/180.0*pi); // y-coordinate cots
const char *ii = "";
switch (i)
{
case 0: ii="0"; break;
case 30 : ii="30"; break;
case 60 : ii="60"; break;
case 90 : ii="90"; break;
case 120 : ii="120"; break;
case 150 : ii="150"; break;
case 180 : ii="180"; break;
case 210 : ii="210"; break;
case 240 : ii="240"; break;
case 270 : ii="270"; break;
case 300 : ii="300"; break;
case 330 : ii="330"; break;
default: break;
}
// Print text centered on position x, y
int16_t x1, y1; // Return values of getTextBounds
uint16_t w, h; // Return values of getTextBounds
getdisplay().getTextBounds(ii, int(x), int(y), &x1, &y1, &w, &h); // Calc width of new string
getdisplay().setCursor(x-w/2, y+h/2);
if(i % 30 == 0){
getdisplay().setFont(&Ubuntu_Bold8pt7b);
getdisplay().print(ii);
}
// Draw sub scale with dots
float x1c = 200 + rInstrument*sin(i/180.0*pi);
float y1c = 150 - rInstrument*cos(i/180.0*pi);
getdisplay().fillCircle((int)x1c, (int)y1c, 2, pixelcolor);
float sinx=sin(i/180.0*pi);
float cosx=cos(i/180.0*pi);
// Draw sub scale with lines (two triangles)
if(i % 30 == 0){
float dx=2; // Line thickness = 2*dx+1
float xx1 = -dx;
float xx2 = +dx;
float yy1 = -(rInstrument-10);
float yy2 = -(rInstrument+10);
getdisplay().fillTriangle(200+(int)(cosx*xx1-sinx*yy1),150+(int)(sinx*xx1+cosx*yy1),
200+(int)(cosx*xx2-sinx*yy1),150+(int)(sinx*xx2+cosx*yy1),
200+(int)(cosx*xx1-sinx*yy2),150+(int)(sinx*xx1+cosx*yy2),pixelcolor);
getdisplay().fillTriangle(200+(int)(cosx*xx2-sinx*yy1),150+(int)(sinx*xx2+cosx*yy1),
200+(int)(cosx*xx1-sinx*yy2),150+(int)(sinx*xx1+cosx*yy2),
200+(int)(cosx*xx2-sinx*yy2),150+(int)(sinx*xx2+cosx*yy2),pixelcolor);
}
}
// Draw wind pointer
float startwidth = 8; // Start width of pointer
if(valid2 == true || holdvalues == true || simulation == true){
float sinx=sin(value1); // Wind direction
float cosx=cos(value1);
// Normal pointer
// Pointer as triangle with center base 2*width
float xx1 = -startwidth;
float xx2 = startwidth;
float yy1 = -startwidth;
float yy2 = -(rInstrument-15);
getdisplay().fillTriangle(200+(int)(cosx*xx1-sinx*yy1),150+(int)(sinx*xx1+cosx*yy1),
200+(int)(cosx*xx2-sinx*yy1),150+(int)(sinx*xx2+cosx*yy1),
200+(int)(cosx*0-sinx*yy2),150+(int)(sinx*0+cosx*yy2),pixelcolor);
// Inverted pointer
// Pointer as triangle with center base 2*width
float endwidth = 2; // End width of pointer
float ix1 = endwidth;
float ix2 = -endwidth;
float iy1 = -(rInstrument-15);
float iy2 = -endwidth;
getdisplay().fillTriangle(200+(int)(cosx*ix1-sinx*iy1),150+(int)(sinx*ix1+cosx*iy1),
200+(int)(cosx*ix2-sinx*iy1),150+(int)(sinx*ix2+cosx*iy1),
200+(int)(cosx*0-sinx*iy2),150+(int)(sinx*0+cosx*iy2),pixelcolor);
}
// Center circle
getdisplay().fillCircle(200, 150, startwidth + 6, bgcolor);
getdisplay().fillCircle(200, 150, startwidth + 4, pixelcolor);
//*******************************************************************************************
// Show values DBT
getdisplay().setTextColor(textcolor);
getdisplay().setFont(&DSEG7Classic_BoldItalic16pt7b);
getdisplay().setCursor(160, 200);
getdisplay().print(svalue5); // Value
getdisplay().setFont(&Ubuntu_Bold8pt7b);
getdisplay().setCursor(190, 215);
getdisplay().print(" ");
if(holdvalues == false){
getdisplay().print(unit5); // Unit
}
else{
getdisplay().print(unit5old); // Unit
}
// Show values STW
getdisplay().setTextColor(textcolor);
getdisplay().setFont(&DSEG7Classic_BoldItalic16pt7b);
getdisplay().setCursor(160, 130);
getdisplay().print(svalue6); // Value
getdisplay().setFont(&Ubuntu_Bold8pt7b);
getdisplay().setCursor(190, 90);
getdisplay().print(" ");
if(holdvalues == false){
getdisplay().print(unit6); // Unit
}
else{
getdisplay().print(unit6old); // Unit
}
// Key Layout
getdisplay().setTextColor(textcolor);
getdisplay().setFont(&Ubuntu_Bold8pt7b);
if(keylock == false){
getdisplay().setCursor(130, 290);
getdisplay().print("[ <<<< " + String(commonData.data.actpage) + "/" + String(commonData.data.maxpage) + " >>>> ]");
if(String(backlightMode) == "Control by Key"){ // Key for illumination
getdisplay().setCursor(343, 290);
getdisplay().print("[ILUM]");
}
}
else{
getdisplay().setCursor(130, 290);
getdisplay().print(" [ Keylock active ]");
}
// Update display
getdisplay().nextPage(); // Partial update (fast)
};
};
static Page *createPage(CommonData &common){
return new PageWindRoseFlex(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 (0 here)
* and will will provide the names of the fixed values we need
*/
PageDescription registerPageWindRoseFlex(
"WindRoseFlex", // Page name
createPage, // Action
6, // Number of bus values depends on selection in Web configuration; was zero
//{"AWA", "AWS", "COG", "SOG", "TWD", "TWS"}, // Bus values we need in the page, modified for WindRose2
true // Show display header on/off
);
#endif

View File

@ -876,7 +876,7 @@
"type": "list",
"default": "Voltage",
"description": "Type of page for page 1",
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","WindRoseFlex","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"category": "OBP60 Page 1",
"capabilities": {
"obp60":"true"
@ -884,7 +884,7 @@
},
{
"name": "page1value1",
"label": "Field 1 ",
"label": "Field 1",
"type": "boatData",
"default": "",
"description": "The display for field one",
@ -892,7 +892,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page1type":"OneValue"},{"page1type":"TwoValues"},{"page1type":"ThreeValues"},{"page1type":"FourValues"},{"page1type":"FourValues2"}]
"condition":[{"page1type":"OneValue"},{"page1type":"TwoValues"},{"page1type":"ThreeValues"},{"page1type":"FourValues"},{"page1type":"FourValues2"},{"page1type":"WindRoseFlex"}]
},
{
"name": "page1value2",
@ -904,7 +904,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page1type":"TwoValues"},{"page1type":"ThreeValues"},{"page1type":"FourValues"},{"page1type":"FourValues2"}]
"condition":[{"page1type":"TwoValues"},{"page1type":"ThreeValues"},{"page1type":"FourValues"},{"page1type":"FourValues2"},{"page1type":"WindRoseFlex"}]
},
{
"name": "page1value3",
@ -916,7 +916,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page1type":"ThreeValues"},{"page1type":"FourValues"},{"page1type":"FourValues2"}]
"condition":[{"page1type":"ThreeValues"},{"page1type":"FourValues"},{"page1type":"FourValues2"},{"page1type":"WindRoseFlex"}]
},
{
"name": "page1value4",
@ -928,7 +928,31 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page1type":"FourValues"},{"page1type":"FourValues2"}]
"condition":[{"page1type":"FourValues"},{"page1type":"FourValues2"},{"page1type":"WindRoseFlex"}]
},
{
"name": "page1value5",
"label": "Field 5",
"type": "boatData",
"default": "",
"description": "The display for field 5",
"category": "OBP60 Page 1",
"capabilities": {
"obp60":"true"
},
"condition":[{"page1type":"WindRoseFlex"}]
},
{
"name": "page1value6",
"label": "Field 6",
"type": "boatData",
"default": "",
"description": "The display for field 6",
"category": "OBP60 Page 1",
"capabilities": {
"obp60":"true"
},
"condition":[{"page1type":"WindRoseFlex"}]
},
{
"name": "page2type",
@ -936,7 +960,7 @@
"type": "list",
"default": "WindRose",
"description": "Type of page for page 2",
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","WindRoseFlex","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"category": "OBP60 Page 2",
"capabilities": {
"obp60":"true"
@ -953,7 +977,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page2type":"OneValue"},{"page2type":"TwoValues"},{"page2type":"ThreeValues"},{"page2type":"FourValues"},{"page2type":"FourValues2"}]
"condition":[{"page2type":"OneValue"},{"page2type":"TwoValues"},{"page2type":"ThreeValues"},{"page2type":"FourValues"},{"page2type":"FourValues2"},{"page2type":"WindRoseFlex"}]
},
{
"name": "page2value2",
@ -965,7 +989,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page2type":"TwoValues"},{"page2type":"ThreeValues"},{"page2type":"FourValues"},{"page2type":"FourValues2"}]
"condition":[{"page2type":"TwoValues"},{"page2type":"ThreeValues"},{"page2type":"FourValues"},{"page2type":"FourValues2"},{"page2type":"WindRoseFlex"}]
},
{
"name": "page2value3",
@ -977,7 +1001,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page2type":"ThreeValues"},{"page2type":"FourValues"},{"page2type":"FourValues2"}]
"condition":[{"page2type":"ThreeValues"},{"page2type":"FourValues"},{"page2type":"FourValues2"},{"page2type":"WindRoseFlex"}]
},
{
"name": "page2value4",
@ -989,7 +1013,31 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page2type":"FourValues"},{"page2type":"FourValues2"}]
"condition":[{"page2type":"FourValues"},{"page2type":"FourValues2"},{"page2type":"WindRoseFlex"}]
},
{
"name": "page2value5",
"label": "Field 5",
"type": "boatData",
"default": "",
"description": "The display for field 5",
"category": "OBP60 Page 2",
"capabilities": {
"obp60":"true"
},
"condition":[{"page2type":"WindRoseFlex"}]
},
{
"name": "page2value6",
"label": "Field 6",
"type": "boatData",
"default": "",
"description": "The display for field 6",
"category": "OBP60 Page 2",
"capabilities": {
"obp60":"true"
},
"condition":[{"page2type":"WindRoseFlex"}]
},
{
"name": "page3type",
@ -997,7 +1045,7 @@
"type": "list",
"default": "OneValue",
"description": "Type of page for page 3",
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","WindRoseFlex","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"category": "OBP60 Page 3",
"capabilities": {
"obp60":"true"
@ -1014,7 +1062,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page3type":"OneValue"},{"page3type":"TwoValues"},{"page3type":"ThreeValues"},{"page3type":"FourValues"},{"page3type":"FourValues2"}]
"condition":[{"page3type":"OneValue"},{"page3type":"TwoValues"},{"page3type":"ThreeValues"},{"page3type":"FourValues"},{"page3type":"FourValues2"},{"page3type":"WindRoseFlex"}]
},
{
"name": "page3value2",
@ -1026,7 +1074,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page3type":"TwoValues"},{"page3type":"ThreeValues"},{"page3type":"FourValues"},{"page3type":"FourValues2"}]
"condition":[{"page3type":"TwoValues"},{"page3type":"ThreeValues"},{"page3type":"FourValues"},{"page3type":"FourValues2"},{"page3type":"WindRoseFlex"}]
},
{
"name": "page3value3",
@ -1038,7 +1086,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page3type":"ThreeValues"},{"page3type":"FourValues"},{"page3type":"FourValues2"}]
"condition":[{"page3type":"ThreeValues"},{"page3type":"FourValues"},{"page3type":"FourValues2"},{"page3type":"WindRoseFlex"}]
},
{
"name": "page3value4",
@ -1050,7 +1098,31 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page3type":"FourValues"},{"page3type":"FourValues2"}]
"condition":[{"page3type":"FourValues"},{"page3type":"FourValues2"},{"page3type":"WindRoseFlex"}]
},
{
"name": "page3value5",
"label": "Field 5",
"type": "boatData",
"default": "",
"description": "The display for field 5",
"category": "OBP60 Page 3",
"capabilities": {
"obp60":"true"
},
"condition":[{"page3type":"WindRoseFlex"}]
},
{
"name": "page3value6",
"label": "Field 6",
"type": "boatData",
"default": "",
"description": "The display for field 6",
"category": "OBP60 Page 3",
"capabilities": {
"obp60":"true"
},
"condition":[{"page3type":"WindRoseFlex"}]
},
{
"name": "page4type",
@ -1058,7 +1130,7 @@
"type": "list",
"default": "TwoValues",
"description": "Type of page for page 4",
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","WindRoseFlex","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"category": "OBP60 Page 4",
"capabilities": {
"obp60":"true"
@ -1075,7 +1147,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page4type":"OneValue"},{"page4type":"TwoValues"},{"page4type":"ThreeValues"},{"page4type":"FourValues"},{"page4type":"FourValues2"}]
"condition":[{"page4type":"OneValue"},{"page4type":"TwoValues"},{"page4type":"ThreeValues"},{"page4type":"FourValues"},{"page4type":"FourValues2"},{"page4type":"WindRoseFlex"}]
},
{
"name": "page4value2",
@ -1087,7 +1159,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page4type":"TwoValues"},{"page4type":"ThreeValues"},{"page4type":"FourValues"},{"page4type":"FourValues2"}]
"condition":[{"page4type":"TwoValues"},{"page4type":"ThreeValues"},{"page4type":"FourValues"},{"page4type":"FourValues2"},{"page4type":"WindRoseFlex"}]
},
{
"name": "page4value3",
@ -1099,7 +1171,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page4type":"ThreeValues"},{"page4type":"FourValues"},{"page4type":"FourValues2"}]
"condition":[{"page4type":"ThreeValues"},{"page4type":"FourValues"},{"page4type":"FourValues2"},{"page4type":"WindRoseFlex"}]
},
{
"name": "page4value4",
@ -1111,7 +1183,31 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page4type":"FourValues"},{"page4type":"FourValues2"}]
"condition":[{"page4type":"FourValues"},{"page4type":"FourValues2"},{"page4type":"WindRoseFlex"}]
},
{
"name": "page4value5",
"label": "Field 5",
"type": "boatData",
"default": "",
"description": "The display for field 5",
"category": "OBP60 Page 4",
"capabilities": {
"obp60":"true"
},
"condition":[{"page4type":"WindRoseFlex"}]
},
{
"name": "page4value6",
"label": "Field 6",
"type": "boatData",
"default": "",
"description": "The display for field 6",
"category": "OBP60 Page 4",
"capabilities": {
"obp60":"true"
},
"condition":[{"page4type":"WindRoseFlex"}]
},
{
"name": "page5type",
@ -1119,7 +1215,7 @@
"type": "list",
"default": "ThreeValues",
"description": "Type of page for page 5",
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","WindRoseFlex","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"category": "OBP60 Page 5",
"capabilities": {
"obp60":"true"
@ -1136,7 +1232,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page5type":"OneValue"},{"page5type":"TwoValues"},{"page5type":"ThreeValues"},{"page5type":"FourValues"},{"page5type":"FourValues2"}]
"condition":[{"page5type":"OneValue"},{"page5type":"TwoValues"},{"page5type":"ThreeValues"},{"page5type":"FourValues"},{"page5type":"FourValues2"},{"page4type":"WindRoseFlex"}]
},
{
"name": "page5value2",
@ -1148,7 +1244,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page5type":"TwoValues"},{"page5type":"ThreeValues"},{"page5type":"FourValues"},{"page5type":"FourValues2"}]
"condition":[{"page5type":"TwoValues"},{"page5type":"ThreeValues"},{"page5type":"FourValues"},{"page5type":"FourValues2"},{"page4type":"WindRoseFlex"}]
},
{
"name": "page5value3",
@ -1160,7 +1256,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page5type":"ThreeValues"},{"page5type":"FourValues"},{"page5type":"FourValues2"}]
"condition":[{"page5type":"ThreeValues"},{"page5type":"FourValues"},{"page5type":"FourValues2"},{"page5type":"WindRoseFlex"}]
},
{
"name": "page5value4",
@ -1172,7 +1268,31 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page5type":"FourValues"},{"page5type":"FourValues2"}]
"condition":[{"page5type":"FourValues"},{"page5type":"FourValues2"},{"page5type":"WindRoseFlex"}]
},
{
"name": "page5value5",
"label": "Field 5",
"type": "boatData",
"default": "",
"description": "The display for field 5",
"category": "OBP60 Page 5",
"capabilities": {
"obp60":"true"
},
"condition":[{"page5type":"WindRoseFlex"}]
},
{
"name": "page5value6",
"label": "Field 6",
"type": "boatData",
"default": "",
"description": "The display for field 6",
"category": "OBP60 Page 5",
"capabilities": {
"obp60":"true"
},
"condition":[{"page5type":"WindRoseFlex"}]
},
{
"name": "page6type",
@ -1180,7 +1300,7 @@
"type": "list",
"default": "FourValues",
"description": "Type of page for page 6",
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","WindRoseFlex","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"category": "OBP60 Page 6",
"capabilities": {
"obp60":"true"
@ -1197,7 +1317,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page6type":"OneValue"},{"page6type":"TwoValues"},{"page6type":"ThreeValues"},{"page6type":"FourValues"},{"page6type":"FourValues2"}]
"condition":[{"page6type":"OneValue"},{"page6type":"TwoValues"},{"page6type":"ThreeValues"},{"page6type":"FourValues"},{"page6type":"FourValues2"},{"page6type":"WindRoseFlex"}]
},
{
"name": "page6value2",
@ -1209,7 +1329,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page6type":"TwoValues"},{"page6type":"ThreeValues"},{"page6type":"FourValues"},{"page6type":"FourValues2"}]
"condition":[{"page6type":"TwoValues"},{"page6type":"ThreeValues"},{"page6type":"FourValues"},{"page6type":"FourValues2"},{"page6type":"WindRoseFlex"}]
},
{
"name": "page6value3",
@ -1221,7 +1341,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page6type":"ThreeValues"},{"page6type":"FourValues"},{"page6type":"FourValues2"}]
"condition":[{"page6type":"ThreeValues"},{"page6type":"FourValues"},{"page6type":"FourValues2"},{"page6type":"WindRoseFlex"}]
},
{
"name": "page6value4",
@ -1233,7 +1353,31 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page6type":"FourValues"},{"page6type":"FourValues2"}]
"condition":[{"page6type":"FourValues"},{"page6type":"FourValues2"},{"page6type":"WindRoseFlex"}]
},
{
"name": "page6value5",
"label": "Field 5",
"type": "boatData",
"default": "",
"description": "The display for field 5",
"category": "OBP60 Page 6",
"capabilities": {
"obp60":"true"
},
"condition":[{"page6type":"WindRoseFlex"}]
},
{
"name": "page6value6",
"label": "Field 6",
"type": "boatData",
"default": "",
"description": "The display for field 6",
"category": "OBP60 Page 6",
"capabilities": {
"obp60":"true"
},
"condition":[{"page6type":"WindRoseFlex"}]
},
{
"name": "page7type",
@ -1241,7 +1385,7 @@
"type": "list",
"default": "FourValues2",
"description": "Type of page for page 7",
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","WindRoseFlex","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"category": "OBP60 Page 7",
"capabilities": {
"obp60":"true"
@ -1258,7 +1402,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page7type":"OneValue"},{"page7type":"TwoValues"},{"page7type":"ThreeValues"},{"page7type":"FourValues"},{"page7type":"FourValues2"}]
"condition":[{"page7type":"OneValue"},{"page7type":"TwoValues"},{"page7type":"ThreeValues"},{"page7type":"FourValues"},{"page7type":"FourValues2"},{"page7type":"WindRoseFlex"}]
},
{
"name": "page7value2",
@ -1270,7 +1414,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page7type":"TwoValues"},{"page7type":"ThreeValues"},{"page7type":"FourValues"},{"page7type":"FourValues2"}]
"condition":[{"page7type":"TwoValues"},{"page7type":"ThreeValues"},{"page7type":"FourValues"},{"page7type":"FourValues2"},{"page7type":"WindRoseFlex"}]
},
{
"name": "page7value3",
@ -1282,7 +1426,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page7type":"ThreeValues"},{"page7type":"FourValues"},{"page7type":"FourValues2"}]
"condition":[{"page7type":"ThreeValues"},{"page7type":"FourValues"},{"page7type":"FourValues2"},{"page7type":"WindRoseFlex"}]
},
{
"name": "page7value4",
@ -1294,7 +1438,31 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page7type":"FourValues"},{"page7type":"FourValues2"}]
"condition":[{"page7type":"FourValues"},{"page7type":"FourValues2"},{"page7type":"WindRoseFlex"}]
},
{
"name": "page7value5",
"label": "Field 5",
"type": "boatData",
"default": "",
"description": "The display for field 5",
"category": "OBP60 Page 7",
"capabilities": {
"obp60":"true"
},
"condition":[{"page7type":"WindRoseFlex"}]
},
{
"name": "page7value6",
"label": "Field 6",
"type": "boatData",
"default": "",
"description": "The display for field 6",
"category": "OBP60 Page 7",
"capabilities": {
"obp60":"true"
},
"condition":[{"page7type":"WindRoseFlex"}]
},
{
"name": "page8type",
@ -1302,7 +1470,7 @@
"type": "list",
"default": "Clock",
"description": "Type of page for page 8",
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","WindRoseFlex","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"category": "OBP60 Page 8",
"capabilities": {
"obp60":"true"
@ -1319,7 +1487,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page8type":"OneValue"},{"page8type":"TwoValues"},{"page8type":"ThreeValues"},{"page8type":"FourValues"},{"page8type":"FourValues2"}]
"condition":[{"page8type":"OneValue"},{"page8type":"TwoValues"},{"page8type":"ThreeValues"},{"page8type":"FourValues"},{"page8type":"FourValues2"},{"page8type":"WindRoseFlex"}]
},
{
"name": "page8value2",
@ -1331,7 +1499,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page8type":"TwoValues"},{"page8type":"ThreeValues"},{"page8type":"FourValues"},{"page8type":"FourValues2"}]
"condition":[{"page8type":"TwoValues"},{"page8type":"ThreeValues"},{"page8type":"FourValues"},{"page8type":"FourValues2"},{"page8type":"WindRoseFlex"}]
},
{
"name": "page8value3",
@ -1343,7 +1511,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page8type":"ThreeValues"},{"page8type":"FourValues"},{"page8type":"FourValues2"}]
"condition":[{"page8type":"ThreeValues"},{"page8type":"FourValues"},{"page8type":"FourValues2"},{"page8type":"WindRoseFlex"}]
},
{
"name": "page8value4",
@ -1355,7 +1523,31 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page8type":"FourValues"},{"page8type":"FourValues2"}]
"condition":[{"page8type":"FourValues"},{"page8type":"FourValues2"},{"page88type":"WindRoseFlex"}]
},
{
"name": "page8value5",
"label": "Field 5",
"type": "boatData",
"default": "",
"description": "The display for field 5",
"category": "OBP60 Page 8",
"capabilities": {
"obp60":"true"
},
"condition":[{"page8type":"WindRoseFlex"}]
},
{
"name": "page8value6",
"label": "Field 6",
"type": "boatData",
"default": "",
"description": "The display for field 6",
"category": "OBP60 Page 8",
"capabilities": {
"obp60":"true"
},
"condition":[{"page8type":"WindRoseFlex"}]
},
{
"name": "page9type",
@ -1363,7 +1555,7 @@
"type": "list",
"default": "RollPitch",
"description": "Type of page for page 9",
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","WindRoseFlex","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"category": "OBP60 Page 9",
"capabilities": {
"obp60":"true"
@ -1380,7 +1572,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page9type":"OneValue"},{"page9type":"TwoValues"},{"page9type":"ThreeValues"},{"page9type":"FourValues"},{"page9type":"FourValues2"}]
"condition":[{"page9type":"OneValue"},{"page9type":"TwoValues"},{"page9type":"ThreeValues"},{"page9type":"FourValues"},{"page9type":"FourValues2"},{"page9type":"WindRoseFlex"}]
},
{
"name": "page9value2",
@ -1392,7 +1584,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page9type":"TwoValues"},{"page9type":"ThreeValues"},{"page9type":"FourValues"},{"page9type":"FourValues2"}]
"condition":[{"page9type":"TwoValues"},{"page9type":"ThreeValues"},{"page9type":"FourValues"},{"page9type":"FourValues2"},{"page9type":"WindRoseFlex"}]
},
{
"name": "page9value3",
@ -1404,7 +1596,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page9type":"ThreeValues"},{"page9type":"FourValues"},{"page9type":"FourValues2"}]
"condition":[{"page9type":"ThreeValues"},{"page9type":"FourValues"},{"page9type":"FourValues2"},{"page9type":"WindRoseFlex"}]
},
{
"name": "page9value4",
@ -1416,7 +1608,31 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page9type":"FourValues"},{"page9type":"FourValues2"}]
"condition":[{"page9type":"FourValues"},{"page9type":"FourValues2"},{"page9type":"WindRoseFlex"}]
},
{
"name": "page9value5",
"label": "Field 5",
"type": "boatData",
"default": "",
"description": "The display for field 5",
"category": "OBP60 Page 9",
"capabilities": {
"obp60":"true"
},
"condition":[{"page9type":"WindRoseFlex"}]
},
{
"name": "page9value6",
"label": "Field 6",
"type": "boatData",
"default": "",
"description": "The display for field 6",
"category": "OBP60 Page 9",
"capabilities": {
"obp60":"true"
},
"condition":[{"page9type":"WindRoseFlex"}]
},
{
"name": "page10type",
@ -1424,7 +1640,7 @@
"type": "list",
"default": "Battery2",
"description": "Type of page for page 10",
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","WindRoseFlex","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"category": "OBP60 Page 10",
"capabilities": {
"obp60":"true"
@ -1441,7 +1657,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page10type":"OneValue"},{"page10type":"TwoValues"},{"page10type":"ThreeValues"},{"page10type":"FourValues"},{"page10type":"FourValues2"}]
"condition":[{"page10type":"OneValue"},{"page10type":"TwoValues"},{"page10type":"ThreeValues"},{"page10type":"FourValues"},{"page10type":"FourValues2"},{"page10type":"WindRoseFlex"}]
},
{
"name": "page10value2",
@ -1453,7 +1669,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page10type":"TwoValues"},{"page10type":"ThreeValues"},{"page10type":"FourValues"},{"page10type":"FourValues2"}]
"condition":[{"page10type":"TwoValues"},{"page10type":"ThreeValues"},{"page10type":"FourValues"},{"page10type":"FourValues2"},{"page10type":"WindRoseFlex"}]
},
{
"name": "page10value3",
@ -1465,7 +1681,7 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page10type":"ThreeValues"},{"page10type":"FourValues"},{"page10type":"FourValues2"}]
"condition":[{"page10type":"ThreeValues"},{"page10type":"FourValues"},{"page10type":"FourValues2"},{"page10type":"WindRoseFlex"}]
},
{
"name": "page10value4",
@ -1477,6 +1693,30 @@
"capabilities": {
"obp60":"true"
},
"condition":[{"page10type":"FourValues"},{"page10type":"FourValues2"}]
}
"condition":[{"page10type":"FourValues"},{"page10type":"FourValues2"},{"page10type":"WindRoseFlex"}]
},
{
"name": "page10value5",
"label": "Field 5",
"type": "boatData",
"default": "",
"description": "The display for field 5",
"category": "OBP60 Page 10",
"capabilities": {
"obp60":"true"
},
"condition":[{"page10type":"WindRoseFlex"}]
},
{
"name": "page10value6",
"label": "Field 6",
"type": "boatData",
"default": "",
"description": "The display for field 6",
"category": "OBP60 Page 10",
"capabilities": {
"obp60":"true"
},
"condition":[{"page10type":"WindRoseFlex"}]
}
]

View File

@ -216,6 +216,8 @@ void registerAllPages(PageList &list){
list.add(&registerPageApparentWind);
extern PageDescription registerPageWindRose;
list.add(&registerPageWindRose);
extern PageDescription registerPageWindRoseFlex;
list.add(&registerPageWindRoseFlex); //
extern PageDescription registerPageVoltage;
list.add(&registerPageVoltage);
extern PageDescription registerPageDST810;

17
notes.txt Normal file
View File

@ -0,0 +1,17 @@
git remote add upstream /url/to/original/repo
git fetch upstream
git checkout master
git reset --hard upstream/master
git push origin master --force
https://github.com/norbert-walter/esp32-nmea2000-obp60
cd /workspace/esp32-nmea2000-obp60
bash /workspace/esp32-nmea2000-obp60/lib/obp60task/run
Page beim OBP60 hinzufügen
1. Page unter /lib/obp60task/PageXXXX.cpp anlegen
2. Alle Page-Namen in PageXXXX.cpp auf den Namen der Datei setzen
3. In /lib/obp60task/obp60task.cpp ab Zeile 242 (registerAllPages) die Seite hinzufügen
4. In /lib/obp60task/config.json für jede Seite den neuen Seitentyp in die Liste aufnehmen.