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