Mercurial > public > ostc4
annotate Discovery/Src/t7.c @ 882:608d3e918146 Evo_2_23
Added slow exit timer function:
At the end of the dive the final ascent to surface should be done slowly. The new function provides a comparison of the current divers depth compared to a linear ascent simulated by the OSTC. The visualization is shown instead of the ascent speed with a little different appearance. The linear ascent is starting from the last stop depth and the time for the ascent may be configurated in the deco settings. The simulated and real peth is compared and the depth color changes based on the difference of the values. In case the diver is much below the timer depth then the timer will stop and wait for the diver to follow.
author | Ideenmodellierer |
---|---|
date | Sat, 31 Aug 2024 17:35:52 +0200 |
parents | db92692c014f |
children | 940f8e132638 |
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; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
212 t7l2.WindowLineSpacing = 22; // Abstand von Y0 |
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; | |
379 t7l2.WindowLineSpacing = 22; // Abstand von Y0 | |
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 | |
2723 point_t start, stop; | |
2724 uint8_t color; | |
2725 int textlength; | |
2726 | |
2727 uint16_t nextstopLengthSeconds = 0; | |
2728 uint8_t nextstopDepthMeter = 0; | |
2729 uint8_t oxygen_percentage = 0; | |
2730 SDivetime Divetime = {0,0,0, 0}; | |
2731 SDivetime SafetyStopTime = {0,0,0,0}; | |
2732 SDivetime TimeoutTime = {0,0,0,0}; | |
2733 uint8_t customview_warnings = 0; | |
2734 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2735 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2736 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2737 |
38 | 2738 Divetime.Total = stateUsed->lifeData.dive_time_seconds_without_surface_time; |
2739 Divetime.Minutes = Divetime.Total / 60; | |
2740 Divetime.Seconds = Divetime.Total - ( Divetime.Minutes * 60 ); | |
2741 | |
2742 SafetyStopTime.Total = timer_Safetystop_GetCountDown(); | |
2743 SafetyStopTime.Minutes = SafetyStopTime.Total / 60; | |
2744 SafetyStopTime.Seconds = SafetyStopTime.Total - (SafetyStopTime.Minutes * 60); | |
2745 | |
882 | 2746 TimeoutTime.Total = pSettings->timeoutDiveReachedZeroDepth - stateUsed->lifeData.counterSecondsShallowDepth; |
2747 if(TimeoutTime.Total > pSettings->timeoutDiveReachedZeroDepth) | |
38 | 2748 { |
2749 TimeoutTime.Total = 0; | |
2750 } | |
2751 TimeoutTime.Minutes = TimeoutTime.Total / 60; | |
2752 TimeoutTime.Seconds = TimeoutTime.Total - (TimeoutTime.Minutes * 60); | |
2753 | |
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
|
2754 const SDecoinfo * pDecoinfo = getDecoInfo(); |
38 | 2755 if(pDecoinfo->output_time_to_surface_seconds) |
2756 { | |
2757 tHome_findNextStop(pDecoinfo->output_stop_length_seconds, &nextstopDepthMeter, &nextstopLengthSeconds); | |
2758 } | |
2759 else | |
2760 { | |
2761 nextstopDepthMeter = 0; | |
2762 nextstopLengthSeconds = 0; | |
2763 } | |
2764 | |
882 | 2765 |
2766 /* max depth */ | |
2767 snprintf(TextL2,TEXTSIZE,"\032\f%c",TXT_MaxDepth); | |
2768 GFX_write_string(&FontT42,&t7l2,TextL2,0); | |
2769 | |
2770 if(unit_depth_float(stateUsed->lifeData.max_depth_meter) < 100) | |
2771 snprintf(TextL2,TEXTSIZE,"\020%01.1f",unit_depth_float(stateUsed->lifeData.max_depth_meter)); | |
2772 else | |
2773 snprintf(TextL2,TEXTSIZE,"\020%01.0f",unit_depth_float(stateUsed->lifeData.max_depth_meter)); | |
2774 | |
2775 Gfx_colorsscheme_mod(TextL2, 0); | |
2776 GFX_write_string(&FontT105,&t7l2,TextL2,1); | |
2777 | |
2778 /* ascent rate graph */ | |
2779 | |
2780 if((pSettings->slowExitTime != 0) && (stateUsed->lifeData.depth_meter < pSettings->last_stop_depth_meter)) | |
2781 { | |
2782 color = t7_drawSlowExitGraph(); | |
2783 } | |
2784 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 */ | |
2785 { | |
2786 color = drawingColor_from_ascentspeed(stateUsed->lifeData.ascent_rate_meter_per_min); | |
2787 t7_drawAcentGraph(color); | |
2788 } | |
2789 | |
2790 | |
38 | 2791 /* depth */ |
174
ecb71521d004
Bugfix: make max depth move with current depth (part 2)
Jan Mulder <jlmulder@xs4all.nl>
parents:
166
diff
changeset
|
2792 float depth = unit_depth_float(stateUsed->lifeData.depth_meter); |
38 | 2793 |
2794 if(depth <= 0.3f) | |
2795 depth = 0; | |
2796 | |
2797 if(settingsGetPointer()->nonMetricalSystem) | |
2798 snprintf(TextL1,TEXTSIZE,"\032\f[feet]"); | |
2799 else | |
2800 snprintf(TextL1,TEXTSIZE,"\032\f%c",TXT_Depth); | |
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
859
diff
changeset
|
2801 |
38 | 2802 GFX_write_string(&FontT24,&t7l1,TextL1,0); |
2803 | |
2804 if((stateUsed->lifeData.ascent_rate_meter_per_min > 8) || (stateUsed->lifeData.ascent_rate_meter_per_min < -10)) | |
2805 { | |
2806 snprintf(TextL1,TEXTSIZE,"\f\002%.0f %c%c/min " | |
2807 , unit_depth_float(stateUsed->lifeData.ascent_rate_meter_per_min) | |
2808 , unit_depth_char1() | |
2809 , unit_depth_char2() | |
2810 ); | |
2811 GFX_write_string(&FontT24,&t7l1,TextL1,0); | |
2812 } | |
2813 | |
2814 if( depth < 100) | |
2815 snprintf(TextL1,TEXTSIZE,"\020%01.1f",depth); | |
2816 else | |
2817 snprintf(TextL1,TEXTSIZE,"\020%01.0f",depth); | |
2818 | |
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
859
diff
changeset
|
2819 Gfx_colorsscheme_mod(TextL1, color); |
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
859
diff
changeset
|
2820 |
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
859
diff
changeset
|
2821 GFX_write_string(&FontT144,&t7l1,TextL1,0); |
38 | 2822 |
882 | 2823 |
2824 | |
2825 /* divetime */ | |
38 | 2826 if(stateUsed->lifeData.counterSecondsShallowDepth) |
2827 { | |
2828 snprintf(TextR1,TEXTSIZE,"\f\002\136 %u:%02u",TimeoutTime.Minutes, TimeoutTime.Seconds); | |
2829 GFX_write_string(&FontT42,&t7r1,TextR1,0); | |
2830 } | |
2831 else | |
2832 { | |
2833 snprintf(TextR1,TEXTSIZE,"\032\f\002%c",TXT_Divetime); | |
2834 GFX_write_string(&FontT42,&t7r1,TextR1,0); | |
2835 } | |
2836 | |
2837 if(Divetime.Minutes < 1000) | |
564
5e0a75e2f00b
Bugfix One or more deactivated sensors hide sensor display:
Ideenmodellierer
parents:
553
diff
changeset
|
2838 snprintf(TextR1,TEXTSIZE,"\020\002\016%u:%02u",Divetime.Minutes, Divetime.Seconds); |
38 | 2839 else |
564
5e0a75e2f00b
Bugfix One or more deactivated sensors hide sensor display:
Ideenmodellierer
parents:
553
diff
changeset
|
2840 snprintf(TextR1,TEXTSIZE,"\020\002\016%u'",Divetime.Minutes); |
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
859
diff
changeset
|
2841 Gfx_colorsscheme_mod(TextR1, 0); |
38 | 2842 GFX_write_string(&FontT105,&t7r1,TextR1,1); |
2843 | |
2844 /* next deco stop */ | |
2845 if(nextstopDepthMeter) | |
2846 { | |
2847 snprintf(TextR2,TEXTSIZE,"\032\f\002%c",TXT_Decostop); | |
2848 GFX_write_string(&FontT42,&t7r2,TextR2,0); | |
2849 textlength = snprintf(TextR2,TEXTSIZE,"\020\002%u%c%c %u'" | |
2850 , unit_depth_integer(nextstopDepthMeter) | |
2851 , unit_depth_char1_T105() | |
2852 , unit_depth_char2_T105() | |
2853 , (nextstopLengthSeconds+59)/60); | |
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
859
diff
changeset
|
2854 Gfx_colorsscheme_mod(TextR2, 0); |
38 | 2855 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
|
2856 TextR2[0] = '\031'; |
38 | 2857 if(textlength <= 9) |
2858 GFX_write_string(&FontT105,&t7r2,TextR2,1); | |
567 | 2859 else if(textlength <= 10) |
2860 GFX_write_string(&FontT84Spaced,&t7r2,TextR2,1); | |
38 | 2861 else |
2862 GFX_write_string(&FontT54,&t7r2,TextR2,1); | |
2863 } | |
2864 else if(SafetyStopTime.Total && (depth > timer_Safetystop_GetDepthUpperLimit())) | |
2865 { | |
2866 snprintf(TextR2,TEXTSIZE,"\032\f\002%c%c",TXT_2BYTE,TXT2BYTE_SafetyStop2); | |
2867 GFX_write_string(&FontT42,&t7r2,TextR2,0); | |
564
5e0a75e2f00b
Bugfix One or more deactivated sensors hide sensor display:
Ideenmodellierer
parents:
553
diff
changeset
|
2868 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
|
2869 Gfx_colorsscheme_mod(TextR2, 0); |
38 | 2870 GFX_write_string(&FontT105,&t7r2,TextR2,1); |
2871 } | |
2872 | |
2873 /* tts - option 1 | |
2874 * ndl - option 2 | |
2875 * empty - option 3 */ | |
2876 if(pDecoinfo->output_time_to_surface_seconds) | |
2877 { | |
2878 snprintf(TextR3,TEXTSIZE,"\032\f\002%c",TXT_TTS); | |
2879 GFX_write_string(&FontT42,&t7r3,TextR3,0); | |
2880 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
|
2881 snprintf(TextR3,TEXTSIZE,"\020\002%i'",(pDecoinfo->output_time_to_surface_seconds + 59)/ 60); |
38 | 2882 else |
214
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
211
diff
changeset
|
2883 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
|
2884 Gfx_colorsscheme_mod(TextR3, 0); |
38 | 2885 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
|
2886 TextR2[0] = '\031'; |
38 | 2887 GFX_write_string(&FontT105,&t7r3,TextR3,1); |
2888 } | |
2889 else if(pDecoinfo->output_ndl_seconds) | |
2890 { | |
2891 snprintf(TextR3,TEXTSIZE,"\032\f\002%c",TXT_Nullzeit); | |
2892 GFX_write_string(&FontT42,&t7r3,TextR3,0); | |
2893 if(pDecoinfo->output_ndl_seconds < 1000 * 60) | |
2894 snprintf(TextR3,TEXTSIZE,"\020\002%i'",pDecoinfo->output_ndl_seconds/60); | |
2895 else | |
2896 snprintf(TextR3,TEXTSIZE,"\020\002%ih",pDecoinfo->output_ndl_seconds/3600); | |
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
859
diff
changeset
|
2897 Gfx_colorsscheme_mod(TextR3, 0); |
38 | 2898 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
|
2899 TextR2[0] = '\031'; |
38 | 2900 GFX_write_string(&FontT105,&t7r3,TextR3,1); |
2901 } | |
2902 | |
2903 /* Menu Selection (and gas mix) */ | |
2904 if(get_globalState() == StDMGAS) | |
2905 { | |
2906 textPointer = 0; | |
2907 TextR1[textPointer++] = '\a'; | |
2908 // TextR1[textPointer++] = '\f'; | |
2909 TextR1[textPointer++] = '\001'; | |
2910 TextR1[textPointer++] = ' '; | |
2911 textPointer += tHome_gas_writer(stateUsed->diveSettings.gas[actualBetterGasId()].oxygen_percentage,stateUsed->diveSettings.gas[actualBetterGasId()].helium_percentage,&TextR1[textPointer]); | |
2912 TextR1[textPointer++] = '?'; | |
2913 TextR1[textPointer++] = ' '; | |
2914 TextR1[textPointer++] = 0; | |
2915 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
2916 } | |
2917 else if(get_globalState() == StDMSPT) | |
2918 { | |
2919 textPointer = 0; | |
2920 TextR1[textPointer++] = '\a'; | |
2921 TextR1[textPointer++] = '\001'; | |
2922 TextR1[textPointer++] = ' '; | |
680 | 2923 textPointer += snprintf(&TextR1[textPointer],TEXTSIZE,"%01.2f",(float)(stateUsed->diveSettings.setpoint[actualBetterSetpointId()].setpoint_cbar) / 100.0); |
38 | 2924 TextR1[textPointer++] = '?'; |
2925 TextR1[textPointer++] = ' '; | |
2926 TextR1[textPointer++] = 0; | |
2927 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
2928 } | |
2929 else if(get_globalState() == StDMENU) | |
2930 { | |
2931 snprintf(TextR1,TEXTSIZE,"\a\001%c%c", TXT_2BYTE, TXT2BYTE_DiveMenuQ); | |
2932 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
|
2933 } else if (get_globalState() == StDBAILOUT) { |
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
770
diff
changeset
|
2934 if (isLoopMode(stateUsed->diveSettings.diveMode)) { |
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
770
diff
changeset
|
2935 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
|
2936 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
|
2937 TextR1[textPointer++] = ' '; |
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
770
diff
changeset
|
2938 TextR1[textPointer++] = '?'; |
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
770
diff
changeset
|
2939 } else { |
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
770
diff
changeset
|
2940 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
|
2941 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
|
2942 TextR1[textPointer++] = ' '; |
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
770
diff
changeset
|
2943 TextR1[textPointer++] = '?'; |
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
770
diff
changeset
|
2944 } |
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
770
diff
changeset
|
2945 |
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
770
diff
changeset
|
2946 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
|
2947 } 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
|
2948 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
|
2949 |
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
|
2950 GFX_write_string_color(&FontT48, &t7c2, TextR1, 0, CLUT_WarningYellow); |
38 | 2951 } |
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
|
2952 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
|
2953 { |
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
|
2954 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
|
2955 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
|
2956 } |
38 | 2957 else if(get_globalState() == StDSIM1) |
2958 { | |
2959 snprintf(TextR1,TEXTSIZE,"\a\001%c%c", TXT_2BYTE, TXT2BYTE_DiveQuitQ); | |
2960 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
2961 } | |
2962 else if(get_globalState() == StDSIM2) | |
2963 { | |
2964 if(settingsGetPointer()->nonMetricalSystem) | |
2965 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:-3.33ft "); | |
2966 else | |
2967 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:-1m "); | |
2968 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
2969 | |
2970 snprintf(TextR1,TEXTSIZE,"\a\f %u %c%c" | |
2971 , unit_depth_integer(simulation_get_aim_depth()) | |
2972 , unit_depth_char1() | |
2973 , unit_depth_char2() | |
2974 ); | |
2975 GFX_write_string_color(&FontT42,&t7l1,TextR1,0,CLUT_WarningYellow); | |
2976 | |
2977 } | |
2978 else if(get_globalState() == StDSIM3) | |
2979 { | |
2980 if(settingsGetPointer()->nonMetricalSystem) | |
2981 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:+3.33ft "); | |
2982 else | |
2983 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:+1m "); | |
2984 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
2985 snprintf(TextR1,TEXTSIZE,"\a\f %u %c%c" | |
2986 , unit_depth_integer(simulation_get_aim_depth()) | |
2987 , unit_depth_char1() | |
2988 , unit_depth_char2() | |
2989 ); | |
2990 GFX_write_string_color(&FontT42,&t7l1,TextR1,0,CLUT_WarningYellow); | |
2991 } | |
2992 else if(get_globalState() == StDSIM4) | |
2993 { | |
2994 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:+5' "); | |
2995 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
2996 snprintf(TextR1,TEXTSIZE,"\a\f %u %c%c" | |
2997 , unit_depth_integer(simulation_get_aim_depth()) | |
2998 , unit_depth_char1() | |
2999 , unit_depth_char2() | |
3000 ); | |
3001 GFX_write_string_color(&FontT42,&t7l1,TextR1,0,CLUT_WarningYellow); | |
3002 } | |
3003 else | |
3004 { | |
3005 /* gas mix */ | |
3006 oxygen_percentage = 100; | |
3007 oxygen_percentage -= stateUsed->lifeData.actualGas.nitrogen_percentage; | |
3008 oxygen_percentage -= stateUsed->lifeData.actualGas.helium_percentage; | |
3009 | |
3010 textPointer = 0; | |
3011 TextC2[textPointer++] = '\020'; | |
3012 if(stateUsed->warnings.betterGas && warning_count_high_time) | |
3013 { | |
3014 TextC2[textPointer++] = '\a'; | |
3015 } | |
3016 else | |
3017 { | |
3018 float fPpO2limitHigh, fPpO2now; | |
3019 | |
3020 if(actualLeftMaxDepth(stateUsed)) | |
3021 fPpO2limitHigh = settingsGetPointer()->ppO2_max_deco; | |
3022 else | |
3023 fPpO2limitHigh = settingsGetPointer()->ppO2_max_std; | |
3024 | |
3025 fPpO2now = (stateUsed->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * oxygen_percentage; | |
3026 | |
3027 if((fPpO2now > fPpO2limitHigh) || (fPpO2now < (float)(settingsGetPointer()->ppO2_min))) | |
3028 TextC2[textPointer++] = '\025'; | |
3029 } | |
3030 TextC2[textPointer++] = '\002'; | |
3031 textPointer += tHome_gas_writer(oxygen_percentage,stateUsed->lifeData.actualGas.helium_percentage,&TextC2[textPointer]); | |
3032 | |
3033 if(stateUsed->warnings.betterGas && warning_count_high_time) | |
3034 { | |
3035 if(TextC2[0] == '\020') | |
3036 { | |
3037 TextC2[0] = '\004'; // NOP | |
3038 } | |
3039 GFX_write_string_color(&FontT48,&t7c2,TextC2,0,CLUT_WarningYellow); | |
3040 } | |
3041 else | |
3042 { | |
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
859
diff
changeset
|
3043 Gfx_colorsscheme_mod(TextC2, 0); |
38 | 3044 GFX_write_string(&FontT48,&t7c2,TextC2,0); // T54 has only numbers |
3045 } | |
3046 | |
3047 if(stateUsed->diveSettings.ccrOption) | |
3048 { | |
662 | 3049 if(isLoopMode(stateUsed->diveSettings.diveMode)) |
38 | 3050 { |
3051 snprintf(TextC2,TEXTSIZE,"\020%01.2f",stateUsed->lifeData.ppO2); | |
662 | 3052 |
38 | 3053 if(stateUsed->warnings.betterSetpoint && warning_count_high_time && (stateUsed->diveSettings.diveMode == DIVEMODE_CCR)) |
3054 { | |
3055 TextC2[0] = '\a'; // inverse instead of color \020 | |
3056 GFX_write_string_color(&FontT48,&t7c2,TextC2,0,CLUT_WarningYellow); | |
3057 } | |
3058 else | |
3059 { | |
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
859
diff
changeset
|
3060 Gfx_colorsscheme_mod(TextC2, 0); |
38 | 3061 GFX_write_string(&FontT48,&t7c2,TextC2,0); |
3062 } | |
3063 } | |
3064 } | |
3065 else if(settingsGetPointer()->alwaysShowPPO2) | |
3066 { | |
3067 snprintf(TextC2,TEXTSIZE,"\020%01.2f",stateUsed->lifeData.ppO2); | |
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
859
diff
changeset
|
3068 Gfx_colorsscheme_mod(TextC2, 0); |
38 | 3069 GFX_write_string(&FontT48,&t7c2,TextC2,0); |
3070 } | |
3071 } | |
3072 | |
3073 /* algorithm, ccr, bailout and battery */ | |
3074 /* and permanent warnings (CNS) */ | |
3075 | |
3076 if((stateUsed->warnings.cnsHigh) && display_count_high_time) | |
3077 { | |
3078 TextC2[0] = '\f'; | |
3079 TextC2[1] = TXT_2BYTE; | |
3080 TextC2[2] = TXT2BYTE_WarnCnsHigh; | |
3081 TextC2[3] = 0; | |
662 | 3082 GFX_write_string_color(&FontT42,&t7c1,TextC2,0,CLUT_WarningRed); |
38 | 3083 } |
3084 else | |
3085 { | |
3086 if(stateUsed->warnings.aGf) | |
3087 { | |
3088 GFX_write_string_color(&FontT48,&t7c1,"\f" "aGF",0,CLUT_WarningYellow); | |
3089 } | |
3090 else if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE) | |
3091 { | |
3092 GFX_write_string(&FontT48,&t7c1,"\027\f" "GF",0); | |
3093 } | |
3094 else | |
3095 { | |
3096 GFX_write_string(&FontT48,&t7c1,"\027\f" "VPM",0); | |
3097 } | |
3098 | |
3099 if(stateUsed->diveSettings.diveMode == DIVEMODE_CCR) | |
3100 GFX_write_string(&FontT24,&t7c1,"\027\f\002" "CCR",0); | |
3101 // GFX_write_string(&FontT24,&t7c1,"\f\177\177\x80" "CCR",0); | |
3102 else | |
662 | 3103 if(stateUsed->diveSettings.diveMode == DIVEMODE_PSCR) |
3104 GFX_write_string(&FontT24,&t7c1,"\027\f\002" "PSCR",0); | |
3105 else | |
38 | 3106 if(stateUsed->diveSettings.ccrOption) |
3107 GFX_write_string(&FontT24,&t7c1,"\f\002\024" "Bailout",0); | |
3108 // GFX_write_string(&FontT24,&t7c1,"\f\177\177\x80\024" "Bailout",0); | |
3109 } | |
3110 TextC1[0] = '\020'; | |
3111 TextC1[1] = '3'; | |
3112 TextC1[2] = '1'; | |
3113 TextC1[3] = '1'; | |
3114 TextC1[4] = '1'; | |
3115 TextC1[5] = '1'; | |
3116 TextC1[6] = '1'; | |
3117 TextC1[7] = '1'; | |
3118 TextC1[8] = '1'; | |
3119 TextC1[9] = '1'; | |
3120 TextC1[10] = '1'; | |
3121 TextC1[11] = '1'; | |
3122 TextC1[12] = '0'; | |
3123 TextC1[13] = 0; | |
3124 | |
3125 for(int i=1;i<=10;i++) | |
3126 { | |
3127 if( stateUsed->lifeData.battery_charge > (9 * i)) | |
3128 TextC1[i+1] += 1; | |
3129 } | |
3130 | |
3131 if(stateUsed->warnings.lowBattery) | |
3132 { | |
3133 TextC1[0] = '\025'; | |
3134 if(warning_count_high_time) | |
3135 { | |
3136 for(int i=2;i<=11;i++) | |
3137 TextC1[i] = '1'; | |
3138 } | |
3139 else | |
3140 { | |
3141 TextC1[2] = '2'; | |
3142 } | |
3143 GFX_write_string(&Batt24,&t7batt,TextC1,0); | |
3144 | |
3145 if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->lifeData.battery_charge < 140)) | |
3146 { | |
3147 snprintf(TextC1,16,"\004\025\f\002%u%%",(uint8_t)stateUsed->lifeData.battery_charge); | |
3148 if(warning_count_high_time) | |
3149 TextC1[0] = '\a'; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3150 GFX_write_string(&FontT24,&t7voltage,TextC1,0); |
38 | 3151 } |
3152 } | |
3153 else | |
3154 { | |
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
859
diff
changeset
|
3155 Gfx_colorsscheme_mod(TextC1, 0); |
38 | 3156 GFX_write_string(&Batt24,&t7batt,TextC1,0); |
3157 | |
3158 if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->lifeData.battery_charge < 140)) | |
3159 { | |
3160 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
|
3161 Gfx_colorsscheme_mod(TextC1, 0); |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3162 GFX_write_string(&FontT24,&t7voltage,TextC1,0); // t7batt |
38 | 3163 } |
3164 } | |
3165 | |
3166 /* customizable left lower corner */ | |
3167 t7_refresh_divemode_userselected_left_lower_corner(); | |
3168 | |
3169 | |
3170 /* customview - option 1 | |
3171 * warning - option 2 */ | |
3172 if(stateUsed->warnings.numWarnings) | |
3173 customview_warnings = t7_test_customview_warnings(); | |
3174 | |
166
255eedad4155
cleanup: get rid of some compile warnings
Jan Mulder <jlmulder@xs4all.nl>
parents:
149
diff
changeset
|
3175 background.pointer = 0; |
38 | 3176 if(customview_warnings && warning_count_high_time) |
3177 t7_show_customview_warnings(); | |
3178 else | |
3179 t7_refresh_customview(); | |
3180 | |
3181 /* the frame */ | |
3182 draw_frame(1,1, CLUT_DIVE_pluginbox, CLUT_DIVE_FieldSeperatorLines); | |
3183 } | |
3184 | |
3185 void t7_set_field_to_primary(void) | |
3186 { | |
3187 if(stateUsed->mode == MODE_DIVE) | |
3188 selection_custom_field = settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary; | |
3189 } | |
3190 | |
3191 void t7_change_field(void) | |
3192 { | |
3193 selection_custom_field++; | |
3194 | |
442
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3195 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
|
3196 { |
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3197 selection_custom_field++; |
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3198 } |
662 | 3199 if((selection_custom_field == LLC_ScrubberTime) && ((settingsGetPointer()->scrubTimerMode == SCRUB_TIMER_OFF) || (!isLoopMode(settingsGetPointer()->dive_mode)))) |
656 | 3200 { |
3201 selection_custom_field++; | |
3202 } | |
662 | 3203 #ifdef ENABLE_PSCR_MODE |
3204 if((selection_custom_field == LCC_SimPpo2) && (settingsGetPointer()->dive_mode != DIVEMODE_PSCR)) | |
3205 { | |
3206 selection_custom_field++; | |
3207 } | |
3208 #endif | |
840 | 3209 #ifdef ENABLE_CO2_SUPPORT |
3210 if((selection_custom_field == LCC_CO2) && (settingsGetPointer()->co2_sensor_active == 0)) | |
3211 { | |
3212 selection_custom_field++; | |
3213 } | |
3214 | |
3215 #endif | |
3216 | |
442
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3217 if(selection_custom_field >= LLC_END) |
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3218 { |
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3219 selection_custom_field = LLC_Empty; |
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3220 } |
38 | 3221 } |
3222 | |
3223 | |
3224 void t7_refresh_divemode_userselected_left_lower_corner(void) | |
3225 { | |
3226 if(!selection_custom_field) | |
3227 return; | |
3228 | |
3229 char headerText[10]; | |
3230 char text[TEXTSIZE]; | |
3231 uint8_t textpointer = 0; | |
3232 _Bool tinyHeaderFont = 0; | |
3233 uint8_t line = 0; | |
457 | 3234 #ifdef ENABLE_BOTTLE_SENSOR |
442
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3235 uint16_t agedColor = 0; |
457 | 3236 #endif |
38 | 3237 |
3238 SDivetime Stopwatch = {0,0,0,0}; | |
3239 float fAverageDepth, fAverageDepthAbsolute; | |
3240 const SDecoinfo * pDecoinfoStandard; | |
3241 const SDecoinfo * pDecoinfoFuture; | |
3242 float fCNS; | |
3243 float temperature; | |
710 | 3244 SSettings* pSettings = settingsGetPointer(); |
38 | 3245 |
3246 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE) | |
3247 { | |
3248 pDecoinfoStandard = &stateUsed->decolistBuehlmann; | |
3249 pDecoinfoFuture = &stateUsed->decolistFutureBuehlmann; | |
3250 } | |
3251 else | |
3252 { | |
3253 pDecoinfoStandard = &stateUsed->decolistVPM; | |
3254 pDecoinfoFuture = &stateUsed->decolistFutureVPM; | |
3255 } | |
3256 | |
3257 Stopwatch.Total = timer_Stopwatch_GetTime(); | |
3258 Stopwatch.Minutes = Stopwatch.Total / 60; | |
3259 Stopwatch.Seconds = Stopwatch.Total - ( Stopwatch.Minutes * 60 ); | |
3260 fAverageDepth = timer_Stopwatch_GetAvarageDepth_Meter(); | |
3261 fAverageDepthAbsolute = stateUsed->lifeData.average_depth_meter; | |
3262 | |
3263 headerText[0] = '\032'; | |
3264 headerText[1] = '\f'; | |
3265 | |
3266 switch(selection_custom_field) | |
3267 { | |
3268 /* Temperature */ | |
442
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3269 case LLC_Temperature: |
38 | 3270 default: |
189
8b8074080d7b
Bugfix: average temperature on arrival from RTE instead of display time
Jan Mulder <jlmulder@xs4all.nl>
parents:
187
diff
changeset
|
3271 temperature = unit_temperature_float(stateUsed->lifeData.temperature_celsius); |
38 | 3272 headerText[2] = TXT_Temperature; |
3273 textpointer = snprintf(text,TEXTSIZE,"\020\016%01.1f \140",temperature); // "\016\016%01.1f `" + C or F | |
3274 if(settingsGetPointer()->nonMetricalSystem == 0) | |
3275 text[textpointer++] = 'C'; | |
3276 else | |
3277 text[textpointer++] = 'F'; | |
3278 text[textpointer++] = 0; | |
3279 tinyHeaderFont = 0; | |
3280 break; | |
3281 | |
3282 /* Average Depth */ | |
442
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3283 case LLC_AverageDepth: |
38 | 3284 headerText[2] = TXT_AvgDepth; |
710 | 3285 if(pSettings->nonMetricalSystem) |
38 | 3286 snprintf(text,TEXTSIZE,"\020%01.0f",unit_depth_float(fAverageDepthAbsolute)); |
3287 else | |
3288 snprintf(text,TEXTSIZE,"\020%01.1f",fAverageDepthAbsolute); | |
3289 break; | |
3290 | |
3291 /* ppO2 */ | |
442
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3292 case LLC_ppO2: |
38 | 3293 headerText[2] = TXT_ppO2; |
3294 snprintf(text,TEXTSIZE,"\020%01.2f",stateUsed->lifeData.ppO2); | |
3295 break; | |
3296 | |
3297 /* Stop Uhr */ | |
442
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3298 case LLC_Stopwatch: |
38 | 3299 headerText[2] = TXT_Stopwatch; |
710 | 3300 if(pSettings->nonMetricalSystem) |
38 | 3301 snprintf(text,TEXTSIZE,"\020\016\016%u:%02u\n\r%01.0f",Stopwatch.Minutes, Stopwatch.Seconds,unit_depth_float(fAverageDepth)); |
3302 else | |
3303 snprintf(text,TEXTSIZE,"\020\016\016%u:%02u\n\r%01.1f",Stopwatch.Minutes, Stopwatch.Seconds,fAverageDepth); | |
3304 tinyHeaderFont = 1; | |
3305 line = 1; | |
3306 break; | |
3307 | |
3308 /* Ceiling */ | |
442
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3309 case LLC_Ceiling: |
38 | 3310 headerText[2] = TXT_Ceiling; |
710 | 3311 if((pDecoinfoStandard->output_ceiling_meter > 99.9f) || (pSettings->nonMetricalSystem)) |
38 | 3312 snprintf(text,TEXTSIZE,"\020%01.0f",unit_depth_float(pDecoinfoStandard->output_ceiling_meter)); |
3313 else | |
3314 snprintf(text,TEXTSIZE,"\020%01.1f",pDecoinfoStandard->output_ceiling_meter); | |
3315 break; | |
3316 | |
3317 /* Future TTS */ | |
442
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3318 case LLC_FutureTTS: |
38 | 3319 headerText[2] = TXT_FutureTTS; |
214
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
211
diff
changeset
|
3320 if (pDecoinfoFuture->output_time_to_surface_seconds < 1000 * 60) |
710 | 3321 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
|
3322 else |
710 | 3323 snprintf(text,TEXTSIZE,"\020\016\016@+%u'\n\r" "%ih TTS",pSettings->future_TTS, (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 3600); |
38 | 3324 tinyHeaderFont = 1; |
3325 line = 1; | |
3326 break; | |
3327 | |
3328 /* CNS */ | |
442
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3329 case LLC_CNS: |
38 | 3330 headerText[2] = TXT_CNS; |
3331 fCNS = stateUsed->lifeData .cns; | |
3332 if(fCNS > 999) | |
3333 fCNS = 999; | |
3334 snprintf(text,TEXTSIZE,"\020%.0f\016\016%%\017",fCNS); | |
3335 break; | |
3336 | |
3337 /* actual GF */ | |
442
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3338 case LLC_GF: |
38 | 3339 headerText[2] = TXT_ActualGradient; |
247
3949781096d4
feature: Relative GF to Saturation renames
Jan Mulder <jlmulder@xs4all.nl>
parents:
225
diff
changeset
|
3340 snprintf(text,TEXTSIZE,"\020%.0f\016\016%%\017",100 * pDecoinfoStandard->super_saturation); |
38 | 3341 break; |
656 | 3342 |
3343 case LLC_ScrubberTime: | |
3344 tinyHeaderFont = 1; | |
3345 headerText[2] = TXT_ScrubTime; | |
758
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
756
diff
changeset
|
3346 |
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
756
diff
changeset
|
3347 printScrubberText(text, TEXTSIZE, pSettings); |
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
756
diff
changeset
|
3348 |
656 | 3349 break; |
662 | 3350 #ifdef ENABLE_PSCR_MODE |
3351 case LCC_SimPpo2: | |
3352 headerText[2] = TXT_SimPpo2; | |
3353 snprintf(text,TEXTSIZE,"\020%.2f\016\016Bar\017",stateUsed->lifeData.ppo2Simulated_bar); | |
3354 break; | |
3355 #endif | |
656 | 3356 |
446
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
442
diff
changeset
|
3357 #ifdef ENABLE_BOTTLE_SENSOR |
442
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3358 case LCC_BottleBar: |
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3359 headerText[2] = TXT_AtemGasVorrat; |
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3360 tinyHeaderFont = 1; |
448
f7c66593ab82
Added compile switch to show voltage parallel to charge status percantage
ideenmodellierer
parents:
446
diff
changeset
|
3361 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
|
3362 break; |
446
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
442
diff
changeset
|
3363 #endif |
749 | 3364 #ifdef ENABLE_CO2_SUPPORT |
3365 case LCC_CO2: | |
3366 headerText[2] = TXT_CO2Sensor; | |
3367 if(stateUsed->lifeData.CO2_data.CO2_ppm < CO2_WARNING_LEVEL_PPM) | |
3368 { | |
3369 text[textpointer++] = '\020'; | |
3370 } | |
3371 else if(stateUsed->lifeData.CO2_data.CO2_ppm < CO2_ALARM_LEVEL_PPM) | |
3372 { | |
3373 text[textpointer++] = '\024'; /* yellow */ | |
3374 } | |
3375 else | |
3376 { | |
3377 text[textpointer++] = '\025'; /* red */ | |
3378 } | |
3379 snprintf(&text[textpointer],TEXTSIZE,"\%5ldppm", stateUsed->lifeData.CO2_data.CO2_ppm); | |
799 | 3380 break; |
749 | 3381 #endif |
737
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3382 case LLC_Compass: |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3383 headerText[2] = TXT_2BYTE; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3384 headerText[3] = TXT2BYTE_Compass; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3385 tinyHeaderFont = 1; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3386 |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3387 uint16_t heading; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3388 if(settingsGetPointer()->compassInertia) { |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3389 heading = (uint16_t)compass_getCompensated(); |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3390 } else { |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3391 heading = (uint16_t)stateUsed->lifeData.compass_heading; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3392 } |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3393 |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3394 uint16_t userSetHeading = stateUsed->diveSettings.compassHeading; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3395 if (!userSetHeading) { |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3396 snprintf(text, TEXTSIZE, "\020\002\034%u ", heading); |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3397 } else { |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3398 snprintf(text, TEXTSIZE, "\020\002\034\016\016%u ", heading); |
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 int16_t declinationFromForwardMark = ((userSetHeading - heading + 180 + 360) % 360) - 180; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3401 int16_t declinationFromNearestMark = ((declinationFromForwardMark + 90 + 180) % 180) - 90; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3402 |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3403 uint16_t colour; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3404 if (abs(declinationFromForwardMark) <= 90) { |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3405 colour = CLUT_CompassUserHeadingTick; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3406 } else { |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3407 colour = CLUT_CompassUserBackHeadingTick; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3408 } |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3409 |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3410 char direction[] = "\001 \004 \004 "; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3411 if (abs(declinationFromNearestMark) <= 10) { |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3412 direction[2] = '>'; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3413 direction[6] = '<'; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3414 |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3415 if (abs(declinationFromForwardMark) <= 10) { |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3416 direction[4] = 'X'; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3417 } else { |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3418 direction[4] = 'O'; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3419 } |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3420 |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3421 if (abs(declinationFromNearestMark) <= 3) { |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3422 direction[3] = '\a'; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3423 direction[5] = '\a'; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3424 } |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3425 } else { |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3426 if (declinationFromForwardMark < -90) { |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3427 direction[7] = 'O'; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3428 } else if (declinationFromForwardMark < 0) { |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3429 direction[1] = 'X'; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3430 } else if (declinationFromForwardMark <= 90) { |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3431 direction[7] = 'X'; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3432 } else { |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3433 direction[1] = 'O'; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3434 } |
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 >= 0) { |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3437 direction[6] = '>'; |
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 > 30) { |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3440 direction[4] = '>'; |
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 > 60 || declinationFromForwardMark == 90) { |
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 < 0) { |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3446 direction[2] = '<'; |
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 < -30) { |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3449 direction[4] = '<'; |
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 if (declinationFromNearestMark < -60 || declinationFromForwardMark == -90) { |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3452 direction[6] = '<'; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3453 } |
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 GFX_write_string_color(&FontT48, &t7l3, direction, 1, colour); |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3457 } |
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 break; |
38 | 3460 } |
737
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3461 |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3462 if (headerText[2] != TXT_2BYTE) { |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3463 headerText[3] = 0; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3464 } else { |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3465 headerText[4] = 0; |
5071d554aaa5
NEW: Add mini compass with marker declination indication
heinrichsweikamp
parents:
710
diff
changeset
|
3466 } |
38 | 3467 |
3468 if(tinyHeaderFont) | |
3469 GFX_write_string(&FontT24,&t7l3,headerText,0); | |
3470 else | |
3471 GFX_write_string(&FontT42,&t7l3,headerText,0); | |
3472 | |
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
859
diff
changeset
|
3473 Gfx_colorsscheme_mod(text, 0); |
446
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
442
diff
changeset
|
3474 #ifndef ENABLE_BOTTLE_SENSOR |
748 | 3475 #ifdef ENABLE_CO2_SUPPORT |
3476 if(selection_custom_field != LCC_CO2) | |
3477 { | |
3478 GFX_write_string(&FontT105,&t7l3,text,line); | |
3479 } | |
3480 else | |
3481 { | |
3482 GFX_write_string(&FontT48,&t7l3,text,line); | |
3483 } | |
3484 #else | |
3485 GFX_write_string(&FontT105,&t7l3,text,line); | |
3486 #endif | |
446
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
442
diff
changeset
|
3487 #else |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
442
diff
changeset
|
3488 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
|
3489 { |
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3490 GFX_write_string(&FontT105,&t7l3,text,line); |
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3491 } |
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3492 else |
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 = 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
|
3495 if(agedColor > 1200) |
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3496 { |
448
f7c66593ab82
Added compile switch to show voltage parallel to charge status percantage
ideenmodellierer
parents:
446
diff
changeset
|
3497 agedColor = CLUT_WarningRed; |
442
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3498 } |
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3499 else |
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3500 if(agedColor > 600) |
448
f7c66593ab82
Added compile switch to show voltage parallel to charge status percantage
ideenmodellierer
parents:
446
diff
changeset
|
3501 { |
f7c66593ab82
Added compile switch to show voltage parallel to charge status percantage
ideenmodellierer
parents:
446
diff
changeset
|
3502 agedColor = CLUT_MenuLineUnselected; |
f7c66593ab82
Added compile switch to show voltage parallel to charge status percantage
ideenmodellierer
parents:
446
diff
changeset
|
3503 } |
f7c66593ab82
Added compile switch to show voltage parallel to charge status percantage
ideenmodellierer
parents:
446
diff
changeset
|
3504 else |
f7c66593ab82
Added compile switch to show voltage parallel to charge status percantage
ideenmodellierer
parents:
446
diff
changeset
|
3505 if(agedColor > 20) |
442
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3506 { |
448
f7c66593ab82
Added compile switch to show voltage parallel to charge status percantage
ideenmodellierer
parents:
446
diff
changeset
|
3507 agedColor = CLUT_Font031; |
442
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3508 } |
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3509 else |
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3510 { |
448
f7c66593ab82
Added compile switch to show voltage parallel to charge status percantage
ideenmodellierer
parents:
446
diff
changeset
|
3511 agedColor = CLUT_Font020; |
442
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3512 } |
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3513 |
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3514 GFX_write_string_color(&FontT105,&t7l3,text,line,agedColor); |
adb18fe92737
Introduced enum for lower left corner view selection:
ideenmodellierer
parents:
432
diff
changeset
|
3515 } |
446
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
442
diff
changeset
|
3516 #endif |
38 | 3517 } |
3518 | |
3519 /* Private functions ---------------------------------------------------------*/ | |
3520 | |
3521 uint8_t t7_customtextPrepare(char * text) | |
3522 { | |
3523 uint8_t i, j, textptr, lineCount; | |
3524 char nextChar; | |
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
537
diff
changeset
|
3525 uint8_t alignmentChanged = 0; |
38 | 3526 |
3527 textptr = 0; | |
3528 lineCount = 0; | |
3529 | |
3530 text[textptr++] = TXT_MINIMAL; | |
3531 | |
3532 j = 0; | |
3533 i = 0; | |
3534 do | |
3535 { | |
3536 j += i; | |
3537 i = 0; | |
3538 do | |
3539 { | |
3540 nextChar = settingsGetPointer()->customtext[i+j]; | |
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
537
diff
changeset
|
3541 if((nextChar == '^') && (alignmentChanged == 0)) /* center */ |
537
0ad0b26ec56b
Added center / right alignment option to custom text display:
Ideenmodellierer
parents:
530
diff
changeset
|
3542 { |
0ad0b26ec56b
Added center / right alignment option to custom text display:
Ideenmodellierer
parents:
530
diff
changeset
|
3543 text[textptr++] = '\001'; |
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
537
diff
changeset
|
3544 alignmentChanged = 1; |
537
0ad0b26ec56b
Added center / right alignment option to custom text display:
Ideenmodellierer
parents:
530
diff
changeset
|
3545 i++; |
0ad0b26ec56b
Added center / right alignment option to custom text display:
Ideenmodellierer
parents:
530
diff
changeset
|
3546 }else |
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
537
diff
changeset
|
3547 if((nextChar == 180) && (alignmentChanged == 0)) /* '�' => Right */ |
537
0ad0b26ec56b
Added center / right alignment option to custom text display:
Ideenmodellierer
parents:
530
diff
changeset
|
3548 { |
0ad0b26ec56b
Added center / right alignment option to custom text display:
Ideenmodellierer
parents:
530
diff
changeset
|
3549 text[textptr++] = '\002'; |
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
537
diff
changeset
|
3550 alignmentChanged = 1; |
537
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 }else |
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 i++; |
0ad0b26ec56b
Added center / right alignment option to custom text display:
Ideenmodellierer
parents:
530
diff
changeset
|
3555 if((!nextChar) || (nextChar =='\n') || (nextChar =='\r')) |
0ad0b26ec56b
Added center / right alignment option to custom text display:
Ideenmodellierer
parents:
530
diff
changeset
|
3556 { |
0ad0b26ec56b
Added center / right alignment option to custom text display:
Ideenmodellierer
parents:
530
diff
changeset
|
3557 break; |
0ad0b26ec56b
Added center / right alignment option to custom text display:
Ideenmodellierer
parents:
530
diff
changeset
|
3558 } |
0ad0b26ec56b
Added center / right alignment option to custom text display:
Ideenmodellierer
parents:
530
diff
changeset
|
3559 text[textptr++] = nextChar; |
0ad0b26ec56b
Added center / right alignment option to custom text display:
Ideenmodellierer
parents:
530
diff
changeset
|
3560 } |
38 | 3561 } while (i < 12); |
3562 | |
537
0ad0b26ec56b
Added center / right alignment option to custom text display:
Ideenmodellierer
parents:
530
diff
changeset
|
3563 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
|
3564 { |
0ad0b26ec56b
Added center / right alignment option to custom text display:
Ideenmodellierer
parents:
530
diff
changeset
|
3565 while((textptr - 1 > 0) && (text[textptr - 1] == 32)) |
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 textptr--; |
0ad0b26ec56b
Added center / right alignment option to custom text display:
Ideenmodellierer
parents:
530
diff
changeset
|
3568 } |
0ad0b26ec56b
Added center / right alignment option to custom text display:
Ideenmodellierer
parents:
530
diff
changeset
|
3569 } |
0ad0b26ec56b
Added center / right alignment option to custom text display:
Ideenmodellierer
parents:
530
diff
changeset
|
3570 |
38 | 3571 if(!nextChar) |
3572 break; | |
3573 | |
3574 if(lineCount < 3) | |
3575 { | |
3576 text[textptr++] = '\n'; | |
3577 text[textptr++] = '\r'; | |
3578 } | |
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
537
diff
changeset
|
3579 alignmentChanged = 0; |
38 | 3580 lineCount++; |
3581 for(uint8_t k=0;k<2;k++) | |
3582 { | |
3583 nextChar = settingsGetPointer()->customtext[i+j+k]; | |
3584 if((nextChar =='\n') || (nextChar =='\r')) | |
3585 i++; | |
3586 else | |
3587 break; | |
3588 } | |
3589 | |
3590 } while (lineCount < 4); | |
3591 | |
3592 text[textptr] = 0; | |
3593 return lineCount; | |
3594 } | |
3595 | |
3596 void draw_frame(_Bool PluginBoxHeader, _Bool LinesOnTheSides, uint8_t colorBox, uint8_t colorLinesOnTheSide) | |
3597 { | |
3598 point_t LeftLow, WidthHeight; | |
3599 point_t start, stop; | |
3600 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3601 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3602 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3603 |
38 | 3604 // plugin box |
3605 LeftLow.x = CUSTOMBOX_LINE_LEFT; | |
3606 WidthHeight.x = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_LINE_LEFT; | |
3607 LeftLow.y = 60; | |
3608 WidthHeight.y = 440 - LeftLow.y; | |
642
c737cf5d9067
Do not show focus indicator in case motion detection is suspended:
Ideenmodellierer
parents:
631
diff
changeset
|
3609 if((viewInFocus() && (!viewDetectionSuspended()))) |
553 | 3610 { |
3611 GFX_draw_box(&t7screen, LeftLow, WidthHeight, 1, CLUT_Font023); | |
3612 } | |
3613 else | |
3614 { | |
3615 GFX_draw_box(&t7screen, LeftLow, WidthHeight, 1, colorBox); | |
3616 } | |
38 | 3617 |
3618 if(PluginBoxHeader) | |
3619 { | |
3620 // plugin box - header | |
3621 start.x = CUSTOMBOX_LINE_LEFT; | |
3622 stop.x = CUSTOMBOX_LINE_RIGHT; | |
3623 stop.y = start.y = 440 - 60; | |
3624 GFX_draw_line(&t7screen, start, stop, colorBox); | |
3625 } | |
3626 | |
3627 if(LinesOnTheSides) | |
3628 { | |
3629 // aufteilung links | |
3630 start.x = 0; | |
3631 stop.x = CUSTOMBOX_LINE_LEFT; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3632 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3633 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3634 stop.y = start.y = t7l1.WindowY0 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3635 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3636 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3637 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3638 stop.y = start.y = 480 - t7l1.WindowY1 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3639 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3640 |
38 | 3641 GFX_draw_line(&t7screen, start, stop, colorLinesOnTheSide); |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3642 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3643 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3644 stop.y = start.y = t7l2.WindowY0 -1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3645 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3646 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3647 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3648 stop.y = start.y = 480 - t7l2.WindowY1 -1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3649 } |
38 | 3650 GFX_draw_line(&t7screen, start, stop, colorLinesOnTheSide); |
3651 | |
3652 // aufteilung rechts | |
3653 start.x = CUSTOMBOX_LINE_RIGHT; | |
3654 stop.x = 799; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3655 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3656 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3657 stop.y = start.y = t7l1.WindowY0 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3658 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3659 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3660 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3661 stop.y = start.y = 480 - t7l1.WindowY1 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3662 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3663 |
38 | 3664 GFX_draw_line(&t7screen, start, stop, colorLinesOnTheSide); |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3665 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3666 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3667 stop.y = start.y = t7l2.WindowY0 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3668 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3669 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3670 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3671 stop.y = start.y = 480 - t7l2.WindowY1 - 1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3672 } |
38 | 3673 GFX_draw_line(&t7screen, start, stop, colorLinesOnTheSide); |
3674 } | |
3675 } | |
3676 | |
3677 | |
3678 /* Compass like TCOS shellfish | |
3679 * input is 0 to 359 | |
3680 * 2 px / 1 degree | |
3681 * Range is 148 degree with CUSTOMBOX_SPACE_INSIDE = 296 | |
3682 * one side is 74 degree (less than 90 degree) | |
3683 * internal 360 + 180 degree of freedom | |
3684 * use positive values only, shift by 360 below 90 mid position | |
3685 */ | |
3686 | |
3687 | |
3688 point_t t7_compass_circle(uint8_t id, uint16_t degree) | |
3689 { | |
3690 float fCos, fSin; | |
3691 const float piMult = ((2 * 3.14159) / 360); | |
3692 // const int radius[4] = {95,105,115,60}; | |
3693 const int radius[4] = {95,105,115,100}; | |
3694 const point_t offset = {.x = 400, .y = 250}; | |
3695 | |
3696 static point_t r[4][360] = { 0 }; | |
3697 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3698 if(r[0][0].y == 0) /* calc table at first call only */ |
38 | 3699 { |
3700 for(int i=0;i<360;i++) | |
3701 { | |
3702 fCos = cos(i * piMult); | |
3703 fSin = sin(i * piMult); | |
3704 for(int j=0;j<4;j++) | |
3705 { | |
3706 r[j][i].x = offset.x + (int)(fSin * radius[j]); | |
3707 r[j][i].y = offset.y + (int)(fCos * radius[j]); | |
3708 } | |
3709 } | |
3710 } | |
3711 if(id > 3) id = 0; | |
3712 if(degree > 359) degree = 0; | |
3713 return r[id][degree]; | |
3714 } | |
3715 | |
3716 /* range should be 0 to 30 bar if 300 meter with 100% of nitrogen or helium | |
3717 * T24 is 28 high | |
3718 */ | |
3719 void t7_tissues(const SDiveState * pState) | |
3720 { | |
3721 point_t start, change, stop; | |
3722 float value; | |
3723 uint16_t front, cns100pixel; | |
3724 char text[256]; | |
3725 uint8_t textpointer = 0; | |
3726 uint8_t color; | |
3727 | |
3728 float percent_N2; | |
3729 float percent_He; | |
3730 float partial_pressure_N2; | |
3731 float partial_pressure_He; | |
3732 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3733 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3734 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3735 |
38 | 3736 |
3737 /* N2 */ | |
3738 t7cY0free.WindowLineSpacing = 28 + 48 + 14; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3739 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3740 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3741 t7cY0free.WindowY0 = t7cH.WindowY0 - 5 - 2 * t7cY0free.WindowLineSpacing; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3742 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3743 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3744 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3745 t7cY0free.WindowY0 = t7cH.WindowY0 + 15; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3746 t7cY0free.WindowY1 = t7cY0free.WindowY0 + 250; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3747 } |
38 | 3748 t7cY0free.WindowNumberOfTextLines = 3; |
3749 | |
3750 text[textpointer++] = '\030'; | |
3751 text[textpointer++] = TXT_2BYTE; | |
3752 text[textpointer++] = TXT2BYTE_Nitrogen; | |
3753 text[textpointer++] = '\n'; | |
3754 text[textpointer++] = '\r'; | |
3755 text[textpointer++] = TXT_2BYTE; | |
3756 text[textpointer++] = TXT2BYTE_Helium; | |
3757 text[textpointer++] = '\n'; | |
3758 text[textpointer++] = '\r'; | |
3759 text[textpointer++] = TXT_2BYTE; | |
3760 text[textpointer++] = TXT2BYTE_CNS; | |
3761 text[textpointer++] = 0; | |
3762 | |
3763 GFX_write_string(&FontT24, &t7cY0free, text, 1); | |
3764 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3765 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3766 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3767 start.y = t7cH.WindowY0 - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3768 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3769 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3770 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3771 start.y = t7cH.WindowY1 - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3772 } |
38 | 3773 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
3774 stop.x = start.x + CUSTOMBOX_SPACE_INSIDE; | |
3775 | |
3776 for(int i=0;i<16;i++) | |
3777 { | |
3778 stop.y = start.y; | |
3779 change.y = start.y; | |
3780 | |
3781 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
|
3782 value *= 80; |
38 | 3783 |
3784 if(value < 0) | |
3785 front = 0; | |
3786 else | |
3787 if(value > CUSTOMBOX_SPACE_INSIDE) | |
3788 front = CUSTOMBOX_SPACE_INSIDE; | |
3789 else | |
3790 front = (uint16_t)value; | |
3791 | |
3792 change.x = start.x + front; | |
3793 if(change.x != start.x) | |
3794 GFX_draw_thick_line(1,&t7screen, start, change, CLUT_Font030); | |
3795 if(change.x != stop.x) | |
3796 GFX_draw_thick_line(1,&t7screen, change, stop, CLUT_Font031); | |
3797 | |
3798 start.y -= 3; | |
3799 } | |
3800 | |
3801 /* He */ | |
3802 start.y -= 28 + 14; | |
3803 for(int i=0;i<16;i++) | |
3804 { | |
3805 stop.y = start.y; | |
3806 change.y = start.y; | |
3807 | |
3808 value = pState->lifeData.tissue_helium_bar[i]; | |
3809 value *= 80;//20 | |
3810 | |
3811 if(value < 0) | |
3812 front = 0; | |
3813 else if(value > CUSTOMBOX_SPACE_INSIDE) | |
3814 front = CUSTOMBOX_SPACE_INSIDE; | |
3815 else | |
3816 front = (uint16_t)value; | |
3817 | |
3818 change.x = start.x + front; | |
3819 if(change.x != start.x) | |
3820 GFX_draw_thick_line(1,&t7screen, start, change, CLUT_Font030); | |
3821 if(change.x != stop.x) | |
3822 GFX_draw_thick_line(1,&t7screen, change, stop, CLUT_Font031); | |
3823 | |
3824 start.y -= 3; | |
3825 } | |
3826 | |
3827 /* CNS == Oxygen */ | |
3828 start.y -= 28 + 14; | |
3829 | |
3830 cns100pixel = (8 * CUSTOMBOX_SPACE_INSIDE) / 10; | |
3831 value = pState->lifeData.cns; | |
3832 value *= cns100pixel; | |
3833 value /= 100; | |
3834 | |
3835 if(value < 0) | |
3836 front = 0; | |
3837 else if(value > CUSTOMBOX_SPACE_INSIDE) | |
3838 front = CUSTOMBOX_SPACE_INSIDE; | |
3839 else | |
3840 front = (uint16_t)value; | |
3841 | |
3842 if(pState->lifeData.cns < 95) | |
3843 color = CLUT_Font030; | |
3844 else if(pState->lifeData.cns < 100) | |
3845 color = CLUT_WarningYellow; | |
3846 else | |
3847 color = CLUT_WarningRed; | |
3848 | |
3849 for(int i=0;i<16;i++) | |
3850 { | |
3851 stop.y = start.y; | |
3852 change.y = start.y; | |
3853 | |
3854 change.x = start.x + front; | |
3855 if(change.x != start.x) | |
3856 GFX_draw_thick_line(1,&t7screen, start, change, color); | |
3857 if(change.x != stop.x) | |
3858 GFX_draw_thick_line(1,&t7screen, change, stop, CLUT_Font031); | |
3859 | |
3860 start.y -= 3; | |
3861 } | |
3862 | |
3863 /* where is the onload/offload limit for N2 and He */ | |
3864 decom_get_inert_gases(pState->lifeData.pressure_ambient_bar, &pState->lifeData.actualGas, &percent_N2, &percent_He); | |
3865 partial_pressure_N2 = (pState->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * percent_N2; | |
3866 partial_pressure_He = (pState->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * percent_He; | |
3867 | |
3868 // Nitrogen vertical bar | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3869 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3870 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3871 start.y = t7cH.WindowY0 + 1 - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3872 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3873 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3874 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3875 start.y = t7cH.WindowY1 - 5; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3876 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3877 |
38 | 3878 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
|
3879 if((percent_N2 > 0) && (partial_pressure_N2 > 0.7512f)) |
38 | 3880 { |
222
9b4b3decd9ba
Bugfix: correct presentation error in tissues custom view
Jan Mulder <jlmulder@xs4all.nl>
parents:
215
diff
changeset
|
3881 value = partial_pressure_N2 - 0.7512f; |
9b4b3decd9ba
Bugfix: correct presentation error in tissues custom view
Jan Mulder <jlmulder@xs4all.nl>
parents:
215
diff
changeset
|
3882 value *= 80; |
38 | 3883 |
3884 if(value < 0) | |
3885 front = 3; | |
3886 else if(value + 5 > CUSTOMBOX_SPACE_INSIDE) | |
3887 front = CUSTOMBOX_SPACE_INSIDE - 3; | |
3888 else | |
3889 front = (uint16_t)value; | |
3890 } | |
3891 else | |
3892 { | |
3893 front = 1; | |
3894 } | |
3895 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + front; | |
3896 stop.x = start.x; | |
3897 GFX_draw_thick_line(2,&t7screen, start, stop, CLUT_EverythingOkayGreen); | |
3898 | |
3899 | |
3900 // Helium vertical bar | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3901 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3902 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3903 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
|
3904 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3905 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3906 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3907 start.y = t7cH.WindowY1 - 5 - 3*16 - 28 - 14; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3908 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3909 |
38 | 3910 stop.y = start.y - (3 * 15) - 1; |
3911 if((percent_He > 0) && (partial_pressure_He > 0.01f)) // 0.5f | |
3912 { | |
3913 | |
3914 value = partial_pressure_He; | |
222
9b4b3decd9ba
Bugfix: correct presentation error in tissues custom view
Jan Mulder <jlmulder@xs4all.nl>
parents:
215
diff
changeset
|
3915 value *= 80; |
38 | 3916 |
3917 if(value < 0) | |
3918 front = 3; | |
3919 else if(value + 5 > CUSTOMBOX_SPACE_INSIDE) | |
3920 front = CUSTOMBOX_SPACE_INSIDE - 3; | |
3921 else | |
3922 front = (uint16_t)value; | |
3923 } | |
3924 else | |
3925 { | |
3926 front = 1; | |
3927 } | |
3928 | |
3929 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + front; | |
3930 stop.x = start.x; | |
3931 GFX_draw_thick_line(2,&t7screen, start, stop, CLUT_EverythingOkayGreen); | |
3932 | |
3933 // Oxygen vertical bar | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3934 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3935 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3936 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
|
3937 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3938 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3939 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3940 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
|
3941 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3942 |
38 | 3943 stop.y = start.y - (3 * 15) - 1; |
3944 | |
3945 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + cns100pixel; | |
3946 stop.x = start.x; | |
3947 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
|
3948 |
38 | 3949 } |
3950 | |
3951 | |
3952 void t7_debug(void) | |
3953 { | |
3954 char text[256+50]; | |
3955 uint8_t textpointer = 0; | |
3956 | |
3957 t7cY0free.WindowLineSpacing = 28 + 48 + 14; | |
3958 t7cY0free.WindowY0 = t7cH.WindowY0 - 5 - 2 * t7cY0free.WindowLineSpacing; | |
3959 t7cY0free.WindowNumberOfTextLines = 3; | |
3960 | |
3961 textpointer += snprintf(&text[textpointer],50,"Ambient [bar]\n\r"); | |
3962 textpointer += snprintf(&text[textpointer],50,"Surface [bar] + salt\n\r"); | |
3963 // textpointer += snprintf(&text[textpointer],50,"Difference [mbar]\n\r"); | |
3964 textpointer += snprintf(&text[textpointer],50,"ShallowCounter [s]\n\r"); | |
3965 GFX_write_string(&FontT24, &t7cY0free, text, 1); | |
3966 | |
3967 t7cY0free.WindowY0 -= 52; | |
3968 // 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)); | |
3969 snprintf(text,60, | |
3970 "%0.2f\n\r" | |
3971 "%0.2f %u%%\n\r" | |
3972 "%u" | |
3973 ,stateUsed->lifeData.pressure_ambient_bar | |
3974 ,stateUsed->lifeData.pressure_surface_bar | |
3975 ,settingsGetPointer()->salinity | |
3976 ,stateUsed->lifeData.counterSecondsShallowDepth); | |
3977 GFX_write_string(&FontT42, &t7cY0free, text, 1); | |
3978 } | |
3979 | |
3980 | |
3981 void t7_SummaryOfLeftCorner(void) | |
3982 { | |
3983 char text[256+60]; | |
3984 uint8_t textpointer = 0; | |
656 | 3985 SSettings* pSettings = settingsGetPointer(); |
38 | 3986 |
3987 const SDecoinfo * pDecoinfoStandard; | |
3988 const SDecoinfo * pDecoinfoFuture; | |
3989 float fCNS; | |
3990 | |
3991 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE) | |
3992 { | |
3993 pDecoinfoStandard = &stateUsed->decolistBuehlmann; | |
3994 pDecoinfoFuture = &stateUsed->decolistFutureBuehlmann; | |
3995 } | |
3996 else | |
3997 { | |
3998 pDecoinfoStandard = &stateUsed->decolistVPM; | |
3999 pDecoinfoFuture = &stateUsed->decolistFutureVPM; | |
4000 } | |
4001 | |
4002 fCNS = stateUsed->lifeData .cns; | |
4003 if(fCNS > 999) | |
4004 fCNS = 999; | |
4005 | |
4006 t7cY0free.WindowY0 = t7cC.WindowY0 - 10; | |
656 | 4007 if(pSettings->FlipDisplay) |
315
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
4008 { |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
4009 t7cY0free.WindowY1 = 400; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
4010 } |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
4011 |
38 | 4012 t7cY0free.WindowLineSpacing = 48; |
4013 t7cY0free.WindowNumberOfTextLines = 6; | |
4014 t7cY0free.WindowTab = 420; | |
4015 | |
4016 // header | |
4017 textpointer = 0; | |
4018 text[textpointer++] = '\032'; | |
4019 text[textpointer++] = '\016'; | |
4020 text[textpointer++] = '\016'; | |
4021 text[textpointer++] = TXT_ppO2; | |
4022 text[textpointer++] = '\n'; | |
4023 text[textpointer++] = '\r'; | |
4024 text[textpointer++] = TXT_Ceiling; | |
4025 text[textpointer++] = '\n'; | |
4026 text[textpointer++] = '\r'; | |
4027 text[textpointer++] = TXT_ActualGradient; | |
4028 text[textpointer++] = '\n'; | |
4029 text[textpointer++] = '\r'; | |
4030 text[textpointer++] = TXT_CNS; | |
4031 text[textpointer++] = '\n'; | |
4032 text[textpointer++] = '\r'; | |
4033 text[textpointer++] = TXT_FutureTTS; | |
656 | 4034 text[textpointer++] = '\n'; |
4035 text[textpointer++] = '\r'; | |
662 | 4036 if((pSettings->scrubTimerMode != SCRUB_TIMER_OFF) && (isLoopMode(pSettings->dive_mode))) |
656 | 4037 { |
4038 text[textpointer++] = TXT_ScrubTime; | |
4039 | |
4040 } | |
38 | 4041 text[textpointer++] = '\017'; |
656 | 4042 text[textpointer++] = 0; |
4043 if(!pSettings->FlipDisplay) | |
315
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
4044 { |
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 GFX_write_string(&FontT24, &t7cY0free, text, 1); |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
4048 t7cY0free.WindowX0 -= 10; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
4049 t7cY0free.WindowY0 -= 10; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
4050 } |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
4051 else |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
4052 { |
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 GFX_write_string(&FontT24, &t7cY0free, text, 1); |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
4056 t7cY0free.WindowY1 += 10; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
4057 t7cY0free.WindowX1 += 10; |
7420ed6c3508
Bugfix Overview, O2 values and mV in flip display mode
ideenmodellierer
parents:
247
diff
changeset
|
4058 } |
38 | 4059 textpointer = 0; |
4060 text[textpointer++] = '\t'; | |
4061 textpointer += snprintf(&text[textpointer],10,"\020%01.2f", stateUsed->lifeData.ppO2); | |
4062 text[textpointer++] = '\n'; | |
4063 text[textpointer++] = '\r'; | |
4064 text[textpointer++] = '\t'; | |
4065 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
|
4066 textpointer += snprintf(&text[textpointer],10,"\020%01.0f",unit_depth_float(pDecoinfoStandard->output_ceiling_meter)); |
38 | 4067 else |
215
4a0ebade04f5
Bugfix, trivial: correctly present avg depth in overview custom
Jan Mulder <jlmulder@xs4all.nl>
parents:
214
diff
changeset
|
4068 textpointer += snprintf(&text[textpointer],10,"\020%01.1f",pDecoinfoStandard->output_ceiling_meter); |
38 | 4069 text[textpointer++] = '\n'; |
4070 text[textpointer++] = '\r'; | |
4071 text[textpointer++] = '\t'; | |
247
3949781096d4
feature: Relative GF to Saturation renames
Jan Mulder <jlmulder@xs4all.nl>
parents:
225
diff
changeset
|
4072 textpointer += snprintf(&text[textpointer],10,"\020%.0f\016\016%%\017", 100 * pDecoinfoStandard->super_saturation); |
38 | 4073 text[textpointer++] = '\n'; |
4074 text[textpointer++] = '\r'; | |
4075 text[textpointer++] = '\t'; | |
4076 textpointer += snprintf(&text[textpointer],10,"\020%.0f\016\016%%\017",fCNS); | |
4077 text[textpointer++] = '\n'; | |
4078 text[textpointer++] = '\r'; | |
4079 text[textpointer++] = '\t'; | |
214
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
211
diff
changeset
|
4080 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
|
4081 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
|
4082 else |
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
211
diff
changeset
|
4083 textpointer += snprintf(&text[textpointer],10,"\020%ih", (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 3600); |
656 | 4084 |
662 | 4085 if((pSettings->scrubTimerMode != SCRUB_TIMER_OFF) && (isLoopMode(pSettings->dive_mode))) |
656 | 4086 { |
4087 text[textpointer++] = '\n'; | |
4088 text[textpointer++] = '\r'; | |
4089 text[textpointer++] = '\t'; | |
758
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
756
diff
changeset
|
4090 |
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
756
diff
changeset
|
4091 textpointer += printScrubberText(&text[textpointer], 10, pSettings); |
656 | 4092 } |
38 | 4093 text[textpointer++] = 0; |
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
859
diff
changeset
|
4094 Gfx_colorsscheme_mod(text, 0); |
38 | 4095 GFX_write_string(&FontT42, &t7cY0free, text, 1); |
4096 } | |
4097 | |
4098 void t7_compass(uint16_t ActualHeading, uint16_t UserSetHeading) | |
4099 { | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4100 uint16_t ActualHeadingRose; |
38 | 4101 uint16_t LeftBorderHeading, LineHeading; |
4102 uint32_t offsetPicture; | |
4103 point_t start, stop, center; | |
4104 static int32_t LastHeading = 0; | |
4105 int32_t newHeading = 0; | |
4106 int32_t diff = 0; | |
4107 int32_t diff2 = 0; | |
4108 | |
4109 int32_t diffAbs = 0; | |
4110 int32_t diffAbs2 = 0; | |
4111 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4112 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4113 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4114 |
38 | 4115 newHeading = ActualHeading; |
4116 | |
4117 diff = newHeading - LastHeading; | |
4118 | |
4119 if(newHeading < LastHeading) | |
4120 diff2 = newHeading + 360 - LastHeading; | |
4121 else | |
4122 diff2 = newHeading - 360 - LastHeading; | |
4123 | |
4124 diffAbs = diff; | |
4125 if(diffAbs < 0) | |
4126 diffAbs *= -1; | |
4127 | |
4128 diffAbs2 = diff2; | |
4129 if(diffAbs2 < 0) | |
4130 diffAbs2 *= -1; | |
4131 | |
4132 | |
4133 if(diffAbs <= diffAbs2) | |
4134 newHeading = LastHeading + (diff / 2); | |
4135 else | |
4136 newHeading = LastHeading + (diff2 / 2); | |
4137 | |
4138 if(newHeading < 0) | |
4139 newHeading += 360; | |
4140 else | |
4141 if(newHeading >= 360) | |
4142 newHeading -= 360; | |
4143 | |
4144 LastHeading = newHeading; | |
4145 ActualHeading = newHeading; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4146 ActualHeadingRose = ActualHeading; |
225
2bb1db22b5f5
cleanup: random set of cleanups
Jan Mulder <jlmulder@xs4all.nl>
parents:
222
diff
changeset
|
4147 |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4148 if(pSettings->FlipDisplay) |
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 ActualHeadingRose = 360 - ActualHeadingRose; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4151 if (ActualHeadingRose < 170) ActualHeadingRose += 360; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4152 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4153 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4154 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4155 if (ActualHeadingRose < 90) ActualHeadingRose += 360; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4156 ActualHeading = ActualHeadingRose; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4157 } |
38 | 4158 |
4159 // new hw 160822 | |
4160 // if (ActualHeading >= 360 + 90) | |
4161 // ActualHeading = 360; | |
4162 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4163 LeftBorderHeading = 2 * (ActualHeadingRose - (CUSTOMBOX_SPACE_INSIDE/4)); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4164 |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4165 if(pSettings->FlipDisplay) /* add offset caused by mirrowed drawing */ |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4166 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4167 LeftBorderHeading += 2 * 80; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4168 } |
38 | 4169 |
4170 offsetPicture = LeftBorderHeading * t7screenCompass.ImageHeight * 2; | |
4171 | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4172 /* the background is used to draw the rotating compass rose */ |
38 | 4173 background.pointer = t7screenCompass.FBStartAdress+offsetPicture; |
4174 background.x0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4175 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4176 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4177 background.y0 = 65; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4178 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4179 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4180 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4181 background.y0 = 480 - t7screenCompass.ImageHeight - 65; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4182 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4183 |
38 | 4184 background.width = CUSTOMBOX_SPACE_INSIDE; |
4185 background.height = t7screenCompass.ImageHeight; | |
4186 | |
4187 | |
4188 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + (CUSTOMBOX_SPACE_INSIDE/2); | |
4189 stop.x = start.x; | |
4190 start.y = 65; | |
4191 stop.y = start.y + 55; | |
4192 GFX_draw_line(&t7screen, start, stop, CLUT_Font030); | |
4193 | |
4194 | |
4195 center.x = start.x; | |
4196 center.y = 300; | |
4197 | |
4198 stop.x = center.x + 44; | |
4199 stop.y = center.y + 24; | |
4200 | |
4201 | |
4202 while(ActualHeading > 359) ActualHeading -= 360; | |
4203 | |
4204 LineHeading = 360 - ActualHeading; | |
4205 GFX_draw_thick_line(9,&t7screen, t7_compass_circle(0,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font030); // North | |
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); // Maintick | |
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 LineHeading += 90; | |
4213 if(LineHeading > 359) LineHeading -= 360; | |
4214 GFX_draw_thick_line(9,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
4215 | |
4216 LineHeading = 360 - ActualHeading; | |
4217 LineHeading += 45; | |
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); // Subtick | |
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 LineHeading += 90; | |
4227 if(LineHeading > 359) LineHeading -= 360; | |
4228 GFX_draw_thick_line(5,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
4229 | |
4230 LineHeading = 360 - ActualHeading; | |
4231 LineHeading += 22; | |
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); // Subtick | |
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); | |
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); // Subtick | |
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 LineHeading += 45; | |
4253 if(LineHeading > 359) LineHeading -= 360; | |
4254 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
4255 | |
4256 if(UserSetHeading) | |
4257 { | |
4258 LineHeading = UserSetHeading + 360 - ActualHeading; | |
4259 if(LineHeading > 359) LineHeading -= 360; | |
4260 GFX_draw_thick_line(9,&t7screen, t7_compass_circle(3,LineHeading), t7_compass_circle(2,LineHeading), CLUT_CompassUserHeadingTick); | |
4261 | |
4262 // R�ckpeilung, User Back Heading | |
4263 LineHeading = UserSetHeading + 360 + 180 - ActualHeading; | |
4264 if(LineHeading > 359) LineHeading -= 360; | |
4265 if(LineHeading > 359) LineHeading -= 360; | |
4266 GFX_draw_thick_line(9,&t7screen, t7_compass_circle(3,LineHeading), t7_compass_circle(2,LineHeading), CLUT_CompassUserBackHeadingTick); | |
4267 } | |
4268 | |
4269 center.x = start.x; | |
4270 center.y = 250; | |
4271 GFX_draw_circle(&t7screen, center, 116, CLUT_Font030); | |
4272 GFX_draw_circle(&t7screen, center, 118, CLUT_Font030); | |
4273 GFX_draw_circle(&t7screen, center, 117, CLUT_Font030); | |
4274 | |
4275 | |
4276 } | |
4277 | |
4278 | |
4279 /* Font_T42: N is 27 px, S is 20 px, W is 36 px, E is 23 px | |
4280 * max is NW with 63 px | |
4281 * Font_T24: N is 15 px, S is 12 px, W is 20 px, E is 13 px | |
4282 * max is NW with 35 px | |
4283 * NE is 28 px | |
4284 * SW is 32 px | |
4285 * SE is 25 px | |
4286 * space between each is 45 px * 2 | |
4287 * FirstItem List | |
4288 * \177 \177 prepare for size | |
4289 */ | |
4290 void init_t7_compass(void) | |
4291 { | |
4292 t7screenCompass.FBStartAdress = getFrame(21); | |
4293 | |
4294 char text[256]; | |
4295 uint8_t textpointer = 0; | |
4296 | |
4297 text[textpointer++] = '\030'; | |
4298 text[textpointer++] = '\177'; | |
4299 text[textpointer++] = '\177'; | |
4300 text[textpointer++] = 76; // 90 - 14 | |
4301 text[textpointer++] = '\016'; | |
4302 text[textpointer++] = '\016'; | |
4303 text[textpointer++] = 'N'; | |
4304 text[textpointer++] = 'E'; // 96 + 28 = 124 total | |
4305 text[textpointer++] = '\017'; | |
4306 text[textpointer++] = '\177'; | |
4307 text[textpointer++] = '\177'; | |
4308 text[textpointer++] = 64; // 90 - 14 - 12 | |
4309 text[textpointer++] = 'E'; // 124 + 74 + 23 = 221 total | |
4310 text[textpointer++] = '\177'; | |
4311 text[textpointer++] = '\177'; | |
4312 text[textpointer++] = 66; // 90 - 11 - 13 | |
4313 text[textpointer++] = '\016'; | |
4314 text[textpointer++] = '\016'; | |
4315 text[textpointer++] = 'S'; | |
4316 text[textpointer++] = 'E'; | |
4317 text[textpointer++] = '\017'; | |
4318 text[textpointer++] = '\177'; | |
4319 text[textpointer++] = '\177'; | |
4320 text[textpointer++] = 68; // 90 - 12 - 10 | |
4321 text[textpointer++] = 'S'; | |
4322 text[textpointer++] = '\177'; | |
4323 text[textpointer++] = '\177'; | |
4324 text[textpointer++] = 64; // 90 - 10 - 16 | |
4325 text[textpointer++] = '\016'; | |
4326 text[textpointer++] = '\016'; | |
4327 text[textpointer++] = 'S'; | |
4328 text[textpointer++] = 'W'; | |
4329 text[textpointer++] = '\017'; | |
4330 text[textpointer++] = '\177'; | |
4331 text[textpointer++] = '\177'; | |
4332 text[textpointer++] = 56; // 90 - 16 - 18 | |
4333 text[textpointer++] = 'W'; | |
4334 text[textpointer++] = '\177'; | |
4335 text[textpointer++] = '\177'; | |
4336 text[textpointer++] = 54; // 90 - 18 - 18 | |
4337 text[textpointer++] = '\016'; | |
4338 text[textpointer++] = '\016'; | |
4339 text[textpointer++] = 'N'; | |
4340 text[textpointer++] = 'W'; | |
4341 text[textpointer++] = '\017'; | |
4342 text[textpointer++] = '\177'; | |
4343 text[textpointer++] = '\177'; | |
4344 text[textpointer++] = 59; // 90 - 17 - 14 | |
4345 text[textpointer++] = 'N'; | |
4346 text[textpointer++] = '\177'; | |
4347 text[textpointer++] = '\177'; | |
4348 text[textpointer++] = 63; // 90 - 13 - 14 | |
4349 text[textpointer++] = '\016'; | |
4350 text[textpointer++] = '\016'; | |
4351 text[textpointer++] = 'N'; | |
4352 text[textpointer++] = 'E'; | |
4353 text[textpointer++] = '\017'; | |
4354 text[textpointer++] = '\177'; | |
4355 text[textpointer++] = '\177'; | |
4356 text[textpointer++] = 64; // 90 - 14 - 12 | |
4357 text[textpointer++] = 'E'; | |
4358 text[textpointer++] = '\177'; | |
4359 text[textpointer++] = '\177'; | |
4360 text[textpointer++] = 66; // 90 - 11 - 13 | |
4361 text[textpointer++] = '\016'; | |
4362 text[textpointer++] = '\016'; | |
4363 text[textpointer++] = 'S'; | |
4364 text[textpointer++] = 'E'; | |
4365 text[textpointer++] = '\017'; | |
4366 text[textpointer++] = '\177'; | |
4367 text[textpointer++] = '\177'; | |
4368 text[textpointer++] = 68; // 90 - 12 - 10 | |
4369 text[textpointer++] = 'S'; | |
4370 text[textpointer++] = '\177'; | |
4371 text[textpointer++] = '\177'; | |
4372 text[textpointer++] = 64; // 90 - 10 - 16 | |
4373 text[textpointer++] = '\016'; | |
4374 text[textpointer++] = '\016'; | |
4375 text[textpointer++] = 'S'; | |
4376 text[textpointer++] = 'W'; | |
4377 text[textpointer++] = '\017'; | |
4378 text[textpointer++] = 0; // end | |
4379 | |
4380 GFX_write_string(&FontT42,&t7pCompass,text,1); | |
4381 | |
4382 releaseAllFramesExcept(21,t7screenCompass.FBStartAdress); | |
4383 } | |
4384 | |
4385 | |
4386 void t7_miniLiveLogProfile(void) | |
4387 { | |
4388 SWindowGimpStyle wintemp; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4389 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4390 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4391 |
38 | 4392 wintemp.left = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
4393 wintemp.right = wintemp.left + CUSTOMBOX_SPACE_INSIDE; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4394 if(!pSettings->FlipDisplay) |
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 wintemp.top = 480 - t7l1.WindowY0; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4397 wintemp.bottom = wintemp. top + 200; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4398 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4399 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4400 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4401 wintemp.top = t7l1.WindowY1; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4402 wintemp.bottom = wintemp. top + 200; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4403 } |
38 | 4404 |
4405 uint16_t max_depth = (uint16_t)(stateUsed->lifeData.max_depth_meter * 10); | |
4406 | |
4407 GFX_graph_print(&t7screen, &wintemp, 0,1,0, max_depth, getMiniLiveLogbookPointerToData(), getMiniLiveLogbookActualDataLength(), CLUT_Font030, NULL); | |
4408 } | |
4409 | |
4410 void t7_logo_OSTC(void) | |
4411 { | |
4412 SWindowGimpStyle windowGimp; | |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4413 SSettings* pSettings; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4414 pSettings = settingsGetPointer(); |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4415 |
38 | 4416 /* OSTC logo */ |
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4417 if(!pSettings->FlipDisplay) |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4418 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4419 windowGimp.left = t7l1.WindowX1 + 32; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4420 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4421 else |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4422 { |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4423 windowGimp.left = t7r1.WindowX1 + 32; |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4424 } |
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4425 |
38 | 4426 windowGimp.top = 40 + 32; |
4427 GFX_draw_image_monochrome(&t7screen, windowGimp, &ImgOSTC, 0); | |
4428 } | |
672 | 4429 |
4430 static uint16_t ChargerLog[60] = {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 10,10,10,10,10,10,10,10,10,10, | |
4434 10,10,10,10,10,10,10,10,10,10, | |
4435 10,10,10,10,10,10,10,10,10,10}; | |
4436 | |
4437 uint16_t LogDeltaCharge(float charge) | |
4438 { | |
4439 static uint8_t curIndex = 0; | |
4440 static float averageSpeed = 0.0; | |
4441 uint16_t level = 0; | |
4442 uint16_t completeSec = 0; | |
4443 | |
4444 if(charge > 0.003) | |
4445 { | |
4446 level = 2; | |
4447 } | |
4448 else if(charge > 0.0025) | |
4449 { | |
4450 level = 3; | |
4451 } | |
4452 else if(charge > 0.002) | |
4453 { | |
4454 level = 4; | |
4455 } | |
4456 else if(charge > 0.0015) | |
4457 { | |
4458 level = 5; | |
4459 } | |
4460 else if(charge > 0.001) | |
4461 { | |
4462 level = 6; | |
4463 } | |
4464 else if(charge > 0.0005) | |
4465 { | |
4466 level = 7; | |
4467 } | |
4468 else if(charge > 0.00) | |
4469 { | |
4470 level = 8; | |
4471 } | |
4472 else | |
4473 { | |
4474 level = 10; | |
4475 } | |
859 | 4476 if(curIndex > 1) |
4477 { | |
4478 level = (level + ChargerLog[curIndex - 1]) / 2; /* smooth small jumps */ | |
4479 } | |
672 | 4480 if(curIndex < 59) |
4481 { | |
4482 ChargerLog[curIndex++] = level; | |
4483 } | |
4484 else | |
4485 { | |
4486 memcpy (&ChargerLog[0],&ChargerLog[1],sizeof(ChargerLog) - 1); | |
4487 ChargerLog[curIndex] = level; | |
4488 } | |
859 | 4489 if(curIndex > 1) /* estimate time til charging is complete */ |
672 | 4490 { |
4491 averageSpeed = ((averageSpeed * (curIndex-1)) + charge) / curIndex; | |
4492 completeSec = (100.0 - stateUsed->lifeData.battery_charge) / averageSpeed; | |
4493 } | |
4494 else | |
4495 { | |
4496 completeSec = 0xffff; | |
4497 } | |
4498 return completeSec; | |
4499 } | |
4500 | |
4501 uint16_t* getChargeLog() | |
4502 { | |
4503 return ChargerLog; | |
4504 } | |
4505 | |
4506 void t7_ChargerView(void) | |
4507 { | |
4508 static float lastCharge = 0.0; | |
4509 float localCharge = 0.0; | |
4510 static uint32_t lastTick = 0; | |
4511 uint32_t curTick = 0; | |
4512 static float speed = 0.0; | |
4513 float deltatime = 0.0; | |
4514 | |
4515 char text[256+50]; | |
4516 uint8_t textpointer = 0; | |
4517 static uint16_t remainingSec = 0; | |
4518 uint16_t hoursto100 = 0; | |
4519 char indicator = '~'; | |
4520 | |
4521 point_t start, stop; | |
4522 | |
675
3c4a3d78ff2b
Bugfix: Missing flip screen support for charge view
Ideenmodellierer
parents:
672
diff
changeset
|
4523 SWindowGimpStyle wintemp; |
3c4a3d78ff2b
Bugfix: Missing flip screen support for charge view
Ideenmodellierer
parents:
672
diff
changeset
|
4524 SSettings* pSettings; |
3c4a3d78ff2b
Bugfix: Missing flip screen support for charge view
Ideenmodellierer
parents:
672
diff
changeset
|
4525 pSettings = settingsGetPointer(); |
3c4a3d78ff2b
Bugfix: Missing flip screen support for charge view
Ideenmodellierer
parents:
672
diff
changeset
|
4526 |
672 | 4527 t7cY0free.WindowLineSpacing = 28 + 48 + 14; |
4528 t7cY0free.WindowY0 = t7cH.WindowY0 - 5 - 2 * t7cY0free.WindowLineSpacing; | |
4529 t7cY0free.WindowNumberOfTextLines = 3; | |
4530 | |
675
3c4a3d78ff2b
Bugfix: Missing flip screen support for charge view
Ideenmodellierer
parents:
672
diff
changeset
|
4531 |
3c4a3d78ff2b
Bugfix: Missing flip screen support for charge view
Ideenmodellierer
parents:
672
diff
changeset
|
4532 if(pSettings->FlipDisplay) |
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 t7cY0free.WindowY0 = t7cH.WindowY0 + 15; |
3c4a3d78ff2b
Bugfix: Missing flip screen support for charge view
Ideenmodellierer
parents:
672
diff
changeset
|
4535 t7cY0free.WindowY1 = t7cY0free.WindowY0 + 250; |
3c4a3d78ff2b
Bugfix: Missing flip screen support for charge view
Ideenmodellierer
parents:
672
diff
changeset
|
4536 } |
3c4a3d78ff2b
Bugfix: Missing flip screen support for charge view
Ideenmodellierer
parents:
672
diff
changeset
|
4537 |
672 | 4538 localCharge = stateUsed->lifeData.battery_charge; |
4539 if(localCharge < 0.0) | |
4540 { | |
4541 localCharge *= -1.0; | |
4542 } | |
4543 | |
4544 if(stateUsed->chargeStatus != CHARGER_off) | |
4545 { | |
859 | 4546 curTick = HAL_GetTick(); |
4547 deltatime = (curTick - lastTick); | |
4548 | |
4549 if((deltatime > 3000) || (lastCharge != localCharge)) /* Charge value update is expected every 2 second. */ | |
4550 { /* Added timeout to keep graph moving in case charger is temporary idle */ | |
4551 if(lastCharge != localCharge) | |
672 | 4552 { |
859 | 4553 if(lastCharge < localCharge) |
4554 { | |
4555 speed = (localCharge - lastCharge) * 1000.0 / deltatime; | |
4556 } | |
4557 | |
4558 if(localCharge > 100.0) | |
4559 { | |
4560 localCharge = 100.0; | |
4561 } | |
4562 lastCharge = localCharge; | |
672 | 4563 } |
4564 deltatime = 0; | |
4565 remainingSec = LogDeltaCharge(speed); | |
4566 speed = 0; | |
859 | 4567 lastTick = curTick; |
672 | 4568 } |
4569 } | |
4570 textpointer += snprintf(&text[textpointer],50,"\n\r"); | |
4571 textpointer += snprintf(&text[textpointer],50,"\001%c\n\r",TXT_ChargeHour); | |
4572 | |
4573 GFX_write_string(&FontT24, &t7cY0free, text, 1); | |
4574 | |
4575 hoursto100 = remainingSec / 3600; /* reduce to hours */ | |
4576 if(hoursto100 < 1) | |
4577 { | |
4578 indicator = '<'; | |
4579 hoursto100 = 1; | |
4580 } | |
675
3c4a3d78ff2b
Bugfix: Missing flip screen support for charge view
Ideenmodellierer
parents:
672
diff
changeset
|
4581 |
3c4a3d78ff2b
Bugfix: Missing flip screen support for charge view
Ideenmodellierer
parents:
672
diff
changeset
|
4582 if(!pSettings->FlipDisplay) |
3c4a3d78ff2b
Bugfix: Missing flip screen support for charge view
Ideenmodellierer
parents:
672
diff
changeset
|
4583 { |
3c4a3d78ff2b
Bugfix: Missing flip screen support for charge view
Ideenmodellierer
parents:
672
diff
changeset
|
4584 t7cY0free.WindowY0 -= 52; |
3c4a3d78ff2b
Bugfix: Missing flip screen support for charge view
Ideenmodellierer
parents:
672
diff
changeset
|
4585 } |
3c4a3d78ff2b
Bugfix: Missing flip screen support for charge view
Ideenmodellierer
parents:
672
diff
changeset
|
4586 else |
3c4a3d78ff2b
Bugfix: Missing flip screen support for charge view
Ideenmodellierer
parents:
672
diff
changeset
|
4587 { |
3c4a3d78ff2b
Bugfix: Missing flip screen support for charge view
Ideenmodellierer
parents:
672
diff
changeset
|
4588 t7cY0free.WindowY1 += 52; |
3c4a3d78ff2b
Bugfix: Missing flip screen support for charge view
Ideenmodellierer
parents:
672
diff
changeset
|
4589 } |
672 | 4590 |
4591 if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->chargeStatus != CHARGER_off)) | |
4592 { | |
4593 snprintf(text,60, | |
693 | 4594 "\001%0.2f\016\016%%\017\n\r" |
672 | 4595 "\001%c%d\n\r" |
4596 ,stateUsed->lifeData.battery_charge | |
4597 ,indicator | |
4598 ,hoursto100); | |
4599 } | |
4600 else | |
4601 { | |
4602 snprintf(text,60, | |
4603 "\001---\n\r" | |
4604 "\001---\n\r"); | |
4605 } | |
4606 GFX_write_string(&FontT42, &t7cY0free, text, 1); | |
4607 | |
4608 wintemp.left = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + 50; | |
4609 wintemp.right = wintemp.left + CUSTOMBOX_SPACE_INSIDE - 100; | |
4610 | |
4611 | |
4612 if(!pSettings->FlipDisplay) | |
4613 { | |
4614 wintemp.top = 480 - t7l1.WindowY0 + 115; | |
4615 wintemp.bottom = wintemp.top + 100; | |
4616 } | |
4617 else | |
4618 { | |
675
3c4a3d78ff2b
Bugfix: Missing flip screen support for charge view
Ideenmodellierer
parents:
672
diff
changeset
|
4619 wintemp.top = t7l1.WindowY1 + 102; |
3c4a3d78ff2b
Bugfix: Missing flip screen support for charge view
Ideenmodellierer
parents:
672
diff
changeset
|
4620 wintemp.bottom = wintemp.top + 100; |
672 | 4621 } |
4622 | |
4623 start.x = wintemp.left-5; | |
4624 start.y = 90; | |
4625 | |
4626 stop.x = wintemp.right + 5 - start.x; | |
4627 stop.y = 100; | |
4628 GFX_draw_box(&t7screen, start, stop,1, CLUT_Font020); | |
4629 | |
4630 if(stateUsed->chargeStatus != CHARGER_off) | |
4631 { | |
4632 GFX_graph_print(&t7screen, &wintemp, 1,1,0, 10, getChargeLog(), 60, CLUT_Font030, NULL); | |
4633 } | |
4634 else | |
4635 { | |
4636 GFX_graph_print(&t7screen, &wintemp, 1,1,0, 10, getChargeLog(), 60, CLUT_Font031, NULL); | |
4637 } | |
4638 | |
4639 } | |
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
|
4640 |
805
dd7ce655db26
Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents:
799
diff
changeset
|
4641 |
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
|
4642 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
|
4643 { |
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
|
4644 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
|
4645 } |
805
dd7ce655db26
Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents:
799
diff
changeset
|
4646 |
882 | 4647 void t7_drawAcentGraph(uint8_t color) |
4648 { | |
4649 point_t start, stop; | |
4650 | |
4651 SSettings* pSettings; | |
4652 pSettings = settingsGetPointer(); | |
4653 | |
4654 | |
4655 if(!pSettings->FlipDisplay) | |
4656 { | |
4657 start.y = t7l1.WindowY0 - 1; | |
4658 } | |
4659 else | |
4660 { | |
4661 start.y = t7l3.WindowY0 - 25; | |
4662 } | |
4663 | |
4664 for(int i = 0; i<4;i++) | |
4665 { | |
4666 start.y += 5*6; | |
4667 stop.y = start.y; | |
4668 start.x = CUSTOMBOX_LINE_LEFT - 1; | |
4669 stop.x = start.x - 17; | |
4670 GFX_draw_line(&t7screen, start, stop, 0); | |
4671 // start.x = CUSTOMBOX_LINE_RIGHT + 2; old right too | |
4672 // stop.x = start.x + 17; | |
4673 // GFX_draw_line(&t7screen, start, stop, 0); | |
4674 } | |
4675 // new thick bar design Sept. 2015 | |
4676 start.x = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET - 3 - 5; | |
4677 stop.x = start.x; | |
4678 if(!pSettings->FlipDisplay) | |
4679 { | |
4680 start.y = t7l1.WindowY0 - 1; | |
4681 } | |
4682 else | |
4683 { | |
4684 start.y = t7l3.WindowY0 - 25; | |
4685 } | |
4686 stop.y = start.y + (uint16_t)(stateUsed->lifeData.ascent_rate_meter_per_min * 6); | |
4687 stop.y -= 3; // wegen der Liniendicke von 12 anstelle von 9 | |
4688 if(stop.y >= 470) | |
4689 stop.y = 470; | |
4690 start.y += 7; // starte etwas weiter oben | |
4691 if(color == 0) | |
4692 { | |
4693 color = CLUT_EverythingOkayGreen; /* do not use white color for drawing graph */ | |
4694 } | |
4695 | |
4696 GFX_draw_thick_line(12,&t7screen, start, stop, color); | |
4697 } | |
4698 | |
4699 #define ASCENT_GRAPH_YPIXEL 120 | |
4700 | |
4701 uint8_t t7_drawSlowExitGraph() | |
4702 { | |
4703 static SSlowExitState slowExitState = SE_END; | |
4704 static uint16_t countDownSec = 0; | |
4705 static uint8_t drawingMeterStep; | |
4706 static float exitDepthMeter = 0.0; | |
4707 static uint32_t exitSecTick = 0; | |
4708 | |
4709 uint8_t index = 0; | |
4710 static uint8_t color = 0; | |
4711 point_t start, stop; | |
4712 | |
4713 SSettings* pSettings; | |
4714 pSettings = settingsGetPointer(); | |
4715 | |
4716 if(stateUsed->lifeData.max_depth_meter < pSettings->last_stop_depth_meter) /* start of dive => reinit timer */ | |
4717 { | |
4718 if(slowExitState != SE_INIT) | |
4719 { | |
4720 //stepPerSecond = pSettings->last_stop_depth_meter / pSettings->slowExitTime; | |
4721 countDownSec = pSettings->slowExitTime * 60; | |
4722 drawingMeterStep = ASCENT_GRAPH_YPIXEL / pSettings->last_stop_depth_meter; /* based on 120 / 4 = 30 of standard ascent graph */ | |
4723 slowExitState = SE_INIT; | |
4724 exitDepthMeter = pSettings->last_stop_depth_meter; | |
4725 color = 0; | |
4726 } | |
4727 } | |
4728 else | |
4729 { | |
4730 if(slowExitState != SE_END) | |
4731 { | |
4732 if(slowExitState == SE_INIT) | |
4733 { | |
4734 slowExitState = SE_ACTIVE; | |
4735 exitSecTick = HAL_GetTick(); | |
4736 } | |
4737 if(time_elapsed_ms(exitSecTick, HAL_GetTick()) > 1000) | |
4738 { | |
4739 exitSecTick = HAL_GetTick(); | |
4740 | |
4741 /* select depth digit color */ | |
4742 if(fabsf(stateUsed->lifeData.depth_meter - exitDepthMeter) < 0.5 ) | |
4743 { | |
4744 color = CLUT_NiceGreen; | |
4745 } | |
4746 else if(fabsf(stateUsed->lifeData.depth_meter - exitDepthMeter) <= 1.5) | |
4747 { | |
4748 color = CLUT_WarningYellow; | |
4749 } | |
4750 else if(stateUsed->lifeData.depth_meter - exitDepthMeter < -1.5 ) | |
4751 { | |
4752 color = CLUT_WarningRed; | |
4753 } | |
4754 else | |
4755 { | |
4756 color = 0; | |
4757 } | |
4758 | |
4759 if((fabsf(stateUsed->lifeData.depth_meter - exitDepthMeter) <= 1.6 ) /* only decrease counter if diver is close to target depth */ | |
4760 || (color == CLUT_WarningRed)) /* or if diver is far ahead */ | |
4761 { | |
4762 countDownSec--; | |
4763 if(countDownSec == 0) | |
4764 { | |
4765 slowExitState = SE_END; | |
4766 color = 0; | |
4767 } | |
4768 exitDepthMeter -= (pSettings->last_stop_depth_meter / (float)(pSettings->slowExitTime * 60)); | |
4769 } | |
4770 } | |
4771 if(!pSettings->FlipDisplay) | |
4772 { | |
4773 start.y = t7l1.WindowY0 - 1; | |
4774 } | |
4775 else | |
4776 { | |
4777 start.y = t7l3.WindowY0 - 25; | |
4778 } | |
4779 | |
4780 for(index = 0; index < pSettings->last_stop_depth_meter; index++) /* draw meter indicators */ | |
4781 { | |
4782 start.y += drawingMeterStep; | |
4783 stop.y = start.y; | |
4784 start.x = CUSTOMBOX_LINE_LEFT - 1; | |
4785 stop.x = start.x - 40; | |
4786 GFX_draw_line(&t7screen, start, stop, 0); | |
4787 } | |
4788 | |
4789 start.x = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET - 20; | |
4790 stop.x = start.x; | |
4791 if(!pSettings->FlipDisplay) | |
4792 { | |
4793 start.y = t7l1.WindowY0 + ASCENT_GRAPH_YPIXEL; | |
4794 } | |
4795 else | |
4796 { | |
4797 start.y = t7l3.WindowY0 - 25; | |
4798 } | |
4799 stop.y = start.y - countDownSec * (ASCENT_GRAPH_YPIXEL / (float)(pSettings->slowExitTime * 60.0)); | |
4800 if(stop.y >= 470) | |
4801 stop.y = 470; | |
4802 | |
4803 GFX_draw_thick_line(15,&t7screen, start, stop, 3); | |
4804 /* mark diver depth */ | |
4805 start.x = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET - 25; | |
4806 stop.x = start.x + 15; | |
4807 | |
4808 start.y = start.y - (stateUsed->lifeData.depth_meter *120 / pSettings->last_stop_depth_meter); | |
4809 stop.y = start.y; | |
4810 GFX_draw_thick_line(10,&t7screen, start, stop, 9); | |
4811 //GFX_draw_line(&t7screen, start, stop, 2); | |
4812 } | |
4813 } | |
4814 return color; | |
4815 } | |
805
dd7ce655db26
Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents:
799
diff
changeset
|
4816 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
|
4817 { |
dd7ce655db26
Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents:
799
diff
changeset
|
4818 SSettings *settings = settingsGetPointer(); |
dd7ce655db26
Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents:
799
diff
changeset
|
4819 |
dd7ce655db26
Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents:
799
diff
changeset
|
4820 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
|
4821 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
|
4822 } |