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