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