Mercurial > public > ostc4
annotate Discovery/Src/t7.c @ 415:e0907c7d8038 Improment_NVM
merged default into Improvment_NVM
author | Ideenmodellierer |
---|---|
date | Tue, 14 Jan 2020 21:52:15 +0100 |
parents | 73db1565220b |
children | 2b4440f75434 |
rev | line source |
---|---|
38 | 1 /////////////////////////////////////////////////////////////////////////////// |
2 /// -*- coding: UTF-8 -*- | |
3 /// | |
4 /// \file Discovery/Src/t7.c | |
5 /// \brief Main Template file for dive mode 7x | |
6 /// \author Heinrichs Weikamp gmbh | |
7 /// \date 23-April-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 "t7.h" | |
31 | |
32 #include "data_exchange_main.h" | |
33 #include "decom.h" | |
34 #include "gfx_fonts.h" | |
35 #include "logbook_miniLive.h" | |
36 #include "math.h" | |
37 #include "tHome.h" | |
38 #include "simulation.h" | |
39 #include "timer.h" | |
40 #include "unit.h" | |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
41 #include "motion.h" |
38 | 42 |
43 /* Private function prototypes -----------------------------------------------*/ | |
44 | |
45 void t7_refresh_surface(void); | |
46 void t7_refresh_surface_debugmode(void); | |
47 void t7_refresh_divemode(void); | |
48 void t7_refresh_sleep_design_fun(void); | |
49 void t7_refresh_divemode_userselected_left_lower_corner(void); | |
50 void t7_refresh_customview(void); | |
405 | 51 uint8_t t7_customview_disabled(uint8_t view); |
38 | 52 |
53 void draw_frame(_Bool PluginBoxHeader, _Bool LinesOnTheSides, uint8_t colorBox, uint8_t colorLinesOnTheSide); | |
54 | |
55 void t7_tissues(const SDiveState * pState); | |
56 void t7_compass(uint16_t ActualHeading, uint16_t UserSetHeading); | |
57 void t7_SummaryOfLeftCorner(void); | |
58 void t7_debug(void); | |
59 | |
60 void t7_miniLiveLogProfile(void); | |
61 void t7_logo_OSTC(void); | |
196
2885628ab3ba
Bugfix, minor: color the overview customview correctly
Jan Mulder <jlmulder@xs4all.nl>
parents:
193
diff
changeset
|
62 static void t7_colorscheme_mod(char *text); |
38 | 63 |
64 uint8_t t7_test_customview_warnings(void); | |
65 void t7_show_customview_warnings(void); | |
66 | |
67 uint8_t t7_test_customview_warnings_surface_mode(void); | |
68 void t7_show_customview_warnings_surface_mode(void); | |
69 | |
70 uint8_t t7_customtextPrepare(char * text); | |
71 | |
193
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
72 /* Imported function prototypes ---------------------------------------------*/ |
38 | 73 extern uint8_t write_gas(char *text, uint8_t oxygen, uint8_t helium); |
74 | |
75 /* Exported variables --------------------------------------------------------*/ | |
76 | |
77 /* Private variables ---------------------------------------------------------*/ | |
78 | |
79 GFX_DrawCfgScreen t7screen; | |
80 GFX_DrawCfgScreen t7screenCompass; | |
81 | |
82 /* left 3 fields | |
83 * right 3 fields | |
84 * centered one field on top of customview, one below | |
85 * customview header + customview + warning | |
86 */ | |
87 GFX_DrawCfgWindow t7l1, t7l2, t7l3; | |
88 GFX_DrawCfgWindow t7r1, t7r2, t7r3; | |
89 GFX_DrawCfgWindow t7c1, t7batt, t7c2, t7charge, t7voltage; | |
90 GFX_DrawCfgWindow t7cH, t7cC, t7cW, t7cY0free; | |
91 GFX_DrawCfgWindow t7pCompass; | |
92 GFX_DrawCfgWindow t7surfaceL, t7surfaceR; | |
93 | |
94 uint8_t selection_custom_field = 1; | |
95 uint8_t selection_customview = 1; | |
96 | |
97 uint8_t updateNecessary = 0; | |
98 | |
99 typedef struct{ | |
100 uint32_t pointer; | |
101 uint32_t x0; | |
102 uint32_t y0; | |
103 uint32_t width; | |
104 uint32_t height; | |
105 } SBackground; | |
106 | |
107 SBackground background = | |
108 { | |
166
255eedad4155
cleanup: get rid of some compile warnings
Jan Mulder <jlmulder@xs4all.nl>
parents:
149
diff
changeset
|
109 .pointer = 0, |
38 | 110 }; |
111 | |
112 | |
113 /* Private types -------------------------------------------------------------*/ | |
114 const uint8_t customviewsDiveStandard[] = | |
115 { | |
116 CVIEW_sensors, | |
117 CVIEW_Compass, | |
118 CVIEW_Decolist, | |
119 CVIEW_Tissues, | |
120 CVIEW_Profile, | |
121 CVIEW_Gaslist, | |
122 CVIEW_sensors_mV, | |
123 CVIEW_EADTime, | |
124 CVIEW_SummaryOfLeftCorner, | |
125 CVIEW_noneOrDebug, | |
126 CVIEW_END, | |
127 CVIEW_END | |
128 }; | |
129 | |
130 const uint8_t customviewsSurfaceStandard[] = | |
131 { | |
132 // CVIEW_CompassDebug, | |
133 CVIEW_Hello, | |
134 CVIEW_sensors, | |
135 CVIEW_Compass, | |
136 CVIEW_Tissues, | |
137 CVIEW_sensors_mV, | |
138 CVIEW_END, | |
139 CVIEW_END | |
140 }; | |
141 | |
142 const uint8_t *customviewsDive = customviewsDiveStandard; | |
143 const uint8_t *customviewsSurface = customviewsSurfaceStandard; | |
144 | |
145 #define TEXTSIZE 16 | |
146 /* offset includes line: 2 = line +1 | |
147 * box (line) is 300 px | |
148 * inside is 296 px | |
149 * left of box are 249 px ( 0..248) | |
150 * right of box are 249 px (551 .. 799) | |
151 */ | |
152 | |
153 #define CUSTOMBOX_LINE_LEFT (250) | |
154 #define CUSTOMBOX_LINE_RIGHT (549) | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
155 #define CUSTOMBOX_LINE_TOP (0) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
156 #define CUSTOMBOX_LINE_MIDDLE (142) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
157 #define CUSTOMBOX_LINE_BOTTOM (318) |
38 | 158 #define CUSTOMBOX_INSIDE_OFFSET (2) |
159 #define CUSTOMBOX_OUTSIDE_OFFSET (2) | |
160 #define CUSTOMBOX_SPACE_INSIDE (CUSTOMBOX_LINE_RIGHT + 1 - (CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + CUSTOMBOX_INSIDE_OFFSET)) | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
161 #define TOP_LINE_HIGHT (25) |
38 | 162 |
336
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
163 #define SHOW_AMBIENTE_SURFACE_DELTA (0.02f) |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
164 #define SHOW_AMBIENTE_DEBOUNCE (0.003f) |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
165 |
38 | 166 /* Exported functions --------------------------------------------------------*/ |
167 | |
168 void t7_init(void) | |
169 { | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
170 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
171 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
172 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
173 |
38 | 174 selection_custom_field = 1; |
175 selection_customview = customviewsSurface[0]; | |
176 | |
177 t7screen.FBStartAdress = 0; | |
178 t7screen.ImageHeight = 480; | |
179 t7screen.ImageWidth = 800; | |
180 t7screen.LayerIndex = 1; | |
181 | |
182 t7screenCompass.FBStartAdress = 0; | |
183 t7screenCompass.ImageHeight = 240; | |
184 t7screenCompass.ImageWidth = 1600; | |
185 t7screenCompass.LayerIndex = 0; | |
186 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
187 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
188 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
189 t7l1.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
190 t7l1.WindowNumberOfTextLines = 2; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
191 t7l1.WindowLineSpacing = 19; // Abstand von Y0 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
192 t7l1.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
193 t7l1.WindowX0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
194 t7l1.WindowX1 = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
195 t7l1.WindowY0 = 318; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
196 t7l1.WindowY1 = 479; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
197 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
198 t7l2.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
199 t7l2.WindowNumberOfTextLines = 2; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
200 t7l2.WindowLineSpacing = 22; // Abstand von Y0 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
201 t7l2.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
202 t7l2.WindowX0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
203 t7l2.WindowX1 = t7l1.WindowX1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
204 t7l2.WindowY0 = 142; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
205 t7l2.WindowY1 = t7l1.WindowY0 - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
206 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
207 t7l3.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
208 t7l3.WindowNumberOfTextLines = 2; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
209 t7l3.WindowLineSpacing = 58; // Abstand von Y0 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
210 t7l3.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
211 t7l3.WindowX0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
212 t7l3.WindowX1 = t7l1.WindowX1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
213 t7l3.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
214 t7l3.WindowY1 = t7l2.WindowY0 - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
215 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
216 t7r1.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
217 t7r1.WindowNumberOfTextLines = 2; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
218 t7r1.WindowLineSpacing = t7l1.WindowLineSpacing; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
219 t7r1.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
220 t7r1.WindowX0 = 550; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
221 t7r1.WindowX1 = 799; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
222 t7r1.WindowY0 = t7l1.WindowY0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
223 t7r1.WindowY1 = 479; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
224 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
225 t7r2.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
226 t7r2.WindowNumberOfTextLines = 2; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
227 t7r2.WindowLineSpacing = t7l2.WindowLineSpacing; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
228 t7r2.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
229 t7r2.WindowX0 = 550; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
230 t7r2.WindowX1 = 799; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
231 t7r2.WindowY0 = t7l2.WindowY0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
232 t7r2.WindowY1 = t7l2.WindowY1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
233 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
234 t7r3.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
235 t7r3.WindowNumberOfTextLines = 2; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
236 t7r3.WindowLineSpacing = 0;//t7l3.WindowLineSpacing; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
237 t7r3.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
238 t7r3.WindowX0 = CUSTOMBOX_LINE_RIGHT + CUSTOMBOX_OUTSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
239 t7r3.WindowX1 = 799; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
240 t7r3.WindowY0 = t7l3.WindowY0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
241 t7r3.WindowY1 = t7l3.WindowY1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
242 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
243 t7cC.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
244 t7cC.WindowNumberOfTextLines = 3; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
245 t7cC.WindowLineSpacing = 95; // Abstand von Y0 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
246 t7cC.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
247 t7cC.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
248 t7cC.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
249 t7cC.WindowY0 = 90; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
250 t7cC.WindowY1 = 434 - 95; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
251 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
252 t7cH.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
253 t7cH.WindowNumberOfTextLines = 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
254 t7cH.WindowLineSpacing = 95; // Abstand von Y0 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
255 t7cH.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
256 t7cH.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
257 t7cH.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
258 t7cH.WindowY0 = 434 - 94; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
259 t7cH.WindowY1 = 434; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
260 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
261 t7cW.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
262 t7cW.WindowNumberOfTextLines = 3; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
263 t7cW.WindowLineSpacing = 95; // Abstand von Y0 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
264 t7cW.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
265 t7cW.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
266 t7cW.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
267 t7cW.WindowY0 = 90; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
268 t7cW.WindowY1 = 434 - 95; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
269 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
270 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
271 t7surfaceL.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
272 t7surfaceL.WindowNumberOfTextLines = 9; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
273 t7surfaceL.WindowLineSpacing = 53; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
274 t7surfaceL.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
275 t7surfaceL.WindowX0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
276 t7surfaceL.WindowX1 = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
277 t7surfaceL.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
278 t7surfaceL.WindowY1 = 480; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
279 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
280 t7surfaceR.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
281 t7surfaceR.WindowNumberOfTextLines = 9; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
282 t7surfaceR.WindowLineSpacing = 53; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
283 t7surfaceR.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
284 t7surfaceR.WindowX0 = CUSTOMBOX_LINE_RIGHT + CUSTOMBOX_OUTSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
285 t7surfaceR.WindowX1 = 800; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
286 t7surfaceR.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
287 t7surfaceR.WindowY1 = 480; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
288 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
289 t7cY0free.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
290 t7cY0free.WindowNumberOfTextLines = 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
291 t7cY0free.WindowLineSpacing = 95; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
292 t7cY0free.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
293 t7cY0free.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
294 t7cY0free.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
295 t7cY0free.WindowY0 = 90; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
296 t7cY0free.WindowY1 = 434 - 95; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
297 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
298 t7batt.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
299 t7batt.WindowNumberOfTextLines = 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
300 t7batt.WindowLineSpacing = 10; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
301 t7batt.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
302 t7batt.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
303 t7batt.WindowX0 = t7batt.WindowX1 - (52+52); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
304 t7batt.WindowY1 = 479; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
305 t7batt.WindowY0 = t7batt.WindowY1 - 25; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
306 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
307 t7charge.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
308 t7charge.WindowNumberOfTextLines = 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
309 t7charge.WindowLineSpacing = 10; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
310 t7charge.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
311 t7charge.WindowX1 = t7batt.WindowX1 - 18; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
312 t7charge.WindowX0 = t7charge.WindowX1 - 14; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
313 t7charge.WindowY1 = 479; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
314 t7charge.WindowY0 = t7batt.WindowY1 - 25; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
315 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
316 t7voltage.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
317 t7voltage.WindowNumberOfTextLines = 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
318 t7voltage.WindowLineSpacing = 10; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
319 t7voltage.WindowTab = 100; |
145 | 320 t7voltage.WindowX0 = t7charge.WindowX0 - 10; |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
321 t7voltage.WindowX1 = t7voltage.WindowX0 + (18*3)+ 9; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
322 t7voltage.WindowY1 = 479; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
323 t7voltage.WindowY0 = t7batt.WindowY1 - 25; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
324 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
325 t7c1.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
326 t7c1.WindowNumberOfTextLines = 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
327 t7c1.WindowLineSpacing = 10; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
328 t7c1.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
329 t7c1.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
330 t7c1.WindowX1 = t7batt.WindowX0 - 18; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
331 t7c1.WindowY0 = 435; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
332 t7c1.WindowY1 = 479; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
333 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
334 t7c2.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
335 t7c2.WindowNumberOfTextLines = 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
336 t7c2.WindowLineSpacing = 0; // Abstand von Y0 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
337 t7c2.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
338 t7c2.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
339 t7c2.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
340 t7c2.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
341 t7c2.WindowY1 = 69; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
342 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
343 t7pCompass.Image = &t7screenCompass; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
344 t7pCompass.WindowNumberOfTextLines = 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
345 t7pCompass.WindowLineSpacing = 100; // Abstand von Y0 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
346 t7pCompass.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
347 t7pCompass.WindowX0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
348 t7pCompass.WindowX1 = 1600-1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
349 t7pCompass.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
350 t7pCompass.WindowY1 = 100-1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
351 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
352 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
353 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
354 /* 6 segments (left / right) used to show data during dive */ |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
355 |
38 | 356 t7l1.Image = &t7screen; |
357 t7l1.WindowNumberOfTextLines = 2; | |
358 t7l1.WindowLineSpacing = 19; // Abstand von Y0 | |
359 t7l1.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
360 t7l1.WindowX0 = CUSTOMBOX_LINE_RIGHT + CUSTOMBOX_OUTSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
361 t7l1.WindowX1 = 799; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
362 t7l1.WindowY0 = CUSTOMBOX_LINE_TOP; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
363 t7l1.WindowY1 = 150 + TOP_LINE_HIGHT; |
38 | 364 |
365 t7l2.Image = &t7screen; | |
366 t7l2.WindowNumberOfTextLines = 2; | |
367 t7l2.WindowLineSpacing = 22; // Abstand von Y0 | |
368 t7l2.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
369 t7l2.WindowX0 = t7l1.WindowX0; |
38 | 370 t7l2.WindowX1 = t7l1.WindowX1; |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
371 t7l2.WindowY0 = t7l1.WindowY1 + 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
372 t7l2.WindowY1 = t7l2.WindowY0 + 146; |
38 | 373 |
374 t7l3.Image = &t7screen; | |
375 t7l3.WindowNumberOfTextLines = 2; | |
376 t7l3.WindowLineSpacing = 58; // Abstand von Y0 | |
377 t7l3.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
378 t7l3.WindowX0 = t7l1.WindowX0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
379 t7l3.WindowX1 = t7l1.WindowX1;; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
380 t7l3.WindowY0 = 479 - 150; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
381 t7l3.WindowY1 = 479; |
38 | 382 |
383 t7r1.Image = &t7screen; | |
384 t7r1.WindowNumberOfTextLines = 2; | |
385 t7r1.WindowLineSpacing = t7l1.WindowLineSpacing; | |
386 t7r1.WindowTab = 100; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
387 t7r1.WindowX0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
388 t7r1.WindowX1 = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET; |
38 | 389 t7r1.WindowY0 = t7l1.WindowY0; |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
390 t7r1.WindowY1 = t7l1.WindowY1; |
38 | 391 |
392 t7r2.Image = &t7screen; | |
393 t7r2.WindowNumberOfTextLines = 2; | |
394 t7r2.WindowLineSpacing = t7l2.WindowLineSpacing; | |
395 t7r2.WindowTab = 100; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
396 t7r2.WindowX0 = t7r1.WindowX0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
397 t7r2.WindowX1 = t7r1.WindowX1; |
38 | 398 t7r2.WindowY0 = t7l2.WindowY0; |
399 t7r2.WindowY1 = t7l2.WindowY1; | |
400 | |
401 t7r3.Image = &t7screen; | |
402 t7r3.WindowNumberOfTextLines = 2; | |
403 t7r3.WindowLineSpacing = 0;//t7l3.WindowLineSpacing; | |
404 t7r3.WindowTab = 100; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
405 t7r3.WindowX0 = t7r1.WindowX0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
406 t7r3.WindowX1 = t7r1.WindowX1; |
38 | 407 t7r3.WindowY0 = t7l3.WindowY0; |
408 t7r3.WindowY1 = t7l3.WindowY1; | |
409 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
410 /* screen for CustomText / serial number */ |
38 | 411 t7cC.Image = &t7screen; |
412 t7cC.WindowNumberOfTextLines = 3; | |
413 t7cC.WindowLineSpacing = 95; // Abstand von Y0 | |
414 t7cC.WindowTab = 100; | |
415 t7cC.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; | |
416 t7cC.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
417 t7cC.WindowY0 = 165; //90; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
418 t7cC.WindowY1 = 415; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
419 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
420 /* used by warning message box */ |
38 | 421 t7cH.Image = &t7screen; |
422 t7cH.WindowNumberOfTextLines = 1; | |
423 t7cH.WindowLineSpacing = 95; // Abstand von Y0 | |
424 t7cH.WindowTab = 100; | |
425 t7cH.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; | |
426 t7cH.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
427 t7cH.WindowY0 = 46; //480 - 434; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
428 t7cH.WindowY1 = 390 - 46;// - 90; //46 + 390; //480 - (434 - 94); //434; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
429 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
430 /* used by warning custom box */ |
38 | 431 t7cW.Image = &t7screen; |
432 t7cW.WindowNumberOfTextLines = 3; | |
433 t7cW.WindowLineSpacing = 95; // Abstand von Y0 | |
434 t7cW.WindowTab = 100; | |
435 t7cW.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; | |
436 t7cW.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
437 t7cW.WindowY0 = 480 - (434 - 90); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
438 t7cW.WindowY1 = 480 - 90; //434 - 95; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
439 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
440 /* time and environment */ |
38 | 441 t7surfaceL.Image = &t7screen; |
442 t7surfaceL.WindowNumberOfTextLines = 9; | |
443 t7surfaceL.WindowLineSpacing = 53; | |
444 t7surfaceL.WindowTab = 100; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
445 t7surfaceL.WindowX0 = CUSTOMBOX_LINE_RIGHT + CUSTOMBOX_OUTSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
446 t7surfaceL.WindowX1 = 799; |
38 | 447 t7surfaceL.WindowY0 = 0; |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
448 t7surfaceL.WindowY1 = 479; |
38 | 449 |
450 t7surfaceR.Image = &t7screen; | |
451 t7surfaceR.WindowNumberOfTextLines = 9; | |
452 t7surfaceR.WindowLineSpacing = 53; | |
453 t7surfaceR.WindowTab = 100; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
454 t7surfaceR.WindowX0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
455 t7surfaceR.WindowX1 = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET; |
38 | 456 t7surfaceR.WindowY0 = 0; |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
457 t7surfaceR.WindowY1 = 479; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
458 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
459 /* info screen in the middle */ |
38 | 460 t7cY0free.Image = &t7screen; |
461 t7cY0free.WindowNumberOfTextLines = 1; | |
462 t7cY0free.WindowLineSpacing = 95; | |
463 t7cY0free.WindowTab = 100; | |
464 t7cY0free.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; | |
465 t7cY0free.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
466 t7cY0free.WindowY0 = 115; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
467 t7cY0free.WindowY1 = 365; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
468 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
469 /* voltage value (V or %) */ |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
470 t7voltage.Image = &t7screen; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
471 t7voltage.WindowNumberOfTextLines = 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
472 t7voltage.WindowLineSpacing = 10; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
473 t7voltage.WindowTab = 100; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
474 t7voltage.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
475 t7voltage.WindowX1 = t7voltage.WindowX0 + (18*3) +9; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
476 t7voltage.WindowY1 = TOP_LINE_HIGHT; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
477 t7voltage.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
478 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
479 /* battery symbol */ |
38 | 480 t7batt.Image = &t7screen; |
481 t7batt.WindowNumberOfTextLines = 1; | |
482 t7batt.WindowLineSpacing = 10; | |
483 t7batt.WindowTab = 100; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
484 t7batt.WindowX0 = t7voltage.WindowX1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
485 t7batt.WindowX1 = t7batt.WindowX0 + (52); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
486 t7batt.WindowY1 = TOP_LINE_HIGHT; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
487 t7batt.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
488 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
489 /* charger symbol */ |
38 | 490 t7charge.Image = &t7screen; |
491 t7charge.WindowNumberOfTextLines = 1; | |
492 t7charge.WindowLineSpacing = 10; | |
493 t7charge.WindowTab = 100; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
494 t7charge.WindowX1 = t7batt.WindowX0 - 18; |
38 | 495 t7charge.WindowX0 = t7charge.WindowX1 - 14; |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
496 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
497 t7charge.WindowY1 = TOP_LINE_HIGHT; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
498 t7charge.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
499 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
500 /* show dive mode OC / CC */ |
38 | 501 t7c1.Image = &t7screen; |
502 t7c1.WindowNumberOfTextLines = 1; | |
503 t7c1.WindowLineSpacing = 10; | |
504 t7c1.WindowTab = 100; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
505 t7c1.WindowX0 = t7batt.WindowX1 + 18; //CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
506 t7c1.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; //t7batt.WindowX1 + 18; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
507 t7c1.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
508 t7c1.WindowY1 = 479 - 435; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
509 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
510 /* Gas warnings and exit Sim*/ |
38 | 511 t7c2.Image = &t7screen; |
512 t7c2.WindowNumberOfTextLines = 1; | |
513 t7c2.WindowLineSpacing = 0; // Abstand von Y0 | |
514 t7c2.WindowTab = 100; | |
515 t7c2.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; | |
516 t7c2.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
517 t7c2.WindowY0 = 480 - 69; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
518 t7c2.WindowY1 = 479; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
519 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
520 /* Rotating compass */ |
38 | 521 t7pCompass.Image = &t7screenCompass; |
522 t7pCompass.WindowNumberOfTextLines = 1; | |
523 t7pCompass.WindowLineSpacing = 100; // Abstand von Y0 | |
524 t7pCompass.WindowTab = 100; | |
525 t7pCompass.WindowX0 = 0; | |
526 t7pCompass.WindowX1 = 1600-1; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
527 t7pCompass.WindowY0 = 479 - 75; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
528 t7pCompass.WindowY1 = 479; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
529 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
530 } |
38 | 531 |
532 init_t7_compass(); | |
533 } | |
534 | |
535 | |
536 void t7_refresh_sleepmode_fun(void) | |
537 { | |
538 uint32_t oldScreen; | |
539 | |
540 oldScreen = t7screen.FBStartAdress; | |
541 t7screen.FBStartAdress = getFrame(22); | |
542 | |
543 t7_refresh_sleep_design_fun(); | |
544 | |
545 if(get_globalState() == StStop) | |
546 { | |
166
255eedad4155
cleanup: get rid of some compile warnings
Jan Mulder <jlmulder@xs4all.nl>
parents:
149
diff
changeset
|
547 GFX_SetFramesTopBottom(t7screen.FBStartAdress, 0,480); |
38 | 548 } |
549 releaseFrame(22,oldScreen); | |
550 } | |
551 | |
552 | |
553 void t7_refresh(void) | |
554 { | |
555 static uint8_t last_mode = MODE_SURFACE; | |
556 SStateList status; | |
557 get_globalStateList(&status); | |
558 | |
559 t7screen.FBStartAdress = getFrame(22); | |
560 | |
561 background.pointer = 0; | |
562 | |
563 if(stateUsed->mode == MODE_DIVE) | |
564 { | |
565 if(last_mode != MODE_DIVE) | |
566 { | |
567 last_mode = MODE_DIVE; | |
568 /* lower left corner primary */ | |
569 selection_custom_field = settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary; | |
570 /* custom view primary OR debug if automatic return is off */ | |
571 if((settingsGetPointer()->tX_customViewTimeout == 0) && (settingsGetPointer()->showDebugInfo)) | |
572 selection_customview = CVIEW_noneOrDebug; | |
573 else | |
574 selection_customview = settingsGetPointer()->tX_customViewPrimary; | |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
575 |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
576 InitMotionDetection(); |
38 | 577 } |
578 | |
579 if(status.page == PageSurface) | |
580 set_globalState(StD); | |
581 | |
582 if(stateUsed->diveSettings.diveMode == DIVEMODE_Gauge) | |
583 { | |
584 settingsGetPointer()->design = 5; | |
585 releaseAllFramesExcept(22,t7screen.FBStartAdress); | |
586 releaseFrame(22,t7screen.FBStartAdress); | |
587 return; | |
588 } | |
589 else if(stateUsed->diveSettings.diveMode == DIVEMODE_Apnea) | |
590 { | |
591 settingsGetPointer()->design = 6; | |
592 releaseAllFramesExcept(22,t7screen.FBStartAdress); | |
593 releaseFrame(22,t7screen.FBStartAdress); | |
594 return; | |
595 } | |
596 else | |
597 { | |
598 t7_refresh_divemode(); | |
599 } | |
600 } | |
601 else // from if(stateUsed->mode == MODE_DIVE) | |
602 { | |
603 if(last_mode != MODE_SURFACE) | |
604 { | |
605 last_mode = MODE_SURFACE; | |
606 selection_customview = customviewsSurface[0]; | |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
607 InitMotionDetection(); |
38 | 608 } |
609 if(status.page == PageDive) | |
610 set_globalState(StS); | |
611 | |
612 if(settingsGetPointer()->showDebugInfo) | |
613 t7_refresh_surface_debugmode(); | |
614 else | |
615 t7_refresh_surface(); | |
616 } | |
617 | |
618 tHome_show_lost_connection_count(&t7screen); | |
619 | |
620 if(status.base == BaseHome) | |
621 { | |
622 if(background.pointer) | |
623 { | |
624 GFX_SetFrameTop(t7screen.FBStartAdress); | |
625 GFX_SetFrameBottom(background.pointer,background.x0 , background.y0, background.width, background.height); | |
626 } | |
627 else | |
166
255eedad4155
cleanup: get rid of some compile warnings
Jan Mulder <jlmulder@xs4all.nl>
parents:
149
diff
changeset
|
628 GFX_SetFramesTopBottom(t7screen.FBStartAdress, 0,480); |
38 | 629 } |
630 | |
631 releaseAllFramesExcept(22,t7screen.FBStartAdress); | |
632 } | |
633 | |
634 /* Private functions ---------------------------------------------------------*/ | |
635 | |
636 void t7_fill_surfacetime_helper(SSurfacetime *outArray, uint32_t inputMinutes, uint32_t inputSeconds) | |
637 { | |
638 inputSeconds += inputMinutes * 60; | |
639 | |
640 outArray->Total = inputSeconds; | |
641 | |
642 outArray->Days = inputSeconds / 86400;// (24*60*60); | |
643 inputSeconds -= 86400 * (uint32_t)outArray->Days; | |
644 | |
645 outArray->Hours = inputSeconds / 3600;// (60*60); | |
646 inputSeconds -= 3600 * (uint32_t)outArray->Hours; | |
647 | |
648 outArray->Minutes = inputSeconds / 60;; | |
649 inputSeconds -= 60 * (uint32_t)outArray->Minutes; | |
650 | |
651 outArray->Seconds = inputSeconds; | |
652 } | |
653 | |
654 void t7_refresh_sleep_design_fun(void) | |
655 { | |
656 static uint16_t state = 0; | |
657 uint16_t ytop = 0; | |
658 | |
659 state +=1; | |
660 if(state > 800) | |
661 state = 1; | |
662 | |
663 if(state > 400) | |
664 ytop = 800 - state; | |
665 else | |
666 ytop = 0 + state; | |
178
d36596281501
Minor: Replace stupid "Sleep Sleep Sleep" message with something more meaningful
heinrichsweikamp
parents:
174
diff
changeset
|
667 Gfx_write_label_var(&t7screen, 300,800, ytop,&FontT48,CLUT_Font020,"Shutting down..."); |
38 | 668 } |
669 | |
670 void t7_refresh_surface(void) | |
671 { | |
336
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
672 static float debounceAmbientPressure = 0; |
38 | 673 char text[256]; |
674 uint8_t date[3], year,month,day; | |
675 uint32_t color; | |
676 uint8_t customview_warnings = 0; | |
677 | |
678 RTC_DateTypeDef Sdate; | |
679 RTC_TimeTypeDef Stime; | |
680 RTC_DateTypeDef SdateFirmware; | |
681 | |
682 uint8_t dateNotSet = 0; | |
683 | |
684 uint8_t oxygen_percentage, gasOffset, actualGasID; | |
685 // uint16_t bottleFirstGas_bar; | |
686 point_t start, stop;//, other; | |
687 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
688 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
689 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
690 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
691 |
38 | 692 // update in all customview modes |
693 if(DataEX_check_RTE_version__needs_update() || font_update_required()) | |
694 updateNecessary = 1; | |
695 else | |
696 updateNecessary = 0; | |
697 | |
698 /* buttons */ | |
699 text[0] = TXT_2BYTE; | |
700 text[1] = TXT2BYTE_ButtonLogbook; | |
701 text[2] = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
702 write_content_simple(&t7screen, 0, 799, 479-TOP_LINE_HIGHT, &FontT24,text,CLUT_ButtonSurfaceScreen); |
38 | 703 |
704 text[0] = '\001'; | |
705 text[1] = TXT_2BYTE; | |
706 text[2] = TXT2BYTE_ButtonView; | |
707 text[3] = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
708 write_content_simple(&t7screen, 0, 799, 479-TOP_LINE_HIGHT, &FontT24,text,CLUT_ButtonSurfaceScreen); |
38 | 709 |
710 text[0] = '\002'; | |
711 text[1] = TXT_2BYTE; | |
712 text[2] = TXT2BYTE_ButtonMenu; | |
713 text[3] = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
714 write_content_simple(&t7screen, 0, 799, 479-TOP_LINE_HIGHT, &FontT24,text,CLUT_ButtonSurfaceScreen); |
38 | 715 |
716 /* was power on reset */ | |
717 //..... | |
718 /* removed hw 160802 in V1.1.1 | |
719 if(errorsInSettings) | |
720 { | |
721 sprintf(text,"Settings: %u",errorsInSettings); | |
722 GFX_write_string_color(&FontT42,&t7surfaceR,text,4,CLUT_WarningRed); | |
723 } | |
724 else | |
725 */ | |
726 if(DataEX_was_power_on()) | |
727 GFX_write_string_color(&FontT42,&t7surfaceR,"cold start",4,CLUT_WarningRed); | |
728 | |
729 /* time and date */ | |
730 translateDate(stateUsed->lifeData.dateBinaryFormat, &Sdate); | |
731 translateTime(stateUsed->lifeData.timeBinaryFormat, &Stime); | |
732 | |
733 firmwareGetDate(&SdateFirmware); | |
734 if(tHome_DateCode(&Sdate) < tHome_DateCode(&SdateFirmware)) | |
735 dateNotSet = 1; | |
736 else | |
737 dateNotSet = 0; | |
738 /* | |
739 if(Stime.Seconds % 2) | |
740 snprintf(text,255,"\001%02d:%02d",Stime.Hours,Stime.Minutes); | |
741 else | |
742 snprintf(text,255,"\001%02d\021:\020%02d",Stime.Hours,Stime.Minutes); | |
743 GFX_write_string(&FontT54,&t7surfaceR,text,3); | |
744 */ | |
745 // debug version: | |
746 if(Stime.Seconds % 2) | |
747 snprintf(text,255,"\001%02d:%02d:%02d",Stime.Hours,Stime.Minutes,Stime.Seconds); | |
748 else if(dateNotSet) | |
749 snprintf(text,255,"\001\021%02d:%02d:%02d\020",Stime.Hours,Stime.Minutes,Stime.Seconds); | |
750 else | |
751 snprintf(text,255,"\001%02d\021:\020%02d:%02d",Stime.Hours,Stime.Minutes,Stime.Seconds); | |
752 GFX_write_string(&FontT54,&t7surfaceR,text,3); | |
753 | |
754 if(settingsGetPointer()->date_format == DDMMYY) | |
755 { | |
756 day = 0; | |
757 month = 1; | |
758 year = 2; | |
759 } | |
760 else | |
761 if(settingsGetPointer()->date_format == MMDDYY) | |
762 { | |
763 day = 1; | |
764 month = 0; | |
765 year = 2; | |
766 } | |
767 else | |
768 { | |
769 day = 2; | |
770 month = 1; | |
771 year = 0; | |
772 } | |
773 date[day] = Sdate.Date; | |
774 date[month] = Sdate.Month; | |
775 date[year] = Sdate.Year; | |
776 | |
777 if((Stime.Seconds % 2) || (dateNotSet == 0)) | |
778 snprintf(text,255,"\001%02d.%02d.%02d",date[0],date[1],date[2]); | |
779 else | |
780 snprintf(text,255,"\001\021%02d.%02d.%02d",date[0],date[1],date[2]); | |
781 | |
782 GFX_write_string(&FontT54,&t7surfaceR,text,5); | |
783 | |
784 if(!DataEX_was_power_on() && !errorsInSettings) | |
785 { | |
786 text[0] = '\001'; | |
787 text[1] = '\004'; | |
788 text[2] = TXT_2BYTE; | |
789 text[3] = TXT2BYTE_Sunday; | |
790 text[4] = 0; | |
791 if(Sdate.WeekDay != RTC_WEEKDAY_SUNDAY) | |
792 text[3] += Sdate.WeekDay; | |
793 | |
794 if(!(Stime.Seconds % 2) && (dateNotSet == 1)) | |
795 text[1] = '\021'; | |
796 | |
797 GFX_write_string(&FontT24,&t7surfaceR,text,4); | |
798 } | |
799 | |
800 /* DEBUG uTick Pressure and Compass */ | |
801 /* | |
802 snprintf(text,255,"\001%u",stateRealGetPointer()->pressure_uTick_new - stateRealGetPointer()->pressure_uTick_old); | |
803 GFX_write_string(&FontT42,&t7surfaceR,text,1); | |
804 snprintf(text,255,"\001%u",HAL_GetTick() - stateRealGetPointer()->pressure_uTick_local_new); | |
805 GFX_write_string(&FontT42,&t7surfaceR,text,2); | |
806 | |
807 snprintf(text,255,"\001%u",stateRealGetPointer()->compass_uTick_new - stateRealGetPointer()->compass_uTick_old); | |
808 GFX_write_string(&FontT42,&t7surfaceR,text,6); | |
809 snprintf(text,255,"\001%u",HAL_GetTick() - stateRealGetPointer()->compass_uTick_local_new); | |
810 GFX_write_string(&FontT42,&t7surfaceR,text,7); | |
811 | |
812 static uint32_t bildschirmRefresh = 0; | |
813 snprintf(text,255,"\001%u",HAL_GetTick() - bildschirmRefresh); | |
814 GFX_write_string(&FontT42,&t7surfaceR,text,8); | |
815 bildschirmRefresh = HAL_GetTick(); | |
816 | |
817 static uint16_t bildschirmRefreshCount = 1; | |
818 if(bildschirmRefreshCount>10) | |
819 bildschirmRefreshCount = 1; | |
820 for(int i=0;i<bildschirmRefreshCount;i++) | |
821 text[i] = '.'; | |
822 text[bildschirmRefreshCount++] = 0; | |
823 GFX_write_string(&FontT42,&t7surfaceR,text,4); | |
824 */ | |
825 | |
826 /* noFlyTime or DesaturationTime */ | |
827 | |
828 if((!display_count_high_time) && (stateUsed->lifeData.no_fly_time_minutes)) | |
829 { | |
830 SSurfacetime NoFlyTime = {0,0,0,0}; | |
831 t7_fill_surfacetime_helper(&NoFlyTime,stateUsed->lifeData.no_fly_time_minutes, 0); | |
832 | |
833 if(NoFlyTime.Days) | |
834 { | |
835 snprintf(text,30,"\001%02d\016\016d\017 %02d\016\016h\017",NoFlyTime.Days, NoFlyTime.Hours); | |
836 } | |
837 else | |
838 { | |
839 snprintf(text,20,"\001%02d:%02d",NoFlyTime.Hours, NoFlyTime.Minutes); | |
840 } | |
841 | |
842 GFX_write_string(&FontT54,&t7surfaceR,text,7); | |
843 | |
844 text[0] = '\001'; | |
845 text[1] = '\022'; | |
846 text[2] = '\016'; | |
847 text[3] = '\016'; | |
848 text[4] = TXT_2BYTE; | |
849 text[5] = TXT2BYTE_noFly; | |
850 text[6] = 0; | |
851 GFX_write_string(&FontT48,&t7surfaceR,text,6); | |
852 } | |
853 else | |
854 if(stateUsed->lifeData.desaturation_time_minutes) | |
855 { | |
856 SSurfacetime DesatTime = {0,0,0,0}; | |
857 t7_fill_surfacetime_helper(&DesatTime,stateUsed->lifeData.desaturation_time_minutes, 0); | |
858 | |
859 if(DesatTime.Days) | |
860 { | |
861 snprintf(text,30,"\001%02d\016\016d\017 %02d\016\016h\017",DesatTime.Days, DesatTime.Hours); | |
862 } | |
863 else | |
864 { | |
865 snprintf(text,20,"\001%02d:%02d",DesatTime.Hours, DesatTime.Minutes); | |
866 } | |
867 GFX_write_string(&FontT54,&t7surfaceR,text,7); | |
868 | |
869 text[0] = '\001'; | |
870 text[1] = '\022'; | |
871 text[2] = '\016'; | |
872 text[3] = '\016'; | |
873 text[4] = TXT_2BYTE; | |
874 text[5] = TXT2BYTE_Desaturation; | |
875 text[6] = 0; | |
876 GFX_write_string(&FontT48,&t7surfaceR,text,6); | |
877 } | |
878 | |
879 /* Time since last dive */ | |
880 if(stateUsed->lifeData.surface_time_seconds) | |
881 { | |
882 SSurfacetime SurfTime = {0,0,0,0}; | |
883 t7_fill_surfacetime_helper(&SurfTime, 0, stateUsed->lifeData.surface_time_seconds); | |
884 | |
885 if(SurfTime.Days == 0) | |
886 { | |
887 snprintf(text,20,"\001\022%02d:%02d",SurfTime.Hours, SurfTime.Minutes); | |
888 } | |
889 else | |
890 { | |
891 snprintf(text,30,"\001\022%02d\016\016d\017 %02d\016\016h\017",SurfTime.Days, SurfTime.Hours); | |
892 } | |
893 | |
894 GFX_write_string(&FontT54,&t7surfaceR,text,2); | |
895 | |
896 | |
897 text[0] = '\001'; | |
898 text[1] = '\022'; | |
899 text[2] = '\016'; | |
900 text[3] = '\016'; | |
901 text[4] = TXT_2BYTE; | |
902 text[5] = TXT2BYTE_TimeSinceLastDive; | |
903 text[6] = 0; | |
904 GFX_write_string(&FontT48,&t7surfaceR,text,1); | |
905 } | |
906 | |
907 /* beta version */ | |
908 if( firmwareDataGetPointer()->versionBeta ) | |
909 { | |
910 snprintf(text,255,"\025 BETA"); | |
911 GFX_write_string(&FontT48,&t7surfaceL,text,2); | |
912 } | |
913 | |
914 /* surface pressure and temperature */ | |
915 if(stateUsed->sensorErrorsRTE == 0) | |
916 { | |
336
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
917 if(fabs(stateUsed->lifeData.pressure_surface_bar - stateUsed->lifeData.pressure_ambient_bar) < SHOW_AMBIENTE_SURFACE_DELTA) /* show ambient pressure if difference to surface is significant*/ |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
918 { |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
919 snprintf(text,30,"%01.0f\022\016\016 %s", stateUsed->lifeData.pressure_surface_bar * 1000.0f,TEXT_PRESSURE_UNIT); |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
920 } |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
921 else |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
922 { |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
923 if(fabsf(debounceAmbientPressure - stateUsed->lifeData.pressure_ambient_bar) > SHOW_AMBIENTE_DEBOUNCE) /* there might be a jitter ~+-1 HPa on the pressure signal => update only if delta is bigger */ |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
924 { |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
925 debounceAmbientPressure = stateUsed->lifeData.pressure_ambient_bar; |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
926 } |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
927 snprintf(text,30,"%01.0f\022\016\016 %s", debounceAmbientPressure * 1000.0f,TEXT_PRESSURE_UNIT); |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
928 } |
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
929 |
38 | 930 GFX_write_string(&FontT48,&t7surfaceL,text,3); |
931 | |
932 if(settingsGetPointer()->nonMetricalSystem) | |
933 snprintf(text,40,"%01.0f\140\022\016\016 fahrenheit",unit_temperature_float(stateUsed->lifeData.temperature_celsius)); | |
934 else | |
935 snprintf(text,30,"%01.0f\140\022\016\016 celsius",stateUsed->lifeData.temperature_celsius); | |
936 GFX_write_string(&FontT48,&t7surfaceL,text,4); | |
937 } | |
938 else | |
939 { | |
103
f5d2f02dc73f
Generalize TEXT of pressure unit
Dmitry Romanov <kitt@bk.ru>
parents:
102
diff
changeset
|
940 snprintf(text,30,"ERR\022\016\016 %s",TEXT_PRESSURE_UNIT); |
38 | 941 GFX_write_string(&FontT48,&t7surfaceL,text,3); |
942 | |
943 if(settingsGetPointer()->nonMetricalSystem) | |
944 snprintf(text,40,"ERR\022\016\016 fahrenheit"); | |
945 else | |
946 snprintf(text,30,"ERR\022\016\016 celsius"); | |
947 GFX_write_string(&FontT48,&t7surfaceL,text,4); | |
948 } | |
949 | |
950 | |
951 /* gas mix and selection */ | |
952 if((stateUsed->diveSettings.diveMode == DIVEMODE_Gauge) || (stateUsed->diveSettings.diveMode == DIVEMODE_Apnea)) | |
953 { | |
954 if(stateUsed->diveSettings.diveMode == DIVEMODE_Gauge) | |
955 text[0] = TXT_Gauge; | |
956 else | |
957 text[0] = TXT_Apnoe; | |
958 | |
959 text[1] = 0; | |
960 GFX_write_string(&FontT48,&t7surfaceL,text,6); | |
961 } | |
962 else | |
963 { | |
964 text[0] = '\021'; | |
965 text[1] = '1'; | |
966 text[2] = '\177'; | |
967 text[3] = '\177'; | |
968 text[4] = 10; | |
969 text[5] = '\021'; | |
970 text[6] = '2'; | |
971 text[7] = '\177'; | |
972 text[8] = '\177'; | |
973 text[9] = 10; | |
974 text[10] = '\021'; | |
975 text[11] = '3'; | |
976 text[12] = '\177'; | |
977 text[13] = '\177'; | |
978 text[14] = 10; | |
979 text[15] = '\021'; | |
980 text[16] = '4'; | |
981 text[17] = '\177'; | |
982 text[18] = '\177'; | |
983 text[19] = 10; | |
984 text[20] = '\021'; | |
985 text[21] = '5'; | |
986 text[22] = 0; | |
987 | |
988 if(stateUsed->diveSettings.diveMode == DIVEMODE_CCR) | |
989 gasOffset = NUM_OFFSET_DILUENT; | |
990 else | |
991 gasOffset = 0; | |
992 for(int i=1;i<=5;i++) | |
993 { | |
994 if(stateUsed->diveSettings.gas[i+gasOffset].note.ub.active) | |
995 text[(i-1)*5] -= 1; | |
996 } | |
997 GFX_write_string(&FontT48,&t7surfaceL,text,6); | |
998 | |
999 | |
1000 oxygen_percentage = 100; | |
1001 oxygen_percentage -= stateUsed->lifeData.actualGas.nitrogen_percentage; | |
1002 oxygen_percentage -= stateUsed->lifeData.actualGas.helium_percentage; | |
1003 | |
1004 tHome_gas_writer(oxygen_percentage,stateUsed->lifeData.actualGas.helium_percentage,&text[0]); | |
1005 GFX_write_string(&FontT48,&t7surfaceL,text,7); | |
1006 | |
1007 actualGasID = stateUsed->lifeData.actualGas.GasIdInSettings; | |
1008 /* | |
1009 bottleFirstGas_bar = stateUsed->lifeData.bottle_bar[actualGasID]; | |
1010 if(bottleFirstGas_bar) | |
1011 { | |
1012 snprintf(text,255,"%3u\022\016\016 bar",bottleFirstGas_bar); | |
1013 GFX_write_string(&FontT48,&t7surfaceL,text,8); | |
1014 } | |
1015 */ | |
1016 // after gas name :-) | |
1017 if(actualGasID > gasOffset) // security | |
1018 { | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1019 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1020 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1021 start.y = t7surfaceL.WindowY0 + (3 * t7surfaceL.WindowLineSpacing); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1022 start.x = t7surfaceL.WindowX0 + ((stateUsed->lifeData.actualGas.GasIdInSettings - gasOffset - 1) * 35); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1023 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1024 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1025 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1026 start.y = t7surfaceR.WindowY0 + (3 * t7surfaceR.WindowLineSpacing); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1027 start.x = t7surfaceR.WindowX0 + ((stateUsed->lifeData.actualGas.GasIdInSettings - gasOffset - 1) * 35); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1028 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1029 |
38 | 1030 stop.x = start.x + 25; |
1031 stop.y = start.y + 52; | |
1032 GFX_draw_box2(&t7screen, start, stop, CLUT_Font020, 1); | |
1033 } | |
1034 } | |
1035 | |
1036 /* dive mode */ | |
193
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1037 switch (stateUsed->diveSettings.diveMode) { |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1038 case DIVEMODE_CCR: |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1039 GFX_write_string(&FontT24, &t7c1, "\f\002" "CCR", 0); |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1040 break; |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1041 case DIVEMODE_OC: |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1042 GFX_write_string(&FontT24, &t7c1, "\f\002" "OC", 0); |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1043 break; |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1044 case DIVEMODE_Gauge: |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1045 GFX_write_string(&FontT24, &t7c1, "\f\002" "Gauge", 0); |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1046 break; |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1047 case DIVEMODE_Apnea: |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1048 GFX_write_string(&FontT24, &t7c1, "\f\002" "Apnea", 0); |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1049 break; |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1050 default: |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1051 GFX_write_string(&FontT24, &t7c1, "\f\002" "OC", 0); |
255326edf00b
Bugfix: show proper dive mode
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1052 } |
38 | 1053 |
1054 /*battery */ | |
1055 | |
1056 text[0] = '3'; | |
1057 text[1] = '1'; | |
1058 text[2] = '1'; | |
1059 text[3] = '1'; | |
1060 text[4] = '1'; | |
1061 text[5] = '1'; | |
1062 text[6] = '1'; | |
1063 text[7] = '1'; | |
1064 text[8] = '1'; | |
1065 text[9] = '1'; | |
1066 text[10] = '1'; | |
1067 text[11] = '0'; | |
1068 text[12] = 0; | |
1069 | |
1070 for(int i=1;i<=10;i++) | |
1071 { | |
1072 if( stateUsed->lifeData.battery_charge > (9 * i)) | |
1073 text[i] += 1; | |
1074 } | |
1075 | |
1076 if(stateUsed->chargeStatus == CHARGER_off) | |
1077 { | |
1078 if(stateUsed->warnings.lowBattery) | |
1079 { | |
1080 if(warning_count_high_time) | |
1081 { | |
1082 for(int i=1;i<=10;i++) | |
1083 text[i] = '1'; | |
1084 } | |
1085 else | |
1086 { | |
1087 text[1] = '2'; | |
1088 } | |
1089 GFX_write_string_color(&Batt24,&t7batt,text,0,CLUT_WarningRed); | |
1090 if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->lifeData.battery_charge < 140)) | |
1091 { | |
1092 snprintf(text,16,"\004\025\f\002%u%%",(uint8_t)stateUsed->lifeData.battery_charge); | |
1093 if(warning_count_high_time) | |
1094 text[0] = '\a'; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1095 GFX_write_string(&FontT24,&t7voltage,text,0); |
38 | 1096 } |
1097 else | |
1098 { | |
1099 snprintf(text,6,"\f%.1fV",stateUsed->lifeData.battery_voltage); | |
1100 GFX_write_string(&FontT24,&t7voltage,text,0); | |
1101 } | |
1102 } | |
1103 else | |
1104 { | |
1105 GFX_write_string_color(&Batt24,&t7batt,text,0,CLUT_BatteryStandard); | |
1106 | |
1107 if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->lifeData.battery_charge < 140)) | |
1108 { | |
1109 snprintf(text,16,"\f\002%u%%",(uint8_t)stateUsed->lifeData.battery_charge); | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1110 // GFX_write_string(&FontT24,&t7batt,text,0); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1111 GFX_write_string(&FontT24,&t7voltage,text,0); |
38 | 1112 } |
1113 else | |
1114 { | |
1115 snprintf(text,6,"\f%.1fV",stateUsed->lifeData.battery_voltage); | |
1116 GFX_write_string(&FontT24,&t7voltage,text,0); | |
1117 } | |
1118 } | |
1119 } | |
1120 else | |
1121 { | |
1122 GFX_write_string_color(&Batt24,&t7batt,text,0,CLUT_BatteryCharging); | |
1123 | |
1124 switch(stateUsed->chargeStatus) | |
1125 { | |
1126 case CHARGER_running: | |
1127 default: | |
1128 color = CLUT_BatteryStandard; | |
1129 break; | |
1130 case CHARGER_complete: | |
1131 color = CLUT_BatteryCharging; | |
1132 break; | |
1133 case CHARGER_lostConnection: | |
1134 color = CLUT_BatteryProblem; | |
1135 break; | |
1136 } | |
1137 text[0] = '4'; | |
1138 text[1] = 0; | |
1139 GFX_write_string_color(&Batt24,&t7charge,text,0,color); | |
1140 } | |
1141 | |
1142 | |
1143 | |
1144 customview_warnings = t7_test_customview_warnings_surface_mode(); | |
1145 if(customview_warnings && warning_count_high_time) | |
1146 t7_show_customview_warnings_surface_mode(); | |
1147 else | |
1148 t7_refresh_customview(); | |
1149 draw_frame(0,0, CLUT_pluginboxSurface, CLUT_Font020); | |
1150 } | |
1151 | |
1152 void t7_refresh_surface_debugmode(void) | |
1153 { | |
1154 // could be warning, now just to set RTE variables | |
1155 DataEX_check_RTE_version__needs_update(); | |
1156 | |
1157 | |
1158 char TextL1[4*TEXTSIZE]; | |
1159 uint32_t color; | |
1160 // uint8_t gasIdFirst; | |
1161 SSettings* pSettings = settingsGetPointer(); | |
198
878dc9e0dbc5
cleanup: another cleanup session (data_exchange_main.c)
Jan Mulder <jlmulder@xs4all.nl>
parents:
196
diff
changeset
|
1162 SDataExchangeSlaveToMaster *dataIn = get_dataInPointer(); |
38 | 1163 |
1164 SWindowGimpStyle windowGimp; | |
1165 | |
1166 RTC_DateTypeDef Sdate; | |
1167 RTC_TimeTypeDef Stime; | |
1168 | |
1169 translateDate(stateUsed->lifeData.dateBinaryFormat, &Sdate); | |
1170 translateTime(stateUsed->lifeData.timeBinaryFormat, &Stime); | |
1171 | |
1172 | |
1173 if(stateUsed->data_old__lost_connection_to_slave) | |
1174 { | |
1175 Gfx_write_label_var(&t7screen, 500,800, 0,&FontT42,CLUT_DiveMainLabel,"old"); | |
198
878dc9e0dbc5
cleanup: another cleanup session (data_exchange_main.c)
Jan Mulder <jlmulder@xs4all.nl>
parents:
196
diff
changeset
|
1176 snprintf(TextL1,TEXTSIZE,"%X %X %X %X",dataIn->header.checkCode[0],dataIn->header.checkCode[1],dataIn->header.checkCode[2],dataIn->header.checkCode[3]); |
38 | 1177 Gfx_write_label_var(&t7screen, 500,800, 45,&FontT48,CLUT_Font020,TextL1); |
1178 } | |
1179 else | |
1180 if(DataEX_lost_connection_count()) | |
1181 { | |
336
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
1182 snprintf(TextL1,TEXTSIZE,"\002%ld",DataEX_lost_connection_count()); |
38 | 1183 Gfx_write_label_var(&t7screen, 600,800, 45,&FontT48,CLUT_Font020,TextL1); |
1184 } | |
1185 | |
1186 snprintf(TextL1,TEXTSIZE,"\002%i",blockedFramesCount()); | |
1187 Gfx_write_label_var(&t7screen, 600,800, 0,&FontT48,CLUT_Font020,TextL1); | |
1188 | |
1189 if(stateUsed->lifeData.compass_DX_f | stateUsed->lifeData.compass_DY_f | stateUsed->lifeData.compass_DZ_f) | |
1190 { | |
1191 snprintf(TextL1,TEXTSIZE,"X %i",stateUsed->lifeData.compass_DX_f); | |
1192 Gfx_write_label_var(&t7screen, 0,400, 45,&FontT48,CLUT_Font020,TextL1); | |
1193 snprintf(TextL1,TEXTSIZE,"Y %i",stateUsed->lifeData.compass_DY_f); | |
1194 Gfx_write_label_var(&t7screen, 0,400,145,&FontT48,CLUT_Font020,TextL1); | |
1195 snprintf(TextL1,TEXTSIZE,"Z %i",stateUsed->lifeData.compass_DZ_f); | |
1196 Gfx_write_label_var(&t7screen, 0,400,255,&FontT48,CLUT_Font020,TextL1); | |
1197 return; | |
1198 } | |
103
f5d2f02dc73f
Generalize TEXT of pressure unit
Dmitry Romanov <kitt@bk.ru>
parents:
102
diff
changeset
|
1199 snprintf(TextL1,TEXTSIZE,"%01.0f %s",stateUsed->lifeData.pressure_ambient_bar * 1000.0f,TEXT_PRESSURE_UNIT); |
38 | 1200 Gfx_write_label_var(&t7screen, 0,400, 0,&FontT42,CLUT_DiveMainLabel,"Ambient Pressure"); |
1201 Gfx_write_label_var(&t7screen, 0,400, 45,&FontT48,CLUT_Font020,TextL1); | |
1202 | |
1203 snprintf(TextL1,TEXTSIZE,"%01.2f C",stateUsed->lifeData.temperature_celsius); | |
1204 Gfx_write_label_var(&t7screen, 0,400,100,&FontT42,CLUT_DiveMainLabel,"Temperature"); | |
1205 Gfx_write_label_var(&t7screen, 0,400,145,&FontT48,CLUT_Font020,TextL1); | |
1206 | |
1207 snprintf(TextL1,TEXTSIZE,"%03.0f %03.0f %03.0f",stateUsed->lifeData.compass_heading,stateUsed->lifeData.compass_roll,stateUsed->lifeData.compass_pitch); | |
1208 Gfx_write_label_var(&t7screen, 0,400,200,&FontT42,CLUT_DiveMainLabel,"Heading Roll Pitch"); | |
1209 Gfx_write_label_var(&t7screen, 0,400,255,&FontT48,CLUT_Font020,TextL1); | |
1210 | |
103
f5d2f02dc73f
Generalize TEXT of pressure unit
Dmitry Romanov <kitt@bk.ru>
parents:
102
diff
changeset
|
1211 snprintf(TextL1,TEXTSIZE,"%01.0f %s",stateUsed->lifeData.pressure_surface_bar * 1000.0f,TEXT_PRESSURE_UNIT); |
38 | 1212 Gfx_write_label_var(&t7screen, 0,400,310,&FontT42,CLUT_DiveMainLabel,"Surface Pressure"); |
1213 Gfx_write_label_var(&t7screen, 0,400,355,&FontT48,CLUT_Font020,TextL1); | |
1214 | |
1215 // gasIdFirst = stateUsed->lifeData.actualGas.GasIdInSettings; | |
198
878dc9e0dbc5
cleanup: another cleanup session (data_exchange_main.c)
Jan Mulder <jlmulder@xs4all.nl>
parents:
196
diff
changeset
|
1216 snprintf(TextL1,TEXTSIZE,"%u.%u",dataIn->RTE_VERSION_high,dataIn->RTE_VERSION_low); |
38 | 1217 Gfx_write_label_var(&t7screen, 320,500,100,&FontT42,CLUT_DiveMainLabel,"RTE"); |
1218 Gfx_write_label_var(&t7screen, 320,500,145,&FontT48,CLUT_Font020,TextL1); | |
1219 | |
1220 Gfx_write_label_var(&t7screen, 500,800,100,&FontT42,CLUT_DiveMainLabel,"Battery"); | |
1221 snprintf(TextL1,TEXTSIZE,"%01.4f V",stateUsed->lifeData.battery_voltage); | |
1222 Gfx_write_label_var(&t7screen, 500,800,145,&FontT48,CLUT_Font020,TextL1); | |
1223 snprintf(TextL1,TEXTSIZE,"%03.1f %%",stateUsed->lifeData.battery_charge); | |
1224 Gfx_write_label_var(&t7screen, 500,800,200,&FontT48,CLUT_Font020,TextL1); | |
1225 if(stateUsed->chargeStatus != CHARGER_off) | |
1226 { | |
1227 switch(stateUsed->chargeStatus) | |
1228 { | |
1229 case CHARGER_running: | |
1230 default: | |
1231 color = CLUT_BatteryStandard; | |
1232 break; | |
1233 case CHARGER_complete: | |
1234 color = CLUT_BatteryCharging; | |
1235 break; | |
1236 case CHARGER_lostConnection: | |
1237 color = CLUT_BatteryProblem; | |
1238 break; | |
1239 } | |
1240 TextL1[0] = '4'; | |
1241 TextL1[1] = 0; | |
1242 Gfx_write_label_var(&t7screen, 660,800,200,&Batt24,color,TextL1); | |
1243 } | |
1244 | |
1245 extern uint32_t base_tempLightLevel; | |
1246 | |
336
449e9e9632e4
Show actual instead of surface (30minute old) pressure if the actual differs significant (e.g. in plane or during pressure testing)
ideenmodellierer
parents:
315
diff
changeset
|
1247 snprintf(TextL1,TEXTSIZE,"# %u (%ld)",stateUsed->lifeData.ambient_light_level, base_tempLightLevel); |
38 | 1248 Gfx_write_label_var(&t7screen, 401,600,310,&FontT42,CLUT_DiveMainLabel,"Light"); |
1249 Gfx_write_label_var(&t7screen, 401,800,355,&FontT48,CLUT_Font020,TextL1); | |
1250 | |
1251 // snprintf(TextL1,TEXTSIZE,"# %u",stateUsed->lifeData.ambient_light_level); | |
1252 // Gfx_write_label_var(&t7screen, 601,800,310,&FontT42,CLUT_DiveMainLabel,"Light"); | |
1253 // Gfx_write_label_var(&t7screen, 601,800,355,&FontT48,CLUT_Font020,TextL1); | |
1254 | |
348 | 1255 /* show surface pressure state */ |
1256 if(stateUsed->lifeData.bool_temp1 ) | |
1257 { | |
1258 snprintf(TextL1,TEXTSIZE,"stable"); | |
1259 } | |
1260 else | |
1261 { | |
1262 snprintf(TextL1,TEXTSIZE,"unstable"); | |
1263 } | |
1264 Gfx_write_label_var(&t7screen, 500,800,400,&FontT48,CLUT_Font020,TextL1); | |
38 | 1265 |
1266 | |
1267 if(Sdate.Year < 15) | |
1268 { | |
1269 if(warning_count_high_time) | |
1270 { | |
1271 snprintf(TextL1,4*TEXTSIZE,"\017 %02d-%02d-%02d %02d:%02d:%02d", Sdate.Date, Sdate.Month, 2000 + Sdate.Year,Stime.Hours, Stime.Minutes, Stime.Seconds); | |
1272 Gfx_write_label_var(&t7screen, 0,800,420,&FontT48,CLUT_Font020,TextL1); | |
1273 } | |
1274 } | |
1275 else | |
1276 { | |
1277 if(pSettings->customtext[0]) | |
1278 { | |
1279 if(pSettings->customtext[59]) | |
1280 pSettings->customtext[59] = 0; | |
1281 Gfx_write_label_var(&t7screen, 0,400,420,&FontT24,CLUT_Font020,pSettings->customtext); | |
1282 } | |
1283 else | |
1284 { | |
1285 snprintf(TextL1,4*TEXTSIZE,"\017 %02d-%02d-%02d %02d:%02d:%02d Dives: %u", Sdate.Date, Sdate.Month, 2000 + Sdate.Year,Stime.Hours, Stime.Minutes, Stime.Seconds,pSettings->totalDiveCounter ); | |
1286 Gfx_write_label_var(&t7screen, 0,800,420,&FontT48,CLUT_Font020,TextL1); | |
1287 } | |
1288 } | |
1289 | |
1290 windowGimp.left = 400; | |
1291 windowGimp.top = 0; | |
1292 GFX_draw_image_monochrome(&t7screen, windowGimp, &ImgOSTC, 0); | |
1293 } | |
1294 | |
1295 /* CUSTOMVIEW | |
1296 * in the middle of the screen | |
1297 */ | |
1298 | |
1299 uint8_t t7_test_customview_warnings(void) | |
1300 { | |
1301 uint8_t count = 0; | |
1302 | |
1303 count = 0; | |
1304 count += stateUsed->warnings.decoMissed; | |
1305 count += stateUsed->warnings.ppO2Low; | |
1306 count += stateUsed->warnings.ppO2High; | |
1307 //count += stateUsed->warnings.lowBattery; | |
1308 count += stateUsed->warnings.sensorLinkLost; | |
1309 count += stateUsed->warnings.fallback; | |
1310 return count; | |
1311 } | |
1312 | |
1313 | |
1314 uint8_t t7_test_customview_warnings_surface_mode(void) | |
1315 { | |
1316 uint8_t count = 0; | |
1317 count = 0; | |
1318 count += stateUsed->cnsHigh_at_the_end_of_dive; | |
1319 count += stateUsed->decoMissed_at_the_end_of_dive; | |
1320 return count; | |
1321 } | |
1322 | |
1323 | |
1324 void t7_show_customview_warnings_surface_mode(void) | |
1325 { | |
1326 char text[256]; | |
1327 uint8_t textpointer, lineFree; | |
1328 | |
1329 text[0] = '\025'; | |
1330 text[1] = '\f'; | |
1331 text[2] = '\001'; | |
1332 text[3] = TXT_Warning; | |
1333 text[4] = 0; | |
1334 GFX_write_string(&FontT42,&t7cH,text,0); | |
1335 | |
1336 textpointer = 0; | |
1337 lineFree = 5; | |
1338 | |
1339 if(stateUsed->decoMissed_at_the_end_of_dive) | |
1340 { | |
1341 text[textpointer++] = TXT_2BYTE; | |
1342 text[textpointer++] = TXT2BYTE_WarnDecoMissed; | |
1343 text[textpointer++] = '\n'; | |
1344 text[textpointer++] = '\r'; | |
1345 text[textpointer] = 0; | |
1346 lineFree--; | |
1347 } | |
1348 | |
1349 if(stateUsed->cnsHigh_at_the_end_of_dive) | |
1350 { | |
1351 text[textpointer++] = TXT_2BYTE; | |
1352 text[textpointer++] = TXT2BYTE_WarnCnsHigh; | |
1353 text[textpointer++] = '\n'; | |
1354 text[textpointer++] = '\r'; | |
1355 text[textpointer] = 0; | |
1356 lineFree--; | |
1357 } | |
1358 if(textpointer != 0) | |
1359 GFX_write_string(&FontT48,&t7cW,text,1); | |
1360 } | |
1361 | |
1362 | |
1363 void t7_show_customview_warnings(void) | |
1364 { | |
1365 char text[256]; | |
1366 uint8_t textpointer, lineFree; | |
1367 | |
1368 text[0] = '\025'; | |
1369 text[1] = '\f'; | |
1370 text[2] = '\001'; | |
1371 text[3] = TXT_Warning; | |
1372 text[4] = 0; | |
1373 GFX_write_string(&FontT42,&t7cH,text,0); | |
1374 | |
1375 textpointer = 0; | |
1376 lineFree = 5; | |
1377 | |
1378 if(lineFree && stateUsed->warnings.decoMissed) | |
1379 { | |
1380 text[textpointer++] = TXT_2BYTE; | |
1381 text[textpointer++] = TXT2BYTE_WarnDecoMissed; | |
1382 text[textpointer++] = '\n'; | |
1383 text[textpointer++] = '\r'; | |
1384 text[textpointer] = 0; | |
1385 lineFree--; | |
1386 } | |
1387 | |
1388 if(lineFree && stateUsed->warnings.fallback) | |
1389 { | |
1390 text[textpointer++] = TXT_2BYTE; | |
1391 text[textpointer++] = TXT2BYTE_WarnFallback; | |
1392 text[textpointer++] = '\n'; | |
1393 text[textpointer++] = '\r'; | |
1394 text[textpointer] = 0; | |
1395 lineFree--; | |
1396 } | |
1397 | |
1398 if(lineFree && stateUsed->warnings.ppO2Low) | |
1399 { | |
1400 text[textpointer++] = TXT_2BYTE; | |
1401 text[textpointer++] = TXT2BYTE_WarnPPO2Low; | |
1402 text[textpointer++] = '\n'; | |
1403 text[textpointer++] = '\r'; | |
1404 text[textpointer] = 0; | |
1405 lineFree--; | |
1406 } | |
1407 | |
1408 if(lineFree && stateUsed->warnings.ppO2High) | |
1409 { | |
1410 text[textpointer++] = TXT_2BYTE; | |
1411 text[textpointer++] = TXT2BYTE_WarnPPO2High; | |
1412 text[textpointer++] = '\n'; | |
1413 text[textpointer++] = '\r'; | |
1414 text[textpointer] = 0; | |
1415 lineFree--; | |
1416 } | |
1417 | |
1418 if(lineFree && stateUsed->warnings.sensorLinkLost) | |
1419 { | |
1420 text[textpointer++] = TXT_2BYTE; | |
1421 text[textpointer++] = TXT2BYTE_WarnSensorLinkLost; | |
1422 text[textpointer++] = '\n'; | |
1423 text[textpointer++] = '\r'; | |
1424 text[textpointer] = 0; | |
1425 lineFree--; | |
1426 } | |
1427 /* | |
1428 if(lineFree && stateUsed->warnings.lowBattery) | |
1429 { | |
1430 text[textpointer++] = TXT_2BYTE; | |
1431 text[textpointer++] = TXT2BYTE_WarnBatteryLow; | |
1432 text[textpointer++] = '\n'; | |
1433 text[textpointer++] = '\r'; | |
1434 text[textpointer] = 0; | |
1435 lineFree--; | |
1436 } | |
1437 */ | |
1438 GFX_write_string(&FontT48,&t7cW,text,1); | |
1439 } | |
1440 | |
1441 | |
1442 void t7_set_customview_to_primary(void) | |
1443 { | |
1444 if(stateUsed->mode == MODE_DIVE) | |
1445 selection_customview = settingsGetPointer()->tX_customViewPrimary; | |
1446 } | |
1447 | |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1448 uint8_t t7_GetEnabled_customviews() |
38 | 1449 { |
379 | 1450 int8_t i; |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1451 uint8_t *pViews; |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1452 uint8_t increment = 1; |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1453 |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1454 uint8_t enabledViewCnt = 0; |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1455 uint32_t cv_config = settingsGetPointer()->cv_configuration; |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1456 |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1457 if(stateUsed->mode == MODE_DIVE) |
374 | 1458 pViews = (uint8_t*)customviewsDive; |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1459 else |
374 | 1460 pViews = (uint8_t*)customviewsSurface; |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1461 |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1462 while((*pViews != CVIEW_END)) |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1463 { |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1464 increment = 1; |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1465 /* check if view is enabled */ |
379 | 1466 i=0; |
1467 do | |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1468 { |
379 | 1469 if(*pViews == cv_changelist[i]) |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1470 { |
379 | 1471 if(!CHECK_BIT_THOME(cv_config, cv_changelist[i])) |
1472 { | |
1473 increment = 0; | |
1474 } | |
1475 break; | |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1476 } |
379 | 1477 i++; |
1478 } while(cv_changelist[i] != CVIEW_END); | |
1479 if(cv_changelist[i] == CVIEW_END) | |
1480 { | |
1481 increment = 0; | |
1482 } | |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1483 if (((*pViews == CVIEW_sensors) || (*pViews == CVIEW_sensors_mV)) && |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1484 ((stateUsed->diveSettings.ppo2sensors_deactivated) || (stateUsed->diveSettings.ccrOption == 0))) |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1485 { |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1486 increment = 0; |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1487 } |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1488 |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1489 pViews++; |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1490 enabledViewCnt += increment; |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1491 } |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1492 return enabledViewCnt; |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1493 } |
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1494 |
405 | 1495 uint8_t t7_customview_disabled(uint8_t view) |
1496 { | |
1497 uint8_t i = 0; | |
1498 uint8_t cv_disabled = 0; | |
1499 | |
1500 while(cv_changelist[i] != CVIEW_END) | |
1501 { | |
1502 if((view == cv_changelist[i]) && !CHECK_BIT_THOME(settingsGetPointer()->cv_configuration, cv_changelist[i])) | |
1503 { | |
1504 cv_disabled = 1; | |
1505 break; | |
1506 } | |
1507 i++; | |
1508 } | |
1509 | |
1510 if (((view == CVIEW_sensors) || (view == CVIEW_sensors_mV)) && | |
1511 ((stateUsed->diveSettings.ppo2sensors_deactivated) || (stateUsed->diveSettings.ccrOption == 0))) | |
1512 { | |
1513 cv_disabled = 1; | |
1514 } | |
1515 return cv_disabled; | |
1516 } | |
1517 | |
361
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1518 void t7_change_customview(uint8_t action) |
38 | 1519 { |
365
c18aebb03fed
Bugfix: selection of current view not working
ideenmodellierer
parents:
361
diff
changeset
|
1520 uint8_t *pViews; |
361
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1521 uint8_t *pStartView,*pCurView, *pLastView; |
38 | 1522 _Bool cv_disabled = 0; |
1523 | |
1524 if(stateUsed->mode == MODE_DIVE) | |
374 | 1525 pViews = (uint8_t*)customviewsDive; |
38 | 1526 else |
374 | 1527 pViews = (uint8_t*)customviewsSurface; |
38 | 1528 |
361
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1529 pStartView = pViews; |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1530 /* set pointer to currently selected view and count number of entries */ |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1531 while((*pViews != CVIEW_END)) |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1532 { |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1533 if (*pViews == selection_customview) |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1534 { |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1535 pCurView = pViews; |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1536 } |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1537 pViews++; |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1538 } |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1539 pLastView = pViews; |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1540 pViews = pCurView; |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1541 |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1542 if((action == ACTION_BUTTON_ENTER) || (action == ACTION_PITCH_POS)) |
38 | 1543 { |
361
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1544 if(*pViews < CVIEW_END) |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1545 pViews++; |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1546 |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1547 if(*pViews == CVIEW_END) |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1548 { |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1549 pViews = pStartView; |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1550 } |
38 | 1551 } |
361
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1552 else |
38 | 1553 { |
365
c18aebb03fed
Bugfix: selection of current view not working
ideenmodellierer
parents:
361
diff
changeset
|
1554 if(pViews == pStartView) |
361
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1555 { |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1556 pViews = pLastView - 1; |
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1557 } |
365
c18aebb03fed
Bugfix: selection of current view not working
ideenmodellierer
parents:
361
diff
changeset
|
1558 else |
c18aebb03fed
Bugfix: selection of current view not working
ideenmodellierer
parents:
361
diff
changeset
|
1559 { |
c18aebb03fed
Bugfix: selection of current view not working
ideenmodellierer
parents:
361
diff
changeset
|
1560 pViews--; |
c18aebb03fed
Bugfix: selection of current view not working
ideenmodellierer
parents:
361
diff
changeset
|
1561 } |
361
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
247
diff
changeset
|
1562 } |
365
c18aebb03fed
Bugfix: selection of current view not working
ideenmodellierer
parents:
361
diff
changeset
|
1563 |
366 | 1564 do |
1565 { | |
405 | 1566 cv_disabled = t7_customview_disabled(*pViews); |
366 | 1567 if(cv_disabled) /* view is disabled => jump to next view */ |
1568 { | |
369
210bffc496a3
Added a function to count the active custom views.
ideenmodellierer
parents:
367
diff
changeset
|
1569 if((action == ACTION_BUTTON_ENTER) || (action == ACTION_PITCH_POS)) |
366 | 1570 { |
1571 pViews++; | |
1572 if(*pViews == CVIEW_END) | |
1573 { | |
1574 pViews = pStartView; | |
1575 } | |
1576 } | |
1577 else | |
1578 { | |
1579 if(pViews == pStartView) | |
1580 { | |
1581 pViews = pLastView - 1; | |
1582 } | |
1583 else | |
1584 { | |
1585 pViews--; | |
1586 } | |
1587 } | |
1588 } | |
1589 } while(cv_disabled); | |
1590 | |
38 | 1591 selection_customview = *pViews; |
1592 } | |
1593 | |
1594 | |
1595 uint8_t t7_get_length_of_customtext(void) | |
1596 { | |
1597 uint8_t i = 0; | |
1598 settingsGetPointer()->customtext[60-1] = 0; | |
1599 while(settingsGetPointer()->customtext[i] > 0) | |
1600 i++; | |
1601 return i; | |
1602 } | |
1603 | |
1604 | |
1605 void t7_refresh_customview(void) | |
1606 { | |
405 | 1607 static uint8_t last_customview = CVIEW_END; |
38 | 1608 |
1609 char text[256]; | |
1610 uint16_t textpointer = 0; | |
1611 int16_t start; | |
51
8f8ea3a32e82
Resolved warnings pointing to possible invalid memory access
Ideenmodellierer
parents:
38
diff
changeset
|
1612 uint8_t lineCountCustomtext = 0; |
38 | 1613 int16_t shiftWindowY0; |
1614 RTC_DateTypeDef Sdate; | |
1615 RTC_TimeTypeDef Stime; | |
1616 float fPpO2limitHigh, fPpO2limitLow, fPpO2ofGasAtThisDepth; // CVIEW_Gaslist | |
1617 const SGasLine * pGasLine; // CVIEW_Gaslist | |
1618 uint8_t oxygen, helium; // CVIEW_Gaslist | |
1619 float depth, surface, fraction_nitrogen, fraction_helium, ead, end; // CVIEW_EADTime | |
1620 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1621 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1622 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1623 |
405 | 1624 if(last_customview != selection_customview) /* check if current selection is disabled and should be skipped */ |
1625 { | |
1626 if(t7_customview_disabled(selection_customview)) | |
1627 { | |
1628 t7_change_customview(ACTION_BUTTON_ENTER); | |
1629 } | |
1630 } | |
38 | 1631 switch(selection_customview) |
1632 { | |
1633 case CVIEW_noneOrDebug: | |
1634 if(settingsGetPointer()->showDebugInfo) | |
1635 { | |
1636 // header | |
1637 strcpy(text,"\032\f\001Debug"); | |
1638 GFX_write_string(&FontT42,&t7cH,text,0); | |
1639 // content | |
1640 t7_debug(); | |
1641 } | |
1642 break; | |
1643 | |
1644 case CVIEW_SummaryOfLeftCorner: | |
1645 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Summary); | |
1646 GFX_write_string(&FontT42,&t7cH,text,0); | |
1647 // content | |
1648 t7_SummaryOfLeftCorner(); | |
1649 break; | |
1650 | |
1651 case CVIEW_CompassDebug: | |
1652 snprintf(text,100,"\032\f\001Compass raw"); | |
1653 GFX_write_string(&FontT42,&t7cH,text,0); | |
1654 /* | |
1655 pStateReal->lifeData.compass_heading = dataIn.data[dataIn.boolCompassData].compass_heading; | |
1656 pStateReal->lifeData.compass_roll = dataIn.data[dataIn.boolCompassData].compass_roll; | |
1657 pStateReal->lifeData.compass_pitch = dataIn.data[dataIn.boolCompassData].compass_pitch; | |
1658 | |
1659 pStateReal->lifeData.compass_DX_f = dataIn.data[dataIn.boolCompassData].compass_DX_f; | |
1660 pStateReal->lifeData.compass_DY_f = dataIn.data[dataIn.boolCompassData].compass_DY_f; | |
1661 pStateReal->lifeData.compass_DZ_f = dataIn.data[dataIn.boolCompassData].compass_DZ_f; | |
1662 */ | |
1663 snprintf(text,255,"%1.1f\n\r%1.1f\n\r%1.1f\n\r%i\n\r%i\n\r%i" | |
1664 ,stateUsed->lifeData.compass_heading | |
1665 ,stateUsed->lifeData.compass_roll | |
1666 ,stateUsed->lifeData.compass_pitch | |
1667 ,stateUsed->lifeData.compass_DX_f | |
1668 ,stateUsed->lifeData.compass_DY_f | |
1669 ,stateUsed->lifeData.compass_DZ_f | |
1670 ); | |
1671 | |
1672 t7cY0free.WindowY0 = t7cC.WindowY0 - 10; | |
1673 t7cY0free.WindowLineSpacing = 48; | |
1674 t7cY0free.WindowNumberOfTextLines = 6; | |
1675 GFX_write_string(&FontT42, &t7cY0free, text, 1); | |
1676 break; | |
1677 | |
1678 case CVIEW_Hello: | |
1679 t7_logo_OSTC(); | |
1680 t7cC.WindowLineSpacing = 53; | |
1681 t7cC.WindowNumberOfTextLines = 5; | |
1682 shiftWindowY0 = 18; | |
1683 | |
1684 if(updateNecessary)//if(DataEX_check_RTE_version__needs_update() || font_update_required()) | |
1685 { | |
1686 if(warning_count_high_time) | |
1687 { | |
1688 shiftWindowY0 += 20; | |
1689 t7cC.WindowY0 -= shiftWindowY0; | |
1690 textpointer = 0; | |
1691 text[textpointer++] = TXT_2BYTE; | |
1692 text[textpointer++] = TXT2BYTE_PleaseUpdate; | |
1693 text[textpointer++] = '\n'; | |
1694 text[textpointer++] = '\r'; | |
1695 if(DataEX_check_RTE_version__needs_update()) | |
1696 { | |
1697 text[textpointer++] = TXT_2BYTE; | |
1698 text[textpointer++] = TXT2BYTE_RTE; | |
1699 text[textpointer++] = '\n'; | |
1700 text[textpointer++] = '\r'; | |
1701 } | |
1702 if(font_update_required()) | |
1703 { | |
1704 text[textpointer++] = TXT_2BYTE; | |
1705 text[textpointer++] = TXT2BYTE_Fonts; | |
1706 } | |
1707 text[textpointer++] = 0; | |
1708 GFX_write_string_color(&FontT42,&t7cC,text,1, CLUT_WarningRed); | |
1709 t7cC.WindowY0 += shiftWindowY0; | |
1710 } | |
1711 t7cC.WindowNumberOfTextLines = 3; | |
1712 } | |
1713 else // customtext | |
1714 { | |
1715 lineCountCustomtext = t7_customtextPrepare(text); | |
1716 if(lineCountCustomtext <= 2) | |
1717 shiftWindowY0 += 20+26; // nach unten | |
1718 else | |
1719 if(lineCountCustomtext <= 3) | |
1720 shiftWindowY0 += 20; // nach unten | |
1721 t7cC.WindowY0 -= shiftWindowY0; | |
1722 | |
1723 GFX_write_string(&FontT42,&t7cC,text,1); | |
1724 t7cC.WindowNumberOfTextLines = 3; | |
1725 t7cC.WindowY0 += shiftWindowY0; | |
1726 } | |
1727 if(lineCountCustomtext <= 4) | |
1728 { | |
1729 snprintf(text,100,"\001#%0u V%01u.%01u.%01u", | |
1730 settingsGetPointer()->serialLow + (256 * settingsGetPointer()->serialHigh), | |
1731 firmwareDataGetPointer()->versionFirst, | |
1732 firmwareDataGetPointer()->versionSecond, | |
1733 firmwareDataGetPointer()->versionThird | |
1734 ); | |
1735 GFX_write_string(&FontT24,&t7cC,text,0); | |
1736 } | |
1737 break; | |
1738 | |
1739 case CVIEW_Gaslist: | |
1740 // a lot of code taken from tMenuGas.c | |
1741 // header | |
1742 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Gaslist); | |
1743 GFX_write_string(&FontT42,&t7cH,text,0); | |
1744 // content | |
1745 textpointer = 0; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1746 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1747 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1748 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1749 t7cY0free.WindowY0 = t7cC.WindowY0 - 10; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1750 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1751 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1752 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1753 t7cY0free.WindowY1 = 400; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1754 } |
38 | 1755 t7cY0free.WindowLineSpacing = 48+9; |
1756 t7cY0free.WindowNumberOfTextLines = 5; // NUM_GASES == 5 | |
1757 t7cY0free.WindowTab = 420; | |
1758 | |
1759 pGasLine = settingsGetPointer()->gas; | |
1760 if(actualLeftMaxDepth(stateUsed)) | |
1761 fPpO2limitHigh = (float)(settingsGetPointer()->ppO2_max_deco) / 100; | |
1762 else | |
1763 fPpO2limitHigh = (float)(settingsGetPointer()->ppO2_max_std) / 100; | |
1764 fPpO2limitLow = (float)(settingsGetPointer()->ppO2_min) / 100; | |
1765 for(int gasId=1;gasId<=NUM_GASES;gasId++) | |
1766 { | |
1767 textpointer = 0; | |
1768 fPpO2ofGasAtThisDepth = (stateUsed->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * pGasLine[gasId].oxygen_percentage / 100; | |
1769 if(pGasLine[gasId].note.ub.active == 0) | |
1770 strcpy(&text[textpointer++],"\021"); | |
1771 else if((fPpO2ofGasAtThisDepth > fPpO2limitHigh) || (fPpO2ofGasAtThisDepth < fPpO2limitLow)) | |
1772 strcpy(&text[textpointer++],"\025"); | |
1773 else | |
1774 strcpy(&text[textpointer++],"\030"); | |
1775 | |
1776 text[textpointer++] = ' '; | |
1777 oxygen = pGasLine[gasId].oxygen_percentage; | |
1778 helium = pGasLine[gasId].helium_percentage; | |
1779 textpointer += write_gas(&text[textpointer], oxygen, helium); | |
1780 // Wechseltiefe | |
1781 if(pGasLine[gasId].depth_meter) | |
1782 { | |
1783 textpointer += snprintf(&text[textpointer],7,"\t%u %c%c",unit_depth_integer(pGasLine[gasId].depth_meter), unit_depth_char1(), unit_depth_char2()); | |
1784 } | |
1785 GFX_write_string(&FontT42, &t7cY0free, text, gasId); | |
1786 } | |
1787 break; | |
1788 | |
1789 case CVIEW_EADTime: | |
1790 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Info ); | |
1791 GFX_write_string(&FontT42,&t7cH,text,0); | |
1792 textpointer = 0; | |
1793 | |
1794 t7cY0free.WindowY0 = t7cC.WindowY0 - 10; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1795 if(pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1796 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1797 t7cY0free.WindowY1 = 400; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1798 } |
38 | 1799 t7cY0free.WindowLineSpacing = 48; |
1800 t7cY0free.WindowNumberOfTextLines = 6; | |
1801 | |
1802 // time | |
1803 snprintf(text,100,"\032\001%c%c",TXT_2BYTE,TXT2BYTE_Clock ); | |
1804 GFX_write_string(&FontT42, &t7cY0free, text, 1); | |
1805 | |
1806 translateDate(stateRealGetPointer()->lifeData.dateBinaryFormat, &Sdate); | |
1807 translateTime(stateRealGetPointer()->lifeData.timeBinaryFormat, &Stime); | |
1808 if(Stime.Seconds % 2) | |
1809 textpointer += snprintf(&text[textpointer],100,"\030\001%02d:%02d",Stime.Hours,Stime.Minutes); | |
1810 else | |
1811 textpointer += snprintf(&text[textpointer],100,"\030\001%02d\031:\030%02d",Stime.Hours,Stime.Minutes); | |
1812 GFX_write_string(&FontT42, &t7cY0free, text, 2); | |
1813 | |
1814 // EAD / END | |
1815 // The equivalent air depth can be calculated for depths in metres as follows: | |
1816 // EAD = (Depth + 10) � Fraction of N2 / 0.79 - 10 (wikipedia) | |
1817 // The equivalent narcotic depth can be calculated for depths in metres as follows: | |
1818 // END = (Depth + 10) � (1 - Fraction of helium) - 10 (wikipedia) | |
1819 decom_get_inert_gases((float)stateUsed->lifeData.pressure_ambient_bar,&(stateUsed->lifeData.actualGas),&fraction_nitrogen,&fraction_helium); | |
1820 depth = stateUsed->lifeData.pressure_ambient_bar; | |
1821 surface = stateUsed->lifeData.pressure_surface_bar; | |
1822 ead = 10.f * ((depth * fraction_nitrogen/0.79f) - surface); | |
1823 end = 10.0f * ((depth * (1.f - fraction_helium)) - surface); | |
1824 if(ead < 0) | |
1825 ead = 0; | |
1826 if(end < 0) | |
1827 end = 0; | |
1828 | |
1829 snprintf(text,100,"\032\001EAD"); | |
1830 GFX_write_string(&FontT42, &t7cY0free, text, 3); | |
1831 snprintf(text,100,"\030\001%01.1f %c%c" | |
1832 , unit_depth_float(ead) | |
1833 , unit_depth_char1() | |
1834 , unit_depth_char2() | |
1835 ); | |
1836 GFX_write_string(&FontT42, &t7cY0free, text, 4); | |
1837 | |
1838 snprintf(text,100,"\032\001END"); | |
1839 GFX_write_string(&FontT42, &t7cY0free, text, 5); | |
1840 snprintf(text,100,"\030\001%01.1f %c%c" | |
1841 , unit_depth_float(ead) | |
1842 , unit_depth_char1() | |
1843 , unit_depth_char2() | |
1844 ); | |
1845 GFX_write_string(&FontT42, &t7cY0free, text, 6); | |
1846 break; | |
1847 | |
1848 case CVIEW_Profile: | |
1849 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Profile); | |
1850 GFX_write_string(&FontT42,&t7cH,text,0); | |
1851 textpointer = 0; | |
1852 t7_miniLiveLogProfile(); | |
1853 break; | |
1854 | |
1855 case CVIEW_Tissues: | |
1856 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Tissues); | |
1857 GFX_write_string(&FontT42,&t7cH,text,0); | |
1858 textpointer = 0; | |
1859 t7_tissues(stateUsed); | |
1860 break; | |
1861 | |
1862 case CVIEW_sensors: | |
1863 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_O2monitor); | |
1864 GFX_write_string(&FontT42,&t7cH,text,0); | |
1865 textpointer = 0; | |
1866 text[textpointer++] = '\030'; // main color | |
1867 for(int i=0;i<3;i++) | |
1868 { | |
1869 if(stateUsed->diveSettings.ppo2sensors_deactivated & (1<<i)) | |
1870 { | |
1871 text[textpointer++] = '\031'; // labelcolor | |
1872 text[textpointer++] = '\001'; | |
1873 text[textpointer++] = '-'; | |
1874 text[textpointer++] = '\n'; | |
1875 text[textpointer++] = '\r'; | |
1876 text[textpointer++] = '\030'; // main color | |
1877 text[textpointer] = 0; | |
1878 } | |
1879 else | |
1880 { | |
1881 if(stateUsed->warnings.sensorOutOfBounds[i]) | |
1882 text[textpointer++] = '\025'; // Warning Red | |
1883 textpointer += snprintf(&text[textpointer],100,"\001%01.2f\n\r\030",stateUsed->lifeData.ppO2Sensor_bar[i]); | |
1884 } | |
1885 } | |
1886 t7cC.WindowLineSpacing = 95; | |
1887 t7cC.WindowNumberOfTextLines = 3; | |
1888 text[textpointer] = 0; | |
315
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1889 if(pSettings->FlipDisplay) |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1890 { |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1891 t7cC.WindowY1 -= 40; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1892 } |
38 | 1893 GFX_write_string(&FontT105,&t7cC,text,1); |
315
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1894 if(pSettings->FlipDisplay) |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1895 { |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1896 t7cC.WindowY1 += 40; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1897 } |
38 | 1898 break; |
1899 | |
1900 case CVIEW_sensors_mV: | |
1901 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_O2voltage); | |
1902 GFX_write_string(&FontT42,&t7cH,text,0); | |
1903 textpointer = 0; | |
1904 text[textpointer++] = '\030'; | |
1905 for(int i=0;i<3;i++) | |
1906 { | |
1907 if(stateUsed->diveSettings.ppo2sensors_deactivated & (1<<i)) | |
1908 { | |
1909 text[textpointer++] = '\031'; | |
1910 text[textpointer++] = '\001'; | |
1911 text[textpointer++] = '-'; | |
1912 text[textpointer++] = '\n'; | |
1913 text[textpointer++] = '\r'; | |
1914 text[textpointer++] = '\030'; | |
1915 text[textpointer] = 0; | |
1916 } | |
1917 else | |
1918 { | |
1919 if(stateUsed->warnings.sensorOutOfBounds[i]) | |
1920 text[textpointer++] = '\025'; | |
1921 textpointer += snprintf(&text[textpointer],100,"\001%01.1f mV\n\r\030",(stateUsed->lifeData.sensorVoltage_mV[i])); | |
1922 } | |
1923 } | |
1924 t7cC.WindowLineSpacing = 95; | |
1925 t7cC.WindowNumberOfTextLines = 3; | |
1926 text[textpointer] = 0; | |
315
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1927 if(pSettings->FlipDisplay) |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1928 { |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1929 t7cC.WindowY1 -= 40; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1930 } |
38 | 1931 GFX_write_string(&FontT48,&t7cC,text,1); |
315
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1932 if(pSettings->FlipDisplay) |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1933 { |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1934 t7cC.WindowY1 += 40; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
1935 } |
38 | 1936 break; |
1937 | |
1938 case CVIEW_Compass: | |
1939 default: | |
1940 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE, TXT2BYTE_Compass); | |
1941 GFX_write_string(&FontT42,&t7cH,text,0); | |
1942 t7_compass((uint16_t)stateUsed->lifeData.compass_heading, stateUsed->diveSettings.compassHeading); | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1943 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1944 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1945 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1946 t7cY0free.WindowX0 += 15; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1947 t7cY0free.WindowY0 = 230; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1948 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1949 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1950 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1951 t7cY0free.WindowX0 -= 15; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1952 t7cY0free.WindowY0 = 0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1953 t7cY0free.WindowY1 = 250; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1954 } |
38 | 1955 snprintf(text,100,"\030\001%03i`",(uint16_t)stateUsed->lifeData.compass_heading); |
1956 GFX_write_string(&FontT54,&t7cY0free,text,0); | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1957 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1958 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1959 t7cY0free.WindowX0 -= 15; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1960 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1961 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1962 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1963 t7cY0free.WindowX0 += 15; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1964 } |
38 | 1965 break; |
1966 | |
1967 case CVIEW_Decolist: | |
1968 snprintf(text,100,"\032\f\001 %c%c", TXT_2BYTE, TXT2BYTE_Decolist); | |
1969 GFX_write_string(&FontT42,&t7cH,text,0); | |
1970 | |
1971 const SDecoinfo * pDecoinfo; | |
1972 uint8_t depthNext, depthLast, depthSecond, depthInc; | |
1973 | |
1974 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE) | |
1975 pDecoinfo = &stateUsed->decolistBuehlmann; | |
1976 else | |
1977 pDecoinfo = &stateUsed->decolistVPM; | |
1978 | |
1979 depthLast = (uint8_t)(stateUsed->diveSettings.last_stop_depth_bar * 10); | |
1980 depthSecond = (uint8_t)(stateUsed->diveSettings.input_second_to_last_stop_depth_bar * 10); | |
1981 depthInc = (uint8_t)(stateUsed->diveSettings.input_next_stop_increment_depth_bar * 10); | |
1982 | |
1983 if(settingsGetPointer()->nonMetricalSystem) | |
1984 { | |
1985 depthLast = (uint8_t)unit_depth_integer(depthLast); | |
1986 depthSecond = (uint8_t)unit_depth_integer(depthSecond); | |
1987 depthInc = (uint8_t)unit_depth_integer(depthInc); | |
1988 } | |
1989 | |
1990 for(start=DECOINFO_STRUCT_MAX_STOPS-1; start>0; start--) | |
1991 if(pDecoinfo->output_stop_length_seconds[start]) break; | |
1992 start -= 6; | |
1993 if(start < 0) start = 0; | |
1994 | |
1995 textpointer = 0; | |
1996 for(int i=start;i<6+start;i++) | |
1997 { | |
1998 if(i == 0) | |
1999 depthNext = depthLast; | |
2000 else | |
2001 depthNext = depthSecond + (( i - 1 )* depthInc); | |
2002 | |
2003 if(pDecoinfo->output_stop_length_seconds[i]) | |
2004 textpointer += snprintf(&text[textpointer],20,"\030\034 %2u\016\016%c%c\017%3i'\n\r",depthNext, unit_depth_char1(), unit_depth_char2(), (pDecoinfo->output_stop_length_seconds[i]+59)/60); | |
2005 else | |
2006 textpointer += snprintf(&text[textpointer],20,"\031\034 %2u\016\016%c%c\017\n\r",depthNext, unit_depth_char1(), unit_depth_char2()); | |
2007 if(textpointer > 200) break; | |
2008 } | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2009 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2010 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2011 t7cY0free.WindowY0 = t7cC.WindowY0 - 10; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2012 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2013 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2014 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2015 t7cY0free.WindowY0 = t7cC.WindowY0 - 10; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2016 t7cY0free.WindowY1 = 400; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2017 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2018 |
38 | 2019 t7cY0free.WindowLineSpacing = 48; |
2020 t7cY0free.WindowNumberOfTextLines = 6; | |
2021 GFX_write_string(&FontT42, &t7cY0free, text, 1); | |
2022 break; | |
2023 } | |
2024 } | |
2025 | |
2026 | |
2027 | |
2028 /* DIVE MODE | |
2029 */ | |
2030 void t7_refresh_divemode(void) | |
2031 { | |
2032 char TextL1[TEXTSIZE]; | |
2033 char TextL2[TEXTSIZE]; | |
2034 | |
2035 char TextR1[TEXTSIZE]; | |
2036 char TextR2[TEXTSIZE]; | |
2037 char TextR3[TEXTSIZE]; | |
2038 | |
2039 char TextC1[2*TEXTSIZE]; | |
2040 char TextC2[TEXTSIZE]; | |
2041 uint8_t textPointer; | |
2042 | |
2043 point_t start, stop; | |
2044 uint8_t color; | |
2045 int textlength; | |
2046 | |
2047 uint16_t nextstopLengthSeconds = 0; | |
2048 uint8_t nextstopDepthMeter = 0; | |
2049 uint8_t oxygen_percentage = 0; | |
2050 SDivetime Divetime = {0,0,0, 0}; | |
2051 SDivetime SafetyStopTime = {0,0,0,0}; | |
2052 SDivetime TimeoutTime = {0,0,0,0}; | |
2053 uint8_t customview_warnings = 0; | |
2054 const SDecoinfo * pDecoinfo; | |
2055 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2056 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2057 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2058 |
38 | 2059 Divetime.Total = stateUsed->lifeData.dive_time_seconds_without_surface_time; |
2060 Divetime.Minutes = Divetime.Total / 60; | |
2061 Divetime.Seconds = Divetime.Total - ( Divetime.Minutes * 60 ); | |
2062 | |
2063 SafetyStopTime.Total = timer_Safetystop_GetCountDown(); | |
2064 SafetyStopTime.Minutes = SafetyStopTime.Total / 60; | |
2065 SafetyStopTime.Seconds = SafetyStopTime.Total - (SafetyStopTime.Minutes * 60); | |
2066 | |
2067 TimeoutTime.Total = settingsGetPointer()->timeoutDiveReachedZeroDepth - stateUsed->lifeData.counterSecondsShallowDepth; | |
2068 if(TimeoutTime.Total > settingsGetPointer()->timeoutDiveReachedZeroDepth) | |
2069 { | |
2070 TimeoutTime.Total = 0; | |
2071 } | |
2072 TimeoutTime.Minutes = TimeoutTime.Total / 60; | |
2073 TimeoutTime.Seconds = TimeoutTime.Total - (TimeoutTime.Minutes * 60); | |
2074 | |
2075 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE) | |
2076 pDecoinfo = &stateUsed->decolistBuehlmann; | |
2077 else | |
2078 pDecoinfo = &stateUsed->decolistVPM; | |
2079 | |
2080 if(pDecoinfo->output_time_to_surface_seconds) | |
2081 { | |
2082 tHome_findNextStop(pDecoinfo->output_stop_length_seconds, &nextstopDepthMeter, &nextstopLengthSeconds); | |
2083 } | |
2084 else | |
2085 { | |
2086 nextstopDepthMeter = 0; | |
2087 nextstopLengthSeconds = 0; | |
2088 } | |
2089 | |
2090 /* depth */ | |
174
ecb71521d004
Bugfix: make max depth move with current depth (part 2)
Jan Mulder <jlmulder@xs4all.nl>
parents:
166
diff
changeset
|
2091 float depth = unit_depth_float(stateUsed->lifeData.depth_meter); |
38 | 2092 |
2093 if(depth <= 0.3f) | |
2094 depth = 0; | |
2095 | |
2096 if(settingsGetPointer()->nonMetricalSystem) | |
2097 snprintf(TextL1,TEXTSIZE,"\032\f[feet]"); | |
2098 else | |
2099 snprintf(TextL1,TEXTSIZE,"\032\f%c",TXT_Depth); | |
2100 GFX_write_string(&FontT24,&t7l1,TextL1,0); | |
2101 | |
2102 if((stateUsed->lifeData.ascent_rate_meter_per_min > 8) || (stateUsed->lifeData.ascent_rate_meter_per_min < -10)) | |
2103 { | |
2104 snprintf(TextL1,TEXTSIZE,"\f\002%.0f %c%c/min " | |
2105 , unit_depth_float(stateUsed->lifeData.ascent_rate_meter_per_min) | |
2106 , unit_depth_char1() | |
2107 , unit_depth_char2() | |
2108 ); | |
2109 GFX_write_string(&FontT24,&t7l1,TextL1,0); | |
2110 } | |
2111 | |
2112 if( depth < 100) | |
2113 snprintf(TextL1,TEXTSIZE,"\020%01.1f",depth); | |
2114 else | |
2115 snprintf(TextL1,TEXTSIZE,"\020%01.0f",depth); | |
2116 | |
2117 t7_colorscheme_mod(TextL1); | |
2118 GFX_write_string(&FontT144,&t7l1,TextL1,1); | |
2119 | |
2120 /* max depth */ | |
2121 snprintf(TextL2,TEXTSIZE,"\032\f%c",TXT_MaxDepth); | |
2122 GFX_write_string(&FontT42,&t7l2,TextL2,0); | |
2123 | |
2124 if(unit_depth_float(stateUsed->lifeData.max_depth_meter) < 100) | |
2125 snprintf(TextL2,TEXTSIZE,"\020%01.1f",unit_depth_float(stateUsed->lifeData.max_depth_meter)); | |
2126 else | |
2127 snprintf(TextL2,TEXTSIZE,"\020%01.0f",unit_depth_float(stateUsed->lifeData.max_depth_meter)); | |
2128 | |
2129 t7_colorscheme_mod(TextL2); | |
2130 GFX_write_string(&FontT105,&t7l2,TextL2,1); | |
2131 | |
187
485c5135cf7f
cleanup: forgotten cleanup from 9da7dd50e2ec
Jan Mulder <jlmulder@xs4all.nl>
parents:
178
diff
changeset
|
2132 /* ascent rate graph */ |
392 | 2133 if(stateUsed->lifeData.ascent_rate_meter_per_min > 1) /* a value < 1 would cause a bar in negative direction brush rectangle of 12 and step width of 6 */ |
38 | 2134 { |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2135 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2136 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2137 start.y = t7l1.WindowY0 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2138 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2139 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2140 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2141 start.y = t7l3.WindowY0 - 25; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2142 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2143 |
38 | 2144 for(int i = 0; i<4;i++) |
2145 { | |
2146 start.y += 5*6; | |
2147 stop.y = start.y; | |
2148 start.x = CUSTOMBOX_LINE_LEFT - 1; | |
2149 stop.x = start.x - 17; | |
2150 GFX_draw_line(&t7screen, start, stop, 0); | |
2151 // start.x = CUSTOMBOX_LINE_RIGHT + 2; old right too | |
2152 // stop.x = start.x + 17; | |
2153 // GFX_draw_line(&t7screen, start, stop, 0); | |
2154 } | |
2155 // new thick bar design Sept. 2015 | |
2156 start.x = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET - 3 - 5; | |
2157 stop.x = start.x; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2158 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2159 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2160 start.y = t7l1.WindowY0 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2161 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2162 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2163 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2164 start.y = t7l3.WindowY0 - 25; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2165 } |
38 | 2166 stop.y = start.y + (uint16_t)(stateUsed->lifeData.ascent_rate_meter_per_min * 6); |
2167 stop.y -= 3; // wegen der Liniendicke von 12 anstelle von 9 | |
2168 if(stop.y >= 470) | |
2169 stop.y = 470; | |
2170 start.y += 7; // starte etwas weiter oben | |
2171 if(stateUsed->lifeData.ascent_rate_meter_per_min <= 10) | |
2172 color = CLUT_EverythingOkayGreen; | |
2173 else | |
2174 if(stateUsed->lifeData.ascent_rate_meter_per_min <= 15) | |
2175 color = CLUT_WarningYellow; | |
2176 else | |
2177 color = CLUT_WarningRed; | |
2178 | |
2179 GFX_draw_thick_line(12,&t7screen, start, stop, color); | |
2180 } | |
2181 //snprintf(TextL2,TEXTSIZE,"\f%.1f m/min",stateUsed->lifeData.ascent_rate_meter_per_min); | |
2182 | |
2183 /* divetime */ | |
2184 if(stateUsed->lifeData.counterSecondsShallowDepth) | |
2185 { | |
2186 snprintf(TextR1,TEXTSIZE,"\f\002\136 %u:%02u",TimeoutTime.Minutes, TimeoutTime.Seconds); | |
2187 GFX_write_string(&FontT42,&t7r1,TextR1,0); | |
2188 } | |
2189 else | |
2190 { | |
2191 snprintf(TextR1,TEXTSIZE,"\032\f\002%c",TXT_Divetime); | |
2192 GFX_write_string(&FontT42,&t7r1,TextR1,0); | |
2193 } | |
2194 | |
2195 if(Divetime.Minutes < 1000) | |
2196 snprintf(TextR1,TEXTSIZE,"\020\016\002%u:%02u",Divetime.Minutes, Divetime.Seconds); | |
2197 else | |
2198 snprintf(TextR1,TEXTSIZE,"\020\016\002%u'",Divetime.Minutes); | |
2199 t7_colorscheme_mod(TextR1); | |
2200 GFX_write_string(&FontT105,&t7r1,TextR1,1); | |
2201 | |
2202 /* next deco stop */ | |
2203 if(nextstopDepthMeter) | |
2204 { | |
2205 snprintf(TextR2,TEXTSIZE,"\032\f\002%c",TXT_Decostop); | |
2206 GFX_write_string(&FontT42,&t7r2,TextR2,0); | |
2207 textlength = snprintf(TextR2,TEXTSIZE,"\020\002%u%c%c %u'" | |
2208 , unit_depth_integer(nextstopDepthMeter) | |
2209 , unit_depth_char1_T105() | |
2210 , unit_depth_char2_T105() | |
2211 , (nextstopLengthSeconds+59)/60); | |
2212 t7_colorscheme_mod(TextR2); | |
2213 if(time_elapsed_ms(pDecoinfo->tickstamp, HAL_GetTick()) > MAX_AGE_DECOINFO_MS) | |
2214 TextR2[0] = '\021'; | |
2215 if(textlength <= 9) | |
2216 GFX_write_string(&FontT105,&t7r2,TextR2,1); | |
2217 else | |
2218 GFX_write_string(&FontT54,&t7r2,TextR2,1); | |
2219 } | |
2220 else if(SafetyStopTime.Total && (depth > timer_Safetystop_GetDepthUpperLimit())) | |
2221 { | |
2222 snprintf(TextR2,TEXTSIZE,"\032\f\002%c%c",TXT_2BYTE,TXT2BYTE_SafetyStop2); | |
2223 GFX_write_string(&FontT42,&t7r2,TextR2,0); | |
2224 snprintf(TextR2,TEXTSIZE,"\020\016\002%u:%02u",SafetyStopTime.Minutes,SafetyStopTime.Seconds); | |
2225 t7_colorscheme_mod(TextR2); | |
2226 GFX_write_string(&FontT105,&t7r2,TextR2,1); | |
2227 } | |
2228 | |
2229 /* tts - option 1 | |
2230 * ndl - option 2 | |
2231 * empty - option 3 */ | |
2232 if(pDecoinfo->output_time_to_surface_seconds) | |
2233 { | |
2234 snprintf(TextR3,TEXTSIZE,"\032\f\002%c",TXT_TTS); | |
2235 GFX_write_string(&FontT42,&t7r3,TextR3,0); | |
2236 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:
211
diff
changeset
|
2237 snprintf(TextR3,TEXTSIZE,"\020\002%i'",(pDecoinfo->output_time_to_surface_seconds + 59)/ 60); |
38 | 2238 else |
214
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
211
diff
changeset
|
2239 snprintf(TextR3,TEXTSIZE,"\020\002%ih",(pDecoinfo->output_time_to_surface_seconds + 59)/ 3600); |
38 | 2240 t7_colorscheme_mod(TextR3); |
2241 if(time_elapsed_ms(pDecoinfo->tickstamp, HAL_GetTick()) > MAX_AGE_DECOINFO_MS) | |
2242 TextR2[0] = '\021'; | |
2243 GFX_write_string(&FontT105,&t7r3,TextR3,1); | |
2244 } | |
2245 else if(pDecoinfo->output_ndl_seconds) | |
2246 { | |
2247 snprintf(TextR3,TEXTSIZE,"\032\f\002%c",TXT_Nullzeit); | |
2248 GFX_write_string(&FontT42,&t7r3,TextR3,0); | |
2249 if(pDecoinfo->output_ndl_seconds < 1000 * 60) | |
2250 snprintf(TextR3,TEXTSIZE,"\020\002%i'",pDecoinfo->output_ndl_seconds/60); | |
2251 else | |
2252 snprintf(TextR3,TEXTSIZE,"\020\002%ih",pDecoinfo->output_ndl_seconds/3600); | |
2253 t7_colorscheme_mod(TextR3); | |
2254 if(time_elapsed_ms(pDecoinfo->tickstamp, HAL_GetTick()) > MAX_AGE_DECOINFO_MS) | |
2255 TextR2[0] = '\021'; | |
2256 GFX_write_string(&FontT105,&t7r3,TextR3,1); | |
2257 } | |
2258 | |
2259 /* Menu Selection (and gas mix) */ | |
2260 if(get_globalState() == StDMGAS) | |
2261 { | |
2262 textPointer = 0; | |
2263 TextR1[textPointer++] = '\a'; | |
2264 // TextR1[textPointer++] = '\f'; | |
2265 TextR1[textPointer++] = '\001'; | |
2266 TextR1[textPointer++] = ' '; | |
2267 textPointer += tHome_gas_writer(stateUsed->diveSettings.gas[actualBetterGasId()].oxygen_percentage,stateUsed->diveSettings.gas[actualBetterGasId()].helium_percentage,&TextR1[textPointer]); | |
2268 TextR1[textPointer++] = '?'; | |
2269 TextR1[textPointer++] = ' '; | |
2270 TextR1[textPointer++] = 0; | |
2271 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
2272 } | |
2273 else if(get_globalState() == StDMSPT) | |
2274 { | |
2275 textPointer = 0; | |
2276 TextR1[textPointer++] = '\a'; | |
2277 TextR1[textPointer++] = '\001'; | |
2278 TextR1[textPointer++] = ' '; | |
2279 textPointer += snprintf(&TextR1[textPointer],5,"%f01.2",((float)(stateUsed->diveSettings.setpoint[actualBetterSetpointId()].setpoint_cbar))/100); | |
2280 TextR1[textPointer++] = '?'; | |
2281 TextR1[textPointer++] = ' '; | |
2282 TextR1[textPointer++] = 0; | |
2283 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
2284 } | |
2285 else if(get_globalState() == StDMENU) | |
2286 { | |
2287 snprintf(TextR1,TEXTSIZE,"\a\001%c%c", TXT_2BYTE, TXT2BYTE_DiveMenuQ); | |
2288 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
2289 } | |
2290 else if(get_globalState() == StDSIM1) | |
2291 { | |
2292 snprintf(TextR1,TEXTSIZE,"\a\001%c%c", TXT_2BYTE, TXT2BYTE_DiveQuitQ); | |
2293 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
2294 } | |
2295 else if(get_globalState() == StDSIM2) | |
2296 { | |
2297 if(settingsGetPointer()->nonMetricalSystem) | |
2298 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:-3.33ft "); | |
2299 else | |
2300 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:-1m "); | |
2301 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
2302 | |
2303 snprintf(TextR1,TEXTSIZE,"\a\f %u %c%c" | |
2304 , unit_depth_integer(simulation_get_aim_depth()) | |
2305 , unit_depth_char1() | |
2306 , unit_depth_char2() | |
2307 ); | |
2308 GFX_write_string_color(&FontT42,&t7l1,TextR1,0,CLUT_WarningYellow); | |
2309 | |
2310 } | |
2311 else if(get_globalState() == StDSIM3) | |
2312 { | |
2313 if(settingsGetPointer()->nonMetricalSystem) | |
2314 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:+3.33ft "); | |
2315 else | |
2316 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:+1m "); | |
2317 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
2318 snprintf(TextR1,TEXTSIZE,"\a\f %u %c%c" | |
2319 , unit_depth_integer(simulation_get_aim_depth()) | |
2320 , unit_depth_char1() | |
2321 , unit_depth_char2() | |
2322 ); | |
2323 GFX_write_string_color(&FontT42,&t7l1,TextR1,0,CLUT_WarningYellow); | |
2324 } | |
2325 else if(get_globalState() == StDSIM4) | |
2326 { | |
2327 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:+5' "); | |
2328 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
2329 snprintf(TextR1,TEXTSIZE,"\a\f %u %c%c" | |
2330 , unit_depth_integer(simulation_get_aim_depth()) | |
2331 , unit_depth_char1() | |
2332 , unit_depth_char2() | |
2333 ); | |
2334 GFX_write_string_color(&FontT42,&t7l1,TextR1,0,CLUT_WarningYellow); | |
2335 } | |
2336 else | |
2337 { | |
2338 /* gas mix */ | |
2339 oxygen_percentage = 100; | |
2340 oxygen_percentage -= stateUsed->lifeData.actualGas.nitrogen_percentage; | |
2341 oxygen_percentage -= stateUsed->lifeData.actualGas.helium_percentage; | |
2342 | |
2343 textPointer = 0; | |
2344 TextC2[textPointer++] = '\020'; | |
2345 if(stateUsed->warnings.betterGas && warning_count_high_time) | |
2346 { | |
2347 TextC2[textPointer++] = '\a'; | |
2348 } | |
2349 else | |
2350 { | |
2351 float fPpO2limitHigh, fPpO2now; | |
2352 | |
2353 if(actualLeftMaxDepth(stateUsed)) | |
2354 fPpO2limitHigh = settingsGetPointer()->ppO2_max_deco; | |
2355 else | |
2356 fPpO2limitHigh = settingsGetPointer()->ppO2_max_std; | |
2357 | |
2358 fPpO2now = (stateUsed->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * oxygen_percentage; | |
2359 | |
2360 if((fPpO2now > fPpO2limitHigh) || (fPpO2now < (float)(settingsGetPointer()->ppO2_min))) | |
2361 TextC2[textPointer++] = '\025'; | |
2362 } | |
2363 TextC2[textPointer++] = '\002'; | |
2364 textPointer += tHome_gas_writer(oxygen_percentage,stateUsed->lifeData.actualGas.helium_percentage,&TextC2[textPointer]); | |
2365 | |
2366 if(stateUsed->warnings.betterGas && warning_count_high_time) | |
2367 { | |
2368 if(TextC2[0] == '\020') | |
2369 { | |
2370 TextC2[0] = '\004'; // NOP | |
2371 } | |
2372 GFX_write_string_color(&FontT48,&t7c2,TextC2,0,CLUT_WarningYellow); | |
2373 } | |
2374 else | |
2375 { | |
2376 t7_colorscheme_mod(TextC2); | |
2377 GFX_write_string(&FontT48,&t7c2,TextC2,0); // T54 has only numbers | |
2378 } | |
2379 | |
2380 if(stateUsed->diveSettings.ccrOption) | |
2381 { | |
2382 if(stateUsed->diveSettings.diveMode == DIVEMODE_CCR) | |
2383 { | |
2384 snprintf(TextC2,TEXTSIZE,"\020%01.2f",stateUsed->lifeData.ppO2); | |
2385 if(stateUsed->warnings.betterSetpoint && warning_count_high_time && (stateUsed->diveSettings.diveMode == DIVEMODE_CCR)) | |
2386 { | |
2387 TextC2[0] = '\a'; // inverse instead of color \020 | |
2388 GFX_write_string_color(&FontT48,&t7c2,TextC2,0,CLUT_WarningYellow); | |
2389 } | |
2390 else | |
2391 { | |
2392 t7_colorscheme_mod(TextC2); | |
2393 GFX_write_string(&FontT48,&t7c2,TextC2,0); | |
2394 } | |
2395 } | |
2396 } | |
2397 else if(settingsGetPointer()->alwaysShowPPO2) | |
2398 { | |
2399 snprintf(TextC2,TEXTSIZE,"\020%01.2f",stateUsed->lifeData.ppO2); | |
2400 t7_colorscheme_mod(TextC2); | |
2401 GFX_write_string(&FontT48,&t7c2,TextC2,0); | |
2402 } | |
2403 } | |
2404 | |
2405 /* algorithm, ccr, bailout and battery */ | |
2406 /* and permanent warnings (CNS) */ | |
2407 | |
2408 if((stateUsed->warnings.cnsHigh) && display_count_high_time) | |
2409 { | |
2410 TextC2[0] = '\f'; | |
2411 TextC2[1] = TXT_2BYTE; | |
2412 TextC2[2] = TXT2BYTE_WarnCnsHigh; | |
2413 TextC2[3] = 0; | |
2414 GFX_write_string_color(&FontT48,&t7c1,TextC2,0,CLUT_WarningRed); | |
2415 } | |
2416 else | |
2417 { | |
2418 if(stateUsed->warnings.aGf) | |
2419 { | |
2420 GFX_write_string_color(&FontT48,&t7c1,"\f" "aGF",0,CLUT_WarningYellow); | |
2421 } | |
2422 else if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE) | |
2423 { | |
2424 GFX_write_string(&FontT48,&t7c1,"\027\f" "GF",0); | |
2425 } | |
2426 else | |
2427 { | |
2428 GFX_write_string(&FontT48,&t7c1,"\027\f" "VPM",0); | |
2429 } | |
2430 | |
2431 if(stateUsed->diveSettings.diveMode == DIVEMODE_CCR) | |
2432 GFX_write_string(&FontT24,&t7c1,"\027\f\002" "CCR",0); | |
2433 // GFX_write_string(&FontT24,&t7c1,"\f\177\177\x80" "CCR",0); | |
2434 else | |
2435 if(stateUsed->diveSettings.ccrOption) | |
2436 GFX_write_string(&FontT24,&t7c1,"\f\002\024" "Bailout",0); | |
2437 // GFX_write_string(&FontT24,&t7c1,"\f\177\177\x80\024" "Bailout",0); | |
2438 } | |
2439 TextC1[0] = '\020'; | |
2440 TextC1[1] = '3'; | |
2441 TextC1[2] = '1'; | |
2442 TextC1[3] = '1'; | |
2443 TextC1[4] = '1'; | |
2444 TextC1[5] = '1'; | |
2445 TextC1[6] = '1'; | |
2446 TextC1[7] = '1'; | |
2447 TextC1[8] = '1'; | |
2448 TextC1[9] = '1'; | |
2449 TextC1[10] = '1'; | |
2450 TextC1[11] = '1'; | |
2451 TextC1[12] = '0'; | |
2452 TextC1[13] = 0; | |
2453 | |
2454 for(int i=1;i<=10;i++) | |
2455 { | |
2456 if( stateUsed->lifeData.battery_charge > (9 * i)) | |
2457 TextC1[i+1] += 1; | |
2458 } | |
2459 | |
2460 if(stateUsed->warnings.lowBattery) | |
2461 { | |
2462 TextC1[0] = '\025'; | |
2463 if(warning_count_high_time) | |
2464 { | |
2465 for(int i=2;i<=11;i++) | |
2466 TextC1[i] = '1'; | |
2467 } | |
2468 else | |
2469 { | |
2470 TextC1[2] = '2'; | |
2471 } | |
2472 GFX_write_string(&Batt24,&t7batt,TextC1,0); | |
2473 | |
2474 if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->lifeData.battery_charge < 140)) | |
2475 { | |
2476 snprintf(TextC1,16,"\004\025\f\002%u%%",(uint8_t)stateUsed->lifeData.battery_charge); | |
2477 if(warning_count_high_time) | |
2478 TextC1[0] = '\a'; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2479 GFX_write_string(&FontT24,&t7voltage,TextC1,0); |
38 | 2480 } |
2481 } | |
2482 else | |
2483 { | |
2484 t7_colorscheme_mod(TextC1); | |
2485 GFX_write_string(&Batt24,&t7batt,TextC1,0); | |
2486 | |
2487 if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->lifeData.battery_charge < 140)) | |
2488 { | |
2489 snprintf(TextC1,16,"\020\f\002%u%%",(uint8_t)stateUsed->lifeData.battery_charge); | |
2490 t7_colorscheme_mod(TextC1); | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2491 GFX_write_string(&FontT24,&t7voltage,TextC1,0); // t7batt |
38 | 2492 } |
2493 } | |
2494 | |
2495 /* customizable left lower corner */ | |
2496 t7_refresh_divemode_userselected_left_lower_corner(); | |
2497 | |
2498 | |
2499 /* customview - option 1 | |
2500 * warning - option 2 */ | |
2501 if(stateUsed->warnings.numWarnings) | |
2502 customview_warnings = t7_test_customview_warnings(); | |
2503 | |
166
255eedad4155
cleanup: get rid of some compile warnings
Jan Mulder <jlmulder@xs4all.nl>
parents:
149
diff
changeset
|
2504 background.pointer = 0; |
38 | 2505 if(customview_warnings && warning_count_high_time) |
2506 t7_show_customview_warnings(); | |
2507 else | |
2508 t7_refresh_customview(); | |
2509 | |
2510 /* the frame */ | |
2511 draw_frame(1,1, CLUT_DIVE_pluginbox, CLUT_DIVE_FieldSeperatorLines); | |
2512 } | |
2513 | |
2514 void t7_set_field_to_primary(void) | |
2515 { | |
2516 if(stateUsed->mode == MODE_DIVE) | |
2517 selection_custom_field = settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary; | |
2518 } | |
2519 | |
2520 void t7_change_field(void) | |
2521 { | |
2522 const uint8_t minVal = 0; | |
2523 const uint8_t maxValGF = 8; | |
2524 const uint8_t maxValVPM = 7; | |
2525 uint8_t maxNow = maxValGF; | |
2526 | |
2527 selection_custom_field++; | |
2528 | |
2529 if(stateUsed->diveSettings.deco_type.ub.standard == VPM_MODE) | |
2530 maxNow = maxValVPM; | |
2531 | |
2532 if(selection_custom_field > maxNow) | |
2533 selection_custom_field = minVal; | |
2534 } | |
2535 | |
2536 | |
2537 void t7_refresh_divemode_userselected_left_lower_corner(void) | |
2538 { | |
2539 if(!selection_custom_field) | |
2540 return; | |
2541 | |
2542 char headerText[10]; | |
2543 char text[TEXTSIZE]; | |
2544 uint8_t textpointer = 0; | |
2545 _Bool tinyHeaderFont = 0; | |
2546 uint8_t line = 0; | |
2547 | |
2548 SDivetime Stopwatch = {0,0,0,0}; | |
2549 float fAverageDepth, fAverageDepthAbsolute; | |
2550 const SDecoinfo * pDecoinfoStandard; | |
2551 const SDecoinfo * pDecoinfoFuture; | |
2552 float fCNS; | |
2553 float temperature; | |
2554 | |
2555 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE) | |
2556 { | |
2557 pDecoinfoStandard = &stateUsed->decolistBuehlmann; | |
2558 pDecoinfoFuture = &stateUsed->decolistFutureBuehlmann; | |
2559 } | |
2560 else | |
2561 { | |
2562 pDecoinfoStandard = &stateUsed->decolistVPM; | |
2563 pDecoinfoFuture = &stateUsed->decolistFutureVPM; | |
2564 } | |
2565 | |
2566 Stopwatch.Total = timer_Stopwatch_GetTime(); | |
2567 Stopwatch.Minutes = Stopwatch.Total / 60; | |
2568 Stopwatch.Seconds = Stopwatch.Total - ( Stopwatch.Minutes * 60 ); | |
2569 fAverageDepth = timer_Stopwatch_GetAvarageDepth_Meter(); | |
2570 fAverageDepthAbsolute = stateUsed->lifeData.average_depth_meter; | |
2571 | |
2572 headerText[0] = '\032'; | |
2573 headerText[1] = '\f'; | |
2574 | |
2575 switch(selection_custom_field) | |
2576 { | |
2577 /* Temperature */ | |
2578 case 1: | |
2579 default: | |
189
8b8074080d7b
Bugfix: average temperature on arrival from RTE instead of display time
Jan Mulder <jlmulder@xs4all.nl>
parents:
187
diff
changeset
|
2580 temperature = unit_temperature_float(stateUsed->lifeData.temperature_celsius); |
38 | 2581 headerText[2] = TXT_Temperature; |
2582 textpointer = snprintf(text,TEXTSIZE,"\020\016%01.1f \140",temperature); // "\016\016%01.1f `" + C or F | |
2583 if(settingsGetPointer()->nonMetricalSystem == 0) | |
2584 text[textpointer++] = 'C'; | |
2585 else | |
2586 text[textpointer++] = 'F'; | |
2587 text[textpointer++] = 0; | |
2588 tinyHeaderFont = 0; | |
2589 break; | |
2590 | |
2591 /* Average Depth */ | |
2592 case 2: | |
2593 headerText[2] = TXT_AvgDepth; | |
2594 if(settingsGetPointer()->nonMetricalSystem) | |
2595 snprintf(text,TEXTSIZE,"\020%01.0f",unit_depth_float(fAverageDepthAbsolute)); | |
2596 else | |
2597 snprintf(text,TEXTSIZE,"\020%01.1f",fAverageDepthAbsolute); | |
2598 break; | |
2599 | |
2600 /* ppO2 */ | |
2601 case 3: | |
2602 headerText[2] = TXT_ppO2; | |
2603 snprintf(text,TEXTSIZE,"\020%01.2f",stateUsed->lifeData.ppO2); | |
2604 break; | |
2605 | |
2606 /* Stop Uhr */ | |
2607 case 4: | |
2608 headerText[2] = TXT_Stopwatch; | |
2609 if(settingsGetPointer()->nonMetricalSystem) | |
2610 snprintf(text,TEXTSIZE,"\020\016\016%u:%02u\n\r%01.0f",Stopwatch.Minutes, Stopwatch.Seconds,unit_depth_float(fAverageDepth)); | |
2611 else | |
2612 snprintf(text,TEXTSIZE,"\020\016\016%u:%02u\n\r%01.1f",Stopwatch.Minutes, Stopwatch.Seconds,fAverageDepth); | |
2613 tinyHeaderFont = 1; | |
2614 line = 1; | |
2615 break; | |
2616 | |
2617 /* Ceiling */ | |
2618 case 5: | |
2619 headerText[2] = TXT_Ceiling; | |
2620 if((pDecoinfoStandard->output_ceiling_meter > 99.9f) || (settingsGetPointer()->nonMetricalSystem)) | |
2621 snprintf(text,TEXTSIZE,"\020%01.0f",unit_depth_float(pDecoinfoStandard->output_ceiling_meter)); | |
2622 else | |
2623 snprintf(text,TEXTSIZE,"\020%01.1f",pDecoinfoStandard->output_ceiling_meter); | |
2624 break; | |
2625 | |
2626 /* Future TTS */ | |
2627 case 6: | |
2628 headerText[2] = TXT_FutureTTS; | |
214
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
211
diff
changeset
|
2629 if (pDecoinfoFuture->output_time_to_surface_seconds < 1000 * 60) |
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
211
diff
changeset
|
2630 snprintf(text,TEXTSIZE,"\020\016\016@+%u'\n\r" "%i' TTS",settingsGetPointer()->future_TTS, (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 60); |
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
211
diff
changeset
|
2631 else |
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
211
diff
changeset
|
2632 snprintf(text,TEXTSIZE,"\020\016\016@+%u'\n\r" "%ih TTS",settingsGetPointer()->future_TTS, (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 3600); |
38 | 2633 tinyHeaderFont = 1; |
2634 line = 1; | |
2635 break; | |
2636 | |
2637 /* CNS */ | |
2638 case 7: | |
2639 headerText[2] = TXT_CNS; | |
2640 fCNS = stateUsed->lifeData .cns; | |
2641 if(fCNS > 999) | |
2642 fCNS = 999; | |
2643 snprintf(text,TEXTSIZE,"\020%.0f\016\016%%\017",fCNS); | |
2644 break; | |
2645 | |
2646 /* actual GF */ | |
2647 case 8: | |
2648 headerText[2] = TXT_ActualGradient; | |
247
3949781096d4
feature: Relative GF to Saturation renames
Jan Mulder <jlmulder@xs4all.nl>
parents:
225
diff
changeset
|
2649 snprintf(text,TEXTSIZE,"\020%.0f\016\016%%\017",100 * pDecoinfoStandard->super_saturation); |
38 | 2650 break; |
2651 } | |
2652 headerText[3] = 0; | |
2653 | |
2654 if(tinyHeaderFont) | |
2655 GFX_write_string(&FontT24,&t7l3,headerText,0); | |
2656 else | |
2657 GFX_write_string(&FontT42,&t7l3,headerText,0); | |
2658 | |
2659 t7_colorscheme_mod(text); | |
2660 GFX_write_string(&FontT105,&t7l3,text,line); | |
2661 } | |
2662 | |
2663 /* Private functions ---------------------------------------------------------*/ | |
2664 | |
2665 uint8_t t7_customtextPrepare(char * text) | |
2666 { | |
2667 uint8_t i, j, textptr, lineCount; | |
2668 char nextChar; | |
2669 | |
2670 textptr = 0; | |
2671 lineCount = 0; | |
2672 | |
2673 text[textptr++] = TXT_MINIMAL; | |
2674 | |
2675 j = 0; | |
2676 i = 0; | |
2677 do | |
2678 { | |
2679 j += i; | |
2680 i = 0; | |
2681 do | |
2682 { | |
2683 nextChar = settingsGetPointer()->customtext[i+j]; | |
2684 i++; | |
2685 if((!nextChar) || (nextChar =='\n') || (nextChar =='\r')) | |
2686 break; | |
2687 text[textptr++] = nextChar; | |
2688 } while (i < 12); | |
2689 | |
2690 if(!nextChar) | |
2691 break; | |
2692 | |
2693 if(lineCount < 3) | |
2694 { | |
2695 text[textptr++] = '\n'; | |
2696 text[textptr++] = '\r'; | |
2697 } | |
2698 lineCount++; | |
2699 for(uint8_t k=0;k<2;k++) | |
2700 { | |
2701 nextChar = settingsGetPointer()->customtext[i+j+k]; | |
2702 if((nextChar =='\n') || (nextChar =='\r')) | |
2703 i++; | |
2704 else | |
2705 break; | |
2706 } | |
2707 | |
2708 } while (lineCount < 4); | |
2709 | |
2710 text[textptr] = 0; | |
2711 return lineCount; | |
2712 } | |
2713 | |
196
2885628ab3ba
Bugfix, minor: color the overview customview correctly
Jan Mulder <jlmulder@xs4all.nl>
parents:
193
diff
changeset
|
2714 static void t7_colorscheme_mod(char *text) { |
2885628ab3ba
Bugfix, minor: color the overview customview correctly
Jan Mulder <jlmulder@xs4all.nl>
parents:
193
diff
changeset
|
2715 char *p = text; |
2885628ab3ba
Bugfix, minor: color the overview customview correctly
Jan Mulder <jlmulder@xs4all.nl>
parents:
193
diff
changeset
|
2716 while (*p) { |
2885628ab3ba
Bugfix, minor: color the overview customview correctly
Jan Mulder <jlmulder@xs4all.nl>
parents:
193
diff
changeset
|
2717 if ((*p == '\020') && !GFX_is_colorschemeDiveStandard()) |
2885628ab3ba
Bugfix, minor: color the overview customview correctly
Jan Mulder <jlmulder@xs4all.nl>
parents:
193
diff
changeset
|
2718 *p = '\027'; |
2885628ab3ba
Bugfix, minor: color the overview customview correctly
Jan Mulder <jlmulder@xs4all.nl>
parents:
193
diff
changeset
|
2719 p++; |
2885628ab3ba
Bugfix, minor: color the overview customview correctly
Jan Mulder <jlmulder@xs4all.nl>
parents:
193
diff
changeset
|
2720 } |
38 | 2721 } |
2722 | |
2723 void draw_frame(_Bool PluginBoxHeader, _Bool LinesOnTheSides, uint8_t colorBox, uint8_t colorLinesOnTheSide) | |
2724 { | |
2725 point_t LeftLow, WidthHeight; | |
2726 point_t start, stop; | |
2727 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2728 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2729 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2730 |
38 | 2731 // plugin box |
2732 LeftLow.x = CUSTOMBOX_LINE_LEFT; | |
2733 WidthHeight.x = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_LINE_LEFT; | |
2734 LeftLow.y = 60; | |
2735 WidthHeight.y = 440 - LeftLow.y; | |
2736 GFX_draw_box(&t7screen, LeftLow, WidthHeight, 1, colorBox); | |
2737 | |
2738 if(PluginBoxHeader) | |
2739 { | |
2740 // plugin box - header | |
2741 start.x = CUSTOMBOX_LINE_LEFT; | |
2742 stop.x = CUSTOMBOX_LINE_RIGHT; | |
2743 stop.y = start.y = 440 - 60; | |
2744 GFX_draw_line(&t7screen, start, stop, colorBox); | |
2745 } | |
2746 | |
2747 if(LinesOnTheSides) | |
2748 { | |
2749 // aufteilung links | |
2750 start.x = 0; | |
2751 stop.x = CUSTOMBOX_LINE_LEFT; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2752 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2753 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2754 stop.y = start.y = t7l1.WindowY0 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2755 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2756 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2757 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2758 stop.y = start.y = 480 - t7l1.WindowY1 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2759 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2760 |
38 | 2761 GFX_draw_line(&t7screen, start, stop, colorLinesOnTheSide); |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2762 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2763 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2764 stop.y = start.y = t7l2.WindowY0 -1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2765 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2766 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2767 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2768 stop.y = start.y = 480 - t7l2.WindowY1 -1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2769 } |
38 | 2770 GFX_draw_line(&t7screen, start, stop, colorLinesOnTheSide); |
2771 | |
2772 // aufteilung rechts | |
2773 start.x = CUSTOMBOX_LINE_RIGHT; | |
2774 stop.x = 799; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2775 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2776 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2777 stop.y = start.y = t7l1.WindowY0 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2778 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2779 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2780 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2781 stop.y = start.y = 480 - t7l1.WindowY1 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2782 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2783 |
38 | 2784 GFX_draw_line(&t7screen, start, stop, colorLinesOnTheSide); |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2785 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2786 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2787 stop.y = start.y = t7l2.WindowY0 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2788 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2789 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2790 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2791 stop.y = start.y = 480 - t7l2.WindowY1 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2792 } |
38 | 2793 GFX_draw_line(&t7screen, start, stop, colorLinesOnTheSide); |
2794 } | |
2795 } | |
2796 | |
2797 | |
2798 /* Compass like TCOS shellfish | |
2799 * input is 0 to 359 | |
2800 * 2 px / 1 degree | |
2801 * Range is 148 degree with CUSTOMBOX_SPACE_INSIDE = 296 | |
2802 * one side is 74 degree (less than 90 degree) | |
2803 * internal 360 + 180 degree of freedom | |
2804 * use positive values only, shift by 360 below 90 mid position | |
2805 */ | |
2806 | |
2807 | |
2808 point_t t7_compass_circle(uint8_t id, uint16_t degree) | |
2809 { | |
2810 float fCos, fSin; | |
2811 const float piMult = ((2 * 3.14159) / 360); | |
2812 // const int radius[4] = {95,105,115,60}; | |
2813 const int radius[4] = {95,105,115,100}; | |
2814 const point_t offset = {.x = 400, .y = 250}; | |
2815 | |
2816 static point_t r[4][360] = { 0 }; | |
2817 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2818 if(r[0][0].y == 0) /* calc table at first call only */ |
38 | 2819 { |
2820 for(int i=0;i<360;i++) | |
2821 { | |
2822 fCos = cos(i * piMult); | |
2823 fSin = sin(i * piMult); | |
2824 for(int j=0;j<4;j++) | |
2825 { | |
2826 r[j][i].x = offset.x + (int)(fSin * radius[j]); | |
2827 r[j][i].y = offset.y + (int)(fCos * radius[j]); | |
2828 } | |
2829 } | |
2830 } | |
2831 if(id > 3) id = 0; | |
2832 if(degree > 359) degree = 0; | |
2833 return r[id][degree]; | |
2834 } | |
2835 | |
2836 /* range should be 0 to 30 bar if 300 meter with 100% of nitrogen or helium | |
2837 * T24 is 28 high | |
2838 */ | |
2839 void t7_tissues(const SDiveState * pState) | |
2840 { | |
2841 point_t start, change, stop; | |
2842 float value; | |
2843 uint16_t front, cns100pixel; | |
2844 char text[256]; | |
2845 uint8_t textpointer = 0; | |
2846 uint8_t color; | |
2847 | |
2848 float percent_N2; | |
2849 float percent_He; | |
2850 float partial_pressure_N2; | |
2851 float partial_pressure_He; | |
2852 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2853 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2854 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2855 |
38 | 2856 |
2857 /* N2 */ | |
2858 t7cY0free.WindowLineSpacing = 28 + 48 + 14; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2859 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2860 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2861 t7cY0free.WindowY0 = t7cH.WindowY0 - 5 - 2 * t7cY0free.WindowLineSpacing; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2862 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2863 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2864 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2865 t7cY0free.WindowY0 = t7cH.WindowY0 + 15; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2866 t7cY0free.WindowY1 = t7cY0free.WindowY0 + 250; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2867 } |
38 | 2868 t7cY0free.WindowNumberOfTextLines = 3; |
2869 | |
2870 text[textpointer++] = '\030'; | |
2871 text[textpointer++] = TXT_2BYTE; | |
2872 text[textpointer++] = TXT2BYTE_Nitrogen; | |
2873 text[textpointer++] = '\n'; | |
2874 text[textpointer++] = '\r'; | |
2875 text[textpointer++] = TXT_2BYTE; | |
2876 text[textpointer++] = TXT2BYTE_Helium; | |
2877 text[textpointer++] = '\n'; | |
2878 text[textpointer++] = '\r'; | |
2879 text[textpointer++] = TXT_2BYTE; | |
2880 text[textpointer++] = TXT2BYTE_CNS; | |
2881 text[textpointer++] = 0; | |
2882 | |
2883 GFX_write_string(&FontT24, &t7cY0free, text, 1); | |
2884 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2885 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2886 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2887 start.y = t7cH.WindowY0 - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2888 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2889 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2890 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2891 start.y = t7cH.WindowY1 - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2892 } |
38 | 2893 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
2894 stop.x = start.x + CUSTOMBOX_SPACE_INSIDE; | |
2895 | |
2896 for(int i=0;i<16;i++) | |
2897 { | |
2898 stop.y = start.y; | |
2899 change.y = start.y; | |
2900 | |
2901 value = pState->lifeData.tissue_nitrogen_bar[i] - 0.7512f; | |
222
9b4b3decd9ba
Bugfix: correct presentation error in tissues custom view
Jan Mulder <jlmulder@xs4all.nl>
parents:
215
diff
changeset
|
2902 value *= 80; |
38 | 2903 |
2904 if(value < 0) | |
2905 front = 0; | |
2906 else | |
2907 if(value > CUSTOMBOX_SPACE_INSIDE) | |
2908 front = CUSTOMBOX_SPACE_INSIDE; | |
2909 else | |
2910 front = (uint16_t)value; | |
2911 | |
2912 change.x = start.x + front; | |
2913 if(change.x != start.x) | |
2914 GFX_draw_thick_line(1,&t7screen, start, change, CLUT_Font030); | |
2915 if(change.x != stop.x) | |
2916 GFX_draw_thick_line(1,&t7screen, change, stop, CLUT_Font031); | |
2917 | |
2918 start.y -= 3; | |
2919 } | |
2920 | |
2921 /* He */ | |
2922 start.y -= 28 + 14; | |
2923 for(int i=0;i<16;i++) | |
2924 { | |
2925 stop.y = start.y; | |
2926 change.y = start.y; | |
2927 | |
2928 value = pState->lifeData.tissue_helium_bar[i]; | |
2929 value *= 80;//20 | |
2930 | |
2931 if(value < 0) | |
2932 front = 0; | |
2933 else if(value > CUSTOMBOX_SPACE_INSIDE) | |
2934 front = CUSTOMBOX_SPACE_INSIDE; | |
2935 else | |
2936 front = (uint16_t)value; | |
2937 | |
2938 change.x = start.x + front; | |
2939 if(change.x != start.x) | |
2940 GFX_draw_thick_line(1,&t7screen, start, change, CLUT_Font030); | |
2941 if(change.x != stop.x) | |
2942 GFX_draw_thick_line(1,&t7screen, change, stop, CLUT_Font031); | |
2943 | |
2944 start.y -= 3; | |
2945 } | |
2946 | |
2947 /* CNS == Oxygen */ | |
2948 start.y -= 28 + 14; | |
2949 | |
2950 cns100pixel = (8 * CUSTOMBOX_SPACE_INSIDE) / 10; | |
2951 value = pState->lifeData.cns; | |
2952 value *= cns100pixel; | |
2953 value /= 100; | |
2954 | |
2955 if(value < 0) | |
2956 front = 0; | |
2957 else if(value > CUSTOMBOX_SPACE_INSIDE) | |
2958 front = CUSTOMBOX_SPACE_INSIDE; | |
2959 else | |
2960 front = (uint16_t)value; | |
2961 | |
2962 if(pState->lifeData.cns < 95) | |
2963 color = CLUT_Font030; | |
2964 else if(pState->lifeData.cns < 100) | |
2965 color = CLUT_WarningYellow; | |
2966 else | |
2967 color = CLUT_WarningRed; | |
2968 | |
2969 for(int i=0;i<16;i++) | |
2970 { | |
2971 stop.y = start.y; | |
2972 change.y = start.y; | |
2973 | |
2974 change.x = start.x + front; | |
2975 if(change.x != start.x) | |
2976 GFX_draw_thick_line(1,&t7screen, start, change, color); | |
2977 if(change.x != stop.x) | |
2978 GFX_draw_thick_line(1,&t7screen, change, stop, CLUT_Font031); | |
2979 | |
2980 start.y -= 3; | |
2981 } | |
2982 | |
2983 /* where is the onload/offload limit for N2 and He */ | |
2984 decom_get_inert_gases(pState->lifeData.pressure_ambient_bar, &pState->lifeData.actualGas, &percent_N2, &percent_He); | |
2985 partial_pressure_N2 = (pState->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * percent_N2; | |
2986 partial_pressure_He = (pState->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * percent_He; | |
2987 | |
2988 // Nitrogen vertical bar | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2989 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2990 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2991 start.y = t7cH.WindowY0 + 1 - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2992 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2993 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2994 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2995 start.y = t7cH.WindowY1 - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2996 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2997 |
38 | 2998 stop.y = start.y - (3 * 15) - 1; |
222
9b4b3decd9ba
Bugfix: correct presentation error in tissues custom view
Jan Mulder <jlmulder@xs4all.nl>
parents:
215
diff
changeset
|
2999 if((percent_N2 > 0) && (partial_pressure_N2 > 0.7512f)) |
38 | 3000 { |
222
9b4b3decd9ba
Bugfix: correct presentation error in tissues custom view
Jan Mulder <jlmulder@xs4all.nl>
parents:
215
diff
changeset
|
3001 value = partial_pressure_N2 - 0.7512f; |
9b4b3decd9ba
Bugfix: correct presentation error in tissues custom view
Jan Mulder <jlmulder@xs4all.nl>
parents:
215
diff
changeset
|
3002 value *= 80; |
38 | 3003 |
3004 if(value < 0) | |
3005 front = 3; | |
3006 else if(value + 5 > CUSTOMBOX_SPACE_INSIDE) | |
3007 front = CUSTOMBOX_SPACE_INSIDE - 3; | |
3008 else | |
3009 front = (uint16_t)value; | |
3010 } | |
3011 else | |
3012 { | |
3013 front = 1; | |
3014 } | |
3015 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + front; | |
3016 stop.x = start.x; | |
3017 GFX_draw_thick_line(2,&t7screen, start, stop, CLUT_EverythingOkayGreen); | |
3018 | |
3019 | |
3020 // Helium vertical bar | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3021 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3022 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3023 start.y = t7cH.WindowY0 + 1 - 5 - 3*16 - 28 - 14; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3024 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3025 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3026 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3027 start.y = t7cH.WindowY1 - 5 - 3*16 - 28 - 14; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3028 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3029 |
38 | 3030 stop.y = start.y - (3 * 15) - 1; |
3031 if((percent_He > 0) && (partial_pressure_He > 0.01f)) // 0.5f | |
3032 { | |
3033 | |
3034 value = partial_pressure_He; | |
222
9b4b3decd9ba
Bugfix: correct presentation error in tissues custom view
Jan Mulder <jlmulder@xs4all.nl>
parents:
215
diff
changeset
|
3035 value *= 80; |
38 | 3036 |
3037 if(value < 0) | |
3038 front = 3; | |
3039 else if(value + 5 > CUSTOMBOX_SPACE_INSIDE) | |
3040 front = CUSTOMBOX_SPACE_INSIDE - 3; | |
3041 else | |
3042 front = (uint16_t)value; | |
3043 } | |
3044 else | |
3045 { | |
3046 front = 1; | |
3047 } | |
3048 | |
3049 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + front; | |
3050 stop.x = start.x; | |
3051 GFX_draw_thick_line(2,&t7screen, start, stop, CLUT_EverythingOkayGreen); | |
3052 | |
3053 // Oxygen vertical bar | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3054 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3055 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3056 start.y = t7cH.WindowY0 + 1 - 5 - 6*16 - 2*28 - 2*14; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3057 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3058 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3059 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3060 start.y = t7cH.WindowY1 - 5 - 6*16 - 2*28 - 2*14; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3061 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3062 |
38 | 3063 stop.y = start.y - (3 * 15) - 1; |
3064 | |
3065 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + cns100pixel; | |
3066 stop.x = start.x; | |
3067 GFX_draw_thick_line(2, &t7screen, start, stop, CLUT_WarningRed); | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3068 |
38 | 3069 } |
3070 | |
3071 | |
3072 void t7_debug(void) | |
3073 { | |
3074 char text[256+50]; | |
3075 uint8_t textpointer = 0; | |
3076 | |
3077 t7cY0free.WindowLineSpacing = 28 + 48 + 14; | |
3078 t7cY0free.WindowY0 = t7cH.WindowY0 - 5 - 2 * t7cY0free.WindowLineSpacing; | |
3079 t7cY0free.WindowNumberOfTextLines = 3; | |
3080 | |
3081 textpointer += snprintf(&text[textpointer],50,"Ambient [bar]\n\r"); | |
3082 textpointer += snprintf(&text[textpointer],50,"Surface [bar] + salt\n\r"); | |
3083 // textpointer += snprintf(&text[textpointer],50,"Difference [mbar]\n\r"); | |
3084 textpointer += snprintf(&text[textpointer],50,"ShallowCounter [s]\n\r"); | |
3085 GFX_write_string(&FontT24, &t7cY0free, text, 1); | |
3086 | |
3087 t7cY0free.WindowY0 -= 52; | |
3088 // snprintf(text,60,"%0.2f\n\r%0.2f %u%%\n\r%0.0f",stateUsed->lifeData.pressure_ambient_bar, stateUsed->lifeData.pressure_surface_bar, settingsGetPointer()->salinity, 1000 * (stateUsed->lifeData.pressure_ambient_bar-stateUsed->lifeData.pressure_surface_bar)); | |
3089 snprintf(text,60, | |
3090 "%0.2f\n\r" | |
3091 "%0.2f %u%%\n\r" | |
3092 "%u" | |
3093 ,stateUsed->lifeData.pressure_ambient_bar | |
3094 ,stateUsed->lifeData.pressure_surface_bar | |
3095 ,settingsGetPointer()->salinity | |
3096 ,stateUsed->lifeData.counterSecondsShallowDepth); | |
3097 GFX_write_string(&FontT42, &t7cY0free, text, 1); | |
3098 } | |
3099 | |
3100 | |
3101 void t7_SummaryOfLeftCorner(void) | |
3102 { | |
3103 char text[256+60]; | |
3104 uint8_t textpointer = 0; | |
3105 | |
3106 const SDecoinfo * pDecoinfoStandard; | |
3107 const SDecoinfo * pDecoinfoFuture; | |
3108 float fCNS; | |
3109 | |
3110 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE) | |
3111 { | |
3112 pDecoinfoStandard = &stateUsed->decolistBuehlmann; | |
3113 pDecoinfoFuture = &stateUsed->decolistFutureBuehlmann; | |
3114 } | |
3115 else | |
3116 { | |
3117 pDecoinfoStandard = &stateUsed->decolistVPM; | |
3118 pDecoinfoFuture = &stateUsed->decolistFutureVPM; | |
3119 } | |
3120 | |
3121 fCNS = stateUsed->lifeData .cns; | |
3122 if(fCNS > 999) | |
3123 fCNS = 999; | |
3124 | |
3125 t7cY0free.WindowY0 = t7cC.WindowY0 - 10; | |
315
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3126 if(settingsGetPointer()->FlipDisplay) |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3127 { |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3128 t7cY0free.WindowY1 = 400; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3129 } |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3130 |
38 | 3131 t7cY0free.WindowLineSpacing = 48; |
3132 t7cY0free.WindowNumberOfTextLines = 6; | |
3133 t7cY0free.WindowTab = 420; | |
3134 | |
3135 // header | |
3136 textpointer = 0; | |
3137 text[textpointer++] = '\032'; | |
3138 text[textpointer++] = '\016'; | |
3139 text[textpointer++] = '\016'; | |
3140 text[textpointer++] = TXT_ppO2; | |
3141 text[textpointer++] = '\n'; | |
3142 text[textpointer++] = '\r'; | |
3143 text[textpointer++] = TXT_Ceiling; | |
3144 text[textpointer++] = '\n'; | |
3145 text[textpointer++] = '\r'; | |
3146 text[textpointer++] = TXT_ActualGradient; | |
3147 text[textpointer++] = '\n'; | |
3148 text[textpointer++] = '\r'; | |
3149 text[textpointer++] = TXT_CNS; | |
3150 text[textpointer++] = '\n'; | |
3151 text[textpointer++] = '\r'; | |
3152 text[textpointer++] = TXT_FutureTTS; | |
3153 text[textpointer++] = '\017'; | |
3154 text[textpointer++] = 0; | |
315
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3155 |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3156 if(!settingsGetPointer()->FlipDisplay) |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3157 { |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3158 t7cY0free.WindowX0 += 10; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3159 t7cY0free.WindowY0 += 10; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3160 GFX_write_string(&FontT24, &t7cY0free, text, 1); |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3161 t7cY0free.WindowX0 -= 10; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3162 t7cY0free.WindowY0 -= 10; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3163 } |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3164 else |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3165 { |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3166 t7cY0free.WindowY1 -= 10; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3167 t7cY0free.WindowX1 -= 10; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3168 GFX_write_string(&FontT24, &t7cY0free, text, 1); |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3169 t7cY0free.WindowY1 += 10; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3170 t7cY0free.WindowX1 += 10; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
3171 } |
38 | 3172 textpointer = 0; |
3173 text[textpointer++] = '\t'; | |
3174 textpointer += snprintf(&text[textpointer],10,"\020%01.2f", stateUsed->lifeData.ppO2); | |
3175 text[textpointer++] = '\n'; | |
3176 text[textpointer++] = '\r'; | |
3177 text[textpointer++] = '\t'; | |
3178 if((pDecoinfoStandard->output_ceiling_meter > 99.9f) || (settingsGetPointer()->nonMetricalSystem)) | |
215
4a0ebade04f5
Bugfix, trivial: correctly present avg depth in overview custom
Jan Mulder <jlmulder@xs4all.nl>
parents:
214
diff
changeset
|
3179 textpointer += snprintf(&text[textpointer],10,"\020%01.0f",unit_depth_float(pDecoinfoStandard->output_ceiling_meter)); |
38 | 3180 else |
215
4a0ebade04f5
Bugfix, trivial: correctly present avg depth in overview custom
Jan Mulder <jlmulder@xs4all.nl>
parents:
214
diff
changeset
|
3181 textpointer += snprintf(&text[textpointer],10,"\020%01.1f",pDecoinfoStandard->output_ceiling_meter); |
38 | 3182 text[textpointer++] = '\n'; |
3183 text[textpointer++] = '\r'; | |
3184 text[textpointer++] = '\t'; | |
247
3949781096d4
feature: Relative GF to Saturation renames
Jan Mulder <jlmulder@xs4all.nl>
parents:
225
diff
changeset
|
3185 textpointer += snprintf(&text[textpointer],10,"\020%.0f\016\016%%\017", 100 * pDecoinfoStandard->super_saturation); |
38 | 3186 text[textpointer++] = '\n'; |
3187 text[textpointer++] = '\r'; | |
3188 text[textpointer++] = '\t'; | |
3189 textpointer += snprintf(&text[textpointer],10,"\020%.0f\016\016%%\017",fCNS); | |
3190 text[textpointer++] = '\n'; | |
3191 text[textpointer++] = '\r'; | |
3192 text[textpointer++] = '\t'; | |
214
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
211
diff
changeset
|
3193 if (pDecoinfoFuture->output_time_to_surface_seconds < 1000 * 60) |
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
211
diff
changeset
|
3194 textpointer += snprintf(&text[textpointer],10,"\020%i'", (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 60); |
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
211
diff
changeset
|
3195 else |
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
211
diff
changeset
|
3196 textpointer += snprintf(&text[textpointer],10,"\020%ih", (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 3600); |
38 | 3197 text[textpointer++] = 0; |
196
2885628ab3ba
Bugfix, minor: color the overview customview correctly
Jan Mulder <jlmulder@xs4all.nl>
parents:
193
diff
changeset
|
3198 t7_colorscheme_mod(text); |
38 | 3199 GFX_write_string(&FontT42, &t7cY0free, text, 1); |
3200 } | |
3201 | |
3202 void t7_compass(uint16_t ActualHeading, uint16_t UserSetHeading) | |
3203 { | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3204 uint16_t ActualHeadingRose; |
38 | 3205 uint16_t LeftBorderHeading, LineHeading; |
3206 uint32_t offsetPicture; | |
3207 point_t start, stop, center; | |
3208 static int32_t LastHeading = 0; | |
3209 int32_t newHeading = 0; | |
3210 int32_t diff = 0; | |
3211 int32_t diff2 = 0; | |
3212 | |
3213 int32_t diffAbs = 0; | |
3214 int32_t diffAbs2 = 0; | |
3215 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3216 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3217 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3218 |
38 | 3219 newHeading = ActualHeading; |
3220 | |
3221 diff = newHeading - LastHeading; | |
3222 | |
3223 if(newHeading < LastHeading) | |
3224 diff2 = newHeading + 360 - LastHeading; | |
3225 else | |
3226 diff2 = newHeading - 360 - LastHeading; | |
3227 | |
3228 diffAbs = diff; | |
3229 if(diffAbs < 0) | |
3230 diffAbs *= -1; | |
3231 | |
3232 diffAbs2 = diff2; | |
3233 if(diffAbs2 < 0) | |
3234 diffAbs2 *= -1; | |
3235 | |
3236 | |
3237 if(diffAbs <= diffAbs2) | |
3238 newHeading = LastHeading + (diff / 2); | |
3239 else | |
3240 newHeading = LastHeading + (diff2 / 2); | |
3241 | |
3242 if(newHeading < 0) | |
3243 newHeading += 360; | |
3244 else | |
3245 if(newHeading >= 360) | |
3246 newHeading -= 360; | |
3247 | |
3248 LastHeading = newHeading; | |
3249 ActualHeading = newHeading; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3250 ActualHeadingRose = ActualHeading; |
225
2bb1db22b5f5
cleanup: random set of cleanups
Jan Mulder <jlmulder@xs4all.nl>
parents:
222
diff
changeset
|
3251 |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3252 if(pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3253 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3254 ActualHeadingRose = 360 - ActualHeadingRose; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3255 if (ActualHeadingRose < 170) ActualHeadingRose += 360; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3256 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3257 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3258 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3259 if (ActualHeadingRose < 90) ActualHeadingRose += 360; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3260 ActualHeading = ActualHeadingRose; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3261 } |
38 | 3262 |
3263 // new hw 160822 | |
3264 // if (ActualHeading >= 360 + 90) | |
3265 // ActualHeading = 360; | |
3266 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3267 LeftBorderHeading = 2 * (ActualHeadingRose - (CUSTOMBOX_SPACE_INSIDE/4)); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3268 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3269 if(pSettings->FlipDisplay) /* add offset caused by mirrowed drawing */ |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3270 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3271 LeftBorderHeading += 2 * 80; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3272 } |
38 | 3273 |
3274 offsetPicture = LeftBorderHeading * t7screenCompass.ImageHeight * 2; | |
3275 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3276 /* the background is used to draw the rotating compass rose */ |
38 | 3277 background.pointer = t7screenCompass.FBStartAdress+offsetPicture; |
3278 background.x0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3279 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3280 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3281 background.y0 = 65; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3282 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3283 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3284 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3285 background.y0 = 480 - t7screenCompass.ImageHeight - 65; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3286 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3287 |
38 | 3288 background.width = CUSTOMBOX_SPACE_INSIDE; |
3289 background.height = t7screenCompass.ImageHeight; | |
3290 | |
3291 | |
3292 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + (CUSTOMBOX_SPACE_INSIDE/2); | |
3293 stop.x = start.x; | |
3294 start.y = 65; | |
3295 stop.y = start.y + 55; | |
3296 GFX_draw_line(&t7screen, start, stop, CLUT_Font030); | |
3297 | |
3298 | |
3299 center.x = start.x; | |
3300 center.y = 300; | |
3301 | |
3302 stop.x = center.x + 44; | |
3303 stop.y = center.y + 24; | |
3304 | |
3305 | |
3306 while(ActualHeading > 359) ActualHeading -= 360; | |
3307 | |
3308 LineHeading = 360 - ActualHeading; | |
3309 GFX_draw_thick_line(9,&t7screen, t7_compass_circle(0,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font030); // North | |
3310 LineHeading += 90; | |
3311 if(LineHeading > 359) LineHeading -= 360; | |
3312 GFX_draw_thick_line(9,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); // Maintick | |
3313 LineHeading += 90; | |
3314 if(LineHeading > 359) LineHeading -= 360; | |
3315 GFX_draw_thick_line(9,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
3316 LineHeading += 90; | |
3317 if(LineHeading > 359) LineHeading -= 360; | |
3318 GFX_draw_thick_line(9,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
3319 | |
3320 LineHeading = 360 - ActualHeading; | |
3321 LineHeading += 45; | |
3322 if(LineHeading > 359) LineHeading -= 360; | |
3323 GFX_draw_thick_line(5,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); // Subtick | |
3324 LineHeading += 90; | |
3325 if(LineHeading > 359) LineHeading -= 360; | |
3326 GFX_draw_thick_line(5,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
3327 LineHeading += 90; | |
3328 if(LineHeading > 359) LineHeading -= 360; | |
3329 GFX_draw_thick_line(5,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
3330 LineHeading += 90; | |
3331 if(LineHeading > 359) LineHeading -= 360; | |
3332 GFX_draw_thick_line(5,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
3333 | |
3334 LineHeading = 360 - ActualHeading; | |
3335 LineHeading += 22; | |
3336 if(LineHeading > 359) LineHeading -= 360; | |
3337 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); // Subtick | |
3338 LineHeading += 45; | |
3339 if(LineHeading > 359) LineHeading -= 360; | |
3340 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
3341 LineHeading += 45; | |
3342 if(LineHeading > 359) LineHeading -= 360; | |
3343 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
3344 LineHeading += 45; | |
3345 if(LineHeading > 359) LineHeading -= 360; | |
3346 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
3347 LineHeading += 45; | |
3348 if(LineHeading > 359) LineHeading -= 360; | |
3349 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); // Subtick | |
3350 LineHeading += 45; | |
3351 if(LineHeading > 359) LineHeading -= 360; | |
3352 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
3353 LineHeading += 45; | |
3354 if(LineHeading > 359) LineHeading -= 360; | |
3355 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
3356 LineHeading += 45; | |
3357 if(LineHeading > 359) LineHeading -= 360; | |
3358 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
3359 | |
3360 if(UserSetHeading) | |
3361 { | |
3362 LineHeading = UserSetHeading + 360 - ActualHeading; | |
3363 if(LineHeading > 359) LineHeading -= 360; | |
3364 GFX_draw_thick_line(9,&t7screen, t7_compass_circle(3,LineHeading), t7_compass_circle(2,LineHeading), CLUT_CompassUserHeadingTick); | |
3365 | |
3366 // R�ckpeilung, User Back Heading | |
3367 LineHeading = UserSetHeading + 360 + 180 - ActualHeading; | |
3368 if(LineHeading > 359) LineHeading -= 360; | |
3369 if(LineHeading > 359) LineHeading -= 360; | |
3370 GFX_draw_thick_line(9,&t7screen, t7_compass_circle(3,LineHeading), t7_compass_circle(2,LineHeading), CLUT_CompassUserBackHeadingTick); | |
3371 } | |
3372 | |
3373 center.x = start.x; | |
3374 center.y = 250; | |
3375 GFX_draw_circle(&t7screen, center, 116, CLUT_Font030); | |
3376 GFX_draw_circle(&t7screen, center, 118, CLUT_Font030); | |
3377 GFX_draw_circle(&t7screen, center, 117, CLUT_Font030); | |
3378 | |
3379 | |
3380 } | |
3381 | |
3382 | |
3383 /* Font_T42: N is 27 px, S is 20 px, W is 36 px, E is 23 px | |
3384 * max is NW with 63 px | |
3385 * Font_T24: N is 15 px, S is 12 px, W is 20 px, E is 13 px | |
3386 * max is NW with 35 px | |
3387 * NE is 28 px | |
3388 * SW is 32 px | |
3389 * SE is 25 px | |
3390 * space between each is 45 px * 2 | |
3391 * FirstItem List | |
3392 * \177 \177 prepare for size | |
3393 */ | |
3394 void init_t7_compass(void) | |
3395 { | |
3396 t7screenCompass.FBStartAdress = getFrame(21); | |
3397 | |
3398 char text[256]; | |
3399 uint8_t textpointer = 0; | |
3400 | |
3401 text[textpointer++] = '\030'; | |
3402 text[textpointer++] = '\177'; | |
3403 text[textpointer++] = '\177'; | |
3404 text[textpointer++] = 76; // 90 - 14 | |
3405 text[textpointer++] = '\016'; | |
3406 text[textpointer++] = '\016'; | |
3407 text[textpointer++] = 'N'; | |
3408 text[textpointer++] = 'E'; // 96 + 28 = 124 total | |
3409 text[textpointer++] = '\017'; | |
3410 text[textpointer++] = '\177'; | |
3411 text[textpointer++] = '\177'; | |
3412 text[textpointer++] = 64; // 90 - 14 - 12 | |
3413 text[textpointer++] = 'E'; // 124 + 74 + 23 = 221 total | |
3414 text[textpointer++] = '\177'; | |
3415 text[textpointer++] = '\177'; | |
3416 text[textpointer++] = 66; // 90 - 11 - 13 | |
3417 text[textpointer++] = '\016'; | |
3418 text[textpointer++] = '\016'; | |
3419 text[textpointer++] = 'S'; | |
3420 text[textpointer++] = 'E'; | |
3421 text[textpointer++] = '\017'; | |
3422 text[textpointer++] = '\177'; | |
3423 text[textpointer++] = '\177'; | |
3424 text[textpointer++] = 68; // 90 - 12 - 10 | |
3425 text[textpointer++] = 'S'; | |
3426 text[textpointer++] = '\177'; | |
3427 text[textpointer++] = '\177'; | |
3428 text[textpointer++] = 64; // 90 - 10 - 16 | |
3429 text[textpointer++] = '\016'; | |
3430 text[textpointer++] = '\016'; | |
3431 text[textpointer++] = 'S'; | |
3432 text[textpointer++] = 'W'; | |
3433 text[textpointer++] = '\017'; | |
3434 text[textpointer++] = '\177'; | |
3435 text[textpointer++] = '\177'; | |
3436 text[textpointer++] = 56; // 90 - 16 - 18 | |
3437 text[textpointer++] = 'W'; | |
3438 text[textpointer++] = '\177'; | |
3439 text[textpointer++] = '\177'; | |
3440 text[textpointer++] = 54; // 90 - 18 - 18 | |
3441 text[textpointer++] = '\016'; | |
3442 text[textpointer++] = '\016'; | |
3443 text[textpointer++] = 'N'; | |
3444 text[textpointer++] = 'W'; | |
3445 text[textpointer++] = '\017'; | |
3446 text[textpointer++] = '\177'; | |
3447 text[textpointer++] = '\177'; | |
3448 text[textpointer++] = 59; // 90 - 17 - 14 | |
3449 text[textpointer++] = 'N'; | |
3450 text[textpointer++] = '\177'; | |
3451 text[textpointer++] = '\177'; | |
3452 text[textpointer++] = 63; // 90 - 13 - 14 | |
3453 text[textpointer++] = '\016'; | |
3454 text[textpointer++] = '\016'; | |
3455 text[textpointer++] = 'N'; | |
3456 text[textpointer++] = 'E'; | |
3457 text[textpointer++] = '\017'; | |
3458 text[textpointer++] = '\177'; | |
3459 text[textpointer++] = '\177'; | |
3460 text[textpointer++] = 64; // 90 - 14 - 12 | |
3461 text[textpointer++] = 'E'; | |
3462 text[textpointer++] = '\177'; | |
3463 text[textpointer++] = '\177'; | |
3464 text[textpointer++] = 66; // 90 - 11 - 13 | |
3465 text[textpointer++] = '\016'; | |
3466 text[textpointer++] = '\016'; | |
3467 text[textpointer++] = 'S'; | |
3468 text[textpointer++] = 'E'; | |
3469 text[textpointer++] = '\017'; | |
3470 text[textpointer++] = '\177'; | |
3471 text[textpointer++] = '\177'; | |
3472 text[textpointer++] = 68; // 90 - 12 - 10 | |
3473 text[textpointer++] = 'S'; | |
3474 text[textpointer++] = '\177'; | |
3475 text[textpointer++] = '\177'; | |
3476 text[textpointer++] = 64; // 90 - 10 - 16 | |
3477 text[textpointer++] = '\016'; | |
3478 text[textpointer++] = '\016'; | |
3479 text[textpointer++] = 'S'; | |
3480 text[textpointer++] = 'W'; | |
3481 text[textpointer++] = '\017'; | |
3482 text[textpointer++] = 0; // end | |
3483 | |
3484 GFX_write_string(&FontT42,&t7pCompass,text,1); | |
3485 | |
3486 releaseAllFramesExcept(21,t7screenCompass.FBStartAdress); | |
3487 } | |
3488 | |
3489 | |
3490 void t7_miniLiveLogProfile(void) | |
3491 { | |
3492 SWindowGimpStyle wintemp; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3493 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3494 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3495 |
38 | 3496 wintemp.left = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
3497 wintemp.right = wintemp.left + CUSTOMBOX_SPACE_INSIDE; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3498 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3499 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3500 wintemp.top = 480 - t7l1.WindowY0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3501 wintemp.bottom = wintemp. top + 200; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3502 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3503 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3504 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3505 wintemp.top = t7l1.WindowY1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3506 wintemp.bottom = wintemp. top + 200; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3507 } |
38 | 3508 |
3509 uint16_t max_depth = (uint16_t)(stateUsed->lifeData.max_depth_meter * 10); | |
3510 | |
3511 GFX_graph_print(&t7screen, &wintemp, 0,1,0, max_depth, getMiniLiveLogbookPointerToData(), getMiniLiveLogbookActualDataLength(), CLUT_Font030, NULL); | |
3512 } | |
3513 | |
3514 void t7_logo_OSTC(void) | |
3515 { | |
3516 SWindowGimpStyle windowGimp; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3517 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3518 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3519 |
38 | 3520 /* OSTC logo */ |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3521 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3522 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3523 windowGimp.left = t7l1.WindowX1 + 32; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3524 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3525 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3526 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3527 windowGimp.left = t7r1.WindowX1 + 32; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3528 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3529 |
38 | 3530 windowGimp.top = 40 + 32; |
3531 GFX_draw_image_monochrome(&t7screen, windowGimp, &ImgOSTC, 0); | |
3532 } |