diff --git a/lib/obp60task/PageTracker.cpp b/lib/obp60task/PageTracker.cpp index 3bd15cf..031aae1 100644 --- a/lib/obp60task/PageTracker.cpp +++ b/lib/obp60task/PageTracker.cpp @@ -6,6 +6,20 @@ - standalone with SD card backend - standalone with server backend - Regatta Hero integration + + In start phase big timer. + Eventually after start other display because timer not needed any + more. Race timer smaller on top right corner. Reserved space for + message area. + + 4 Positions for flags + +-----+-----+ + | 1 | 2 | + +-----+-----+ + | 3 | 4 | + +-----+-----+ + + */ #include "Pagedata.h" @@ -25,6 +39,7 @@ #include "images/orange.xbm" #include "images/papa.xbm" #include "images/repeat_one.xbm" +#include "images/sierra.xbm" #include "images/start.xbm" #include "images/uniform.xbm" #include "images/xray.xbm" @@ -36,25 +51,33 @@ class PageTracker : public Page private: char mode = 'N'; // (N)ormal, (C)onfig bool simulation = false; - String trackerType; String flashLED; + String trackerType; + String trackerOrganisation; + String trackerTeam; + String sailClub; + String boatName; + String boatClass; + String boatSailNumber; + float boatHandicap; + void displayModeNormal(PageData &pageData) { // TBD Boatvalues: ... // Title - getdisplay().setTextColor(commonData->fgcolor); +/* getdisplay().setTextColor(commonData->fgcolor); getdisplay().setFont(&Ubuntu_Bold12pt8b); getdisplay().setCursor(8, 48); - getdisplay().print("Tracker"); + getdisplay().print("Tracker"); */ getdisplay().setFont(&Ubuntu_Bold8pt8b); - getdisplay().setCursor(8, 64); + getdisplay().setCursor(8, 42); if (trackerType == "NONE") { - getdisplay().printf("Disabled. Use Web-GUI to enable."); + getdisplay().print("Disabled!"); } else { - getdisplay().printf("Type: %s", trackerType); + getdisplay().print(trackerType); } // Timer @@ -77,25 +100,64 @@ private: getdisplay().setTextColor(commonData->fgcolor); getdisplay().setFont(&Ubuntu_Bold12pt8b); - getdisplay().setCursor(8, 48); + getdisplay().setCursor(8, 42); getdisplay().print("Tracker configuration"); getdisplay().setFont(&Ubuntu_Bold8pt8b); // TODO - uint16_t y = 64; - getdisplay().setCursor(8, y); + // Boat data + uint16_t y = 80; + uint16_t x = 16; + uint16_t x1 = 100; + getdisplay().setFont(&Ubuntu_Bold10pt8b); + getdisplay().setCursor(8, 64); + getdisplay().print("Boat data"); + + getdisplay().setFont(&Ubuntu_Bold8pt8b); + getdisplay().setCursor(x, y); getdisplay().print("Boat name"); - getdisplay().setCursor(8, y+20); + getdisplay().setCursor(x1, y); + getdisplay().print(boatName); + + getdisplay().setCursor(x, y+20); getdisplay().print("Boat class"); - getdisplay().setCursor(8, y+40); + getdisplay().setCursor(x1, y+20); + getdisplay().print(boatClass); + + getdisplay().setCursor(x, y+40); getdisplay().print("Handicap"); - getdisplay().setCursor(8, y+60); + getdisplay().setCursor(x1, y+40); + getdisplay().print(boatHandicap, 1); + + getdisplay().setCursor(x, y+60); + getdisplay().print("Sail club"); + getdisplay().setCursor(x1, y+60); + getdisplay().print(sailClub); + + // Tracker data + y = 80; + x = 208; + getdisplay().setFont(&Ubuntu_Bold10pt8b); + getdisplay().setCursor(x, 64); + getdisplay().print("Tracker info"); + + getdisplay().setFont(&Ubuntu_Bold8pt8b); + getdisplay().setCursor(x, y); + if (trackerType == "NONE") { + getdisplay().print("Disabled"); + } else { + getdisplay().printf("Type: %s", trackerType); + } + getdisplay().setCursor(x, y + 20); getdisplay().print("Team"); + getdisplay().setCursor(x, y + 40); + getdisplay().print("Tracker organisation"); - - y = 64; - getdisplay().setCursor(208, y); + // Ragatta selection + y = 200; + getdisplay().setFont(&Ubuntu_Bold10pt8b); + getdisplay().setCursor(x, y); getdisplay().print("Regattas"); // A) Regatta Hero: @@ -119,7 +181,17 @@ public: common.logger->logDebug(GwLog::LOG, "Instantiate PageTracker"); flashLED = common.config->getString(common.config->flashLED); simulation = common.config->getBool(common.config->useSimuData); + trackerType = common.config->getString(common.config->trackerType); + trackerOrganisation = common.config->getString(common.config->trackerOrg); + trackerTeam = common.config->getString(common.config->trackerTeam); + + boatName = common.config->getString(common.config->boatName); + boatClass = common.config->getString(common.config->boatClass); + boatSailNumber = common.config->getString(common.config->boatSailnumber); + sailClub = common.config->getString(common.config->sailClub); + boatHandicap = common.config->getString(common.config->boatHandicap).toFloat(); + } void setupKeys(){ diff --git a/lib/obp60task/config_obp40.json b/lib/obp60task/config_obp40.json index 7c30863..e0aafff 100644 --- a/lib/obp60task/config_obp40.json +++ b/lib/obp60task/config_obp40.json @@ -61,20 +61,6 @@ "obp40": "true" } }, - { - "name": "draft", - "label": "Boat Draft [m]", - "type": "number", - "default": "0.00", - "check": "checkMinMax", - "min": 0.00, - "max": 50.00, - "description": "The draft of the boat [0...50m]", - "category": "OBP40 Settings", - "capabilities": { - "obp40": "true" - } - }, { "name": "fuelTank", "label": "Fuel Tank [l]", @@ -1351,6 +1337,111 @@ "obp40":"true" } }, + { + "name": "trackerOrg", + "label": "Tracker: Organisation", + "type": "string", + "default": "", + "description": "Regatta organisation for regatta login (gotten from race officer)", + "category": "OBP40 Settings", + "capabilities": { + "obp40":"true" + } + }, + { + "name": "trackerPasscode", + "label": "Tracker: Passcode", + "type": "password", + "default": "123456", + "description": "Passcode for regatta login (gotten from race officer)", + "category": "OBP40 Settings", + "capabilities": { + "obp40":"true" + } + }, + { + "name": "trackerTeam", + "label": "Tracker: Team", + "type": "string", + "default": "OBP", + "description": "Your regatta team you belong to", + "category": "OBP40 Settings", + "capabilities": { + "obp40":"true" + } + }, + { + "name": "boatName", + "label": "Boat Name", + "type": "string", + "default": "OBP", + "description": "The name of your boat. E.g. to be displayed in regatta", + "category": "OBP40 Boatdata", + "capabilities": { + "obp40":"true" + } + }, + { + "name": "sailClub", + "label": "Sail Club", + "type": "string", + "default": "", + "description": "The short name of sail club. E.g. to be displayed in regatta", + "category": "OBP40 Boatdata", + "capabilities": { + "obp40":"true" + } + }, + { + "name": "boatClass", + "label": "Boat class", + "type": "string", + "default": "OBP", + "description": "Class name of your boat if available or 'One off'", + "category": "OBP40 Boatdata", + "capabilities": { + "obp40":"true" + } + }, + { + "name": "boatSailnumber", + "label": "Sail number", + "type": "string", + "default": "", + "description": "Identification number on sail", + "category": "OBP40 Boatdata", + "capabilities": { + "obp40":"true" + } + }, + { + "name": "boatHandicap", + "label": "Handicap value", + "type": "number", + "default": "100", + "check": "checkMinMax", + "min": 0.00, + "max": 9999.00, + "description": " The handicap value of your boat. E.g. yardstick value", + "category": "OBP40 Boatdata", + "capabilities": { + "obp40":"true" + } + }, + { + "name": "draft", + "label": "Boat Draft [m]", + "type": "number", + "default": "0.00", + "check": "checkMinMax", + "min": 0.00, + "max": 50.00, + "description": "The draft of the boat [0...50m]", + "category": "OBP40 Boatdata", + "capabilities": { + "obp40": "true" + } + }, { "name": "page1type", "label": "Type", diff --git a/lib/obp60task/images/sierra.xbm b/lib/obp60task/images/sierra.xbm new file mode 100644 index 0000000..265b27e --- /dev/null +++ b/lib/obp60task/images/sierra.xbm @@ -0,0 +1,68 @@ +#pragma once +#define sierra_width 96 +#define sierra_height 64 +static unsigned char sierra_bits[] PROGMEM = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, + 0x03, 0x00, 0x50, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0xc0, + 0x03, 0x00, 0xe8, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0x0e, 0x00, 0xc0, + 0x03, 0x00, 0x50, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0xc0, + 0x03, 0x00, 0xb8, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0x1b, 0x00, 0xc0, + 0x03, 0x00, 0x50, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0xc0, + 0x03, 0x00, 0xe8, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0x0e, 0x00, 0xc0, + 0x03, 0x00, 0x50, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0xc0, + 0x03, 0x00, 0xb8, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0x1b, 0x00, 0xc0, + 0x03, 0x00, 0x50, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0xc0, + 0x03, 0x00, 0xe8, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0x0e, 0x00, 0xc0, + 0x03, 0x00, 0x50, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0xc0, + 0x03, 0x00, 0xb8, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0x1b, 0x00, 0xc0, + 0x03, 0x00, 0x50, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0xc0, + 0x03, 0x00, 0xe8, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0x0e, 0x00, 0xc0, + 0x03, 0x00, 0x50, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0xc0, + 0x03, 0x00, 0xb8, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0x1b, 0x00, 0xc0, + 0x03, 0x00, 0x50, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0xc0, + 0x03, 0x00, 0xe8, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0x0e, 0x00, 0xc0, + 0x03, 0x00, 0x50, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0xc0, + 0x03, 0x00, 0xb8, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0x1b, 0x00, 0xc0, + 0x03, 0x00, 0x50, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0xc0, + 0x03, 0x00, 0xe8, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0x0e, 0x00, 0xc0, + 0x03, 0x00, 0x50, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0xc0, + 0x03, 0x00, 0xb8, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0x1b, 0x00, 0xc0, + 0x03, 0x00, 0x50, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0xc0, + 0x03, 0x00, 0xe8, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0x0e, 0x00, 0xc0, + 0x03, 0x00, 0x50, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0xc0, + 0x03, 0x00, 0xb8, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0x1b, 0x00, 0xc0, + 0x03, 0x00, 0x50, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0xc0, + 0x03, 0x00, 0xe8, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0x0e, 0x00, 0xc0, + 0x03, 0x00, 0x50, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0xc0, + 0x03, 0x00, 0xb8, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0x1b, 0x00, 0xc0, + 0x03, 0x00, 0x50, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0xc0, + 0x03, 0x00, 0xe8, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0x0e, 0x00, 0xc0, + 0x03, 0x00, 0x50, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0xc0, + 0x03, 0x00, 0xb8, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0x1b, 0x00, 0xc0, + 0x03, 0x00, 0x50, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0xc0, + 0x03, 0x00, 0xe8, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0x0e, 0x00, 0xc0, + 0x03, 0x00, 0x50, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0xc0, + 0x03, 0x00, 0xb8, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0x1b, 0x00, 0xc0, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };