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