 |
RSeries astromech firmware
|
|
Go to the documentation of this file. 1 #ifndef CommandScreenHandlerSMQ_h
2 #define CommandScreenHandlerSMQ_h
48 fString += String(
"\n") + String(val);
53 fString += String(
"\n") + text;
71 printf(
"Failed to send LCD\n");
77 fNewDialValue = newValue;
83 fButtonPressed = pressed;
84 fButtonRepeat = repeat;
104 fRemoteActive =
false;
107 if (currentScr !=
nullptr)
109 if (fDialValue != fNewDialValue || fButtonID != 0)
115 if (fDialValue != fNewDialValue)
117 currentScr->
buttonDial(fNewDialValue, fDialValue);
118 fDialValue = fNewDialValue;
122 if (fButtonID == 1 && fButtonPressed)
124 if (fButtonID == 2 && fButtonPressed)
126 if (fButtonID == 3 && fButtonPressed)
128 if (fButtonID == 4 && fButtonPressed)
130 if (fButtonID == 5 && fButtonPressed)
132 if (fLastScreenID == currentScr->
ID())
134 if (fButtonID == 1 && !fButtonPressed)
136 if (fButtonID == 2 && !fButtonPressed)
138 if (fButtonID == 3 && !fButtonPressed)
140 if (fButtonID == 4 && !fButtonPressed)
142 if (fButtonID == 5 && !fButtonPressed)
145 fLastScreenID = currentScr->
ID();
147 else if (fLastScreenID == currentScr->
ID())
149 if (fButtonID == 1 && fButtonPressed && fButtonRepeat)
153 else if (fButtonID == 2 && fButtonPressed && fButtonRepeat)
157 else if (fButtonID == 3 && fButtonPressed && fButtonRepeat)
161 else if (fButtonID == 4 && fButtonPressed && fButtonRepeat)
165 else if (fButtonID == 5 && fButtonPressed && fButtonRepeat)
172 fButtonPressed =
false;
173 fButtonRepeat =
false;
174 fDialValue = fNewDialValue;
180 long fNewDialValue = 0;
181 uint8_t fButtonID = 0;
182 bool fRemoteActive =
false;
183 bool fButtonPressed =
false;
184 bool fButtonRepeat =
false;
185 ScreenID fLastScreenID = kInvalid;
197 fClearDisplay =
false;
void print(String text)
Definition: CommandScreenHandlerSMQ.h:41
Definition: CommandScreen.h:273
virtual void buttonLeftPressed(bool repeat=false)
Definition: CommandScreen.h:328
void println(unsigned val)
Definition: CommandScreenHandlerSMQ.h:46
void remoteActive()
Definition: CommandScreenHandlerSMQ.h:87
CommandScreenHandlerSMQ()
Definition: CommandScreenHandlerSMQ.h:9
void switchToScreen(ScreenID id, bool popStack=true)
Definition: CommandScreen.h:175
void setTextSize(int siz)
Definition: CommandScreenHandlerSMQ.h:24
CommandScreen * current()
Definition: CommandScreen.h:154
void remoteButtonEvent(uint8_t id, bool pressed, bool repeat)
Definition: CommandScreenHandlerSMQ.h:80
void remoteDialEvent(long newValue, long oldValue)
Definition: CommandScreenHandlerSMQ.h:75
void invertDisplay(bool invert)
Definition: CommandScreenHandlerSMQ.h:14
virtual void buttonInReleased()
Definition: CommandScreen.h:336
static bool sendTopic(const smq_id id)
Definition: ReelTwoSMQ.h:155
void restoreScreen()
Definition: CommandScreen.h:417
Definition: CommandScreen.h:147
Definition: CommandScreenHandlerSMQ.h:6
void setEnabled(bool enabled)
Definition: CommandScreen.h:236
void drawTextCentered(String text)
Definition: CommandScreenHandlerSMQ.h:29
void setCursor(uint8_t x, uint8_t y)
Definition: CommandScreenHandlerSMQ.h:35
void println(String text)
Definition: CommandScreenHandlerSMQ.h:51
virtual void buttonRightPressed(bool repeat=false)
Definition: CommandScreen.h:330
virtual void buttonLeftReleased()
Definition: CommandScreen.h:333
ScreenID ID() const
Definition: CommandScreen.h:286
void clearDisplay()
Definition: CommandScreenHandlerSMQ.h:19
virtual bool handleEvent()
Definition: CommandScreenHandlerSMQ.h:97
void display()
Definition: CommandScreenHandlerSMQ.h:56
virtual void buttonDial(long newValue, long oldValue=0)
Definition: CommandScreen.h:337
virtual void buttonUpPressed(bool repeat=false)
Definition: CommandScreen.h:327
static void send_uint8(const msg_id id, uint8_t val)
Definition: ReelTwoSMQ.h:292
virtual void sleepDevice() override
Definition: CommandScreenHandlerSMQ.h:93
virtual void buttonDownReleased()
Definition: CommandScreen.h:334
static void send_boolean(const msg_id id, bool val)
Definition: ReelTwoSMQ.h:412
virtual void buttonUpReleased()
Definition: CommandScreen.h:332
virtual void buttonRightReleased()
Definition: CommandScreen.h:335
virtual void buttonInPressed(bool repeat=false)
Definition: CommandScreen.h:331
virtual void buttonDownPressed(bool repeat=false)
Definition: CommandScreen.h:329
static void send_string(const char *str)
Definition: ReelTwoSMQ.h:106
static void sendEnd()
Definition: ReelTwoSMQ32.h:1103