diff --git a/lib/obp60task/.gitignore b/lib/obp60task/.gitignore new file mode 100644 index 0000000..da719a8 --- /dev/null +++ b/lib/obp60task/.gitignore @@ -0,0 +1,2 @@ +# Linux backup files +*~ diff --git a/lib/obp60task/OBP60Extensions.cpp b/lib/obp60task/OBP60Extensions.cpp index 28ca085..7261e9a 100644 --- a/lib/obp60task/OBP60Extensions.cpp +++ b/lib/obp60task/OBP60Extensions.cpp @@ -14,6 +14,7 @@ // Character sets #include "Ubuntu_Bold8pt7b.h" +#include "Ubuntu_Bold10pt7b.h" #include "Ubuntu_Bold12pt7b.h" #include "Ubuntu_Bold16pt7b.h" #include "Ubuntu_Bold20pt7b.h" diff --git a/lib/obp60task/OBP60Extensions.h b/lib/obp60task/OBP60Extensions.h index 230f1a9..e02cd8b 100644 --- a/lib/obp60task/OBP60Extensions.h +++ b/lib/obp60task/OBP60Extensions.h @@ -11,6 +11,7 @@ // Fonts declarations for display (#inclues see OBP60Extensions.cpp) extern const GFXfont Ubuntu_Bold8pt7b; +extern const GFXfont Ubuntu_Bold10pt7b; extern const GFXfont Ubuntu_Bold12pt7b; extern const GFXfont Ubuntu_Bold16pt7b; extern const GFXfont Ubuntu_Bold20pt7b; diff --git a/lib/obp60task/PageAutobahn.cpp b/lib/obp60task/PageAutobahn.cpp new file mode 100644 index 0000000..46ba7dc --- /dev/null +++ b/lib/obp60task/PageAutobahn.cpp @@ -0,0 +1,235 @@ +#ifdef BOARD_OBP60S3 + +#include "Pagedata.h" +#include "OBP60Extensions.h" + +/* + Autobahn view + XTE - Cross track error + COG - Track / Course over ground + DTW - Distance to waypoint + BTW - Bearing to waypoint +*/ + +#define ship_width 32 +#define ship_height 32 +static unsigned char ship_bits[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x80, 0x03, 0x00, + 0x00, 0xc0, 0x07, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0xe0, 0x0f, 0x00, + 0x00, 0xe0, 0x0f, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0xf0, 0x1f, 0x00, + 0x00, 0xf0, 0x1f, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0xf8, 0x3f, 0x00, + 0x00, 0xf8, 0x3f, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0xf8, 0x3f, 0x00, + 0x00, 0xfc, 0x7f, 0x00, 0x00, 0xfc, 0x7f, 0x00, 0x00, 0xfc, 0x7f, 0x00, + 0x00, 0xfc, 0x7f, 0x00, 0x00, 0xfc, 0x7f, 0x00, 0x00, 0xfc, 0x7f, 0x00, + 0x00, 0xfc, 0x7f, 0x00, 0x00, 0xfc, 0x7f, 0x00, 0x00, 0xf8, 0x3f, 0x00, + 0x00, 0xf8, 0x3f, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0xf8, 0x3f, 0x00, + 0x00, 0xf8, 0x3f, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0xf8, 0x3f, 0x00, + 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +class PageAutobahn : public Page{ + bool keylock = false; // Keylock + + public: + PageAutobahn(CommonData &common){ + common.logger->logDebug(GwLog::LOG,"Show PageAutobahn"); + } + + void drawSegment(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, + uint16_t x2, uint16_t y2, uint16_t x3, uint16_t y3, + uint16_t color, bool fill){ + if (fill == true) { + // no primitive for quadrangular object + // we create it from 2 triangles + getdisplay().fillTriangle(x0, y0, x1, y1, x3, y3, color); + getdisplay().fillTriangle(x1, y1, x2, y2, x3, y3, color); + } else { + // draw outline + getdisplay().drawLine(x0, y0, x1, y1, color); + getdisplay().drawLine(x1, y1, x2, y2, color); + getdisplay().drawLine(x2, y2, x3, y3, color); + getdisplay().drawLine(x3, y3, x0, y0, color); + } + } + + virtual int handleKey(int key){ + 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; + + // Get config data + String flashLED = config->getString(config->flashLED); + String displaycolor = config->getString(config->displaycolor); + String backlightMode = config->getString(config->backlight); + + String trackStep = config->getString(config->trackStep); + double seg_deg = trackStep.toFloat(); // degrees per display segment + + // Optical warning by limit violation (unused) + if(String(flashLED) == "Limit Violation"){ + setBlinkingLED(false); + setFlashLED(false); + } + + // Logging boat values + LOG_DEBUG(GwLog::LOG,"Drawing at PageAutobahn"); + + // 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_WHITE; + pixelcolor = GxEPD_WHITE; + bgcolor = GxEPD_BLACK; + } + // Set display in partial refresh mode + getdisplay().setPartialWindow(0, 0, getdisplay().width(), getdisplay().height()); // Set partial update + + // descriptions + getdisplay().setFont(&Ubuntu_Bold8pt7b); + getdisplay().setCursor(50, 188); + getdisplay().print("Cross-track error"); + getdisplay().setCursor(270, 188); + getdisplay().print("Track"); + getdisplay().setCursor(45, 275); + getdisplay().print("Distance to waypoint"); + getdisplay().setCursor(260, 275); + getdisplay().print("Bearing"); + + // values + getdisplay().setFont(&DSEG7Classic_BoldItalic30pt7b); + + int16_t x, y; + uint16_t w, h; + + GwApi::BoatValue *bv_xte = pageData.values[0]; // XTE + String sval_xte = formatValue(bv_xte, commonData).svalue; + getdisplay().getTextBounds(sval_xte, 0, 0, &x, &y, &w, &h); + getdisplay().setCursor(160-w, 170); + getdisplay().print(sval_xte); + + GwApi::BoatValue *bv_cog = pageData.values[1]; // COG + String sval_cog = formatValue(bv_cog, commonData).svalue; + getdisplay().getTextBounds(sval_cog, 0, 0, &x, &y, &w, &h); + getdisplay().setCursor(360-w, 170); + getdisplay().print(sval_cog); + + GwApi::BoatValue *bv_dtw = pageData.values[2]; // DTW + String sval_dtw = formatValue(bv_dtw, commonData).svalue; + getdisplay().getTextBounds(sval_dtw, 0, 0, &x, &y, &w, &h); + getdisplay().setCursor(160-w, 257); + getdisplay().print(sval_dtw); + + GwApi::BoatValue *bv_btw = pageData.values[3]; // BTW + String sval_btw = formatValue(bv_btw, commonData).svalue; + getdisplay().getTextBounds(sval_btw, 0, 0, &x, &y, &w, &h); + getdisplay().setCursor(360-w, 257); + getdisplay().print(sval_btw); + + // autobahn view + + // draw ship symbol (as bitmap) + getdisplay().drawXBitmap(184, 68, ship_bits, ship_width, ship_height, pixelcolor); + + // draw next waypoint name + String sval_wpname = "Tonne 122"; + getdisplay().setFont(&Ubuntu_Bold10pt7b); + getdisplay().getTextBounds(sval_wpname, 0, 150, &x, &y, &w, &h); + // TODO if text don't fix use smaller font size. + // if smallest size does not fit use 2 lines + // last resort: clip with ellipsis + getdisplay().setCursor(200 - w / 2, 60); + + getdisplay().print(sval_wpname); + + // draw course segments + + double diff = bv_cog->value - bv_btw->value; + if (diff < -180) { + diff += 360; + } else if (diff > 180:) { + diff -= 360 + } + + // default all segments activated + bool seg[6] = {true, true, true, true, true, true}; + // number of inactive segments + int nseg = std::min(std::floor(std::abs(diff) / seg_deg), 5); + + int order[6]; + if (diff < 0) { + // right + order[0] = 6; order[1] = 5; order[2] = 4; + order[3] = 1; order[4] = 2; order[5] = 3; + else if (diff > 0) { + // left + order[0] = 3; order[1] = 2; order[2] = 1; + order[3] = 4; order[4] = 5; order[5] = 6; + } + int i = 0; + while (nseg > 0) { + seg[order[i]] = false; + i += 1; + nseg -= 1; + } + + // left segments + drawSegment(0, 54, 46, 18, 75, 18, 0, 90, pixelcolor, seg[0]); + drawSegment(0, 100, 82, 18, 112, 18, 50, 100, pixelcolor, seg[1]); + drawSegment(60, 100, 117, 18, 147, 18, 110, 100, pixelcolor,seg[2]); + // right segments + drawSegment(399, 54, 354, 18, 325, 18, 399, 90, pixelcolor, seg[3]); + drawSegment(399, 100, 318, 18, 289, 18, 350, 100, pixelcolor, seg[4])); + drawSegment(340, 100, 283, 18, 253, 18, 290, 100, pixelcolor, seg[5]); + + // Key Layout + getdisplay().setFont(&Ubuntu_Bold8pt7b); + if(keylock == false){ + getdisplay().setCursor(130, 296); + getdisplay().print("[ <<<< " + String(commonData.data.actpage) + "/" + String(commonData.data.maxpage) + " >>>> ]"); + if(String(backlightMode) == "Control by Key"){ // Key for illumination + getdisplay().setCursor(343, 296); + getdisplay().print("[ILUM]"); + } + } + else{ + getdisplay().setCursor(130, 296); + getdisplay().print(" [ Keylock active ]"); + } + + // Update display + getdisplay().nextPage(); // Partial update (fast) + + }; +}; + +static Page* createPage(CommonData &common){ + return new PageAutobahn(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 registerPageAutobahn( + "Autobahn", // Page name + createPage, // Action + 0, // Number of bus values depends on selection in Web configuration + {"XTE", "COG", "DTW", "BTW"}, // Bus values we need in the page + true // Show display header on/off +); + +#endif diff --git a/lib/obp60task/Ubuntu_Bold10pt7b.h b/lib/obp60task/Ubuntu_Bold10pt7b.h new file mode 100644 index 0000000..92924ac --- /dev/null +++ b/lib/obp60task/Ubuntu_Bold10pt7b.h @@ -0,0 +1,232 @@ +const uint8_t Ubuntu_Bold10pt7bBitmaps[] PROGMEM = { + 0xFF, 0xFF, 0xFF, 0xE3, 0xFF, 0xC0, 0xEF, 0xDF, 0xBF, 0x7E, 0xFD, 0xC0, + 0x0E, 0xE0, 0xEE, 0x1D, 0xCF, 0xFF, 0xFF, 0xF1, 0xDC, 0x1D, 0xC3, 0xB8, + 0xFF, 0xFF, 0xFF, 0x3B, 0x83, 0xB8, 0x77, 0x07, 0x70, 0x1C, 0x0E, 0x0F, + 0xCF, 0xEE, 0x07, 0x03, 0x81, 0xFC, 0x7F, 0x0F, 0xC0, 0xE0, 0x74, 0x3F, + 0xF9, 0xF8, 0x38, 0x1C, 0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x0E, 0x1C, 0x38, 0x38, 0x70, 0xFF, + 0xFF, 0xFF, 0x0E, 0x3C, 0xF9, 0xC3, 0x87, 0x0E, 0x1C, 0x79, 0xE3, 0xC7, + 0xC3, 0x87, 0x0E, 0x1C, 0x38, 0x7C, 0xF8, 0x70, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xF0, 0xE1, 0xE3, 0xE1, 0xC3, 0x87, 0x0E, 0x1C, 0x3C, + 0x3C, 0x79, 0xF3, 0x87, 0x0E, 0x1C, 0x39, 0xF3, 0xE7, 0x00, 0x30, 0x9F, + 0x3F, 0xFF, 0x3E, 0x43, 0x00 }; + +const GFXglyph Ubuntu_Bold10pt7bGlyphs[] PROGMEM = { + { 0, 0, 0, 5, 0, 1 }, // 0x20 ' ' + { 0, 3, 14, 5, 1, -13 }, // 0x21 '!' + { 6, 7, 6, 9, 1, -14 }, // 0x22 '"' + { 12, 12, 14, 14, 1, -13 }, // 0x23 '#' + { 33, 9, 17, 11, 1, -14 }, // 0x24 '$' + { 53, 16, 14, 18, 1, -13 }, // 0x25 '%' + { 81, 13, 14, 14, 1, -13 }, // 0x26 '&' + { 104, 3, 6, 5, 1, -14 }, // 0x27 ''' + { 107, 6, 20, 7, 1, -15 }, // 0x28 '(' + { 122, 6, 20, 7, 0, -15 }, // 0x29 ')' + { 137, 9, 8, 10, 1, -13 }, // 0x2A '*' + { 146, 11, 11, 13, 1, -11 }, // 0x2B '+' + { 162, 4, 6, 5, 0, -2 }, // 0x2C ',' + { 165, 6, 3, 8, 1, -7 }, // 0x2D '-' + { 168, 4, 4, 6, 1, -3 }, // 0x2E '.' + { 170, 10, 20, 9, -1, -15 }, // 0x2F '/' + { 195, 9, 14, 11, 1, -13 }, // 0x30 '0' + { 211, 7, 14, 11, 1, -13 }, // 0x31 '1' + { 224, 9, 14, 11, 1, -13 }, // 0x32 '2' + { 240, 9, 14, 11, 1, -13 }, // 0x33 '3' + { 256, 9, 14, 11, 1, -13 }, // 0x34 '4' + { 272, 9, 14, 11, 1, -13 }, // 0x35 '5' + { 288, 9, 14, 11, 1, -13 }, // 0x36 '6' + { 304, 9, 14, 11, 1, -13 }, // 0x37 '7' + { 320, 9, 14, 11, 1, -13 }, // 0x38 '8' + { 336, 9, 14, 11, 1, -13 }, // 0x39 '9' + { 352, 4, 11, 6, 1, -10 }, // 0x3A ':' + { 358, 5, 14, 6, 0, -10 }, // 0x3B ';' + { 367, 10, 9, 11, 1, -9 }, // 0x3C '<' + { 379, 9, 8, 11, 1, -9 }, // 0x3D '=' + { 388, 9, 9, 11, 1, -9 }, // 0x3E '>' + { 399, 8, 16, 9, 0, -15 }, // 0x3F '?' + { 415, 17, 17, 19, 1, -13 }, // 0x40 '@' + { 452, 15, 14, 15, 0, -13 }, // 0x41 'A' + { 479, 10, 14, 13, 2, -13 }, // 0x42 'B' + { 497, 11, 14, 13, 1, -13 }, // 0x43 'C' + { 517, 12, 14, 15, 2, -13 }, // 0x44 'D' + { 538, 9, 14, 12, 2, -13 }, // 0x45 'E' + { 554, 8, 14, 11, 2, -13 }, // 0x46 'F' + { 568, 11, 14, 14, 1, -13 }, // 0x47 'G' + { 588, 11, 14, 15, 2, -13 }, // 0x48 'H' + { 608, 3, 14, 7, 2, -13 }, // 0x49 'I' + { 614, 9, 14, 11, 0, -13 }, // 0x4A 'J' + { 630, 12, 14, 14, 2, -13 }, // 0x4B 'K' + { 651, 9, 14, 11, 2, -13 }, // 0x4C 'L' + { 667, 15, 14, 17, 1, -13 }, // 0x4D 'M' + { 694, 11, 14, 15, 2, -13 }, // 0x4E 'N' + { 714, 14, 14, 16, 1, -13 }, // 0x4F 'O' + { 739, 10, 14, 13, 2, -13 }, // 0x50 'P' + { 757, 14, 17, 16, 1, -13 }, // 0x51 'Q' + { 787, 11, 14, 13, 2, -13 }, // 0x52 'R' + { 807, 10, 14, 12, 1, -13 }, // 0x53 'S' + { 825, 11, 14, 11, 0, -13 }, // 0x54 'T' + { 845, 11, 14, 15, 2, -13 }, // 0x55 'U' + { 865, 15, 14, 15, 0, -13 }, // 0x56 'V' + { 892, 19, 14, 19, 0, -13 }, // 0x57 'W' + { 926, 14, 14, 14, 0, -13 }, // 0x58 'X' + { 951, 13, 14, 13, 0, -13 }, // 0x59 'Y' + { 974, 10, 14, 12, 1, -13 }, // 0x5A 'Z' + { 992, 5, 20, 7, 2, -15 }, // 0x5B '[' + { 1005, 10, 20, 9, -1, -15 }, // 0x5C '\' + { 1030, 5, 20, 7, 0, -15 }, // 0x5D ']' + { 1043, 11, 8, 11, 0, -13 }, // 0x5E '^' + { 1054, 10, 2, 10, 0, 3 }, // 0x5F '_' + { 1057, 5, 4, 6, 1, -15 }, // 0x60 '`' + { 1060, 9, 11, 11, 1, -10 }, // 0x61 'a' + { 1073, 10, 16, 12, 1, -15 }, // 0x62 'b' + { 1093, 8, 11, 10, 1, -10 }, // 0x63 'c' + { 1104, 10, 16, 12, 1, -15 }, // 0x64 'd' + { 1124, 10, 11, 12, 1, -10 }, // 0x65 'e' + { 1138, 8, 16, 8, 1, -15 }, // 0x66 'f' + { 1154, 10, 15, 12, 1, -10 }, // 0x67 'g' + { 1173, 10, 16, 12, 1, -15 }, // 0x68 'h' + { 1193, 3, 16, 5, 1, -15 }, // 0x69 'i' + { 1199, 6, 20, 5, -2, -15 }, // 0x6A 'j' + { 1214, 11, 16, 12, 1, -15 }, // 0x6B 'k' + { 1236, 5, 16, 6, 1, -15 }, // 0x6C 'l' + { 1246, 15, 11, 17, 1, -10 }, // 0x6D 'm' + { 1267, 10, 11, 12, 1, -10 }, // 0x6E 'n' + { 1281, 10, 11, 12, 1, -10 }, // 0x6F 'o' + { 1295, 10, 15, 12, 1, -10 }, // 0x70 'p' + { 1314, 10, 15, 12, 1, -10 }, // 0x71 'q' + { 1333, 7, 11, 8, 1, -10 }, // 0x72 'r' + { 1343, 8, 11, 10, 1, -10 }, // 0x73 's' + { 1354, 7, 14, 9, 1, -13 }, // 0x74 't' + { 1367, 10, 11, 12, 1, -10 }, // 0x75 'u' + { 1381, 11, 11, 11, 0, -10 }, // 0x76 'v' + { 1397, 15, 11, 15, 0, -10 }, // 0x77 'w' + { 1418, 11, 11, 11, 0, -10 }, // 0x78 'x' + { 1434, 11, 15, 11, 0, -10 }, // 0x79 'y' + { 1455, 8, 11, 10, 1, -10 }, // 0x7A 'z' + { 1466, 7, 20, 8, 1, -15 }, // 0x7B '{' + { 1484, 3, 20, 7, 2, -15 }, // 0x7C '|' + { 1492, 7, 20, 8, 0, -15 }, // 0x7D '}' + { 1510, 10, 5, 11, 1, -8 } }; // 0x7E '~' + +const GFXfont Ubuntu_Bold10pt7b PROGMEM = { + (uint8_t *)Ubuntu_Bold10pt7bBitmaps, + (GFXglyph *)Ubuntu_Bold10pt7bGlyphs, + 0x20, 0x7E, 23 }; + +// Approx. 2189 bytes diff --git a/lib/obp60task/config.json b/lib/obp60task/config.json index 49484de..1639008 100644 --- a/lib/obp60task/config.json +++ b/lib/obp60task/config.json @@ -166,6 +166,20 @@ "obp60":"true" } }, + { + "name": "trackStep", + "label": "angle [deg]", + "type": "number", + "default": "3.0", + "check": "checkMinMax", + "min": 1.0, + "max": 12.0, + "description": "track step offset [1...12deg]", + "category": "OBP60 Settings", + "capabilities": { + "obp60":"true" + } + }, { "name": "lengthFormat", "label": "Length Format", @@ -876,7 +890,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","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator","Autobahn"], "category": "OBP60 Page 1", "capabilities": { "obp60":"true" @@ -936,7 +950,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","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator","Autobahn"], "category": "OBP60 Page 2", "capabilities": { "obp60":"true" @@ -997,7 +1011,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","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator","Autobahn"], "category": "OBP60 Page 3", "capabilities": { "obp60":"true" @@ -1058,7 +1072,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","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator","Autobahn"], "category": "OBP60 Page 4", "capabilities": { "obp60":"true" @@ -1119,7 +1133,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","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator","Autobahn"], "category": "OBP60 Page 5", "capabilities": { "obp60":"true" @@ -1180,7 +1194,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","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator","Autobahn"], "category": "OBP60 Page 6", "capabilities": { "obp60":"true" @@ -1241,7 +1255,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","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator","Autobahn"], "category": "OBP60 Page 7", "capabilities": { "obp60":"true" @@ -1302,7 +1316,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","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator","Autobahn"], "category": "OBP60 Page 8", "capabilities": { "obp60":"true" @@ -1363,7 +1377,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","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator","Autobahn"], "category": "OBP60 Page 9", "capabilities": { "obp60":"true" @@ -1424,7 +1438,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","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator","Autobahn"], "category": "OBP60 Page 10", "capabilities": { "obp60":"true" diff --git a/lib/obp60task/obp60task.cpp b/lib/obp60task/obp60task.cpp index d6691b1..62714eb 100644 --- a/lib/obp60task/obp60task.cpp +++ b/lib/obp60task/obp60task.cpp @@ -240,6 +240,8 @@ void registerAllPages(PageList &list){ list.add(®isterPageSolar); extern PageDescription registerPageGenerator; list.add(®isterPageGenerator); + extern PageDescription registerPageAutobahn; + list.add(®isterPageAutobahn); } // Undervoltage detection for shutdown display