Informace o viditelnosti

This commit is contained in:
Pavel Brychta 2020-11-25 17:49:30 +01:00
parent 9e67bd4591
commit 9f417bbe42
2 changed files with 12 additions and 2 deletions

View File

@ -168,8 +168,9 @@ void onOffOverlay(OLEDDisplay *display, OLEDDisplayUiState *state)
} }
} }
void OLEDUIPlus::loop(void) bool OLEDUIPlus::loop(void)
{ {
bool result = false;
if (_displayon) { if (_displayon) {
// obsluha puvodniho Ui objektu // obsluha puvodniho Ui objektu
@ -178,6 +179,7 @@ void OLEDUIPlus::loop(void)
if (0 < rtb) { if (0 < rtb) {
_timing.set(rtb); _timing.set(rtb);
} }
result = true;
} }
// obsluha casovace blikani // obsluha casovace blikani
if (_blink.expired()) { if (_blink.expired()) {
@ -193,6 +195,7 @@ void OLEDUIPlus::loop(void)
} else { } else {
handleKbd(); handleKbd();
} }
return result;
} }
void OLEDUIPlus::drawMenu(OLEDDisplay * display, const menu_t *menu, int *top, int *selected, int16_t x, int16_t y) void OLEDUIPlus::drawMenu(OLEDDisplay * display, const menu_t *menu, int *top, int *selected, int16_t x, int16_t y)
@ -318,6 +321,12 @@ void OLEDUIPlus::setTimeout(uint32_t ms)
extendOn(); extendOn();
} }
bool OLEDUIPlus::isVisible(void)
{
return _displayon;
}
#if defined(USE_OTA) #if defined(USE_OTA)
void OLEDUIPlus::OTAStart(void) void OLEDUIPlus::OTAStart(void)
{ {

View File

@ -48,7 +48,7 @@ public:
void begin(OLEDDisplay *display, kbdRead rKbd, uint32_t timeout, FrameCallback frames[], size_t framesCount, OverlayCallback overlays[], size_t overlaysCount); void begin(OLEDDisplay *display, kbdRead rKbd, uint32_t timeout, FrameCallback frames[], size_t framesCount, OverlayCallback overlays[], size_t overlaysCount);
void startAnim(int open); void startAnim(int open);
void onOffOverlay(OLEDDisplay *display, OLEDDisplayUiState *state); void onOffOverlay(OLEDDisplay *display, OLEDDisplayUiState *state);
void loop(void); bool loop(void);
void drawMenu(OLEDDisplay *display, const menu_t *menu, int *top, int *selected, int16_t x, int16_t y); void drawMenu(OLEDDisplay *display, const menu_t *menu, int *top, int *selected, int16_t x, int16_t y);
int handleKbd(void); int handleKbd(void);
int extendOn(void); int extendOn(void);
@ -57,6 +57,7 @@ public:
bool menuExpired(void); bool menuExpired(void);
uint8_t getFrameIndex(FrameCallback cb); uint8_t getFrameIndex(FrameCallback cb);
void setMainFrame(FrameCallback cb); void setMainFrame(FrameCallback cb);
bool isVisible(void);
#if defined(USE_OTA) #if defined(USE_OTA)
void OTAStart(void); void OTAStart(void);
void OTAProgress(unsigned int progress, unsigned int total); void OTAProgress(unsigned int progress, unsigned int total);