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