Fix GPS info in head line
This commit is contained in:
parent
d2a17b755c
commit
2c9ebcc6a2
|
@ -219,7 +219,7 @@ void displayTrendLow(int16_t x, int16_t y, uint16_t size, uint16_t color){
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show header informations
|
// Show header informations
|
||||||
void displayHeader(CommonData &commonData, GwApi::BoatValue *date, GwApi::BoatValue *time){
|
void displayHeader(CommonData &commonData, GwApi::BoatValue *date, GwApi::BoatValue *time, GwApi::BoatValue *hdop){
|
||||||
|
|
||||||
static bool heartbeat = false;
|
static bool heartbeat = false;
|
||||||
static unsigned long usbRxOld = 0;
|
static unsigned long usbRxOld = 0;
|
||||||
|
@ -263,8 +263,8 @@ void displayHeader(CommonData &commonData, GwApi::BoatValue *date, GwApi::BoatVa
|
||||||
if(commonData.status.usbRx != usbRxOld || commonData.status.usbTx != usbTxOld){
|
if(commonData.status.usbRx != usbRxOld || commonData.status.usbTx != usbTxOld){
|
||||||
getdisplay().print("USB ");
|
getdisplay().print("USB ");
|
||||||
}
|
}
|
||||||
String acttime = formatValue(time, commonData).svalue;
|
double gpshdop = formatValue(hdop, commonData).value;
|
||||||
if(commonData.config->getBool(commonData.config->useGPS) == true && date->valid == true){
|
if(commonData.config->getString(commonData.config->useGPS) != "off" && gpshdop > 1.0){
|
||||||
getdisplay().print("GPS");
|
getdisplay().print("GPS");
|
||||||
}
|
}
|
||||||
// Save old telegram counter
|
// Save old telegram counter
|
||||||
|
|
|
@ -57,7 +57,7 @@ String xdrDelete(String input); // Delete xdr prefix from string
|
||||||
void displayTrendHigh(int16_t x, int16_t y, uint16_t size, uint16_t color);
|
void displayTrendHigh(int16_t x, int16_t y, uint16_t size, uint16_t color);
|
||||||
void displayTrendLow(int16_t x, int16_t y, uint16_t size, uint16_t color);
|
void displayTrendLow(int16_t x, int16_t y, uint16_t size, uint16_t color);
|
||||||
|
|
||||||
void displayHeader(CommonData &commonData, GwApi::BoatValue *date, GwApi::BoatValue *time); // Draw display header
|
void displayHeader(CommonData &commonData, GwApi::BoatValue *date, GwApi::BoatValue *time, GwApi::BoatValue *hdop); // Draw display header
|
||||||
|
|
||||||
SunData calcSunsetSunrise(GwApi *api, double time, double date, double latitude, double longitude, double timezone); // Calulate sunset and sunrise
|
SunData calcSunsetSunrise(GwApi *api, double time, double date, double latitude, double longitude, double timezone); // Calulate sunset and sunrise
|
||||||
|
|
||||||
|
|
|
@ -410,6 +410,7 @@ void OBP60Task(GwApi *api){
|
||||||
GwApi::BoatValue *time = boatValues.findValueOrCreate("GPST"); // Load GpsTime
|
GwApi::BoatValue *time = boatValues.findValueOrCreate("GPST"); // Load GpsTime
|
||||||
GwApi::BoatValue *lat = boatValues.findValueOrCreate("LAT"); // Load GpsLatitude
|
GwApi::BoatValue *lat = boatValues.findValueOrCreate("LAT"); // Load GpsLatitude
|
||||||
GwApi::BoatValue *lon = boatValues.findValueOrCreate("LON"); // Load GpsLongitude
|
GwApi::BoatValue *lon = boatValues.findValueOrCreate("LON"); // Load GpsLongitude
|
||||||
|
GwApi::BoatValue *hdop = boatValues.findValueOrCreate("HDOP"); // Load GpsHDOP
|
||||||
|
|
||||||
LOG_DEBUG(GwLog::LOG,"obp60task: start mainloop");
|
LOG_DEBUG(GwLog::LOG,"obp60task: start mainloop");
|
||||||
// Set start page
|
// Set start page
|
||||||
|
@ -559,8 +560,8 @@ void OBP60Task(GwApi *api){
|
||||||
getdisplay().fillRect(0, 0, getdisplay().width(), getdisplay().height(), bgcolor); // Clear display
|
getdisplay().fillRect(0, 0, getdisplay().width(), getdisplay().height(), bgcolor); // Clear display
|
||||||
if (pages[pageNumber].description && pages[pageNumber].description->header){
|
if (pages[pageNumber].description && pages[pageNumber].description->header){
|
||||||
//build some header and footer using commonData
|
//build some header and footer using commonData
|
||||||
getdisplay().fillScreen(bgcolor); // Clear display
|
getdisplay().fillScreen(bgcolor); // Clear display
|
||||||
displayHeader(commonData, date, time); // Sown header
|
displayHeader(commonData, date, time, hdop); // Sown header
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call the particular page
|
// Call the particular page
|
||||||
|
|
Loading…
Reference in New Issue