2021-08-23 15:48:40 +02:00
|
|
|
#ifndef GUI_h
|
|
|
|
#define GUI_h
|
|
|
|
|
2021-09-15 18:11:32 +02:00
|
|
|
#include "BleFingerprint.h"
|
2021-08-23 15:48:40 +02:00
|
|
|
#include <Arduino.h>
|
|
|
|
|
|
|
|
#ifdef M5STICK
|
|
|
|
#ifdef PLUS
|
|
|
|
#include <M5StickCPlus.h>
|
|
|
|
#else
|
|
|
|
#include <M5StickC.h>
|
|
|
|
#endif
|
2021-09-17 00:18:15 +02:00
|
|
|
#elif defined M5ATOM
|
|
|
|
#include <M5Atom.h>
|
2021-08-23 15:48:40 +02:00
|
|
|
#endif
|
|
|
|
|
2021-09-17 02:29:43 +02:00
|
|
|
class BleFingerprint;
|
|
|
|
|
2021-08-23 15:48:40 +02:00
|
|
|
class GUI
|
|
|
|
{
|
|
|
|
public:
|
2022-01-23 18:38:05 +01:00
|
|
|
void setup();
|
|
|
|
|
2021-09-15 18:11:32 +02:00
|
|
|
void added(BleFingerprint *f);
|
2021-09-30 18:48:50 +02:00
|
|
|
void removed(BleFingerprint *f, long age);
|
2021-09-15 18:11:32 +02:00
|
|
|
void close(BleFingerprint *f);
|
|
|
|
void left(BleFingerprint *f);
|
|
|
|
|
2021-09-17 00:18:15 +02:00
|
|
|
void erasing();
|
|
|
|
void erased();
|
|
|
|
|
2021-09-14 03:22:00 +02:00
|
|
|
void seenStart();
|
|
|
|
void seenEnd();
|
2021-09-15 18:11:32 +02:00
|
|
|
|
2022-01-23 18:38:05 +01:00
|
|
|
void updateStart();
|
2021-09-17 00:18:15 +02:00
|
|
|
void updateProgress(unsigned int percent);
|
|
|
|
void updateEnd();
|
|
|
|
|
|
|
|
void connecting();
|
2021-08-23 15:48:40 +02:00
|
|
|
void connected(bool wifi, bool mqtt);
|
2021-09-17 00:18:15 +02:00
|
|
|
|
|
|
|
void status(const char *message, ...);
|
2022-01-23 18:38:05 +01:00
|
|
|
void blit();
|
|
|
|
|
|
|
|
void setStatusLed(bool enabled) { _statusLed = enabled; }
|
2021-08-23 15:48:40 +02:00
|
|
|
|
|
|
|
private:
|
2022-01-23 18:38:05 +01:00
|
|
|
bool _statusLed = true;
|
2021-11-15 00:54:19 +01:00
|
|
|
void begin();
|
|
|
|
|
2021-08-23 15:48:40 +02:00
|
|
|
bool init;
|
|
|
|
#ifdef M5STICK
|
2021-09-17 00:18:15 +02:00
|
|
|
bool dirty;
|
2021-08-23 15:48:40 +02:00
|
|
|
TFT_eSprite sprite = TFT_eSprite(&M5.Lcd);
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
extern GUI Display;
|
2021-09-14 03:22:00 +02:00
|
|
|
|
|
|
|
#endif
|