45 Display(DisplayType displayType) : displayType(displayType) {}
47 virtual ~Display() =
default;
49 constexpr virtual size_t getNumBrowserAndMenuLines() = 0;
51 virtual void setText(std::string_view newText,
bool alignRight =
false, uint8_t drawDot = 255,
bool doBlink =
false,
52 uint8_t* newBlinkMask =
nullptr,
bool blinkImmediately =
false,
bool shouldBlinkFast =
false,
53 int32_t scrollPos = 0, uint8_t* blinkAddition =
nullptr,
54 bool justReplaceBottomLayer =
false) {};
56 virtual void displayPopup(
char const* newText, int8_t numFlashes = 3,
bool alignRight =
false,
57 uint8_t drawDot = 255, int32_t blinkSpeed = 1, PopupType type = PopupType::GENERAL) = 0;
59 virtual void displayPopup(uint8_t val, int8_t numFlashes = 3,
bool alignRight =
false, uint8_t drawDot = 255,
60 int32_t blinkSpeed = 1, PopupType type = PopupType::GENERAL) {
62 intToString(val, valStr, 1);
63 displayPopup(valStr, numFlashes, alignRight, drawDot, blinkSpeed, type);
66 virtual void displayPopup(
char const* shortLong[2], int8_t numFlashes = 3,
bool alignRight =
false,
67 uint8_t drawDot = 255, int32_t blinkSpeed = 1, PopupType type = PopupType::GENERAL) {
68 displayPopup(have7SEG() ? shortLong[0] : shortLong[1], numFlashes, alignRight, drawDot, blinkSpeed, type);
71 virtual void popupText(
char const* text, PopupType type = PopupType::GENERAL) = 0;
72 virtual void popupTextTemporary(
char const* text, PopupType type = PopupType::GENERAL) = 0;
74 virtual void setNextTransitionDirection(int8_t thisDirection) {};
76 virtual void cancelPopup() = 0;
77 virtual void freezeWithError(
char const* text) = 0;
78 virtual bool isLayerCurrentlyOnTop(
NumericLayer* layer) = 0;
79 virtual void displayError(Error error) = 0;
81 virtual void removeWorkingAnimation() = 0;
84 virtual void displayLoadingAnimation() {};
85 virtual void displayLoadingAnimationText(
char const* text,
bool delayed =
false,
bool transparent =
false) = 0;
86 virtual void removeLoadingAnimation() = 0;
88 virtual void displayNotification(std::string_view paramTitle, std::optional<std::string_view> paramValue) {}
90 virtual bool hasPopup() = 0;
91 virtual bool hasPopupOfType(PopupType type) = 0;
93 virtual void consoleText(
char const* text) = 0;
95 virtual void timerRoutine() = 0;
97 virtual void setTextAsNumber(int16_t number, uint8_t drawDot = 255,
bool doBlink =
false) {}
98 virtual int32_t getEncodedPosFromLeft(int32_t textPos,
char const* text,
bool* andAHalf) {
return 0; }
99 virtual void setTextAsSlot(int16_t currentSlot, int8_t currentSubSlot,
bool currentSlotExists,
bool doBlink =
false,
100 int32_t blinkPos = -1,
bool blinkImmediately =
false) {}
101 virtual void setTextWithMultipleDots(std::string_view newText, std::vector<uint8_t> dotPositions,
102 bool alignRight =
false,
bool doBlink =
false, uint8_t* newBlinkMask =
nullptr,
103 bool blinkImmediately =
false) {}
105 int32_t initialDelay = 600,
int count = -1,
106 uint8_t fixedDot = 255) {
110 virtual std::array<uint8_t, kNumericDisplayLength> getLast() {
return {0}; };
112 bool haveOLED() {
return displayType == DisplayType::OLED; }
113 bool have7SEG() {
return displayType == DisplayType::SEVENSEG; }
116 DisplayType displayType;