Mercurial > public > ostc4
annotate Discovery/Src/t3.c @ 138:cc9c18075e00 FlipDisplay
Removed no longer supported scooter code
author | Ideenmodellierer |
---|---|
date | Sat, 23 Feb 2019 21:10:51 +0100 |
parents | cc8e24374b83 |
children | 255eedad4155 |
rev | line source |
---|---|
38 | 1 /////////////////////////////////////////////////////////////////////////////// |
2 /// -*- coding: UTF-8 -*- | |
3 /// | |
4 /// \file Discovery/Src/t3.c | |
5 /// \brief Main Template file for dive mode special scree t3 | |
6 /// \author Heinrichs Weikamp gmbh | |
7 /// \date 10-Nov-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 "t3.h" | |
31 | |
32 #include "data_exchange_main.h" | |
33 #include "decom.h" | |
34 #include "gfx_fonts.h" | |
35 #include "math.h" | |
36 #include "tHome.h" | |
37 #include "timer.h" | |
38 #include "unit.h" | |
39 | |
40 //* Importend function prototypes ---------------------------------------------*/ | |
41 extern uint8_t write_gas(char *text, uint8_t oxygen, uint8_t helium); | |
42 | |
43 /* Exported variables --------------------------------------------------------*/ | |
44 | |
45 const uint16_t BigFontSeperationLeftRight = 399; | |
46 const uint16_t BigFontSeperationTopBottom = 240; | |
47 | |
48 /* Private variables ---------------------------------------------------------*/ | |
49 GFX_DrawCfgScreen t3screen; | |
50 GFX_DrawCfgWindow t3l1; | |
51 GFX_DrawCfgWindow t3r1; | |
52 GFX_DrawCfgWindow t3c1; | |
53 GFX_DrawCfgWindow t3c2; | |
54 | |
55 extern float depthLastCall[9]; | |
56 extern uint8_t idDepthLastCall; | |
57 extern float temperatureLastCall[3]; | |
58 extern uint8_t idTemperatureLastCall; | |
59 | |
60 uint8_t t3_selection_customview = 0; | |
61 | |
62 /* TEM HAS TO MOVE TO GLOBAL--------------------------------------------------*/ | |
63 | |
64 /* Private types -------------------------------------------------------------*/ | |
65 #define TEXTSIZE 16 | |
66 | |
67 const uint8_t t3_customviewsStandard[] = | |
68 { | |
69 CVIEW_T3_Decostop, | |
70 CVIEW_sensors, | |
71 CVIEW_Compass, | |
72 CVIEW_T3_MaxDepth, | |
73 CVIEW_T3_StopWatch, | |
74 CVIEW_T3_TTS, | |
75 CVIEW_T3_ppO2andGas, | |
76 CVIEW_T3_END | |
77 }; | |
78 | |
79 | |
80 const uint8_t *t3_customviews = t3_customviewsStandard; | |
81 | |
82 /* Private function prototypes -----------------------------------------------*/ | |
83 void t3_refresh_divemode(void); | |
84 | |
85 uint8_t t3_test_customview_warnings(void); | |
86 void t3_refresh_customview(float depth); | |
87 void t3_basics_compass(GFX_DrawCfgScreen *tXscreen, uint16_t ActualHeading, uint16_t UserSetHeading); | |
88 | |
89 /* Exported functions --------------------------------------------------------*/ | |
90 | |
91 void t3_init(void) | |
92 { | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
93 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
94 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
95 |
38 | 96 t3_selection_customview = t3_customviews[0]; |
97 | |
98 t3screen.FBStartAdress = 0; | |
99 t3screen.ImageHeight = 480; | |
100 t3screen.ImageWidth = 800; | |
101 t3screen.LayerIndex = 1; | |
102 | |
103 t3l1.Image = &t3screen; | |
104 t3l1.WindowNumberOfTextLines = 2; | |
105 t3l1.WindowLineSpacing = 19; // Abstand von Y0 | |
106 t3l1.WindowTab = 100; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
107 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
108 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
109 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
110 t3l1.WindowX0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
111 t3l1.WindowX1 = BigFontSeperationLeftRight - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
112 t3l1.WindowY0 = BigFontSeperationTopBottom + 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
113 t3l1.WindowY1 = 479; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
114 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
115 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
116 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
117 t3l1.WindowX0 = 800 - BigFontSeperationLeftRight + 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
118 t3l1.WindowX1 = 799; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
119 t3l1.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
120 t3l1.WindowY1 = 479 - BigFontSeperationTopBottom + 5 ; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
121 } |
38 | 122 |
123 t3r1.Image = &t3screen; | |
124 t3r1.WindowNumberOfTextLines = t3l1.WindowNumberOfTextLines; | |
125 t3r1.WindowLineSpacing = t3l1.WindowLineSpacing; | |
126 t3r1.WindowTab = t3l1.WindowTab; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
127 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
128 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
129 t3r1.WindowX0 = BigFontSeperationLeftRight + 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
130 t3r1.WindowX1 = 799; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
131 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
132 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
133 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
134 t3r1.WindowX0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
135 t3r1.WindowX1 = BigFontSeperationLeftRight - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
136 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
137 |
38 | 138 t3r1.WindowY0 = t3l1.WindowY0; |
139 t3r1.WindowY1 = t3l1.WindowY1; | |
140 | |
141 t3c1.Image = &t3screen; | |
142 t3c1.WindowNumberOfTextLines = 2; | |
143 t3c1.WindowLineSpacing = t3l1.WindowLineSpacing; | |
144 t3c1.WindowX0 = 0; | |
145 t3c1.WindowX1 = 799; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
146 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
147 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
148 t3c1.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
149 t3c1.WindowY1 = BigFontSeperationTopBottom - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
150 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
151 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
152 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
153 t3c1.WindowY0 = 480 - BigFontSeperationTopBottom + 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
154 t3c1.WindowY1 = 479; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
155 } |
38 | 156 |
157 t3c2.Image = &t3screen; | |
158 t3c2.WindowNumberOfTextLines = 3; | |
159 t3c2.WindowLineSpacing = 58; | |
160 t3c2.WindowX0 = 370; | |
161 t3c2.WindowX1 = 799; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
162 t3c2.WindowY0 = t3c1.WindowY0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
163 t3c2.WindowY1 = t3c1.WindowY1; |
38 | 164 t3c2.WindowTab = 600; |
165 } | |
166 | |
167 | |
168 void t3_refresh(void) | |
169 { | |
170 SStateList status; | |
171 get_globalStateList(&status); | |
172 | |
173 if(stateUsed->mode != MODE_DIVE) | |
174 { | |
175 settingsGetPointer()->design = 7; | |
176 return; | |
177 } | |
178 | |
179 if(status.base != BaseHome) | |
180 return; | |
181 | |
182 t3screen.FBStartAdress = getFrame(24); | |
183 t3_refresh_divemode(); | |
184 GFX_SetFramesTopBottom(t3screen.FBStartAdress, NULL,480); | |
185 releaseAllFramesExcept(24,t3screen.FBStartAdress); | |
186 } | |
187 | |
188 | |
189 /* Private functions ---------------------------------------------------------*/ | |
190 | |
191 float t3_basics_lines_depth_and_divetime(GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXl1, GFX_DrawCfgWindow* tXr1, uint8_t mode) | |
192 { | |
193 char text[512]; | |
194 uint8_t color; | |
195 uint8_t depthChangeRate; | |
196 uint8_t depthChangeAscent; | |
197 point_t start, stop, startZeroLine; | |
198 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
199 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
200 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
201 |
38 | 202 start.x = 0; |
203 stop.x = 799; | |
204 stop.y = start.y = BigFontSeperationTopBottom; | |
205 GFX_draw_line(tXscreen, start, stop, CLUT_Font020); | |
206 | |
207 start.y = BigFontSeperationTopBottom; | |
208 stop.y = 479; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
209 |
38 | 210 stop.x = start.x = BigFontSeperationLeftRight; |
211 GFX_draw_line(tXscreen, start, stop, CLUT_Font020); | |
212 | |
213 | |
214 /* depth */ | |
215 float depth = 0; | |
216 float depthThisCall = unit_depth_float(stateUsed->lifeData.depth_meter); | |
217 if(is_stateUsedSetToSim()) | |
218 { | |
219 depth = (depthThisCall + depthLastCall[0] + depthLastCall[1] + depthLastCall[2] + depthLastCall[3] + depthLastCall[4] + depthLastCall[5] + depthLastCall[6] + depthLastCall[7] + depthLastCall[8]) / 10.0f; | |
220 | |
221 idDepthLastCall++; | |
222 if(idDepthLastCall >= 9) | |
223 idDepthLastCall = 0; | |
224 depthLastCall[idDepthLastCall] = depthThisCall; | |
225 } | |
226 else | |
227 { | |
228 depth = (depthThisCall + depthLastCall[0] + depthLastCall[1] + depthLastCall[2]) / 4.0f; | |
229 | |
230 idDepthLastCall++; | |
231 if(idDepthLastCall >= 3) | |
232 idDepthLastCall = 0; | |
233 depthLastCall[idDepthLastCall] = depthThisCall; | |
234 } | |
235 | |
236 if(depth <= 0.3f) | |
237 depth = 0; | |
238 | |
239 if(settingsGetPointer()->nonMetricalSystem) | |
240 snprintf(text,TEXTSIZE,"\032\f[feet]"); | |
241 else | |
242 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Depth); | |
243 GFX_write_string(&FontT42,tXl1,text,0); | |
244 | |
245 if( ((mode == DIVEMODE_Apnea) && ((stateUsed->lifeData.ascent_rate_meter_per_min > 4) || (stateUsed->lifeData.ascent_rate_meter_per_min < -4 ))) | |
246 || ((mode != DIVEMODE_Apnea) && ((stateUsed->lifeData.ascent_rate_meter_per_min > 8) || (stateUsed->lifeData.ascent_rate_meter_per_min < -10))) | |
247 ) | |
248 { | |
249 snprintf(text,TEXTSIZE,"\f\002%.0f %c%c/min " | |
250 , unit_depth_float(stateUsed->lifeData.ascent_rate_meter_per_min) | |
251 , unit_depth_char1() | |
252 , unit_depth_char2() | |
253 ); | |
254 GFX_write_string(&FontT42,tXl1,text,0); | |
255 } | |
256 | |
257 if( depth < 100) | |
258 snprintf(text,TEXTSIZE,"\020\003\016%01.1f",depth); | |
259 else | |
260 snprintf(text,TEXTSIZE,"\020\003\016%01.0f",depth); | |
261 | |
262 t3_basics_colorscheme_mod(text); | |
263 GFX_write_string(&FontT105,tXl1,text,1); | |
264 | |
265 | |
266 /* ascentrate graph */ | |
267 if(mode == DIVEMODE_Apnea) | |
268 { | |
269 /* ascentrate graph - apnea mode */ | |
270 if(stateUsed->lifeData.ascent_rate_meter_per_min > 0) | |
271 { | |
272 depthChangeAscent = 1; | |
273 if(stateUsed->lifeData.ascent_rate_meter_per_min < 200) | |
274 depthChangeRate = (uint8_t)stateUsed->lifeData.ascent_rate_meter_per_min; | |
275 else | |
276 depthChangeRate = 200; | |
277 } | |
278 else | |
279 { | |
280 depthChangeAscent = 0; | |
281 if(stateUsed->lifeData.ascent_rate_meter_per_min > -200) | |
282 depthChangeRate = (uint8_t)(0 - stateUsed->lifeData.ascent_rate_meter_per_min); | |
283 else | |
284 depthChangeRate = 200; | |
285 } | |
286 start.y = tXl1->WindowY0 - 1; | |
287 for(int i = 0; i<5;i++) | |
288 { | |
289 start.y += 40; | |
290 stop.y = start.y; | |
291 start.x = tXl1->WindowX1 - 1; | |
292 stop.x = start.x - 17; | |
293 | |
294 if(depthChangeRate <= 6) | |
295 { | |
296 if(i == 2) | |
297 { | |
298 startZeroLine.y = start.y; | |
299 stop.x = start.x - 34; | |
300 } | |
301 } | |
302 else | |
303 { | |
304 if(((i == 1) && depthChangeAscent) || ((i == 3) && !depthChangeAscent)) | |
305 { | |
306 startZeroLine.y = start.y; | |
307 stop.x = start.x - 34; | |
308 } | |
309 } | |
310 GFX_draw_line(tXscreen, start, stop, 0); | |
311 } | |
312 // new thick bar design Sept. 2015 | |
313 if((stateUsed->lifeData.ascent_rate_meter_per_min > 4) || (stateUsed->lifeData.ascent_rate_meter_per_min < -4)) | |
314 { | |
315 start.y = startZeroLine.y; | |
316 | |
317 if(depthChangeAscent) | |
318 { | |
319 color = CLUT_EverythingOkayGreen; | |
320 start.y += 7; // starte etwas weiter oben | |
321 stop.y = start.y + (uint16_t)(depthChangeRate * 4) - 9; // - x; // wegen der Liniendicke | |
322 if(stop.y > 475) | |
323 stop.y = 475; | |
324 } | |
325 else | |
326 { | |
327 color = CLUT_Font023; | |
328 start.y -= 7; | |
329 stop.y = start.y - (uint16_t)(depthChangeRate * 4) + 9; | |
330 if(stop.y <= tXl1->WindowY0) | |
331 stop.y = tXl1->WindowY0 + 1; | |
332 } | |
333 stop.x = start.x = tXl1->WindowX1 - 8; | |
334 GFX_draw_thick_line(12,tXscreen, start, stop, color); | |
335 } | |
336 } | |
337 else | |
338 { | |
339 /* ascentrate graph -standard mode */ | |
340 if(stateUsed->lifeData.ascent_rate_meter_per_min > 0) | |
341 { | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
342 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
343 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
344 start.y = tXl1->WindowY0 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
345 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
346 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
347 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
348 start.y = tXl1->WindowY1 + 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
349 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
350 |
38 | 351 for(int i = 0; i<4;i++) |
352 { | |
353 start.y += 5*8; | |
354 stop.y = start.y; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
355 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
356 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
357 start.x = tXl1->WindowX1 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
358 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
359 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
360 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
361 start.x = tXr1->WindowX1 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
362 } |
38 | 363 stop.x = start.x - 17; |
364 GFX_draw_line(tXscreen, start, stop, 0); | |
365 } | |
366 // new thick bar design Sept. 2015 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
367 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
368 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
369 start.x = tXl1->WindowX1 - 3 - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
370 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
371 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
372 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
373 start.x = tXr1->WindowX1 - 3 - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
374 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
375 |
38 | 376 stop.x = start.x; |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
377 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
378 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
379 start.y = tXl1->WindowY0 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
380 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
381 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
382 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
383 start.y = tXl1->WindowY1 + 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
384 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
385 |
38 | 386 stop.y = start.y + (uint16_t)(stateUsed->lifeData.ascent_rate_meter_per_min * 8); |
387 stop.y -= 3; // wegen der Liniendicke von 12 anstelle von 9 | |
388 if(stop.y >= 470) | |
389 stop.y = 470; | |
390 start.y += 7; // starte etwas weiter oben | |
391 if(stateUsed->lifeData.ascent_rate_meter_per_min <= 10) | |
392 color = CLUT_EverythingOkayGreen; | |
393 else | |
394 if(stateUsed->lifeData.ascent_rate_meter_per_min <= 15) | |
395 color = CLUT_WarningYellow; | |
396 else | |
397 color = CLUT_WarningRed; | |
398 | |
399 GFX_draw_thick_line(12,tXscreen, start, stop, color); | |
400 } | |
401 } | |
402 | |
403 // divetime | |
404 if(mode == DIVEMODE_Apnea) | |
405 { | |
406 if(stateUsed->lifeData.counterSecondsShallowDepth) | |
407 { | |
408 SDivetime SurfaceBreakTime = {0,0,0,0}; | |
409 | |
410 SurfaceBreakTime.Total = stateUsed->lifeData.counterSecondsShallowDepth; | |
411 SurfaceBreakTime.Minutes = SurfaceBreakTime.Total / 60; | |
412 SurfaceBreakTime.Seconds = SurfaceBreakTime.Total - (SurfaceBreakTime.Minutes * 60); | |
413 | |
414 snprintf(text,TEXTSIZE,"\032\f\002%c%c", TXT_2BYTE,TXT2BYTE_ApneaSurface); | |
415 GFX_write_string(&FontT42,tXr1,text,0); | |
416 | |
417 snprintf(text,TEXTSIZE,"\020\003\016\002%u:%02u",SurfaceBreakTime.Minutes, SurfaceBreakTime.Seconds); | |
418 } | |
419 else | |
420 { | |
421 SDivetime Divetime = {0,0,0, 0}; | |
422 | |
423 Divetime.Total = stateUsed->lifeData.dive_time_seconds; | |
424 Divetime.Minutes = Divetime.Total / 60; | |
425 Divetime.Seconds = Divetime.Total - ( Divetime.Minutes * 60 ); | |
426 | |
427 snprintf(text,TEXTSIZE,"\032\f\002%c",TXT_Divetime); | |
428 GFX_write_string(&FontT42,tXr1,text,0); | |
429 | |
430 if(Divetime.Minutes < 100) | |
431 snprintf(text,TEXTSIZE,"\020\003\016\002%u:%02u",Divetime.Minutes, Divetime.Seconds); | |
432 else | |
433 snprintf(text,TEXTSIZE,"\020\003\016\002%u'",Divetime.Minutes); | |
434 } | |
435 } | |
436 else | |
437 { | |
438 SDivetime Divetime = {0,0,0, 0}; | |
439 | |
440 Divetime.Total = stateUsed->lifeData.dive_time_seconds_without_surface_time; | |
441 Divetime.Minutes = Divetime.Total / 60; | |
442 Divetime.Seconds = Divetime.Total - ( Divetime.Minutes * 60 ); | |
443 | |
444 snprintf(text,TEXTSIZE,"\032\f\002%c",TXT_Divetime); | |
445 GFX_write_string(&FontT42,tXr1,text,0); | |
446 | |
447 if(Divetime.Minutes < 100) | |
448 snprintf(text,TEXTSIZE,"\020\003\016\002%u:%02u",Divetime.Minutes, Divetime.Seconds); | |
449 else | |
450 snprintf(text,TEXTSIZE,"\020\003\016\002%u'",Divetime.Minutes); | |
451 } | |
452 t3_basics_colorscheme_mod(text); | |
453 GFX_write_string(&FontT105,tXr1,text,1); | |
454 | |
455 return depth; | |
456 } | |
457 | |
458 | |
459 void t3_refresh_divemode(void) | |
460 { | |
461 uint8_t customview_warnings = 0; | |
462 float depth_meter = 0.0; | |
463 | |
464 // everything like lines, depth, ascent graph and divetime | |
465 depth_meter = t3_basics_lines_depth_and_divetime(&t3screen, &t3l1, &t3r1, 0); // 0 could be stateUsed->diveSettings.diveMode for CCR specials | |
466 | |
467 // customview | |
468 if(stateUsed->warnings.numWarnings) | |
469 customview_warnings = t3_test_customview_warnings(); | |
470 | |
471 if(customview_warnings && warning_count_high_time) | |
472 t3_basics_show_customview_warnings(&t3c1); | |
473 else | |
474 t3_refresh_customview(depth_meter); | |
475 | |
476 if(stateUsed->warnings.lowBattery) | |
477 t3_basics_battery_low_customview_extra(&t3c1); | |
478 } | |
479 | |
480 | |
481 void t3_basics_battery_low_customview_extra(GFX_DrawCfgWindow* tXc1) | |
482 { | |
483 char TextC1[256]; | |
484 | |
485 TextC1[0] = '\002'; | |
486 TextC1[1] = '\f'; | |
487 TextC1[2] = '\025'; | |
488 TextC1[3] = '3'; | |
489 TextC1[4] = '1'; | |
490 TextC1[5] = '1'; | |
491 TextC1[6] = '1'; | |
492 TextC1[7] = '1'; | |
493 TextC1[8] = '1'; | |
494 TextC1[9] = '1'; | |
495 TextC1[10] = '1'; | |
496 TextC1[11] = '1'; | |
497 TextC1[12] = '1'; | |
498 TextC1[13] = '1'; | |
499 TextC1[14] = '0'; | |
500 TextC1[15] = 0; | |
501 | |
502 if(!warning_count_high_time) | |
503 TextC1[4] = '2'; | |
504 | |
505 GFX_write_string(&Batt24,tXc1,TextC1,0); | |
506 } | |
507 | |
508 | |
509 | |
510 void t3_refresh_customview(float depth) | |
511 { | |
512 if((t3_selection_customview == CVIEW_sensors) &&(stateUsed->diveSettings.ccrOption == 0)) | |
513 t3_change_customview(); | |
514 | |
515 SDiveState * pDiveState; | |
516 | |
517 if(stateUsed == stateRealGetPointer()) | |
518 pDiveState = stateRealGetPointerWrite(); | |
519 else | |
520 pDiveState = stateSimGetPointerWrite(); | |
521 | |
522 t3_basics_refresh_customview(depth, t3_selection_customview, &t3screen, &t3c1, &t3c2, pDiveState->diveSettings.diveMode); | |
523 } | |
524 | |
525 | |
526 void t3_basics_refresh_apnoeRight(float depth, uint8_t tX_selection_customview, GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXc1, GFX_DrawCfgWindow* tXc2, uint8_t mode) | |
527 { | |
528 char text[512]; | |
529 uint16_t textpointer = 0; | |
530 | |
531 // CVIEW_T3_Temperature | |
532 float temperatureThisCall; | |
533 float temperature; | |
534 | |
535 SDivetime TotalDivetime = {0,0,0,0}; | |
536 SDivetime LastDivetime = {0,0,0,0}; | |
537 | |
538 uint16_t tempWinX0; | |
539 uint16_t tempWinY0; | |
540 | |
541 tempWinX0 = tXc1->WindowX0; | |
542 tempWinY0 = tXc1->WindowY0; | |
543 | |
544 tXc1->WindowX0 = 440; // rechte Seite | |
545 | |
546 switch(tX_selection_customview) | |
547 { | |
548 case CVIEW_T3_Temperature: | |
549 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Temperature); | |
550 GFX_write_string(&FontT42,tXc1,text,0); | |
551 | |
552 // mean value | |
553 temperatureThisCall = unit_temperature_float(stateUsed->lifeData.temperature_celsius); | |
554 temperature = (temperatureThisCall + temperatureLastCall[0] + temperatureLastCall[1] + temperatureLastCall[2]) / 4.0f; | |
555 idTemperatureLastCall++; | |
556 if(idTemperatureLastCall >= 3) | |
557 idTemperatureLastCall = 0; | |
558 temperatureLastCall[idTemperatureLastCall] = temperatureThisCall; | |
559 textpointer = snprintf(text,TEXTSIZE,"\020\003\016%01.0f\016\016\140",temperature); // "\016\016%01.1f `" + C or F | |
560 if(settingsGetPointer()->nonMetricalSystem == 0) | |
561 text[textpointer++] = 'C'; | |
562 else | |
563 text[textpointer++] = 'F'; | |
564 text[textpointer++] = 0; | |
565 t3_basics_colorscheme_mod(text); | |
566 GFX_write_string(&FontT105,tXc1,text,1); | |
567 break; | |
568 | |
569 case CVIEW_T3_ApnoeSurfaceInfo: | |
570 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Divetime); | |
571 GFX_write_string(&FontT42,tXc1,text,0); | |
572 | |
573 TotalDivetime.Total = stateUsed->lifeData.dive_time_seconds_without_surface_time; | |
574 TotalDivetime.Minutes = TotalDivetime.Total / 60; | |
575 TotalDivetime.Seconds = TotalDivetime.Total - ( TotalDivetime.Minutes * 60 ); | |
576 | |
577 LastDivetime.Total = stateUsed->lifeData.apnea_last_dive_time_seconds; | |
578 LastDivetime.Minutes = LastDivetime.Total / 60; | |
579 LastDivetime.Seconds = LastDivetime.Total - ( LastDivetime.Minutes * 60 ); | |
580 | |
581 tXc1->WindowY0 = 100; // obere Zeile | |
582 | |
583 snprintf(text,TEXTSIZE,"\020\016%u:%02u",LastDivetime.Minutes, LastDivetime.Seconds); | |
584 t3_basics_colorscheme_mod(text); | |
585 GFX_write_string(&FontT105,tXc1,text,0); | |
586 | |
587 snprintf(text,TEXTSIZE,"\032\002%c%c",TXT_2BYTE, TXT2BYTE_ApneaLast); | |
588 GFX_write_string(&FontT42,tXc1,text,0); | |
589 | |
590 tXc1->WindowY0 = tempWinY0; // wieder unten | |
591 | |
592 snprintf(text,TEXTSIZE,"\020\016%u:%02u",TotalDivetime.Minutes, TotalDivetime.Seconds); | |
593 t3_basics_colorscheme_mod(text); | |
594 GFX_write_string(&FontT105,tXc1,text,0); | |
595 | |
596 snprintf(text,TEXTSIZE,"\032\002%c%c",TXT_2BYTE, TXT2BYTE_ApneaTotal); | |
597 GFX_write_string(&FontT42,tXc1,text,0); | |
598 break; | |
599 } | |
600 | |
601 tXc1->WindowX0 = tempWinX0; | |
602 tXc1->WindowY0 = tempWinY0; | |
603 | |
604 } | |
605 | |
606 | |
607 void t3_basics_refresh_customview(float depth, uint8_t tX_selection_customview, GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXc1, GFX_DrawCfgWindow* tXc2, uint8_t mode) | |
608 { | |
609 char text[512]; | |
610 uint16_t textpointer = 0; | |
611 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
612 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
613 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
614 |
38 | 615 // CVIEW_T3_Decostop and CVIEW_T3_TTS |
616 const SDecoinfo * pDecoinfo; | |
617 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE) | |
618 pDecoinfo = &stateUsed->decolistBuehlmann; | |
619 else | |
620 pDecoinfo = &stateUsed->decolistVPM; | |
621 | |
622 // CVIEW_T3_Decostop | |
623 uint16_t nextstopLengthSeconds = 0; | |
624 uint8_t nextstopDepthMeter = 0; | |
625 SDivetime SafetyStopTime = {0,0,0,0}; | |
626 | |
627 // CVIEW_T3_ppO2andGas | |
628 uint8_t oxygen_percentage = 0; | |
629 | |
630 // CVIEW_T3_Temperature | |
631 float temperatureThisCall; | |
632 float temperature; | |
633 | |
634 // CVIEW_T3_GasList | |
635 float fPpO2limitHigh, fPpO2limitLow, fPpO2ofGasAtThisDepth; | |
636 const SGasLine * pGasLine; | |
637 uint8_t oxygen, helium; | |
638 uint8_t lineNumber; | |
639 | |
640 // CVIEW_T3_StopWatch | |
641 SDivetime Stopwatch = {0,0,0,0}; | |
642 float fAverageDepth, fAverageDepthAbsolute; | |
643 | |
644 | |
645 uint16_t tempWinX0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
646 uint16_t tempWinX1; |
38 | 647 uint16_t tempWinY0; |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
648 uint16_t tempWinY1; |
38 | 649 uint16_t tempWinC2X0; |
650 uint16_t tempWinC2Tab; | |
651 | |
652 tempWinX0 = tXc1->WindowX0; | |
653 tempWinY0 = tXc1->WindowY0; | |
654 tempWinC2X0 = tXc2->WindowX0; | |
655 tempWinC2Tab = tXc2->WindowTab; | |
656 | |
657 switch(tX_selection_customview) | |
658 { | |
659 case CVIEW_T3_ApnoeSurfaceInfo: | |
660 snprintf(text,TEXTSIZE,"\032\f%c",TXT_MaxDepth); | |
661 GFX_write_string(&FontT42,tXc1,text,0); | |
662 | |
663 tXc1->WindowY0 = 100; // obere Zeile | |
664 | |
665 snprintf(text,TEXTSIZE,"\020\016%01.1f",unit_depth_float(stateUsed->lifeData.apnea_last_max_depth_meter)); | |
666 t3_basics_colorscheme_mod(text); | |
667 GFX_write_string(&FontT105,tXc1,text,0); | |
668 | |
669 tXc1->WindowY0 = tempWinY0; // wieder unten | |
670 | |
671 snprintf(text,TEXTSIZE,"\020\016%01.1f",unit_depth_float(stateUsed->lifeData.apnea_total_max_depth_meter)); | |
672 t3_basics_colorscheme_mod(text); | |
673 GFX_write_string(&FontT105,tXc1,text,0); | |
674 break; | |
675 | |
676 case CVIEW_T3_StopWatch: | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
677 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
678 tempWinX0 = tXc1->WindowX0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
679 tempWinY0 = tXc1->WindowY0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
680 tempWinX1 = tXc1->WindowX1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
681 tempWinY1 = tXc1->WindowY1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
682 |
38 | 683 Stopwatch.Total = timer_Stopwatch_GetTime(); |
684 Stopwatch.Minutes = Stopwatch.Total / 60; | |
685 Stopwatch.Seconds = Stopwatch.Total - ( Stopwatch.Minutes * 60 ); | |
686 fAverageDepth = timer_Stopwatch_GetAvarageDepth_Meter(); | |
687 fAverageDepthAbsolute = stateUsed->lifeData.average_depth_meter; | |
688 | |
689 snprintf(text,TEXTSIZE,"\032\f%c",TXT_AvgDepth); | |
690 GFX_write_string(&FontT42,tXc1,text,0); | |
691 snprintf(text,TEXTSIZE,"\030\003\016%01.1f",unit_depth_float(fAverageDepthAbsolute)); | |
692 GFX_write_string(&FontT105,tXc1,text,0); | |
693 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
694 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
695 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
696 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
697 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
698 tXc1->WindowX0 = 480; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
699 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
700 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
701 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
702 tXc1->WindowX1 = 320; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
703 tXc1->WindowY0 = t3c1.WindowY0; /* select customer window */ |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
704 } |
38 | 705 // snprintf(text,TEXTSIZE,"\032\f%c%c - %c",TXT_2BYTE, TXT2BYTE_Clock, TXT_AvgDepth); |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
706 |
38 | 707 snprintf(text,TEXTSIZE,"\032\f%c", TXT_Stopwatch); |
708 GFX_write_string(&FontT42,tXc1,text,0); | |
709 snprintf(text,TEXTSIZE,"\030\016%01.1f",unit_depth_float(fAverageDepth)); | |
710 GFX_write_string(&FontT105,tXc1,text,0); | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
711 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
712 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
713 tXc1->WindowY0 = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
714 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
715 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
716 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
717 tXc1->WindowY1 -= 100; /* jump to upper of two lines */ |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
718 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
719 |
38 | 720 snprintf(text,TEXTSIZE,"\030%u:\016\016%02u",Stopwatch.Minutes, Stopwatch.Seconds); |
721 GFX_write_string(&FontT105,tXc1,text,0); | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
722 |
38 | 723 tXc1->WindowX0 = tempWinX0; |
724 tXc1->WindowY0 = tempWinY0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
725 tXc1->WindowX1 = tempWinX1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
726 tXc1->WindowY1 = tempWinY1; |
38 | 727 break; |
728 | |
729 case CVIEW_T3_GasList: | |
730 snprintf(text,TEXTSIZE,"\032\f%c%c",TXT_2BYTE, TXT2BYTE_Gaslist); | |
731 GFX_write_string(&FontT42,tXc1,text,0); | |
732 | |
733 textpointer = 0; | |
734 tempWinC2X0 = tXc2->WindowX0; | |
735 tempWinC2Tab = tXc2->WindowTab; | |
736 | |
737 tXc2->WindowX0 = 0; | |
738 tXc2->WindowTab = 800/2; | |
739 | |
740 pGasLine = settingsGetPointer()->gas; | |
741 if(actualLeftMaxDepth(stateUsed)) | |
742 fPpO2limitHigh = (float)(settingsGetPointer()->ppO2_max_deco) / 100; | |
743 else | |
744 fPpO2limitHigh = (float)(settingsGetPointer()->ppO2_max_std) / 100; | |
745 fPpO2limitLow = (float)(settingsGetPointer()->ppO2_min) / 100; | |
746 for(int gasId=1;gasId<=NUM_GASES;gasId++) | |
747 { | |
748 textpointer = 0; | |
749 lineNumber = gasId; | |
750 if(gasId > 3) | |
751 { | |
752 text[textpointer++] = '\t'; | |
753 lineNumber = gasId - 3; | |
754 } | |
755 fPpO2ofGasAtThisDepth = (stateUsed->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * pGasLine[gasId].oxygen_percentage / 100; | |
756 if(pGasLine[gasId].note.ub.active == 0) | |
757 strcpy(&text[textpointer++],"\021"); | |
758 else if((fPpO2ofGasAtThisDepth > fPpO2limitHigh) || (fPpO2ofGasAtThisDepth < fPpO2limitLow)) | |
759 strcpy(&text[textpointer++],"\025"); | |
760 else | |
761 strcpy(&text[textpointer++],"\030"); | |
762 | |
763 text[textpointer++] = ' '; | |
764 oxygen = pGasLine[gasId].oxygen_percentage; | |
765 helium = pGasLine[gasId].helium_percentage; | |
766 textpointer += write_gas(&text[textpointer], oxygen, helium); | |
767 GFX_write_string(&FontT42, tXc2, text, lineNumber); | |
768 } | |
769 break; | |
770 | |
771 case CVIEW_T3_Temperature: | |
772 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Temperature); | |
773 GFX_write_string(&FontT42,tXc1,text,0); | |
774 // mean value | |
775 temperatureThisCall = unit_temperature_float(stateUsed->lifeData.temperature_celsius); | |
776 temperature = (temperatureThisCall + temperatureLastCall[0] + temperatureLastCall[1] + temperatureLastCall[2]) / 4.0f; | |
777 idTemperatureLastCall++; | |
778 if(idTemperatureLastCall >= 3) | |
779 idTemperatureLastCall = 0; | |
780 temperatureLastCall[idTemperatureLastCall] = temperatureThisCall; | |
781 textpointer = snprintf(text,TEXTSIZE,"\030\003\016%01.1f \140",temperature); // "\016\016%01.1f `" + C or F | |
782 if(settingsGetPointer()->nonMetricalSystem == 0) | |
783 text[textpointer++] = 'C'; | |
784 else | |
785 text[textpointer++] = 'F'; | |
786 text[textpointer++] = 0; | |
787 GFX_write_string(&FontT105,tXc1,text,0); | |
788 break; | |
789 | |
790 case CVIEW_Compass: | |
791 snprintf(text,TEXTSIZE,"\032\f%c%c",TXT_2BYTE, TXT2BYTE_Compass); | |
792 GFX_write_string(&FontT42,tXc1,text,0); | |
793 snprintf(text,100,"\030\003%03i`",(uint16_t)stateUsed->lifeData.compass_heading); | |
794 GFX_write_string(&FontT105,tXc1,text,0); | |
795 t3_basics_compass(tXscreen, (uint16_t)stateUsed->lifeData.compass_heading, stateUsed->diveSettings.compassHeading); | |
796 break; | |
797 | |
798 case CVIEW_T3_Decostop: | |
799 default: | |
800 // decostop | |
801 if(pDecoinfo->output_time_to_surface_seconds) | |
802 { | |
803 tHome_findNextStop(pDecoinfo->output_stop_length_seconds, &nextstopDepthMeter, &nextstopLengthSeconds); | |
804 } | |
805 else | |
806 { | |
807 nextstopDepthMeter = 0; | |
808 nextstopLengthSeconds = 0; | |
809 } | |
810 | |
811 SafetyStopTime.Total = timer_Safetystop_GetCountDown(); | |
812 SafetyStopTime.Minutes = SafetyStopTime.Total / 60; | |
813 SafetyStopTime.Seconds = SafetyStopTime.Total - (SafetyStopTime.Minutes * 60); | |
814 | |
815 if(nextstopDepthMeter) | |
816 { | |
817 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Decostop); | |
818 GFX_write_string(&FontT42,tXc1,text,0); | |
819 | |
820 textpointer = 0; | |
821 snprintf(&text[textpointer],TEXTSIZE,"\020\003%u%c%c %u'" | |
822 , unit_depth_integer(nextstopDepthMeter) | |
823 , unit_depth_char1_T105() | |
824 , unit_depth_char2_T105() | |
825 , (nextstopLengthSeconds+59)/60); | |
826 // old without feet hw 170703 snprintf(&text[textpointer],TEXTSIZE,"\020\003%um %u'",nextstopDepthMeter,(nextstopLengthSeconds+59)/60); | |
827 t3_basics_colorscheme_mod(text); | |
828 GFX_write_string(&FontT105,tXc1,text,1); | |
829 } | |
830 else if(SafetyStopTime.Total && (depth > timer_Safetystop_GetDepthUpperLimit())) | |
831 { | |
832 textpointer = 0; | |
833 snprintf(&text[textpointer],TEXTSIZE,"\032\f%c%c",TXT_2BYTE,TXT2BYTE_SafetyStop2); | |
834 GFX_write_string(&FontT42,tXc1,text,0); | |
835 | |
836 textpointer = 0; | |
837 snprintf(&text[textpointer],TEXTSIZE,"\020\003\016%u:%02u",SafetyStopTime.Minutes,SafetyStopTime.Seconds); | |
838 t3_basics_colorscheme_mod(text); | |
839 GFX_write_string(&FontT105,tXc1,text,1); | |
840 } | |
841 else // NDL | |
842 { | |
843 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Nullzeit); | |
844 GFX_write_string(&FontT42,tXc1,text,0); | |
845 if(pDecoinfo->output_ndl_seconds < 1000 * 60) | |
846 snprintf(text,TEXTSIZE,"\020\003%i'",pDecoinfo->output_ndl_seconds/60); | |
847 else | |
848 snprintf(text,TEXTSIZE,"\020\003%ih",pDecoinfo->output_ndl_seconds/3600); | |
849 t3_basics_colorscheme_mod(text); | |
850 GFX_write_string(&FontT105,tXc1,text,1); | |
851 } | |
852 break; | |
853 | |
854 case CVIEW_sensors: | |
855 snprintf(text,TEXTSIZE,"\032\f%c%c",TXT_2BYTE,TXT2BYTE_O2monitor); | |
856 GFX_write_string(&FontT42,tXc1,text,0); | |
857 | |
858 for(int i=0;i<3;i++) | |
859 { | |
860 textpointer = 0; | |
861 text[textpointer++] = '\030'; | |
862 if(i==1) | |
863 text[textpointer++] = '\001'; | |
864 else if(i==2) | |
865 text[textpointer++] = '\002'; | |
866 if(stateUsed->diveSettings.ppo2sensors_deactivated & (1<<i)) | |
867 { | |
868 text[textpointer++] = '\031'; | |
869 text[textpointer++] = ' '; | |
870 text[textpointer++] = '-'; | |
871 text[textpointer++] = ' '; | |
872 } | |
873 else | |
874 { | |
875 if(stateUsed->warnings.sensorOutOfBounds[i]) | |
876 text[textpointer++] = '\025'; | |
877 textpointer += snprintf(&text[textpointer],TEXTSIZE,"%.1f",stateUsed->lifeData.ppO2Sensor_bar[i]); | |
878 } | |
879 GFX_write_string(&FontT144,tXc1,text,1); | |
880 } | |
881 break; | |
882 | |
883 case CVIEW_T3_MaxDepth: | |
884 snprintf(text,TEXTSIZE,"\032\f%c",TXT_MaxDepth); | |
885 GFX_write_string(&FontT42,tXc1,text,0); | |
886 snprintf(text,TEXTSIZE,"\020\003\016%01.1f",unit_depth_float(stateUsed->lifeData.max_depth_meter)); | |
887 t3_basics_colorscheme_mod(text); | |
888 GFX_write_string(&FontT105,tXc1,text,1); | |
889 break; | |
890 | |
891 case CVIEW_T3_TTS: | |
892 snprintf(text,TEXTSIZE,"\032\f%c",TXT_TTS); | |
893 GFX_write_string(&FontT42,tXc1,text,0); | |
894 if(pDecoinfo->output_time_to_surface_seconds) | |
895 { | |
896 if(pDecoinfo->output_time_to_surface_seconds < 1000 * 60) | |
897 snprintf(text,TEXTSIZE,"\020\003\002%i'",(pDecoinfo->output_time_to_surface_seconds + 30)/ 60); | |
898 else | |
899 snprintf(text,TEXTSIZE,"\020\003\002%ih",pDecoinfo->output_time_to_surface_seconds / 3600); | |
900 t3_basics_colorscheme_mod(text); | |
901 GFX_write_string(&FontT105,tXc1,text,1); | |
902 } | |
903 break; | |
904 | |
905 case CVIEW_T3_ppO2andGas: | |
906 snprintf(text,TEXTSIZE,"\032\f%c",TXT_ppO2); | |
907 GFX_write_string(&FontT42,tXc1,text,0); | |
908 snprintf(text,TEXTSIZE,"\020\003%01.2f",stateUsed->lifeData.ppO2); | |
909 t3_basics_colorscheme_mod(text); | |
910 GFX_write_string(&FontT105,tXc1,text,1); | |
911 | |
912 textpointer = 0; | |
913 text[textpointer++] = '\020'; | |
914 text[textpointer++] = '\003'; | |
915 oxygen_percentage = 100; | |
916 oxygen_percentage -= stateUsed->lifeData.actualGas.nitrogen_percentage; | |
917 oxygen_percentage -= stateUsed->lifeData.actualGas.helium_percentage; | |
918 text[textpointer++] = '\002'; | |
919 tHome_gas_writer(oxygen_percentage,stateUsed->lifeData.actualGas.helium_percentage,&text[textpointer]); | |
920 //textpointer = snprintf(&text[textpointer],TEXTSIZE,"\020\002%02u/%02u",oxygen_percentage, stateUsed->lifeData.actualGas.helium_percentage); | |
921 t3_basics_colorscheme_mod(text); | |
922 GFX_write_string(&FontT48,tXc1,text,1); | |
923 break; | |
924 } | |
925 tXc1->WindowX0 = tempWinX0; | |
926 tXc1->WindowY0 = tempWinY0; | |
927 tXc2->WindowX0 = tempWinC2X0; | |
928 tXc2->WindowTab = tempWinC2Tab; | |
929 } | |
930 | |
931 | |
932 uint8_t t3_test_customview_warnings(void) | |
933 { | |
934 uint8_t count = 0; | |
935 | |
936 count = 0; | |
937 count += stateUsed->warnings.decoMissed; | |
938 count += stateUsed->warnings.ppO2Low; | |
939 count += stateUsed->warnings.ppO2High; | |
940 //count += stateUsed->warnings.lowBattery; | |
941 count += stateUsed->warnings.sensorLinkLost; | |
942 count += stateUsed->warnings.fallback; | |
943 | |
944 return count; | |
945 } | |
946 | |
947 //void t3_show_customview_warnings(GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXl1, GFX_DrawCfgWindow* tXr1, uint8_t mode) | |
948 void t3_basics_show_customview_warnings(GFX_DrawCfgWindow* tXc1) | |
949 { | |
950 char text[256], textMain[256]; | |
951 uint8_t textpointer, textpointerMain, lineFree, more; | |
952 | |
953 snprintf(text,TEXTSIZE,"\025\f%c",TXT_Warning); | |
954 GFX_write_string(&FontT42,&t3c1,text,0); | |
955 | |
956 lineFree = 1; | |
957 more = 0; | |
958 | |
959 textpointerMain = 0; | |
960 textMain[textpointerMain++] = '\025'; | |
961 textMain[textpointerMain++] = '\003'; | |
962 | |
963 textpointer = 0; | |
964 | |
965 text[textpointer++] = '\021'; | |
966 text[textpointer++] = TXT_2BYTE; | |
967 text[textpointer++] = TXT2BYTE_WarnDecoMissed; | |
968 if(stateUsed->warnings.decoMissed) | |
969 { | |
970 text[textpointer - 3] = '\025'; | |
971 if(lineFree) | |
972 { | |
973 textMain[textpointerMain++] = TXT_2BYTE; | |
974 textMain[textpointerMain++] = text[textpointer - 1]; | |
975 textMain[textpointerMain] = 0; | |
976 lineFree--; | |
977 } | |
978 else | |
979 { | |
980 more++; | |
981 } | |
982 } | |
983 | |
984 text[textpointer++] = '\t'; | |
985 text[textpointer++] = '\021'; | |
986 text[textpointer++] = TXT_2BYTE; | |
987 text[textpointer++] = TXT2BYTE_WarnPPO2Low; | |
988 if(stateUsed->warnings.ppO2Low) | |
989 { | |
990 text[textpointer - 3] = '\025'; | |
991 if(lineFree) | |
992 { | |
993 textMain[textpointerMain++] = TXT_2BYTE; | |
994 textMain[textpointerMain++] = text[textpointer - 1]; | |
995 textMain[textpointerMain] = 0; | |
996 lineFree--; | |
997 } | |
998 else | |
999 { | |
1000 more++; | |
1001 } | |
1002 } | |
1003 | |
1004 text[textpointer++] = '\n'; | |
1005 text[textpointer++] = '\r'; | |
1006 text[textpointer++] = '\021'; | |
1007 text[textpointer++] = TXT_2BYTE; | |
1008 text[textpointer++] = TXT2BYTE_WarnPPO2High; | |
1009 if(stateUsed->warnings.ppO2High) | |
1010 { | |
1011 text[textpointer - 3] = '\025'; | |
1012 if(lineFree) | |
1013 { | |
1014 textMain[textpointerMain++] = TXT_2BYTE; | |
1015 textMain[textpointerMain++] = text[textpointer - 1]; | |
1016 textMain[textpointerMain] = 0; | |
1017 lineFree--; | |
1018 } | |
1019 else | |
1020 { | |
1021 more++; | |
1022 } | |
1023 } | |
1024 | |
1025 text[textpointer++] = '\t'; | |
1026 text[textpointer++] = '\021'; | |
1027 text[textpointer++] = TXT_2BYTE; | |
1028 text[textpointer++] = TXT2BYTE_WarnFallback; | |
1029 if(stateUsed->warnings.fallback) | |
1030 { | |
1031 text[textpointer - 3] = '\025'; | |
1032 if(lineFree) | |
1033 { | |
1034 textMain[textpointerMain++] = TXT_2BYTE; | |
1035 textMain[textpointerMain++] = text[textpointer - 1]; | |
1036 textMain[textpointerMain] = 0; | |
1037 lineFree--; | |
1038 } | |
1039 else | |
1040 { | |
1041 more++; | |
1042 } | |
1043 } | |
1044 | |
1045 text[textpointer++] = '\n'; | |
1046 text[textpointer++] = '\r'; | |
1047 text[textpointer++] = '\021'; | |
1048 text[textpointer++] = TXT_2BYTE; | |
1049 text[textpointer++] = TXT2BYTE_WarnSensorLinkLost; | |
1050 if(stateUsed->warnings.sensorLinkLost) | |
1051 { | |
1052 text[textpointer - 3] = '\025'; | |
1053 if(lineFree) | |
1054 { | |
1055 textMain[textpointerMain++] = TXT_2BYTE; | |
1056 textMain[textpointerMain++] = text[textpointer - 1]; | |
1057 textMain[textpointerMain] = 0; | |
1058 lineFree--; | |
1059 } | |
1060 else | |
1061 { | |
1062 more++; | |
1063 } | |
1064 } | |
1065 | |
1066 /* | |
1067 text[textpointer++] = '\t'; | |
1068 text[textpointer++] = '\021'; | |
1069 text[textpointer++] = TXT_2BYTE; | |
1070 text[textpointer++] = TXT2BYTE_WarnBatteryLow; | |
1071 if(stateUsed->warnings.lowBattery) | |
1072 { | |
1073 text[textpointer - 3] = '\025'; | |
1074 if(lineFree) | |
1075 { | |
1076 textMain[textpointerMain++] = TXT_2BYTE; | |
1077 textMain[textpointerMain++] = text[textpointer - 1]; | |
1078 textMain[textpointerMain] = 0; | |
1079 lineFree--; | |
1080 } | |
1081 else | |
1082 { | |
1083 more++; | |
1084 } | |
1085 } | |
1086 */ | |
1087 text[textpointer] = 0; | |
1088 /* | |
1089 if(more) | |
1090 { | |
1091 text[textpointer++] = '\002'; | |
1092 text[textpointer++] = '+'; | |
1093 if(more < 10) | |
1094 text[textpointer++] = '0' + more; | |
1095 else | |
1096 text[textpointer++] = 'X'; | |
1097 text[textpointer] = 0; | |
1098 } | |
1099 */ | |
1100 GFX_write_string(&FontT48,&t3c1,textMain,1); | |
1101 if(more) | |
1102 { | |
1103 GFX_write_string(&FontT48,&t3c2,text,1); | |
1104 } | |
1105 } | |
1106 | |
1107 | |
1108 void t3_change_customview(void) | |
1109 { | |
1110 t3_basics_change_customview(&t3_selection_customview, t3_customviews); | |
1111 } | |
1112 | |
1113 | |
1114 void t3_basics_change_customview(uint8_t *tX_selection_customview, const uint8_t *tX_customviews) | |
1115 { | |
1116 const SDecoinfo * pDecoinfo; | |
1117 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE) | |
1118 pDecoinfo = &stateUsed->decolistBuehlmann; | |
1119 else | |
1120 pDecoinfo = &stateUsed->decolistVPM; | |
1121 | |
1122 const uint8_t *pViews; | |
1123 pViews = tX_customviews; | |
1124 | |
1125 while((*pViews != CVIEW_T3_END) && (*pViews != *tX_selection_customview)) | |
1126 {pViews++;} | |
1127 | |
1128 if(*pViews < CVIEW_T3_END) | |
1129 pViews++; | |
1130 | |
1131 if((*pViews == CVIEW_T3_TTS) && !pDecoinfo->output_time_to_surface_seconds) | |
1132 pViews++; | |
1133 | |
1134 if(*pViews == CVIEW_T3_END) | |
1135 { | |
1136 *tX_selection_customview = tX_customviews[0]; | |
1137 } | |
1138 else | |
1139 *tX_selection_customview = *pViews; | |
1140 } | |
1141 | |
1142 | |
1143 void t3_basics_colorscheme_mod(char *text) | |
1144 { | |
1145 if((text[0] == '\020') && !GFX_is_colorschemeDiveStandard()) | |
1146 { | |
1147 text[0] = '\027'; | |
1148 } | |
1149 } | |
1150 | |
1151 | |
1152 point_t t3_compass_circle(uint8_t id, uint16_t degree) | |
1153 { | |
1154 float fCos, fSin; | |
1155 const float piMult = ((2 * 3.14159) / 360); | |
1156 // const int radius[4] = {95,105,115,60}; | |
1157 const int radius[4] = {85,95,105,90}; | |
1158 const point_t offset = {.x = 600, .y = 116}; | |
1159 | |
1160 static point_t r[4][360] = { 0 }; | |
1161 | |
1162 if(r[0][0].y == 0) | |
1163 { | |
1164 for(int i=0;i<360;i++) | |
1165 { | |
1166 fCos = cos(i * piMult); | |
1167 fSin = sin(i * piMult); | |
1168 for(int j=0;j<4;j++) | |
1169 { | |
1170 r[j][i].x = offset.x + (int)(fSin * radius[j]); | |
1171 r[j][i].y = offset.y + (int)(fCos * radius[j]); | |
1172 } | |
1173 } | |
1174 } | |
1175 if(id > 3) id = 0; | |
1176 if(degree > 359) degree = 0; | |
1177 return r[id][degree]; | |
1178 } | |
1179 | |
1180 | |
1181 void t3_basics_compass(GFX_DrawCfgScreen *tXscreen, uint16_t ActualHeading, uint16_t UserSetHeading) | |
1182 { | |
1183 uint16_t LineHeading; | |
1184 point_t center; | |
1185 static int32_t LastHeading = 0; | |
1186 int32_t newHeading = 0; | |
1187 int32_t diff = 0; | |
1188 int32_t diff2 = 0; | |
1189 | |
1190 int32_t diffAbs = 0; | |
1191 int32_t diffAbs2 = 0; | |
1192 | |
1193 newHeading = ActualHeading; | |
1194 | |
1195 diff = newHeading - LastHeading; | |
1196 | |
1197 if(newHeading < LastHeading) | |
1198 diff2 = newHeading + 360 - LastHeading; | |
1199 else | |
1200 diff2 = newHeading - 360 - LastHeading; | |
1201 | |
1202 diffAbs = diff; | |
1203 if(diffAbs < 0) | |
1204 diffAbs *= -1; | |
1205 | |
1206 diffAbs2 = diff2; | |
1207 if(diffAbs2 < 0) | |
1208 diffAbs2 *= -1; | |
1209 | |
1210 if(diffAbs <= diffAbs2) | |
1211 newHeading = LastHeading + (diff / 2); | |
1212 else | |
1213 newHeading = LastHeading + (diff2 / 2); | |
1214 | |
1215 if(newHeading < 0) | |
1216 newHeading += 360; | |
1217 else | |
1218 if(newHeading >= 360) | |
1219 newHeading -= 360; | |
1220 | |
1221 LastHeading = newHeading; | |
1222 ActualHeading = newHeading; | |
1223 | |
1224 if (ActualHeading < 90) | |
1225 ActualHeading += 360; | |
1226 | |
1227 while(ActualHeading > 359) ActualHeading -= 360; | |
1228 | |
1229 LineHeading = 360 - ActualHeading; | |
1230 GFX_draw_thick_line(9,tXscreen, t3_compass_circle(0,LineHeading), t3_compass_circle(2,LineHeading), CLUT_Font030); // North | |
1231 LineHeading += 90; | |
1232 if(LineHeading > 359) LineHeading -= 360; | |
1233 GFX_draw_thick_line(9,tXscreen, t3_compass_circle(1,LineHeading), t3_compass_circle(2,LineHeading), CLUT_Font031); // Maintick | |
1234 LineHeading += 90; | |
1235 if(LineHeading > 359) LineHeading -= 360; | |
1236 GFX_draw_thick_line(9,tXscreen, t3_compass_circle(1,LineHeading), t3_compass_circle(2,LineHeading), CLUT_Font031); | |
1237 LineHeading += 90; | |
1238 if(LineHeading > 359) LineHeading -= 360; | |
1239 GFX_draw_thick_line(9,tXscreen, t3_compass_circle(1,LineHeading), t3_compass_circle(2,LineHeading), CLUT_Font031); | |
1240 | |
1241 LineHeading = 360 - ActualHeading; | |
1242 LineHeading += 45; | |
1243 if(LineHeading > 359) LineHeading -= 360; | |
1244 GFX_draw_thick_line(5,tXscreen, t3_compass_circle(1,LineHeading), t3_compass_circle(2,LineHeading), CLUT_Font031); // Subtick | |
1245 LineHeading += 90; | |
1246 if(LineHeading > 359) LineHeading -= 360; | |
1247 GFX_draw_thick_line(5,tXscreen, t3_compass_circle(1,LineHeading), t3_compass_circle(2,LineHeading), CLUT_Font031); | |
1248 LineHeading += 90; | |
1249 if(LineHeading > 359) LineHeading -= 360; | |
1250 GFX_draw_thick_line(5,tXscreen, t3_compass_circle(1,LineHeading), t3_compass_circle(2,LineHeading), CLUT_Font031); | |
1251 LineHeading += 90; | |
1252 if(LineHeading > 359) LineHeading -= 360; | |
1253 GFX_draw_thick_line(5,tXscreen, t3_compass_circle(1,LineHeading), t3_compass_circle(2,LineHeading), CLUT_Font031); | |
1254 | |
1255 LineHeading = 360 - ActualHeading; | |
1256 LineHeading += 22; | |
1257 if(LineHeading > 359) LineHeading -= 360; | |
1258 GFX_draw_thick_line(3,tXscreen, t3_compass_circle(1,LineHeading), t3_compass_circle(2,LineHeading), CLUT_Font031); // Subtick | |
1259 LineHeading += 45; | |
1260 if(LineHeading > 359) LineHeading -= 360; | |
1261 GFX_draw_thick_line(3,tXscreen, t3_compass_circle(1,LineHeading), t3_compass_circle(2,LineHeading), CLUT_Font031); | |
1262 LineHeading += 45; | |
1263 if(LineHeading > 359) LineHeading -= 360; | |
1264 GFX_draw_thick_line(3,tXscreen, t3_compass_circle(1,LineHeading), t3_compass_circle(2,LineHeading), CLUT_Font031); | |
1265 LineHeading += 45; | |
1266 if(LineHeading > 359) LineHeading -= 360; | |
1267 GFX_draw_thick_line(3,tXscreen, t3_compass_circle(1,LineHeading), t3_compass_circle(2,LineHeading), CLUT_Font031); | |
1268 LineHeading += 45; | |
1269 if(LineHeading > 359) LineHeading -= 360; | |
1270 GFX_draw_thick_line(3,tXscreen, t3_compass_circle(1,LineHeading), t3_compass_circle(2,LineHeading), CLUT_Font031); // Subtick | |
1271 LineHeading += 45; | |
1272 if(LineHeading > 359) LineHeading -= 360; | |
1273 GFX_draw_thick_line(3,tXscreen, t3_compass_circle(1,LineHeading), t3_compass_circle(2,LineHeading), CLUT_Font031); | |
1274 LineHeading += 45; | |
1275 if(LineHeading > 359) LineHeading -= 360; | |
1276 GFX_draw_thick_line(3,tXscreen, t3_compass_circle(1,LineHeading), t3_compass_circle(2,LineHeading), CLUT_Font031); | |
1277 LineHeading += 45; | |
1278 if(LineHeading > 359) LineHeading -= 360; | |
1279 GFX_draw_thick_line(3,tXscreen, t3_compass_circle(1,LineHeading), t3_compass_circle(2,LineHeading), CLUT_Font031); | |
1280 | |
1281 if(UserSetHeading) | |
1282 { | |
1283 LineHeading = UserSetHeading + 360 - ActualHeading; | |
1284 if(LineHeading > 359) LineHeading -= 360; | |
1285 GFX_draw_thick_line(9,tXscreen, t3_compass_circle(3,LineHeading), t3_compass_circle(2,LineHeading), CLUT_CompassUserHeadingTick); | |
1286 | |
1287 // R�ckpeilung, User Back Heading | |
1288 LineHeading = UserSetHeading + 360 + 180 - ActualHeading; | |
1289 if(LineHeading > 359) LineHeading -= 360; | |
1290 if(LineHeading > 359) LineHeading -= 360; | |
1291 GFX_draw_thick_line(9,tXscreen, t3_compass_circle(3,LineHeading), t3_compass_circle(2,LineHeading), CLUT_CompassUserBackHeadingTick); | |
1292 } | |
1293 | |
1294 center.x = 600; | |
1295 center.y = 116; | |
1296 GFX_draw_circle(tXscreen, center, 106, CLUT_Font030); | |
1297 GFX_draw_circle(tXscreen, center, 107, CLUT_Font030); | |
1298 GFX_draw_circle(tXscreen, center, 108, CLUT_Font030); | |
1299 } |