mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2026-01-26 16:13:07 +01:00
PageTwoValues: added chart display option
This commit is contained in:
@@ -12,8 +12,8 @@ private:
|
||||
|
||||
enum PageMode {
|
||||
VALUE,
|
||||
CHART,
|
||||
BOTH
|
||||
BOTH,
|
||||
CHART
|
||||
};
|
||||
enum DisplayMode {
|
||||
FULL,
|
||||
@@ -54,6 +54,7 @@ private:
|
||||
RingBuffer<uint16_t>* dataHstryBuf = nullptr;
|
||||
std::unique_ptr<Chart> dataChart; // Chart object
|
||||
|
||||
// display data value in display <mode> [FULL|HALF]
|
||||
void showData(GwApi::BoatValue* bValue1, DisplayMode mode)
|
||||
{
|
||||
int nameXoff, nameYoff, unitXoff, unitYoff, value1Xoff, value1Yoff;
|
||||
@@ -158,17 +159,17 @@ public:
|
||||
Page::setupKeys();
|
||||
|
||||
#if defined BOARD_OBP60S3
|
||||
constexpr int ZOOM_IDX = 4;
|
||||
constexpr int ZOOM_KEY = 4;
|
||||
#elif defined BOARD_OBP40S3
|
||||
constexpr int ZOOM_IDX = 1;
|
||||
constexpr int ZOOM_KEY = 1;
|
||||
#endif
|
||||
|
||||
if (dataHstryBuf) { // show "Mode" key only if chart supported boat data type is available
|
||||
commonData->keydata[0].label = "MODE";
|
||||
commonData->keydata[ZOOM_IDX].label = "ZOOM";
|
||||
commonData->keydata[ZOOM_KEY].label = "ZOOM";
|
||||
} else {
|
||||
commonData->keydata[0].label = "";
|
||||
commonData->keydata[ZOOM_IDX].label = "";
|
||||
commonData->keydata[ZOOM_KEY].label = "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,7 +178,7 @@ public:
|
||||
{
|
||||
if (dataHstryBuf) { // if boat data type supports charts
|
||||
|
||||
// Set page mode value | value/half chart | full chart
|
||||
// Set page mode: value | value/half chart | full chart
|
||||
if (key == 1) {
|
||||
switch (pageMode) {
|
||||
case VALUE:
|
||||
|
||||
Reference in New Issue
Block a user