-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstate_editor.h
55 lines (47 loc) · 1.04 KB
/
state_editor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* state_editor.h
*
* Created on: 29 dec. 2017
* Author: MisterCavespider
*/
#ifndef STATE_EDITOR_H_
#define STATE_EDITOR_H_
#include "enc.h"
#include "model.h"
#include "state_state.h"
typedef struct drawdata drawdata_t;
class EditorState: public ProgramState {
public:
EditorState(
U8G2_ST7920_128X64_F_SW_SPI *u8g2,
EncoderCapsule *encc1,
EncoderCapsule *encc2,
EncoderCapsule *encc3,
StateManager *states)
:ProgramState(u8g2, encc1, encc2, encc3, states, "EDITOR")
{
mdd = NULL;
}
void setup();
void loop();
private:
bool zoomed = false;
selector_t selI, selO;
drawdata_t *mdd;
Module *m = NULL; // !!!
void onZoomedIn();
void whileZoomedIn();
void onZoomedOut();
void whileZoomedOut();
void highlightModule(Module *m);
void drawModule(Module *m);
};
struct drawdata
{
bool calcd = false; // Is it calculated?
bool drawn = false; // Is it drawn?
uint8_t x = 0; // Drawn x (left)
uint8_t y = 0; // Drawn y (center)
uint8_t w = 0; // Frame width (String width + 3)
};
#endif /* STATE_EDITOR_H_ */