Mercurial > public > ostc4
annotate Discovery/Src/t3.c @ 541:6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
In previous version the ostc tried to applied the t7 default view selection to t3 view. As t3 has different views than t3, a new selection menu has been added to the custom view menu enabling the selection of the big font default view.
In parallel the auto return function has been adapted to use the new parameter.
author | Ideenmodellierer |
---|---|
date | Sat, 10 Oct 2020 18:34:10 +0200 |
parents | d784f281833a |
children | 6960df7ddb09 |
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 | |
237
ec16fd26e280
Bugfix: do not show NDL in bigscreen mode when zero
Jan Mulder <jlmulder@xs4all.nl>
parents:
214
diff
changeset
|
40 //* Imported function prototypes ---------------------------------------------*/ |
38 | 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 | |
529
0e1db77b2aca
Added skip condition in custom view selection:
Ideenmodellierer
parents:
527
diff
changeset
|
55 uint8_t t3_selection_customview = CVIEW_noneOrDebug; |
38 | 56 |
57 /* TEM HAS TO MOVE TO GLOBAL--------------------------------------------------*/ | |
58 | |
59 /* Private types -------------------------------------------------------------*/ | |
60 #define TEXTSIZE 16 | |
384
427ae9f8e28e
Consider number of available t3 views in sector handling:
ideenmodellierer
parents:
272
diff
changeset
|
61 #define NUMBER_OF_VIEWS 7 /* number of views defined in the array below */ |
38 | 62 |
63 const uint8_t t3_customviewsStandard[] = | |
64 { | |
65 CVIEW_T3_Decostop, | |
66 CVIEW_sensors, | |
67 CVIEW_Compass, | |
68 CVIEW_T3_MaxDepth, | |
69 CVIEW_T3_StopWatch, | |
70 CVIEW_T3_TTS, | |
71 CVIEW_T3_ppO2andGas, | |
518 | 72 CVIEW_T3_GasList, |
511 | 73 CVIEW_T3_Navigation, |
74 CVIEW_T3_DepthData, | |
541
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
75 CVIEW_noneOrDebug, |
38 | 76 CVIEW_T3_END |
77 }; | |
78 | |
79 /* Private function prototypes -----------------------------------------------*/ | |
80 void t3_refresh_divemode(void); | |
81 | |
82 uint8_t t3_test_customview_warnings(void); | |
83 void t3_refresh_customview(float depth); | |
496 | 84 void t3_basics_compass(GFX_DrawCfgScreen *tXscreen, point_t center, uint16_t ActualHeading, uint16_t UserSetHeading); |
38 | 85 |
86 /* Exported functions --------------------------------------------------------*/ | |
87 | |
88 void t3_init(void) | |
89 { | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
90 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
91 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
92 |
496 | 93 t3_selection_customview = t3_customviewsStandard[0]; |
38 | 94 |
95 t3screen.FBStartAdress = 0; | |
96 t3screen.ImageHeight = 480; | |
97 t3screen.ImageWidth = 800; | |
98 t3screen.LayerIndex = 1; | |
99 | |
100 t3l1.Image = &t3screen; | |
101 t3l1.WindowNumberOfTextLines = 2; | |
102 t3l1.WindowLineSpacing = 19; // Abstand von Y0 | |
103 t3l1.WindowTab = 100; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
104 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
105 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
106 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
107 t3l1.WindowX0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
108 t3l1.WindowX1 = BigFontSeperationLeftRight - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
109 t3l1.WindowY0 = BigFontSeperationTopBottom + 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
110 t3l1.WindowY1 = 479; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
111 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
112 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
113 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
114 t3l1.WindowX0 = 800 - BigFontSeperationLeftRight + 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
115 t3l1.WindowX1 = 799; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
116 t3l1.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
117 t3l1.WindowY1 = 479 - BigFontSeperationTopBottom + 5 ; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
118 } |
38 | 119 |
120 t3r1.Image = &t3screen; | |
121 t3r1.WindowNumberOfTextLines = t3l1.WindowNumberOfTextLines; | |
122 t3r1.WindowLineSpacing = t3l1.WindowLineSpacing; | |
123 t3r1.WindowTab = t3l1.WindowTab; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
124 if(!pSettings->FlipDisplay) |
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 t3r1.WindowX0 = BigFontSeperationLeftRight + 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
127 t3r1.WindowX1 = 799; |
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 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
130 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
131 t3r1.WindowX0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
132 t3r1.WindowX1 = BigFontSeperationLeftRight - 5; |
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 |
38 | 135 t3r1.WindowY0 = t3l1.WindowY0; |
136 t3r1.WindowY1 = t3l1.WindowY1; | |
137 | |
518 | 138 /* t3c1 is across the complete lower part of the display */ |
38 | 139 t3c1.Image = &t3screen; |
140 t3c1.WindowNumberOfTextLines = 2; | |
518 | 141 t3c1.WindowLineSpacing = 84 + 5; /* double font + spacing */ |
38 | 142 t3c1.WindowX0 = 0; |
143 t3c1.WindowX1 = 799; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
144 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
145 { |
511 | 146 t3c1.WindowY0 = 5; |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
147 t3c1.WindowY1 = BigFontSeperationTopBottom - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
148 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
149 else |
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 t3c1.WindowY0 = 480 - BigFontSeperationTopBottom + 5; |
511 | 152 t3c1.WindowY1 = 479 - 5; |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
153 } |
38 | 154 |
518 | 155 /* t3c2 is just showing the lower right part of the display */ |
38 | 156 t3c2.Image = &t3screen; |
157 t3c2.WindowNumberOfTextLines = 3; | |
511 | 158 t3c2.WindowLineSpacing = t3c1.WindowLineSpacing ; |
38 | 159 t3c2.WindowX0 = 370; |
160 t3c2.WindowX1 = 799; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
161 t3c2.WindowY0 = t3c1.WindowY0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
162 t3c2.WindowY1 = t3c1.WindowY1; |
38 | 163 t3c2.WindowTab = 600; |
164 } | |
165 | |
166 | |
167 void t3_refresh(void) | |
168 { | |
496 | 169 static uint8_t last_mode = MODE_SURFACE; |
170 | |
38 | 171 SStateList status; |
172 get_globalStateList(&status); | |
173 | |
174 if(stateUsed->mode != MODE_DIVE) | |
175 { | |
176 settingsGetPointer()->design = 7; | |
177 return; | |
178 } | |
179 | |
180 if(status.base != BaseHome) | |
181 return; | |
182 | |
541
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
183 if(last_mode != MODE_DIVE) /* Select custom view */ |
496 | 184 { |
185 if((settingsGetPointer()->tX_customViewTimeout == 0) && (settingsGetPointer()->showDebugInfo)) | |
186 { | |
187 t3_selection_customview = CVIEW_noneOrDebug; | |
188 } | |
189 else | |
190 { | |
541
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
191 t3_selection_customview = settingsGetPointer()->tX_customViewPrimaryBF; |
496 | 192 } |
193 t3_change_customview(ACTION_END); | |
194 } | |
38 | 195 t3screen.FBStartAdress = getFrame(24); |
196 t3_refresh_divemode(); | |
166
255eedad4155
cleanup: get rid of some compile warnings
Jan Mulder <jlmulder@xs4all.nl>
parents:
138
diff
changeset
|
197 GFX_SetFramesTopBottom(t3screen.FBStartAdress, 0,480); |
38 | 198 releaseAllFramesExcept(24,t3screen.FBStartAdress); |
496 | 199 last_mode = stateUsed->mode; |
38 | 200 } |
201 | |
541
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
202 void t3_set_customview_to_primary(void) |
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
203 { |
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
204 if(stateUsed->mode == MODE_DIVE) |
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
205 { |
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
206 t3_selection_customview = settingsGetPointer()->tX_customViewPrimaryBF; |
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
207 } |
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
208 } |
38 | 209 |
210 /* Private functions ---------------------------------------------------------*/ | |
211 | |
212 float t3_basics_lines_depth_and_divetime(GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXl1, GFX_DrawCfgWindow* tXr1, uint8_t mode) | |
213 { | |
518 | 214 char text[256]; |
215 uint8_t textPointer; | |
38 | 216 uint8_t color; |
217 uint8_t depthChangeRate; | |
218 uint8_t depthChangeAscent; | |
219 point_t start, stop, startZeroLine; | |
518 | 220 SDivetime Divetime = {0,0,0,0}; |
38 | 221 |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
222 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
223 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
224 |
38 | 225 start.x = 0; |
226 stop.x = 799; | |
227 stop.y = start.y = BigFontSeperationTopBottom; | |
228 GFX_draw_line(tXscreen, start, stop, CLUT_Font020); | |
229 | |
230 start.y = BigFontSeperationTopBottom; | |
231 stop.y = 479; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
232 |
38 | 233 stop.x = start.x = BigFontSeperationLeftRight; |
234 GFX_draw_line(tXscreen, start, stop, CLUT_Font020); | |
235 | |
236 /* depth */ | |
174
ecb71521d004
Bugfix: make max depth move with current depth (part 2)
Jan Mulder <jlmulder@xs4all.nl>
parents:
166
diff
changeset
|
237 float depth = unit_depth_float(stateUsed->lifeData.depth_meter); |
38 | 238 |
239 if(depth <= 0.3f) | |
240 depth = 0; | |
241 | |
242 if(settingsGetPointer()->nonMetricalSystem) | |
243 snprintf(text,TEXTSIZE,"\032\f[feet]"); | |
244 else | |
245 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Depth); | |
246 GFX_write_string(&FontT42,tXl1,text,0); | |
247 | |
248 if( ((mode == DIVEMODE_Apnea) && ((stateUsed->lifeData.ascent_rate_meter_per_min > 4) || (stateUsed->lifeData.ascent_rate_meter_per_min < -4 ))) | |
249 || ((mode != DIVEMODE_Apnea) && ((stateUsed->lifeData.ascent_rate_meter_per_min > 8) || (stateUsed->lifeData.ascent_rate_meter_per_min < -10))) | |
250 ) | |
251 { | |
252 snprintf(text,TEXTSIZE,"\f\002%.0f %c%c/min " | |
253 , unit_depth_float(stateUsed->lifeData.ascent_rate_meter_per_min) | |
254 , unit_depth_char1() | |
255 , unit_depth_char2() | |
256 ); | |
257 GFX_write_string(&FontT42,tXl1,text,0); | |
258 } | |
259 | |
260 if( depth < 100) | |
261 snprintf(text,TEXTSIZE,"\020\003\016%01.1f",depth); | |
262 else | |
263 snprintf(text,TEXTSIZE,"\020\003\016%01.0f",depth); | |
264 | |
265 t3_basics_colorscheme_mod(text); | |
266 GFX_write_string(&FontT105,tXl1,text,1); | |
267 | |
268 | |
269 /* ascentrate graph */ | |
270 if(mode == DIVEMODE_Apnea) | |
271 { | |
272 /* ascentrate graph - apnea mode */ | |
273 if(stateUsed->lifeData.ascent_rate_meter_per_min > 0) | |
274 { | |
275 depthChangeAscent = 1; | |
276 if(stateUsed->lifeData.ascent_rate_meter_per_min < 200) | |
277 depthChangeRate = (uint8_t)stateUsed->lifeData.ascent_rate_meter_per_min; | |
278 else | |
279 depthChangeRate = 200; | |
280 } | |
281 else | |
282 { | |
283 depthChangeAscent = 0; | |
284 if(stateUsed->lifeData.ascent_rate_meter_per_min > -200) | |
285 depthChangeRate = (uint8_t)(0 - stateUsed->lifeData.ascent_rate_meter_per_min); | |
286 else | |
287 depthChangeRate = 200; | |
288 } | |
413 | 289 |
290 if(!pSettings->FlipDisplay) | |
291 { | |
292 start.y = tXl1->WindowY0 - 1; | |
293 } | |
294 else | |
295 { | |
296 start.y = tXl1->WindowY1 + 1; | |
297 } | |
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
298 startZeroLine.y = start.y; |
38 | 299 for(int i = 0; i<5;i++) |
300 { | |
301 start.y += 40; | |
302 stop.y = start.y; | |
413 | 303 if(!pSettings->FlipDisplay) |
304 { | |
305 start.x = tXl1->WindowX1 - 1; | |
306 } | |
307 else | |
308 { | |
309 start.x = tXr1->WindowX1 - 1; | |
310 } | |
38 | 311 stop.x = start.x - 17; |
312 | |
313 if(depthChangeRate <= 6) | |
314 { | |
315 if(i == 2) | |
316 { | |
317 startZeroLine.y = start.y; | |
318 stop.x = start.x - 34; | |
319 } | |
320 } | |
321 else | |
322 { | |
323 if(((i == 1) && depthChangeAscent) || ((i == 3) && !depthChangeAscent)) | |
324 { | |
325 startZeroLine.y = start.y; | |
326 stop.x = start.x - 34; | |
327 } | |
328 } | |
329 GFX_draw_line(tXscreen, start, stop, 0); | |
330 } | |
331 // new thick bar design Sept. 2015 | |
332 if((stateUsed->lifeData.ascent_rate_meter_per_min > 4) || (stateUsed->lifeData.ascent_rate_meter_per_min < -4)) | |
333 { | |
334 start.y = startZeroLine.y; | |
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 } | |
413 | 351 if(!pSettings->FlipDisplay) |
352 { | |
353 start.x = tXl1->WindowX1 - 3 - 5; | |
354 } | |
355 else | |
356 { | |
357 start.x = tXr1->WindowX1 - 3 - 5; | |
358 } | |
359 | |
360 stop.x = start.x; | |
38 | 361 GFX_draw_thick_line(12,tXscreen, start, stop, color); |
362 } | |
363 } | |
364 else | |
365 { | |
366 /* ascentrate graph -standard mode */ | |
367 if(stateUsed->lifeData.ascent_rate_meter_per_min > 0) | |
368 { | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
369 if(!pSettings->FlipDisplay) |
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 start.y = tXl1->WindowY0 - 1; |
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 else |
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.y = tXl1->WindowY1 + 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 |
38 | 378 for(int i = 0; i<4;i++) |
379 { | |
380 start.y += 5*8; | |
381 stop.y = start.y; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
382 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
383 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
384 start.x = tXl1->WindowX1 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
385 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
386 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
387 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
388 start.x = tXr1->WindowX1 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
389 } |
38 | 390 stop.x = start.x - 17; |
391 GFX_draw_line(tXscreen, start, stop, 0); | |
392 } | |
393 // new thick bar design Sept. 2015 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
394 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
395 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
396 start.x = tXl1->WindowX1 - 3 - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
397 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
398 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
399 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
400 start.x = tXr1->WindowX1 - 3 - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
401 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
402 |
38 | 403 stop.x = start.x; |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
404 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
405 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
406 start.y = tXl1->WindowY0 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
407 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
408 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
409 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
410 start.y = tXl1->WindowY1 + 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
411 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
412 |
38 | 413 stop.y = start.y + (uint16_t)(stateUsed->lifeData.ascent_rate_meter_per_min * 8); |
414 stop.y -= 3; // wegen der Liniendicke von 12 anstelle von 9 | |
415 if(stop.y >= 470) | |
416 stop.y = 470; | |
417 start.y += 7; // starte etwas weiter oben | |
418 if(stateUsed->lifeData.ascent_rate_meter_per_min <= 10) | |
419 color = CLUT_EverythingOkayGreen; | |
420 else | |
421 if(stateUsed->lifeData.ascent_rate_meter_per_min <= 15) | |
422 color = CLUT_WarningYellow; | |
423 else | |
424 color = CLUT_WarningRed; | |
425 | |
426 GFX_draw_thick_line(12,tXscreen, start, stop, color); | |
427 } | |
428 } | |
429 | |
430 // divetime | |
431 if(mode == DIVEMODE_Apnea) | |
432 { | |
433 if(stateUsed->lifeData.counterSecondsShallowDepth) | |
434 { | |
435 SDivetime SurfaceBreakTime = {0,0,0,0}; | |
436 | |
437 SurfaceBreakTime.Total = stateUsed->lifeData.counterSecondsShallowDepth; | |
438 SurfaceBreakTime.Minutes = SurfaceBreakTime.Total / 60; | |
439 SurfaceBreakTime.Seconds = SurfaceBreakTime.Total - (SurfaceBreakTime.Minutes * 60); | |
440 | |
441 snprintf(text,TEXTSIZE,"\032\f\002%c%c", TXT_2BYTE,TXT2BYTE_ApneaSurface); | |
442 GFX_write_string(&FontT42,tXr1,text,0); | |
443 | |
444 snprintf(text,TEXTSIZE,"\020\003\016\002%u:%02u",SurfaceBreakTime.Minutes, SurfaceBreakTime.Seconds); | |
445 } | |
446 else | |
447 { | |
448 Divetime.Total = stateUsed->lifeData.dive_time_seconds; | |
449 Divetime.Minutes = Divetime.Total / 60; | |
450 Divetime.Seconds = Divetime.Total - ( Divetime.Minutes * 60 ); | |
451 | |
452 snprintf(text,TEXTSIZE,"\032\f\002%c",TXT_Divetime); | |
453 GFX_write_string(&FontT42,tXr1,text,0); | |
454 | |
455 if(Divetime.Minutes < 100) | |
456 snprintf(text,TEXTSIZE,"\020\003\016\002%u:%02u",Divetime.Minutes, Divetime.Seconds); | |
457 else | |
458 snprintf(text,TEXTSIZE,"\020\003\016\002%u'",Divetime.Minutes); | |
459 } | |
518 | 460 t3_basics_colorscheme_mod(text); |
461 GFX_write_string(&FontT105,tXr1,text,1); | |
38 | 462 } |
463 else | |
464 { | |
518 | 465 switch(get_globalState()) |
466 { | |
467 case StDBEAR: snprintf(text,TEXTSIZE,"\a\003\001%c%c", TXT_2BYTE, TXT2BYTE_DiveBearingQ); | |
468 GFX_write_string_color(&FontT42,tXr1,text,1,CLUT_WarningYellow); | |
469 break; | |
470 case StDRAVG: snprintf(text,TEXTSIZE,"\a\003\001%c%c", TXT_2BYTE, TXT2BYTE_DiveResetAvgQ); | |
471 GFX_write_string_color(&FontT42,tXr1,text,1,CLUT_WarningYellow); | |
472 break; | |
38 | 473 |
518 | 474 case StDMGAS: |
475 textPointer = 0; | |
476 text[textPointer++] = '\a'; | |
477 text[textPointer++] = '\001'; | |
478 text[textPointer++] = ' '; | |
479 textPointer += tHome_gas_writer(stateUsed->diveSettings.gas[actualBetterGasId()].oxygen_percentage,stateUsed->diveSettings.gas[actualBetterGasId()].helium_percentage,&text[textPointer]); | |
480 text[textPointer++] = '?'; | |
481 text[textPointer++] = ' '; | |
482 text[textPointer++] = 0; | |
483 GFX_write_string_color(&FontT42,tXr1,text,1,CLUT_WarningYellow); | |
484 break; | |
485 default: /* show divetime */ | |
38 | 486 |
518 | 487 Divetime.Total = stateUsed->lifeData.dive_time_seconds_without_surface_time; |
488 Divetime.Minutes = Divetime.Total / 60; | |
489 Divetime.Seconds = Divetime.Total - ( Divetime.Minutes * 60 ); | |
490 | |
491 snprintf(text,TEXTSIZE,"\032\f\002%c",TXT_Divetime); | |
492 GFX_write_string(&FontT42,tXr1,text,0); | |
493 | |
494 if(Divetime.Minutes < 100) | |
495 snprintf(text,TEXTSIZE,"\020\003\016\002%u:%02u",Divetime.Minutes, Divetime.Seconds); | |
496 else | |
497 snprintf(text,TEXTSIZE,"\020\003\016\002%u'",Divetime.Minutes); | |
498 | |
499 t3_basics_colorscheme_mod(text); | |
500 GFX_write_string(&FontT105,tXr1,text,1); | |
501 break; | |
502 } | |
38 | 503 } |
504 | |
505 return depth; | |
506 } | |
507 | |
508 | |
509 void t3_refresh_divemode(void) | |
510 { | |
511 uint8_t customview_warnings = 0; | |
512 float depth_meter = 0.0; | |
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
513 |
38 | 514 // everything like lines, depth, ascent graph and divetime |
515 depth_meter = t3_basics_lines_depth_and_divetime(&t3screen, &t3l1, &t3r1, 0); // 0 could be stateUsed->diveSettings.diveMode for CCR specials | |
516 | |
517 // customview | |
518 if(stateUsed->warnings.numWarnings) | |
519 customview_warnings = t3_test_customview_warnings(); | |
520 | |
521 if(customview_warnings && warning_count_high_time) | |
522 t3_basics_show_customview_warnings(&t3c1); | |
523 else | |
524 t3_refresh_customview(depth_meter); | |
525 | |
526 if(stateUsed->warnings.lowBattery) | |
496 | 527 t3_basics_battery_low_customview_extra(&t3r1); //t3c1); |
38 | 528 } |
529 | |
530 | |
531 void t3_basics_battery_low_customview_extra(GFX_DrawCfgWindow* tXc1) | |
532 { | |
533 char TextC1[256]; | |
534 | |
496 | 535 TextC1[0] = ' ';//'\002'; |
38 | 536 TextC1[1] = '\f'; |
537 TextC1[2] = '\025'; | |
538 TextC1[3] = '3'; | |
539 TextC1[4] = '1'; | |
540 TextC1[5] = '1'; | |
541 TextC1[6] = '1'; | |
542 TextC1[7] = '1'; | |
543 TextC1[8] = '1'; | |
544 TextC1[9] = '1'; | |
545 TextC1[10] = '1'; | |
546 TextC1[11] = '1'; | |
547 TextC1[12] = '1'; | |
548 TextC1[13] = '1'; | |
549 TextC1[14] = '0'; | |
550 TextC1[15] = 0; | |
551 | |
552 if(!warning_count_high_time) | |
553 TextC1[4] = '2'; | |
554 | |
555 GFX_write_string(&Batt24,tXc1,TextC1,0); | |
556 } | |
557 | |
558 | |
559 | |
560 void t3_refresh_customview(float depth) | |
561 { | |
272
74a8296a2318
cleanup: simplify stateUsed usage
Jan Mulder <jlmulder@xs4all.nl>
parents:
237
diff
changeset
|
562 t3_basics_refresh_customview(depth, t3_selection_customview, &t3screen, &t3c1, &t3c2, stateUsedWrite->diveSettings.diveMode); |
38 | 563 } |
564 | |
565 | |
566 void t3_basics_refresh_apnoeRight(float depth, uint8_t tX_selection_customview, GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXc1, GFX_DrawCfgWindow* tXc2, uint8_t mode) | |
567 { | |
568 char text[512]; | |
569 uint16_t textpointer = 0; | |
570 | |
571 // CVIEW_T3_Temperature | |
572 float temperature; | |
413 | 573 SSettings* pSettings; |
574 pSettings = settingsGetPointer(); | |
38 | 575 |
576 SDivetime TotalDivetime = {0,0,0,0}; | |
577 SDivetime LastDivetime = {0,0,0,0}; | |
578 | |
579 uint16_t tempWinX0; | |
413 | 580 uint16_t tempWinX1; |
38 | 581 uint16_t tempWinY0; |
413 | 582 uint16_t tempWinY1; |
38 | 583 |
584 tempWinX0 = tXc1->WindowX0; | |
413 | 585 tempWinX1 = tXc1->WindowX1; |
38 | 586 tempWinY0 = tXc1->WindowY0; |
413 | 587 tempWinY1 = tXc1->WindowY1; |
38 | 588 |
589 tXc1->WindowX0 = 440; // rechte Seite | |
590 | |
591 switch(tX_selection_customview) | |
592 { | |
593 case CVIEW_T3_Temperature: | |
594 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Temperature); | |
595 GFX_write_string(&FontT42,tXc1,text,0); | |
596 | |
189
8b8074080d7b
Bugfix: average temperature on arrival from RTE instead of display time
Jan Mulder <jlmulder@xs4all.nl>
parents:
174
diff
changeset
|
597 temperature = unit_temperature_float(stateUsed->lifeData.temperature_celsius); |
38 | 598 textpointer = snprintf(text,TEXTSIZE,"\020\003\016%01.0f\016\016\140",temperature); // "\016\016%01.1f `" + C or F |
599 if(settingsGetPointer()->nonMetricalSystem == 0) | |
600 text[textpointer++] = 'C'; | |
601 else | |
602 text[textpointer++] = 'F'; | |
603 text[textpointer++] = 0; | |
604 t3_basics_colorscheme_mod(text); | |
605 GFX_write_string(&FontT105,tXc1,text,1); | |
606 break; | |
607 | |
608 case CVIEW_T3_ApnoeSurfaceInfo: | |
609 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Divetime); | |
610 GFX_write_string(&FontT42,tXc1,text,0); | |
611 | |
612 TotalDivetime.Total = stateUsed->lifeData.dive_time_seconds_without_surface_time; | |
613 TotalDivetime.Minutes = TotalDivetime.Total / 60; | |
614 TotalDivetime.Seconds = TotalDivetime.Total - ( TotalDivetime.Minutes * 60 ); | |
615 | |
616 LastDivetime.Total = stateUsed->lifeData.apnea_last_dive_time_seconds; | |
617 LastDivetime.Minutes = LastDivetime.Total / 60; | |
618 LastDivetime.Seconds = LastDivetime.Total - ( LastDivetime.Minutes * 60 ); | |
619 | |
413 | 620 // tXc1->WindowY0 = 100; // obere Zeile |
621 if(!pSettings->FlipDisplay) | |
622 { | |
623 tXc1->WindowY0 = 100; | |
624 } | |
625 else | |
626 { | |
627 tXc1->WindowY1 -= 100; /* jump to upper of two lines */ | |
628 } | |
38 | 629 |
630 snprintf(text,TEXTSIZE,"\020\016%u:%02u",LastDivetime.Minutes, LastDivetime.Seconds); | |
631 t3_basics_colorscheme_mod(text); | |
632 GFX_write_string(&FontT105,tXc1,text,0); | |
633 | |
413 | 634 if(pSettings->FlipDisplay) |
635 { | |
636 tXc1->WindowX0 = 0; | |
637 | |
638 } | |
38 | 639 snprintf(text,TEXTSIZE,"\032\002%c%c",TXT_2BYTE, TXT2BYTE_ApneaLast); |
640 GFX_write_string(&FontT42,tXc1,text,0); | |
641 | |
413 | 642 if(!pSettings->FlipDisplay) |
643 { | |
644 tXc1->WindowY0 = tempWinY0; | |
645 } | |
646 else | |
647 { | |
648 tXc1->WindowX1 = tempWinX1; | |
649 tXc1->WindowY1 = tempWinY1; /* jump to upper of two lines */ | |
650 } | |
38 | 651 |
652 snprintf(text,TEXTSIZE,"\020\016%u:%02u",TotalDivetime.Minutes, TotalDivetime.Seconds); | |
653 t3_basics_colorscheme_mod(text); | |
654 GFX_write_string(&FontT105,tXc1,text,0); | |
655 | |
656 snprintf(text,TEXTSIZE,"\032\002%c%c",TXT_2BYTE, TXT2BYTE_ApneaTotal); | |
413 | 657 if(pSettings->FlipDisplay) |
658 { | |
659 tXc1->WindowX0 = 0; | |
660 | |
661 } | |
38 | 662 GFX_write_string(&FontT42,tXc1,text,0); |
663 break; | |
664 } | |
665 | |
666 tXc1->WindowX0 = tempWinX0; | |
413 | 667 tXc1->WindowX1 = tempWinX1; |
38 | 668 tXc1->WindowY0 = tempWinY0; |
669 | |
670 } | |
671 | |
672 | |
673 void t3_basics_refresh_customview(float depth, uint8_t tX_selection_customview, GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXc1, GFX_DrawCfgWindow* tXc2, uint8_t mode) | |
674 { | |
675 char text[512]; | |
676 uint16_t textpointer = 0; | |
677 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
678 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
679 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
680 |
38 | 681 // CVIEW_T3_Decostop and CVIEW_T3_TTS |
682 const SDecoinfo * pDecoinfo; | |
683 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE) | |
684 pDecoinfo = &stateUsed->decolistBuehlmann; | |
685 else | |
686 pDecoinfo = &stateUsed->decolistVPM; | |
687 | |
688 // CVIEW_T3_Decostop | |
689 uint16_t nextstopLengthSeconds = 0; | |
690 uint8_t nextstopDepthMeter = 0; | |
691 SDivetime SafetyStopTime = {0,0,0,0}; | |
692 | |
693 // CVIEW_T3_ppO2andGas | |
694 uint8_t oxygen_percentage = 0; | |
695 | |
696 // CVIEW_T3_Temperature | |
697 float temperature; | |
698 | |
699 // CVIEW_T3_GasList | |
700 float fPpO2limitHigh, fPpO2limitLow, fPpO2ofGasAtThisDepth; | |
701 const SGasLine * pGasLine; | |
702 uint8_t oxygen, helium; | |
703 uint8_t lineNumber; | |
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
704 uint8_t gasPosIdx; |
38 | 705 |
496 | 706 /* compass position */ |
707 point_t center; | |
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
708 uint16_t heading; |
496 | 709 |
38 | 710 // CVIEW_T3_StopWatch |
711 SDivetime Stopwatch = {0,0,0,0}; | |
712 float fAverageDepth, fAverageDepthAbsolute; | |
713 | |
714 uint16_t tempWinX0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
715 uint16_t tempWinX1; |
38 | 716 uint16_t tempWinY0; |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
717 uint16_t tempWinY1; |
38 | 718 uint16_t tempWinC2X0; |
413 | 719 uint16_t tempWinC2Y0; |
720 uint16_t tempWinC2X1; | |
721 uint16_t tempWinC2Y1; | |
38 | 722 uint16_t tempWinC2Tab; |
723 | |
724 tempWinX0 = tXc1->WindowX0; | |
725 tempWinY0 = tXc1->WindowY0; | |
496 | 726 tempWinX1 = tXc1->WindowX1; |
727 tempWinY1 = tXc1->WindowY1; | |
413 | 728 |
38 | 729 tempWinC2X0 = tXc2->WindowX0; |
413 | 730 tempWinC2Y0 = tXc2->WindowY0; |
731 tempWinC2X1 = tXc2->WindowX1; | |
732 tempWinC2Y1 = tXc2->WindowY1; | |
38 | 733 tempWinC2Tab = tXc2->WindowTab; |
734 | |
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
735 if(settingsGetPointer()->compassInertia) |
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
736 { |
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
737 heading = (uint16_t)compass_getCompensated(); |
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
738 } |
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
739 else |
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
740 { |
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
741 heading = (uint16_t)stateUsed->lifeData.compass_heading; |
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
742 } |
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
743 |
38 | 744 switch(tX_selection_customview) |
745 { | |
746 case CVIEW_T3_ApnoeSurfaceInfo: | |
747 snprintf(text,TEXTSIZE,"\032\f%c",TXT_MaxDepth); | |
748 | |
413 | 749 if(!pSettings->FlipDisplay) |
750 { | |
751 GFX_write_string(&FontT42,tXc1,text,0); | |
752 tXc1->WindowY0 = 100; | |
753 } | |
754 else | |
755 { | |
756 GFX_write_string(&FontT42,tXc2,text,0); | |
757 tXc2->WindowY1 -= 100; /* jump to upper of two lines */ | |
758 } | |
38 | 759 |
760 snprintf(text,TEXTSIZE,"\020\016%01.1f",unit_depth_float(stateUsed->lifeData.apnea_last_max_depth_meter)); | |
761 t3_basics_colorscheme_mod(text); | |
413 | 762 |
763 if(!pSettings->FlipDisplay) | |
764 { | |
765 GFX_write_string(&FontT105,tXc1,text,0); | |
766 tXc1->WindowY0 = tempWinY0; | |
767 } | |
768 else | |
769 { | |
770 GFX_write_string(&FontT105,tXc2,text,0); | |
771 tXc2->WindowY1 = tempWinC2Y1; /* jump to upper of two lines */ | |
772 } | |
38 | 773 |
774 | |
775 snprintf(text,TEXTSIZE,"\020\016%01.1f",unit_depth_float(stateUsed->lifeData.apnea_total_max_depth_meter)); | |
776 t3_basics_colorscheme_mod(text); | |
413 | 777 if(!pSettings->FlipDisplay) |
778 { | |
779 GFX_write_string(&FontT105,tXc1,text,0); | |
780 } | |
781 else | |
782 { | |
783 GFX_write_string(&FontT105,tXc2,text,0); | |
784 } | |
38 | 785 break; |
786 | |
787 case CVIEW_T3_StopWatch: | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
788 |
38 | 789 Stopwatch.Total = timer_Stopwatch_GetTime(); |
790 Stopwatch.Minutes = Stopwatch.Total / 60; | |
791 Stopwatch.Seconds = Stopwatch.Total - ( Stopwatch.Minutes * 60 ); | |
792 fAverageDepth = timer_Stopwatch_GetAvarageDepth_Meter(); | |
793 fAverageDepthAbsolute = stateUsed->lifeData.average_depth_meter; | |
794 | |
795 snprintf(text,TEXTSIZE,"\032\f%c",TXT_AvgDepth); | |
796 GFX_write_string(&FontT42,tXc1,text,0); | |
797 snprintf(text,TEXTSIZE,"\030\003\016%01.1f",unit_depth_float(fAverageDepthAbsolute)); | |
798 GFX_write_string(&FontT105,tXc1,text,0); | |
799 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
800 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
801 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
802 tXc1->WindowX0 = 480; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
803 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
804 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
805 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
806 tXc1->WindowX1 = 320; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
807 tXc1->WindowY0 = t3c1.WindowY0; /* select customer window */ |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
808 } |
38 | 809 // 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
|
810 |
38 | 811 snprintf(text,TEXTSIZE,"\032\f%c", TXT_Stopwatch); |
812 GFX_write_string(&FontT42,tXc1,text,0); | |
813 snprintf(text,TEXTSIZE,"\030\016%01.1f",unit_depth_float(fAverageDepth)); | |
814 GFX_write_string(&FontT105,tXc1,text,0); | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
815 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
816 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
817 tXc1->WindowY0 = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
818 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
819 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
820 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
821 tXc1->WindowY1 -= 100; /* jump to upper of two lines */ |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
822 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
823 |
38 | 824 snprintf(text,TEXTSIZE,"\030%u:\016\016%02u",Stopwatch.Minutes, Stopwatch.Seconds); |
825 GFX_write_string(&FontT105,tXc1,text,0); | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
826 |
496 | 827 break; |
38 | 828 |
829 case CVIEW_T3_GasList: | |
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
830 gasPosIdx = 0; |
38 | 831 snprintf(text,TEXTSIZE,"\032\f%c%c",TXT_2BYTE, TXT2BYTE_Gaslist); |
832 GFX_write_string(&FontT42,tXc1,text,0); | |
833 | |
834 textpointer = 0; | |
835 tXc2->WindowX0 = 0; | |
518 | 836 tXc2->WindowTab = 800/3; // /2 |
38 | 837 |
413 | 838 if(pSettings->FlipDisplay) |
839 { | |
840 tXc2->WindowY1 = 0; | |
841 } | |
842 | |
38 | 843 pGasLine = settingsGetPointer()->gas; |
844 if(actualLeftMaxDepth(stateUsed)) | |
845 fPpO2limitHigh = (float)(settingsGetPointer()->ppO2_max_deco) / 100; | |
846 else | |
847 fPpO2limitHigh = (float)(settingsGetPointer()->ppO2_max_std) / 100; | |
848 fPpO2limitLow = (float)(settingsGetPointer()->ppO2_min) / 100; | |
849 for(int gasId=1;gasId<=NUM_GASES;gasId++) | |
850 { | |
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
851 #ifdef ENABLE_UNUSED_GAS_HIDING |
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
852 if(!pGasLine[gasId].note.ub.off) |
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
853 { |
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
854 #endif |
38 | 855 textpointer = 0; |
518 | 856 text[textpointer++] = '\003'; |
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
857 |
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
858 lineNumber = 1; |
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
859 |
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
860 switch(gasPosIdx) |
38 | 861 { |
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
862 case 0: lineNumber = 0; |
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
863 case 1: |
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
864 break; |
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
865 case 4: text[textpointer++] = '\001'; /* display centered */ |
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
866 break; |
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
867 case 2: lineNumber = 0; |
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
868 case 3: text[textpointer++] = '\002'; /* display right aligned */ |
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
869 default: |
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
870 break; |
38 | 871 } |
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
872 gasPosIdx++; |
518 | 873 |
38 | 874 fPpO2ofGasAtThisDepth = (stateUsed->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * pGasLine[gasId].oxygen_percentage / 100; |
875 if(pGasLine[gasId].note.ub.active == 0) | |
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
876 strcpy(&text[textpointer++],"\031"); |
518 | 877 else if(stateUsed->lifeData.actualGas.GasIdInSettings == gasId) /* actual selected gas */ |
878 { | |
879 strcpy(&text[textpointer++],"\030"); | |
880 } | |
38 | 881 else if((fPpO2ofGasAtThisDepth > fPpO2limitHigh) || (fPpO2ofGasAtThisDepth < fPpO2limitLow)) |
882 strcpy(&text[textpointer++],"\025"); | |
518 | 883 else if(actualBetterGasId() == gasId) |
884 { | |
885 strcpy(&text[textpointer++],"\026"); /* Highlight better gas */ | |
886 } | |
38 | 887 else |
518 | 888 strcpy(&text[textpointer++],"\023"); /* Blue for travel or deco without special state */ |
38 | 889 |
890 text[textpointer++] = ' '; | |
891 oxygen = pGasLine[gasId].oxygen_percentage; | |
892 helium = pGasLine[gasId].helium_percentage; | |
893 textpointer += write_gas(&text[textpointer], oxygen, helium); | |
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
894 |
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
895 if((pGasLine[gasId].depth_meter) && (gasPosIdx < 5)) /* do not show for potential last gas because of formating issues */ |
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
896 { |
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
897 textpointer += snprintf(&text[textpointer],7,"\016\016%u%c%c",unit_depth_integer(pGasLine[gasId].depth_meter), unit_depth_char1(), unit_depth_char2()); |
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
898 } |
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
899 text[textpointer++] = 0; |
518 | 900 GFX_write_string(&FontT42, tXc1, text, lineNumber); |
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
901 #ifdef ENABLE_UNUSED_GAS_HIDING |
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
902 } |
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
903 #endif |
38 | 904 } |
905 break; | |
906 | |
907 case CVIEW_T3_Temperature: | |
908 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Temperature); | |
909 GFX_write_string(&FontT42,tXc1,text,0); | |
189
8b8074080d7b
Bugfix: average temperature on arrival from RTE instead of display time
Jan Mulder <jlmulder@xs4all.nl>
parents:
174
diff
changeset
|
910 |
8b8074080d7b
Bugfix: average temperature on arrival from RTE instead of display time
Jan Mulder <jlmulder@xs4all.nl>
parents:
174
diff
changeset
|
911 temperature = unit_temperature_float(stateUsed->lifeData.temperature_celsius); |
38 | 912 textpointer = snprintf(text,TEXTSIZE,"\030\003\016%01.1f \140",temperature); // "\016\016%01.1f `" + C or F |
913 if(settingsGetPointer()->nonMetricalSystem == 0) | |
914 text[textpointer++] = 'C'; | |
915 else | |
916 text[textpointer++] = 'F'; | |
917 text[textpointer++] = 0; | |
918 GFX_write_string(&FontT105,tXc1,text,0); | |
919 break; | |
920 | |
921 case CVIEW_Compass: | |
496 | 922 center.x = 600; |
923 center.y = 116; | |
38 | 924 snprintf(text,TEXTSIZE,"\032\f%c%c",TXT_2BYTE, TXT2BYTE_Compass); |
925 GFX_write_string(&FontT42,tXc1,text,0); | |
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
926 snprintf(text,100,"\030\003%03i`",heading); |
38 | 927 GFX_write_string(&FontT105,tXc1,text,0); |
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
928 t3_basics_compass(tXscreen, center, heading, stateUsed->diveSettings.compassHeading); |
38 | 929 break; |
930 | |
931 case CVIEW_T3_Decostop: | |
932 default: | |
933 // decostop | |
934 if(pDecoinfo->output_time_to_surface_seconds) | |
935 { | |
936 tHome_findNextStop(pDecoinfo->output_stop_length_seconds, &nextstopDepthMeter, &nextstopLengthSeconds); | |
937 } | |
938 else | |
939 { | |
940 nextstopDepthMeter = 0; | |
941 nextstopLengthSeconds = 0; | |
942 } | |
943 | |
944 SafetyStopTime.Total = timer_Safetystop_GetCountDown(); | |
945 SafetyStopTime.Minutes = SafetyStopTime.Total / 60; | |
946 SafetyStopTime.Seconds = SafetyStopTime.Total - (SafetyStopTime.Minutes * 60); | |
947 | |
948 if(nextstopDepthMeter) | |
949 { | |
950 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Decostop); | |
951 GFX_write_string(&FontT42,tXc1,text,0); | |
952 | |
953 textpointer = 0; | |
954 snprintf(&text[textpointer],TEXTSIZE,"\020\003%u%c%c %u'" | |
955 , unit_depth_integer(nextstopDepthMeter) | |
956 , unit_depth_char1_T105() | |
957 , unit_depth_char2_T105() | |
958 , (nextstopLengthSeconds+59)/60); | |
959 // old without feet hw 170703 snprintf(&text[textpointer],TEXTSIZE,"\020\003%um %u'",nextstopDepthMeter,(nextstopLengthSeconds+59)/60); | |
960 t3_basics_colorscheme_mod(text); | |
496 | 961 GFX_write_string(&FontT105,tXc1,text,0); |
38 | 962 } |
963 else if(SafetyStopTime.Total && (depth > timer_Safetystop_GetDepthUpperLimit())) | |
964 { | |
965 textpointer = 0; | |
966 snprintf(&text[textpointer],TEXTSIZE,"\032\f%c%c",TXT_2BYTE,TXT2BYTE_SafetyStop2); | |
967 GFX_write_string(&FontT42,tXc1,text,0); | |
968 | |
969 textpointer = 0; | |
970 snprintf(&text[textpointer],TEXTSIZE,"\020\003\016%u:%02u",SafetyStopTime.Minutes,SafetyStopTime.Seconds); | |
971 t3_basics_colorscheme_mod(text); | |
496 | 972 GFX_write_string(&FontT105,tXc1,text,0); |
38 | 973 } |
237
ec16fd26e280
Bugfix: do not show NDL in bigscreen mode when zero
Jan Mulder <jlmulder@xs4all.nl>
parents:
214
diff
changeset
|
974 else if(pDecoinfo->output_ndl_seconds) // NDL |
38 | 975 { |
976 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Nullzeit); | |
977 GFX_write_string(&FontT42,tXc1,text,0); | |
978 if(pDecoinfo->output_ndl_seconds < 1000 * 60) | |
979 snprintf(text,TEXTSIZE,"\020\003%i'",pDecoinfo->output_ndl_seconds/60); | |
980 else | |
981 snprintf(text,TEXTSIZE,"\020\003%ih",pDecoinfo->output_ndl_seconds/3600); | |
982 t3_basics_colorscheme_mod(text); | |
496 | 983 GFX_write_string(&FontT105,tXc1,text,0); |
38 | 984 } |
985 break; | |
986 | |
987 case CVIEW_sensors: | |
988 snprintf(text,TEXTSIZE,"\032\f%c%c",TXT_2BYTE,TXT2BYTE_O2monitor); | |
989 GFX_write_string(&FontT42,tXc1,text,0); | |
990 | |
991 for(int i=0;i<3;i++) | |
992 { | |
993 textpointer = 0; | |
994 text[textpointer++] = '\030'; | |
995 if(i==1) | |
996 text[textpointer++] = '\001'; | |
997 else if(i==2) | |
998 text[textpointer++] = '\002'; | |
999 if(stateUsed->diveSettings.ppo2sensors_deactivated & (1<<i)) | |
1000 { | |
1001 text[textpointer++] = '\031'; | |
1002 text[textpointer++] = ' '; | |
1003 text[textpointer++] = '-'; | |
1004 text[textpointer++] = ' '; | |
1005 } | |
1006 else | |
1007 { | |
1008 if(stateUsed->warnings.sensorOutOfBounds[i]) | |
1009 text[textpointer++] = '\025'; | |
1010 textpointer += snprintf(&text[textpointer],TEXTSIZE,"%.1f",stateUsed->lifeData.ppO2Sensor_bar[i]); | |
1011 } | |
496 | 1012 GFX_write_string(&FontT144,tXc1,text,0); |
38 | 1013 } |
1014 break; | |
1015 | |
1016 case CVIEW_T3_MaxDepth: | |
1017 snprintf(text,TEXTSIZE,"\032\f%c",TXT_MaxDepth); | |
413 | 1018 if(pSettings->FlipDisplay) |
1019 { | |
1020 if(mode == DIVEMODE_Apnea) | |
1021 { | |
1022 GFX_write_string(&FontT42,tXc2,text,0); | |
1023 } | |
1024 else | |
1025 { | |
1026 GFX_write_string(&FontT42,tXc1,text,0); | |
1027 } | |
1028 } | |
1029 else | |
1030 { | |
1031 GFX_write_string(&FontT42,tXc1,text,0); | |
1032 } | |
38 | 1033 snprintf(text,TEXTSIZE,"\020\003\016%01.1f",unit_depth_float(stateUsed->lifeData.max_depth_meter)); |
1034 t3_basics_colorscheme_mod(text); | |
413 | 1035 if(pSettings->FlipDisplay) |
1036 { | |
1037 if(mode == DIVEMODE_Apnea) | |
1038 { | |
1039 GFX_write_string(&FontT105,tXc2,text,0); | |
1040 } | |
1041 else | |
1042 { | |
1043 GFX_write_string(&FontT105,tXc1,text,0); | |
1044 } | |
1045 } | |
1046 else | |
1047 { | |
496 | 1048 GFX_write_string(&FontT105,tXc1,text,0); |
413 | 1049 } |
38 | 1050 break; |
1051 | |
1052 case CVIEW_T3_TTS: | |
1053 snprintf(text,TEXTSIZE,"\032\f%c",TXT_TTS); | |
1054 GFX_write_string(&FontT42,tXc1,text,0); | |
1055 if(pDecoinfo->output_time_to_surface_seconds) | |
1056 { | |
1057 if(pDecoinfo->output_time_to_surface_seconds < 1000 * 60) | |
214
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1058 snprintf(text,TEXTSIZE,"\020\003\002%i'",(pDecoinfo->output_time_to_surface_seconds + 59)/ 60); |
38 | 1059 else |
214
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1060 snprintf(text,TEXTSIZE,"\020\003\002%ih",(pDecoinfo->output_time_to_surface_seconds + 59)/ 3600); |
38 | 1061 t3_basics_colorscheme_mod(text); |
496 | 1062 GFX_write_string(&FontT105,tXc1,text,0); |
38 | 1063 } |
1064 break; | |
1065 | |
1066 case CVIEW_T3_ppO2andGas: | |
1067 snprintf(text,TEXTSIZE,"\032\f%c",TXT_ppO2); | |
1068 GFX_write_string(&FontT42,tXc1,text,0); | |
1069 snprintf(text,TEXTSIZE,"\020\003%01.2f",stateUsed->lifeData.ppO2); | |
1070 t3_basics_colorscheme_mod(text); | |
496 | 1071 GFX_write_string(&FontT105,tXc1,text,0); |
38 | 1072 |
1073 textpointer = 0; | |
1074 text[textpointer++] = '\020'; | |
1075 text[textpointer++] = '\003'; | |
1076 oxygen_percentage = 100; | |
1077 oxygen_percentage -= stateUsed->lifeData.actualGas.nitrogen_percentage; | |
1078 oxygen_percentage -= stateUsed->lifeData.actualGas.helium_percentage; | |
1079 text[textpointer++] = '\002'; | |
1080 tHome_gas_writer(oxygen_percentage,stateUsed->lifeData.actualGas.helium_percentage,&text[textpointer]); | |
1081 //textpointer = snprintf(&text[textpointer],TEXTSIZE,"\020\002%02u/%02u",oxygen_percentage, stateUsed->lifeData.actualGas.helium_percentage); | |
1082 t3_basics_colorscheme_mod(text); | |
496 | 1083 GFX_write_string(&FontT48,tXc1,text,0); |
38 | 1084 break; |
496 | 1085 |
1086 case CVIEW_T3_Navigation: | |
1087 Stopwatch.Total = timer_Stopwatch_GetTime(); | |
1088 Stopwatch.Minutes = Stopwatch.Total / 60; | |
1089 Stopwatch.Seconds = Stopwatch.Total - ( Stopwatch.Minutes * 60 ); | |
1090 fAverageDepth = timer_Stopwatch_GetAvarageDepth_Meter(); | |
1091 | |
1092 if(!pSettings->FlipDisplay) | |
1093 { | |
1094 tXc2->WindowX0 = 550; | |
1095 } | |
1096 else | |
1097 { | |
1098 tXc2->WindowX1 = 800; | |
1099 tXc2->WindowY0 = t3c2.WindowY0; /* select customer window */ | |
1100 } | |
1101 | |
1102 snprintf(text,TEXTSIZE,"\032\002\f%c", TXT_Stopwatch); | |
511 | 1103 GFX_write_string(&FontT42,tXc1,text,0); |
496 | 1104 snprintf(text,TEXTSIZE,"\030\016\002%01.1f",unit_depth_float(fAverageDepth)); |
511 | 1105 GFX_write_string(&FontT105,tXc1,text,0); |
496 | 1106 if(!pSettings->FlipDisplay) |
1107 { | |
1108 tXc2->WindowY0 = 100; | |
1109 } | |
1110 else | |
1111 { | |
1112 tXc2->WindowY1 -= 100; /* jump to upper of two lines */ | |
1113 } | |
1114 | |
1115 snprintf(text,TEXTSIZE,"\030\002%u:\016\016%02u",Stopwatch.Minutes, Stopwatch.Seconds); | |
511 | 1116 GFX_write_string(&FontT105,tXc1,text,1); |
496 | 1117 |
1118 | |
1119 center.x = 400; | |
1120 center.y = 116; | |
1121 | |
1122 snprintf(text,TEXTSIZE,"\032\f%c%c",TXT_2BYTE, TXT2BYTE_Compass); | |
1123 GFX_write_string(&FontT42,tXc1,text,0); | |
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
1124 snprintf(text,100,"\030%03i`",heading); |
496 | 1125 GFX_write_string(&FontT144,tXc1,text,0); |
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
1126 t3_basics_compass(tXscreen, center, heading, stateUsed->diveSettings.compassHeading); |
496 | 1127 |
1128 break; | |
1129 | |
1130 case CVIEW_T3_DepthData: | |
1131 snprintf(text,TEXTSIZE,"\032\f%c",TXT_MaxDepth); | |
1132 if(pSettings->FlipDisplay) | |
1133 { | |
1134 if(mode == DIVEMODE_Apnea) | |
1135 { | |
1136 GFX_write_string(&FontT42,tXc2,text,0); | |
1137 } | |
1138 else | |
1139 { | |
1140 GFX_write_string(&FontT42,tXc1,text,0); | |
1141 } | |
1142 } | |
1143 else | |
1144 { | |
1145 GFX_write_string(&FontT42,tXc1,text,0); | |
1146 } | |
1147 snprintf(text,TEXTSIZE,"\020\003\016%01.1f",unit_depth_float(stateUsed->lifeData.max_depth_meter)); | |
1148 t3_basics_colorscheme_mod(text); | |
1149 if(pSettings->FlipDisplay) | |
1150 { | |
1151 if(mode == DIVEMODE_Apnea) | |
1152 { | |
1153 GFX_write_string(&FontT105,tXc2,text,0); | |
1154 } | |
1155 else | |
1156 { | |
1157 GFX_write_string(&FontT105,tXc1,text,0); | |
1158 } | |
1159 } | |
1160 else | |
1161 { | |
1162 GFX_write_string(&FontT105,tXc1,text,0); | |
1163 } | |
1164 fAverageDepthAbsolute = stateUsed->lifeData.average_depth_meter; | |
1165 snprintf(text,TEXTSIZE,"\032\002\f%c",TXT_AvgDepth); | |
511 | 1166 GFX_write_string(&FontT42,tXc1,text,0); |
496 | 1167 |
1168 snprintf(text,TEXTSIZE,"\020\003\016\002\%01.1f",unit_depth_float(fAverageDepthAbsolute)); | |
511 | 1169 GFX_write_string(&FontT105,tXc1,text,0); |
496 | 1170 break; |
38 | 1171 } |
496 | 1172 |
1173 | |
1174 | |
38 | 1175 tXc1->WindowX0 = tempWinX0; |
1176 tXc1->WindowY0 = tempWinY0; | |
496 | 1177 tXc1->WindowX1 = tempWinX1; |
1178 tXc1->WindowY1 = tempWinY1; | |
413 | 1179 |
38 | 1180 tXc2->WindowX0 = tempWinC2X0; |
413 | 1181 tXc2->WindowY0 = tempWinC2Y0; |
1182 tXc2->WindowX1 = tempWinC2X1; | |
1183 tXc2->WindowY1 = tempWinC2Y1; | |
38 | 1184 tXc2->WindowTab = tempWinC2Tab; |
1185 } | |
1186 | |
1187 | |
1188 uint8_t t3_test_customview_warnings(void) | |
1189 { | |
1190 uint8_t count = 0; | |
1191 | |
1192 count = 0; | |
1193 count += stateUsed->warnings.decoMissed; | |
1194 count += stateUsed->warnings.ppO2Low; | |
1195 count += stateUsed->warnings.ppO2High; | |
1196 //count += stateUsed->warnings.lowBattery; | |
1197 count += stateUsed->warnings.sensorLinkLost; | |
1198 count += stateUsed->warnings.fallback; | |
1199 | |
1200 return count; | |
1201 } | |
1202 | |
1203 //void t3_show_customview_warnings(GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXl1, GFX_DrawCfgWindow* tXr1, uint8_t mode) | |
1204 void t3_basics_show_customview_warnings(GFX_DrawCfgWindow* tXc1) | |
1205 { | |
1206 char text[256], textMain[256]; | |
1207 uint8_t textpointer, textpointerMain, lineFree, more; | |
1208 | |
1209 snprintf(text,TEXTSIZE,"\025\f%c",TXT_Warning); | |
1210 GFX_write_string(&FontT42,&t3c1,text,0); | |
1211 | |
1212 lineFree = 1; | |
1213 more = 0; | |
1214 | |
1215 textpointerMain = 0; | |
511 | 1216 textMain[textpointerMain++] = '\025'; /* red */ |
1217 textMain[textpointerMain++] = '\003'; /* doublesize */ | |
38 | 1218 |
1219 textpointer = 0; | |
1220 | |
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1221 text[textpointer++] = '\031'; |
38 | 1222 text[textpointer++] = TXT_2BYTE; |
1223 text[textpointer++] = TXT2BYTE_WarnDecoMissed; | |
1224 if(stateUsed->warnings.decoMissed) | |
1225 { | |
1226 text[textpointer - 3] = '\025'; | |
1227 if(lineFree) | |
1228 { | |
1229 textMain[textpointerMain++] = TXT_2BYTE; | |
1230 textMain[textpointerMain++] = text[textpointer - 1]; | |
1231 textMain[textpointerMain] = 0; | |
1232 lineFree--; | |
1233 } | |
1234 else | |
1235 { | |
1236 more++; | |
1237 } | |
1238 } | |
1239 | |
1240 text[textpointer++] = '\t'; | |
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1241 text[textpointer++] = '\031'; |
38 | 1242 text[textpointer++] = TXT_2BYTE; |
1243 text[textpointer++] = TXT2BYTE_WarnPPO2Low; | |
1244 if(stateUsed->warnings.ppO2Low) | |
1245 { | |
1246 text[textpointer - 3] = '\025'; | |
1247 if(lineFree) | |
1248 { | |
1249 textMain[textpointerMain++] = TXT_2BYTE; | |
1250 textMain[textpointerMain++] = text[textpointer - 1]; | |
1251 textMain[textpointerMain] = 0; | |
1252 lineFree--; | |
1253 } | |
1254 else | |
1255 { | |
1256 more++; | |
1257 } | |
1258 } | |
1259 | |
1260 text[textpointer++] = '\n'; | |
1261 text[textpointer++] = '\r'; | |
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1262 text[textpointer++] = '\031'; |
38 | 1263 text[textpointer++] = TXT_2BYTE; |
1264 text[textpointer++] = TXT2BYTE_WarnPPO2High; | |
1265 if(stateUsed->warnings.ppO2High) | |
1266 { | |
1267 text[textpointer - 3] = '\025'; | |
1268 if(lineFree) | |
1269 { | |
1270 textMain[textpointerMain++] = TXT_2BYTE; | |
1271 textMain[textpointerMain++] = text[textpointer - 1]; | |
1272 textMain[textpointerMain] = 0; | |
1273 lineFree--; | |
1274 } | |
1275 else | |
1276 { | |
1277 more++; | |
1278 } | |
1279 } | |
1280 | |
1281 text[textpointer++] = '\t'; | |
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1282 text[textpointer++] = '\031'; |
38 | 1283 text[textpointer++] = TXT_2BYTE; |
1284 text[textpointer++] = TXT2BYTE_WarnFallback; | |
1285 if(stateUsed->warnings.fallback) | |
1286 { | |
1287 text[textpointer - 3] = '\025'; | |
1288 if(lineFree) | |
1289 { | |
1290 textMain[textpointerMain++] = TXT_2BYTE; | |
1291 textMain[textpointerMain++] = text[textpointer - 1]; | |
1292 textMain[textpointerMain] = 0; | |
1293 lineFree--; | |
1294 } | |
1295 else | |
1296 { | |
1297 more++; | |
1298 } | |
1299 } | |
1300 | |
1301 text[textpointer++] = '\n'; | |
1302 text[textpointer++] = '\r'; | |
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1303 text[textpointer++] = '\031'; |
38 | 1304 text[textpointer++] = TXT_2BYTE; |
1305 text[textpointer++] = TXT2BYTE_WarnSensorLinkLost; | |
1306 if(stateUsed->warnings.sensorLinkLost) | |
1307 { | |
1308 text[textpointer - 3] = '\025'; | |
1309 if(lineFree) | |
1310 { | |
1311 textMain[textpointerMain++] = TXT_2BYTE; | |
1312 textMain[textpointerMain++] = text[textpointer - 1]; | |
1313 textMain[textpointerMain] = 0; | |
1314 lineFree--; | |
1315 } | |
1316 else | |
1317 { | |
1318 more++; | |
1319 } | |
1320 } | |
1321 | |
1322 /* | |
1323 text[textpointer++] = '\t'; | |
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1324 text[textpointer++] = '\031'; |
38 | 1325 text[textpointer++] = TXT_2BYTE; |
1326 text[textpointer++] = TXT2BYTE_WarnBatteryLow; | |
1327 if(stateUsed->warnings.lowBattery) | |
1328 { | |
1329 text[textpointer - 3] = '\025'; | |
1330 if(lineFree) | |
1331 { | |
1332 textMain[textpointerMain++] = TXT_2BYTE; | |
1333 textMain[textpointerMain++] = text[textpointer - 1]; | |
1334 textMain[textpointerMain] = 0; | |
1335 lineFree--; | |
1336 } | |
1337 else | |
1338 { | |
1339 more++; | |
1340 } | |
1341 } | |
1342 */ | |
1343 text[textpointer] = 0; | |
1344 /* | |
1345 if(more) | |
1346 { | |
1347 text[textpointer++] = '\002'; | |
1348 text[textpointer++] = '+'; | |
1349 if(more < 10) | |
1350 text[textpointer++] = '0' + more; | |
1351 else | |
1352 text[textpointer++] = 'X'; | |
1353 text[textpointer] = 0; | |
1354 } | |
1355 */ | |
511 | 1356 GFX_write_string(&FontT48,&t3c1,textMain,0); |
38 | 1357 if(more) |
1358 { | |
511 | 1359 GFX_write_string(&FontT48,&t3c2,text,0); |
38 | 1360 } |
1361 } | |
1362 | |
496 | 1363 uint8_t t3_customview_disabled(uint8_t view) |
1364 { | |
1365 uint8_t i = 0; | |
1366 uint8_t cv_disabled = 0; | |
1367 const uint8_t *pcv_changelist; | |
1368 uint32_t cv_config = settingsGetPointer()->cv_config_BigScreen; | |
1369 | |
511 | 1370 pcv_changelist = cv_changelist_BS; |
496 | 1371 |
1372 while(pcv_changelist[i] != CVIEW_T3_END) | |
1373 { | |
1374 if((view == pcv_changelist[i]) && !CHECK_BIT_THOME(cv_config, pcv_changelist[i])) | |
1375 { | |
1376 cv_disabled = 1; | |
1377 break; | |
1378 } | |
1379 i++; | |
1380 } | |
1381 | |
1382 if (((view == CVIEW_sensors) || (view == CVIEW_sensors_mV)) && | |
1383 ((stateUsed->diveSettings.ppo2sensors_deactivated) || (stateUsed->diveSettings.ccrOption == 0))) | |
1384 { | |
1385 cv_disabled = 1; | |
1386 } | |
1387 | |
1388 return cv_disabled; | |
1389 } | |
38 | 1390 |
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1391 void t3_change_customview(uint8_t action) |
38 | 1392 { |
511 | 1393 |
496 | 1394 t3_basics_change_customview(&t3_selection_customview, t3_customviewsStandard, action); |
38 | 1395 } |
1396 | |
1397 | |
511 | 1398 void t3_basics_change_customview(uint8_t *tX_selection_customview,const uint8_t *tX_customviews, uint8_t action) |
38 | 1399 { |
1400 const SDecoinfo * pDecoinfo; | |
1401 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE) | |
1402 pDecoinfo = &stateUsed->decolistBuehlmann; | |
1403 else | |
1404 pDecoinfo = &stateUsed->decolistVPM; | |
1405 | |
511 | 1406 uint8_t curViewIdx = 0xff; |
1407 uint8_t index = 0; | |
1408 uint8_t lastViewIdx = 0; | |
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1409 uint8_t iterate = 0; /* set to 1 if a view has to be skipped */ |
38 | 1410 |
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1411 /* set pointer to currently selected view and count number of entries */ |
511 | 1412 while((tX_customviews[index] != CVIEW_T3_END)) |
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1413 { |
511 | 1414 if (tX_customviews[index] == *tX_selection_customview) |
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1415 { |
511 | 1416 curViewIdx = index; |
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1417 } |
511 | 1418 index++; |
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1419 } |
511 | 1420 if(curViewIdx == 0xff) /* called with unknown view */ |
496 | 1421 { |
511 | 1422 curViewIdx = 0; |
1423 *tX_selection_customview = tX_customviews[index]; | |
496 | 1424 } |
511 | 1425 lastViewIdx = index; |
1426 index = curViewIdx; | |
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1427 do |
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1428 { |
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1429 iterate = 0; |
496 | 1430 switch(action) |
1431 { | |
1432 case ACTION_BUTTON_ENTER: | |
1433 case ACTION_PITCH_POS: | |
1434 | |
511 | 1435 if(tX_customviews[index] != CVIEW_T3_END) |
496 | 1436 { |
511 | 1437 index++; |
1438 } | |
1439 if(tX_customviews[index] == CVIEW_T3_END) | |
1440 { | |
1441 index = 0; | |
496 | 1442 } |
1443 break; | |
1444 case ACTION_PITCH_NEG: | |
511 | 1445 if(index == 0) |
496 | 1446 { |
511 | 1447 index = lastViewIdx - 1; |
496 | 1448 } |
1449 else | |
1450 { | |
511 | 1451 index--; |
496 | 1452 } |
1453 break; | |
1454 default: | |
1455 break; | |
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1456 } |
496 | 1457 |
511 | 1458 if(t3_customview_disabled(tX_customviews[index])) |
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1459 { |
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1460 iterate = 1; |
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1461 } |
529
0e1db77b2aca
Added skip condition in custom view selection:
Ideenmodellierer
parents:
527
diff
changeset
|
1462 if((tX_customviews[index] == CVIEW_T3_TTS) && !pDecoinfo->output_time_to_surface_seconds) /* Skip TTS if value is 0 */ |
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1463 { |
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1464 iterate = 1; |
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1465 } |
529
0e1db77b2aca
Added skip condition in custom view selection:
Ideenmodellierer
parents:
527
diff
changeset
|
1466 if((tX_customviews[index] == CVIEW_T3_Decostop) && ((!pDecoinfo->output_ndl_seconds) && (!pDecoinfo->output_time_to_surface_seconds) && (timer_Safetystop_GetCountDown() == 0))) /* Skip Deco if NDL is not set */ |
0e1db77b2aca
Added skip condition in custom view selection:
Ideenmodellierer
parents:
527
diff
changeset
|
1467 { |
0e1db77b2aca
Added skip condition in custom view selection:
Ideenmodellierer
parents:
527
diff
changeset
|
1468 iterate = 1; |
0e1db77b2aca
Added skip condition in custom view selection:
Ideenmodellierer
parents:
527
diff
changeset
|
1469 } |
496 | 1470 if((iterate) && (action == ACTION_END)) |
1471 { | |
1472 action = ACTION_BUTTON_ENTER; | |
1473 } | |
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1474 }while (iterate == 1); |
38 | 1475 |
511 | 1476 *tX_selection_customview = tX_customviews[index]; |
38 | 1477 } |
1478 | |
1479 | |
1480 void t3_basics_colorscheme_mod(char *text) | |
1481 { | |
1482 if((text[0] == '\020') && !GFX_is_colorschemeDiveStandard()) | |
1483 { | |
1484 text[0] = '\027'; | |
1485 } | |
1486 } | |
1487 | |
1488 | |
496 | 1489 point_t t3_compass_circle(uint8_t id, uint16_t degree, point_t center) |
38 | 1490 { |
1491 float fCos, fSin; | |
1492 const float piMult = ((2 * 3.14159) / 360); | |
1493 // const int radius[4] = {95,105,115,60}; | |
1494 const int radius[4] = {85,95,105,90}; | |
496 | 1495 static point_t forcenter = {.x = 900, .y = 500}; /* used to identify change of circle position */ |
38 | 1496 static point_t r[4][360] = { 0 }; |
1497 | |
496 | 1498 if((r[0][0].y == 0) || (forcenter.x != center.x) || (forcenter.y != center.y)) /* calculate values only once during first call or if center position changed */ |
38 | 1499 { |
1500 for(int i=0;i<360;i++) | |
1501 { | |
1502 fCos = cos(i * piMult); | |
1503 fSin = sin(i * piMult); | |
1504 for(int j=0;j<4;j++) | |
1505 { | |
496 | 1506 r[j][i].x = center.x + (int)(fSin * radius[j]); |
1507 r[j][i].y = center.y + (int)(fCos * radius[j]); | |
38 | 1508 } |
1509 } | |
496 | 1510 forcenter.x = center.x; |
1511 forcenter.y = center.y; | |
38 | 1512 } |
1513 if(id > 3) id = 0; | |
1514 if(degree > 359) degree = 0; | |
1515 return r[id][degree]; | |
1516 } | |
1517 | |
1518 | |
496 | 1519 void t3_basics_compass(GFX_DrawCfgScreen *tXscreen, point_t center, uint16_t ActualHeading, uint16_t UserSetHeading) |
38 | 1520 { |
496 | 1521 uint8_t loop = 0; |
38 | 1522 uint16_t LineHeading; |
496 | 1523 |
38 | 1524 static int32_t LastHeading = 0; |
1525 int32_t newHeading = 0; | |
1526 int32_t diff = 0; | |
1527 int32_t diff2 = 0; | |
1528 | |
1529 int32_t diffAbs = 0; | |
1530 int32_t diffAbs2 = 0; | |
1531 | |
1532 newHeading = ActualHeading; | |
1533 | |
1534 diff = newHeading - LastHeading; | |
1535 | |
1536 if(newHeading < LastHeading) | |
1537 diff2 = newHeading + 360 - LastHeading; | |
1538 else | |
1539 diff2 = newHeading - 360 - LastHeading; | |
1540 | |
1541 diffAbs = diff; | |
1542 if(diffAbs < 0) | |
1543 diffAbs *= -1; | |
1544 | |
1545 diffAbs2 = diff2; | |
1546 if(diffAbs2 < 0) | |
1547 diffAbs2 *= -1; | |
1548 | |
1549 if(diffAbs <= diffAbs2) | |
1550 newHeading = LastHeading + (diff / 2); | |
1551 else | |
1552 newHeading = LastHeading + (diff2 / 2); | |
1553 | |
1554 if(newHeading < 0) | |
1555 newHeading += 360; | |
1556 else | |
1557 if(newHeading >= 360) | |
1558 newHeading -= 360; | |
1559 | |
1560 LastHeading = newHeading; | |
1561 ActualHeading = newHeading; | |
1562 | |
1563 if (ActualHeading < 90) | |
1564 ActualHeading += 360; | |
1565 | |
1566 while(ActualHeading > 359) ActualHeading -= 360; | |
1567 | |
1568 LineHeading = 360 - ActualHeading; | |
496 | 1569 |
1570 GFX_draw_thick_line(9,tXscreen, t3_compass_circle(0,LineHeading, center), t3_compass_circle(2,LineHeading, center), CLUT_Font030); // North | |
38 | 1571 LineHeading += 90; |
496 | 1572 |
1573 for (loop = 0; loop < 3; loop++) | |
1574 { | |
1575 if(LineHeading > 359) LineHeading -= 360; | |
1576 GFX_draw_thick_line(9,tXscreen, t3_compass_circle(0,LineHeading, center), t3_compass_circle(2,LineHeading, center), CLUT_Font031); // Main Ticks | |
1577 LineHeading += 90; | |
1578 } | |
38 | 1579 |
1580 LineHeading = 360 - ActualHeading; | |
1581 LineHeading += 45; | |
496 | 1582 |
1583 for (loop = 0; loop < 4; loop++) | |
1584 { | |
1585 if(LineHeading > 359) LineHeading -= 360; | |
1586 GFX_draw_thick_line(5,tXscreen, t3_compass_circle(1,LineHeading, center), t3_compass_circle(2,LineHeading, center), CLUT_Font031); // Subtick | |
1587 LineHeading += 90; | |
1588 } | |
38 | 1589 |
1590 LineHeading = 360 - ActualHeading; | |
1591 LineHeading += 22; | |
496 | 1592 for (loop = 0; loop < 8; loop++) |
1593 { | |
1594 if(LineHeading > 359) LineHeading -= 360; | |
1595 GFX_draw_thick_line(3,tXscreen, t3_compass_circle(1,LineHeading, center), t3_compass_circle(2,LineHeading, center), CLUT_Font031); // Subtick | |
1596 LineHeading += 45; | |
1597 } | |
38 | 1598 if(UserSetHeading) |
1599 { | |
1600 LineHeading = UserSetHeading + 360 - ActualHeading; | |
1601 if(LineHeading > 359) LineHeading -= 360; | |
496 | 1602 GFX_draw_thick_line(9,tXscreen, t3_compass_circle(3,LineHeading, center), t3_compass_circle(2,LineHeading, center), CLUT_CompassUserHeadingTick); |
38 | 1603 |
1604 // R�ckpeilung, User Back Heading | |
1605 LineHeading = UserSetHeading + 360 + 180 - ActualHeading; | |
1606 if(LineHeading > 359) LineHeading -= 360; | |
1607 if(LineHeading > 359) LineHeading -= 360; | |
496 | 1608 GFX_draw_thick_line(9,tXscreen, t3_compass_circle(3,LineHeading, center), t3_compass_circle(2,LineHeading, center), CLUT_CompassUserBackHeadingTick); |
38 | 1609 } |
1610 | |
1611 GFX_draw_circle(tXscreen, center, 106, CLUT_Font030); | |
1612 GFX_draw_circle(tXscreen, center, 107, CLUT_Font030); | |
1613 GFX_draw_circle(tXscreen, center, 108, CLUT_Font030); | |
1614 } | |
384
427ae9f8e28e
Consider number of available t3 views in sector handling:
ideenmodellierer
parents:
272
diff
changeset
|
1615 |
427ae9f8e28e
Consider number of available t3 views in sector handling:
ideenmodellierer
parents:
272
diff
changeset
|
1616 uint8_t t3_GetEnabled_customviews() |
427ae9f8e28e
Consider number of available t3 views in sector handling:
ideenmodellierer
parents:
272
diff
changeset
|
1617 { |
496 | 1618 uint8_t *pViews; |
1619 uint8_t increment = 1; | |
384
427ae9f8e28e
Consider number of available t3 views in sector handling:
ideenmodellierer
parents:
272
diff
changeset
|
1620 uint8_t enabledViewCnt = 0; |
496 | 1621 |
511 | 1622 pViews = (uint8_t*)t3_customviewsStandard; |
496 | 1623 while((*pViews != CVIEW_T3_END)) |
1624 { | |
1625 increment = 1; | |
1626 /* check if view is enabled */ | |
1627 if(t3_customview_disabled(*pViews)) | |
1628 { | |
1629 increment = 0; | |
1630 } | |
1631 pViews++; | |
1632 enabledViewCnt += increment; | |
1633 } | |
384
427ae9f8e28e
Consider number of available t3 views in sector handling:
ideenmodellierer
parents:
272
diff
changeset
|
1634 return enabledViewCnt; |
427ae9f8e28e
Consider number of available t3 views in sector handling:
ideenmodellierer
parents:
272
diff
changeset
|
1635 } |
427ae9f8e28e
Consider number of available t3 views in sector handling:
ideenmodellierer
parents:
272
diff
changeset
|
1636 |
518 | 1637 uint8_t t3_getCustomView(void) |
1638 { | |
1639 return t3_selection_customview; | |
1640 } |