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