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