Move things to pagedata
This commit is contained in:
parent
15ca3614ba
commit
35c89dce42
|
@ -19,8 +19,6 @@
|
||||||
class PageAIS : public Page
|
class PageAIS : public Page
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
GwConfigHandler *config;
|
|
||||||
GwLog *logger;
|
|
||||||
bool simulation = false;
|
bool simulation = false;
|
||||||
bool holdvalues = false;
|
bool holdvalues = false;
|
||||||
String flashLED;
|
String flashLED;
|
||||||
|
@ -38,7 +36,7 @@ private:
|
||||||
|
|
||||||
// TBD Boatvalues: ...
|
// TBD Boatvalues: ...
|
||||||
|
|
||||||
LOG_DEBUG(GwLog::DEBUG,"Drawing at PageAIS");
|
logger->logDebug(GwLog::DEBUG,"Drawing at PageAIS");
|
||||||
|
|
||||||
Point c = {200, 150}; // center = current boat position
|
Point c = {200, 150}; // center = current boat position
|
||||||
uint16_t r = 125;
|
uint16_t r = 125;
|
||||||
|
@ -84,11 +82,8 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PageAIS(CommonData &common)
|
PageAIS(CommonData &common) : Page(common)
|
||||||
{
|
{
|
||||||
commonData = &common;
|
|
||||||
config = commonData->config;
|
|
||||||
logger = commonData->logger;
|
|
||||||
logger->logDebug(GwLog::LOG, "Instantiate PageAIS");
|
logger->logDebug(GwLog::LOG, "Instantiate PageAIS");
|
||||||
|
|
||||||
// preload configuration data
|
// preload configuration data
|
||||||
|
@ -148,7 +143,7 @@ public:
|
||||||
int displayPage(PageData &pageData){
|
int displayPage(PageData &pageData){
|
||||||
|
|
||||||
// Logging boat values
|
// Logging boat values
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageAIS; Mode=%c", mode);
|
logger->logDebug(GwLog::LOG, "Drawing at PageAIS; Mode=%c", mode);
|
||||||
|
|
||||||
// Set display in partial refresh mode
|
// Set display in partial refresh mode
|
||||||
epd->setPartialWindow(0, 0, epd->width(), epd->height());
|
epd->setPartialWindow(0, 0, epd->width(), epd->height());
|
||||||
|
|
|
@ -100,7 +100,7 @@ private:
|
||||||
String sval_hdop = formatValue(bv_hdop, *commonData).svalue;
|
String sval_hdop = formatValue(bv_hdop, *commonData).svalue;
|
||||||
String sunit_hdop = formatValue(bv_hdop, *commonData).unit;
|
String sunit_hdop = formatValue(bv_hdop, *commonData).unit;
|
||||||
|
|
||||||
LOG_DEBUG(GwLog::DEBUG,"Drawing at PageAnchor; DBS=%f, HDT=%f, AWS=%f", bv_dbs->value, bv_hdt->value, bv_aws->value);
|
logger->logDebug(GwLog::DEBUG, "Drawing at PageAnchor; DBS=%f, HDT=%f, AWS=%f", bv_dbs->value, bv_hdt->value, bv_aws->value);
|
||||||
|
|
||||||
Point c = {200, 150}; // center = anchor position
|
Point c = {200, 150}; // center = anchor position
|
||||||
uint16_t r = 125;
|
uint16_t r = 125;
|
||||||
|
@ -196,7 +196,7 @@ private:
|
||||||
// alarm range in meter has to be smaller than the scale in meter
|
// alarm range in meter has to be smaller than the scale in meter
|
||||||
// r and r_range are pixel values
|
// r and r_range are pixel values
|
||||||
uint16_t r_range = int(alarm_range * r / scale);
|
uint16_t r_range = int(alarm_range * r / scale);
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageAnchor; Alarm range = %d", r_range);
|
logger->logDebug(GwLog::LOG, "Drawing at PageAnchor; Alarm range = %d", r_range);
|
||||||
epd->drawCircle(c.x, c.y, r_range, commonData->fgcolor);
|
epd->drawCircle(c.x, c.y, r_range, commonData->fgcolor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ private:
|
||||||
for (int i = 0 ; i < menu->getItemCount(); i++) {
|
for (int i = 0 ; i < menu->getItemCount(); i++) {
|
||||||
ConfigMenuItem *itm = menu->getItemByIndex(i);
|
ConfigMenuItem *itm = menu->getItemByIndex(i);
|
||||||
if (!itm) {
|
if (!itm) {
|
||||||
LOG_DEBUG(GwLog::ERROR, "Menu item not found: %d", i);
|
logger->logDebug(GwLog::ERROR, "Menu item not found: %d", i);
|
||||||
} else {
|
} else {
|
||||||
Rect r = menu->getItemRect(i);
|
Rect r = menu->getItemRect(i);
|
||||||
bool inverted = (i == menu->getActiveIndex());
|
bool inverted = (i == menu->getActiveIndex());
|
||||||
|
@ -244,11 +244,8 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PageAnchor(CommonData &common)
|
PageAnchor(CommonData &common) : Page(common)
|
||||||
{
|
{
|
||||||
commonData = &common;
|
|
||||||
config = commonData->config;
|
|
||||||
logger = commonData->logger;
|
|
||||||
logger->logDebug(GwLog::LOG, "Instantiate PageAnchor");
|
logger->logDebug(GwLog::LOG, "Instantiate PageAnchor");
|
||||||
|
|
||||||
// preload configuration data
|
// preload configuration data
|
||||||
|
@ -397,7 +394,7 @@ public:
|
||||||
int displayPage(PageData &pageData){
|
int displayPage(PageData &pageData){
|
||||||
|
|
||||||
// Logging boat values
|
// Logging boat values
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageAnchor; Mode=%c", mode);
|
logger->logDebug(GwLog::LOG, "Drawing at PageAnchor; Mode=%c", mode);
|
||||||
|
|
||||||
// Set display in partial refresh mode
|
// Set display in partial refresh mode
|
||||||
epd->setPartialWindow(0, 0, epd->width(), epd->height()); // Set partial update
|
epd->setPartialWindow(0, 0, epd->width(), epd->height()); // Set partial update
|
||||||
|
|
|
@ -25,7 +25,7 @@ private:
|
||||||
|
|
||||||
// TBD Boatvalues: ...
|
// TBD Boatvalues: ...
|
||||||
|
|
||||||
LOG_DEBUG(GwLog::DEBUG,"Drawing at PageAutopilot");
|
logger->logDebug(GwLog::DEBUG, "Drawing at PageAutopilot");
|
||||||
|
|
||||||
// Title and corner value headings
|
// Title and corner value headings
|
||||||
epd->setTextColor(commonData->fgcolor);
|
epd->setTextColor(commonData->fgcolor);
|
||||||
|
@ -48,11 +48,8 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PageAutopilot(CommonData &common)
|
PageAutopilot(CommonData &common) : Page(common)
|
||||||
{
|
{
|
||||||
commonData = &common;
|
|
||||||
config = commonData->config;
|
|
||||||
logger = commonData->logger;
|
|
||||||
logger->logDebug(GwLog::LOG, "Instantiate PageAutopilot");
|
logger->logDebug(GwLog::LOG, "Instantiate PageAutopilot");
|
||||||
|
|
||||||
// preload configuration data
|
// preload configuration data
|
||||||
|
@ -111,7 +108,7 @@ public:
|
||||||
int displayPage(PageData &pageData){
|
int displayPage(PageData &pageData){
|
||||||
|
|
||||||
// Logging boat values
|
// Logging boat values
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageAutopilot; Mode=%c", mode);
|
logger->logDebug(GwLog::LOG, "Drawing at PageAutopilot; Mode=%c", mode);
|
||||||
|
|
||||||
// Set display in partial refresh mode
|
// Set display in partial refresh mode
|
||||||
epd->setPartialWindow(0, 0, epd->width(), epd->height());
|
epd->setPartialWindow(0, 0, epd->width(), epd->height());
|
||||||
|
|
|
@ -7,9 +7,9 @@
|
||||||
class PageBME280 : public Page
|
class PageBME280 : public Page
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PageBME280(CommonData &common){
|
PageBME280(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageBME280");
|
logger->logDebug(GwLog::LOG, "Instantiate PageBME280");
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int handleKey(int key){
|
virtual int handleKey(int key){
|
||||||
|
@ -100,7 +100,7 @@ class PageBME280 : public Page
|
||||||
}
|
}
|
||||||
|
|
||||||
// Logging boat values
|
// Logging boat values
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageBME280, %s: %f, %s: %f, %s: %f", name1.c_str(), value1, name2.c_str(), value2, name3.c_str(), value3);
|
logger->logDebug(GwLog::LOG, "Drawing at PageBME280, %s: %f, %s: %f, %s: %f", name1.c_str(), value1, name2.c_str(), value2, name3.c_str(), value3);
|
||||||
|
|
||||||
// Draw page
|
// Draw page
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
|
|
@ -9,9 +9,9 @@ class PageBattery : public Page
|
||||||
int average = 0; // Average type [0...3], 0=off, 1=10s, 2=60s, 3=300s
|
int average = 0; // Average type [0...3], 0=off, 1=10s, 2=60s, 3=300s
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PageBattery(CommonData &common){
|
PageBattery(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageBattery");
|
logger->logDebug(GwLog::LOG, "Instantiate PageBattery");
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void setupKeys(){
|
virtual void setupKeys(){
|
||||||
|
@ -36,8 +36,6 @@ class PageBattery : public Page
|
||||||
}
|
}
|
||||||
|
|
||||||
int displayPage(PageData &pageData){
|
int displayPage(PageData &pageData){
|
||||||
GwConfigHandler *config = commonData->config;
|
|
||||||
GwLog *logger = commonData->logger;
|
|
||||||
|
|
||||||
// Old values for hold function
|
// Old values for hold function
|
||||||
double value1 = 0;
|
double value1 = 0;
|
||||||
|
@ -153,7 +151,7 @@ class PageBattery : public Page
|
||||||
}
|
}
|
||||||
|
|
||||||
// Logging boat values
|
// Logging boat values
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageBattery, %s: %f, %s: %f, %s: %f, Avg: %d", name1.c_str(), value1, name2.c_str(), value2, name3.c_str(), value3, average);
|
logger->logDebug(GwLog::LOG, "Drawing at PageBattery, %s: %f, %s: %f, %s: %f, Avg: %d", name1.c_str(), value1, name2.c_str(), value2, name3.c_str(), value3, average);
|
||||||
|
|
||||||
// Draw page
|
// Draw page
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
|
|
@ -13,9 +13,9 @@ bool trend = true; // Trend indicator [0|1], 0=off, 1=on
|
||||||
double raw = 0;
|
double raw = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PageBattery2(CommonData &common){
|
PageBattery2(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageBattery2");
|
logger->logDebug(GwLog::LOG, "Instantiate PageBattery2");
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void setupKeys(){
|
virtual void setupKeys(){
|
||||||
|
@ -47,9 +47,6 @@ public:
|
||||||
|
|
||||||
int displayPage(PageData &pageData)
|
int displayPage(PageData &pageData)
|
||||||
{
|
{
|
||||||
GwConfigHandler *config = commonData->config;
|
|
||||||
GwLog *logger = commonData->logger;
|
|
||||||
|
|
||||||
// Polynominal coefficients second order for battery energy level calculation
|
// Polynominal coefficients second order for battery energy level calculation
|
||||||
// index 0 = Pb, 1 = Gel, 2 = AGM, 3 = LiFePo4
|
// index 0 = Pb, 1 = Gel, 2 = AGM, 3 = LiFePo4
|
||||||
float x0[4] = {+3082.5178, +1656.1571, +1316.8766, +14986.9336}; // Offset
|
float x0[4] = {+3082.5178, +1656.1571, +1316.8766, +14986.9336}; // Offset
|
||||||
|
@ -179,7 +176,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Logging voltage value
|
// Logging voltage value
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageBattery2, Type:%s %s:=%f", batType.c_str(), name1.c_str(), raw);
|
logger->logDebug(GwLog::LOG, "Drawing at PageBattery2, Type:%s %s:=%f", batType.c_str(), name1.c_str(), raw);
|
||||||
|
|
||||||
// Draw page
|
// Draw page
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
|
|
@ -29,22 +29,22 @@ double homelon;
|
||||||
bool homevalid = false; // homelat and homelon are valid
|
bool homevalid = false; // homelat and homelon are valid
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PageClock(CommonData &common){
|
PageClock(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageClock");
|
logger->logDebug(GwLog::LOG, "Instantiate PageClock");
|
||||||
|
|
||||||
// WIP time source
|
// WIP time source
|
||||||
#ifdef BOARD_OBP60S3
|
#ifdef BOARD_OBP60S3
|
||||||
String use_rtc = common.config->getString(common.config->useRTC);
|
String use_rtc = config->getString(config->useRTC);
|
||||||
if (use_rtc == "off") {
|
if (use_rtc == "off") {
|
||||||
source = 'G';
|
source = 'G';
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
simulation = common.config->getBool(common.config->useSimuData);
|
simulation = config->getBool(config->useSimuData);
|
||||||
timezone = common.config->getString(common.config->timeZone).toDouble();
|
timezone = config->getString(config->timeZone).toDouble();
|
||||||
homelat = common.config->getString(common.config->homeLAT).toDouble();
|
homelat = config->getString(config->homeLAT).toDouble();
|
||||||
homelon = common.config->getString(common.config->homeLON).toDouble();
|
homelon = config->getString(config->homeLON).toDouble();
|
||||||
homevalid = homelat >= -180.0 and homelat <= 180 and homelon >= -90.0 and homelon <= 90.0;
|
homevalid = homelat >= -180.0 and homelat <= 180 and homelon >= -90.0 and homelon <= 90.0;
|
||||||
simtime = 38160; // time value 11:36
|
simtime = 38160; // time value 11:36
|
||||||
}
|
}
|
||||||
|
@ -97,9 +97,6 @@ bool homevalid = false; // homelat and homelon are valid
|
||||||
|
|
||||||
int displayPage(PageData &pageData)
|
int displayPage(PageData &pageData)
|
||||||
{
|
{
|
||||||
GwConfigHandler *config = commonData->config;
|
|
||||||
GwLog *logger = commonData->logger;
|
|
||||||
|
|
||||||
static String svalue1old = "";
|
static String svalue1old = "";
|
||||||
static String unit1old = "";
|
static String unit1old = "";
|
||||||
static String svalue2old = "";
|
static String svalue2old = "";
|
||||||
|
@ -177,7 +174,7 @@ bool homevalid = false; // homelat and homelon are valid
|
||||||
|
|
||||||
// Logging boat values
|
// Logging boat values
|
||||||
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
|
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageClock, %s:%f, %s:%f, %s:%f", name1.c_str(), value1, name2.c_str(), value2, name3.c_str(), value3);
|
logger->logDebug(GwLog::LOG, "Drawing at PageClock, %s:%f, %s:%f, %s:%f", name1.c_str(), value1, name2.c_str(), value2, name3.c_str(), value3);
|
||||||
|
|
||||||
// Draw page
|
// Draw page
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
@ -394,7 +391,7 @@ bool homevalid = false; // homelat and homelon are valid
|
||||||
if (hour > 12) {
|
if (hour > 12) {
|
||||||
hour -= 12.0;
|
hour -= 12.0;
|
||||||
}
|
}
|
||||||
LOG_DEBUG(GwLog::DEBUG,"... PageClock, value1: %f hour: %f minute:%f", value1, hour, minute);
|
logger->logDebug(GwLog::DEBUG, "... PageClock, value1: %f hour: %f minute:%f", value1, hour, minute);
|
||||||
|
|
||||||
// Draw hour pointer
|
// Draw hour pointer
|
||||||
float startwidth = 8; // Start width of pointer
|
float startwidth = 8; // Start width of pointer
|
||||||
|
|
|
@ -29,9 +29,9 @@ class PageCompass : public Page
|
||||||
int WhichDataDisplay = ShowHDM;
|
int WhichDataDisplay = ShowHDM;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PageCompass(CommonData &common){
|
PageCompass(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageCompass");
|
logger->logDebug(GwLog::LOG, "Instantiate PageCompass");
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void setupKeys(){
|
virtual void setupKeys(){
|
||||||
|
@ -63,8 +63,6 @@ class PageCompass : public Page
|
||||||
}
|
}
|
||||||
|
|
||||||
int displayPage(PageData &pageData){
|
int displayPage(PageData &pageData){
|
||||||
GwConfigHandler *config = commonData->config;
|
|
||||||
GwLog *logger = commonData->logger;
|
|
||||||
|
|
||||||
// Old values for hold function
|
// Old values for hold function
|
||||||
static String OldDataText[HowManyValues] = {"", "", "","", "", ""};
|
static String OldDataText[HowManyValues] = {"", "", "","", "", ""};
|
||||||
|
@ -96,7 +94,7 @@ class PageCompass : public Page
|
||||||
DataValue[i] = TheFormattedData.value; // Value as double in SI unit
|
DataValue[i] = TheFormattedData.value; // Value as double in SI unit
|
||||||
DataValid[i] = bvalue->valid;
|
DataValid[i] = bvalue->valid;
|
||||||
DataFormat[i] = bvalue->getFormat(); // Unit of value
|
DataFormat[i] = bvalue->getFormat(); // Unit of value
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageCompass: %d %s %f %s %s", i, DataName[i], DataValue[i], DataFormat[i], DataText[i] );
|
logger->logDebug(GwLog::LOG, "Drawing at PageCompass: %d %s %f %s %s", i, DataName[i], DataValue[i], DataFormat[i], DataText[i] );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Optical warning by limit violation (unused)
|
// Optical warning by limit violation (unused)
|
||||||
|
|
|
@ -7,9 +7,9 @@
|
||||||
class PageDST810 : public Page
|
class PageDST810 : public Page
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PageDST810(CommonData &common){
|
PageDST810(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageDST810");
|
logger->logDebug(GwLog::LOG, "Instantiate PageDST810");
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int handleKey(int key){
|
virtual int handleKey(int key){
|
||||||
|
@ -22,8 +22,6 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
int displayPage(PageData &pageData){
|
int displayPage(PageData &pageData){
|
||||||
GwConfigHandler *config = commonData->config;
|
|
||||||
GwLog *logger = commonData->logger;
|
|
||||||
|
|
||||||
// Old values for hold function
|
// Old values for hold function
|
||||||
static String svalue1old = "";
|
static String svalue1old = "";
|
||||||
|
@ -86,7 +84,7 @@ public:
|
||||||
|
|
||||||
// Logging boat values
|
// Logging boat values
|
||||||
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
|
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageDST810, %s: %f, %s: %f, %s: %f, %s: %f", name1.c_str(), value1, name2.c_str(), value2, name3.c_str(), value3, name4.c_str(), value4);
|
logger->logDebug(GwLog::LOG, "Drawing at PageDST810, %s: %f, %s: %f, %s: %f, %s: %f", name1.c_str(), value1, name2.c_str(), value2, name3.c_str(), value3, name4.c_str(), value4);
|
||||||
|
|
||||||
// Draw page
|
// Draw page
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
|
|
@ -25,7 +25,7 @@ private:
|
||||||
|
|
||||||
// TBD Boatvalues: ...
|
// TBD Boatvalues: ...
|
||||||
|
|
||||||
LOG_DEBUG(GwLog::DEBUG,"Drawing at PageEPropulsion");
|
logger->logDebug(GwLog::DEBUG, "Drawing at PageEPropulsion");
|
||||||
|
|
||||||
// Title and corner value headings
|
// Title and corner value headings
|
||||||
epd->setTextColor(commonData->fgcolor);
|
epd->setTextColor(commonData->fgcolor);
|
||||||
|
@ -48,11 +48,8 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PageEPropulsion(CommonData &common)
|
PageEPropulsion(CommonData &common) : Page(common)
|
||||||
{
|
{
|
||||||
commonData = &common;
|
|
||||||
config = commonData->config;
|
|
||||||
logger = commonData->logger;
|
|
||||||
logger->logDebug(GwLog::LOG,"Instantiate PageEPropulsion");
|
logger->logDebug(GwLog::LOG,"Instantiate PageEPropulsion");
|
||||||
|
|
||||||
// preload configuration data
|
// preload configuration data
|
||||||
|
@ -110,7 +107,7 @@ public:
|
||||||
int displayPage(PageData &pageData){
|
int displayPage(PageData &pageData){
|
||||||
|
|
||||||
// Logging boat values
|
// Logging boat values
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageEPropulsion; Mode=%c", mode);
|
logger->logDebug(GwLog::LOG,"Drawing at PageEPropulsion; Mode=%c", mode);
|
||||||
|
|
||||||
// Set display in partial refresh mode
|
// Set display in partial refresh mode
|
||||||
epd->setPartialWindow(0, 0, epd->width(), epd->height());
|
epd->setPartialWindow(0, 0, epd->width(), epd->height());
|
||||||
|
|
|
@ -75,11 +75,11 @@ class PageFluid : public Page
|
||||||
int fluidtype;
|
int fluidtype;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PageFluid(CommonData &common){
|
PageFluid(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageFluid");
|
logger->logDebug(GwLog::LOG, "Instantiate PageFluid");
|
||||||
simulation = common.config->getBool(common.config->useSimuData);
|
simulation = config->getBool(config->useSimuData);
|
||||||
holdvalues = common.config->getBool(common.config->holdvalues);
|
holdvalues = config->getBool(config->holdvalues);
|
||||||
simval = double(random(0, 100));
|
simval = double(random(0, 100));
|
||||||
simgoto = double(random(0, 100));
|
simgoto = double(random(0, 100));
|
||||||
simstep = (simgoto - simval) / 20.0;
|
simstep = (simgoto - simval) / 20.0;
|
||||||
|
@ -96,12 +96,10 @@ class PageFluid : public Page
|
||||||
|
|
||||||
virtual void displayNew(PageData &pageData){
|
virtual void displayNew(PageData &pageData){
|
||||||
fluidtype = commonData->config->getInt("page" + String(pageData.pageNumber) + "fluid", 0);
|
fluidtype = commonData->config->getInt("page" + String(pageData.pageNumber) + "fluid", 0);
|
||||||
commonData->logger->logDebug(GwLog::LOG,"New PageFluid: fluidtype=%d", fluidtype);
|
logger->logDebug(GwLog::LOG, "New PageFluid: fluidtype=%d", fluidtype);
|
||||||
}
|
}
|
||||||
|
|
||||||
int displayPage(PageData &pageData){
|
int displayPage(PageData &pageData){
|
||||||
GwConfigHandler *config = commonData->config;
|
|
||||||
GwLog *logger = commonData->logger;
|
|
||||||
|
|
||||||
// Old values for hold function
|
// Old values for hold function
|
||||||
static double value1old;
|
static double value1old;
|
||||||
|
@ -133,7 +131,7 @@ class PageFluid : public Page
|
||||||
}
|
}
|
||||||
|
|
||||||
// Logging boat values
|
// Logging boat values
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageFluid: value=%f", bvalue1->value);
|
logger->logDebug(GwLog::LOG, "Drawing at PageFluid: value=%f", bvalue1->value);
|
||||||
|
|
||||||
// Draw page
|
// Draw page
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
class PageFourValues : public Page
|
class PageFourValues : public Page
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PageFourValues(CommonData &common){
|
PageFourValues(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageFourValues");
|
logger->logDebug(GwLog::LOG, "Instantiate PageFourValues");
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int handleKey(int key){
|
virtual int handleKey(int key){
|
||||||
|
@ -23,8 +23,6 @@ class PageFourValues : public Page
|
||||||
}
|
}
|
||||||
|
|
||||||
int displayPage(PageData &pageData){
|
int displayPage(PageData &pageData){
|
||||||
GwConfigHandler *config = commonData->config;
|
|
||||||
GwLog *logger = commonData->logger;
|
|
||||||
|
|
||||||
// Old values for hold function
|
// Old values for hold function
|
||||||
static String svalue1old = "";
|
static String svalue1old = "";
|
||||||
|
@ -91,7 +89,7 @@ class PageFourValues : public Page
|
||||||
|
|
||||||
// Logging boat values
|
// Logging boat values
|
||||||
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
|
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageFourValues, %s: %f, %s: %f, %s: %f, %s: %f", name1.c_str(), value1, name2.c_str(), value2, name3.c_str(), value3, name4.c_str(), value4);
|
logger->logDebug(GwLog::LOG, "Drawing at PageFourValues, %s: %f, %s: %f, %s: %f, %s: %f", name1.c_str(), value1, name2.c_str(), value2, name3.c_str(), value3, name4.c_str(), value4);
|
||||||
|
|
||||||
// Draw page
|
// Draw page
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
class PageFourValues2 : public Page
|
class PageFourValues2 : public Page
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PageFourValues2(CommonData &common){
|
PageFourValues2(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageFourValues2");
|
logger->logDebug(GwLog::LOG, "Instantiate PageFourValues2");
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int handleKey(int key){
|
virtual int handleKey(int key){
|
||||||
|
@ -23,8 +23,6 @@ class PageFourValues2 : public Page
|
||||||
}
|
}
|
||||||
|
|
||||||
int displayPage(PageData &pageData){
|
int displayPage(PageData &pageData){
|
||||||
GwConfigHandler *config = commonData->config;
|
|
||||||
GwLog *logger = commonData->logger;
|
|
||||||
|
|
||||||
// Old values for hold function
|
// Old values for hold function
|
||||||
static String svalue1old = "";
|
static String svalue1old = "";
|
||||||
|
@ -91,7 +89,7 @@ class PageFourValues2 : public Page
|
||||||
|
|
||||||
// Logging boat values
|
// Logging boat values
|
||||||
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
|
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageFourValues2, %s: %f, %s: %f, %s: %f, %s: %f", name1.c_str(), value1, name2.c_str(), value2, name3.c_str(), value3, name4.c_str(), value4);
|
logger->logDebug(GwLog::LOG, "Drawing at PageFourValues2, %s: %f, %s: %f, %s: %f, %s: %f", name1.c_str(), value1, name2.c_str(), value2, name3.c_str(), value3, name4.c_str(), value4);
|
||||||
|
|
||||||
// Draw page
|
// Draw page
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
class PageGenerator : public Page
|
class PageGenerator : public Page
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PageGenerator(CommonData &common){
|
PageGenerator(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageGenerator");
|
logger->logDebug(GwLog::LOG, "Instantiate PageGenerator");
|
||||||
}
|
}
|
||||||
virtual int handleKey(int key){
|
virtual int handleKey(int key){
|
||||||
// Code for keylock
|
// Code for keylock
|
||||||
|
@ -21,10 +21,7 @@ public:
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
int displayPage(PageData &pageData)
|
int displayPage(PageData &pageData) {
|
||||||
{
|
|
||||||
GwConfigHandler *config = commonData->config;
|
|
||||||
GwLog *logger = commonData->logger;
|
|
||||||
|
|
||||||
// Get config data
|
// Get config data
|
||||||
bool simulation = config->getBool(config->useSimuData);
|
bool simulation = config->getBool(config->useSimuData);
|
||||||
|
@ -78,7 +75,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Logging voltage value
|
// Logging voltage value
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageGenerator, Type:%iW %s:=%f", genPower, name1.c_str(), value1);
|
logger->logDebug(GwLog::LOG, "Drawing at PageGenerator, Type:%iW %s:=%f", genPower, name1.c_str(), value1);
|
||||||
|
|
||||||
// Draw page
|
// Draw page
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
|
|
@ -7,9 +7,9 @@
|
||||||
class PageKeelPosition : public Page
|
class PageKeelPosition : public Page
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PageKeelPosition(CommonData &common){
|
PageKeelPosition(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageKeelPosition");
|
logger->logDebug(GwLog::LOG, "Instantiate PageKeelPosition");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Key functions
|
// Key functions
|
||||||
|
@ -24,9 +24,6 @@ public:
|
||||||
|
|
||||||
int displayPage(PageData &pageData)
|
int displayPage(PageData &pageData)
|
||||||
{
|
{
|
||||||
GwConfigHandler *config = commonData->config;
|
|
||||||
GwLog *logger = commonData->logger;
|
|
||||||
|
|
||||||
double value1 = 0;
|
double value1 = 0;
|
||||||
double value1old = 0;
|
double value1old = 0;
|
||||||
|
|
||||||
|
@ -63,7 +60,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Logging boat values
|
// Logging boat values
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageKeelPosition, Keel:%f", value1);
|
logger->logDebug(GwLog::LOG, "Drawing at PageKeelPosition, Keel:%f", value1);
|
||||||
|
|
||||||
// Draw page
|
// Draw page
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
class PageOneValue : public Page
|
class PageOneValue : public Page
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PageOneValue(CommonData &common){
|
PageOneValue(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageOneValue");
|
logger->logDebug(GwLog::LOG, "Instantiate PageOneValue");
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int handleKey(int key){
|
virtual int handleKey(int key){
|
||||||
|
@ -23,8 +23,6 @@ class PageOneValue : public Page
|
||||||
}
|
}
|
||||||
|
|
||||||
int displayPage(PageData &pageData){
|
int displayPage(PageData &pageData){
|
||||||
GwConfigHandler *config = commonData->config;
|
|
||||||
GwLog *logger = commonData->logger;
|
|
||||||
|
|
||||||
// Old values for hold function
|
// Old values for hold function
|
||||||
static String svalue1old = "";
|
static String svalue1old = "";
|
||||||
|
@ -55,7 +53,7 @@ class PageOneValue : public Page
|
||||||
|
|
||||||
// Logging boat values
|
// Logging boat values
|
||||||
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
|
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageOneValue, %s: %f", name1.c_str(), value1);
|
logger->logDebug(GwLog::LOG, "Drawing at PageOneValue, %s: %f", name1.c_str(), value1);
|
||||||
|
|
||||||
// Draw page
|
// Draw page
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
|
|
@ -7,9 +7,9 @@
|
||||||
class PageRollPitch : public Page
|
class PageRollPitch : public Page
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PageRollPitch(CommonData &common){
|
PageRollPitch(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageRollPitch");
|
logger->logDebug(GwLog::LOG,"Instantiate PageRollPitch");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Key functions
|
// Key functions
|
||||||
|
@ -23,8 +23,6 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
int displayPage(PageData &pageData){
|
int displayPage(PageData &pageData){
|
||||||
GwConfigHandler *config = commonData->config;
|
|
||||||
GwLog *logger = commonData->logger;
|
|
||||||
|
|
||||||
double value1 = 0;
|
double value1 = 0;
|
||||||
double value2 = 0;
|
double value2 = 0;
|
||||||
|
@ -111,7 +109,7 @@ public:
|
||||||
|
|
||||||
// Logging boat values
|
// Logging boat values
|
||||||
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
|
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageRollPitch, %s:%f, %s:%f", name1.c_str(), value1, name2.c_str(), value2);
|
logger->logDebug(GwLog::LOG, "Drawing at PageRollPitch, %s:%f, %s:%f", name1.c_str(), value1, name2.c_str(), value2);
|
||||||
|
|
||||||
// Draw page
|
// Draw page
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
class PageRudderPosition : public Page
|
class PageRudderPosition : public Page
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PageRudderPosition(CommonData &common){
|
PageRudderPosition(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
common.logger->logDebug(GwLog::LOG,"Show PageRudderPosition");
|
logger->logDebug(GwLog::LOG, "Instantiate PageRudderPosition");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Key functions
|
// Key functions
|
||||||
|
@ -24,8 +24,6 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
int displayPage(PageData &pageData){
|
int displayPage(PageData &pageData){
|
||||||
GwConfigHandler *config = commonData->config;
|
|
||||||
GwLog *logger = commonData->logger;
|
|
||||||
|
|
||||||
static String unit1old = "";
|
static String unit1old = "";
|
||||||
double value1 = 0.1;
|
double value1 = 0.1;
|
||||||
|
@ -69,7 +67,7 @@ public:
|
||||||
|
|
||||||
// Logging boat values
|
// Logging boat values
|
||||||
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
|
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageRudderPosition, %s:%f", name1.c_str(), value1);
|
logger->logDebug(GwLog::LOG, "Drawing at PageRudderPosition, %s:%f", name1.c_str(), value1);
|
||||||
|
|
||||||
// Draw page
|
// Draw page
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
|
|
@ -16,9 +16,9 @@ const int HowManyValues = 6;
|
||||||
class PageSixValues : public Page
|
class PageSixValues : public Page
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PageSixValues(CommonData &common){
|
PageSixValues(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageSixValues");
|
logger->logDebug(GwLog::LOG, "Instantiate PageSixValues");
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int handleKey(int key){
|
virtual int handleKey(int key){
|
||||||
|
@ -31,9 +31,6 @@ class PageSixValues : public Page
|
||||||
}
|
}
|
||||||
|
|
||||||
int displayPage(PageData &pageData){
|
int displayPage(PageData &pageData){
|
||||||
GwConfigHandler *config = commonData->config;
|
|
||||||
GwLog *logger = commonData->logger;
|
|
||||||
|
|
||||||
|
|
||||||
// Old values for hold function
|
// Old values for hold function
|
||||||
static String OldDataText[HowManyValues] = {"", "", "", "", "", ""};
|
static String OldDataText[HowManyValues] = {"", "", "", "", "", ""};
|
||||||
|
@ -90,7 +87,7 @@ class PageSixValues : public Page
|
||||||
int ValueIndex = i * 2 + j;
|
int ValueIndex = i * 2 + j;
|
||||||
int x0 = SixValues_x1 + j * SixValues_DeltaX;
|
int x0 = SixValues_x1 + j * SixValues_DeltaX;
|
||||||
int y0 = SixValues_y1 + i * SixValues_DeltaY;
|
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] );
|
logger->logDebug(GwLog::LOG,"Drawing at PageSixValue: %d %s %f %s", ValueIndex, DataName[ValueIndex], DataValue[ValueIndex], DataFormat[ValueIndex] );
|
||||||
|
|
||||||
// Show name
|
// Show name
|
||||||
epd->setFont(&Ubuntu_Bold12pt8b);
|
epd->setFont(&Ubuntu_Bold12pt8b);
|
||||||
|
|
|
@ -11,9 +11,9 @@
|
||||||
class PageSkyView : public Page
|
class PageSkyView : public Page
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PageSkyView(CommonData &common){
|
PageSkyView(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
common.logger->logDebug(GwLog::LOG,"Show PageSkyView");
|
logger->logDebug(GwLog::LOG, "Instantiate PageSkyView");
|
||||||
}
|
}
|
||||||
|
|
||||||
int handleKey(int key){
|
int handleKey(int key){
|
||||||
|
@ -26,8 +26,6 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
int displayPage(PageData &pageData) {
|
int displayPage(PageData &pageData) {
|
||||||
GwConfigHandler *config = commonData->config;
|
|
||||||
GwLog *logger = commonData->logger;
|
|
||||||
|
|
||||||
// Get config data
|
// Get config data
|
||||||
String flashLED = config->getString(config->flashLED);
|
String flashLED = config->getString(config->flashLED);
|
||||||
|
@ -41,7 +39,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Logging boat values
|
// Logging boat values
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageSkyView");
|
logger->logDebug(GwLog::LOG, "Drawing at PageSkyView");
|
||||||
|
|
||||||
// Draw page
|
// Draw page
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
class PageSolar : public Page
|
class PageSolar : public Page
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PageSolar(CommonData &common){
|
PageSolar(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageSolar");
|
logger->logDebug(GwLog::LOG, "Instantiate PageSolar");
|
||||||
}
|
}
|
||||||
virtual int handleKey(int key){
|
virtual int handleKey(int key){
|
||||||
// Code for keylock
|
// Code for keylock
|
||||||
|
@ -22,8 +22,6 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
int displayPage(PageData &pageData){
|
int displayPage(PageData &pageData){
|
||||||
GwConfigHandler *config = commonData->config;
|
|
||||||
GwLog *logger = commonData->logger;
|
|
||||||
|
|
||||||
// Get config data
|
// Get config data
|
||||||
bool simulation = config->getBool(config->useSimuData);
|
bool simulation = config->getBool(config->useSimuData);
|
||||||
|
@ -77,7 +75,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Logging voltage value
|
// Logging voltage value
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageSolar, Type:%iW %s:=%f", solPower, name1.c_str(), value1);
|
logger->logDebug(GwLog::LOG, "Drawing at PageSolar, Type:%iW %s:=%f", solPower, name1.c_str(), value1);
|
||||||
|
|
||||||
// Draw page
|
// Draw page
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
|
|
@ -1,27 +1,6 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3
|
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3
|
||||||
|
|
||||||
#include "Pagedata.h"
|
|
||||||
#include "OBP60Extensions.h"
|
|
||||||
#include "ConfigMenu.h"
|
|
||||||
#include "images/logo64.xbm"
|
|
||||||
#include <esp32/clk.h>
|
|
||||||
#include "qrcode.h"
|
|
||||||
#include "Nmea2kTwai.h"
|
|
||||||
|
|
||||||
#ifdef BOARD_OBP40S3
|
|
||||||
#include <SD.h>
|
|
||||||
#include <FS.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define STRINGIZE_IMPL(x) #x
|
|
||||||
#define STRINGIZE(x) STRINGIZE_IMPL(x)
|
|
||||||
#define VERSINFO STRINGIZE(GWDEVVERSION)
|
|
||||||
#define BOARDINFO STRINGIZE(BOARD)
|
|
||||||
#define PCBINFO STRINGIZE(PCBVERS)
|
|
||||||
#define DISPLAYINFO STRINGIZE(EPDTYPE)
|
|
||||||
#define GXEPD2INFO STRINGIZE(GXEPD2VERS)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Special system page, called directly with fast key sequence 5,4
|
* Special system page, called directly with fast key sequence 5,4
|
||||||
* Out of normal page order.
|
* Out of normal page order.
|
||||||
|
@ -44,6 +23,27 @@
|
||||||
* powerInit(powermode);
|
* powerInit(powermode);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "Pagedata.h"
|
||||||
|
#include "OBP60Extensions.h"
|
||||||
|
#include "ConfigMenu.h"
|
||||||
|
#include "images/logo64.xbm"
|
||||||
|
#include <esp32/clk.h>
|
||||||
|
#include "qrcode.h"
|
||||||
|
#include "Nmea2kTwai.h"
|
||||||
|
|
||||||
|
#ifdef BOARD_OBP40S3
|
||||||
|
#include <SD.h>
|
||||||
|
#include <FS.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define STRINGIZE_IMPL(x) #x
|
||||||
|
#define STRINGIZE(x) STRINGIZE_IMPL(x)
|
||||||
|
#define VERSINFO STRINGIZE(GWDEVVERSION)
|
||||||
|
#define BOARDINFO STRINGIZE(BOARD)
|
||||||
|
#define PCBINFO STRINGIZE(PCBVERS)
|
||||||
|
#define DISPLAYINFO STRINGIZE(EPDTYPE)
|
||||||
|
#define GXEPD2INFO STRINGIZE(GXEPD2VERS)
|
||||||
|
|
||||||
class PageSystem : public Page
|
class PageSystem : public Page
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
@ -267,7 +267,7 @@ private:
|
||||||
for (int i = 0 ; i < menu->getItemCount(); i++) {
|
for (int i = 0 ; i < menu->getItemCount(); i++) {
|
||||||
ConfigMenuItem *itm = menu->getItemByIndex(i);
|
ConfigMenuItem *itm = menu->getItemByIndex(i);
|
||||||
if (!itm) {
|
if (!itm) {
|
||||||
LOG_DEBUG(GwLog::ERROR, "Menu item not found: %d", i);
|
logger->logDebug(GwLog::ERROR, "Menu item not found: %d", i);
|
||||||
} else {
|
} else {
|
||||||
Rect r = menu->getItemRect(i);
|
Rect r = menu->getItemRect(i);
|
||||||
bool inverted = (i == menu->getActiveIndex());
|
bool inverted = (i == menu->getActiveIndex());
|
||||||
|
@ -416,36 +416,33 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PageSystem(CommonData &common){
|
PageSystem(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
config = commonData->config;
|
|
||||||
logger = commonData->logger;
|
|
||||||
|
|
||||||
logger->logDebug(GwLog::LOG, "Instantiate PageSystem");
|
logger->logDebug(GwLog::LOG, "Instantiate PageSystem");
|
||||||
if (hasFRAM) {
|
if (hasFRAM) {
|
||||||
mode = fram.read(FRAM_SYSTEM_MODE);
|
mode = fram.read(FRAM_SYSTEM_MODE);
|
||||||
logger->logDebug(GwLog::LOG, "Loaded mode '%c' from FRAM", mode);
|
logger->logDebug(GwLog::LOG, "Loaded mode '%c' from FRAM", mode);
|
||||||
}
|
}
|
||||||
flashLED = common.config->getString(common.config->flashLED);
|
flashLED = config->getString(config->flashLED);
|
||||||
|
|
||||||
chipid = ESP.getEfuseMac();
|
chipid = ESP.getEfuseMac();
|
||||||
simulation = common.config->getBool(common.config->useSimuData);
|
simulation = config->getBool(config->useSimuData);
|
||||||
#ifdef BOARD_OBP40S3
|
#ifdef BOARD_OBP40S3
|
||||||
sdcard = common.config->getBool(common.config->useSDCard);
|
sdcard = config->getBool(config->useSDCard);
|
||||||
#endif
|
#endif
|
||||||
buzzer_mode = common.config->getString(common.config->buzzerMode);
|
buzzer_mode = config->getString(config->buzzerMode);
|
||||||
buzzer_mode.toLowerCase();
|
buzzer_mode.toLowerCase();
|
||||||
buzzer_power = common.config->getInt(common.config->buzzerPower);
|
buzzer_power = config->getInt(config->buzzerPower);
|
||||||
cpuspeed = common.config->getString(common.config->cpuSpeed);
|
cpuspeed = config->getString(config->cpuSpeed);
|
||||||
env_module = common.config->getString(common.config->useEnvSensor);
|
env_module = config->getString(config->useEnvSensor);
|
||||||
rtc_module = common.config->getString(common.config->useRTC);
|
rtc_module = config->getString(config->useRTC);
|
||||||
gps_module = common.config->getString(common.config->useGPS);
|
gps_module = config->getString(config->useGPS);
|
||||||
batt_sensor = common.config->getString(common.config->usePowSensor1);
|
batt_sensor = config->getString(config->usePowSensor1);
|
||||||
solar_sensor = common.config->getString(common.config->usePowSensor2);
|
solar_sensor = config->getString(config->usePowSensor2);
|
||||||
gen_sensor = common.config->getString(common.config->usePowSensor3);
|
gen_sensor = config->getString(config->usePowSensor3);
|
||||||
rot_sensor = common.config->getString(common.config->useRotSensor);
|
rot_sensor = config->getString(config->useRotSensor);
|
||||||
homelat = common.config->getString(common.config->homeLAT).toDouble();
|
homelat = config->getString(config->homeLAT).toDouble();
|
||||||
homelon = common.config->getString(common.config->homeLON).toDouble();
|
homelon = config->getString(config->homeLON).toDouble();
|
||||||
|
|
||||||
// CPU speed: 80 | 160 | 240
|
// CPU speed: 80 | 160 | 240
|
||||||
// Power mode: Max | 5V | Min
|
// Power mode: Max | 5V | Min
|
||||||
|
@ -478,7 +475,7 @@ public:
|
||||||
virtual int handleKey(int key){
|
virtual int handleKey(int key){
|
||||||
// do *NOT* handle key #1 this handled by obp60task as exit
|
// do *NOT* handle key #1 this handled by obp60task as exit
|
||||||
// Switch display mode
|
// Switch display mode
|
||||||
commonData->logger->logDebug(GwLog::LOG, "System keyboard handler");
|
logger->logDebug(GwLog::LOG, "System keyboard handler");
|
||||||
if (key == 2) {
|
if (key == 2) {
|
||||||
incMode();
|
incMode();
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -550,10 +547,9 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
int displayPage(PageData &pageData){
|
int displayPage(PageData &pageData){
|
||||||
// GwConfigHandler *config = commonData->config;
|
|
||||||
// GwLog *logger = commonData->logger;
|
|
||||||
|
|
||||||
NMEA2000 = pageData.api->getNMEA2000();
|
// Get references from API
|
||||||
|
NMEA2000 = pageData.api->getNMEA2000(); // TODO this should go to page initialization!
|
||||||
logger->logDebug(GwLog::LOG, "PageSystem: N2k source address=%d", NMEA2000->GetN2kSource());
|
logger->logDebug(GwLog::LOG, "PageSystem: N2k source address=%d", NMEA2000->GetN2kSource());
|
||||||
|
|
||||||
// Optical warning by limit violation (unused)
|
// Optical warning by limit violation (unused)
|
||||||
|
@ -565,10 +561,6 @@ public:
|
||||||
// Logging page information
|
// Logging page information
|
||||||
logger->logDebug(GwLog::LOG,"Drawing at PageSystem, Mode=%c", mode);
|
logger->logDebug(GwLog::LOG,"Drawing at PageSystem, Mode=%c", mode);
|
||||||
|
|
||||||
// Get references from API
|
|
||||||
// NMEA2000 = pageData.api->getNMEA2000();
|
|
||||||
// LOG_DEBUG(GwLog::LOG,"N2k source address=%d", NMEA2000->GetN2kSource());
|
|
||||||
|
|
||||||
// Set display in partial refresh mode
|
// Set display in partial refresh mode
|
||||||
epd->setPartialWindow(0, 0, epd->width(), epd->height());
|
epd->setPartialWindow(0, 0, epd->width(), epd->height());
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
class PageThreeValues : public Page
|
class PageThreeValues : public Page
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PageThreeValues(CommonData &common){
|
PageThreeValues(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageThreeValue");
|
logger->logDebug(GwLog::LOG,"Instantiate PageThreeValue");
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int handleKey(int key){
|
virtual int handleKey(int key){
|
||||||
|
@ -23,8 +23,6 @@ class PageThreeValues : public Page
|
||||||
}
|
}
|
||||||
|
|
||||||
int displayPage(PageData &pageData){
|
int displayPage(PageData &pageData){
|
||||||
GwConfigHandler *config = commonData->config;
|
|
||||||
GwLog *logger = commonData->logger;
|
|
||||||
|
|
||||||
// Old values for hold function
|
// Old values for hold function
|
||||||
static String svalue1old = "";
|
static String svalue1old = "";
|
||||||
|
@ -79,7 +77,7 @@ class PageThreeValues : public Page
|
||||||
|
|
||||||
// Logging boat values
|
// Logging boat values
|
||||||
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
|
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageThreeValues, %s: %f, %s: %f, %s: %f", name1.c_str(), value1, name2.c_str(), value2, name3.c_str(), value3);
|
logger->logDebug(GwLog::LOG, "Drawing at PageThreeValues, %s: %f, %s: %f, %s: %f", name1.c_str(), value1, name2.c_str(), value2, name3.c_str(), value3);
|
||||||
|
|
||||||
// Draw page
|
// Draw page
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
class PageTwoValues : public Page
|
class PageTwoValues : public Page
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PageTwoValues(CommonData &common){
|
PageTwoValues(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageTwoValue");
|
logger->logDebug(GwLog::LOG,"Instantiate PageTwoValue");
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int handleKey(int key){
|
virtual int handleKey(int key){
|
||||||
|
@ -67,7 +67,7 @@ class PageTwoValues : public Page
|
||||||
|
|
||||||
// Logging boat values
|
// Logging boat values
|
||||||
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
|
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageTwoValues, %s: %f, %s: %f", name1.c_str(), value1, name2.c_str(), value2);
|
logger->logDebug(GwLog::LOG, "Drawing at PageTwoValues, %s: %f, %s: %f", name1.c_str(), value1, name2.c_str(), value2);
|
||||||
|
|
||||||
// Draw page
|
// Draw page
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
|
|
@ -15,11 +15,8 @@ private:
|
||||||
char mode = 'D'; // display mode (A)nalog | (D)igital
|
char mode = 'D'; // display mode (A)nalog | (D)igital
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PageVoltage(CommonData &common){
|
PageVoltage(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
config = commonData->config;
|
|
||||||
logger = commonData->logger;
|
|
||||||
|
|
||||||
logger->logDebug(GwLog::LOG, "Instantiate PageVoltage");
|
logger->logDebug(GwLog::LOG, "Instantiate PageVoltage");
|
||||||
if (hasFRAM) {
|
if (hasFRAM) {
|
||||||
average = fram.read(FRAM_VOLTAGE_AVG);
|
average = fram.read(FRAM_VOLTAGE_AVG);
|
||||||
|
@ -110,8 +107,6 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
int displayPage(PageData &pageData){
|
int displayPage(PageData &pageData){
|
||||||
GwConfigHandler *config = commonData->config;
|
|
||||||
GwLog *logger = commonData->logger;
|
|
||||||
|
|
||||||
// Get config data
|
// Get config data
|
||||||
bool simulation = config->getBool(config->useSimuData);
|
bool simulation = config->getBool(config->useSimuData);
|
||||||
|
@ -196,7 +191,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Logging voltage value
|
// Logging voltage value
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageVoltage, Type:%s %s:=%f", batType, name1.c_str(), raw);
|
logger->logDebug(GwLog::LOG, "Drawing at PageVoltage, Type:%s %s:=%f", batType, name1.c_str(), raw);
|
||||||
|
|
||||||
// Draw page
|
// Draw page
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
|
|
@ -17,9 +17,9 @@ class PageWhite : public Page
|
||||||
char mode = 'W'; // display mode (W)hite | (L)ogo | (M)FD logo
|
char mode = 'W'; // display mode (W)hite | (L)ogo | (M)FD logo
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PageWhite(CommonData &common){
|
PageWhite(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageWhite");
|
logger->logDebug(GwLog::LOG, "Instantiate PageWhite");
|
||||||
refreshtime = 15000;
|
refreshtime = 15000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,8 +39,6 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
int displayPage(PageData &pageData){
|
int displayPage(PageData &pageData){
|
||||||
GwConfigHandler *config = commonData->config;
|
|
||||||
GwLog *logger = commonData->logger;
|
|
||||||
|
|
||||||
// Get config data
|
// Get config data
|
||||||
String flashLED = config->getString(config->flashLED);
|
String flashLED = config->getString(config->flashLED);
|
||||||
|
@ -52,7 +50,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Logging boat values
|
// Logging boat values
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageWhite");
|
logger->logDebug(GwLog::LOG, "Drawing at PageWhite");
|
||||||
|
|
||||||
// Draw page
|
// Draw page
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
|
|
@ -221,9 +221,9 @@ char mode = 'N'; // page mode (N)ormal | (L)ens | e(X)ample
|
||||||
char source = 'A'; // data source (A)pparent | (T)rue
|
char source = 'A'; // data source (A)pparent | (T)rue
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PageWind(CommonData &common){
|
PageWind(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageWind");
|
logger->logDebug(GwLog::LOG, "Instantiate PageWind");
|
||||||
if (hasFRAM) {
|
if (hasFRAM) {
|
||||||
lp = fram.read(FRAM_WIND_SIZE);
|
lp = fram.read(FRAM_WIND_SIZE);
|
||||||
source = fram.read(FRAM_WIND_SRC);
|
source = fram.read(FRAM_WIND_SRC);
|
||||||
|
@ -299,8 +299,6 @@ public:
|
||||||
|
|
||||||
int displayPage(PageData &pageData)
|
int displayPage(PageData &pageData)
|
||||||
{
|
{
|
||||||
GwConfigHandler *config = commonData->config;
|
|
||||||
GwLog *logger = commonData->logger;
|
|
||||||
|
|
||||||
static String svalue1old = "";
|
static String svalue1old = "";
|
||||||
static String unit1old = "";
|
static String unit1old = "";
|
||||||
|
@ -356,7 +354,7 @@ public:
|
||||||
|
|
||||||
// Logging boat values
|
// Logging boat values
|
||||||
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
|
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageWind, %s:%f, %s:%f", name1.c_str(), value1, name2.c_str(), value2);
|
logger->logDebug(GwLog::LOG, "Drawing at PageWind, %s:%f, %s:%f", name1.c_str(), value1, name2.c_str(), value2);
|
||||||
|
|
||||||
// Draw page
|
// Draw page
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
|
|
@ -57,10 +57,9 @@ class PageWindPlot : public Page {
|
||||||
bool showTWS = true; // Show TWS value in chart area
|
bool showTWS = true; // Show TWS value in chart area
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PageWindPlot(CommonData& common)
|
PageWindPlot(CommonData& common) : Page(common)
|
||||||
{
|
{
|
||||||
commonData = &common;
|
logger->logDebug(GwLog::LOG, "Instantiate PageWindPlot");
|
||||||
common.logger->logDebug(GwLog::LOG, "Instantiate PageWindPlot");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void setupKeys()
|
virtual void setupKeys()
|
||||||
|
@ -116,9 +115,6 @@ public:
|
||||||
|
|
||||||
int displayPage(PageData& pageData)
|
int displayPage(PageData& pageData)
|
||||||
{
|
{
|
||||||
GwConfigHandler* config = commonData->config;
|
|
||||||
GwLog* logger = commonData->logger;
|
|
||||||
|
|
||||||
float twsValue; // TWS value in chart area
|
float twsValue; // TWS value in chart area
|
||||||
static String twdName, twdUnit; // TWD name and unit
|
static String twdName, twdUnit; // TWD name and unit
|
||||||
static int updFreq; // Update frequency for TWD
|
static int updFreq; // Update frequency for TWD
|
||||||
|
@ -173,7 +169,7 @@ public:
|
||||||
int chrtVal; // Current wind value
|
int chrtVal; // Current wind value
|
||||||
static int chrtPrevVal; // Last wind value in chart area for check if value crosses 180 degree line
|
static int chrtPrevVal; // Last wind value in chart area for check if value crosses 180 degree line
|
||||||
|
|
||||||
LOG_DEBUG(GwLog::LOG, "Display page WindPlot");
|
logger->logDebug(GwLog::LOG, "Display page WindPlot");
|
||||||
|
|
||||||
// Get config data
|
// Get config data
|
||||||
simulation = config->getBool(config->useSimuData);
|
simulation = config->getBool(config->useSimuData);
|
||||||
|
@ -241,7 +237,7 @@ public:
|
||||||
bufStart = max(0, bufStart - numAddedBufVals);
|
bufStart = max(0, bufStart - numAddedBufVals);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOG_DEBUG(GwLog::DEBUG, "PageWindPlot Dataset: count: %d, TWD: %.0f, TWS: %.1f, TWD_valid? %d, intvBufSize: %d, numWndVals: %d, bufStart: %d, numAddedBufVals: %d, lastIdx: %d, old: %d, act: %d",
|
logger->logDebug(GwLog::DEBUG, "PageWindPlot Dataset: count: %d, TWD: %.0f, TWS: %.1f, TWD_valid? %d, intvBufSize: %d, numWndVals: %d, bufStart: %d, numAddedBufVals: %d, lastIdx: %d, old: %d, act: %d",
|
||||||
count, pageData.boatHstry.twdHstry->getLast() / 1000.0 * radToDeg, pageData.boatHstry.twsHstry->getLast() / 10.0 * 1.94384, BDataValid[0],
|
count, pageData.boatHstry.twdHstry->getLast() / 1000.0 * radToDeg, pageData.boatHstry.twsHstry->getLast() / 10.0 * 1.94384, BDataValid[0],
|
||||||
intvBufSize, numWndVals, bufStart, numAddedBufVals, pageData.boatHstry.twdHstry->getLastIdx(), oldDataIntv, dataIntv);
|
intvBufSize, numWndVals, bufStart, numAddedBufVals, pageData.boatHstry.twdHstry->getLastIdx(), oldDataIntv, dataIntv);
|
||||||
|
|
||||||
|
@ -254,7 +250,7 @@ public:
|
||||||
} else {
|
} else {
|
||||||
wndCenter = 0;
|
wndCenter = 0;
|
||||||
}
|
}
|
||||||
LOG_DEBUG(GwLog::DEBUG, "PageWindPlot Range Init: count: %d, TWD: %.0f, wndCenter: %d, diffRng: %d, chrtRng: %d", count, pageData.boatHstry.twdHstry->getLast() / 1000.0 * radToDeg,
|
logger->logDebug(GwLog::DEBUG, "PageWindPlot Range Init: count: %d, TWD: %.0f, wndCenter: %d, diffRng: %d, chrtRng: %d", count, pageData.boatHstry.twdHstry->getLast() / 1000.0 * radToDeg,
|
||||||
wndCenter, diffRng, chrtRng);
|
wndCenter, diffRng, chrtRng);
|
||||||
} else {
|
} else {
|
||||||
// check and adjust range between left, center, and right chart limit
|
// check and adjust range between left, center, and right chart limit
|
||||||
|
@ -334,7 +330,7 @@ public:
|
||||||
|
|
||||||
// if (i >= (numWndVals / dataIntv) - 10)
|
// if (i >= (numWndVals / dataIntv) - 10)
|
||||||
if (i >= (numWndVals / dataIntv) - 1)
|
if (i >= (numWndVals / dataIntv) - 1)
|
||||||
LOG_DEBUG(GwLog::DEBUG, "PageWindPlot Chart: i: %d, chrtVal: %d, bufStart: %d, count: %d, linesToShow: %d", i, chrtVal, bufStart, count, (numWndVals / dataIntv));
|
logger->logDebug(GwLog::DEBUG, "PageWindPlot Chart: i: %d, chrtVal: %d, bufStart: %d, count: %d, linesToShow: %d", i, chrtVal, bufStart, count, (numWndVals / dataIntv));
|
||||||
|
|
||||||
if ((i == 0) || (chrtPrevVal == INT16_MIN)) {
|
if ((i == 0) || (chrtPrevVal == INT16_MIN)) {
|
||||||
// just a dot for 1st chart point or after some invalid values
|
// just a dot for 1st chart point or after some invalid values
|
||||||
|
@ -367,7 +363,7 @@ public:
|
||||||
|
|
||||||
int minWndDir = pageData.boatHstry.twdHstry->getMin(numWndVals) / 1000.0 * radToDeg;
|
int minWndDir = pageData.boatHstry.twdHstry->getMin(numWndVals) / 1000.0 * radToDeg;
|
||||||
int maxWndDir = pageData.boatHstry.twdHstry->getMax(numWndVals) / 1000.0 * radToDeg;
|
int maxWndDir = pageData.boatHstry.twdHstry->getMax(numWndVals) / 1000.0 * radToDeg;
|
||||||
LOG_DEBUG(GwLog::DEBUG, "PageWindPlot FreeTop: Minimum: %d, Maximum: %d, OldwndCenter: %d", minWndDir, maxWndDir, wndCenter);
|
logger->logDebug(GwLog::DEBUG, "PageWindPlot FreeTop: Minimum: %d, Maximum: %d, OldwndCenter: %d", minWndDir, maxWndDir, wndCenter);
|
||||||
// if ((minWndDir + 540 >= wndCenter + 540) || (maxWndDir + 540 <= wndCenter + 540)) {
|
// if ((minWndDir + 540 >= wndCenter + 540) || (maxWndDir + 540 <= wndCenter + 540)) {
|
||||||
if (((minWndDir - wndCenter >= 0) && (minWndDir - wndCenter < 180)) || ((maxWndDir - wndCenter <= 0) && (maxWndDir - wndCenter >=180))) {
|
if (((minWndDir - wndCenter >= 0) && (minWndDir - wndCenter < 180)) || ((maxWndDir - wndCenter <= 0) && (maxWndDir - wndCenter >=180))) {
|
||||||
// Check if all wind value are left or right of center value -> optimize chart range
|
// Check if all wind value are left or right of center value -> optimize chart range
|
||||||
|
@ -376,14 +372,14 @@ public:
|
||||||
wndCenter = int((midWndDir + (midWndDir >= 0 ? 5 : -5)) / 10) * 10; // Set new center value; round to nearest 10 degree value
|
wndCenter = int((midWndDir + (midWndDir >= 0 ? 5 : -5)) / 10) * 10; // Set new center value; round to nearest 10 degree value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOG_DEBUG(GwLog::DEBUG, "PageWindPlot FreeTop: cHeight: %d, bufStart: %d, numWndVals: %d, wndCenter: %d", cHeight, bufStart, numWndVals, wndCenter);
|
logger->logDebug(GwLog::DEBUG, "PageWindPlot FreeTop: cHeight: %d, bufStart: %d, numWndVals: %d, wndCenter: %d", cHeight, bufStart, numWndVals, wndCenter);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// No valid data available
|
// No valid data available
|
||||||
LOG_DEBUG(GwLog::LOG, "PageWindPlot: No valid data available");
|
logger->logDebug(GwLog::LOG, "PageWindPlot: No valid data available");
|
||||||
epd->setFont(&Ubuntu_Bold10pt8b);
|
epd->setFont(&Ubuntu_Bold10pt8b);
|
||||||
epd->fillRect(xCenter - 33, height / 2 - 20, 66, 24, commonData->bgcolor); // Clear area for message
|
epd->fillRect(xCenter - 33, height / 2 - 20, 66, 24, commonData->bgcolor); // Clear area for message
|
||||||
drawTextCenter(xCenter, height / 2 - 10, "No data");
|
drawTextCenter(xCenter, height / 2 - 10, "No data");
|
||||||
|
|
|
@ -10,9 +10,9 @@ class PageWindRose : public Page
|
||||||
int16_t lp = 80; // Pointer length
|
int16_t lp = 80; // Pointer length
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PageWindRose(CommonData &common){
|
PageWindRose(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageWindRose");
|
logger->logDebug(GwLog::LOG, "Instantiate PageWindRose");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Key functions
|
// Key functions
|
||||||
|
@ -26,8 +26,6 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
int displayPage(PageData &pageData){
|
int displayPage(PageData &pageData){
|
||||||
GwConfigHandler *config = commonData->config;
|
|
||||||
GwLog *logger = commonData->logger;
|
|
||||||
|
|
||||||
static String svalue1old = "";
|
static String svalue1old = "";
|
||||||
static String unit1old = "";
|
static String unit1old = "";
|
||||||
|
@ -142,7 +140,7 @@ public:
|
||||||
|
|
||||||
// Logging boat values
|
// Logging boat values
|
||||||
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
|
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageWindRose, %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);
|
logger->logDebug(GwLog::LOG, "Drawing at PageWindRose, %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
|
// Draw page
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
|
|
@ -10,9 +10,9 @@ class PageWindRoseFlex : public Page
|
||||||
int16_t lp = 80; // Pointer length
|
int16_t lp = 80; // Pointer length
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PageWindRoseFlex(CommonData &common){
|
PageWindRoseFlex(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageWindRoseFlex");
|
logger->logDebug(GwLog::LOG, "Instantiate PageWindRoseFlex");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Key functions
|
// Key functions
|
||||||
|
@ -26,8 +26,6 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
int displayPage(PageData &pageData){
|
int displayPage(PageData &pageData){
|
||||||
GwConfigHandler *config = commonData->config;
|
|
||||||
GwLog *logger = commonData->logger;
|
|
||||||
|
|
||||||
static String svalue1old = "";
|
static String svalue1old = "";
|
||||||
static String unit1old = "";
|
static String unit1old = "";
|
||||||
|
@ -142,7 +140,7 @@ public:
|
||||||
|
|
||||||
// Logging boat values
|
// Logging boat values
|
||||||
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
|
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
|
||||||
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);
|
logger->logDebug(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
|
// Draw page
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
|
|
@ -33,11 +33,11 @@ class PageXTETrack : public Page
|
||||||
bool holdvalues = false;
|
bool holdvalues = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PageXTETrack(CommonData &common){
|
PageXTETrack(CommonData &common) : Page(common)
|
||||||
commonData = &common;
|
{
|
||||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageXTETrack");
|
logger->logDebug(GwLog::LOG, "Instantiate PageXTETrack");
|
||||||
simulation = common.config->getBool(common.config->useSimuData);
|
simulation = config->getBool(config->useSimuData);
|
||||||
holdvalues = common.config->getBool(common.config->holdvalues);
|
holdvalues = config->getBool(config->holdvalues);
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawSegment(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1,
|
void drawSegment(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1,
|
||||||
|
@ -67,8 +67,6 @@ class PageXTETrack : public Page
|
||||||
}
|
}
|
||||||
|
|
||||||
int displayPage(PageData &pageData){
|
int displayPage(PageData &pageData){
|
||||||
GwConfigHandler *config = commonData->config;
|
|
||||||
GwLog *logger = commonData->logger;
|
|
||||||
|
|
||||||
// Get config data
|
// Get config data
|
||||||
String flashLED = config->getString(config->flashLED);
|
String flashLED = config->getString(config->flashLED);
|
||||||
|
@ -84,7 +82,7 @@ class PageXTETrack : public Page
|
||||||
}
|
}
|
||||||
|
|
||||||
// Logging boat values
|
// Logging boat values
|
||||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageXTETrack");
|
logger->logDebug(GwLog::LOG,"Drawing at PageXTETrack");
|
||||||
|
|
||||||
// Draw page
|
// Draw page
|
||||||
//***********************************************************
|
//***********************************************************
|
||||||
|
|
|
@ -130,6 +130,12 @@ protected:
|
||||||
GwConfigHandler *config;
|
GwConfigHandler *config;
|
||||||
GwLog *logger;
|
GwLog *logger;
|
||||||
public:
|
public:
|
||||||
|
Page(){}
|
||||||
|
Page(CommonData &common) {
|
||||||
|
commonData = &common;
|
||||||
|
config = commonData->config;
|
||||||
|
logger = commonData->logger;
|
||||||
|
}
|
||||||
int refreshtime = 1000;
|
int refreshtime = 1000;
|
||||||
virtual int displayPage(PageData &pageData)=0;
|
virtual int displayPage(PageData &pageData)=0;
|
||||||
virtual void displayNew(PageData &pageData){}
|
virtual void displayNew(PageData &pageData){}
|
||||||
|
|
|
@ -17,3 +17,7 @@
|
||||||
- page clock: sunrise / sunset in local time or UTC
|
- page clock: sunrise / sunset in local time or UTC
|
||||||
|
|
||||||
- implement alerts
|
- implement alerts
|
||||||
|
|
||||||
|
- page windplot: replace circles for degree symbol with font symbol
|
||||||
|
|
||||||
|
- central definition of placeholder symbol: ---
|
||||||
|
|
Loading…
Reference in New Issue