-
Notifications
You must be signed in to change notification settings - Fork 1
/
help.ino
executable file
·158 lines (130 loc) · 3.99 KB
/
help.ino
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
void help()
/*
* Help menu
*
*/
{
#define H_TEXT TFT_SILVER
#define H_TITLE TFT_WHITE
#define H_SUBTITLE TFT_SKYBLUE
#define H_PAGE TFT_SKYBLUE
#define H_KEY TFT_ORANGE
if (g.help_mode == 0)
return;
tft.fillScreen(TFT_BLACK);
tft.setCursor(0, 0);
tft.setTextColor(H_TEXT, TFT_BLACK);
switch (g.help_page)
{
case 0:
tft.setTextColor(H_TITLE, TFT_BLACK);
tft.println(" HELP (1/A to scroll)");
help_topic(" MAIN SCREEN");
help_line("1/A", "Rewind/FastForward");
help_line("4", "Set foreground point");
help_line("7", "GoTo foreground pnt");
help_line("B", "Set background point");
help_line("C", "GoTo background pnt");
break;
case 1:
help_line("0", "Switch mode");
help_line("D", "Start shooting");
help_line("5", "Stack step, um");
help_line("8", "Number of shots [1PC]");
tft.println(" Frames per sec [2PC]");
tft.println(" Delay 1, sec [2PN]");
help_line("9", "Delay 2, sec [2PN]");
break;
case 2:
help_line("*", "Alternative screen");
help_line("2", "GoTo (mm)");
help_line("3", "Parking");
help_line("6", "Help");
help_line("#1", "Move one step back");
help_line("#A", "Move one step ahead");
help_line("#B", "Break");
break;
case 3:
help_line("#C", "Calibrate rail");
help_line("#*", "Factory reset");
help_line("#7", "Trigger camera");
help_line("#2/3", "Write/Read bank 1");
help_line("#5/6", "Write/Read bank 2");
help_line("#8/9", "Write/Read bank 3");
help_line("*2/3", "Write/Read bank 4");
break;
case 4:
help_line("*5/6", "Write/Read bank 5");
help_line("*1", "Rail reverse");
help_line("*4", "N timelapse passes");
help_line("*7", "Time between time-");
tft.println(" lapse passes, sec");
help_line("*0", "Save energy on/off");
break;
case 5:
help_line("*A", "Acceleration factor");
tft.println(" larger means slower");
help_line("*9", "Accel factor 2");
help_line("*B", "Backlash mode");
help_line("*C", "Camera mirror mode");
help_line("*D", "Buzzer on/off");
break;
case 6:
help_topic(" WHEN STACKING");
help_line("Any key", "Abort [1PC]");
tft.println(" Pause [2PC,2PN]");
break;
case 7:
help_topic(" WHEN PAUSED");
help_line("D", "Resume stacking");
help_line("1", "Move 10 frames back");
help_line("A", "Move 10 frames ahead");
help_line("2", "GoTo specific frame");
help_line("6", "Help");
break;
case 8:
help_line("#1", "Move 1 frame back");
help_line("#A", "Move 1 frame ahead");
help_line("#B", "Abort stacking");
help_line("#7", "Trigger camera");
break;
case 9:
help_topic(" EDITING MODE");
help_line("0-9", "Type the digit");
help_line("#", "Type dot");
help_line("A", "Accept the number");
help_line("B", "Backspace");
help_line("C", "Cancel");
break;
}
my_setCursor(TFT_NX - 5, TFT_NY, 0);
g.y0 = g.y0 - 16;
tft.setCursor(g.x0, g.y0);
tft.setTextColor(H_PAGE, TFT_BLACK);
tft.setTextFont(1);
tft.print(g.help_page + 1);
tft.print("/");
tft.print(N_HELP_PAGES);
tft.setTextFont(2);
return;
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
void help_line(char* key, char* string)
// Print one line in help mode
{
tft.setTextColor(H_KEY, TFT_BLACK);
tft.print(key);
tft.print(" ");
tft.setTextColor(H_TEXT, TFT_BLACK);
tft.println(string);
return;
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
void help_topic(char* topic)
// Print help topic (one line)
{
tft.setTextColor(H_SUBTITLE, TFT_BLACK);
tft.println(topic);
return;
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++