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