Mercurial > public > ostc4
annotate Discovery/Src/t7.c @ 436:079f32a8e68c Improve_BatteryGasGauge
Moved power on detection to RTE:
Removed no longer needed funtion to reset the charger status in case of an power on reset
author | ideenmodellierer |
---|---|
date | Sun, 23 Feb 2020 21:18:49 +0100 |
parents | 2b4440f75434 |
children | adb18fe92737 |
rev | line source |
---|---|
38 | 1 /////////////////////////////////////////////////////////////////////////////// |
2 /// -*- coding: UTF-8 -*- | |
3 /// | |
4 /// \file Discovery/Src/t7.c | |
5 /// \brief Main Template file for dive mode 7x | |
6 /// \author Heinrichs Weikamp gmbh | |
7 /// \date 23-April-2014 | |
8 /// | |
9 /// \details | |
10 /// | |
11 /// $Id$ | |
12 /////////////////////////////////////////////////////////////////////////////// | |
13 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh | |
14 /// | |
15 /// This program is free software: you can redistribute it and/or modify | |
16 /// it under the terms of the GNU General Public License as published by | |
17 /// the Free Software Foundation, either version 3 of the License, or | |
18 /// (at your option) any later version. | |
19 /// | |
20 /// This program is distributed in the hope that it will be useful, | |
21 /// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
22 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
23 /// GNU General Public License for more details. | |
24 /// | |
25 /// You should have received a copy of the GNU General Public License | |
26 /// along with this program. If not, see <http://www.gnu.org/licenses/>. | |
27 ////////////////////////////////////////////////////////////////////////////// | |
28 | |
29 /* Includes ------------------------------------------------------------------*/ | |
30 #include "t7.h" | |
31 | |
32 #include "data_exchange_main.h" | |
33 #include "decom.h" | |
34 #include "gfx_fonts.h" | |
35 #include "logbook_miniLive.h" | |
36 #include "math.h" | |
37 #include "tHome.h" | |
38 #include "simulation.h" | |
39 #include "timer.h" | |
40 #include "unit.h" | |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
41 #include "motion.h" |
38 | 42 |
43 /* Private function prototypes -----------------------------------------------*/ | |
44 | |
45 void t7_refresh_surface(void); | |
46 void t7_refresh_surface_debugmode(void); | |
47 void t7_refresh_divemode(void); | |
48 void t7_refresh_sleep_design_fun(void); | |
49 void t7_refresh_divemode_userselected_left_lower_corner(void); | |
50 void t7_refresh_customview(void); | |
405 | 51 uint8_t t7_customview_disabled(uint8_t view); |
38 | 52 |
53 void draw_frame(_Bool PluginBoxHeader, _Bool LinesOnTheSides, uint8_t colorBox, uint8_t colorLinesOnTheSide); | |
54 | |
55 void t7_tissues(const SDiveState * pState); | |
56 void t7_compass(uint16_t ActualHeading, uint16_t UserSetHeading); | |
57 void t7_SummaryOfLeftCorner(void); | |
58 void t7_debug(void); | |
59 | |
60 void t7_miniLiveLogProfile(void); | |
61 void t7_logo_OSTC(void); | |
196
2885628ab3ba
Bugfix, minor: color the overview customview correctly
Jan Mulder <jlmulder@xs4all.nl>
parents:
193
diff
changeset
|
62 static void t7_colorscheme_mod(char *text); |
38 | 63 |
64 uint8_t t7_test_customview_warnings(void); | |
65 void t7_show_customview_warnings(void); | |
66 | |
67 uint8_t t7_test_customview_warnings_surface_mode(void); | |
68 void t7_show_customview_warnings_surface_mode(void); | |
69 | |
70 uint8_t t7_customtextPrepare(char * text); | |
71 | |
193
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
72 /* Imported function prototypes ---------------------------------------------*/ |
38 | 73 extern uint8_t write_gas(char *text, uint8_t oxygen, uint8_t helium); |
74 | |
75 /* Exported variables --------------------------------------------------------*/ | |
76 | |
77 /* Private variables ---------------------------------------------------------*/ | |
78 | |
79 GFX_DrawCfgScreen t7screen; | |
80 GFX_DrawCfgScreen t7screenCompass; | |
81 | |
82 /* left 3 fields | |
83 * right 3 fields | |
84 * centered one field on top of customview, one below | |
85 * customview header + customview + warning | |
86 */ | |
87 GFX_DrawCfgWindow t7l1, t7l2, t7l3; | |
88 GFX_DrawCfgWindow t7r1, t7r2, t7r3; | |
89 GFX_DrawCfgWindow t7c1, t7batt, t7c2, t7charge, t7voltage; | |
90 GFX_DrawCfgWindow t7cH, t7cC, t7cW, t7cY0free; | |
91 GFX_DrawCfgWindow t7pCompass; | |
92 GFX_DrawCfgWindow t7surfaceL, t7surfaceR; | |
93 | |
94 uint8_t selection_custom_field = 1; | |
95 uint8_t selection_customview = 1; | |
96 | |
97 uint8_t updateNecessary = 0; | |
98 | |
99 typedef struct{ | |
100 uint32_t pointer; | |
101 uint32_t x0; | |
102 uint32_t y0; | |
103 uint32_t width; | |
104 uint32_t height; | |
105 } SBackground; | |
106 | |
107 SBackground background = | |
108 { | |
166
255eedad4155
cleanup: get rid of some compile warnings
Jan Mulder <jlmulder@xs4all.nl>
parents:
149
diff
changeset
|
109 .pointer = 0, |
38 | 110 }; |
111 | |
112 | |
113 /* Private types -------------------------------------------------------------*/ | |
114 const uint8_t customviewsDiveStandard[] = | |
115 { | |
116 CVIEW_sensors, | |
117 CVIEW_Compass, | |
118 CVIEW_Decolist, | |
119 CVIEW_Tissues, | |
120 CVIEW_Profile, | |
121 CVIEW_Gaslist, | |
122 CVIEW_sensors_mV, | |
123 CVIEW_EADTime, | |
124 CVIEW_SummaryOfLeftCorner, | |
125 CVIEW_noneOrDebug, | |
126 CVIEW_END, | |
127 CVIEW_END | |
128 }; | |
129 | |
130 const uint8_t customviewsSurfaceStandard[] = | |
131 { | |
132 // CVIEW_CompassDebug, | |
133 CVIEW_Hello, | |
134 CVIEW_sensors, | |
135 CVIEW_Compass, | |
136 CVIEW_Tissues, | |
137 CVIEW_sensors_mV, | |
138 CVIEW_END, | |
139 CVIEW_END | |
140 }; | |
141 | |
142 const uint8_t *customviewsDive = customviewsDiveStandard; | |
143 const uint8_t *customviewsSurface = customviewsSurfaceStandard; | |
144 | |
145 #define TEXTSIZE 16 | |
146 /* offset includes line: 2 = line +1 | |
147 * box (line) is 300 px | |
148 * inside is 296 px | |
149 * left of box are 249 px ( 0..248) | |
150 * right of box are 249 px (551 .. 799) | |
151 */ | |
152 | |
153 #define CUSTOMBOX_LINE_LEFT (250) | |
154 #define CUSTOMBOX_LINE_RIGHT (549) | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
155 #define CUSTOMBOX_LINE_TOP (0) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
156 #define CUSTOMBOX_LINE_MIDDLE (142) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
157 #define CUSTOMBOX_LINE_BOTTOM (318) |
38 | 158 #define CUSTOMBOX_INSIDE_OFFSET (2) |
159 #define CUSTOMBOX_OUTSIDE_OFFSET (2) | |
160 #define CUSTOMBOX_SPACE_INSIDE (CUSTOMBOX_LINE_RIGHT + 1 - (CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + CUSTOMBOX_INSIDE_OFFSET)) | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
161 #define TOP_LINE_HIGHT (25) |
38 | 162 |
336
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
163 #define SHOW_AMBIENTE_SURFACE_DELTA (0.02f) |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
164 #define SHOW_AMBIENTE_DEBOUNCE (0.003f) |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
165 |
38 | 166 /* Exported functions --------------------------------------------------------*/ |
167 | |
168 void t7_init(void) | |
169 { | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
170 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
171 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
172 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
173 |
38 | 174 selection_custom_field = 1; |
175 selection_customview = customviewsSurface[0]; | |
176 | |
177 t7screen.FBStartAdress = 0; | |
178 t7screen.ImageHeight = 480; | |
179 t7screen.ImageWidth = 800; | |
180 t7screen.LayerIndex = 1; | |
181 | |
182 t7screenCompass.FBStartAdress = 0; | |
183 t7screenCompass.ImageHeight = 240; | |
184 t7screenCompass.ImageWidth = 1600; | |
185 t7screenCompass.LayerIndex = 0; | |
186 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
187 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
188 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
189 t7l1.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
190 t7l1.WindowNumberOfTextLines = 2; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
191 t7l1.WindowLineSpacing = 19; // Abstand von Y0 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
192 t7l1.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
193 t7l1.WindowX0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
194 t7l1.WindowX1 = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
195 t7l1.WindowY0 = 318; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
196 t7l1.WindowY1 = 479; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
197 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
198 t7l2.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
199 t7l2.WindowNumberOfTextLines = 2; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
200 t7l2.WindowLineSpacing = 22; // Abstand von Y0 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
201 t7l2.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
202 t7l2.WindowX0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
203 t7l2.WindowX1 = t7l1.WindowX1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
204 t7l2.WindowY0 = 142; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
205 t7l2.WindowY1 = t7l1.WindowY0 - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
206 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
207 t7l3.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
208 t7l3.WindowNumberOfTextLines = 2; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
209 t7l3.WindowLineSpacing = 58; // Abstand von Y0 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
210 t7l3.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
211 t7l3.WindowX0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
212 t7l3.WindowX1 = t7l1.WindowX1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
213 t7l3.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
214 t7l3.WindowY1 = t7l2.WindowY0 - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
215 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
216 t7r1.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
217 t7r1.WindowNumberOfTextLines = 2; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
218 t7r1.WindowLineSpacing = t7l1.WindowLineSpacing; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
219 t7r1.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
220 t7r1.WindowX0 = 550; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
221 t7r1.WindowX1 = 799; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
222 t7r1.WindowY0 = t7l1.WindowY0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
223 t7r1.WindowY1 = 479; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
224 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
225 t7r2.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
226 t7r2.WindowNumberOfTextLines = 2; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
227 t7r2.WindowLineSpacing = t7l2.WindowLineSpacing; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
228 t7r2.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
229 t7r2.WindowX0 = 550; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
230 t7r2.WindowX1 = 799; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
231 t7r2.WindowY0 = t7l2.WindowY0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
232 t7r2.WindowY1 = t7l2.WindowY1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
233 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
234 t7r3.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
235 t7r3.WindowNumberOfTextLines = 2; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
236 t7r3.WindowLineSpacing = 0;//t7l3.WindowLineSpacing; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
237 t7r3.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
238 t7r3.WindowX0 = CUSTOMBOX_LINE_RIGHT + CUSTOMBOX_OUTSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
239 t7r3.WindowX1 = 799; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
240 t7r3.WindowY0 = t7l3.WindowY0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
241 t7r3.WindowY1 = t7l3.WindowY1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
242 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
243 t7cC.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
244 t7cC.WindowNumberOfTextLines = 3; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
245 t7cC.WindowLineSpacing = 95; // Abstand von Y0 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
246 t7cC.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
247 t7cC.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
248 t7cC.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
249 t7cC.WindowY0 = 90; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
250 t7cC.WindowY1 = 434 - 95; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
251 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
252 t7cH.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
253 t7cH.WindowNumberOfTextLines = 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
254 t7cH.WindowLineSpacing = 95; // Abstand von Y0 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
255 t7cH.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
256 t7cH.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
257 t7cH.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
258 t7cH.WindowY0 = 434 - 94; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
259 t7cH.WindowY1 = 434; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
260 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
261 t7cW.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
262 t7cW.WindowNumberOfTextLines = 3; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
263 t7cW.WindowLineSpacing = 95; // Abstand von Y0 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
264 t7cW.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
265 t7cW.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
266 t7cW.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
267 t7cW.WindowY0 = 90; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
268 t7cW.WindowY1 = 434 - 95; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
269 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
270 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
271 t7surfaceL.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
272 t7surfaceL.WindowNumberOfTextLines = 9; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
273 t7surfaceL.WindowLineSpacing = 53; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
274 t7surfaceL.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
275 t7surfaceL.WindowX0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
276 t7surfaceL.WindowX1 = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
277 t7surfaceL.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
278 t7surfaceL.WindowY1 = 480; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
279 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
280 t7surfaceR.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
281 t7surfaceR.WindowNumberOfTextLines = 9; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
282 t7surfaceR.WindowLineSpacing = 53; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
283 t7surfaceR.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
284 t7surfaceR.WindowX0 = CUSTOMBOX_LINE_RIGHT + CUSTOMBOX_OUTSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
285 t7surfaceR.WindowX1 = 800; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
286 t7surfaceR.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
287 t7surfaceR.WindowY1 = 480; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
288 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
289 t7cY0free.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
290 t7cY0free.WindowNumberOfTextLines = 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
291 t7cY0free.WindowLineSpacing = 95; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
292 t7cY0free.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
293 t7cY0free.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
294 t7cY0free.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
295 t7cY0free.WindowY0 = 90; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
296 t7cY0free.WindowY1 = 434 - 95; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
297 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
298 t7batt.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
299 t7batt.WindowNumberOfTextLines = 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
300 t7batt.WindowLineSpacing = 10; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
301 t7batt.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
302 t7batt.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
303 t7batt.WindowX0 = t7batt.WindowX1 - (52+52); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
304 t7batt.WindowY1 = 479; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
305 t7batt.WindowY0 = t7batt.WindowY1 - 25; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
306 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
307 t7charge.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
308 t7charge.WindowNumberOfTextLines = 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
309 t7charge.WindowLineSpacing = 10; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
310 t7charge.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
311 t7charge.WindowX1 = t7batt.WindowX1 - 18; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
312 t7charge.WindowX0 = t7charge.WindowX1 - 14; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
313 t7charge.WindowY1 = 479; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
314 t7charge.WindowY0 = t7batt.WindowY1 - 25; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
315 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
316 t7voltage.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
317 t7voltage.WindowNumberOfTextLines = 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
318 t7voltage.WindowLineSpacing = 10; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
319 t7voltage.WindowTab = 100; |
145 | 320 t7voltage.WindowX0 = t7charge.WindowX0 - 10; |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
321 t7voltage.WindowX1 = t7voltage.WindowX0 + (18*3)+ 9; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
322 t7voltage.WindowY1 = 479; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
323 t7voltage.WindowY0 = t7batt.WindowY1 - 25; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
324 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
325 t7c1.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
326 t7c1.WindowNumberOfTextLines = 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
327 t7c1.WindowLineSpacing = 10; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
328 t7c1.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
329 t7c1.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
330 t7c1.WindowX1 = t7batt.WindowX0 - 18; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
331 t7c1.WindowY0 = 435; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
332 t7c1.WindowY1 = 479; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
333 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
334 t7c2.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
335 t7c2.WindowNumberOfTextLines = 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
336 t7c2.WindowLineSpacing = 0; // Abstand von Y0 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
337 t7c2.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
338 t7c2.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
339 t7c2.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
340 t7c2.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
341 t7c2.WindowY1 = 69; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
342 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
343 t7pCompass.Image = &t7screenCompass; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
344 t7pCompass.WindowNumberOfTextLines = 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
345 t7pCompass.WindowLineSpacing = 100; // Abstand von Y0 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
346 t7pCompass.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
347 t7pCompass.WindowX0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
348 t7pCompass.WindowX1 = 1600-1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
349 t7pCompass.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
350 t7pCompass.WindowY1 = 100-1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
351 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
352 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
353 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
354 /* 6 segments (left / right) used to show data during dive */ |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
355 |
38 | 356 t7l1.Image = &t7screen; |
357 t7l1.WindowNumberOfTextLines = 2; | |
358 t7l1.WindowLineSpacing = 19; // Abstand von Y0 | |
359 t7l1.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
360 t7l1.WindowX0 = CUSTOMBOX_LINE_RIGHT + CUSTOMBOX_OUTSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
361 t7l1.WindowX1 = 799; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
362 t7l1.WindowY0 = CUSTOMBOX_LINE_TOP; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
363 t7l1.WindowY1 = 150 + TOP_LINE_HIGHT; |
38 | 364 |
365 t7l2.Image = &t7screen; | |
366 t7l2.WindowNumberOfTextLines = 2; | |
367 t7l2.WindowLineSpacing = 22; // Abstand von Y0 | |
368 t7l2.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
369 t7l2.WindowX0 = t7l1.WindowX0; |
38 | 370 t7l2.WindowX1 = t7l1.WindowX1; |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
371 t7l2.WindowY0 = t7l1.WindowY1 + 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
372 t7l2.WindowY1 = t7l2.WindowY0 + 146; |
38 | 373 |
374 t7l3.Image = &t7screen; | |
375 t7l3.WindowNumberOfTextLines = 2; | |
376 t7l3.WindowLineSpacing = 58; // Abstand von Y0 | |
377 t7l3.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
378 t7l3.WindowX0 = t7l1.WindowX0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
379 t7l3.WindowX1 = t7l1.WindowX1;; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
380 t7l3.WindowY0 = 479 - 150; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
381 t7l3.WindowY1 = 479; |
38 | 382 |
383 t7r1.Image = &t7screen; | |
384 t7r1.WindowNumberOfTextLines = 2; | |
385 t7r1.WindowLineSpacing = t7l1.WindowLineSpacing; | |
386 t7r1.WindowTab = 100; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
387 t7r1.WindowX0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
388 t7r1.WindowX1 = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET; |
38 | 389 t7r1.WindowY0 = t7l1.WindowY0; |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
390 t7r1.WindowY1 = t7l1.WindowY1; |
38 | 391 |
392 t7r2.Image = &t7screen; | |
393 t7r2.WindowNumberOfTextLines = 2; | |
394 t7r2.WindowLineSpacing = t7l2.WindowLineSpacing; | |
395 t7r2.WindowTab = 100; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
396 t7r2.WindowX0 = t7r1.WindowX0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
397 t7r2.WindowX1 = t7r1.WindowX1; |
38 | 398 t7r2.WindowY0 = t7l2.WindowY0; |
399 t7r2.WindowY1 = t7l2.WindowY1; | |
400 | |
401 t7r3.Image = &t7screen; | |
402 t7r3.WindowNumberOfTextLines = 2; | |
403 t7r3.WindowLineSpacing = 0;//t7l3.WindowLineSpacing; | |
404 t7r3.WindowTab = 100; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
405 t7r3.WindowX0 = t7r1.WindowX0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
406 t7r3.WindowX1 = t7r1.WindowX1; |
38 | 407 t7r3.WindowY0 = t7l3.WindowY0; |
408 t7r3.WindowY1 = t7l3.WindowY1; | |
409 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
410 /* screen for CustomText / serial number */ |
38 | 411 t7cC.Image = &t7screen; |
412 t7cC.WindowNumberOfTextLines = 3; | |
413 t7cC.WindowLineSpacing = 95; // Abstand von Y0 | |
414 t7cC.WindowTab = 100; | |
415 t7cC.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; | |
416 t7cC.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
417 t7cC.WindowY0 = 165; //90; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
418 t7cC.WindowY1 = 415; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
419 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
420 /* used by warning message box */ |
38 | 421 t7cH.Image = &t7screen; |
422 t7cH.WindowNumberOfTextLines = 1; | |
423 t7cH.WindowLineSpacing = 95; // Abstand von Y0 | |
424 t7cH.WindowTab = 100; | |
425 t7cH.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; | |
426 t7cH.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
427 t7cH.WindowY0 = 46; //480 - 434; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
428 t7cH.WindowY1 = 390 - 46;// - 90; //46 + 390; //480 - (434 - 94); //434; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
429 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
430 /* used by warning custom box */ |
38 | 431 t7cW.Image = &t7screen; |
432 t7cW.WindowNumberOfTextLines = 3; | |
433 t7cW.WindowLineSpacing = 95; // Abstand von Y0 | |
434 t7cW.WindowTab = 100; | |
435 t7cW.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; | |
436 t7cW.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
437 t7cW.WindowY0 = 480 - (434 - 90); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
438 t7cW.WindowY1 = 480 - 90; //434 - 95; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
439 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
440 /* time and environment */ |
38 | 441 t7surfaceL.Image = &t7screen; |
442 t7surfaceL.WindowNumberOfTextLines = 9; | |
443 t7surfaceL.WindowLineSpacing = 53; | |
444 t7surfaceL.WindowTab = 100; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
445 t7surfaceL.WindowX0 = CUSTOMBOX_LINE_RIGHT + CUSTOMBOX_OUTSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
446 t7surfaceL.WindowX1 = 799; |
38 | 447 t7surfaceL.WindowY0 = 0; |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
448 t7surfaceL.WindowY1 = 479; |
38 | 449 |
450 t7surfaceR.Image = &t7screen; | |
451 t7surfaceR.WindowNumberOfTextLines = 9; | |
452 t7surfaceR.WindowLineSpacing = 53; | |
453 t7surfaceR.WindowTab = 100; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
454 t7surfaceR.WindowX0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
455 t7surfaceR.WindowX1 = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET; |
38 | 456 t7surfaceR.WindowY0 = 0; |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
457 t7surfaceR.WindowY1 = 479; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
458 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
459 /* info screen in the middle */ |
38 | 460 t7cY0free.Image = &t7screen; |
461 t7cY0free.WindowNumberOfTextLines = 1; | |
462 t7cY0free.WindowLineSpacing = 95; | |
463 t7cY0free.WindowTab = 100; | |
464 t7cY0free.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; | |
465 t7cY0free.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
466 t7cY0free.WindowY0 = 115; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
467 t7cY0free.WindowY1 = 365; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
468 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
469 /* voltage value (V or %) */ |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
470 t7voltage.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
471 t7voltage.WindowNumberOfTextLines = 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
472 t7voltage.WindowLineSpacing = 10; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
473 t7voltage.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
474 t7voltage.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
475 t7voltage.WindowX1 = t7voltage.WindowX0 + (18*3) +9; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
476 t7voltage.WindowY1 = TOP_LINE_HIGHT; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
477 t7voltage.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
478 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
479 /* battery symbol */ |
38 | 480 t7batt.Image = &t7screen; |
481 t7batt.WindowNumberOfTextLines = 1; | |
482 t7batt.WindowLineSpacing = 10; | |
483 t7batt.WindowTab = 100; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
484 t7batt.WindowX0 = t7voltage.WindowX1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
485 t7batt.WindowX1 = t7batt.WindowX0 + (52); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
486 t7batt.WindowY1 = TOP_LINE_HIGHT; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
487 t7batt.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
488 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
489 /* charger symbol */ |
38 | 490 t7charge.Image = &t7screen; |
491 t7charge.WindowNumberOfTextLines = 1; | |
492 t7charge.WindowLineSpacing = 10; | |
493 t7charge.WindowTab = 100; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
494 t7charge.WindowX1 = t7batt.WindowX0 - 18; |
38 | 495 t7charge.WindowX0 = t7charge.WindowX1 - 14; |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
496 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
497 t7charge.WindowY1 = TOP_LINE_HIGHT; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
498 t7charge.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
499 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
500 /* show dive mode OC / CC */ |
38 | 501 t7c1.Image = &t7screen; |
502 t7c1.WindowNumberOfTextLines = 1; | |
503 t7c1.WindowLineSpacing = 10; | |
504 t7c1.WindowTab = 100; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
505 t7c1.WindowX0 = t7batt.WindowX1 + 18; //CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
506 t7c1.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; //t7batt.WindowX1 + 18; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
507 t7c1.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
508 t7c1.WindowY1 = 479 - 435; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
509 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
510 /* Gas warnings and exit Sim*/ |
38 | 511 t7c2.Image = &t7screen; |
512 t7c2.WindowNumberOfTextLines = 1; | |
513 t7c2.WindowLineSpacing = 0; // Abstand von Y0 | |
514 t7c2.WindowTab = 100; | |
515 t7c2.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; | |
516 t7c2.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
517 t7c2.WindowY0 = 480 - 69; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
518 t7c2.WindowY1 = 479; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
519 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
520 /* Rotating compass */ |
38 | 521 t7pCompass.Image = &t7screenCompass; |
522 t7pCompass.WindowNumberOfTextLines = 1; | |
523 t7pCompass.WindowLineSpacing = 100; // Abstand von Y0 | |
524 t7pCompass.WindowTab = 100; | |
525 t7pCompass.WindowX0 = 0; | |
526 t7pCompass.WindowX1 = 1600-1; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
527 t7pCompass.WindowY0 = 479 - 75; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
528 t7pCompass.WindowY1 = 479; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
529 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
530 } |
38 | 531 |
532 init_t7_compass(); | |
533 } | |
534 | |
535 | |
536 void t7_refresh_sleepmode_fun(void) | |
537 { | |
538 uint32_t oldScreen; | |
539 | |
540 oldScreen = t7screen.FBStartAdress; | |
541 t7screen.FBStartAdress = getFrame(22); | |
542 | |
543 t7_refresh_sleep_design_fun(); | |
544 | |
545 if(get_globalState() == StStop) | |
546 { | |
166
255eedad4155
cleanup: get rid of some compile warnings
Jan Mulder <jlmulder@xs4all.nl>
parents:
149
diff
changeset
|
547 GFX_SetFramesTopBottom(t7screen.FBStartAdress, 0,480); |
38 | 548 } |
549 releaseFrame(22,oldScreen); | |
550 } | |
551 | |
552 | |
553 void t7_refresh(void) | |
554 { | |
555 static uint8_t last_mode = MODE_SURFACE; | |
556 SStateList status; | |
557 get_globalStateList(&status); | |
558 | |
559 t7screen.FBStartAdress = getFrame(22); | |
560 | |
561 background.pointer = 0; | |
562 | |
563 if(stateUsed->mode == MODE_DIVE) | |
564 { | |
565 if(last_mode != MODE_DIVE) | |
566 { | |
567 last_mode = MODE_DIVE; | |
568 /* lower left corner primary */ | |
569 selection_custom_field = settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary; | |
570 /* custom view primary OR debug if automatic return is off */ | |
571 if((settingsGetPointer()->tX_customViewTimeout == 0) && (settingsGetPointer()->showDebugInfo)) | |
572 selection_customview = CVIEW_noneOrDebug; | |
573 else | |
574 selection_customview = settingsGetPointer()->tX_customViewPrimary; | |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
575 |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
576 InitMotionDetection(); |
38 | 577 } |
578 | |
579 if(status.page == PageSurface) | |
580 set_globalState(StD); | |
581 | |
582 if(stateUsed->diveSettings.diveMode == DIVEMODE_Gauge) | |
583 { | |
584 settingsGetPointer()->design = 5; | |
585 releaseAllFramesExcept(22,t7screen.FBStartAdress); | |
586 releaseFrame(22,t7screen.FBStartAdress); | |
587 return; | |
588 } | |
589 else if(stateUsed->diveSettings.diveMode == DIVEMODE_Apnea) | |
590 { | |
591 settingsGetPointer()->design = 6; | |
592 releaseAllFramesExcept(22,t7screen.FBStartAdress); | |
593 releaseFrame(22,t7screen.FBStartAdress); | |
594 return; | |
595 } | |
596 else | |
597 { | |
598 t7_refresh_divemode(); | |
599 } | |
600 } | |
601 else // from if(stateUsed->mode == MODE_DIVE) | |
602 { | |
603 if(last_mode != MODE_SURFACE) | |
604 { | |
605 last_mode = MODE_SURFACE; | |
606 selection_customview = customviewsSurface[0]; | |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
607 InitMotionDetection(); |
38 | 608 } |
609 if(status.page == PageDive) | |
610 set_globalState(StS); | |
611 | |
612 if(settingsGetPointer()->showDebugInfo) | |
613 t7_refresh_surface_debugmode(); | |
614 else | |
615 t7_refresh_surface(); | |
616 } | |
617 | |
618 tHome_show_lost_connection_count(&t7screen); | |
619 | |
620 if(status.base == BaseHome) | |
621 { | |
622 if(background.pointer) | |
623 { | |
624 GFX_SetFrameTop(t7screen.FBStartAdress); | |
625 GFX_SetFrameBottom(background.pointer,background.x0 , background.y0, background.width, background.height); | |
626 } | |
627 else | |
166
255eedad4155
cleanup: get rid of some compile warnings
Jan Mulder <jlmulder@xs4all.nl>
parents:
149
diff
changeset
|
628 GFX_SetFramesTopBottom(t7screen.FBStartAdress, 0,480); |
38 | 629 } |
630 | |
631 releaseAllFramesExcept(22,t7screen.FBStartAdress); | |
632 } | |
633 | |
634 /* Private functions ---------------------------------------------------------*/ | |
635 | |
636 void t7_fill_surfacetime_helper(SSurfacetime *outArray, uint32_t inputMinutes, uint32_t inputSeconds) | |
637 { | |
638 inputSeconds += inputMinutes * 60; | |
639 | |
640 outArray->Total = inputSeconds; | |
641 | |
642 outArray->Days = inputSeconds / 86400;// (24*60*60); | |
643 inputSeconds -= 86400 * (uint32_t)outArray->Days; | |
644 | |
645 outArray->Hours = inputSeconds / 3600;// (60*60); | |
646 inputSeconds -= 3600 * (uint32_t)outArray->Hours; | |
647 | |
648 outArray->Minutes = inputSeconds / 60;; | |
649 inputSeconds -= 60 * (uint32_t)outArray->Minutes; | |
650 | |
651 outArray->Seconds = inputSeconds; | |
652 } | |
653 | |
654 void t7_refresh_sleep_design_fun(void) | |
655 { | |
656 static uint16_t state = 0; | |
657 uint16_t ytop = 0; | |
658 | |
659 state +=1; | |
660 if(state > 800) | |
661 state = 1; | |
662 | |
663 if(state > 400) | |
664 ytop = 800 - state; | |
665 else | |
666 ytop = 0 + state; | |
178
d36596281501
Minor: Replace stupid "Sleep Sleep Sleep" message with something more meaningful
heinrichsweikamp
parents:
174
diff
changeset
|
667 Gfx_write_label_var(&t7screen, 300,800, ytop,&FontT48,CLUT_Font020,"Shutting down..."); |
38 | 668 } |
669 | |
670 void t7_refresh_surface(void) | |
671 { | |
336
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
672 static float debounceAmbientPressure = 0; |
38 | 673 char text[256]; |
674 uint8_t date[3], year,month,day; | |
675 uint32_t color; | |
676 uint8_t customview_warnings = 0; | |
677 | |
678 RTC_DateTypeDef Sdate; | |
679 RTC_TimeTypeDef Stime; | |
680 RTC_DateTypeDef SdateFirmware; | |
681 | |
682 uint8_t dateNotSet = 0; | |
683 | |
684 uint8_t oxygen_percentage, gasOffset, actualGasID; | |
685 // uint16_t bottleFirstGas_bar; | |
686 point_t start, stop;//, other; | |
687 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
688 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
689 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
690 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
691 |
38 | 692 // update in all customview modes |
693 if(DataEX_check_RTE_version__needs_update() || font_update_required()) | |
694 updateNecessary = 1; | |
695 else | |
696 updateNecessary = 0; | |
697 | |
698 /* buttons */ | |
699 text[0] = TXT_2BYTE; | |
700 text[1] = TXT2BYTE_ButtonLogbook; | |
701 text[2] = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
702 write_content_simple(&t7screen, 0, 799, 479-TOP_LINE_HIGHT, &FontT24,text,CLUT_ButtonSurfaceScreen); |
38 | 703 |
704 text[0] = '\001'; | |
705 text[1] = TXT_2BYTE; | |
706 text[2] = TXT2BYTE_ButtonView; | |
707 text[3] = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
708 write_content_simple(&t7screen, 0, 799, 479-TOP_LINE_HIGHT, &FontT24,text,CLUT_ButtonSurfaceScreen); |
38 | 709 |
710 text[0] = '\002'; | |
711 text[1] = TXT_2BYTE; | |
712 text[2] = TXT2BYTE_ButtonMenu; | |
713 text[3] = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
714 write_content_simple(&t7screen, 0, 799, 479-TOP_LINE_HIGHT, &FontT24,text,CLUT_ButtonSurfaceScreen); |
38 | 715 |
716 /* was power on reset */ | |
717 //..... | |
718 /* removed hw 160802 in V1.1.1 | |
719 if(errorsInSettings) | |
720 { | |
721 sprintf(text,"Settings: %u",errorsInSettings); | |
722 GFX_write_string_color(&FontT42,&t7surfaceR,text,4,CLUT_WarningRed); | |
723 } | |
724 else | |
725 */ | |
726 if(DataEX_was_power_on()) | |
727 GFX_write_string_color(&FontT42,&t7surfaceR,"cold start",4,CLUT_WarningRed); | |
728 | |
729 /* time and date */ | |
730 translateDate(stateUsed->lifeData.dateBinaryFormat, &Sdate); | |
731 translateTime(stateUsed->lifeData.timeBinaryFormat, &Stime); | |
732 | |
733 firmwareGetDate(&SdateFirmware); | |
734 if(tHome_DateCode(&Sdate) < tHome_DateCode(&SdateFirmware)) | |
735 dateNotSet = 1; | |
736 else | |
737 dateNotSet = 0; | |
738 /* | |
739 if(Stime.Seconds % 2) | |
740 snprintf(text,255,"\001%02d:%02d",Stime.Hours,Stime.Minutes); | |
741 else | |
742 snprintf(text,255,"\001%02d\021:\020%02d",Stime.Hours,Stime.Minutes); | |
743 GFX_write_string(&FontT54,&t7surfaceR,text,3); | |
744 */ | |
745 // debug version: | |
746 if(Stime.Seconds % 2) | |
747 snprintf(text,255,"\001%02d:%02d:%02d",Stime.Hours,Stime.Minutes,Stime.Seconds); | |
748 else if(dateNotSet) | |
749 snprintf(text,255,"\001\021%02d:%02d:%02d\020",Stime.Hours,Stime.Minutes,Stime.Seconds); | |
750 else | |
751 snprintf(text,255,"\001%02d\021:\020%02d:%02d",Stime.Hours,Stime.Minutes,Stime.Seconds); | |
752 GFX_write_string(&FontT54,&t7surfaceR,text,3); | |
753 | |
754 if(settingsGetPointer()->date_format == DDMMYY) | |
755 { | |
756 day = 0; | |
757 month = 1; | |
758 year = 2; | |
759 } | |
760 else | |
761 if(settingsGetPointer()->date_format == MMDDYY) | |
762 { | |
763 day = 1; | |
764 month = 0; | |
765 year = 2; | |
766 } | |
767 else | |
768 { | |
769 day = 2; | |
770 month = 1; | |
771 year = 0; | |
772 } | |
773 date[day] = Sdate.Date; | |
774 date[month] = Sdate.Month; | |
775 date[year] = Sdate.Year; | |
776 | |
777 if((Stime.Seconds % 2) || (dateNotSet == 0)) | |
778 snprintf(text,255,"\001%02d.%02d.%02d",date[0],date[1],date[2]); | |
779 else | |
780 snprintf(text,255,"\001\021%02d.%02d.%02d",date[0],date[1],date[2]); | |
781 | |
782 GFX_write_string(&FontT54,&t7surfaceR,text,5); | |
783 | |
784 if(!DataEX_was_power_on() && !errorsInSettings) | |
785 { | |
786 text[0] = '\001'; | |
787 text[1] = '\004'; | |
788 text[2] = TXT_2BYTE; | |
789 text[3] = TXT2BYTE_Sunday; | |
790 text[4] = 0; | |
791 if(Sdate.WeekDay != RTC_WEEKDAY_SUNDAY) | |
792 text[3] += Sdate.WeekDay; | |
793 | |
794 if(!(Stime.Seconds % 2) && (dateNotSet == 1)) | |
795 text[1] = '\021'; | |
796 | |
797 GFX_write_string(&FontT24,&t7surfaceR,text,4); | |
798 } | |
799 | |
800 /* DEBUG uTick Pressure and Compass */ | |
801 /* | |
802 snprintf(text,255,"\001%u",stateRealGetPointer()->pressure_uTick_new - stateRealGetPointer()->pressure_uTick_old); | |
803 GFX_write_string(&FontT42,&t7surfaceR,text,1); | |
804 snprintf(text,255,"\001%u",HAL_GetTick() - stateRealGetPointer()->pressure_uTick_local_new); | |
805 GFX_write_string(&FontT42,&t7surfaceR,text,2); | |
806 | |
807 snprintf(text,255,"\001%u",stateRealGetPointer()->compass_uTick_new - stateRealGetPointer()->compass_uTick_old); | |
808 GFX_write_string(&FontT42,&t7surfaceR,text,6); | |
809 snprintf(text,255,"\001%u",HAL_GetTick() - stateRealGetPointer()->compass_uTick_local_new); | |
810 GFX_write_string(&FontT42,&t7surfaceR,text,7); | |
811 | |
812 static uint32_t bildschirmRefresh = 0; | |
813 snprintf(text,255,"\001%u",HAL_GetTick() - bildschirmRefresh); | |
814 GFX_write_string(&FontT42,&t7surfaceR,text,8); | |
815 bildschirmRefresh = HAL_GetTick(); | |
816 | |
817 static uint16_t bildschirmRefreshCount = 1; | |
818 if(bildschirmRefreshCount>10) | |
819 bildschirmRefreshCount = 1; | |
820 for(int i=0;i<bildschirmRefreshCount;i++) | |
821 text[i] = '.'; | |
822 text[bildschirmRefreshCount++] = 0; | |
823 GFX_write_string(&FontT42,&t7surfaceR,text,4); | |
824 */ | |
825 | |
826 /* noFlyTime or DesaturationTime */ | |
827 | |
828 if((!display_count_high_time) && (stateUsed->lifeData.no_fly_time_minutes)) | |
829 { | |
830 SSurfacetime NoFlyTime = {0,0,0,0}; | |
831 t7_fill_surfacetime_helper(&NoFlyTime,stateUsed->lifeData.no_fly_time_minutes, 0); | |
832 | |
833 if(NoFlyTime.Days) | |
834 { | |
835 snprintf(text,30,"\001%02d\016\016d\017 %02d\016\016h\017",NoFlyTime.Days, NoFlyTime.Hours); | |
836 } | |
837 else | |
838 { | |
839 snprintf(text,20,"\001%02d:%02d",NoFlyTime.Hours, NoFlyTime.Minutes); | |
840 } | |
841 | |
842 GFX_write_string(&FontT54,&t7surfaceR,text,7); | |
843 | |
844 text[0] = '\001'; | |
845 text[1] = '\022'; | |
846 text[2] = '\016'; | |
847 text[3] = '\016'; | |
848 text[4] = TXT_2BYTE; | |
849 text[5] = TXT2BYTE_noFly; | |
850 text[6] = 0; | |
851 GFX_write_string(&FontT48,&t7surfaceR,text,6); | |
852 } | |
853 else | |
854 if(stateUsed->lifeData.desaturation_time_minutes) | |
855 { | |
856 SSurfacetime DesatTime = {0,0,0,0}; | |
857 t7_fill_surfacetime_helper(&DesatTime,stateUsed->lifeData.desaturation_time_minutes, 0); | |
858 | |
859 if(DesatTime.Days) | |
860 { | |
861 snprintf(text,30,"\001%02d\016\016d\017 %02d\016\016h\017",DesatTime.Days, DesatTime.Hours); | |
862 } | |
863 else | |
864 { | |
865 snprintf(text,20,"\001%02d:%02d",DesatTime.Hours, DesatTime.Minutes); | |
866 } | |
867 GFX_write_string(&FontT54,&t7surfaceR,text,7); | |
868 | |
869 text[0] = '\001'; | |
870 text[1] = '\022'; | |
871 text[2] = '\016'; | |
872 text[3] = '\016'; | |
873 text[4] = TXT_2BYTE; | |
874 text[5] = TXT2BYTE_Desaturation; | |
875 text[6] = 0; | |
876 GFX_write_string(&FontT48,&t7surfaceR,text,6); | |
877 } | |
878 | |
879 /* Time since last dive */ | |
880 if(stateUsed->lifeData.surface_time_seconds) | |
881 { | |
882 SSurfacetime SurfTime = {0,0,0,0}; | |
883 t7_fill_surfacetime_helper(&SurfTime, 0, stateUsed->lifeData.surface_time_seconds); | |
884 | |
885 if(SurfTime.Days == 0) | |
886 { | |
887 snprintf(text,20,"\001\022%02d:%02d",SurfTime.Hours, SurfTime.Minutes); | |
888 } | |
889 else | |
890 { | |
891 snprintf(text,30,"\001\022%02d\016\016d\017 %02d\016\016h\017",SurfTime.Days, SurfTime.Hours); | |
892 } | |
893 | |
894 GFX_write_string(&FontT54,&t7surfaceR,text,2); | |
895 | |
896 | |
897 text[0] = '\001'; | |
898 text[1] = '\022'; | |
899 text[2] = '\016'; | |
900 text[3] = '\016'; | |
901 text[4] = TXT_2BYTE; | |
902 text[5] = TXT2BYTE_TimeSinceLastDive; | |
903 text[6] = 0; | |
904 GFX_write_string(&FontT48,&t7surfaceR,text,1); | |
905 } | |
906 | |
907 /* beta version */ | |
908 if( firmwareDataGetPointer()->versionBeta ) | |
909 { | |
910 snprintf(text,255,"\025 BETA"); | |
911 GFX_write_string(&FontT48,&t7surfaceL,text,2); | |
912 } | |
913 | |
914 /* surface pressure and temperature */ | |
915 if(stateUsed->sensorErrorsRTE == 0) | |
916 { | |
336
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
917 if(fabs(stateUsed->lifeData.pressure_surface_bar - stateUsed->lifeData.pressure_ambient_bar) < SHOW_AMBIENTE_SURFACE_DELTA) /* show ambient pressure if difference to surface is significant*/ |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
918 { |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
919 snprintf(text,30,"%01.0f\022\016\016 %s", stateUsed->lifeData.pressure_surface_bar * 1000.0f,TEXT_PRESSURE_UNIT); |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
920 } |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
921 else |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
922 { |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
923 if(fabsf(debounceAmbientPressure - stateUsed->lifeData.pressure_ambient_bar) > SHOW_AMBIENTE_DEBOUNCE) /* there might be a jitter ~+-1 HPa on the pressure signal => update only if delta is bigger */ |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
924 { |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
925 debounceAmbientPressure = stateUsed->lifeData.pressure_ambient_bar; |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
926 } |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
927 snprintf(text,30,"%01.0f\022\016\016 %s", debounceAmbientPressure * 1000.0f,TEXT_PRESSURE_UNIT); |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
928 } |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
929 |
38 | 930 GFX_write_string(&FontT48,&t7surfaceL,text,3); |
931 | |
932 if(settingsGetPointer()->nonMetricalSystem) | |
933 snprintf(text,40,"%01.0f\140\022\016\016 fahrenheit",unit_temperature_float(stateUsed->lifeData.temperature_celsius)); | |
934 else | |
935 snprintf(text,30,"%01.0f\140\022\016\016 celsius",stateUsed->lifeData.temperature_celsius); | |
936 GFX_write_string(&FontT48,&t7surfaceL,text,4); | |
937 } | |
938 else | |
939 { | |
103
f5d2f02dc73f
Generalize TEXT of pressure unit
Dmitry Romanov <kitt@bk.ru>
parents:
102
diff
changeset
|
940 snprintf(text,30,"ERR\022\016\016 %s",TEXT_PRESSURE_UNIT); |
38 | 941 GFX_write_string(&FontT48,&t7surfaceL,text,3); |
942 | |
943 if(settingsGetPointer()->nonMetricalSystem) | |
944 snprintf(text,40,"ERR\022\016\016 fahrenheit"); | |
945 else | |
946 snprintf(text,30,"ERR\022\016\016 celsius"); | |
947 GFX_write_string(&FontT48,&t7surfaceL,text,4); | |
948 } | |
949 | |
950 | |
951 /* gas mix and selection */ | |
952 if((stateUsed->diveSettings.diveMode == DIVEMODE_Gauge) || (stateUsed->diveSettings.diveMode == DIVEMODE_Apnea)) | |
953 { | |
954 if(stateUsed->diveSettings.diveMode == DIVEMODE_Gauge) | |
955 text[0] = TXT_Gauge; | |
956 else | |
957 text[0] = TXT_Apnoe; | |
958 | |
959 text[1] = 0; | |
960 GFX_write_string(&FontT48,&t7surfaceL,text,6); | |
961 } | |
962 else | |
963 { | |
964 text[0] = '\021'; | |
965 text[1] = '1'; | |
966 text[2] = '\177'; | |
967 text[3] = '\177'; | |
968 text[4] = 10; | |
969 text[5] = '\021'; | |
970 text[6] = '2'; | |
971 text[7] = '\177'; | |
972 text[8] = '\177'; | |
973 text[9] = 10; | |
974 text[10] = '\021'; | |
975 text[11] = '3'; | |
976 text[12] = '\177'; | |
977 text[13] = '\177'; | |
978 text[14] = 10; | |
979 text[15] = '\021'; | |
980 text[16] = '4'; | |
981 text[17] = '\177'; | |
982 text[18] = '\177'; | |
983 text[19] = 10; | |
984 text[20] = '\021'; | |
985 text[21] = '5'; | |
986 text[22] = 0; | |
987 | |
988 if(stateUsed->diveSettings.diveMode == DIVEMODE_CCR) | |
989 gasOffset = NUM_OFFSET_DILUENT; | |
990 else | |
991 gasOffset = 0; | |
992 for(int i=1;i<=5;i++) | |
993 { | |
994 if(stateUsed->diveSettings.gas[i+gasOffset].note.ub.active) | |
995 text[(i-1)*5] -= 1; | |
996 } | |
997 GFX_write_string(&FontT48,&t7surfaceL,text,6); | |
998 | |
999 | |
1000 oxygen_percentage = 100; | |
1001 oxygen_percentage -= stateUsed->lifeData.actualGas.nitrogen_percentage; | |
1002 oxygen_percentage -= stateUsed->lifeData.actualGas.helium_percentage; | |
1003 | |
1004 tHome_gas_writer(oxygen_percentage,stateUsed->lifeData.actualGas.helium_percentage,&text[0]); | |
1005 GFX_write_string(&FontT48,&t7surfaceL,text,7); | |
1006 | |
1007 actualGasID = stateUsed->lifeData.actualGas.GasIdInSettings; | |
1008 /* | |
1009 bottleFirstGas_bar = stateUsed->lifeData.bottle_bar[actualGasID]; | |
1010 if(bottleFirstGas_bar) | |
1011 { | |
1012 snprintf(text,255,"%3u\022\016\016 bar",bottleFirstGas_bar); | |
1013 GFX_write_string(&FontT48,&t7surfaceL,text,8); | |
1014 } | |
1015 */ | |
1016 // after gas name :-) | |
1017 if(actualGasID > gasOffset) // security | |
1018 { | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1019 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1020 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1021 start.y = t7surfaceL.WindowY0 + (3 * t7surfaceL.WindowLineSpacing); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1022 start.x = t7surfaceL.WindowX0 + ((stateUsed->lifeData.actualGas.GasIdInSettings - gasOffset - 1) * 35); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1023 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1024 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1025 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1026 start.y = t7surfaceR.WindowY0 + (3 * t7surfaceR.WindowLineSpacing); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1027 start.x = t7surfaceR.WindowX0 + ((stateUsed->lifeData.actualGas.GasIdInSettings - gasOffset - 1) * 35); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1028 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1029 |
38 | 1030 stop.x = start.x + 25; |
1031 stop.y = start.y + 52; | |
1032 GFX_draw_box2(&t7screen, start, stop, CLUT_Font020, 1); | |
1033 } | |
1034 } | |
1035 | |
1036 /* dive mode */ | |
193
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1037 switch (stateUsed->diveSettings.diveMode) { |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1038 case DIVEMODE_CCR: |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1039 GFX_write_string(&FontT24, &t7c1, "\f\002" "CCR", 0); |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1040 break; |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1041 case DIVEMODE_OC: |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1042 GFX_write_string(&FontT24, &t7c1, "\f\002" "OC", 0); |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1043 break; |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1044 case DIVEMODE_Gauge: |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1045 GFX_write_string(&FontT24, &t7c1, "\f\002" "Gauge", 0); |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1046 break; |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1047 case DIVEMODE_Apnea: |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1048 GFX_write_string(&FontT24, &t7c1, "\f\002" "Apnea", 0); |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1049 break; |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1050 default: |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1051 GFX_write_string(&FontT24, &t7c1, "\f\002" "OC", 0); |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1052 } |
38 | 1053 |
1054 /*battery */ | |
1055 | |
1056 text[0] = '3'; | |
1057 text[1] = '1'; | |
1058 text[2] = '1'; | |
1059 text[3] = '1'; | |
1060 text[4] = '1'; | |
1061 text[5] = '1'; | |
1062 text[6] = '1'; | |
1063 text[7] = '1'; | |
1064 text[8] = '1'; | |
1065 text[9] = '1'; | |
1066 text[10] = '1'; | |
1067 text[11] = '0'; | |
1068 text[12] = 0; | |
1069 | |
1070 for(int i=1;i<=10;i++) | |
1071 { | |
1072 if( stateUsed->lifeData.battery_charge > (9 * i)) | |
1073 text[i] += 1; | |
1074 } | |
1075 | |
1076 if(stateUsed->chargeStatus == CHARGER_off) | |
1077 { | |
1078 if(stateUsed->warnings.lowBattery) | |
1079 { | |
1080 if(warning_count_high_time) | |
1081 { | |
1082 for(int i=1;i<=10;i++) | |
1083 text[i] = '1'; | |
1084 } | |
1085 else | |
1086 { | |
1087 text[1] = '2'; | |
1088 } | |
1089 GFX_write_string_color(&Batt24,&t7batt,text,0,CLUT_WarningRed); | |
1090 if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->lifeData.battery_charge < 140)) | |
1091 { | |
432
2b4440f75434
show battery percent and voltage and surfacemode. That gives additional
heinrichsweikamp
parents:
405
diff
changeset
|
1092 // show battery percent and voltage |
2b4440f75434
show battery percent and voltage and surfacemode. That gives additional
heinrichsweikamp
parents:
405
diff
changeset
|
1093 snprintf(text,16,"\f\002%u%% \f%.1fV",(uint8_t)stateUsed->lifeData.battery_charge,stateUsed->lifeData.battery_voltage); |
38 | 1094 if(warning_count_high_time) |
1095 text[0] = '\a'; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1096 GFX_write_string(&FontT24,&t7voltage,text,0); |
38 | 1097 } |
1098 else | |
1099 { | |
1100 snprintf(text,6,"\f%.1fV",stateUsed->lifeData.battery_voltage); | |
1101 GFX_write_string(&FontT24,&t7voltage,text,0); | |
1102 } | |
1103 } | |
1104 else | |
1105 { | |
1106 GFX_write_string_color(&Batt24,&t7batt,text,0,CLUT_BatteryStandard); | |
1107 | |
1108 if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->lifeData.battery_charge < 140)) | |
1109 { | |
432
2b4440f75434
show battery percent and voltage and surfacemode. That gives additional
heinrichsweikamp
parents:
405
diff
changeset
|
1110 // show battery percent and voltage |
2b4440f75434
show battery percent and voltage and surfacemode. That gives additional
heinrichsweikamp
parents:
405
diff
changeset
|
1111 snprintf(text,16,"\f\002%u%% \f%.1fV",(uint8_t)stateUsed->lifeData.battery_charge,stateUsed->lifeData.battery_voltage); |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1112 // GFX_write_string(&FontT24,&t7batt,text,0); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1113 GFX_write_string(&FontT24,&t7voltage,text,0); |
38 | 1114 } |
1115 else | |
1116 { | |
1117 snprintf(text,6,"\f%.1fV",stateUsed->lifeData.battery_voltage); | |
1118 GFX_write_string(&FontT24,&t7voltage,text,0); | |
1119 } | |
1120 } | |
1121 } | |
1122 else | |
1123 { | |
1124 GFX_write_string_color(&Batt24,&t7batt,text,0,CLUT_BatteryCharging); | |
1125 | |
1126 switch(stateUsed->chargeStatus) | |
1127 { | |
1128 case CHARGER_running: | |
1129 default: | |
1130 color = CLUT_BatteryStandard; | |
1131 break; | |
1132 case CHARGER_complete: | |
1133 color = CLUT_BatteryCharging; | |
1134 break; | |
1135 case CHARGER_lostConnection: | |
1136 color = CLUT_BatteryProblem; | |
1137 break; | |
1138 } | |
1139 text[0] = '4'; | |
1140 text[1] = 0; | |
1141 GFX_write_string_color(&Batt24,&t7charge,text,0,color); | |
1142 } | |
1143 | |
1144 | |
1145 | |
1146 customview_warnings = t7_test_customview_warnings_surface_mode(); | |
1147 if(customview_warnings && warning_count_high_time) | |
1148 t7_show_customview_warnings_surface_mode(); | |
1149 else | |
1150 t7_refresh_customview(); | |
1151 draw_frame(0,0, CLUT_pluginboxSurface, CLUT_Font020); | |
1152 } | |
1153 | |
1154 void t7_refresh_surface_debugmode(void) | |
1155 { | |
1156 // could be warning, now just to set RTE variables | |
1157 DataEX_check_RTE_version__needs_update(); | |
1158 | |
1159 | |
1160 char TextL1[4*TEXTSIZE]; | |
1161 uint32_t color; | |
1162 // uint8_t gasIdFirst; | |
1163 SSettings* pSettings = settingsGetPointer(); | |
198
878dc9e0dbc5
cleanup: another cleanup session (data_exchange_main.c)
Jan Mulder <jlmulder@xs4all.nl>
parents:
196
diff
changeset
|
1164 SDataExchangeSlaveToMaster *dataIn = get_dataInPointer(); |
38 | 1165 |
1166 SWindowGimpStyle windowGimp; | |
1167 | |
1168 RTC_DateTypeDef Sdate; | |
1169 RTC_TimeTypeDef Stime; | |
1170 | |
1171 translateDate(stateUsed->lifeData.dateBinaryFormat, &Sdate); | |
1172 translateTime(stateUsed->lifeData.timeBinaryFormat, &Stime); | |
1173 | |
1174 | |
1175 if(stateUsed->data_old__lost_connection_to_slave) | |
1176 { | |
1177 Gfx_write_label_var(&t7screen, 500,800, 0,&FontT42,CLUT_DiveMainLabel,"old"); | |
198
878dc9e0dbc5
cleanup: another cleanup session (data_exchange_main.c)
Jan Mulder <jlmulder@xs4all.nl>
parents:
196
diff
changeset
|
1178 snprintf(TextL1,TEXTSIZE,"%X %X %X %X",dataIn->header.checkCode[0],dataIn->header.checkCode[1],dataIn->header.checkCode[2],dataIn->header.checkCode[3]); |
38 | 1179 Gfx_write_label_var(&t7screen, 500,800, 45,&FontT48,CLUT_Font020,TextL1); |
1180 } | |
1181 else | |
1182 if(DataEX_lost_connection_count()) | |
1183 { | |
336
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
1184 snprintf(TextL1,TEXTSIZE,"\002%ld",DataEX_lost_connection_count()); |
38 | 1185 Gfx_write_label_var(&t7screen, 600,800, 45,&FontT48,CLUT_Font020,TextL1); |
1186 } | |
1187 | |
1188 snprintf(TextL1,TEXTSIZE,"\002%i",blockedFramesCount()); | |
1189 Gfx_write_label_var(&t7screen, 600,800, 0,&FontT48,CLUT_Font020,TextL1); | |
1190 | |
1191 if(stateUsed->lifeData.compass_DX_f | stateUsed->lifeData.compass_DY_f | stateUsed->lifeData.compass_DZ_f) | |
1192 { | |
1193 snprintf(TextL1,TEXTSIZE,"X %i",stateUsed->lifeData.compass_DX_f); | |
1194 Gfx_write_label_var(&t7screen, 0,400, 45,&FontT48,CLUT_Font020,TextL1); | |
1195 snprintf(TextL1,TEXTSIZE,"Y %i",stateUsed->lifeData.compass_DY_f); | |
1196 Gfx_write_label_var(&t7screen, 0,400,145,&FontT48,CLUT_Font020,TextL1); | |
1197 snprintf(TextL1,TEXTSIZE,"Z %i",stateUsed->lifeData.compass_DZ_f); | |
1198 Gfx_write_label_var(&t7screen, 0,400,255,&FontT48,CLUT_Font020,TextL1); | |
1199 return; | |
1200 } | |
103
f5d2f02dc73f
Generalize TEXT of pressure unit
Dmitry Romanov <kitt@bk.ru>
parents:
102
diff
changeset
|
1201 snprintf(TextL1,TEXTSIZE,"%01.0f %s",stateUsed->lifeData.pressure_ambient_bar * 1000.0f,TEXT_PRESSURE_UNIT); |
38 | 1202 Gfx_write_label_var(&t7screen, 0,400, 0,&FontT42,CLUT_DiveMainLabel,"Ambient Pressure"); |
1203 Gfx_write_label_var(&t7screen, 0,400, 45,&FontT48,CLUT_Font020,TextL1); | |
1204 | |
1205 snprintf(TextL1,TEXTSIZE,"%01.2f C",stateUsed->lifeData.temperature_celsius); | |
1206 Gfx_write_label_var(&t7screen, 0,400,100,&FontT42,CLUT_DiveMainLabel,"Temperature"); | |
1207 Gfx_write_label_var(&t7screen, 0,400,145,&FontT48,CLUT_Font020,TextL1); | |
1208 | |
1209 snprintf(TextL1,TEXTSIZE,"%03.0f %03.0f %03.0f",stateUsed->lifeData.compass_heading,stateUsed->lifeData.compass_roll,stateUsed->lifeData.compass_pitch); | |
1210 Gfx_write_label_var(&t7screen, 0,400,200,&FontT42,CLUT_DiveMainLabel,"Heading Roll Pitch"); | |
1211 Gfx_write_label_var(&t7screen, 0,400,255,&FontT48,CLUT_Font020,TextL1); | |
1212 | |
103
f5d2f02dc73f
Generalize TEXT of pressure unit
Dmitry Romanov <kitt@bk.ru>
parents:
102
diff
changeset
|
1213 snprintf(TextL1,TEXTSIZE,"%01.0f %s",stateUsed->lifeData.pressure_surface_bar * 1000.0f,TEXT_PRESSURE_UNIT); |
38 | 1214 Gfx_write_label_var(&t7screen, 0,400,310,&FontT42,CLUT_DiveMainLabel,"Surface Pressure"); |
1215 Gfx_write_label_var(&t7screen, 0,400,355,&FontT48,CLUT_Font020,TextL1); | |
1216 | |
1217 // gasIdFirst = stateUsed->lifeData.actualGas.GasIdInSettings; | |
198
878dc9e0dbc5
cleanup: another cleanup session (data_exchange_main.c)
Jan Mulder <jlmulder@xs4all.nl>
parents:
196
diff
changeset
|
1218 snprintf(TextL1,TEXTSIZE,"%u.%u",dataIn->RTE_VERSION_high,dataIn->RTE_VERSION_low); |
38 | 1219 Gfx_write_label_var(&t7screen, 320,500,100,&FontT42,CLUT_DiveMainLabel,"RTE"); |
1220 Gfx_write_label_var(&t7screen, 320,500,145,&FontT48,CLUT_Font020,TextL1); | |
1221 | |
1222 Gfx_write_label_var(&t7screen, 500,800,100,&FontT42,CLUT_DiveMainLabel,"Battery"); | |
1223 snprintf(TextL1,TEXTSIZE,"%01.4f V",stateUsed->lifeData.battery_voltage); | |
1224 Gfx_write_label_var(&t7screen, 500,800,145,&FontT48,CLUT_Font020,TextL1); | |
1225 snprintf(TextL1,TEXTSIZE,"%03.1f %%",stateUsed->lifeData.battery_charge); | |
1226 Gfx_write_label_var(&t7screen, 500,800,200,&FontT48,CLUT_Font020,TextL1); | |
1227 if(stateUsed->chargeStatus != CHARGER_off) | |
1228 { | |
1229 switch(stateUsed->chargeStatus) | |
1230 { | |
1231 case CHARGER_running: | |
1232 default: | |
1233 color = CLUT_BatteryStandard; | |
1234 break; | |
1235 case CHARGER_complete: | |
1236 color = CLUT_BatteryCharging; | |
1237 break; | |
1238 case CHARGER_lostConnection: | |
1239 color = CLUT_BatteryProblem; | |
1240 break; | |
1241 } | |
1242 TextL1[0] = '4'; | |
1243 TextL1[1] = 0; | |
1244 Gfx_write_label_var(&t7screen, 660,800,200,&Batt24,color,TextL1); | |
1245 } | |
1246 | |
1247 extern uint32_t base_tempLightLevel; | |
1248 | |
336
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
1249 snprintf(TextL1,TEXTSIZE,"# %u (%ld)",stateUsed->lifeData.ambient_light_level, base_tempLightLevel); |
38 | 1250 Gfx_write_label_var(&t7screen, 401,600,310,&FontT42,CLUT_DiveMainLabel,"Light"); |
1251 Gfx_write_label_var(&t7screen, 401,800,355,&FontT48,CLUT_Font020,TextL1); | |
1252 | |
1253 // snprintf(TextL1,TEXTSIZE,"# %u",stateUsed->lifeData.ambient_light_level); | |
1254 // Gfx_write_label_var(&t7screen, 601,800,310,&FontT42,CLUT_DiveMainLabel,"Light"); | |
1255 // Gfx_write_label_var(&t7screen, 601,800,355,&FontT48,CLUT_Font020,TextL1); | |
1256 | |
348 | 1257 /* show surface pressure state */ |
1258 if(stateUsed->lifeData.bool_temp1 ) | |
1259 { | |
1260 snprintf(TextL1,TEXTSIZE,"stable"); | |
1261 } | |
1262 else | |
1263 { | |
1264 snprintf(TextL1,TEXTSIZE,"unstable"); | |
1265 } | |
1266 Gfx_write_label_var(&t7screen, 500,800,400,&FontT48,CLUT_Font020,TextL1); | |
38 | 1267 |
1268 | |
1269 if(Sdate.Year < 15) | |
1270 { | |
1271 if(warning_count_high_time) | |
1272 { | |
1273 snprintf(TextL1,4*TEXTSIZE,"\017 %02d-%02d-%02d %02d:%02d:%02d", Sdate.Date, Sdate.Month, 2000 + Sdate.Year,Stime.Hours, Stime.Minutes, Stime.Seconds); | |
1274 Gfx_write_label_var(&t7screen, 0,800,420,&FontT48,CLUT_Font020,TextL1); | |
1275 } | |
1276 } | |
1277 else | |
1278 { | |
1279 if(pSettings->customtext[0]) | |
1280 { | |
1281 if(pSettings->customtext[59]) | |
1282 pSettings->customtext[59] = 0; | |
1283 Gfx_write_label_var(&t7screen, 0,400,420,&FontT24,CLUT_Font020,pSettings->customtext); | |
1284 } | |
1285 else | |
1286 { | |
1287 snprintf(TextL1,4*TEXTSIZE,"\017 %02d-%02d-%02d %02d:%02d:%02d Dives: %u", Sdate.Date, Sdate.Month, 2000 + Sdate.Year,Stime.Hours, Stime.Minutes, Stime.Seconds,pSettings->totalDiveCounter ); | |
1288 Gfx_write_label_var(&t7screen, 0,800,420,&FontT48,CLUT_Font020,TextL1); | |
1289 } | |
1290 } | |
1291 | |
1292 windowGimp.left = 400; | |
1293 windowGimp.top = 0; | |
1294 GFX_draw_image_monochrome(&t7screen, windowGimp, &ImgOSTC, 0); | |
1295 } | |
1296 | |
1297 /* CUSTOMVIEW | |
1298 * in the middle of the screen | |
1299 */ | |
1300 | |
1301 uint8_t t7_test_customview_warnings(void) | |
1302 { | |
1303 uint8_t count = 0; | |
1304 | |
1305 count = 0; | |
1306 count += stateUsed->warnings.decoMissed; | |
1307 count += stateUsed->warnings.ppO2Low; | |
1308 count += stateUsed->warnings.ppO2High; | |
1309 //count += stateUsed->warnings.lowBattery; | |
1310 count += stateUsed->warnings.sensorLinkLost; | |
1311 count += stateUsed->warnings.fallback; | |
1312 return count; | |
1313 } | |
1314 | |
1315 | |
1316 uint8_t t7_test_customview_warnings_surface_mode(void) | |
1317 { | |
1318 uint8_t count = 0; | |
1319 count = 0; | |
1320 count += stateUsed->cnsHigh_at_the_end_of_dive; | |
1321 count += stateUsed->decoMissed_at_the_end_of_dive; | |
1322 return count; | |
1323 } | |
1324 | |
1325 | |
1326 void t7_show_customview_warnings_surface_mode(void) | |
1327 { | |
1328 char text[256]; | |
1329 uint8_t textpointer, lineFree; | |
1330 | |
1331 text[0] = '\025'; | |
1332 text[1] = '\f'; | |
1333 text[2] = '\001'; | |
1334 text[3] = TXT_Warning; | |
1335 text[4] = 0; | |
1336 GFX_write_string(&FontT42,&t7cH,text,0); | |
1337 | |
1338 textpointer = 0; | |
1339 lineFree = 5; | |
1340 | |
1341 if(stateUsed->decoMissed_at_the_end_of_dive) | |
1342 { | |
1343 text[textpointer++] = TXT_2BYTE; | |
1344 text[textpointer++] = TXT2BYTE_WarnDecoMissed; | |
1345 text[textpointer++] = '\n'; | |
1346 text[textpointer++] = '\r'; | |
1347 text[textpointer] = 0; | |
1348 lineFree--; | |
1349 } | |
1350 | |
1351 if(stateUsed->cnsHigh_at_the_end_of_dive) | |
1352 { | |
1353 text[textpointer++] = TXT_2BYTE; | |
1354 text[textpointer++] = TXT2BYTE_WarnCnsHigh; | |
1355 text[textpointer++] = '\n'; | |
1356 text[textpointer++] = '\r'; | |
1357 text[textpointer] = 0; | |
1358 lineFree--; | |
1359 } | |
1360 if(textpointer != 0) | |
1361 GFX_write_string(&FontT48,&t7cW,text,1); | |
1362 } | |
1363 | |
1364 | |
1365 void t7_show_customview_warnings(void) | |
1366 { | |
1367 char text[256]; | |
1368 uint8_t textpointer, lineFree; | |
1369 | |
1370 text[0] = '\025'; | |
1371 text[1] = '\f'; | |
1372 text[2] = '\001'; | |
1373 text[3] = TXT_Warning; | |
1374 text[4] = 0; | |
1375 GFX_write_string(&FontT42,&t7cH,text,0); | |
1376 | |
1377 textpointer = 0; | |
1378 lineFree = 5; | |
1379 | |
1380 if(lineFree && stateUsed->warnings.decoMissed) | |
1381 { | |
1382 text[textpointer++] = TXT_2BYTE; | |
1383 text[textpointer++] = TXT2BYTE_WarnDecoMissed; | |
1384 text[textpointer++] = '\n'; | |
1385 text[textpointer++] = '\r'; | |
1386 text[textpointer] = 0; | |
1387 lineFree--; | |
1388 } | |
1389 | |
1390 if(lineFree && stateUsed->warnings.fallback) | |
1391 { | |
1392 text[textpointer++] = TXT_2BYTE; | |
1393 text[textpointer++] = TXT2BYTE_WarnFallback; | |
1394 text[textpointer++] = '\n'; | |
1395 text[textpointer++] = '\r'; | |
1396 text[textpointer] = 0; | |
1397 lineFree--; | |
1398 } | |
1399 | |
1400 if(lineFree && stateUsed->warnings.ppO2Low) | |
1401 { | |
1402 text[textpointer++] = TXT_2BYTE; | |
1403 text[textpointer++] = TXT2BYTE_WarnPPO2Low; | |
1404 text[textpointer++] = '\n'; | |
1405 text[textpointer++] = '\r'; | |
1406 text[textpointer] = 0; | |
1407 lineFree--; | |
1408 } | |
1409 | |
1410 if(lineFree && stateUsed->warnings.ppO2High) | |
1411 { | |
1412 text[textpointer++] = TXT_2BYTE; | |
1413 text[textpointer++] = TXT2BYTE_WarnPPO2High; | |
1414 text[textpointer++] = '\n'; | |
1415 text[textpointer++] = '\r'; | |
1416 text[textpointer] = 0; | |
1417 lineFree--; | |
1418 } | |
1419 | |
1420 if(lineFree && stateUsed->warnings.sensorLinkLost) | |
1421 { | |
1422 text[textpointer++] = TXT_2BYTE; | |
1423 text[textpointer++] = TXT2BYTE_WarnSensorLinkLost; | |
1424 text[textpointer++] = '\n'; | |
1425 text[textpointer++] = '\r'; | |
1426 text[textpointer] = 0; | |
1427 lineFree--; | |
1428 } | |
1429 /* | |
1430 if(lineFree && stateUsed->warnings.lowBattery) | |
1431 { | |
1432 text[textpointer++] = TXT_2BYTE; | |
1433 text[textpointer++] = TXT2BYTE_WarnBatteryLow; | |
1434 text[textpointer++] = '\n'; | |
1435 text[textpointer++] = '\r'; | |
1436 text[textpointer] = 0; | |
1437 lineFree--; | |
1438 } | |
1439 */ | |
1440 GFX_write_string(&FontT48,&t7cW,text,1); | |
1441 } | |
1442 | |
1443 | |
1444 void t7_set_customview_to_primary(void) | |
1445 { | |
1446 if(stateUsed->mode == MODE_DIVE) | |
1447 selection_customview = settingsGetPointer()->tX_customViewPrimary; | |
1448 } | |
1449 | |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1450 uint8_t t7_GetEnabled_customviews() |
38 | 1451 { |
379 | 1452 int8_t i; |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1453 uint8_t *pViews; |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1454 uint8_t increment = 1; |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1455 |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1456 uint8_t enabledViewCnt = 0; |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1457 uint32_t cv_config = settingsGetPointer()->cv_configuration; |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1458 |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1459 if(stateUsed->mode == MODE_DIVE) |
374 | 1460 pViews = (uint8_t*)customviewsDive; |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1461 else |
374 | 1462 pViews = (uint8_t*)customviewsSurface; |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1463 |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1464 while((*pViews != CVIEW_END)) |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1465 { |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1466 increment = 1; |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1467 /* check if view is enabled */ |
379 | 1468 i=0; |
1469 do | |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1470 { |
379 | 1471 if(*pViews == cv_changelist[i]) |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1472 { |
379 | 1473 if(!CHECK_BIT_THOME(cv_config, cv_changelist[i])) |
1474 { | |
1475 increment = 0; | |
1476 } | |
1477 break; | |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1478 } |
379 | 1479 i++; |
1480 } while(cv_changelist[i] != CVIEW_END); | |
1481 if(cv_changelist[i] == CVIEW_END) | |
1482 { | |
1483 increment = 0; | |
1484 } | |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1485 if (((*pViews == CVIEW_sensors) || (*pViews == CVIEW_sensors_mV)) && |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1486 ((stateUsed->diveSettings.ppo2sensors_deactivated) || (stateUsed->diveSettings.ccrOption == 0))) |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1487 { |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1488 increment = 0; |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1489 } |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1490 |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1491 pViews++; |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1492 enabledViewCnt += increment; |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1493 } |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1494 return enabledViewCnt; |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1495 } |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1496 |
405 | 1497 uint8_t t7_customview_disabled(uint8_t view) |
1498 { | |
1499 uint8_t i = 0; | |
1500 uint8_t cv_disabled = 0; | |
1501 | |
1502 while(cv_changelist[i] != CVIEW_END) | |
1503 { | |
1504 if((view == cv_changelist[i]) && !CHECK_BIT_THOME(settingsGetPointer()->cv_configuration, cv_changelist[i])) | |
1505 { | |
1506 cv_disabled = 1; | |
1507 break; | |
1508 } | |
1509 i++; | |
1510 } | |
1511 | |
1512 if (((view == CVIEW_sensors) || (view == CVIEW_sensors_mV)) && | |
1513 ((stateUsed->diveSettings.ppo2sensors_deactivated) || (stateUsed->diveSettings.ccrOption == 0))) | |
1514 { | |
1515 cv_disabled = 1; | |
1516 } | |
1517 return cv_disabled; | |
1518 } | |
1519 | |
361
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1520 void t7_change_customview(uint8_t action) |
38 | 1521 { |
365
c18aebb03fed
Bugfix: selection of current view not working
ideenmodellierer
parents:
361
diff
changeset
|
1522 uint8_t *pViews; |
361
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1523 uint8_t *pStartView,*pCurView, *pLastView; |
38 | 1524 _Bool cv_disabled = 0; |
1525 | |
1526 if(stateUsed->mode == MODE_DIVE) | |
374 | 1527 pViews = (uint8_t*)customviewsDive; |
38 | 1528 else |
374 | 1529 pViews = (uint8_t*)customviewsSurface; |
38 | 1530 |
361
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1531 pStartView = pViews; |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1532 /* set pointer to currently selected view and count number of entries */ |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1533 while((*pViews != CVIEW_END)) |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1534 { |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1535 if (*pViews == selection_customview) |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1536 { |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1537 pCurView = pViews; |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1538 } |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1539 pViews++; |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1540 } |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1541 pLastView = pViews; |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1542 pViews = pCurView; |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1543 |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1544 if((action == ACTION_BUTTON_ENTER) || (action == ACTION_PITCH_POS)) |
38 | 1545 { |
361
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1546 if(*pViews < CVIEW_END) |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1547 pViews++; |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1548 |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1549 if(*pViews == CVIEW_END) |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1550 { |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1551 pViews = pStartView; |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1552 } |
38 | 1553 } |
361
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1554 else |
38 | 1555 { |
365
c18aebb03fed
Bugfix: selection of current view not working
ideenmodellierer
parents:
361
diff
changeset
|
1556 if(pViews == pStartView) |
361
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1557 { |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1558 pViews = pLastView - 1; |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1559 } |
365
c18aebb03fed
Bugfix: selection of current view not working
ideenmodellierer
parents:
361
diff
changeset
|
1560 else |
c18aebb03fed
Bugfix: selection of current view not working
ideenmodellierer
parents:
361
diff
changeset
|
1561 { |
c18aebb03fed
Bugfix: selection of current view not working
ideenmodellierer
parents:
361
diff
changeset
|
1562 pViews--; |
c18aebb03fed
Bugfix: selection of current view not working
ideenmodellierer
parents:
361
diff
changeset
|
1563 } |
361
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1564 } |
365
c18aebb03fed
Bugfix: selection of current view not working
ideenmodellierer
parents:
361
diff
changeset
|
1565 |
366 | 1566 do |
1567 { | |
405 | 1568 cv_disabled = t7_customview_disabled(*pViews); |
366 | 1569 if(cv_disabled) /* view is disabled => jump to next view */ |
1570 { | |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1571 if((action == ACTION_BUTTON_ENTER) || (action == ACTION_PITCH_POS)) |
366 | 1572 { |
1573 pViews++; | |
1574 if(*pViews == CVIEW_END) | |
1575 { | |
1576 pViews = pStartView; | |
1577 } | |
1578 } | |
1579 else | |
1580 { | |
1581 if(pViews == pStartView) | |
1582 { | |
1583 pViews = pLastView - 1; | |
1584 } | |
1585 else | |
1586 { | |
1587 pViews--; | |
1588 } | |
1589 } | |
1590 } | |
1591 } while(cv_disabled); | |
1592 | |
38 | 1593 selection_customview = *pViews; |
1594 } | |
1595 | |
1596 | |
1597 uint8_t t7_get_length_of_customtext(void) | |
1598 { | |
1599 uint8_t i = 0; | |
1600 settingsGetPointer()->customtext[60-1] = 0; | |
1601 while(settingsGetPointer()->customtext[i] > 0) | |
1602 i++; | |
1603 return i; | |
1604 } | |
1605 | |
1606 | |
1607 void t7_refresh_customview(void) | |
1608 { | |
405 | 1609 static uint8_t last_customview = CVIEW_END; |
38 | 1610 |
1611 char text[256]; | |
1612 uint16_t textpointer = 0; | |
1613 int16_t start; | |
51
8f8ea3a32e82
Resolved warnings pointing to possible invalid memory access
Ideenmodellierer
parents:
38
diff
changeset
|
1614 uint8_t lineCountCustomtext = 0; |
38 | 1615 int16_t shiftWindowY0; |
1616 RTC_DateTypeDef Sdate; | |
1617 RTC_TimeTypeDef Stime; | |
1618 float fPpO2limitHigh, fPpO2limitLow, fPpO2ofGasAtThisDepth; // CVIEW_Gaslist | |
1619 const SGasLine * pGasLine; // CVIEW_Gaslist | |
1620 uint8_t oxygen, helium; // CVIEW_Gaslist | |
1621 float depth, surface, fraction_nitrogen, fraction_helium, ead, end; // CVIEW_EADTime | |
1622 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1623 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1624 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1625 |
405 | 1626 if(last_customview != selection_customview) /* check if current selection is disabled and should be skipped */ |
1627 { | |
1628 if(t7_customview_disabled(selection_customview)) | |
1629 { | |
1630 t7_change_customview(ACTION_BUTTON_ENTER); | |
1631 } | |
1632 } | |
38 | 1633 switch(selection_customview) |
1634 { | |
1635 case CVIEW_noneOrDebug: | |
1636 if(settingsGetPointer()->showDebugInfo) | |
1637 { | |
1638 // header | |
1639 strcpy(text,"\032\f\001Debug"); | |
1640 GFX_write_string(&FontT42,&t7cH,text,0); | |
1641 // content | |
1642 t7_debug(); | |
1643 } | |
1644 break; | |
1645 | |
1646 case CVIEW_SummaryOfLeftCorner: | |
1647 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Summary); | |
1648 GFX_write_string(&FontT42,&t7cH,text,0); | |
1649 // content | |
1650 t7_SummaryOfLeftCorner(); | |
1651 break; | |
1652 | |
1653 case CVIEW_CompassDebug: | |
1654 snprintf(text,100,"\032\f\001Compass raw"); | |
1655 GFX_write_string(&FontT42,&t7cH,text,0); | |
1656 /* | |
1657 pStateReal->lifeData.compass_heading = dataIn.data[dataIn.boolCompassData].compass_heading; | |
1658 pStateReal->lifeData.compass_roll = dataIn.data[dataIn.boolCompassData].compass_roll; | |
1659 pStateReal->lifeData.compass_pitch = dataIn.data[dataIn.boolCompassData].compass_pitch; | |
1660 | |
1661 pStateReal->lifeData.compass_DX_f = dataIn.data[dataIn.boolCompassData].compass_DX_f; | |
1662 pStateReal->lifeData.compass_DY_f = dataIn.data[dataIn.boolCompassData].compass_DY_f; | |
1663 pStateReal->lifeData.compass_DZ_f = dataIn.data[dataIn.boolCompassData].compass_DZ_f; | |
1664 */ | |
1665 snprintf(text,255,"%1.1f\n\r%1.1f\n\r%1.1f\n\r%i\n\r%i\n\r%i" | |
1666 ,stateUsed->lifeData.compass_heading | |
1667 ,stateUsed->lifeData.compass_roll | |
1668 ,stateUsed->lifeData.compass_pitch | |
1669 ,stateUsed->lifeData.compass_DX_f | |
1670 ,stateUsed->lifeData.compass_DY_f | |
1671 ,stateUsed->lifeData.compass_DZ_f | |
1672 ); | |
1673 | |
1674 t7cY0free.WindowY0 = t7cC.WindowY0 - 10; | |
1675 t7cY0free.WindowLineSpacing = 48; | |
1676 t7cY0free.WindowNumberOfTextLines = 6; | |
1677 GFX_write_string(&FontT42, &t7cY0free, text, 1); | |
1678 break; | |
1679 | |
1680 case CVIEW_Hello: | |
1681 t7_logo_OSTC(); | |
1682 t7cC.WindowLineSpacing = 53; | |
1683 t7cC.WindowNumberOfTextLines = 5; | |
1684 shiftWindowY0 = 18; | |
1685 | |
1686 if(updateNecessary)//if(DataEX_check_RTE_version__needs_update() || font_update_required()) | |
1687 { | |
1688 if(warning_count_high_time) | |
1689 { | |
1690 shiftWindowY0 += 20; | |
1691 t7cC.WindowY0 -= shiftWindowY0; | |
1692 textpointer = 0; | |
1693 text[textpointer++] = TXT_2BYTE; | |
1694 text[textpointer++] = TXT2BYTE_PleaseUpdate; | |
1695 text[textpointer++] = '\n'; | |
1696 text[textpointer++] = '\r'; | |
1697 if(DataEX_check_RTE_version__needs_update()) | |
1698 { | |
1699 text[textpointer++] = TXT_2BYTE; | |
1700 text[textpointer++] = TXT2BYTE_RTE; | |
1701 text[textpointer++] = '\n'; | |
1702 text[textpointer++] = '\r'; | |
1703 } | |
1704 if(font_update_required()) | |
1705 { | |
1706 text[textpointer++] = TXT_2BYTE; | |
1707 text[textpointer++] = TXT2BYTE_Fonts; | |
1708 } | |
1709 text[textpointer++] = 0; | |
1710 GFX_write_string_color(&FontT42,&t7cC,text,1, CLUT_WarningRed); | |
1711 t7cC.WindowY0 += shiftWindowY0; | |
1712 } | |
1713 t7cC.WindowNumberOfTextLines = 3; | |
1714 } | |
1715 else // customtext | |
1716 { | |
1717 lineCountCustomtext = t7_customtextPrepare(text); | |
1718 if(lineCountCustomtext <= 2) | |
1719 shiftWindowY0 += 20+26; // nach unten | |
1720 else | |
1721 if(lineCountCustomtext <= 3) | |
1722 shiftWindowY0 += 20; // nach unten | |
1723 t7cC.WindowY0 -= shiftWindowY0; | |
1724 | |
1725 GFX_write_string(&FontT42,&t7cC,text,1); | |
1726 t7cC.WindowNumberOfTextLines = 3; | |
1727 t7cC.WindowY0 += shiftWindowY0; | |
1728 } | |
1729 if(lineCountCustomtext <= 4) | |
1730 { | |
1731 snprintf(text,100,"\001#%0u V%01u.%01u.%01u", | |
1732 settingsGetPointer()->serialLow + (256 * settingsGetPointer()->serialHigh), | |
1733 firmwareDataGetPointer()->versionFirst, | |
1734 firmwareDataGetPointer()->versionSecond, | |
1735 firmwareDataGetPointer()->versionThird | |
1736 ); | |
1737 GFX_write_string(&FontT24,&t7cC,text,0); | |
1738 } | |
1739 break; | |
1740 | |
1741 case CVIEW_Gaslist: | |
1742 // a lot of code taken from tMenuGas.c | |
1743 // header | |
1744 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Gaslist); | |
1745 GFX_write_string(&FontT42,&t7cH,text,0); | |
1746 // content | |
1747 textpointer = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1748 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1749 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1750 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1751 t7cY0free.WindowY0 = t7cC.WindowY0 - 10; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1752 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1753 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1754 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1755 t7cY0free.WindowY1 = 400; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1756 } |
38 | 1757 t7cY0free.WindowLineSpacing = 48+9; |
1758 t7cY0free.WindowNumberOfTextLines = 5; // NUM_GASES == 5 | |
1759 t7cY0free.WindowTab = 420; | |
1760 | |
1761 pGasLine = settingsGetPointer()->gas; | |
1762 if(actualLeftMaxDepth(stateUsed)) | |
1763 fPpO2limitHigh = (float)(settingsGetPointer()->ppO2_max_deco) / 100; | |
1764 else | |
1765 fPpO2limitHigh = (float)(settingsGetPointer()->ppO2_max_std) / 100; | |
1766 fPpO2limitLow = (float)(settingsGetPointer()->ppO2_min) / 100; | |
1767 for(int gasId=1;gasId<=NUM_GASES;gasId++) | |
1768 { | |
1769 textpointer = 0; | |
1770 fPpO2ofGasAtThisDepth = (stateUsed->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * pGasLine[gasId].oxygen_percentage / 100; | |
1771 if(pGasLine[gasId].note.ub.active == 0) | |
1772 strcpy(&text[textpointer++],"\021"); | |
1773 else if((fPpO2ofGasAtThisDepth > fPpO2limitHigh) || (fPpO2ofGasAtThisDepth < fPpO2limitLow)) | |
1774 strcpy(&text[textpointer++],"\025"); | |
1775 else | |
1776 strcpy(&text[textpointer++],"\030"); | |
1777 | |
1778 text[textpointer++] = ' '; | |
1779 oxygen = pGasLine[gasId].oxygen_percentage; | |
1780 helium = pGasLine[gasId].helium_percentage; | |
1781 textpointer += write_gas(&text[textpointer], oxygen, helium); | |
1782 // Wechseltiefe | |
1783 if(pGasLine[gasId].depth_meter) | |
1784 { | |
1785 textpointer += snprintf(&text[textpointer],7,"\t%u %c%c",unit_depth_integer(pGasLine[gasId].depth_meter), unit_depth_char1(), unit_depth_char2()); | |
1786 } | |
1787 GFX_write_string(&FontT42, &t7cY0free, text, gasId); | |
1788 } | |
1789 break; | |
1790 | |
1791 case CVIEW_EADTime: | |
1792 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Info ); | |
1793 GFX_write_string(&FontT42,&t7cH,text,0); | |
1794 textpointer = 0; | |
1795 | |
1796 t7cY0free.WindowY0 = t7cC.WindowY0 - 10; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1797 if(pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1798 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1799 t7cY0free.WindowY1 = 400; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1800 } |
38 | 1801 t7cY0free.WindowLineSpacing = 48; |
1802 t7cY0free.WindowNumberOfTextLines = 6; | |
1803 | |
1804 // time | |
1805 snprintf(text,100,"\032\001%c%c",TXT_2BYTE,TXT2BYTE_Clock ); | |
1806 GFX_write_string(&FontT42, &t7cY0free, text, 1); | |
1807 | |
1808 translateDate(stateRealGetPointer()->lifeData.dateBinaryFormat, &Sdate); | |
1809 translateTime(stateRealGetPointer()->lifeData.timeBinaryFormat, &Stime); | |
1810 if(Stime.Seconds % 2) | |
1811 textpointer += snprintf(&text[textpointer],100,"\030\001%02d:%02d",Stime.Hours,Stime.Minutes); | |
1812 else | |
1813 textpointer += snprintf(&text[textpointer],100,"\030\001%02d\031:\030%02d",Stime.Hours,Stime.Minutes); | |
1814 GFX_write_string(&FontT42, &t7cY0free, text, 2); | |
1815 | |
1816 // EAD / END | |
1817 // The equivalent air depth can be calculated for depths in metres as follows: | |
1818 // EAD = (Depth + 10) � Fraction of N2 / 0.79 - 10 (wikipedia) | |
1819 // The equivalent narcotic depth can be calculated for depths in metres as follows: | |
1820 // END = (Depth + 10) � (1 - Fraction of helium) - 10 (wikipedia) | |
1821 decom_get_inert_gases((float)stateUsed->lifeData.pressure_ambient_bar,&(stateUsed->lifeData.actualGas),&fraction_nitrogen,&fraction_helium); | |
1822 depth = stateUsed->lifeData.pressure_ambient_bar; | |
1823 surface = stateUsed->lifeData.pressure_surface_bar; | |
1824 ead = 10.f * ((depth * fraction_nitrogen/0.79f) - surface); | |
1825 end = 10.0f * ((depth * (1.f - fraction_helium)) - surface); | |
1826 if(ead < 0) | |
1827 ead = 0; | |
1828 if(end < 0) | |
1829 end = 0; | |
1830 | |
1831 snprintf(text,100,"\032\001EAD"); | |
1832 GFX_write_string(&FontT42, &t7cY0free, text, 3); | |
1833 snprintf(text,100,"\030\001%01.1f %c%c" | |
1834 , unit_depth_float(ead) | |
1835 , unit_depth_char1() | |
1836 , unit_depth_char2() | |
1837 ); | |
1838 GFX_write_string(&FontT42, &t7cY0free, text, 4); | |
1839 | |
1840 snprintf(text,100,"\032\001END"); | |
1841 GFX_write_string(&FontT42, &t7cY0free, text, 5); | |
1842 snprintf(text,100,"\030\001%01.1f %c%c" | |
1843 , unit_depth_float(ead) | |
1844 , unit_depth_char1() | |
1845 , unit_depth_char2() | |
1846 ); | |
1847 GFX_write_string(&FontT42, &t7cY0free, text, 6); | |
1848 break; | |
1849 | |
1850 case CVIEW_Profile: | |
1851 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Profile); | |
1852 GFX_write_string(&FontT42,&t7cH,text,0); | |
1853 textpointer = 0; | |
1854 t7_miniLiveLogProfile(); | |
1855 break; | |
1856 | |
1857 case CVIEW_Tissues: | |
1858 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Tissues); | |
1859 GFX_write_string(&FontT42,&t7cH,text,0); | |
1860 textpointer = 0; | |
1861 t7_tissues(stateUsed); | |
1862 break; | |
1863 | |
1864 case CVIEW_sensors: | |
1865 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_O2monitor); | |
1866 GFX_write_string(&FontT42,&t7cH,text,0); | |
1867 textpointer = 0; | |
1868 text[textpointer++] = '\030'; // main color | |
1869 for(int i=0;i<3;i++) | |
1870 { | |
1871 if(stateUsed->diveSettings.ppo2sensors_deactivated & (1<<i)) | |
1872 { | |
1873 text[textpointer++] = '\031'; // labelcolor | |
1874 text[textpointer++] = '\001'; | |
1875 text[textpointer++] = '-'; | |
1876 text[textpointer++] = '\n'; | |
1877 text[textpointer++] = '\r'; | |
1878 text[textpointer++] = '\030'; // main color | |
1879 text[textpointer] = 0; | |
1880 } | |
1881 else | |
1882 { | |
1883 if(stateUsed->warnings.sensorOutOfBounds[i]) | |
1884 text[textpointer++] = '\025'; // Warning Red | |
1885 textpointer += snprintf(&text[textpointer],100,"\001%01.2f\n\r\030",stateUsed->lifeData.ppO2Sensor_bar[i]); | |
1886 } | |
1887 } | |
1888 t7cC.WindowLineSpacing = 95; | |
1889 t7cC.WindowNumberOfTextLines = 3; | |
1890 text[textpointer] = 0; | |
315
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1891 if(pSettings->FlipDisplay) |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1892 { |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1893 t7cC.WindowY1 -= 40; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1894 } |
38 | 1895 GFX_write_string(&FontT105,&t7cC,text,1); |
315
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1896 if(pSettings->FlipDisplay) |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1897 { |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1898 t7cC.WindowY1 += 40; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1899 } |
38 | 1900 break; |
1901 | |
1902 case CVIEW_sensors_mV: | |
1903 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_O2voltage); | |
1904 GFX_write_string(&FontT42,&t7cH,text,0); | |
1905 textpointer = 0; | |
1906 text[textpointer++] = '\030'; | |
1907 for(int i=0;i<3;i++) | |
1908 { | |
1909 if(stateUsed->diveSettings.ppo2sensors_deactivated & (1<<i)) | |
1910 { | |
1911 text[textpointer++] = '\031'; | |
1912 text[textpointer++] = '\001'; | |
1913 text[textpointer++] = '-'; | |
1914 text[textpointer++] = '\n'; | |
1915 text[textpointer++] = '\r'; | |
1916 text[textpointer++] = '\030'; | |
1917 text[textpointer] = 0; | |
1918 } | |
1919 else | |
1920 { | |
1921 if(stateUsed->warnings.sensorOutOfBounds[i]) | |
1922 text[textpointer++] = '\025'; | |
1923 textpointer += snprintf(&text[textpointer],100,"\001%01.1f mV\n\r\030",(stateUsed->lifeData.sensorVoltage_mV[i])); | |
1924 } | |
1925 } | |
1926 t7cC.WindowLineSpacing = 95; | |
1927 t7cC.WindowNumberOfTextLines = 3; | |
1928 text[textpointer] = 0; | |
315
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1929 if(pSettings->FlipDisplay) |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1930 { |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1931 t7cC.WindowY1 -= 40; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1932 } |
38 | 1933 GFX_write_string(&FontT48,&t7cC,text,1); |
315
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1934 if(pSettings->FlipDisplay) |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1935 { |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1936 t7cC.WindowY1 += 40; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1937 } |
38 | 1938 break; |
1939 | |
1940 case CVIEW_Compass: | |
1941 default: | |
1942 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE, TXT2BYTE_Compass); | |
1943 GFX_write_string(&FontT42,&t7cH,text,0); | |
1944 t7_compass((uint16_t)stateUsed->lifeData.compass_heading, stateUsed->diveSettings.compassHeading); | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1945 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1946 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1947 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1948 t7cY0free.WindowX0 += 15; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1949 t7cY0free.WindowY0 = 230; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1950 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1951 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1952 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1953 t7cY0free.WindowX0 -= 15; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1954 t7cY0free.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1955 t7cY0free.WindowY1 = 250; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1956 } |
38 | 1957 snprintf(text,100,"\030\001%03i`",(uint16_t)stateUsed->lifeData.compass_heading); |
1958 GFX_write_string(&FontT54,&t7cY0free,text,0); | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1959 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1960 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1961 t7cY0free.WindowX0 -= 15; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1962 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1963 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1964 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1965 t7cY0free.WindowX0 += 15; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1966 } |
38 | 1967 break; |
1968 | |
1969 case CVIEW_Decolist: | |
1970 snprintf(text,100,"\032\f\001 %c%c", TXT_2BYTE, TXT2BYTE_Decolist); | |
1971 GFX_write_string(&FontT42,&t7cH,text,0); | |
1972 | |
1973 const SDecoinfo * pDecoinfo; | |
1974 uint8_t depthNext, depthLast, depthSecond, depthInc; | |
1975 | |
1976 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE) | |
1977 pDecoinfo = &stateUsed->decolistBuehlmann; | |
1978 else | |
1979 pDecoinfo = &stateUsed->decolistVPM; | |
1980 | |
1981 depthLast = (uint8_t)(stateUsed->diveSettings.last_stop_depth_bar * 10); | |
1982 depthSecond = (uint8_t)(stateUsed->diveSettings.input_second_to_last_stop_depth_bar * 10); | |
1983 depthInc = (uint8_t)(stateUsed->diveSettings.input_next_stop_increment_depth_bar * 10); | |
1984 | |
1985 if(settingsGetPointer()->nonMetricalSystem) | |
1986 { | |
1987 depthLast = (uint8_t)unit_depth_integer(depthLast); | |
1988 depthSecond = (uint8_t)unit_depth_integer(depthSecond); | |
1989 depthInc = (uint8_t)unit_depth_integer(depthInc); | |
1990 } | |
1991 | |
1992 for(start=DECOINFO_STRUCT_MAX_STOPS-1; start>0; start--) | |
1993 if(pDecoinfo->output_stop_length_seconds[start]) break; | |
1994 start -= 6; | |
1995 if(start < 0) start = 0; | |
1996 | |
1997 textpointer = 0; | |
1998 for(int i=start;i<6+start;i++) | |
1999 { | |
2000 if(i == 0) | |
2001 depthNext = depthLast; | |
2002 else | |
2003 depthNext = depthSecond + (( i - 1 )* depthInc); | |
2004 | |
2005 if(pDecoinfo->output_stop_length_seconds[i]) | |
2006 textpointer += snprintf(&text[textpointer],20,"\030\034 %2u\016\016%c%c\017%3i'\n\r",depthNext, unit_depth_char1(), unit_depth_char2(), (pDecoinfo->output_stop_length_seconds[i]+59)/60); | |
2007 else | |
2008 textpointer += snprintf(&text[textpointer],20,"\031\034 %2u\016\016%c%c\017\n\r",depthNext, unit_depth_char1(), unit_depth_char2()); | |
2009 if(textpointer > 200) break; | |
2010 } | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2011 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2012 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2013 t7cY0free.WindowY0 = t7cC.WindowY0 - 10; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2014 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2015 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2016 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2017 t7cY0free.WindowY0 = t7cC.WindowY0 - 10; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2018 t7cY0free.WindowY1 = 400; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2019 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2020 |
38 | 2021 t7cY0free.WindowLineSpacing = 48; |
2022 t7cY0free.WindowNumberOfTextLines = 6; | |
2023 GFX_write_string(&FontT42, &t7cY0free, text, 1); | |
2024 break; | |
2025 } | |
2026 } | |
2027 | |
2028 | |
2029 | |
2030 /* DIVE MODE | |
2031 */ | |
2032 void t7_refresh_divemode(void) | |
2033 { | |
2034 char TextL1[TEXTSIZE]; | |
2035 char TextL2[TEXTSIZE]; | |
2036 | |
2037 char TextR1[TEXTSIZE]; | |
2038 char TextR2[TEXTSIZE]; | |
2039 char TextR3[TEXTSIZE]; | |
2040 | |
2041 char TextC1[2*TEXTSIZE]; | |
2042 char TextC2[TEXTSIZE]; | |
2043 uint8_t textPointer; | |
2044 | |
2045 point_t start, stop; | |
2046 uint8_t color; | |
2047 int textlength; | |
2048 | |
2049 uint16_t nextstopLengthSeconds = 0; | |
2050 uint8_t nextstopDepthMeter = 0; | |
2051 uint8_t oxygen_percentage = 0; | |
2052 SDivetime Divetime = {0,0,0, 0}; | |
2053 SDivetime SafetyStopTime = {0,0,0,0}; | |
2054 SDivetime TimeoutTime = {0,0,0,0}; | |
2055 uint8_t customview_warnings = 0; | |
2056 const SDecoinfo * pDecoinfo; | |
2057 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2058 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2059 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2060 |
38 | 2061 Divetime.Total = stateUsed->lifeData.dive_time_seconds_without_surface_time; |
2062 Divetime.Minutes = Divetime.Total / 60; | |
2063 Divetime.Seconds = Divetime.Total - ( Divetime.Minutes * 60 ); | |
2064 | |
2065 SafetyStopTime.Total = timer_Safetystop_GetCountDown(); | |
2066 SafetyStopTime.Minutes = SafetyStopTime.Total / 60; | |
2067 SafetyStopTime.Seconds = SafetyStopTime.Total - (SafetyStopTime.Minutes * 60); | |
2068 | |
2069 TimeoutTime.Total = settingsGetPointer()->timeoutDiveReachedZeroDepth - stateUsed->lifeData.counterSecondsShallowDepth; | |
2070 if(TimeoutTime.Total > settingsGetPointer()->timeoutDiveReachedZeroDepth) | |
2071 { | |
2072 TimeoutTime.Total = 0; | |
2073 } | |
2074 TimeoutTime.Minutes = TimeoutTime.Total / 60; | |
2075 TimeoutTime.Seconds = TimeoutTime.Total - (TimeoutTime.Minutes * 60); | |
2076 | |
2077 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE) | |
2078 pDecoinfo = &stateUsed->decolistBuehlmann; | |
2079 else | |
2080 pDecoinfo = &stateUsed->decolistVPM; | |
2081 | |
2082 if(pDecoinfo->output_time_to_surface_seconds) | |
2083 { | |
2084 tHome_findNextStop(pDecoinfo->output_stop_length_seconds, &nextstopDepthMeter, &nextstopLengthSeconds); | |
2085 } | |
2086 else | |
2087 { | |
2088 nextstopDepthMeter = 0; | |
2089 nextstopLengthSeconds = 0; | |
2090 } | |
2091 | |
2092 /* depth */ | |
174
ecb71521d004
Bugfix: make max depth move with current depth (part 2)
Jan Mulder <jlmulder@xs4all.nl>
parents:
166
diff
changeset
|
2093 float depth = unit_depth_float(stateUsed->lifeData.depth_meter); |
38 | 2094 |
2095 if(depth <= 0.3f) | |
2096 depth = 0; | |
2097 | |
2098 if(settingsGetPointer()->nonMetricalSystem) | |
2099 snprintf(TextL1,TEXTSIZE,"\032\f[feet]"); | |
2100 else | |
2101 snprintf(TextL1,TEXTSIZE,"\032\f%c",TXT_Depth); | |
2102 GFX_write_string(&FontT24,&t7l1,TextL1,0); | |
2103 | |
2104 if((stateUsed->lifeData.ascent_rate_meter_per_min > 8) || (stateUsed->lifeData.ascent_rate_meter_per_min < -10)) | |
2105 { | |
2106 snprintf(TextL1,TEXTSIZE,"\f\002%.0f %c%c/min " | |
2107 , unit_depth_float(stateUsed->lifeData.ascent_rate_meter_per_min) | |
2108 , unit_depth_char1() | |
2109 , unit_depth_char2() | |
2110 ); | |
2111 GFX_write_string(&FontT24,&t7l1,TextL1,0); | |
2112 } | |
2113 | |
2114 if( depth < 100) | |
2115 snprintf(TextL1,TEXTSIZE,"\020%01.1f",depth); | |
2116 else | |
2117 snprintf(TextL1,TEXTSIZE,"\020%01.0f",depth); | |
2118 | |
2119 t7_colorscheme_mod(TextL1); | |
2120 GFX_write_string(&FontT144,&t7l1,TextL1,1); | |
2121 | |
2122 /* max depth */ | |
2123 snprintf(TextL2,TEXTSIZE,"\032\f%c",TXT_MaxDepth); | |
2124 GFX_write_string(&FontT42,&t7l2,TextL2,0); | |
2125 | |
2126 if(unit_depth_float(stateUsed->lifeData.max_depth_meter) < 100) | |
2127 snprintf(TextL2,TEXTSIZE,"\020%01.1f",unit_depth_float(stateUsed->lifeData.max_depth_meter)); | |
2128 else | |
2129 snprintf(TextL2,TEXTSIZE,"\020%01.0f",unit_depth_float(stateUsed->lifeData.max_depth_meter)); | |
2130 | |
2131 t7_colorscheme_mod(TextL2); | |
2132 GFX_write_string(&FontT105,&t7l2,TextL2,1); | |
2133 | |
187
485c5135cf7f
cleanup: forgotten cleanup from 9da7dd50e2ec
Jan Mulder <jlmulder@xs4all.nl>
parents:
178
diff
changeset
|
2134 /* ascent rate graph */ |
392 | 2135 if(stateUsed->lifeData.ascent_rate_meter_per_min > 1) /* a value < 1 would cause a bar in negative direction brush rectangle of 12 and step width of 6 */ |
38 | 2136 { |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2137 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2138 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2139 start.y = t7l1.WindowY0 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2140 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2141 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2142 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2143 start.y = t7l3.WindowY0 - 25; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2144 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2145 |
38 | 2146 for(int i = 0; i<4;i++) |
2147 { | |
2148 start.y += 5*6; | |
2149 stop.y = start.y; | |
2150 start.x = CUSTOMBOX_LINE_LEFT - 1; | |
2151 stop.x = start.x - 17; | |
2152 GFX_draw_line(&t7screen, start, stop, 0); | |
2153 // start.x = CUSTOMBOX_LINE_RIGHT + 2; old right too | |
2154 // stop.x = start.x + 17; | |
2155 // GFX_draw_line(&t7screen, start, stop, 0); | |
2156 } | |
2157 // new thick bar design Sept. 2015 | |
2158 start.x = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET - 3 - 5; | |
2159 stop.x = start.x; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2160 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2161 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2162 start.y = t7l1.WindowY0 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2163 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2164 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2165 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2166 start.y = t7l3.WindowY0 - 25; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2167 } |
38 | 2168 stop.y = start.y + (uint16_t)(stateUsed->lifeData.ascent_rate_meter_per_min * 6); |
2169 stop.y -= 3; // wegen der Liniendicke von 12 anstelle von 9 | |
2170 if(stop.y >= 470) | |
2171 stop.y = 470; | |
2172 start.y += 7; // starte etwas weiter oben | |
2173 if(stateUsed->lifeData.ascent_rate_meter_per_min <= 10) | |
2174 color = CLUT_EverythingOkayGreen; | |
2175 else | |
2176 if(stateUsed->lifeData.ascent_rate_meter_per_min <= 15) | |
2177 color = CLUT_WarningYellow; | |
2178 else | |
2179 color = CLUT_WarningRed; | |
2180 | |
2181 GFX_draw_thick_line(12,&t7screen, start, stop, color); | |
2182 } | |
2183 //snprintf(TextL2,TEXTSIZE,"\f%.1f m/min",stateUsed->lifeData.ascent_rate_meter_per_min); | |
2184 | |
2185 /* divetime */ | |
2186 if(stateUsed->lifeData.counterSecondsShallowDepth) | |
2187 { | |
2188 snprintf(TextR1,TEXTSIZE,"\f\002\136 %u:%02u",TimeoutTime.Minutes, TimeoutTime.Seconds); | |
2189 GFX_write_string(&FontT42,&t7r1,TextR1,0); | |
2190 } | |
2191 else | |
2192 { | |
2193 snprintf(TextR1,TEXTSIZE,"\032\f\002%c",TXT_Divetime); | |
2194 GFX_write_string(&FontT42,&t7r1,TextR1,0); | |
2195 } | |
2196 | |
2197 if(Divetime.Minutes < 1000) | |
2198 snprintf(TextR1,TEXTSIZE,"\020\016\002%u:%02u",Divetime.Minutes, Divetime.Seconds); | |
2199 else | |
2200 snprintf(TextR1,TEXTSIZE,"\020\016\002%u'",Divetime.Minutes); | |
2201 t7_colorscheme_mod(TextR1); | |
2202 GFX_write_string(&FontT105,&t7r1,TextR1,1); | |
2203 | |
2204 /* next deco stop */ | |
2205 if(nextstopDepthMeter) | |
2206 { | |
2207 snprintf(TextR2,TEXTSIZE,"\032\f\002%c",TXT_Decostop); | |
2208 GFX_write_string(&FontT42,&t7r2,TextR2,0); | |
2209 textlength = snprintf(TextR2,TEXTSIZE,"\020\002%u%c%c %u'" | |
2210 , unit_depth_integer(nextstopDepthMeter) | |
2211 , unit_depth_char1_T105() | |
2212 , unit_depth_char2_T105() | |
2213 , (nextstopLengthSeconds+59)/60); | |
2214 t7_colorscheme_mod(TextR2); | |
2215 if(time_elapsed_ms(pDecoinfo->tickstamp, HAL_GetTick()) > MAX_AGE_DECOINFO_MS) | |
2216 TextR2[0] = '\021'; | |
2217 if(textlength <= 9) | |
2218 GFX_write_string(&FontT105,&t7r2,TextR2,1); | |
2219 else | |
2220 GFX_write_string(&FontT54,&t7r2,TextR2,1); | |
2221 } | |
2222 else if(SafetyStopTime.Total && (depth > timer_Safetystop_GetDepthUpperLimit())) | |
2223 { | |
2224 snprintf(TextR2,TEXTSIZE,"\032\f\002%c%c",TXT_2BYTE,TXT2BYTE_SafetyStop2); | |
2225 GFX_write_string(&FontT42,&t7r2,TextR2,0); | |
2226 snprintf(TextR2,TEXTSIZE,"\020\016\002%u:%02u",SafetyStopTime.Minutes,SafetyStopTime.Seconds); | |
2227 t7_colorscheme_mod(TextR2); | |
2228 GFX_write_string(&FontT105,&t7r2,TextR2,1); | |
2229 } | |
2230 | |
2231 /* tts - option 1 | |
2232 * ndl - option 2 | |
2233 * empty - option 3 */ | |
2234 if(pDecoinfo->output_time_to_surface_seconds) | |
2235 { | |
2236 snprintf(TextR3,TEXTSIZE,"\032\f\002%c",TXT_TTS); | |
2237 GFX_write_string(&FontT42,&t7r3,TextR3,0); | |
2238 if(pDecoinfo->output_time_to_surface_seconds < 1000 * 60) | |
214
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
211
diff
changeset
|
2239 snprintf(TextR3,TEXTSIZE,"\020\002%i'",(pDecoinfo->output_time_to_surface_seconds + 59)/ 60); |
38 | 2240 else |
214
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
211
diff
changeset
|
2241 snprintf(TextR3,TEXTSIZE,"\020\002%ih",(pDecoinfo->output_time_to_surface_seconds + 59)/ 3600); |
38 | 2242 t7_colorscheme_mod(TextR3); |
2243 if(time_elapsed_ms(pDecoinfo->tickstamp, HAL_GetTick()) > MAX_AGE_DECOINFO_MS) | |
2244 TextR2[0] = '\021'; | |
2245 GFX_write_string(&FontT105,&t7r3,TextR3,1); | |
2246 } | |
2247 else if(pDecoinfo->output_ndl_seconds) | |
2248 { | |
2249 snprintf(TextR3,TEXTSIZE,"\032\f\002%c",TXT_Nullzeit); | |
2250 GFX_write_string(&FontT42,&t7r3,TextR3,0); | |
2251 if(pDecoinfo->output_ndl_seconds < 1000 * 60) | |
2252 snprintf(TextR3,TEXTSIZE,"\020\002%i'",pDecoinfo->output_ndl_seconds/60); | |
2253 else | |
2254 snprintf(TextR3,TEXTSIZE,"\020\002%ih",pDecoinfo->output_ndl_seconds/3600); | |
2255 t7_colorscheme_mod(TextR3); | |
2256 if(time_elapsed_ms(pDecoinfo->tickstamp, HAL_GetTick()) > MAX_AGE_DECOINFO_MS) | |
2257 TextR2[0] = '\021'; | |
2258 GFX_write_string(&FontT105,&t7r3,TextR3,1); | |
2259 } | |
2260 | |
2261 /* Menu Selection (and gas mix) */ | |
2262 if(get_globalState() == StDMGAS) | |
2263 { | |
2264 textPointer = 0; | |
2265 TextR1[textPointer++] = '\a'; | |
2266 // TextR1[textPointer++] = '\f'; | |
2267 TextR1[textPointer++] = '\001'; | |
2268 TextR1[textPointer++] = ' '; | |
2269 textPointer += tHome_gas_writer(stateUsed->diveSettings.gas[actualBetterGasId()].oxygen_percentage,stateUsed->diveSettings.gas[actualBetterGasId()].helium_percentage,&TextR1[textPointer]); | |
2270 TextR1[textPointer++] = '?'; | |
2271 TextR1[textPointer++] = ' '; | |
2272 TextR1[textPointer++] = 0; | |
2273 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
2274 } | |
2275 else if(get_globalState() == StDMSPT) | |
2276 { | |
2277 textPointer = 0; | |
2278 TextR1[textPointer++] = '\a'; | |
2279 TextR1[textPointer++] = '\001'; | |
2280 TextR1[textPointer++] = ' '; | |
2281 textPointer += snprintf(&TextR1[textPointer],5,"%f01.2",((float)(stateUsed->diveSettings.setpoint[actualBetterSetpointId()].setpoint_cbar))/100); | |
2282 TextR1[textPointer++] = '?'; | |
2283 TextR1[textPointer++] = ' '; | |
2284 TextR1[textPointer++] = 0; | |
2285 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
2286 } | |
2287 else if(get_globalState() == StDMENU) | |
2288 { | |
2289 snprintf(TextR1,TEXTSIZE,"\a\001%c%c", TXT_2BYTE, TXT2BYTE_DiveMenuQ); | |
2290 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
2291 } | |
2292 else if(get_globalState() == StDSIM1) | |
2293 { | |
2294 snprintf(TextR1,TEXTSIZE,"\a\001%c%c", TXT_2BYTE, TXT2BYTE_DiveQuitQ); | |
2295 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
2296 } | |
2297 else if(get_globalState() == StDSIM2) | |
2298 { | |
2299 if(settingsGetPointer()->nonMetricalSystem) | |
2300 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:-3.33ft "); | |
2301 else | |
2302 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:-1m "); | |
2303 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
2304 | |
2305 snprintf(TextR1,TEXTSIZE,"\a\f %u %c%c" | |
2306 , unit_depth_integer(simulation_get_aim_depth()) | |
2307 , unit_depth_char1() | |
2308 , unit_depth_char2() | |
2309 ); | |
2310 GFX_write_string_color(&FontT42,&t7l1,TextR1,0,CLUT_WarningYellow); | |
2311 | |
2312 } | |
2313 else if(get_globalState() == StDSIM3) | |
2314 { | |
2315 if(settingsGetPointer()->nonMetricalSystem) | |
2316 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:+3.33ft "); | |
2317 else | |
2318 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:+1m "); | |
2319 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
2320 snprintf(TextR1,TEXTSIZE,"\a\f %u %c%c" | |
2321 , unit_depth_integer(simulation_get_aim_depth()) | |
2322 , unit_depth_char1() | |
2323 , unit_depth_char2() | |
2324 ); | |
2325 GFX_write_string_color(&FontT42,&t7l1,TextR1,0,CLUT_WarningYellow); | |
2326 } | |
2327 else if(get_globalState() == StDSIM4) | |
2328 { | |
2329 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:+5' "); | |
2330 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
2331 snprintf(TextR1,TEXTSIZE,"\a\f %u %c%c" | |
2332 , unit_depth_integer(simulation_get_aim_depth()) | |
2333 , unit_depth_char1() | |
2334 , unit_depth_char2() | |
2335 ); | |
2336 GFX_write_string_color(&FontT42,&t7l1,TextR1,0,CLUT_WarningYellow); | |
2337 } | |
2338 else | |
2339 { | |
2340 /* gas mix */ | |
2341 oxygen_percentage = 100; | |
2342 oxygen_percentage -= stateUsed->lifeData.actualGas.nitrogen_percentage; | |
2343 oxygen_percentage -= stateUsed->lifeData.actualGas.helium_percentage; | |
2344 | |
2345 textPointer = 0; | |
2346 TextC2[textPointer++] = '\020'; | |
2347 if(stateUsed->warnings.betterGas && warning_count_high_time) | |
2348 { | |
2349 TextC2[textPointer++] = '\a'; | |
2350 } | |
2351 else | |
2352 { | |
2353 float fPpO2limitHigh, fPpO2now; | |
2354 | |
2355 if(actualLeftMaxDepth(stateUsed)) | |
2356 fPpO2limitHigh = settingsGetPointer()->ppO2_max_deco; | |
2357 else | |
2358 fPpO2limitHigh = settingsGetPointer()->ppO2_max_std; | |
2359 | |
2360 fPpO2now = (stateUsed->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * oxygen_percentage; | |
2361 | |
2362 if((fPpO2now > fPpO2limitHigh) || (fPpO2now < (float)(settingsGetPointer()->ppO2_min))) | |
2363 TextC2[textPointer++] = '\025'; | |
2364 } | |
2365 TextC2[textPointer++] = '\002'; | |
2366 textPointer += tHome_gas_writer(oxygen_percentage,stateUsed->lifeData.actualGas.helium_percentage,&TextC2[textPointer]); | |
2367 | |
2368 if(stateUsed->warnings.betterGas && warning_count_high_time) | |
2369 { | |
2370 if(TextC2[0] == '\020') | |
2371 { | |
2372 TextC2[0] = '\004'; // NOP | |
2373 } | |
2374 GFX_write_string_color(&FontT48,&t7c2,TextC2,0,CLUT_WarningYellow); | |
2375 } | |
2376 else | |
2377 { | |
2378 t7_colorscheme_mod(TextC2); | |
2379 GFX_write_string(&FontT48,&t7c2,TextC2,0); // T54 has only numbers | |
2380 } | |
2381 | |
2382 if(stateUsed->diveSettings.ccrOption) | |
2383 { | |
2384 if(stateUsed->diveSettings.diveMode == DIVEMODE_CCR) | |
2385 { | |
2386 snprintf(TextC2,TEXTSIZE,"\020%01.2f",stateUsed->lifeData.ppO2); | |
2387 if(stateUsed->warnings.betterSetpoint && warning_count_high_time && (stateUsed->diveSettings.diveMode == DIVEMODE_CCR)) | |
2388 { | |
2389 TextC2[0] = '\a'; // inverse instead of color \020 | |
2390 GFX_write_string_color(&FontT48,&t7c2,TextC2,0,CLUT_WarningYellow); | |
2391 } | |
2392 else | |
2393 { | |
2394 t7_colorscheme_mod(TextC2); | |
2395 GFX_write_string(&FontT48,&t7c2,TextC2,0); | |
2396 } | |
2397 } | |
2398 } | |
2399 else if(settingsGetPointer()->alwaysShowPPO2) | |
2400 { | |
2401 snprintf(TextC2,TEXTSIZE,"\020%01.2f",stateUsed->lifeData.ppO2); | |
2402 t7_colorscheme_mod(TextC2); | |
2403 GFX_write_string(&FontT48,&t7c2,TextC2,0); | |
2404 } | |
2405 } | |
2406 | |
2407 /* algorithm, ccr, bailout and battery */ | |
2408 /* and permanent warnings (CNS) */ | |
2409 | |
2410 if((stateUsed->warnings.cnsHigh) && display_count_high_time) | |
2411 { | |
2412 TextC2[0] = '\f'; | |
2413 TextC2[1] = TXT_2BYTE; | |
2414 TextC2[2] = TXT2BYTE_WarnCnsHigh; | |
2415 TextC2[3] = 0; | |
2416 GFX_write_string_color(&FontT48,&t7c1,TextC2,0,CLUT_WarningRed); | |
2417 } | |
2418 else | |
2419 { | |
2420 if(stateUsed->warnings.aGf) | |
2421 { | |
2422 GFX_write_string_color(&FontT48,&t7c1,"\f" "aGF",0,CLUT_WarningYellow); | |
2423 } | |
2424 else if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE) | |
2425 { | |
2426 GFX_write_string(&FontT48,&t7c1,"\027\f" "GF",0); | |
2427 } | |
2428 else | |
2429 { | |
2430 GFX_write_string(&FontT48,&t7c1,"\027\f" "VPM",0); | |
2431 } | |
2432 | |
2433 if(stateUsed->diveSettings.diveMode == DIVEMODE_CCR) | |
2434 GFX_write_string(&FontT24,&t7c1,"\027\f\002" "CCR",0); | |
2435 // GFX_write_string(&FontT24,&t7c1,"\f\177\177\x80" "CCR",0); | |
2436 else | |
2437 if(stateUsed->diveSettings.ccrOption) | |
2438 GFX_write_string(&FontT24,&t7c1,"\f\002\024" "Bailout",0); | |
2439 // GFX_write_string(&FontT24,&t7c1,"\f\177\177\x80\024" "Bailout",0); | |
2440 } | |
2441 TextC1[0] = '\020'; | |
2442 TextC1[1] = '3'; | |
2443 TextC1[2] = '1'; | |
2444 TextC1[3] = '1'; | |
2445 TextC1[4] = '1'; | |
2446 TextC1[5] = '1'; | |
2447 TextC1[6] = '1'; | |
2448 TextC1[7] = '1'; | |
2449 TextC1[8] = '1'; | |
2450 TextC1[9] = '1'; | |
2451 TextC1[10] = '1'; | |
2452 TextC1[11] = '1'; | |
2453 TextC1[12] = '0'; | |
2454 TextC1[13] = 0; | |
2455 | |
2456 for(int i=1;i<=10;i++) | |
2457 { | |
2458 if( stateUsed->lifeData.battery_charge > (9 * i)) | |
2459 TextC1[i+1] += 1; | |
2460 } | |
2461 | |
2462 if(stateUsed->warnings.lowBattery) | |
2463 { | |
2464 TextC1[0] = '\025'; | |
2465 if(warning_count_high_time) | |
2466 { | |
2467 for(int i=2;i<=11;i++) | |
2468 TextC1[i] = '1'; | |
2469 } | |
2470 else | |
2471 { | |
2472 TextC1[2] = '2'; | |
2473 } | |
2474 GFX_write_string(&Batt24,&t7batt,TextC1,0); | |
2475 | |
2476 if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->lifeData.battery_charge < 140)) | |
2477 { | |
2478 snprintf(TextC1,16,"\004\025\f\002%u%%",(uint8_t)stateUsed->lifeData.battery_charge); | |
2479 if(warning_count_high_time) | |
2480 TextC1[0] = '\a'; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2481 GFX_write_string(&FontT24,&t7voltage,TextC1,0); |
38 | 2482 } |
2483 } | |
2484 else | |
2485 { | |
2486 t7_colorscheme_mod(TextC1); | |
2487 GFX_write_string(&Batt24,&t7batt,TextC1,0); | |
2488 | |
2489 if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->lifeData.battery_charge < 140)) | |
2490 { | |
2491 snprintf(TextC1,16,"\020\f\002%u%%",(uint8_t)stateUsed->lifeData.battery_charge); | |
2492 t7_colorscheme_mod(TextC1); | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2493 GFX_write_string(&FontT24,&t7voltage,TextC1,0); // t7batt |
38 | 2494 } |
2495 } | |
2496 | |
2497 /* customizable left lower corner */ | |
2498 t7_refresh_divemode_userselected_left_lower_corner(); | |
2499 | |
2500 | |
2501 /* customview - option 1 | |
2502 * warning - option 2 */ | |
2503 if(stateUsed->warnings.numWarnings) | |
2504 customview_warnings = t7_test_customview_warnings(); | |
2505 | |
166
255eedad4155
cleanup: get rid of some compile warnings
Jan Mulder <jlmulder@xs4all.nl>
parents:
149
diff
changeset
|
2506 background.pointer = 0; |
38 | 2507 if(customview_warnings && warning_count_high_time) |
2508 t7_show_customview_warnings(); | |
2509 else | |
2510 t7_refresh_customview(); | |
2511 | |
2512 /* the frame */ | |
2513 draw_frame(1,1, CLUT_DIVE_pluginbox, CLUT_DIVE_FieldSeperatorLines); | |
2514 } | |
2515 | |
2516 void t7_set_field_to_primary(void) | |
2517 { | |
2518 if(stateUsed->mode == MODE_DIVE) | |
2519 selection_custom_field = settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary; | |
2520 } | |
2521 | |
2522 void t7_change_field(void) | |
2523 { | |
2524 const uint8_t minVal = 0; | |
2525 const uint8_t maxValGF = 8; | |
2526 const uint8_t maxValVPM = 7; | |
2527 uint8_t maxNow = maxValGF; | |
2528 | |
2529 selection_custom_field++; | |
2530 | |
2531 if(stateUsed->diveSettings.deco_type.ub.standard == VPM_MODE) | |
2532 maxNow = maxValVPM; | |
2533 | |
2534 if(selection_custom_field > maxNow) | |
2535 selection_custom_field = minVal; | |
2536 } | |
2537 | |
2538 | |
2539 void t7_refresh_divemode_userselected_left_lower_corner(void) | |
2540 { | |
2541 if(!selection_custom_field) | |
2542 return; | |
2543 | |
2544 char headerText[10]; | |
2545 char text[TEXTSIZE]; | |
2546 uint8_t textpointer = 0; | |
2547 _Bool tinyHeaderFont = 0; | |
2548 uint8_t line = 0; | |
2549 | |
2550 SDivetime Stopwatch = {0,0,0,0}; | |
2551 float fAverageDepth, fAverageDepthAbsolute; | |
2552 const SDecoinfo * pDecoinfoStandard; | |
2553 const SDecoinfo * pDecoinfoFuture; | |
2554 float fCNS; | |
2555 float temperature; | |
2556 | |
2557 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE) | |
2558 { | |
2559 pDecoinfoStandard = &stateUsed->decolistBuehlmann; | |
2560 pDecoinfoFuture = &stateUsed->decolistFutureBuehlmann; | |
2561 } | |
2562 else | |
2563 { | |
2564 pDecoinfoStandard = &stateUsed->decolistVPM; | |
2565 pDecoinfoFuture = &stateUsed->decolistFutureVPM; | |
2566 } | |
2567 | |
2568 Stopwatch.Total = timer_Stopwatch_GetTime(); | |
2569 Stopwatch.Minutes = Stopwatch.Total / 60; | |
2570 Stopwatch.Seconds = Stopwatch.Total - ( Stopwatch.Minutes * 60 ); | |
2571 fAverageDepth = timer_Stopwatch_GetAvarageDepth_Meter(); | |
2572 fAverageDepthAbsolute = stateUsed->lifeData.average_depth_meter; | |
2573 | |
2574 headerText[0] = '\032'; | |
2575 headerText[1] = '\f'; | |
2576 | |
2577 switch(selection_custom_field) | |
2578 { | |
2579 /* Temperature */ | |
2580 case 1: | |
2581 default: | |
189
8b8074080d7b
Bugfix: average temperature on arrival from RTE instead of display time
Jan Mulder <jlmulder@xs4all.nl>
parents:
187
diff
changeset
|
2582 temperature = unit_temperature_float(stateUsed->lifeData.temperature_celsius); |
38 | 2583 headerText[2] = TXT_Temperature; |
2584 textpointer = snprintf(text,TEXTSIZE,"\020\016%01.1f \140",temperature); // "\016\016%01.1f `" + C or F | |
2585 if(settingsGetPointer()->nonMetricalSystem == 0) | |
2586 text[textpointer++] = 'C'; | |
2587 else | |
2588 text[textpointer++] = 'F'; | |
2589 text[textpointer++] = 0; | |
2590 tinyHeaderFont = 0; | |
2591 break; | |
2592 | |
2593 /* Average Depth */ | |
2594 case 2: | |
2595 headerText[2] = TXT_AvgDepth; | |
2596 if(settingsGetPointer()->nonMetricalSystem) | |
2597 snprintf(text,TEXTSIZE,"\020%01.0f",unit_depth_float(fAverageDepthAbsolute)); | |
2598 else | |
2599 snprintf(text,TEXTSIZE,"\020%01.1f",fAverageDepthAbsolute); | |
2600 break; | |
2601 | |
2602 /* ppO2 */ | |
2603 case 3: | |
2604 headerText[2] = TXT_ppO2; | |
2605 snprintf(text,TEXTSIZE,"\020%01.2f",stateUsed->lifeData.ppO2); | |
2606 break; | |
2607 | |
2608 /* Stop Uhr */ | |
2609 case 4: | |
2610 headerText[2] = TXT_Stopwatch; | |
2611 if(settingsGetPointer()->nonMetricalSystem) | |
2612 snprintf(text,TEXTSIZE,"\020\016\016%u:%02u\n\r%01.0f",Stopwatch.Minutes, Stopwatch.Seconds,unit_depth_float(fAverageDepth)); | |
2613 else | |
2614 snprintf(text,TEXTSIZE,"\020\016\016%u:%02u\n\r%01.1f",Stopwatch.Minutes, Stopwatch.Seconds,fAverageDepth); | |
2615 tinyHeaderFont = 1; | |
2616 line = 1; | |
2617 break; | |
2618 | |
2619 /* Ceiling */ | |
2620 case 5: | |
2621 headerText[2] = TXT_Ceiling; | |
2622 if((pDecoinfoStandard->output_ceiling_meter > 99.9f) || (settingsGetPointer()->nonMetricalSystem)) | |
2623 snprintf(text,TEXTSIZE,"\020%01.0f",unit_depth_float(pDecoinfoStandard->output_ceiling_meter)); | |
2624 else | |
2625 snprintf(text,TEXTSIZE,"\020%01.1f",pDecoinfoStandard->output_ceiling_meter); | |
2626 break; | |
2627 | |
2628 /* Future TTS */ | |
2629 case 6: | |
2630 headerText[2] = TXT_FutureTTS; | |
214
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
211
diff
changeset
|
2631 if (pDecoinfoFuture->output_time_to_surface_seconds < 1000 * 60) |
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
211
diff
changeset
|
2632 snprintf(text,TEXTSIZE,"\020\016\016@+%u'\n\r" "%i' TTS",settingsGetPointer()->future_TTS, (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 60); |
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
211
diff
changeset
|
2633 else |
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
211
diff
changeset
|
2634 snprintf(text,TEXTSIZE,"\020\016\016@+%u'\n\r" "%ih TTS",settingsGetPointer()->future_TTS, (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 3600); |
38 | 2635 tinyHeaderFont = 1; |
2636 line = 1; | |
2637 break; | |
2638 | |
2639 /* CNS */ | |
2640 case 7: | |
2641 headerText[2] = TXT_CNS; | |
2642 fCNS = stateUsed->lifeData .cns; | |
2643 if(fCNS > 999) | |
2644 fCNS = 999; | |
2645 snprintf(text,TEXTSIZE,"\020%.0f\016\016%%\017",fCNS); | |
2646 break; | |
2647 | |
2648 /* actual GF */ | |
2649 case 8: | |
2650 headerText[2] = TXT_ActualGradient; | |
247
3949781096d4
feature: Relative GF to Saturation renames
Jan Mulder <jlmulder@xs4all.nl>
parents:
225
diff
changeset
|
2651 snprintf(text,TEXTSIZE,"\020%.0f\016\016%%\017",100 * pDecoinfoStandard->super_saturation); |
38 | 2652 break; |
2653 } | |
2654 headerText[3] = 0; | |
2655 | |
2656 if(tinyHeaderFont) | |
2657 GFX_write_string(&FontT24,&t7l3,headerText,0); | |
2658 else | |
2659 GFX_write_string(&FontT42,&t7l3,headerText,0); | |
2660 | |
2661 t7_colorscheme_mod(text); | |
2662 GFX_write_string(&FontT105,&t7l3,text,line); | |
2663 } | |
2664 | |
2665 /* Private functions ---------------------------------------------------------*/ | |
2666 | |
2667 uint8_t t7_customtextPrepare(char * text) | |
2668 { | |
2669 uint8_t i, j, textptr, lineCount; | |
2670 char nextChar; | |
2671 | |
2672 textptr = 0; | |
2673 lineCount = 0; | |
2674 | |
2675 text[textptr++] = TXT_MINIMAL; | |
2676 | |
2677 j = 0; | |
2678 i = 0; | |
2679 do | |
2680 { | |
2681 j += i; | |
2682 i = 0; | |
2683 do | |
2684 { | |
2685 nextChar = settingsGetPointer()->customtext[i+j]; | |
2686 i++; | |
2687 if((!nextChar) || (nextChar =='\n') || (nextChar =='\r')) | |
2688 break; | |
2689 text[textptr++] = nextChar; | |
2690 } while (i < 12); | |
2691 | |
2692 if(!nextChar) | |
2693 break; | |
2694 | |
2695 if(lineCount < 3) | |
2696 { | |
2697 text[textptr++] = '\n'; | |
2698 text[textptr++] = '\r'; | |
2699 } | |
2700 lineCount++; | |
2701 for(uint8_t k=0;k<2;k++) | |
2702 { | |
2703 nextChar = settingsGetPointer()->customtext[i+j+k]; | |
2704 if((nextChar =='\n') || (nextChar =='\r')) | |
2705 i++; | |
2706 else | |
2707 break; | |
2708 } | |
2709 | |
2710 } while (lineCount < 4); | |
2711 | |
2712 text[textptr] = 0; | |
2713 return lineCount; | |
2714 } | |
2715 | |
196
2885628ab3ba
Bugfix, minor: color the overview customview correctly
Jan Mulder <jlmulder@xs4all.nl>
parents:
193
diff
changeset
|
2716 static void t7_colorscheme_mod(char *text) { |
2885628ab3ba
Bugfix, minor: color the overview customview correctly
Jan Mulder <jlmulder@xs4all.nl>
parents:
193
diff
changeset
|
2717 char *p = text; |
2885628ab3ba
Bugfix, minor: color the overview customview correctly
Jan Mulder <jlmulder@xs4all.nl>
parents:
193
diff
changeset
|
2718 while (*p) { |
2885628ab3ba
Bugfix, minor: color the overview customview correctly
Jan Mulder <jlmulder@xs4all.nl>
parents:
193
diff
changeset
|
2719 if ((*p == '\020') && !GFX_is_colorschemeDiveStandard()) |
2885628ab3ba
Bugfix, minor: color the overview customview correctly
Jan Mulder <jlmulder@xs4all.nl>
parents:
193
diff
changeset
|
2720 *p = '\027'; |
2885628ab3ba
Bugfix, minor: color the overview customview correctly
Jan Mulder <jlmulder@xs4all.nl>
parents:
193
diff
changeset
|
2721 p++; |
2885628ab3ba
Bugfix, minor: color the overview customview correctly
Jan Mulder <jlmulder@xs4all.nl>
parents:
193
diff
changeset
|
2722 } |
38 | 2723 } |
2724 | |
2725 void draw_frame(_Bool PluginBoxHeader, _Bool LinesOnTheSides, uint8_t colorBox, uint8_t colorLinesOnTheSide) | |
2726 { | |
2727 point_t LeftLow, WidthHeight; | |
2728 point_t start, stop; | |
2729 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2730 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2731 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2732 |
38 | 2733 // plugin box |
2734 LeftLow.x = CUSTOMBOX_LINE_LEFT; | |
2735 WidthHeight.x = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_LINE_LEFT; | |
2736 LeftLow.y = 60; | |
2737 WidthHeight.y = 440 - LeftLow.y; | |
2738 GFX_draw_box(&t7screen, LeftLow, WidthHeight, 1, colorBox); | |
2739 | |
2740 if(PluginBoxHeader) | |
2741 { | |
2742 // plugin box - header | |
2743 start.x = CUSTOMBOX_LINE_LEFT; | |
2744 stop.x = CUSTOMBOX_LINE_RIGHT; | |
2745 stop.y = start.y = 440 - 60; | |
2746 GFX_draw_line(&t7screen, start, stop, colorBox); | |
2747 } | |
2748 | |
2749 if(LinesOnTheSides) | |
2750 { | |
2751 // aufteilung links | |
2752 start.x = 0; | |
2753 stop.x = CUSTOMBOX_LINE_LEFT; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2754 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2755 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2756 stop.y = start.y = t7l1.WindowY0 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2757 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2758 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2759 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2760 stop.y = start.y = 480 - t7l1.WindowY1 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2761 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2762 |
38 | 2763 GFX_draw_line(&t7screen, start, stop, colorLinesOnTheSide); |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2764 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2765 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2766 stop.y = start.y = t7l2.WindowY0 -1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2767 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2768 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2769 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2770 stop.y = start.y = 480 - t7l2.WindowY1 -1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2771 } |
38 | 2772 GFX_draw_line(&t7screen, start, stop, colorLinesOnTheSide); |
2773 | |
2774 // aufteilung rechts | |
2775 start.x = CUSTOMBOX_LINE_RIGHT; | |
2776 stop.x = 799; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2777 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2778 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2779 stop.y = start.y = t7l1.WindowY0 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2780 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2781 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2782 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2783 stop.y = start.y = 480 - t7l1.WindowY1 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2784 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2785 |
38 | 2786 GFX_draw_line(&t7screen, start, stop, colorLinesOnTheSide); |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2787 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2788 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2789 stop.y = start.y = t7l2.WindowY0 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2790 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2791 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2792 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2793 stop.y = start.y = 480 - t7l2.WindowY1 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2794 } |
38 | 2795 GFX_draw_line(&t7screen, start, stop, colorLinesOnTheSide); |
2796 } | |
2797 } | |
2798 | |
2799 | |
2800 /* Compass like TCOS shellfish | |
2801 * input is 0 to 359 | |
2802 * 2 px / 1 degree | |
2803 * Range is 148 degree with CUSTOMBOX_SPACE_INSIDE = 296 | |
2804 * one side is 74 degree (less than 90 degree) | |
2805 * internal 360 + 180 degree of freedom | |
2806 * use positive values only, shift by 360 below 90 mid position | |
2807 */ | |
2808 | |
2809 | |
2810 point_t t7_compass_circle(uint8_t id, uint16_t degree) | |
2811 { | |
2812 float fCos, fSin; | |
2813 const float piMult = ((2 * 3.14159) / 360); | |
2814 // const int radius[4] = {95,105,115,60}; | |
2815 const int radius[4] = {95,105,115,100}; | |
2816 const point_t offset = {.x = 400, .y = 250}; | |
2817 | |
2818 static point_t r[4][360] = { 0 }; | |
2819 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2820 if(r[0][0].y == 0) /* calc table at first call only */ |
38 | 2821 { |
2822 for(int i=0;i<360;i++) | |
2823 { | |
2824 fCos = cos(i * piMult); | |
2825 fSin = sin(i * piMult); | |
2826 for(int j=0;j<4;j++) | |
2827 { | |
2828 r[j][i].x = offset.x + (int)(fSin * radius[j]); | |
2829 r[j][i].y = offset.y + (int)(fCos * radius[j]); | |
2830 } | |
2831 } | |
2832 } | |
2833 if(id > 3) id = 0; | |
2834 if(degree > 359) degree = 0; | |
2835 return r[id][degree]; | |
2836 } | |
2837 | |
2838 /* range should be 0 to 30 bar if 300 meter with 100% of nitrogen or helium | |
2839 * T24 is 28 high | |
2840 */ | |
2841 void t7_tissues(const SDiveState * pState) | |
2842 { | |
2843 point_t start, change, stop; | |
2844 float value; | |
2845 uint16_t front, cns100pixel; | |
2846 char text[256]; | |
2847 uint8_t textpointer = 0; | |
2848 uint8_t color; | |
2849 | |
2850 float percent_N2; | |
2851 float percent_He; | |
2852 float partial_pressure_N2; | |
2853 float partial_pressure_He; | |
2854 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2855 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2856 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2857 |
38 | 2858 |
2859 /* N2 */ | |
2860 t7cY0free.WindowLineSpacing = 28 + 48 + 14; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2861 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2862 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2863 t7cY0free.WindowY0 = t7cH.WindowY0 - 5 - 2 * t7cY0free.WindowLineSpacing; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2864 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2865 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2866 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2867 t7cY0free.WindowY0 = t7cH.WindowY0 + 15; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2868 t7cY0free.WindowY1 = t7cY0free.WindowY0 + 250; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2869 } |
38 | 2870 t7cY0free.WindowNumberOfTextLines = 3; |
2871 | |
2872 text[textpointer++] = '\030'; | |
2873 text[textpointer++] = TXT_2BYTE; | |
2874 text[textpointer++] = TXT2BYTE_Nitrogen; | |
2875 text[textpointer++] = '\n'; | |
2876 text[textpointer++] = '\r'; | |
2877 text[textpointer++] = TXT_2BYTE; | |
2878 text[textpointer++] = TXT2BYTE_Helium; | |
2879 text[textpointer++] = '\n'; | |
2880 text[textpointer++] = '\r'; | |
2881 text[textpointer++] = TXT_2BYTE; | |
2882 text[textpointer++] = TXT2BYTE_CNS; | |
2883 text[textpointer++] = 0; | |
2884 | |
2885 GFX_write_string(&FontT24, &t7cY0free, text, 1); | |
2886 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2887 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2888 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2889 start.y = t7cH.WindowY0 - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2890 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2891 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2892 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2893 start.y = t7cH.WindowY1 - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2894 } |
38 | 2895 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
2896 stop.x = start.x + CUSTOMBOX_SPACE_INSIDE; | |
2897 | |
2898 for(int i=0;i<16;i++) | |
2899 { | |
2900 stop.y = start.y; | |
2901 change.y = start.y; | |
2902 | |
2903 value = pState->lifeData.tissue_nitrogen_bar[i] - 0.7512f; | |
222
9b4b3decd9ba
Bugfix: correct presentation error in tissues custom view
Jan Mulder <jlmulder@xs4all.nl>
parents:
215
diff
changeset
|
2904 value *= 80; |
38 | 2905 |
2906 if(value < 0) | |
2907 front = 0; | |
2908 else | |
2909 if(value > CUSTOMBOX_SPACE_INSIDE) | |
2910 front = CUSTOMBOX_SPACE_INSIDE; | |
2911 else | |
2912 front = (uint16_t)value; | |
2913 | |
2914 change.x = start.x + front; | |
2915 if(change.x != start.x) | |
2916 GFX_draw_thick_line(1,&t7screen, start, change, CLUT_Font030); | |
2917 if(change.x != stop.x) | |
2918 GFX_draw_thick_line(1,&t7screen, change, stop, CLUT_Font031); | |
2919 | |
2920 start.y -= 3; | |
2921 } | |
2922 | |
2923 /* He */ | |
2924 start.y -= 28 + 14; | |
2925 for(int i=0;i<16;i++) | |
2926 { | |
2927 stop.y = start.y; | |
2928 change.y = start.y; | |
2929 | |
2930 value = pState->lifeData.tissue_helium_bar[i]; | |
2931 value *= 80;//20 | |
2932 | |
2933 if(value < 0) | |
2934 front = 0; | |
2935 else if(value > CUSTOMBOX_SPACE_INSIDE) | |
2936 front = CUSTOMBOX_SPACE_INSIDE; | |
2937 else | |
2938 front = (uint16_t)value; | |
2939 | |
2940 change.x = start.x + front; | |
2941 if(change.x != start.x) | |
2942 GFX_draw_thick_line(1,&t7screen, start, change, CLUT_Font030); | |
2943 if(change.x != stop.x) | |
2944 GFX_draw_thick_line(1,&t7screen, change, stop, CLUT_Font031); | |
2945 | |
2946 start.y -= 3; | |
2947 } | |
2948 | |
2949 /* CNS == Oxygen */ | |
2950 start.y -= 28 + 14; | |
2951 | |
2952 cns100pixel = (8 * CUSTOMBOX_SPACE_INSIDE) / 10; | |
2953 value = pState->lifeData.cns; | |
2954 value *= cns100pixel; | |
2955 value /= 100; | |
2956 | |
2957 if(value < 0) | |
2958 front = 0; | |
2959 else if(value > CUSTOMBOX_SPACE_INSIDE) | |
2960 front = CUSTOMBOX_SPACE_INSIDE; | |
2961 else | |
2962 front = (uint16_t)value; | |
2963 | |
2964 if(pState->lifeData.cns < 95) | |
2965 color = CLUT_Font030; | |
2966 else if(pState->lifeData.cns < 100) | |
2967 color = CLUT_WarningYellow; | |
2968 else | |
2969 color = CLUT_WarningRed; | |
2970 | |
2971 for(int i=0;i<16;i++) | |
2972 { | |
2973 stop.y = start.y; | |
2974 change.y = start.y; | |
2975 | |
2976 change.x = start.x + front; | |
2977 if(change.x != start.x) | |
2978 GFX_draw_thick_line(1,&t7screen, start, change, color); | |
2979 if(change.x != stop.x) | |
2980 GFX_draw_thick_line(1,&t7screen, change, stop, CLUT_Font031); | |
2981 | |
2982 start.y -= 3; | |
2983 } | |
2984 | |
2985 /* where is the onload/offload limit for N2 and He */ | |
2986 decom_get_inert_gases(pState->lifeData.pressure_ambient_bar, &pState->lifeData.actualGas, &percent_N2, &percent_He); | |
2987 partial_pressure_N2 = (pState->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * percent_N2; | |
2988 partial_pressure_He = (pState->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * percent_He; | |
2989 | |
2990 // Nitrogen vertical bar | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2991 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2992 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2993 start.y = t7cH.WindowY0 + 1 - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2994 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2995 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2996 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2997 start.y = t7cH.WindowY1 - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2998 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2999 |
38 | 3000 stop.y = start.y - (3 * 15) - 1; |
222
9b4b3decd9ba
Bugfix: correct presentation error in tissues custom view
Jan Mulder <jlmulder@xs4all.nl>
parents:
215
diff
changeset
|
3001 if((percent_N2 > 0) && (partial_pressure_N2 > 0.7512f)) |
38 | 3002 { |
222
9b4b3decd9ba
Bugfix: correct presentation error in tissues custom view
Jan Mulder <jlmulder@xs4all.nl>
parents:
215
diff
changeset
|
3003 value = partial_pressure_N2 - 0.7512f; |
9b4b3decd9ba
Bugfix: correct presentation error in tissues custom view
Jan Mulder <jlmulder@xs4all.nl>
parents:
215
diff
changeset
|
3004 value *= 80; |
38 | 3005 |
3006 if(value < 0) | |
3007 front = 3; | |
3008 else if(value + 5 > CUSTOMBOX_SPACE_INSIDE) | |
3009 front = CUSTOMBOX_SPACE_INSIDE - 3; | |
3010 else | |
3011 front = (uint16_t)value; | |
3012 } | |
3013 else | |
3014 { | |
3015 front = 1; | |
3016 } | |
3017 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + front; | |
3018 stop.x = start.x; | |
3019 GFX_draw_thick_line(2,&t7screen, start, stop, CLUT_EverythingOkayGreen); | |
3020 | |
3021 | |
3022 // Helium vertical bar | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3023 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3024 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3025 start.y = t7cH.WindowY0 + 1 - 5 - 3*16 - 28 - 14; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3026 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3027 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3028 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3029 start.y = t7cH.WindowY1 - 5 - 3*16 - 28 - 14; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3030 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3031 |
38 | 3032 stop.y = start.y - (3 * 15) - 1; |
3033 if((percent_He > 0) && (partial_pressure_He > 0.01f)) // 0.5f | |
3034 { | |
3035 | |
3036 value = partial_pressure_He; | |
222
9b4b3decd9ba
Bugfix: correct presentation error in tissues custom view
Jan Mulder <jlmulder@xs4all.nl>
parents:
215
diff
changeset
|
3037 value *= 80; |
38 | 3038 |
3039 if(value < 0) | |
3040 front = 3; | |
3041 else if(value + 5 > CUSTOMBOX_SPACE_INSIDE) | |
3042 front = CUSTOMBOX_SPACE_INSIDE - 3; | |
3043 else | |
3044 front = (uint16_t)value; | |
3045 } | |
3046 else | |
3047 { | |
3048 front = 1; | |
3049 } | |
3050 | |
3051 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + front; | |
3052 stop.x = start.x; | |
3053 GFX_draw_thick_line(2,&t7screen, start, stop, CLUT_EverythingOkayGreen); | |
3054 | |
3055 // Oxygen vertical bar | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3056 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3057 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3058 start.y = t7cH.WindowY0 + 1 - 5 - 6*16 - 2*28 - 2*14; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3059 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3060 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3061 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3062 start.y = t7cH.WindowY1 - 5 - 6*16 - 2*28 - 2*14; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3063 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3064 |
38 | 3065 stop.y = start.y - (3 * 15) - 1; |
3066 | |
3067 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + cns100pixel; | |
3068 stop.x = start.x; | |
3069 GFX_draw_thick_line(2, &t7screen, start, stop, CLUT_WarningRed); | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3070 |
38 | 3071 } |
3072 | |
3073 | |
3074 void t7_debug(void) | |
3075 { | |
3076 char text[256+50]; | |
3077 uint8_t textpointer = 0; | |
3078 | |
3079 t7cY0free.WindowLineSpacing = 28 + 48 + 14; | |
3080 t7cY0free.WindowY0 = t7cH.WindowY0 - 5 - 2 * t7cY0free.WindowLineSpacing; | |
3081 t7cY0free.WindowNumberOfTextLines = 3; | |
3082 | |
3083 textpointer += snprintf(&text[textpointer],50,"Ambient [bar]\n\r"); | |
3084 textpointer += snprintf(&text[textpointer],50,"Surface [bar] + salt\n\r"); | |
3085 // textpointer += snprintf(&text[textpointer],50,"Difference [mbar]\n\r"); | |
3086 textpointer += snprintf(&text[textpointer],50,"ShallowCounter [s]\n\r"); | |
3087 GFX_write_string(&FontT24, &t7cY0free, text, 1); | |
3088 | |
3089 t7cY0free.WindowY0 -= 52; | |
3090 // snprintf(text,60,"%0.2f\n\r%0.2f %u%%\n\r%0.0f",stateUsed->lifeData.pressure_ambient_bar, stateUsed->lifeData.pressure_surface_bar, settingsGetPointer()->salinity, 1000 * (stateUsed->lifeData.pressure_ambient_bar-stateUsed->lifeData.pressure_surface_bar)); | |
3091 snprintf(text,60, | |
3092 "%0.2f\n\r" | |
3093 "%0.2f %u%%\n\r" | |
3094 "%u" | |
3095 ,stateUsed->lifeData.pressure_ambient_bar | |
3096 ,stateUsed->lifeData.pressure_surface_bar | |
3097 ,settingsGetPointer()->salinity | |
3098 ,stateUsed->lifeData.counterSecondsShallowDepth); | |
3099 GFX_write_string(&FontT42, &t7cY0free, text, 1); | |
3100 } | |
3101 | |
3102 | |
3103 void t7_SummaryOfLeftCorner(void) | |
3104 { | |
3105 char text[256+60]; | |
3106 uint8_t textpointer = 0; | |
3107 | |
3108 const SDecoinfo * pDecoinfoStandard; | |
3109 const SDecoinfo * pDecoinfoFuture; | |
3110 float fCNS; | |
3111 | |
3112 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE) | |
3113 { | |
3114 pDecoinfoStandard = &stateUsed->decolistBuehlmann; | |
3115 pDecoinfoFuture = &stateUsed->decolistFutureBuehlmann; | |
3116 } | |
3117 else | |
3118 { | |
3119 pDecoinfoStandard = &stateUsed->decolistVPM; | |
3120 pDecoinfoFuture = &stateUsed->decolistFutureVPM; | |
3121 } | |
3122 | |
3123 fCNS = stateUsed->lifeData .cns; | |
3124 if(fCNS > 999) | |
3125 fCNS = 999; | |
3126 | |
3127 t7cY0free.WindowY0 = t7cC.WindowY0 - 10; | |
315
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3128 if(settingsGetPointer()->FlipDisplay) |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3129 { |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3130 t7cY0free.WindowY1 = 400; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3131 } |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3132 |
38 | 3133 t7cY0free.WindowLineSpacing = 48; |
3134 t7cY0free.WindowNumberOfTextLines = 6; | |
3135 t7cY0free.WindowTab = 420; | |
3136 | |
3137 // header | |
3138 textpointer = 0; | |
3139 text[textpointer++] = '\032'; | |
3140 text[textpointer++] = '\016'; | |
3141 text[textpointer++] = '\016'; | |
3142 text[textpointer++] = TXT_ppO2; | |
3143 text[textpointer++] = '\n'; | |
3144 text[textpointer++] = '\r'; | |
3145 text[textpointer++] = TXT_Ceiling; | |
3146 text[textpointer++] = '\n'; | |
3147 text[textpointer++] = '\r'; | |
3148 text[textpointer++] = TXT_ActualGradient; | |
3149 text[textpointer++] = '\n'; | |
3150 text[textpointer++] = '\r'; | |
3151 text[textpointer++] = TXT_CNS; | |
3152 text[textpointer++] = '\n'; | |
3153 text[textpointer++] = '\r'; | |
3154 text[textpointer++] = TXT_FutureTTS; | |
3155 text[textpointer++] = '\017'; | |
3156 text[textpointer++] = 0; | |
315
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3157 |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3158 if(!settingsGetPointer()->FlipDisplay) |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3159 { |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3160 t7cY0free.WindowX0 += 10; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3161 t7cY0free.WindowY0 += 10; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3162 GFX_write_string(&FontT24, &t7cY0free, text, 1); |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3163 t7cY0free.WindowX0 -= 10; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3164 t7cY0free.WindowY0 -= 10; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3165 } |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3166 else |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3167 { |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3168 t7cY0free.WindowY1 -= 10; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3169 t7cY0free.WindowX1 -= 10; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3170 GFX_write_string(&FontT24, &t7cY0free, text, 1); |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3171 t7cY0free.WindowY1 += 10; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3172 t7cY0free.WindowX1 += 10; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3173 } |
38 | 3174 textpointer = 0; |
3175 text[textpointer++] = '\t'; | |
3176 textpointer += snprintf(&text[textpointer],10,"\020%01.2f", stateUsed->lifeData.ppO2); | |
3177 text[textpointer++] = '\n'; | |
3178 text[textpointer++] = '\r'; | |
3179 text[textpointer++] = '\t'; | |
3180 if((pDecoinfoStandard->output_ceiling_meter > 99.9f) || (settingsGetPointer()->nonMetricalSystem)) | |
215
4a0ebade04f5
Bugfix, trivial: correctly present avg depth in overview custom
Jan Mulder <jlmulder@xs4all.nl>
parents:
214
diff
changeset
|
3181 textpointer += snprintf(&text[textpointer],10,"\020%01.0f",unit_depth_float(pDecoinfoStandard->output_ceiling_meter)); |
38 | 3182 else |
215
4a0ebade04f5
Bugfix, trivial: correctly present avg depth in overview custom
Jan Mulder <jlmulder@xs4all.nl>
parents:
214
diff
changeset
|
3183 textpointer += snprintf(&text[textpointer],10,"\020%01.1f",pDecoinfoStandard->output_ceiling_meter); |
38 | 3184 text[textpointer++] = '\n'; |
3185 text[textpointer++] = '\r'; | |
3186 text[textpointer++] = '\t'; | |
247
3949781096d4
feature: Relative GF to Saturation renames
Jan Mulder <jlmulder@xs4all.nl>
parents:
225
diff
changeset
|
3187 textpointer += snprintf(&text[textpointer],10,"\020%.0f\016\016%%\017", 100 * pDecoinfoStandard->super_saturation); |
38 | 3188 text[textpointer++] = '\n'; |
3189 text[textpointer++] = '\r'; | |
3190 text[textpointer++] = '\t'; | |
3191 textpointer += snprintf(&text[textpointer],10,"\020%.0f\016\016%%\017",fCNS); | |
3192 text[textpointer++] = '\n'; | |
3193 text[textpointer++] = '\r'; | |
3194 text[textpointer++] = '\t'; | |
214
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
211
diff
changeset
|
3195 if (pDecoinfoFuture->output_time_to_surface_seconds < 1000 * 60) |
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
211
diff
changeset
|
3196 textpointer += snprintf(&text[textpointer],10,"\020%i'", (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 60); |
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
211
diff
changeset
|
3197 else |
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
211
diff
changeset
|
3198 textpointer += snprintf(&text[textpointer],10,"\020%ih", (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 3600); |
38 | 3199 text[textpointer++] = 0; |
196
2885628ab3ba
Bugfix, minor: color the overview customview correctly
Jan Mulder <jlmulder@xs4all.nl>
parents:
193
diff
changeset
|
3200 t7_colorscheme_mod(text); |
38 | 3201 GFX_write_string(&FontT42, &t7cY0free, text, 1); |
3202 } | |
3203 | |
3204 void t7_compass(uint16_t ActualHeading, uint16_t UserSetHeading) | |
3205 { | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3206 uint16_t ActualHeadingRose; |
38 | 3207 uint16_t LeftBorderHeading, LineHeading; |
3208 uint32_t offsetPicture; | |
3209 point_t start, stop, center; | |
3210 static int32_t LastHeading = 0; | |
3211 int32_t newHeading = 0; | |
3212 int32_t diff = 0; | |
3213 int32_t diff2 = 0; | |
3214 | |
3215 int32_t diffAbs = 0; | |
3216 int32_t diffAbs2 = 0; | |
3217 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3218 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3219 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3220 |
38 | 3221 newHeading = ActualHeading; |
3222 | |
3223 diff = newHeading - LastHeading; | |
3224 | |
3225 if(newHeading < LastHeading) | |
3226 diff2 = newHeading + 360 - LastHeading; | |
3227 else | |
3228 diff2 = newHeading - 360 - LastHeading; | |
3229 | |
3230 diffAbs = diff; | |
3231 if(diffAbs < 0) | |
3232 diffAbs *= -1; | |
3233 | |
3234 diffAbs2 = diff2; | |
3235 if(diffAbs2 < 0) | |
3236 diffAbs2 *= -1; | |
3237 | |
3238 | |
3239 if(diffAbs <= diffAbs2) | |
3240 newHeading = LastHeading + (diff / 2); | |
3241 else | |
3242 newHeading = LastHeading + (diff2 / 2); | |
3243 | |
3244 if(newHeading < 0) | |
3245 newHeading += 360; | |
3246 else | |
3247 if(newHeading >= 360) | |
3248 newHeading -= 360; | |
3249 | |
3250 LastHeading = newHeading; | |
3251 ActualHeading = newHeading; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3252 ActualHeadingRose = ActualHeading; |
225
2bb1db22b5f5
cleanup: random set of cleanups
Jan Mulder <jlmulder@xs4all.nl>
parents:
222
diff
changeset
|
3253 |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3254 if(pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3255 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3256 ActualHeadingRose = 360 - ActualHeadingRose; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3257 if (ActualHeadingRose < 170) ActualHeadingRose += 360; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3258 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3259 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3260 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3261 if (ActualHeadingRose < 90) ActualHeadingRose += 360; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3262 ActualHeading = ActualHeadingRose; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3263 } |
38 | 3264 |
3265 // new hw 160822 | |
3266 // if (ActualHeading >= 360 + 90) | |
3267 // ActualHeading = 360; | |
3268 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3269 LeftBorderHeading = 2 * (ActualHeadingRose - (CUSTOMBOX_SPACE_INSIDE/4)); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3270 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3271 if(pSettings->FlipDisplay) /* add offset caused by mirrowed drawing */ |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3272 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3273 LeftBorderHeading += 2 * 80; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3274 } |
38 | 3275 |
3276 offsetPicture = LeftBorderHeading * t7screenCompass.ImageHeight * 2; | |
3277 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3278 /* the background is used to draw the rotating compass rose */ |
38 | 3279 background.pointer = t7screenCompass.FBStartAdress+offsetPicture; |
3280 background.x0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3281 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3282 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3283 background.y0 = 65; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3284 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3285 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3286 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3287 background.y0 = 480 - t7screenCompass.ImageHeight - 65; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3288 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3289 |
38 | 3290 background.width = CUSTOMBOX_SPACE_INSIDE; |
3291 background.height = t7screenCompass.ImageHeight; | |
3292 | |
3293 | |
3294 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + (CUSTOMBOX_SPACE_INSIDE/2); | |
3295 stop.x = start.x; | |
3296 start.y = 65; | |
3297 stop.y = start.y + 55; | |
3298 GFX_draw_line(&t7screen, start, stop, CLUT_Font030); | |
3299 | |
3300 | |
3301 center.x = start.x; | |
3302 center.y = 300; | |
3303 | |
3304 stop.x = center.x + 44; | |
3305 stop.y = center.y + 24; | |
3306 | |
3307 | |
3308 while(ActualHeading > 359) ActualHeading -= 360; | |
3309 | |
3310 LineHeading = 360 - ActualHeading; | |
3311 GFX_draw_thick_line(9,&t7screen, t7_compass_circle(0,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font030); // North | |
3312 LineHeading += 90; | |
3313 if(LineHeading > 359) LineHeading -= 360; | |
3314 GFX_draw_thick_line(9,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); // Maintick | |
3315 LineHeading += 90; | |
3316 if(LineHeading > 359) LineHeading -= 360; | |
3317 GFX_draw_thick_line(9,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
3318 LineHeading += 90; | |
3319 if(LineHeading > 359) LineHeading -= 360; | |
3320 GFX_draw_thick_line(9,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
3321 | |
3322 LineHeading = 360 - ActualHeading; | |
3323 LineHeading += 45; | |
3324 if(LineHeading > 359) LineHeading -= 360; | |
3325 GFX_draw_thick_line(5,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); // Subtick | |
3326 LineHeading += 90; | |
3327 if(LineHeading > 359) LineHeading -= 360; | |
3328 GFX_draw_thick_line(5,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
3329 LineHeading += 90; | |
3330 if(LineHeading > 359) LineHeading -= 360; | |
3331 GFX_draw_thick_line(5,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
3332 LineHeading += 90; | |
3333 if(LineHeading > 359) LineHeading -= 360; | |
3334 GFX_draw_thick_line(5,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
3335 | |
3336 LineHeading = 360 - ActualHeading; | |
3337 LineHeading += 22; | |
3338 if(LineHeading > 359) LineHeading -= 360; | |
3339 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); // Subtick | |
3340 LineHeading += 45; | |
3341 if(LineHeading > 359) LineHeading -= 360; | |
3342 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
3343 LineHeading += 45; | |
3344 if(LineHeading > 359) LineHeading -= 360; | |
3345 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
3346 LineHeading += 45; | |
3347 if(LineHeading > 359) LineHeading -= 360; | |
3348 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
3349 LineHeading += 45; | |
3350 if(LineHeading > 359) LineHeading -= 360; | |
3351 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); // Subtick | |
3352 LineHeading += 45; | |
3353 if(LineHeading > 359) LineHeading -= 360; | |
3354 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
3355 LineHeading += 45; | |
3356 if(LineHeading > 359) LineHeading -= 360; | |
3357 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
3358 LineHeading += 45; | |
3359 if(LineHeading > 359) LineHeading -= 360; | |
3360 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
3361 | |
3362 if(UserSetHeading) | |
3363 { | |
3364 LineHeading = UserSetHeading + 360 - ActualHeading; | |
3365 if(LineHeading > 359) LineHeading -= 360; | |
3366 GFX_draw_thick_line(9,&t7screen, t7_compass_circle(3,LineHeading), t7_compass_circle(2,LineHeading), CLUT_CompassUserHeadingTick); | |
3367 | |
3368 // R�ckpeilung, User Back Heading | |
3369 LineHeading = UserSetHeading + 360 + 180 - ActualHeading; | |
3370 if(LineHeading > 359) LineHeading -= 360; | |
3371 if(LineHeading > 359) LineHeading -= 360; | |
3372 GFX_draw_thick_line(9,&t7screen, t7_compass_circle(3,LineHeading), t7_compass_circle(2,LineHeading), CLUT_CompassUserBackHeadingTick); | |
3373 } | |
3374 | |
3375 center.x = start.x; | |
3376 center.y = 250; | |
3377 GFX_draw_circle(&t7screen, center, 116, CLUT_Font030); | |
3378 GFX_draw_circle(&t7screen, center, 118, CLUT_Font030); | |
3379 GFX_draw_circle(&t7screen, center, 117, CLUT_Font030); | |
3380 | |
3381 | |
3382 } | |
3383 | |
3384 | |
3385 /* Font_T42: N is 27 px, S is 20 px, W is 36 px, E is 23 px | |
3386 * max is NW with 63 px | |
3387 * Font_T24: N is 15 px, S is 12 px, W is 20 px, E is 13 px | |
3388 * max is NW with 35 px | |
3389 * NE is 28 px | |
3390 * SW is 32 px | |
3391 * SE is 25 px | |
3392 * space between each is 45 px * 2 | |
3393 * FirstItem List | |
3394 * \177 \177 prepare for size | |
3395 */ | |
3396 void init_t7_compass(void) | |
3397 { | |
3398 t7screenCompass.FBStartAdress = getFrame(21); | |
3399 | |
3400 char text[256]; | |
3401 uint8_t textpointer = 0; | |
3402 | |
3403 text[textpointer++] = '\030'; | |
3404 text[textpointer++] = '\177'; | |
3405 text[textpointer++] = '\177'; | |
3406 text[textpointer++] = 76; // 90 - 14 | |
3407 text[textpointer++] = '\016'; | |
3408 text[textpointer++] = '\016'; | |
3409 text[textpointer++] = 'N'; | |
3410 text[textpointer++] = 'E'; // 96 + 28 = 124 total | |
3411 text[textpointer++] = '\017'; | |
3412 text[textpointer++] = '\177'; | |
3413 text[textpointer++] = '\177'; | |
3414 text[textpointer++] = 64; // 90 - 14 - 12 | |
3415 text[textpointer++] = 'E'; // 124 + 74 + 23 = 221 total | |
3416 text[textpointer++] = '\177'; | |
3417 text[textpointer++] = '\177'; | |
3418 text[textpointer++] = 66; // 90 - 11 - 13 | |
3419 text[textpointer++] = '\016'; | |
3420 text[textpointer++] = '\016'; | |
3421 text[textpointer++] = 'S'; | |
3422 text[textpointer++] = 'E'; | |
3423 text[textpointer++] = '\017'; | |
3424 text[textpointer++] = '\177'; | |
3425 text[textpointer++] = '\177'; | |
3426 text[textpointer++] = 68; // 90 - 12 - 10 | |
3427 text[textpointer++] = 'S'; | |
3428 text[textpointer++] = '\177'; | |
3429 text[textpointer++] = '\177'; | |
3430 text[textpointer++] = 64; // 90 - 10 - 16 | |
3431 text[textpointer++] = '\016'; | |
3432 text[textpointer++] = '\016'; | |
3433 text[textpointer++] = 'S'; | |
3434 text[textpointer++] = 'W'; | |
3435 text[textpointer++] = '\017'; | |
3436 text[textpointer++] = '\177'; | |
3437 text[textpointer++] = '\177'; | |
3438 text[textpointer++] = 56; // 90 - 16 - 18 | |
3439 text[textpointer++] = 'W'; | |
3440 text[textpointer++] = '\177'; | |
3441 text[textpointer++] = '\177'; | |
3442 text[textpointer++] = 54; // 90 - 18 - 18 | |
3443 text[textpointer++] = '\016'; | |
3444 text[textpointer++] = '\016'; | |
3445 text[textpointer++] = 'N'; | |
3446 text[textpointer++] = 'W'; | |
3447 text[textpointer++] = '\017'; | |
3448 text[textpointer++] = '\177'; | |
3449 text[textpointer++] = '\177'; | |
3450 text[textpointer++] = 59; // 90 - 17 - 14 | |
3451 text[textpointer++] = 'N'; | |
3452 text[textpointer++] = '\177'; | |
3453 text[textpointer++] = '\177'; | |
3454 text[textpointer++] = 63; // 90 - 13 - 14 | |
3455 text[textpointer++] = '\016'; | |
3456 text[textpointer++] = '\016'; | |
3457 text[textpointer++] = 'N'; | |
3458 text[textpointer++] = 'E'; | |
3459 text[textpointer++] = '\017'; | |
3460 text[textpointer++] = '\177'; | |
3461 text[textpointer++] = '\177'; | |
3462 text[textpointer++] = 64; // 90 - 14 - 12 | |
3463 text[textpointer++] = 'E'; | |
3464 text[textpointer++] = '\177'; | |
3465 text[textpointer++] = '\177'; | |
3466 text[textpointer++] = 66; // 90 - 11 - 13 | |
3467 text[textpointer++] = '\016'; | |
3468 text[textpointer++] = '\016'; | |
3469 text[textpointer++] = 'S'; | |
3470 text[textpointer++] = 'E'; | |
3471 text[textpointer++] = '\017'; | |
3472 text[textpointer++] = '\177'; | |
3473 text[textpointer++] = '\177'; | |
3474 text[textpointer++] = 68; // 90 - 12 - 10 | |
3475 text[textpointer++] = 'S'; | |
3476 text[textpointer++] = '\177'; | |
3477 text[textpointer++] = '\177'; | |
3478 text[textpointer++] = 64; // 90 - 10 - 16 | |
3479 text[textpointer++] = '\016'; | |
3480 text[textpointer++] = '\016'; | |
3481 text[textpointer++] = 'S'; | |
3482 text[textpointer++] = 'W'; | |
3483 text[textpointer++] = '\017'; | |
3484 text[textpointer++] = 0; // end | |
3485 | |
3486 GFX_write_string(&FontT42,&t7pCompass,text,1); | |
3487 | |
3488 releaseAllFramesExcept(21,t7screenCompass.FBStartAdress); | |
3489 } | |
3490 | |
3491 | |
3492 void t7_miniLiveLogProfile(void) | |
3493 { | |
3494 SWindowGimpStyle wintemp; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3495 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3496 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3497 |
38 | 3498 wintemp.left = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
3499 wintemp.right = wintemp.left + CUSTOMBOX_SPACE_INSIDE; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3500 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3501 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3502 wintemp.top = 480 - t7l1.WindowY0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3503 wintemp.bottom = wintemp. top + 200; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3504 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3505 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3506 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3507 wintemp.top = t7l1.WindowY1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3508 wintemp.bottom = wintemp. top + 200; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3509 } |
38 | 3510 |
3511 uint16_t max_depth = (uint16_t)(stateUsed->lifeData.max_depth_meter * 10); | |
3512 | |
3513 GFX_graph_print(&t7screen, &wintemp, 0,1,0, max_depth, getMiniLiveLogbookPointerToData(), getMiniLiveLogbookActualDataLength(), CLUT_Font030, NULL); | |
3514 } | |
3515 | |
3516 void t7_logo_OSTC(void) | |
3517 { | |
3518 SWindowGimpStyle windowGimp; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3519 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3520 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3521 |
38 | 3522 /* OSTC logo */ |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3523 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3524 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3525 windowGimp.left = t7l1.WindowX1 + 32; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3526 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3527 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3528 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3529 windowGimp.left = t7r1.WindowX1 + 32; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3530 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3531 |
38 | 3532 windowGimp.top = 40 + 32; |
3533 GFX_draw_image_monochrome(&t7screen, windowGimp, &ImgOSTC, 0); | |
3534 } |