Mercurial > public > ostc4
annotate Discovery/Src/t3.c @ 1028:3d9552e4997c GasConsumption
Code improvment: line <=> menu id function:
In generell the structure of the menus is defined by the tStructure.h using global state defines. In some implementation hardcoded line numbers are used. Risk: In case the order of menu items change the update of other code sections could be forgotten (in the case the update of the top menu) causing unintended behavior. To avoid this the hard coded lines have been replaced by a function connecting the intended function to the menu item defined in the tstructure.h.
| author | Ideenmodellierer |
|---|---|
| date | Sun, 07 Sep 2025 19:08:43 +0200 |
| parents | 6e11f7327efd |
| children |
| rev | line source |
|---|---|
| 38 | 1 /////////////////////////////////////////////////////////////////////////////// |
| 2 /// -*- coding: UTF-8 -*- | |
| 3 /// | |
| 4 /// \file Discovery/Src/t3.c | |
| 5 /// \brief Main Template file for dive mode special scree t3 | |
| 6 /// \author Heinrichs Weikamp gmbh | |
| 7 /// \date 10-Nov-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 ------------------------------------------------------------------*/ | |
|
758
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
755
diff
changeset
|
30 #include <stdbool.h> |
| 841 | 31 #include <stdlib.h> |
|
758
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
755
diff
changeset
|
32 |
| 38 | 33 #include "t3.h" |
| 34 | |
| 35 #include "data_exchange_main.h" | |
|
1014
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
36 #include "settings.h" |
| 38 | 37 #include "decom.h" |
| 38 #include "gfx_fonts.h" | |
| 39 #include "math.h" | |
| 40 #include "tHome.h" | |
| 41 #include "timer.h" | |
| 42 #include "unit.h" | |
| 553 | 43 #include "motion.h" |
|
592
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
44 #include "logbook_miniLive.h" |
| 835 | 45 #include "tMenuEditCustom.h" |
|
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
857
diff
changeset
|
46 #include "gfx_engine.h" |
|
592
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
47 |
|
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
48 |
| 599 | 49 #define CV_PROFILE_WIDTH (600U) |
|
592
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
50 |
|
237
ec16fd26e280
Bugfix: do not show NDL in bigscreen mode when zero
Jan Mulder <jlmulder@xs4all.nl>
parents:
214
diff
changeset
|
51 //* Imported function prototypes ---------------------------------------------*/ |
| 38 | 52 extern uint8_t write_gas(char *text, uint8_t oxygen, uint8_t helium); |
| 53 | |
| 54 /* Exported variables --------------------------------------------------------*/ | |
| 55 | |
| 56 const uint16_t BigFontSeperationLeftRight = 399; | |
| 57 const uint16_t BigFontSeperationTopBottom = 240; | |
| 58 | |
| 59 /* Private variables ---------------------------------------------------------*/ | |
| 60 GFX_DrawCfgScreen t3screen; | |
| 61 GFX_DrawCfgWindow t3l1; | |
| 62 GFX_DrawCfgWindow t3r1; | |
| 63 GFX_DrawCfgWindow t3c1; | |
| 64 GFX_DrawCfgWindow t3c2; | |
| 65 | |
|
529
0e1db77b2aca
Added skip condition in custom view selection:
Ideenmodellierer
parents:
527
diff
changeset
|
66 uint8_t t3_selection_customview = CVIEW_noneOrDebug; |
| 38 | 67 |
| 841 | 68 static uint8_t AF_lastDecoDepth = 0; |
| 69 static uint16_t AF_lastTTS = 0; | |
| 70 | |
| 71 | |
| 38 | 72 /* TEM HAS TO MOVE TO GLOBAL--------------------------------------------------*/ |
| 73 | |
| 74 /* Private types -------------------------------------------------------------*/ | |
| 75 #define TEXTSIZE 16 | |
| 76 | |
| 841 | 77 /* defines for autofocus of compass */ |
| 78 #define AF_COMPASS_ACTIVATION_ANGLE (10.0f) /* angle for pitch and roll. Compass gets activated in case the value is smaller (OSTC4 hold in horitontal position */ | |
| 79 #define AF_COMPASS_DEBOUNCE (10u) /* debouncing value to avoid compass activation during normal movement */ | |
| 80 | |
| 81 | |
| 38 | 82 /* Private function prototypes -----------------------------------------------*/ |
| 83 void t3_refresh_divemode(void); | |
| 84 | |
| 85 uint8_t t3_test_customview_warnings(void); | |
| 86 void t3_refresh_customview(float depth); | |
| 496 | 87 void t3_basics_compass(GFX_DrawCfgScreen *tXscreen, point_t center, uint16_t ActualHeading, uint16_t UserSetHeading); |
| 841 | 88 uint8_t t3_EvaluateAFCondition(uint8_t T3CView); |
| 945 | 89 uint8_t t3_drawSlowExitGraph(GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXl1, GFX_DrawCfgWindow* tXr1); /* this function is only called if diver is below last last stop depth */ |
| 38 | 90 |
| 91 /* Exported functions --------------------------------------------------------*/ | |
| 92 | |
| 93 void t3_init(void) | |
| 94 { | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
95 SSettings* pSettings; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
96 pSettings = settingsGetPointer(); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
97 |
| 837 | 98 t3_selection_customview = cv_changelist_BS[0]; |
| 38 | 99 |
| 100 t3screen.FBStartAdress = 0; | |
| 101 t3screen.ImageHeight = 480; | |
| 102 t3screen.ImageWidth = 800; | |
| 103 t3screen.LayerIndex = 1; | |
| 104 | |
| 105 t3l1.Image = &t3screen; | |
| 106 t3l1.WindowNumberOfTextLines = 2; | |
| 107 t3l1.WindowLineSpacing = 19; // Abstand von Y0 | |
| 108 t3l1.WindowTab = 100; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
109 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
110 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
111 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
112 t3l1.WindowX0 = 0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
113 t3l1.WindowX1 = BigFontSeperationLeftRight - 5; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
114 t3l1.WindowY0 = BigFontSeperationTopBottom + 5; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
115 t3l1.WindowY1 = 479; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
116 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
117 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
118 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
119 t3l1.WindowX0 = 800 - BigFontSeperationLeftRight + 5; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
120 t3l1.WindowX1 = 799; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
121 t3l1.WindowY0 = 0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
122 t3l1.WindowY1 = 479 - BigFontSeperationTopBottom + 5 ; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
123 } |
| 38 | 124 |
| 125 t3r1.Image = &t3screen; | |
| 126 t3r1.WindowNumberOfTextLines = t3l1.WindowNumberOfTextLines; | |
| 127 t3r1.WindowLineSpacing = t3l1.WindowLineSpacing; | |
| 128 t3r1.WindowTab = t3l1.WindowTab; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
129 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
130 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
131 t3r1.WindowX0 = BigFontSeperationLeftRight + 5; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
132 t3r1.WindowX1 = 799; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
133 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
134 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
135 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
136 t3r1.WindowX0 = 0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
137 t3r1.WindowX1 = BigFontSeperationLeftRight - 5; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
138 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
139 |
| 38 | 140 t3r1.WindowY0 = t3l1.WindowY0; |
| 141 t3r1.WindowY1 = t3l1.WindowY1; | |
| 142 | |
| 518 | 143 /* t3c1 is across the complete lower part of the display */ |
| 38 | 144 t3c1.Image = &t3screen; |
| 145 t3c1.WindowNumberOfTextLines = 2; | |
| 518 | 146 t3c1.WindowLineSpacing = 84 + 5; /* double font + spacing */ |
| 38 | 147 t3c1.WindowX0 = 0; |
| 148 t3c1.WindowX1 = 799; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
149 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
150 { |
| 511 | 151 t3c1.WindowY0 = 5; |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
152 t3c1.WindowY1 = BigFontSeperationTopBottom - 5; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
153 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
154 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
155 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
156 t3c1.WindowY0 = 480 - BigFontSeperationTopBottom + 5; |
| 511 | 157 t3c1.WindowY1 = 479 - 5; |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
158 } |
| 38 | 159 |
| 518 | 160 /* t3c2 is just showing the lower right part of the display */ |
| 38 | 161 t3c2.Image = &t3screen; |
| 162 t3c2.WindowNumberOfTextLines = 3; | |
| 511 | 163 t3c2.WindowLineSpacing = t3c1.WindowLineSpacing ; |
| 38 | 164 t3c2.WindowX0 = 370; |
| 165 t3c2.WindowX1 = 799; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
166 t3c2.WindowY0 = t3c1.WindowY0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
167 t3c2.WindowY1 = t3c1.WindowY1; |
| 38 | 168 t3c2.WindowTab = 600; |
| 841 | 169 |
| 170 t3_EvaluateAFCondition(CVIEW_T3_END); /* reset debounce counters */ | |
| 38 | 171 } |
| 172 | |
|
592
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
173 void t3_select_customview(uint8_t selectedCustomview) |
|
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
174 { |
|
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
175 if(selectedCustomview < CVIEW_T3_END) |
|
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
176 { |
|
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
177 t3_selection_customview = selectedCustomview; |
|
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
178 } |
|
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
179 } |
|
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
180 |
| 610 | 181 void t3_drawMarker(GFX_DrawCfgScreen *hgfx, const SWindowGimpStyle *window, uint8_t *data, uint16_t datalength, uint8_t color) |
| 182 { | |
| 183 uint16_t line = 0; | |
| 184 uint16_t dataIndex = 0; | |
| 185 uint16_t lastDataIndex = 0; | |
| 186 uint16_t windowWidth = 0; | |
| 187 int16_t factor = 0; | |
| 188 uint8_t setMarker = 0; | |
| 189 | |
| 190 point_t start; | |
| 191 point_t stop; | |
| 192 | |
| 193 | |
| 194 if( (window->bottom <= 479) | |
| 195 && (window->top <= 479) | |
| 196 && (window->right <= 799) | |
| 197 && (window->left <= 799) | |
| 198 && (window->right >= 0) | |
| 199 && (window->left >= 0) | |
| 200 && (window->bottom > window->top) | |
| 201 && (window->right > window->left)) | |
| 202 { | |
| 203 windowWidth = window->right - window->left; | |
| 204 | |
|
624
930f1bbe0ac2
Development bugfix: Marker in standard t3 view drawn in wrong direction
Ideenmodellierer
parents:
622
diff
changeset
|
205 start.y = 479 - BigFontSeperationTopBottom - 5; |
|
930f1bbe0ac2
Development bugfix: Marker in standard t3 view drawn in wrong direction
Ideenmodellierer
parents:
622
diff
changeset
|
206 stop.y =5; |
|
930f1bbe0ac2
Development bugfix: Marker in standard t3 view drawn in wrong direction
Ideenmodellierer
parents:
622
diff
changeset
|
207 |
| 610 | 208 while((line <= windowWidth) && (dataIndex < datalength)) |
| 209 { | |
| 210 factor = (10 * line * (long)datalength)/windowWidth; | |
| 211 dataIndex = factor/10; | |
| 212 /* check if a marker is set in the intervall which is bypassed because of data reduction */ | |
| 213 setMarker = 0; | |
| 214 while(lastDataIndex <= dataIndex) | |
| 215 { | |
| 216 lastDataIndex++; | |
| 217 if(data[lastDataIndex] != 0) | |
| 218 { | |
| 219 setMarker = 1; | |
| 220 break; | |
| 221 } | |
| 222 } | |
| 223 lastDataIndex = dataIndex; | |
| 224 int rest = factor - dataIndex*10; | |
| 225 if(rest >= 5) | |
| 226 dataIndex++; | |
| 227 | |
| 228 if((datalength - 1) < dataIndex) | |
| 229 dataIndex = datalength-1; | |
| 230 | |
| 231 if((line > 0) && (setMarker)) /* draw marker line */ | |
| 232 { | |
| 233 start.x = line; | |
| 234 stop.x = line; | |
| 235 GFX_draw_line(hgfx, start, stop, color); | |
| 236 } | |
| 237 line++; | |
| 238 dataIndex++; | |
| 239 } | |
| 240 } | |
| 241 } | |
| 242 | |
|
592
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
243 void t3_miniLiveLogProfile(void) |
|
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
244 { |
|
641
ed5422ac4ffb
Development Bugfix Deco bars not shown after last deco stop passed:
Ideenmodellierer
parents:
633
diff
changeset
|
245 static uint8_t wasDecoDive = 0; |
|
ed5422ac4ffb
Development Bugfix Deco bars not shown after last deco stop passed:
Ideenmodellierer
parents:
633
diff
changeset
|
246 |
|
592
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
247 SWindowGimpStyle wintemp; |
|
602
2cb0a97a07ad
Added replay data scaling in case life data is longer than replay block
Ideenmodellierer
parents:
601
diff
changeset
|
248 uint16_t replayDataLength = 0; |
|
2cb0a97a07ad
Added replay data scaling in case life data is longer than replay block
Ideenmodellierer
parents:
601
diff
changeset
|
249 uint16_t liveDataLength = 0; |
|
2cb0a97a07ad
Added replay data scaling in case life data is longer than replay block
Ideenmodellierer
parents:
601
diff
changeset
|
250 uint16_t drawDataLength = 0; |
|
592
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
251 uint16_t* pReplayData; |
| 610 | 252 uint8_t* pReplayMarker; |
| 599 | 253 uint16_t max_depth = 10; |
| 254 char text[TEXTSIZE]; | |
|
592
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
255 point_t start, stop; |
| 599 | 256 uint16_t diveMinutes = 0; |
|
592
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
257 |
| 622 | 258 SSettings* pSettings; |
| 259 pSettings = settingsGetPointer(); | |
|
619
8fa2de4414a8
Added t3 quick menu for marker synchronisation:
Ideenmodellierer
parents:
613
diff
changeset
|
260 |
| 622 | 261 wintemp.top = 479 - BigFontSeperationTopBottom + 5; |
| 599 | 262 wintemp.bottom = 479 - 5; |
|
592
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
263 |
| 622 | 264 if(!pSettings->FlipDisplay) |
| 265 { | |
| 266 wintemp.left = t3c1.WindowX0; | |
| 267 wintemp.right = t3c1.WindowX0 + CV_PROFILE_WIDTH; | |
| 268 } | |
| 269 else | |
| 270 { | |
| 271 wintemp.left = t3c1.WindowX1 - CV_PROFILE_WIDTH;; | |
| 272 wintemp.right = t3c1.WindowX1; | |
| 273 } | |
| 274 | |
|
592
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
275 start.x = CV_PROFILE_WIDTH + 2; |
|
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
276 stop.x = start.x; |
| 622 | 277 start.y = 479 - BigFontSeperationTopBottom - 5; |
| 278 stop.y =5; | |
|
592
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
279 |
|
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
280 GFX_draw_line(&t3screen, start, stop, CLUT_Font020); |
|
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
281 |
|
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
282 if(getReplayOffset() != 0xFFFF) |
|
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
283 { |
| 610 | 284 getReplayInfo(&pReplayData, &pReplayMarker, &replayDataLength, &max_depth, &diveMinutes); |
|
592
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
285 } |
|
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
286 |
|
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
287 if(max_depth < (uint16_t)(stateUsed->lifeData.max_depth_meter * 100)) |
|
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
288 { |
|
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
289 max_depth = (uint16_t)(stateUsed->lifeData.max_depth_meter * 100); |
|
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
290 } |
|
602
2cb0a97a07ad
Added replay data scaling in case life data is longer than replay block
Ideenmodellierer
parents:
601
diff
changeset
|
291 |
|
2cb0a97a07ad
Added replay data scaling in case life data is longer than replay block
Ideenmodellierer
parents:
601
diff
changeset
|
292 liveDataLength = getMiniLiveReplayLength(); |
|
2cb0a97a07ad
Added replay data scaling in case life data is longer than replay block
Ideenmodellierer
parents:
601
diff
changeset
|
293 |
|
2cb0a97a07ad
Added replay data scaling in case life data is longer than replay block
Ideenmodellierer
parents:
601
diff
changeset
|
294 if(replayDataLength > liveDataLength) |
|
2cb0a97a07ad
Added replay data scaling in case life data is longer than replay block
Ideenmodellierer
parents:
601
diff
changeset
|
295 { |
|
2cb0a97a07ad
Added replay data scaling in case life data is longer than replay block
Ideenmodellierer
parents:
601
diff
changeset
|
296 drawDataLength = replayDataLength; |
|
2cb0a97a07ad
Added replay data scaling in case life data is longer than replay block
Ideenmodellierer
parents:
601
diff
changeset
|
297 } |
|
2cb0a97a07ad
Added replay data scaling in case life data is longer than replay block
Ideenmodellierer
parents:
601
diff
changeset
|
298 else |
|
2cb0a97a07ad
Added replay data scaling in case life data is longer than replay block
Ideenmodellierer
parents:
601
diff
changeset
|
299 { |
|
2cb0a97a07ad
Added replay data scaling in case life data is longer than replay block
Ideenmodellierer
parents:
601
diff
changeset
|
300 drawDataLength = liveDataLength; |
|
2cb0a97a07ad
Added replay data scaling in case life data is longer than replay block
Ideenmodellierer
parents:
601
diff
changeset
|
301 } |
|
2cb0a97a07ad
Added replay data scaling in case life data is longer than replay block
Ideenmodellierer
parents:
601
diff
changeset
|
302 |
|
2cb0a97a07ad
Added replay data scaling in case life data is longer than replay block
Ideenmodellierer
parents:
601
diff
changeset
|
303 if(drawDataLength < CV_PROFILE_WIDTH) |
|
592
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
304 { |
|
602
2cb0a97a07ad
Added replay data scaling in case life data is longer than replay block
Ideenmodellierer
parents:
601
diff
changeset
|
305 drawDataLength = CV_PROFILE_WIDTH; |
|
592
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
306 } |
|
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
307 |
| 599 | 308 if(diveMinutes != 0) |
| 309 { | |
| 310 snprintf(text,TEXTSIZE,"\002%dmin",diveMinutes); | |
| 311 GFX_write_string(&FontT42,&t3c1,text,1); | |
| 312 } | |
| 313 | |
| 314 snprintf(text,TEXTSIZE,"\002%01.1fm", max_depth / 100.0); | |
| 315 GFX_write_string(&FontT42,&t3c1,text,0); | |
| 316 | |
|
641
ed5422ac4ffb
Development Bugfix Deco bars not shown after last deco stop passed:
Ideenmodellierer
parents:
633
diff
changeset
|
317 if(getMiniLiveReplayLength() < 10) /* new dive startet => reset the visualization state for deco data */ |
|
ed5422ac4ffb
Development Bugfix Deco bars not shown after last deco stop passed:
Ideenmodellierer
parents:
633
diff
changeset
|
318 { |
|
ed5422ac4ffb
Development Bugfix Deco bars not shown after last deco stop passed:
Ideenmodellierer
parents:
633
diff
changeset
|
319 wasDecoDive = 0; |
|
ed5422ac4ffb
Development Bugfix Deco bars not shown after last deco stop passed:
Ideenmodellierer
parents:
633
diff
changeset
|
320 } |
|
619
8fa2de4414a8
Added t3 quick menu for marker synchronisation:
Ideenmodellierer
parents:
613
diff
changeset
|
321 |
|
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:
758
diff
changeset
|
322 const SDecoinfo * pDecoinfo = getDecoInfo(); |
|
641
ed5422ac4ffb
Development Bugfix Deco bars not shown after last deco stop passed:
Ideenmodellierer
parents:
633
diff
changeset
|
323 if((pDecoinfo->output_time_to_surface_seconds) || (wasDecoDive)) /* draw deco data first => will be overlayed by all other informations */ |
|
619
8fa2de4414a8
Added t3 quick menu for marker synchronisation:
Ideenmodellierer
parents:
613
diff
changeset
|
324 { |
|
641
ed5422ac4ffb
Development Bugfix Deco bars not shown after last deco stop passed:
Ideenmodellierer
parents:
633
diff
changeset
|
325 wasDecoDive = 1; |
|
619
8fa2de4414a8
Added t3 quick menu for marker synchronisation:
Ideenmodellierer
parents:
613
diff
changeset
|
326 GFX_graph_print(&t3screen,&wintemp,wintemp.top * -1,1,0,max_depth, getMiniLiveDecoPointerToData(),drawDataLength, CLUT_NiceGreen, NULL); |
|
8fa2de4414a8
Added t3 quick menu for marker synchronisation:
Ideenmodellierer
parents:
613
diff
changeset
|
327 } |
|
8fa2de4414a8
Added t3 quick menu for marker synchronisation:
Ideenmodellierer
parents:
613
diff
changeset
|
328 |
|
602
2cb0a97a07ad
Added replay data scaling in case life data is longer than replay block
Ideenmodellierer
parents:
601
diff
changeset
|
329 if(replayDataLength != 0) |
|
2cb0a97a07ad
Added replay data scaling in case life data is longer than replay block
Ideenmodellierer
parents:
601
diff
changeset
|
330 { |
|
2cb0a97a07ad
Added replay data scaling in case life data is longer than replay block
Ideenmodellierer
parents:
601
diff
changeset
|
331 GFX_graph_print(&t3screen, &wintemp, 0,1,0, max_depth, pReplayData, drawDataLength, CLUT_Font031, NULL); |
| 610 | 332 if(pReplayMarker[0] != 0xFF) |
| 333 { | |
| 334 t3_drawMarker(&t3screen, &wintemp, pReplayMarker, drawDataLength, CLUT_CompassUserHeadingTick); | |
| 335 } | |
|
602
2cb0a97a07ad
Added replay data scaling in case life data is longer than replay block
Ideenmodellierer
parents:
601
diff
changeset
|
336 } |
|
2cb0a97a07ad
Added replay data scaling in case life data is longer than replay block
Ideenmodellierer
parents:
601
diff
changeset
|
337 |
|
2cb0a97a07ad
Added replay data scaling in case life data is longer than replay block
Ideenmodellierer
parents:
601
diff
changeset
|
338 if(liveDataLength > 3) |
| 599 | 339 { |
|
602
2cb0a97a07ad
Added replay data scaling in case life data is longer than replay block
Ideenmodellierer
parents:
601
diff
changeset
|
340 GFX_graph_print(&t3screen, &wintemp, 0,1,0, max_depth, getMiniLiveReplayPointerToData(), drawDataLength, CLUT_Font030, NULL); |
| 599 | 341 } |
|
592
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
342 } |
|
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
343 |
| 38 | 344 |
| 345 void t3_refresh(void) | |
| 346 { | |
| 496 | 347 static uint8_t last_mode = MODE_SURFACE; |
| 348 | |
| 38 | 349 SStateList status; |
| 350 get_globalStateList(&status); | |
| 351 | |
| 352 if(stateUsed->mode != MODE_DIVE) | |
| 353 { | |
| 354 settingsGetPointer()->design = 7; | |
| 355 return; | |
| 356 } | |
| 357 | |
| 358 if(status.base != BaseHome) | |
| 359 return; | |
| 360 | |
|
541
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
361 if(last_mode != MODE_DIVE) /* Select custom view */ |
| 496 | 362 { |
| 363 if((settingsGetPointer()->tX_customViewTimeout == 0) && (settingsGetPointer()->showDebugInfo)) | |
| 364 { | |
| 365 t3_selection_customview = CVIEW_noneOrDebug; | |
| 366 } | |
| 367 else | |
| 368 { | |
|
541
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
369 t3_selection_customview = settingsGetPointer()->tX_customViewPrimaryBF; |
| 496 | 370 } |
| 371 t3_change_customview(ACTION_END); | |
| 372 } | |
| 38 | 373 t3screen.FBStartAdress = getFrame(24); |
| 374 t3_refresh_divemode(); | |
|
166
255eedad4155
cleanup: get rid of some compile warnings
Jan Mulder <jlmulder@xs4all.nl>
parents:
138
diff
changeset
|
375 GFX_SetFramesTopBottom(t3screen.FBStartAdress, 0,480); |
| 38 | 376 releaseAllFramesExcept(24,t3screen.FBStartAdress); |
| 496 | 377 last_mode = stateUsed->mode; |
| 38 | 378 } |
| 379 | |
|
541
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
380 void t3_set_customview_to_primary(void) |
|
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
381 { |
|
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
382 if(stateUsed->mode == MODE_DIVE) |
|
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
383 { |
|
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
384 t3_selection_customview = settingsGetPointer()->tX_customViewPrimaryBF; |
| 599 | 385 t3_change_customview(ACTION_END); |
|
541
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
386 } |
|
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
539
diff
changeset
|
387 } |
| 38 | 388 |
| 389 /* Private functions ---------------------------------------------------------*/ | |
| 390 | |
| 391 float t3_basics_lines_depth_and_divetime(GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXl1, GFX_DrawCfgWindow* tXr1, uint8_t mode) | |
| 392 { | |
| 518 | 393 char text[256]; |
| 394 uint8_t textPointer; | |
| 945 | 395 uint8_t color = 0; |
| 38 | 396 uint8_t depthChangeRate; |
| 397 uint8_t depthChangeAscent; | |
| 398 point_t start, stop, startZeroLine; | |
| 518 | 399 SDivetime Divetime = {0,0,0,0}; |
| 945 | 400 uint16_t nextstopLengthSeconds = 0; |
| 401 uint8_t nextstopDepthMeter = 0; | |
| 38 | 402 |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
403 SSettings* pSettings; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
404 pSettings = settingsGetPointer(); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
405 |
| 945 | 406 const SDecoinfo * pDecoinfo = getDecoInfo(); |
| 407 if(pDecoinfo->output_time_to_surface_seconds) | |
| 408 { | |
| 409 tHome_findNextStop(pDecoinfo->output_stop_length_seconds, &nextstopDepthMeter, &nextstopLengthSeconds); | |
| 410 } | |
| 411 else | |
| 412 { | |
| 413 nextstopDepthMeter = 0; | |
| 414 nextstopLengthSeconds = 0; | |
| 415 } | |
| 416 | |
| 38 | 417 start.x = 0; |
| 418 stop.x = 799; | |
| 419 stop.y = start.y = BigFontSeperationTopBottom; | |
|
642
c737cf5d9067
Do not show focus indicator in case motion detection is suspended:
Ideenmodellierer
parents:
641
diff
changeset
|
420 if((viewInFocus()) && (!viewDetectionSuspended())) |
| 553 | 421 { |
| 422 GFX_draw_line(tXscreen, start, stop, CLUT_Font023); | |
| 423 } | |
| 424 else | |
| 425 { | |
| 426 GFX_draw_line(tXscreen, start, stop, CLUT_Font020); | |
| 427 } | |
| 428 | |
| 38 | 429 start.y = BigFontSeperationTopBottom; |
| 430 stop.y = 479; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
431 |
| 38 | 432 stop.x = start.x = BigFontSeperationLeftRight; |
|
642
c737cf5d9067
Do not show focus indicator in case motion detection is suspended:
Ideenmodellierer
parents:
641
diff
changeset
|
433 if((viewInFocus() && (!viewDetectionSuspended()))) |
| 553 | 434 { |
| 435 GFX_draw_line(tXscreen, start, stop, CLUT_Font023); | |
| 436 } | |
| 437 else | |
| 438 { | |
| 439 GFX_draw_line(tXscreen, start, stop, CLUT_Font020); | |
| 440 } | |
| 38 | 441 |
| 442 /* ascentrate graph */ | |
| 443 if(mode == DIVEMODE_Apnea) | |
| 444 { | |
| 445 /* ascentrate graph - apnea mode */ | |
| 446 if(stateUsed->lifeData.ascent_rate_meter_per_min > 0) | |
| 447 { | |
| 448 depthChangeAscent = 1; | |
| 449 if(stateUsed->lifeData.ascent_rate_meter_per_min < 200) | |
| 450 depthChangeRate = (uint8_t)stateUsed->lifeData.ascent_rate_meter_per_min; | |
| 451 else | |
| 452 depthChangeRate = 200; | |
| 453 } | |
| 454 else | |
| 455 { | |
| 456 depthChangeAscent = 0; | |
| 457 if(stateUsed->lifeData.ascent_rate_meter_per_min > -200) | |
| 458 depthChangeRate = (uint8_t)(0 - stateUsed->lifeData.ascent_rate_meter_per_min); | |
| 459 else | |
| 460 depthChangeRate = 200; | |
| 461 } | |
| 413 | 462 |
| 463 if(!pSettings->FlipDisplay) | |
| 464 { | |
| 465 start.y = tXl1->WindowY0 - 1; | |
| 466 } | |
| 467 else | |
| 468 { | |
| 469 start.y = tXl1->WindowY1 + 1; | |
| 470 } | |
|
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
471 startZeroLine.y = start.y; |
| 38 | 472 for(int i = 0; i<5;i++) |
| 473 { | |
| 474 start.y += 40; | |
| 475 stop.y = start.y; | |
| 413 | 476 if(!pSettings->FlipDisplay) |
| 477 { | |
| 478 start.x = tXl1->WindowX1 - 1; | |
| 479 } | |
| 480 else | |
| 481 { | |
| 482 start.x = tXr1->WindowX1 - 1; | |
| 483 } | |
| 38 | 484 stop.x = start.x - 17; |
| 485 | |
| 486 if(depthChangeRate <= 6) | |
| 487 { | |
| 488 if(i == 2) | |
| 489 { | |
| 490 startZeroLine.y = start.y; | |
| 491 stop.x = start.x - 34; | |
| 492 } | |
| 493 } | |
| 494 else | |
| 495 { | |
| 496 if(((i == 1) && depthChangeAscent) || ((i == 3) && !depthChangeAscent)) | |
| 497 { | |
| 498 startZeroLine.y = start.y; | |
| 499 stop.x = start.x - 34; | |
| 500 } | |
| 501 } | |
| 502 GFX_draw_line(tXscreen, start, stop, 0); | |
| 503 } | |
| 504 // new thick bar design Sept. 2015 | |
| 505 if((stateUsed->lifeData.ascent_rate_meter_per_min > 4) || (stateUsed->lifeData.ascent_rate_meter_per_min < -4)) | |
| 506 { | |
| 507 start.y = startZeroLine.y; | |
| 508 if(depthChangeAscent) | |
| 509 { | |
| 510 color = CLUT_EverythingOkayGreen; | |
| 511 start.y += 7; // starte etwas weiter oben | |
| 512 stop.y = start.y + (uint16_t)(depthChangeRate * 4) - 9; // - x; // wegen der Liniendicke | |
| 513 if(stop.y > 475) | |
| 514 stop.y = 475; | |
| 515 } | |
| 516 else | |
| 517 { | |
| 518 color = CLUT_Font023; | |
| 519 start.y -= 7; | |
| 520 stop.y = start.y - (uint16_t)(depthChangeRate * 4) + 9; | |
| 521 if(stop.y <= tXl1->WindowY0) | |
| 522 stop.y = tXl1->WindowY0 + 1; | |
| 523 } | |
| 413 | 524 if(!pSettings->FlipDisplay) |
| 525 { | |
| 526 start.x = tXl1->WindowX1 - 3 - 5; | |
| 527 } | |
| 528 else | |
| 529 { | |
| 530 start.x = tXr1->WindowX1 - 3 - 5; | |
| 531 } | |
| 532 | |
| 533 stop.x = start.x; | |
| 38 | 534 GFX_draw_thick_line(12,tXscreen, start, stop, color); |
| 535 } | |
| 536 } | |
| 537 else | |
| 538 { | |
|
954
4e4fbd73e329
Slow exit graph draw normal ascent if slow exit is inactive:
Ideenmodellierer
parents:
951
diff
changeset
|
539 color = 0xff; |
|
1025
6e11f7327efd
Hide slow exit graph if close to surface:
Ideenmodellierer
parents:
1014
diff
changeset
|
540 if((pSettings->slowExitTime != 0) && (nextstopDepthMeter == 0) && (stateUsed->lifeData.depth_meter < pSettings->last_stop_depth_meter) && (stateUsed->lifeData.depth_meter > 0.3)) |
| 945 | 541 { |
| 542 color = t3_drawSlowExitGraph(tXscreen, tXl1, tXr1); | |
| 543 } | |
|
954
4e4fbd73e329
Slow exit graph draw normal ascent if slow exit is inactive:
Ideenmodellierer
parents:
951
diff
changeset
|
544 if(color == 0xff) /* no slow exit => continue with common ascent graph */ |
| 945 | 545 { |
|
1025
6e11f7327efd
Hide slow exit graph if close to surface:
Ideenmodellierer
parents:
1014
diff
changeset
|
546 if(stateUsed->lifeData.ascent_rate_meter_per_min > 0) /* ascent rate graph -standard mode */ |
| 945 | 547 { |
| 548 if(!pSettings->FlipDisplay) | |
| 549 { | |
| 550 start.y = tXl1->WindowY0 - 1; | |
| 551 } | |
| 552 else | |
| 553 { | |
| 554 start.y = tXl1->WindowY1 + 1; | |
| 555 } | |
| 556 | |
| 557 for(int i = 0; i<4;i++) | |
| 558 { | |
| 559 start.y += 5*8; | |
| 560 stop.y = start.y; | |
| 561 if(!pSettings->FlipDisplay) | |
| 562 { | |
| 563 start.x = tXl1->WindowX1 - 1; | |
| 564 } | |
| 565 else | |
| 566 { | |
| 567 start.x = tXr1->WindowX1 + 3; | |
| 568 } | |
| 569 stop.x = start.x - 17; | |
| 570 GFX_draw_line(tXscreen, start, stop, 0); | |
| 571 } | |
| 572 // new thick bar design Sept. 2015 | |
| 573 if(!pSettings->FlipDisplay) | |
| 574 { | |
| 575 start.x = tXl1->WindowX1 - 3 - 5; | |
| 576 } | |
| 577 else | |
| 578 { | |
| 579 start.x = tXr1->WindowX1 - 3 - 5; | |
| 580 } | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
581 |
| 945 | 582 stop.x = start.x; |
| 583 if(!pSettings->FlipDisplay) | |
| 584 { | |
| 585 start.y = tXl1->WindowY0 - 1; | |
| 586 } | |
| 587 else | |
| 588 { | |
| 589 start.y = tXl1->WindowY1 + 1; | |
| 590 } | |
| 591 | |
| 592 stop.y = start.y + (uint16_t)(stateUsed->lifeData.ascent_rate_meter_per_min * 8); | |
| 593 stop.y -= 3; // wegen der Liniendicke von 12 anstelle von 9 | |
| 594 if(stop.y >= 470) | |
| 595 stop.y = 470; | |
| 596 start.y += 7; // starte etwas weiter oben | |
| 597 if(stateUsed->lifeData.ascent_rate_meter_per_min <= 10) | |
| 598 color = CLUT_EverythingOkayGreen; | |
| 599 else | |
| 600 if(stateUsed->lifeData.ascent_rate_meter_per_min <= 15) | |
| 601 color = CLUT_WarningYellow; | |
| 602 else | |
| 603 color = CLUT_WarningRed; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
604 |
| 945 | 605 GFX_draw_thick_line(12,tXscreen, start, stop, color); |
| 606 } | |
| 607 color = drawingColor_from_ascentspeed(stateUsed->lifeData.ascent_rate_meter_per_min); | |
| 608 } | |
| 609 } | |
| 610 /* depth */ | |
| 611 float depth = unit_depth_float(stateUsed->lifeData.depth_meter); | |
| 612 | |
| 613 if(depth <= 0.3f) | |
| 614 depth = 0; | |
| 615 | |
| 616 if(settingsGetPointer()->nonMetricalSystem) | |
| 617 snprintf(text,TEXTSIZE,"\032\f[feet]"); | |
| 618 else | |
| 619 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Depth); | |
| 620 GFX_write_string(&FontT42,tXl1,text,0); | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
621 |
| 945 | 622 if( ((mode == DIVEMODE_Apnea) && ((stateUsed->lifeData.ascent_rate_meter_per_min > 4) || (stateUsed->lifeData.ascent_rate_meter_per_min < -4 ))) |
| 623 || ((mode != DIVEMODE_Apnea) && ((stateUsed->lifeData.ascent_rate_meter_per_min > 8) || (stateUsed->lifeData.ascent_rate_meter_per_min < -10))) | |
| 624 ) | |
| 625 { | |
| 626 snprintf(text,TEXTSIZE,"\f\002%.0f %c%c/min " | |
| 627 , unit_depth_float(stateUsed->lifeData.ascent_rate_meter_per_min) | |
| 628 , unit_depth_char1() | |
| 629 , unit_depth_char2() | |
| 630 ); | |
| 631 GFX_write_string(&FontT42,tXl1,text,0); | |
| 632 } | |
| 38 | 633 |
| 945 | 634 if( depth < 100) |
| 635 snprintf(text,TEXTSIZE,"\020\003\016%01.1f",depth); | |
| 636 else | |
| 637 snprintf(text,TEXTSIZE,"\020\003\016%01.0f",depth); | |
| 638 | |
| 639 Gfx_colorsscheme_mod(text,color); | |
| 640 GFX_write_string(&FontT105,tXl1,text,1); | |
| 641 | |
| 38 | 642 |
| 643 // divetime | |
| 644 if(mode == DIVEMODE_Apnea) | |
| 645 { | |
| 646 if(stateUsed->lifeData.counterSecondsShallowDepth) | |
| 647 { | |
| 648 SDivetime SurfaceBreakTime = {0,0,0,0}; | |
| 649 | |
| 650 SurfaceBreakTime.Total = stateUsed->lifeData.counterSecondsShallowDepth; | |
| 651 SurfaceBreakTime.Minutes = SurfaceBreakTime.Total / 60; | |
| 652 SurfaceBreakTime.Seconds = SurfaceBreakTime.Total - (SurfaceBreakTime.Minutes * 60); | |
| 653 | |
| 654 snprintf(text,TEXTSIZE,"\032\f\002%c%c", TXT_2BYTE,TXT2BYTE_ApneaSurface); | |
| 655 GFX_write_string(&FontT42,tXr1,text,0); | |
| 656 | |
|
564
5e0a75e2f00b
Bugfix One or more deactivated sensors hide sensor display:
Ideenmodellierer
parents:
553
diff
changeset
|
657 snprintf(text,TEXTSIZE,"\020\003\002\016%u:%02u",SurfaceBreakTime.Minutes, SurfaceBreakTime.Seconds); |
| 38 | 658 } |
| 659 else | |
| 660 { | |
| 661 Divetime.Total = stateUsed->lifeData.dive_time_seconds; | |
| 662 Divetime.Minutes = Divetime.Total / 60; | |
| 663 Divetime.Seconds = Divetime.Total - ( Divetime.Minutes * 60 ); | |
| 664 | |
| 665 snprintf(text,TEXTSIZE,"\032\f\002%c",TXT_Divetime); | |
| 666 GFX_write_string(&FontT42,tXr1,text,0); | |
| 667 | |
| 668 if(Divetime.Minutes < 100) | |
|
564
5e0a75e2f00b
Bugfix One or more deactivated sensors hide sensor display:
Ideenmodellierer
parents:
553
diff
changeset
|
669 snprintf(text,TEXTSIZE,"\020\003\002\016%u:%02u",Divetime.Minutes, Divetime.Seconds); |
| 38 | 670 else |
|
564
5e0a75e2f00b
Bugfix One or more deactivated sensors hide sensor display:
Ideenmodellierer
parents:
553
diff
changeset
|
671 snprintf(text,TEXTSIZE,"\020\003\002\016%u'",Divetime.Minutes); |
| 38 | 672 } |
|
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
857
diff
changeset
|
673 Gfx_colorsscheme_mod(text,0); |
| 518 | 674 GFX_write_string(&FontT105,tXr1,text,1); |
| 38 | 675 } |
| 676 else | |
| 677 { | |
| 518 | 678 switch(get_globalState()) |
| 679 { | |
| 739 | 680 case StDMENU: snprintf(text,TEXTSIZE,"\a\003\001%c%c", TXT_2BYTE, TXT2BYTE_DiveMenuQ); |
| 681 GFX_write_string_color(&FontT42,tXr1,text,1,CLUT_WarningYellow); | |
| 682 break; | |
| 518 | 683 case StDBEAR: snprintf(text,TEXTSIZE,"\a\003\001%c%c", TXT_2BYTE, TXT2BYTE_DiveBearingQ); |
| 684 GFX_write_string_color(&FontT42,tXr1,text,1,CLUT_WarningYellow); | |
| 685 break; | |
| 686 case StDRAVG: snprintf(text,TEXTSIZE,"\a\003\001%c%c", TXT_2BYTE, TXT2BYTE_DiveResetAvgQ); | |
| 687 GFX_write_string_color(&FontT42,tXr1,text,1,CLUT_WarningYellow); | |
| 688 break; | |
| 38 | 689 |
| 518 | 690 case StDMGAS: |
| 691 textPointer = 0; | |
| 692 text[textPointer++] = '\a'; | |
| 693 text[textPointer++] = '\001'; | |
| 694 text[textPointer++] = ' '; | |
| 695 textPointer += tHome_gas_writer(stateUsed->diveSettings.gas[actualBetterGasId()].oxygen_percentage,stateUsed->diveSettings.gas[actualBetterGasId()].helium_percentage,&text[textPointer]); | |
| 696 text[textPointer++] = '?'; | |
| 697 text[textPointer++] = ' '; | |
| 698 text[textPointer++] = 0; | |
| 699 GFX_write_string_color(&FontT42,tXr1,text,1,CLUT_WarningYellow); | |
| 700 break; | |
| 613 | 701 |
| 702 case StDMARK: snprintf(text,TEXTSIZE,"\a\003\001%c%c", TXT_2BYTE, TXT2BYTE_SetMarkerShort); | |
| 703 GFX_write_string_color(&FontT42,tXr1,text,1,CLUT_WarningYellow); | |
| 704 break; | |
| 705 | |
|
619
8fa2de4414a8
Added t3 quick menu for marker synchronisation:
Ideenmodellierer
parents:
613
diff
changeset
|
706 case StDCHECK: snprintf(text,TEXTSIZE,"\a\003\001%c%c", TXT_2BYTE, TXT2BYTE_CheckMarker); |
|
8fa2de4414a8
Added t3 quick menu for marker synchronisation:
Ideenmodellierer
parents:
613
diff
changeset
|
707 GFX_write_string_color(&FontT42,tXr1,text,1,CLUT_WarningYellow); |
|
8fa2de4414a8
Added t3 quick menu for marker synchronisation:
Ideenmodellierer
parents:
613
diff
changeset
|
708 break; |
|
8fa2de4414a8
Added t3 quick menu for marker synchronisation:
Ideenmodellierer
parents:
613
diff
changeset
|
709 |
|
633
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
624
diff
changeset
|
710 #ifdef ENABLE_T3_PPO_SIM |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
624
diff
changeset
|
711 case StDSIM1: snprintf(text,TEXTSIZE,"\a\003\001PPO S0 +"); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
624
diff
changeset
|
712 GFX_write_string_color(&FontT42,tXr1,text,1,CLUT_WarningYellow); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
624
diff
changeset
|
713 break; |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
624
diff
changeset
|
714 case StDSIM2: snprintf(text,TEXTSIZE,"\a\003\001PPO S0 -"); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
624
diff
changeset
|
715 GFX_write_string_color(&FontT42,tXr1,text,1,CLUT_WarningYellow); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
624
diff
changeset
|
716 break; |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
624
diff
changeset
|
717 case StDSIM3: snprintf(text,TEXTSIZE,"\a\003\001PPO S1 +"); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
624
diff
changeset
|
718 GFX_write_string_color(&FontT42,tXr1,text,1,CLUT_WarningYellow); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
624
diff
changeset
|
719 break; |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
624
diff
changeset
|
720 case StDSIM4: snprintf(text,TEXTSIZE,"\a\003\001PPO S1 -"); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
624
diff
changeset
|
721 GFX_write_string_color(&FontT42,tXr1,text,1,CLUT_WarningYellow); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
624
diff
changeset
|
722 break; |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
624
diff
changeset
|
723 case StDSIM5: snprintf(text,TEXTSIZE,"\a\003\001PPO S2 +"); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
624
diff
changeset
|
724 GFX_write_string_color(&FontT42,tXr1,text,1,CLUT_WarningYellow); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
624
diff
changeset
|
725 break; |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
624
diff
changeset
|
726 case StDSIM6: snprintf(text,TEXTSIZE,"\a\003\001PPO S2 -"); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
624
diff
changeset
|
727 GFX_write_string_color(&FontT42,tXr1,text,1,CLUT_WarningYellow); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
624
diff
changeset
|
728 break; |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
624
diff
changeset
|
729 #endif |
| 518 | 730 default: /* show divetime */ |
| 38 | 731 |
| 518 | 732 Divetime.Total = stateUsed->lifeData.dive_time_seconds_without_surface_time; |
| 733 Divetime.Minutes = Divetime.Total / 60; | |
| 734 Divetime.Seconds = Divetime.Total - ( Divetime.Minutes * 60 ); | |
| 735 | |
| 736 snprintf(text,TEXTSIZE,"\032\f\002%c",TXT_Divetime); | |
| 737 GFX_write_string(&FontT42,tXr1,text,0); | |
| 738 | |
| 739 if(Divetime.Minutes < 100) | |
|
564
5e0a75e2f00b
Bugfix One or more deactivated sensors hide sensor display:
Ideenmodellierer
parents:
553
diff
changeset
|
740 snprintf(text,TEXTSIZE,"\020\003\002\016%u:%02u",Divetime.Minutes, Divetime.Seconds); |
| 518 | 741 else |
|
564
5e0a75e2f00b
Bugfix One or more deactivated sensors hide sensor display:
Ideenmodellierer
parents:
553
diff
changeset
|
742 snprintf(text,TEXTSIZE,"\020\003\002\016%u'",Divetime.Minutes); |
| 518 | 743 |
|
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
857
diff
changeset
|
744 Gfx_colorsscheme_mod(text,0); |
| 518 | 745 GFX_write_string(&FontT105,tXr1,text,1); |
| 746 break; | |
| 747 } | |
| 38 | 748 } |
| 749 | |
| 750 return depth; | |
| 751 } | |
| 752 | |
| 753 | |
| 754 void t3_refresh_divemode(void) | |
| 755 { | |
| 756 uint8_t customview_warnings = 0; | |
| 757 float depth_meter = 0.0; | |
|
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
758 |
| 38 | 759 // everything like lines, depth, ascent graph and divetime |
| 760 depth_meter = t3_basics_lines_depth_and_divetime(&t3screen, &t3l1, &t3r1, 0); // 0 could be stateUsed->diveSettings.diveMode for CCR specials | |
| 761 | |
| 762 // customview | |
| 763 if(stateUsed->warnings.numWarnings) | |
| 764 customview_warnings = t3_test_customview_warnings(); | |
| 765 | |
| 766 if(customview_warnings && warning_count_high_time) | |
| 951 | 767 { |
| 38 | 768 t3_basics_show_customview_warnings(&t3c1); |
| 951 | 769 } |
| 38 | 770 else |
| 951 | 771 { |
| 38 | 772 t3_refresh_customview(depth_meter); |
| 996 | 773 requestBuzzerActivation(REQUEST_BUZZER_OFF); |
| 951 | 774 } |
| 38 | 775 if(stateUsed->warnings.lowBattery) |
| 496 | 776 t3_basics_battery_low_customview_extra(&t3r1); //t3c1); |
| 38 | 777 } |
| 778 | |
| 779 | |
| 780 void t3_basics_battery_low_customview_extra(GFX_DrawCfgWindow* tXc1) | |
| 781 { | |
| 782 char TextC1[256]; | |
| 783 | |
| 496 | 784 TextC1[0] = ' ';//'\002'; |
| 38 | 785 TextC1[1] = '\f'; |
| 786 TextC1[2] = '\025'; | |
| 787 TextC1[3] = '3'; | |
| 788 TextC1[4] = '1'; | |
| 789 TextC1[5] = '1'; | |
| 790 TextC1[6] = '1'; | |
| 791 TextC1[7] = '1'; | |
| 792 TextC1[8] = '1'; | |
| 793 TextC1[9] = '1'; | |
| 794 TextC1[10] = '1'; | |
| 795 TextC1[11] = '1'; | |
| 796 TextC1[12] = '1'; | |
| 797 TextC1[13] = '1'; | |
| 798 TextC1[14] = '0'; | |
| 799 TextC1[15] = 0; | |
| 800 | |
| 801 if(!warning_count_high_time) | |
| 802 TextC1[4] = '2'; | |
| 803 | |
| 804 GFX_write_string(&Batt24,tXc1,TextC1,0); | |
| 805 } | |
| 806 | |
| 807 | |
| 808 | |
| 809 void t3_refresh_customview(float depth) | |
| 810 { | |
|
272
74a8296a2318
cleanup: simplify stateUsed usage
Jan Mulder <jlmulder@xs4all.nl>
parents:
237
diff
changeset
|
811 t3_basics_refresh_customview(depth, t3_selection_customview, &t3screen, &t3c1, &t3c2, stateUsedWrite->diveSettings.diveMode); |
| 38 | 812 } |
| 813 | |
| 814 | |
| 815 void t3_basics_refresh_apnoeRight(float depth, uint8_t tX_selection_customview, GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXc1, GFX_DrawCfgWindow* tXc2, uint8_t mode) | |
| 816 { | |
| 722 | 817 char text[30]; |
| 38 | 818 uint16_t textpointer = 0; |
| 819 | |
| 820 // CVIEW_T3_Temperature | |
| 821 float temperature; | |
| 413 | 822 SSettings* pSettings; |
| 823 pSettings = settingsGetPointer(); | |
| 38 | 824 |
| 825 SDivetime TotalDivetime = {0,0,0,0}; | |
| 826 SDivetime LastDivetime = {0,0,0,0}; | |
| 827 | |
| 828 uint16_t tempWinX0; | |
| 413 | 829 uint16_t tempWinX1; |
| 38 | 830 uint16_t tempWinY0; |
| 413 | 831 uint16_t tempWinY1; |
| 38 | 832 |
| 833 tempWinX0 = tXc1->WindowX0; | |
| 413 | 834 tempWinX1 = tXc1->WindowX1; |
| 38 | 835 tempWinY0 = tXc1->WindowY0; |
| 413 | 836 tempWinY1 = tXc1->WindowY1; |
| 38 | 837 |
| 838 tXc1->WindowX0 = 440; // rechte Seite | |
| 839 | |
| 840 switch(tX_selection_customview) | |
| 841 { | |
| 842 case CVIEW_T3_Temperature: | |
| 843 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Temperature); | |
| 844 GFX_write_string(&FontT42,tXc1,text,0); | |
| 845 | |
|
189
8b8074080d7b
Bugfix: average temperature on arrival from RTE instead of display time
Jan Mulder <jlmulder@xs4all.nl>
parents:
174
diff
changeset
|
846 temperature = unit_temperature_float(stateUsed->lifeData.temperature_celsius); |
| 38 | 847 textpointer = snprintf(text,TEXTSIZE,"\020\003\016%01.0f\016\016\140",temperature); // "\016\016%01.1f `" + C or F |
| 848 if(settingsGetPointer()->nonMetricalSystem == 0) | |
| 849 text[textpointer++] = 'C'; | |
| 850 else | |
| 851 text[textpointer++] = 'F'; | |
| 852 text[textpointer++] = 0; | |
|
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
857
diff
changeset
|
853 Gfx_colorsscheme_mod(text,0); |
| 38 | 854 GFX_write_string(&FontT105,tXc1,text,1); |
| 855 break; | |
| 856 | |
| 857 case CVIEW_T3_ApnoeSurfaceInfo: | |
| 858 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Divetime); | |
| 859 GFX_write_string(&FontT42,tXc1,text,0); | |
| 860 | |
| 861 TotalDivetime.Total = stateUsed->lifeData.dive_time_seconds_without_surface_time; | |
| 862 TotalDivetime.Minutes = TotalDivetime.Total / 60; | |
| 863 TotalDivetime.Seconds = TotalDivetime.Total - ( TotalDivetime.Minutes * 60 ); | |
| 864 | |
| 865 LastDivetime.Total = stateUsed->lifeData.apnea_last_dive_time_seconds; | |
| 866 LastDivetime.Minutes = LastDivetime.Total / 60; | |
| 867 LastDivetime.Seconds = LastDivetime.Total - ( LastDivetime.Minutes * 60 ); | |
| 868 | |
| 413 | 869 // tXc1->WindowY0 = 100; // obere Zeile |
| 870 if(!pSettings->FlipDisplay) | |
| 871 { | |
| 872 tXc1->WindowY0 = 100; | |
| 873 } | |
| 874 else | |
| 875 { | |
| 876 tXc1->WindowY1 -= 100; /* jump to upper of two lines */ | |
| 877 } | |
| 38 | 878 |
| 879 snprintf(text,TEXTSIZE,"\020\016%u:%02u",LastDivetime.Minutes, LastDivetime.Seconds); | |
|
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
857
diff
changeset
|
880 Gfx_colorsscheme_mod(text,0); |
| 38 | 881 GFX_write_string(&FontT105,tXc1,text,0); |
| 882 | |
| 413 | 883 if(pSettings->FlipDisplay) |
| 884 { | |
| 885 tXc1->WindowX0 = 0; | |
| 886 | |
| 887 } | |
| 38 | 888 snprintf(text,TEXTSIZE,"\032\002%c%c",TXT_2BYTE, TXT2BYTE_ApneaLast); |
| 889 GFX_write_string(&FontT42,tXc1,text,0); | |
| 890 | |
| 413 | 891 if(!pSettings->FlipDisplay) |
| 892 { | |
| 893 tXc1->WindowY0 = tempWinY0; | |
| 894 } | |
| 895 else | |
| 896 { | |
| 897 tXc1->WindowX1 = tempWinX1; | |
| 898 tXc1->WindowY1 = tempWinY1; /* jump to upper of two lines */ | |
| 899 } | |
| 38 | 900 |
| 901 snprintf(text,TEXTSIZE,"\020\016%u:%02u",TotalDivetime.Minutes, TotalDivetime.Seconds); | |
|
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
857
diff
changeset
|
902 Gfx_colorsscheme_mod(text,0); |
| 38 | 903 GFX_write_string(&FontT105,tXc1,text,0); |
| 904 | |
| 905 snprintf(text,TEXTSIZE,"\032\002%c%c",TXT_2BYTE, TXT2BYTE_ApneaTotal); | |
| 413 | 906 if(pSettings->FlipDisplay) |
| 907 { | |
| 908 tXc1->WindowX0 = 0; | |
| 909 | |
| 910 } | |
| 38 | 911 GFX_write_string(&FontT42,tXc1,text,0); |
| 912 break; | |
| 913 } | |
| 914 | |
| 915 tXc1->WindowX0 = tempWinX0; | |
| 413 | 916 tXc1->WindowX1 = tempWinX1; |
| 38 | 917 tXc1->WindowY0 = tempWinY0; |
| 918 | |
| 919 } | |
| 920 | |
| 921 | |
| 922 void t3_basics_refresh_customview(float depth, uint8_t tX_selection_customview, GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXc1, GFX_DrawCfgWindow* tXc2, uint8_t mode) | |
| 923 { | |
| 837 | 924 static uint8_t last_customview = CVIEW_T3_END; |
|
582
64bf41faab83
Show Fallback if no valid sensor value is available:
Ideenmodellierer
parents:
577
diff
changeset
|
925 |
| 722 | 926 char text[30]; |
| 38 | 927 uint16_t textpointer = 0; |
| 928 | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
929 SSettings* pSettings; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
930 pSettings = settingsGetPointer(); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
931 |
| 38 | 932 // CVIEW_T3_Decostop and CVIEW_T3_TTS |
|
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:
758
diff
changeset
|
933 const SDecoinfo * pDecoinfo = getDecoInfo(); |
| 38 | 934 |
| 935 // CVIEW_T3_Decostop | |
| 936 uint16_t nextstopLengthSeconds = 0; | |
| 937 uint8_t nextstopDepthMeter = 0; | |
| 938 SDivetime SafetyStopTime = {0,0,0,0}; | |
| 939 | |
| 940 // CVIEW_T3_ppO2andGas | |
| 941 uint8_t oxygen_percentage = 0; | |
| 942 | |
| 943 // CVIEW_T3_Temperature | |
| 944 float temperature; | |
| 945 | |
| 946 // CVIEW_T3_GasList | |
| 947 float fPpO2limitHigh, fPpO2limitLow, fPpO2ofGasAtThisDepth; | |
| 948 const SGasLine * pGasLine; | |
| 949 uint8_t oxygen, helium; | |
| 950 uint8_t lineNumber; | |
|
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
951 uint8_t gasPosIdx; |
| 38 | 952 |
| 496 | 953 /* compass position */ |
| 954 point_t center; | |
|
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
955 uint16_t heading; |
| 496 | 956 |
| 38 | 957 // CVIEW_T3_StopWatch |
| 958 SDivetime Stopwatch = {0,0,0,0}; | |
| 959 float fAverageDepth, fAverageDepthAbsolute; | |
| 960 | |
| 662 | 961 #ifdef ENABLE_PSCR_MODE |
| 962 uint8_t showSimPPO2 = 1; | |
| 963 #endif | |
| 38 | 964 uint16_t tempWinX0; |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
965 uint16_t tempWinX1; |
| 38 | 966 uint16_t tempWinY0; |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
967 uint16_t tempWinY1; |
| 38 | 968 uint16_t tempWinC2X0; |
| 413 | 969 uint16_t tempWinC2Y0; |
| 970 uint16_t tempWinC2X1; | |
| 971 uint16_t tempWinC2Y1; | |
| 38 | 972 uint16_t tempWinC2Tab; |
| 973 | |
| 974 tempWinX0 = tXc1->WindowX0; | |
| 975 tempWinY0 = tXc1->WindowY0; | |
| 496 | 976 tempWinX1 = tXc1->WindowX1; |
| 977 tempWinY1 = tXc1->WindowY1; | |
| 413 | 978 |
| 38 | 979 tempWinC2X0 = tXc2->WindowX0; |
| 413 | 980 tempWinC2Y0 = tXc2->WindowY0; |
| 981 tempWinC2X1 = tXc2->WindowX1; | |
| 982 tempWinC2Y1 = tXc2->WindowY1; | |
| 38 | 983 tempWinC2Tab = tXc2->WindowTab; |
| 984 | |
|
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
985 if(settingsGetPointer()->compassInertia) |
|
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
986 { |
|
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
987 heading = (uint16_t)compass_getCompensated(); |
|
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
988 } |
|
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
989 else |
|
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
990 { |
|
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
991 heading = (uint16_t)stateUsed->lifeData.compass_heading; |
|
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
992 } |
| 837 | 993 if((last_customview != tX_selection_customview) && (settingsGetPointer()->design == 3)) /* check if current selection is disabled and should be skipped */ |
|
582
64bf41faab83
Show Fallback if no valid sensor value is available:
Ideenmodellierer
parents:
577
diff
changeset
|
994 { |
|
64bf41faab83
Show Fallback if no valid sensor value is available:
Ideenmodellierer
parents:
577
diff
changeset
|
995 if(t3_customview_disabled(tX_selection_customview)) |
|
64bf41faab83
Show Fallback if no valid sensor value is available:
Ideenmodellierer
parents:
577
diff
changeset
|
996 { |
|
64bf41faab83
Show Fallback if no valid sensor value is available:
Ideenmodellierer
parents:
577
diff
changeset
|
997 tX_selection_customview = t3_change_customview(ACTION_BUTTON_ENTER); |
|
64bf41faab83
Show Fallback if no valid sensor value is available:
Ideenmodellierer
parents:
577
diff
changeset
|
998 } |
|
64bf41faab83
Show Fallback if no valid sensor value is available:
Ideenmodellierer
parents:
577
diff
changeset
|
999 last_customview = tX_selection_customview; |
|
64bf41faab83
Show Fallback if no valid sensor value is available:
Ideenmodellierer
parents:
577
diff
changeset
|
1000 } |
|
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
1001 |
| 38 | 1002 switch(tX_selection_customview) |
| 1003 { | |
| 1004 case CVIEW_T3_ApnoeSurfaceInfo: | |
| 1005 snprintf(text,TEXTSIZE,"\032\f%c",TXT_MaxDepth); | |
| 1006 | |
| 413 | 1007 if(!pSettings->FlipDisplay) |
| 1008 { | |
| 1009 GFX_write_string(&FontT42,tXc1,text,0); | |
| 1010 tXc1->WindowY0 = 100; | |
| 1011 } | |
| 1012 else | |
| 1013 { | |
| 1014 GFX_write_string(&FontT42,tXc2,text,0); | |
| 1015 tXc2->WindowY1 -= 100; /* jump to upper of two lines */ | |
| 1016 } | |
| 38 | 1017 |
| 1018 snprintf(text,TEXTSIZE,"\020\016%01.1f",unit_depth_float(stateUsed->lifeData.apnea_last_max_depth_meter)); | |
|
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
857
diff
changeset
|
1019 Gfx_colorsscheme_mod(text,0); |
| 413 | 1020 |
| 1021 if(!pSettings->FlipDisplay) | |
| 1022 { | |
| 1023 GFX_write_string(&FontT105,tXc1,text,0); | |
| 1024 tXc1->WindowY0 = tempWinY0; | |
| 1025 } | |
| 1026 else | |
| 1027 { | |
| 1028 GFX_write_string(&FontT105,tXc2,text,0); | |
| 1029 tXc2->WindowY1 = tempWinC2Y1; /* jump to upper of two lines */ | |
| 1030 } | |
| 38 | 1031 |
| 1032 | |
| 1033 snprintf(text,TEXTSIZE,"\020\016%01.1f",unit_depth_float(stateUsed->lifeData.apnea_total_max_depth_meter)); | |
|
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
857
diff
changeset
|
1034 Gfx_colorsscheme_mod(text,0); |
| 413 | 1035 if(!pSettings->FlipDisplay) |
| 1036 { | |
| 1037 GFX_write_string(&FontT105,tXc1,text,0); | |
| 1038 } | |
| 1039 else | |
| 1040 { | |
| 1041 GFX_write_string(&FontT105,tXc2,text,0); | |
| 1042 } | |
| 38 | 1043 break; |
| 1044 | |
| 1045 case CVIEW_T3_StopWatch: | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1046 |
| 38 | 1047 Stopwatch.Total = timer_Stopwatch_GetTime(); |
| 1048 Stopwatch.Minutes = Stopwatch.Total / 60; | |
| 1049 Stopwatch.Seconds = Stopwatch.Total - ( Stopwatch.Minutes * 60 ); | |
| 1050 fAverageDepth = timer_Stopwatch_GetAvarageDepth_Meter(); | |
| 1051 fAverageDepthAbsolute = stateUsed->lifeData.average_depth_meter; | |
| 1052 | |
| 1053 snprintf(text,TEXTSIZE,"\032\f%c",TXT_AvgDepth); | |
| 1054 GFX_write_string(&FontT42,tXc1,text,0); | |
| 1055 snprintf(text,TEXTSIZE,"\030\003\016%01.1f",unit_depth_float(fAverageDepthAbsolute)); | |
| 1056 GFX_write_string(&FontT105,tXc1,text,0); | |
| 1057 | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1058 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1059 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1060 tXc1->WindowX0 = 480; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1061 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1062 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1063 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1064 tXc1->WindowX1 = 320; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1065 tXc1->WindowY0 = t3c1.WindowY0; /* select customer window */ |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1066 } |
| 38 | 1067 // snprintf(text,TEXTSIZE,"\032\f%c%c - %c",TXT_2BYTE, TXT2BYTE_Clock, TXT_AvgDepth); |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1068 |
| 38 | 1069 snprintf(text,TEXTSIZE,"\032\f%c", TXT_Stopwatch); |
| 1070 GFX_write_string(&FontT42,tXc1,text,0); | |
| 1071 snprintf(text,TEXTSIZE,"\030\016%01.1f",unit_depth_float(fAverageDepth)); | |
| 1072 GFX_write_string(&FontT105,tXc1,text,0); | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1073 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1074 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1075 tXc1->WindowY0 = 100; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1076 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1077 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1078 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1079 tXc1->WindowY1 -= 100; /* jump to upper of two lines */ |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1080 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1081 |
| 38 | 1082 snprintf(text,TEXTSIZE,"\030%u:\016\016%02u",Stopwatch.Minutes, Stopwatch.Seconds); |
| 1083 GFX_write_string(&FontT105,tXc1,text,0); | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
38
diff
changeset
|
1084 |
| 496 | 1085 break; |
| 38 | 1086 |
| 1087 case CVIEW_T3_GasList: | |
|
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1088 gasPosIdx = 0; |
| 38 | 1089 snprintf(text,TEXTSIZE,"\032\f%c%c",TXT_2BYTE, TXT2BYTE_Gaslist); |
| 1090 GFX_write_string(&FontT42,tXc1,text,0); | |
| 1091 | |
| 1092 textpointer = 0; | |
| 1093 tXc2->WindowX0 = 0; | |
| 518 | 1094 tXc2->WindowTab = 800/3; // /2 |
| 38 | 1095 |
| 413 | 1096 if(pSettings->FlipDisplay) |
| 1097 { | |
| 1098 tXc2->WindowY1 = 0; | |
| 1099 } | |
| 1100 | |
| 38 | 1101 pGasLine = settingsGetPointer()->gas; |
| 1102 if(actualLeftMaxDepth(stateUsed)) | |
| 1103 fPpO2limitHigh = (float)(settingsGetPointer()->ppO2_max_deco) / 100; | |
| 1104 else | |
| 1105 fPpO2limitHigh = (float)(settingsGetPointer()->ppO2_max_std) / 100; | |
| 1106 fPpO2limitLow = (float)(settingsGetPointer()->ppO2_min) / 100; | |
| 1107 for(int gasId=1;gasId<=NUM_GASES;gasId++) | |
| 1108 { | |
|
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1109 #ifdef ENABLE_UNUSED_GAS_HIDING |
|
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1110 if(!pGasLine[gasId].note.ub.off) |
|
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1111 { |
|
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1112 #endif |
| 38 | 1113 textpointer = 0; |
| 518 | 1114 text[textpointer++] = '\003'; |
|
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1115 |
|
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1116 lineNumber = 1; |
|
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1117 |
|
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1118 switch(gasPosIdx) |
| 38 | 1119 { |
|
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1120 case 0: lineNumber = 0; |
|
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1121 case 1: |
|
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1122 break; |
|
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1123 case 4: text[textpointer++] = '\001'; /* display centered */ |
|
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1124 break; |
|
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1125 case 2: lineNumber = 0; |
|
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1126 case 3: text[textpointer++] = '\002'; /* display right aligned */ |
|
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1127 default: |
|
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1128 break; |
| 38 | 1129 } |
|
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1130 gasPosIdx++; |
| 518 | 1131 |
| 38 | 1132 fPpO2ofGasAtThisDepth = (stateUsed->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * pGasLine[gasId].oxygen_percentage / 100; |
| 1133 if(pGasLine[gasId].note.ub.active == 0) | |
|
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1134 strcpy(&text[textpointer++],"\031"); |
| 518 | 1135 else if(stateUsed->lifeData.actualGas.GasIdInSettings == gasId) /* actual selected gas */ |
| 1136 { | |
| 1137 strcpy(&text[textpointer++],"\030"); | |
| 1138 } | |
| 38 | 1139 else if((fPpO2ofGasAtThisDepth > fPpO2limitHigh) || (fPpO2ofGasAtThisDepth < fPpO2limitLow)) |
| 1140 strcpy(&text[textpointer++],"\025"); | |
| 518 | 1141 else if(actualBetterGasId() == gasId) |
| 1142 { | |
| 1143 strcpy(&text[textpointer++],"\026"); /* Highlight better gas */ | |
| 1144 } | |
| 38 | 1145 else |
| 518 | 1146 strcpy(&text[textpointer++],"\023"); /* Blue for travel or deco without special state */ |
| 38 | 1147 |
| 1148 text[textpointer++] = ' '; | |
| 1149 oxygen = pGasLine[gasId].oxygen_percentage; | |
| 1150 helium = pGasLine[gasId].helium_percentage; | |
| 1151 textpointer += write_gas(&text[textpointer], oxygen, helium); | |
|
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1152 |
|
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1153 if((pGasLine[gasId].depth_meter) && (gasPosIdx < 5)) /* do not show for potential last gas because of formating issues */ |
|
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1154 { |
|
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1155 textpointer += snprintf(&text[textpointer],7,"\016\016%u%c%c",unit_depth_integer(pGasLine[gasId].depth_meter), unit_depth_char1(), unit_depth_char2()); |
|
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1156 } |
|
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1157 text[textpointer++] = 0; |
| 518 | 1158 GFX_write_string(&FontT42, tXc1, text, lineNumber); |
|
527
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1159 #ifdef ENABLE_UNUSED_GAS_HIDING |
|
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1160 } |
|
962d7b2c18c6
Do not show gases in "Off" state in custom gas list:
Ideenmodellierer
parents:
518
diff
changeset
|
1161 #endif |
| 38 | 1162 } |
| 1163 break; | |
| 1164 | |
| 1165 case CVIEW_T3_Temperature: | |
| 1166 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Temperature); | |
| 1167 GFX_write_string(&FontT42,tXc1,text,0); | |
|
189
8b8074080d7b
Bugfix: average temperature on arrival from RTE instead of display time
Jan Mulder <jlmulder@xs4all.nl>
parents:
174
diff
changeset
|
1168 |
|
8b8074080d7b
Bugfix: average temperature on arrival from RTE instead of display time
Jan Mulder <jlmulder@xs4all.nl>
parents:
174
diff
changeset
|
1169 temperature = unit_temperature_float(stateUsed->lifeData.temperature_celsius); |
| 38 | 1170 textpointer = snprintf(text,TEXTSIZE,"\030\003\016%01.1f \140",temperature); // "\016\016%01.1f `" + C or F |
| 1171 if(settingsGetPointer()->nonMetricalSystem == 0) | |
| 1172 text[textpointer++] = 'C'; | |
| 1173 else | |
| 1174 text[textpointer++] = 'F'; | |
| 1175 text[textpointer++] = 0; | |
| 1176 GFX_write_string(&FontT105,tXc1,text,0); | |
| 1177 break; | |
| 1178 | |
| 1179 case CVIEW_Compass: | |
| 496 | 1180 center.x = 600; |
| 1181 center.y = 116; | |
| 38 | 1182 snprintf(text,TEXTSIZE,"\032\f%c%c",TXT_2BYTE, TXT2BYTE_Compass); |
| 1183 GFX_write_string(&FontT42,tXc1,text,0); | |
|
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
1184 snprintf(text,100,"\030\003%03i`",heading); |
| 38 | 1185 GFX_write_string(&FontT105,tXc1,text,0); |
|
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
1186 t3_basics_compass(tXscreen, center, heading, stateUsed->diveSettings.compassHeading); |
| 38 | 1187 break; |
| 601 | 1188 #ifdef ENABLE_T3_PROFILE_VIEW |
|
592
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
1189 case CVIEW_T3_Profile: |
| 599 | 1190 snprintf(text,100,"\032\f\002%c%c",TXT_2BYTE,TXT2BYTE_Profile); |
|
592
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
1191 GFX_write_string(&FontT42,tXc1,text,0); |
|
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
1192 t3_miniLiveLogProfile(); |
|
f52bc70e380f
MotionCtrl - Sectorview Map sectors directly to custom views:
Ideenmodellierer
parents:
582
diff
changeset
|
1193 break; |
| 601 | 1194 #endif |
|
542
6960df7ddb09
Added new t3 view showing first deco stop and tts in parallel:
Ideenmodellierer
parents:
541
diff
changeset
|
1195 case CVIEW_T3_DecoTTS: |
| 38 | 1196 case CVIEW_T3_Decostop: |
| 1197 default: | |
| 1198 // decostop | |
| 1199 if(pDecoinfo->output_time_to_surface_seconds) | |
| 1200 { | |
| 1201 tHome_findNextStop(pDecoinfo->output_stop_length_seconds, &nextstopDepthMeter, &nextstopLengthSeconds); | |
| 1202 } | |
| 1203 else | |
| 1204 { | |
| 1205 nextstopDepthMeter = 0; | |
| 1206 nextstopLengthSeconds = 0; | |
| 1207 } | |
| 1208 | |
| 1209 SafetyStopTime.Total = timer_Safetystop_GetCountDown(); | |
| 1210 SafetyStopTime.Minutes = SafetyStopTime.Total / 60; | |
| 1211 SafetyStopTime.Seconds = SafetyStopTime.Total - (SafetyStopTime.Minutes * 60); | |
| 1212 | |
| 1213 if(nextstopDepthMeter) | |
| 1214 { | |
| 1215 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Decostop); | |
| 1216 GFX_write_string(&FontT42,tXc1,text,0); | |
| 1217 | |
| 1218 textpointer = 0; | |
| 1219 snprintf(&text[textpointer],TEXTSIZE,"\020\003%u%c%c %u'" | |
|
542
6960df7ddb09
Added new t3 view showing first deco stop and tts in parallel:
Ideenmodellierer
parents:
541
diff
changeset
|
1220 , unit_depth_integer(nextstopDepthMeter) |
|
6960df7ddb09
Added new t3 view showing first deco stop and tts in parallel:
Ideenmodellierer
parents:
541
diff
changeset
|
1221 , unit_depth_char1_T105() |
|
6960df7ddb09
Added new t3 view showing first deco stop and tts in parallel:
Ideenmodellierer
parents:
541
diff
changeset
|
1222 , unit_depth_char2_T105() |
|
6960df7ddb09
Added new t3 view showing first deco stop and tts in parallel:
Ideenmodellierer
parents:
541
diff
changeset
|
1223 , (nextstopLengthSeconds+59)/60); |
|
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
857
diff
changeset
|
1224 Gfx_colorsscheme_mod(text,0); |
|
542
6960df7ddb09
Added new t3 view showing first deco stop and tts in parallel:
Ideenmodellierer
parents:
541
diff
changeset
|
1225 GFX_write_string(&FontT105,tXc1,text,0); |
| 38 | 1226 } |
| 1227 else if(SafetyStopTime.Total && (depth > timer_Safetystop_GetDepthUpperLimit())) | |
| 1228 { | |
| 1229 textpointer = 0; | |
| 1230 snprintf(&text[textpointer],TEXTSIZE,"\032\f%c%c",TXT_2BYTE,TXT2BYTE_SafetyStop2); | |
| 1231 GFX_write_string(&FontT42,tXc1,text,0); | |
| 1232 | |
| 1233 textpointer = 0; | |
| 1234 snprintf(&text[textpointer],TEXTSIZE,"\020\003\016%u:%02u",SafetyStopTime.Minutes,SafetyStopTime.Seconds); | |
|
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
857
diff
changeset
|
1235 Gfx_colorsscheme_mod(text,0); |
| 496 | 1236 GFX_write_string(&FontT105,tXc1,text,0); |
| 38 | 1237 } |
|
237
ec16fd26e280
Bugfix: do not show NDL in bigscreen mode when zero
Jan Mulder <jlmulder@xs4all.nl>
parents:
214
diff
changeset
|
1238 else if(pDecoinfo->output_ndl_seconds) // NDL |
| 38 | 1239 { |
| 1240 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Nullzeit); | |
| 1241 GFX_write_string(&FontT42,tXc1,text,0); | |
| 1242 if(pDecoinfo->output_ndl_seconds < 1000 * 60) | |
| 1243 snprintf(text,TEXTSIZE,"\020\003%i'",pDecoinfo->output_ndl_seconds/60); | |
| 1244 else | |
| 1245 snprintf(text,TEXTSIZE,"\020\003%ih",pDecoinfo->output_ndl_seconds/3600); | |
|
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
857
diff
changeset
|
1246 Gfx_colorsscheme_mod(text,0); |
| 496 | 1247 GFX_write_string(&FontT105,tXc1,text,0); |
| 38 | 1248 } |
|
542
6960df7ddb09
Added new t3 view showing first deco stop and tts in parallel:
Ideenmodellierer
parents:
541
diff
changeset
|
1249 |
|
6960df7ddb09
Added new t3 view showing first deco stop and tts in parallel:
Ideenmodellierer
parents:
541
diff
changeset
|
1250 if(tX_selection_customview == CVIEW_T3_DecoTTS) /* add tts data on right side of screen */ |
|
6960df7ddb09
Added new t3 view showing first deco stop and tts in parallel:
Ideenmodellierer
parents:
541
diff
changeset
|
1251 { |
|
6960df7ddb09
Added new t3 view showing first deco stop and tts in parallel:
Ideenmodellierer
parents:
541
diff
changeset
|
1252 if(pDecoinfo->output_time_to_surface_seconds) |
|
6960df7ddb09
Added new t3 view showing first deco stop and tts in parallel:
Ideenmodellierer
parents:
541
diff
changeset
|
1253 { |
| 722 | 1254 snprintf(text,TEXTSIZE,"\002\032\f%c",TXT_TTS); |
| 1255 GFX_write_string(&FontT42,tXc1,text,0); | |
| 1256 if(pDecoinfo->output_time_to_surface_seconds) | |
| 1257 { | |
| 1258 if(pDecoinfo->output_time_to_surface_seconds < 100 * 60) | |
| 1259 snprintf(text,TEXTSIZE,"\020\003\002%i'",(pDecoinfo->output_time_to_surface_seconds + 59)/ 60); | |
| 1260 else | |
| 1261 snprintf(text,TEXTSIZE,"\020\003\002%ih",(pDecoinfo->output_time_to_surface_seconds + 59)/ 3600); | |
|
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
857
diff
changeset
|
1262 Gfx_colorsscheme_mod(text,0); |
| 722 | 1263 GFX_write_string(&FontT105,tXc1,text,0); |
| 1264 } | |
| 1265 } | |
| 1266 else if(pDecoinfo->super_saturation > 0.1) | |
| 1267 { | |
| 1268 snprintf(text,TEXTSIZE,"\002\032\f%c",TXT_ActualGradient); | |
| 1269 GFX_write_string(&FontT42,tXc1,text,0); | |
| 1270 snprintf(text,TEXTSIZE,"\020\003\002%.0f\016\016%%\017",100 * pDecoinfo->super_saturation); | |
|
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
857
diff
changeset
|
1271 Gfx_colorsscheme_mod(text,0); |
|
542
6960df7ddb09
Added new t3 view showing first deco stop and tts in parallel:
Ideenmodellierer
parents:
541
diff
changeset
|
1272 GFX_write_string(&FontT105,tXc1,text,0); |
|
6960df7ddb09
Added new t3 view showing first deco stop and tts in parallel:
Ideenmodellierer
parents:
541
diff
changeset
|
1273 } |
|
6960df7ddb09
Added new t3 view showing first deco stop and tts in parallel:
Ideenmodellierer
parents:
541
diff
changeset
|
1274 } |
| 38 | 1275 break; |
| 1276 | |
| 837 | 1277 case CVIEW_T3_sensors: |
| 38 | 1278 snprintf(text,TEXTSIZE,"\032\f%c%c",TXT_2BYTE,TXT2BYTE_O2monitor); |
| 1279 GFX_write_string(&FontT42,tXc1,text,0); | |
| 1280 | |
| 1281 for(int i=0;i<3;i++) | |
| 1282 { | |
| 1283 textpointer = 0; | |
| 1284 text[textpointer++] = '\030'; | |
| 1285 if(i==1) | |
|
564
5e0a75e2f00b
Bugfix One or more deactivated sensors hide sensor display:
Ideenmodellierer
parents:
553
diff
changeset
|
1286 text[textpointer++] = '\001'; /* center */ |
| 38 | 1287 else if(i==2) |
|
564
5e0a75e2f00b
Bugfix One or more deactivated sensors hide sensor display:
Ideenmodellierer
parents:
553
diff
changeset
|
1288 text[textpointer++] = '\002'; /* right */ |
|
5e0a75e2f00b
Bugfix One or more deactivated sensors hide sensor display:
Ideenmodellierer
parents:
553
diff
changeset
|
1289 |
|
577
9bb9a52d6ae5
Handle o2 voltage values < 0.5mV as invalid:
Ideenmodellierer
parents:
564
diff
changeset
|
1290 if((stateUsed->diveSettings.ppo2sensors_deactivated & (1<<i)) || (stateUsed->lifeData.ppO2Sensor_bar[i] == 0.0)) |
| 38 | 1291 { |
| 662 | 1292 #ifdef ENABLE_PSCR_MODE |
| 1293 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 */ | |
| 1294 { | |
| 1295 text[textpointer++] = '\023'; | |
| 1296 textpointer += snprintf(&text[textpointer],TEXTSIZE,"%.2f",stateUsed->lifeData.ppo2Simulated_bar); | |
| 1297 showSimPPO2 = 0; | |
| 1298 } | |
| 1299 else | |
| 1300 #endif | |
| 1301 { | |
| 1302 text[textpointer++] = '\031'; | |
| 1303 text[textpointer++] = ' '; | |
| 1304 text[textpointer++] = '-'; | |
| 1305 text[textpointer++] = ' '; | |
| 1306 text[textpointer++] = 0; | |
| 1307 } | |
| 38 | 1308 } |
| 1309 else | |
| 1310 { | |
| 1311 if(stateUsed->warnings.sensorOutOfBounds[i]) | |
| 1312 text[textpointer++] = '\025'; | |
|
564
5e0a75e2f00b
Bugfix One or more deactivated sensors hide sensor display:
Ideenmodellierer
parents:
553
diff
changeset
|
1313 textpointer += snprintf(&text[textpointer],TEXTSIZE,"%.2f",stateUsed->lifeData.ppO2Sensor_bar[i]); |
| 38 | 1314 } |
|
564
5e0a75e2f00b
Bugfix One or more deactivated sensors hide sensor display:
Ideenmodellierer
parents:
553
diff
changeset
|
1315 GFX_write_string(&FontT105,tXc1,text,0); |
| 656 | 1316 |
| 828 | 1317 if((pSettings->co2_sensor_active) && isLoopMode(pSettings->dive_mode)) |
| 1318 { | |
| 1319 snprintf(text,TEXTSIZE,"\032\001\f%c",TXT_CO2Sensor); | |
| 1320 GFX_write_string(&FontT42,tXc1,text,0); | |
| 1321 textpointer = 0; | |
| 1322 if(stateUsed->lifeData.CO2_data.CO2_ppm < CO2_WARNING_LEVEL_PPM) | |
| 1323 { | |
| 1324 text[textpointer++] = '\020'; | |
| 1325 } | |
| 1326 else if(stateUsed->lifeData.CO2_data.CO2_ppm < CO2_ALARM_LEVEL_PPM) | |
| 1327 { | |
| 1328 text[textpointer++] = '\024'; /* yellow */ | |
| 1329 } | |
| 1330 else | |
| 1331 { | |
| 1332 text[textpointer++] = '\025'; /* red */ | |
| 1333 } | |
| 1334 snprintf(&text[textpointer],TEXTSIZE,"\001%5ld",stateUsed->lifeData.CO2_data.CO2_ppm); | |
| 1335 GFX_write_string(&FontT105,tXc1,text,1); | |
| 1336 } | |
| 656 | 1337 |
|
1014
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
1338 if (isScrubberTimerEnabled(pSettings)) { |
| 656 | 1339 snprintf(text,TEXTSIZE,"\032\002\f%c",TXT_ScrubTime); |
| 1340 GFX_write_string(&FontT42,tXc1,text,0); | |
| 1341 | |
|
758
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
755
diff
changeset
|
1342 textpointer = 0; |
|
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
755
diff
changeset
|
1343 text[textpointer++] = '\002'; |
|
1014
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
1344 textpointer += printScrubberText(&text[textpointer], 10, stateUsed->scrubberDataDive, pSettings, false); |
| 656 | 1345 GFX_write_string(&FontT105,tXc1,text,1); |
| 1346 } | |
| 38 | 1347 } |
| 1348 break; | |
| 1349 | |
| 1350 case CVIEW_T3_MaxDepth: | |
| 1351 snprintf(text,TEXTSIZE,"\032\f%c",TXT_MaxDepth); | |
| 413 | 1352 if(pSettings->FlipDisplay) |
| 1353 { | |
| 1354 if(mode == DIVEMODE_Apnea) | |
| 1355 { | |
| 1356 GFX_write_string(&FontT42,tXc2,text,0); | |
| 1357 } | |
| 1358 else | |
| 1359 { | |
| 1360 GFX_write_string(&FontT42,tXc1,text,0); | |
| 1361 } | |
| 1362 } | |
| 1363 else | |
| 1364 { | |
| 1365 GFX_write_string(&FontT42,tXc1,text,0); | |
| 1366 } | |
| 38 | 1367 snprintf(text,TEXTSIZE,"\020\003\016%01.1f",unit_depth_float(stateUsed->lifeData.max_depth_meter)); |
|
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
857
diff
changeset
|
1368 Gfx_colorsscheme_mod(text,0); |
| 413 | 1369 if(pSettings->FlipDisplay) |
| 1370 { | |
| 1371 if(mode == DIVEMODE_Apnea) | |
| 1372 { | |
| 1373 GFX_write_string(&FontT105,tXc2,text,0); | |
| 1374 } | |
| 1375 else | |
| 1376 { | |
| 1377 GFX_write_string(&FontT105,tXc1,text,0); | |
| 1378 } | |
| 1379 } | |
| 1380 else | |
| 1381 { | |
| 496 | 1382 GFX_write_string(&FontT105,tXc1,text,0); |
| 413 | 1383 } |
| 38 | 1384 break; |
| 1385 | |
| 1386 case CVIEW_T3_TTS: | |
| 1387 snprintf(text,TEXTSIZE,"\032\f%c",TXT_TTS); | |
| 1388 GFX_write_string(&FontT42,tXc1,text,0); | |
| 1389 if(pDecoinfo->output_time_to_surface_seconds) | |
| 1390 { | |
| 1391 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:
189
diff
changeset
|
1392 snprintf(text,TEXTSIZE,"\020\003\002%i'",(pDecoinfo->output_time_to_surface_seconds + 59)/ 60); |
| 38 | 1393 else |
|
214
51a3aeffc6b3
Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents:
189
diff
changeset
|
1394 snprintf(text,TEXTSIZE,"\020\003\002%ih",(pDecoinfo->output_time_to_surface_seconds + 59)/ 3600); |
|
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
857
diff
changeset
|
1395 Gfx_colorsscheme_mod(text,0); |
| 496 | 1396 GFX_write_string(&FontT105,tXc1,text,0); |
| 38 | 1397 } |
| 1398 break; | |
| 1399 | |
| 1400 case CVIEW_T3_ppO2andGas: | |
| 1401 snprintf(text,TEXTSIZE,"\032\f%c",TXT_ppO2); | |
| 1402 GFX_write_string(&FontT42,tXc1,text,0); | |
| 1403 snprintf(text,TEXTSIZE,"\020\003%01.2f",stateUsed->lifeData.ppO2); | |
|
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
857
diff
changeset
|
1404 Gfx_colorsscheme_mod(text,0); |
| 496 | 1405 GFX_write_string(&FontT105,tXc1,text,0); |
| 38 | 1406 |
| 1407 textpointer = 0; | |
| 1408 text[textpointer++] = '\020'; | |
| 1409 text[textpointer++] = '\003'; | |
| 1410 oxygen_percentage = 100; | |
| 1411 oxygen_percentage -= stateUsed->lifeData.actualGas.nitrogen_percentage; | |
| 1412 oxygen_percentage -= stateUsed->lifeData.actualGas.helium_percentage; | |
| 1413 text[textpointer++] = '\002'; | |
| 1414 tHome_gas_writer(oxygen_percentage,stateUsed->lifeData.actualGas.helium_percentage,&text[textpointer]); | |
| 1415 //textpointer = snprintf(&text[textpointer],TEXTSIZE,"\020\002%02u/%02u",oxygen_percentage, stateUsed->lifeData.actualGas.helium_percentage); | |
|
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
857
diff
changeset
|
1416 Gfx_colorsscheme_mod(text,0); |
| 496 | 1417 GFX_write_string(&FontT48,tXc1,text,0); |
| 38 | 1418 break; |
| 496 | 1419 |
| 1420 case CVIEW_T3_Navigation: | |
| 1421 Stopwatch.Total = timer_Stopwatch_GetTime(); | |
| 1422 Stopwatch.Minutes = Stopwatch.Total / 60; | |
| 1423 Stopwatch.Seconds = Stopwatch.Total - ( Stopwatch.Minutes * 60 ); | |
| 1424 fAverageDepth = timer_Stopwatch_GetAvarageDepth_Meter(); | |
| 1425 | |
| 1426 if(!pSettings->FlipDisplay) | |
| 1427 { | |
| 1428 tXc2->WindowX0 = 550; | |
| 1429 } | |
| 1430 else | |
| 1431 { | |
| 1432 tXc2->WindowX1 = 800; | |
| 1433 tXc2->WindowY0 = t3c2.WindowY0; /* select customer window */ | |
| 1434 } | |
| 1435 | |
| 1436 snprintf(text,TEXTSIZE,"\032\002\f%c", TXT_Stopwatch); | |
| 511 | 1437 GFX_write_string(&FontT42,tXc1,text,0); |
|
564
5e0a75e2f00b
Bugfix One or more deactivated sensors hide sensor display:
Ideenmodellierer
parents:
553
diff
changeset
|
1438 snprintf(text,TEXTSIZE,"\030\002\016%01.1f",unit_depth_float(fAverageDepth)); |
| 511 | 1439 GFX_write_string(&FontT105,tXc1,text,0); |
| 496 | 1440 if(!pSettings->FlipDisplay) |
| 1441 { | |
| 1442 tXc2->WindowY0 = 100; | |
| 1443 } | |
| 1444 else | |
| 1445 { | |
| 1446 tXc2->WindowY1 -= 100; /* jump to upper of two lines */ | |
| 1447 } | |
| 1448 | |
| 1449 snprintf(text,TEXTSIZE,"\030\002%u:\016\016%02u",Stopwatch.Minutes, Stopwatch.Seconds); | |
| 511 | 1450 GFX_write_string(&FontT105,tXc1,text,1); |
| 496 | 1451 |
| 1452 | |
| 1453 center.x = 400; | |
| 1454 center.y = 116; | |
| 1455 | |
| 1456 snprintf(text,TEXTSIZE,"\032\f%c%c",TXT_2BYTE, TXT2BYTE_Compass); | |
| 1457 GFX_write_string(&FontT42,tXc1,text,0); | |
|
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
1458 snprintf(text,100,"\030%03i`",heading); |
| 496 | 1459 GFX_write_string(&FontT144,tXc1,text,0); |
|
539
d784f281833a
Added inertia simulation for compass heading:
Ideenmodellierer
parents:
529
diff
changeset
|
1460 t3_basics_compass(tXscreen, center, heading, stateUsed->diveSettings.compassHeading); |
| 496 | 1461 |
| 1462 break; | |
| 1463 | |
| 1464 case CVIEW_T3_DepthData: | |
| 1465 snprintf(text,TEXTSIZE,"\032\f%c",TXT_MaxDepth); | |
| 1466 if(pSettings->FlipDisplay) | |
| 1467 { | |
| 1468 if(mode == DIVEMODE_Apnea) | |
| 1469 { | |
| 1470 GFX_write_string(&FontT42,tXc2,text,0); | |
| 1471 } | |
| 1472 else | |
| 1473 { | |
| 1474 GFX_write_string(&FontT42,tXc1,text,0); | |
| 1475 } | |
| 1476 } | |
| 1477 else | |
| 1478 { | |
| 1479 GFX_write_string(&FontT42,tXc1,text,0); | |
| 1480 } | |
| 1481 snprintf(text,TEXTSIZE,"\020\003\016%01.1f",unit_depth_float(stateUsed->lifeData.max_depth_meter)); | |
|
868
db92692c014f
Introduce speed dependend coloring of depth:
Ideenmodellierer
parents:
857
diff
changeset
|
1482 Gfx_colorsscheme_mod(text,0); |
| 496 | 1483 if(pSettings->FlipDisplay) |
| 1484 { | |
| 1485 if(mode == DIVEMODE_Apnea) | |
| 1486 { | |
| 1487 GFX_write_string(&FontT105,tXc2,text,0); | |
| 1488 } | |
| 1489 else | |
| 1490 { | |
| 1491 GFX_write_string(&FontT105,tXc1,text,0); | |
| 1492 } | |
| 1493 } | |
| 1494 else | |
| 1495 { | |
| 1496 GFX_write_string(&FontT105,tXc1,text,0); | |
| 1497 } | |
| 1498 fAverageDepthAbsolute = stateUsed->lifeData.average_depth_meter; | |
| 1499 snprintf(text,TEXTSIZE,"\032\002\f%c",TXT_AvgDepth); | |
| 511 | 1500 GFX_write_string(&FontT42,tXc1,text,0); |
| 496 | 1501 |
|
564
5e0a75e2f00b
Bugfix One or more deactivated sensors hide sensor display:
Ideenmodellierer
parents:
553
diff
changeset
|
1502 snprintf(text,TEXTSIZE,"\020\003\002\016\%01.1f",unit_depth_float(fAverageDepthAbsolute)); |
| 511 | 1503 GFX_write_string(&FontT105,tXc1,text,0); |
| 496 | 1504 break; |
| 38 | 1505 } |
| 496 | 1506 |
| 1507 | |
| 1508 | |
| 38 | 1509 tXc1->WindowX0 = tempWinX0; |
| 1510 tXc1->WindowY0 = tempWinY0; | |
| 496 | 1511 tXc1->WindowX1 = tempWinX1; |
| 1512 tXc1->WindowY1 = tempWinY1; | |
| 413 | 1513 |
| 38 | 1514 tXc2->WindowX0 = tempWinC2X0; |
| 413 | 1515 tXc2->WindowY0 = tempWinC2Y0; |
| 1516 tXc2->WindowX1 = tempWinC2X1; | |
| 1517 tXc2->WindowY1 = tempWinC2Y1; | |
| 38 | 1518 tXc2->WindowTab = tempWinC2Tab; |
| 1519 } | |
| 1520 | |
| 1521 | |
| 1522 uint8_t t3_test_customview_warnings(void) | |
| 1523 { | |
| 1524 uint8_t count = 0; | |
| 1525 | |
| 1526 count = 0; | |
| 1527 count += stateUsed->warnings.decoMissed; | |
| 1528 count += stateUsed->warnings.ppO2Low; | |
| 1529 count += stateUsed->warnings.ppO2High; | |
| 1530 //count += stateUsed->warnings.lowBattery; | |
| 1531 count += stateUsed->warnings.sensorLinkLost; | |
| 1532 count += stateUsed->warnings.fallback; | |
| 1533 | |
| 1534 return count; | |
| 1535 } | |
| 1536 | |
| 1537 //void t3_show_customview_warnings(GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXl1, GFX_DrawCfgWindow* tXr1, uint8_t mode) | |
| 1538 void t3_basics_show_customview_warnings(GFX_DrawCfgWindow* tXc1) | |
| 1539 { | |
| 1540 char text[256], textMain[256]; | |
| 1541 uint8_t textpointer, textpointerMain, lineFree, more; | |
| 951 | 1542 #ifdef HAVE_DEBUG_WARNINGS |
| 857 | 1543 uint8_t index = 0; |
| 951 | 1544 #endif |
| 38 | 1545 |
| 1546 snprintf(text,TEXTSIZE,"\025\f%c",TXT_Warning); | |
| 1547 GFX_write_string(&FontT42,&t3c1,text,0); | |
| 1548 | |
| 1549 lineFree = 1; | |
| 1550 more = 0; | |
| 1551 | |
| 1552 textpointerMain = 0; | |
| 511 | 1553 textMain[textpointerMain++] = '\025'; /* red */ |
| 1554 textMain[textpointerMain++] = '\003'; /* doublesize */ | |
|
755
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1555 textMain[textpointerMain++] = TXT_2BYTE; /* There is only one Main warning to be displayed */ |
| 38 | 1556 |
| 1557 textpointer = 0; | |
|
755
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1558 text[textpointer++] = '\025'; /* red */ |
| 38 | 1559 |
| 1560 if(stateUsed->warnings.decoMissed) | |
| 1561 { | |
| 1562 if(lineFree) | |
| 1563 { | |
|
755
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1564 textMain[textpointerMain++] = TXT2BYTE_WarnDecoMissed; |
| 38 | 1565 lineFree--; |
| 1566 } | |
| 1567 else | |
| 1568 { | |
|
755
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1569 text[textpointer++] = '\002'; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1570 text[textpointer++] = TXT_2BYTE; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1571 text[textpointer++] = TXT2BYTE_WarnDecoMissed; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1572 text[textpointer++] = '\r'; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1573 text[textpointer++] = '\n'; |
| 38 | 1574 more++; |
| 1575 } | |
| 1576 } | |
| 1577 | |
| 1578 if(stateUsed->warnings.ppO2Low) | |
| 1579 { | |
| 1580 if(lineFree) | |
| 1581 { | |
|
755
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1582 textMain[textpointerMain++] = TXT2BYTE_WarnPPO2Low; |
| 38 | 1583 lineFree--; |
| 1584 } | |
| 1585 else | |
| 1586 { | |
|
755
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1587 text[textpointer++] = '\002'; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1588 text[textpointer++] = TXT_2BYTE; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1589 text[textpointer++] = TXT2BYTE_WarnPPO2Low; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1590 text[textpointer++] = '\r'; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1591 text[textpointer++] = '\n'; |
| 38 | 1592 more++; |
| 1593 } | |
| 1594 } | |
| 1595 | |
| 1596 if(stateUsed->warnings.ppO2High) | |
| 1597 { | |
| 1598 if(lineFree) | |
| 1599 { | |
|
755
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1600 textMain[textpointerMain++] = TXT2BYTE_WarnPPO2High; |
| 38 | 1601 lineFree--; |
| 1602 } | |
| 1603 else | |
| 1604 { | |
|
755
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1605 text[textpointer++] = '\002'; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1606 text[textpointer++] = TXT_2BYTE; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1607 text[textpointer++] = TXT2BYTE_WarnPPO2High; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1608 text[textpointer++] = '\r'; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1609 text[textpointer++] = '\n'; |
| 38 | 1610 more++; |
| 1611 } | |
| 1612 } | |
| 1613 | |
| 1614 if(stateUsed->warnings.fallback) | |
| 1615 { | |
| 1616 if(lineFree) | |
| 1617 { | |
|
755
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1618 textMain[textpointerMain++] = TXT2BYTE_WarnFallback; |
| 38 | 1619 lineFree--; |
| 1620 } | |
| 1621 else | |
| 1622 { | |
|
755
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1623 text[textpointer++] = '\002'; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1624 text[textpointer++] = TXT_2BYTE; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1625 text[textpointer++] = TXT2BYTE_WarnFallback; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1626 text[textpointer++] = '\r'; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1627 text[textpointer++] = '\n'; |
| 38 | 1628 more++; |
| 1629 } | |
| 1630 } | |
| 1631 | |
| 1632 if(stateUsed->warnings.sensorLinkLost) | |
| 1633 { | |
| 1634 if(lineFree) | |
| 1635 { | |
|
755
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1636 textMain[textpointerMain++] = TXT2BYTE_WarnSensorLinkLost; |
| 38 | 1637 lineFree--; |
| 1638 } | |
| 1639 else | |
| 1640 { | |
|
755
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1641 text[textpointer++] = '\002'; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1642 text[textpointer++] = TXT_2BYTE; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1643 text[textpointer++] = TXT2BYTE_WarnSensorLinkLost; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1644 text[textpointer++] = '\r'; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1645 text[textpointer++] = '\n'; |
| 38 | 1646 more++; |
| 1647 } | |
| 1648 } | |
| 1649 | |
|
755
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1650 if(stateUsed->warnings.co2High) |
| 38 | 1651 { |
| 1652 if(lineFree) | |
| 1653 { | |
|
755
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1654 textMain[textpointerMain++] = TXT2BYTE_WarnCO2High; |
| 38 | 1655 } |
| 1656 else | |
| 1657 { | |
|
755
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1658 text[textpointer++] = '\002'; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1659 text[textpointer++] = TXT_2BYTE; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1660 text[textpointer++] = TXT2BYTE_WarnCO2High; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1661 text[textpointer++] = '\r'; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1662 text[textpointer++] = '\n'; |
| 38 | 1663 more++; |
| 1664 } | |
| 1665 } | |
| 857 | 1666 #ifdef HAVE_DEBUG_WARNINGS |
| 1667 if(lineFree && stateUsed->warnings.debug) | |
| 1668 { | |
| 1669 for(index=0; index<3; index++) | |
| 1670 { | |
| 1671 if(((stateUsed->lifeData.extIf_sensor_map[index] == SENSOR_DIGO2M) && (((SSensorDataDiveO2*)(stateUsed->lifeData.extIf_sensor_data[index]))->status & DVO2_FATAL_ERROR))) | |
| 1672 { | |
| 1673 textpointer += snprintf(&text[textpointer],32,"\001Debug: %lx\n",((SSensorDataDiveO2*)(stateUsed->lifeData.extIf_sensor_data[index]))->status); | |
| 1674 } | |
| 1675 } | |
| 1676 lineFree--; | |
| 1677 } | |
| 1678 #endif | |
| 38 | 1679 text[textpointer] = 0; |
|
755
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1680 textMain[textpointerMain] = 0; |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1681 |
|
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1682 if(lineFree == 0) |
| 38 | 1683 { |
|
755
92bf7bf9fb8a
Cleanup display of multiple warnings in T3 (Big font) view:
Ideenmodellierer
parents:
739
diff
changeset
|
1684 GFX_write_string(&FontT48,&t3c1,textMain,0); |
| 38 | 1685 } |
| 1686 if(more) | |
| 1687 { | |
| 511 | 1688 GFX_write_string(&FontT48,&t3c2,text,0); |
| 38 | 1689 } |
| 996 | 1690 requestBuzzerActivation(REQUEST_BUZZER_CONTINUOUS); |
| 38 | 1691 } |
| 1692 | |
| 496 | 1693 uint8_t t3_customview_disabled(uint8_t view) |
| 1694 { | |
| 1695 uint8_t i = 0; | |
| 1696 uint8_t cv_disabled = 0; | |
| 1697 const uint8_t *pcv_changelist; | |
| 1698 uint32_t cv_config = settingsGetPointer()->cv_config_BigScreen; | |
| 1699 | |
| 511 | 1700 pcv_changelist = cv_changelist_BS; |
| 496 | 1701 |
| 1702 while(pcv_changelist[i] != CVIEW_T3_END) | |
| 1703 { | |
| 1704 if((view == pcv_changelist[i]) && !CHECK_BIT_THOME(cv_config, pcv_changelist[i])) | |
| 1705 { | |
| 1706 cv_disabled = 1; | |
| 1707 break; | |
| 1708 } | |
| 1709 i++; | |
| 1710 } | |
| 1711 | |
| 837 | 1712 if ((view == CVIEW_T3_sensors) && |
|
582
64bf41faab83
Show Fallback if no valid sensor value is available:
Ideenmodellierer
parents:
577
diff
changeset
|
1713 ((stateUsed->diveSettings.ppo2sensors_deactivated == 0x07) || (stateUsed->diveSettings.ccrOption == 0) || stateUsed->warnings.fallback)) |
| 496 | 1714 { |
| 1715 cv_disabled = 1; | |
| 1716 } | |
| 1717 | |
| 1718 return cv_disabled; | |
| 1719 } | |
| 38 | 1720 |
|
582
64bf41faab83
Show Fallback if no valid sensor value is available:
Ideenmodellierer
parents:
577
diff
changeset
|
1721 uint8_t t3_change_customview(uint8_t action) |
| 38 | 1722 { |
| 511 | 1723 |
| 837 | 1724 t3_basics_change_customview(&t3_selection_customview, cv_changelist_BS, action); |
|
582
64bf41faab83
Show Fallback if no valid sensor value is available:
Ideenmodellierer
parents:
577
diff
changeset
|
1725 return t3_selection_customview; |
| 38 | 1726 } |
| 1727 | |
| 1728 | |
| 511 | 1729 void t3_basics_change_customview(uint8_t *tX_selection_customview,const uint8_t *tX_customviews, uint8_t action) |
| 38 | 1730 { |
| 511 | 1731 uint8_t curViewIdx = 0xff; |
| 1732 uint8_t index = 0; | |
| 599 | 1733 uint8_t indexOverrun = 0; |
| 511 | 1734 uint8_t lastViewIdx = 0; |
| 599 | 1735 uint8_t iterate = 0; /* set to 1 if a view has to be skipped */ |
| 1736 uint8_t useFallback = 0; /* is set if the current view is disabled */ | |
| 1737 uint8_t fallbackSelection = CVIEW_noneOrDebug; /* show "None" view per default */ | |
| 38 | 1738 |
|
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1739 /* set pointer to currently selected view and count number of entries */ |
| 511 | 1740 while((tX_customviews[index] != CVIEW_T3_END)) |
|
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1741 { |
| 511 | 1742 if (tX_customviews[index] == *tX_selection_customview) |
|
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1743 { |
| 511 | 1744 curViewIdx = index; |
| 837 | 1745 break; |
|
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1746 } |
| 511 | 1747 index++; |
|
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1748 } |
| 511 | 1749 if(curViewIdx == 0xff) /* called with unknown view */ |
| 496 | 1750 { |
| 511 | 1751 curViewIdx = 0; |
| 599 | 1752 *tX_selection_customview = CVIEW_noneOrDebug; /* show "None" view per default */ |
| 496 | 1753 } |
| 511 | 1754 lastViewIdx = index; |
| 1755 index = curViewIdx; | |
|
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1756 do |
|
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1757 { |
|
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1758 iterate = 0; |
| 496 | 1759 switch(action) |
| 1760 { | |
| 1761 case ACTION_BUTTON_ENTER: | |
| 1762 case ACTION_PITCH_POS: | |
| 1763 | |
| 511 | 1764 if(tX_customviews[index] != CVIEW_T3_END) |
| 496 | 1765 { |
| 511 | 1766 index++; |
| 1767 } | |
| 1768 if(tX_customviews[index] == CVIEW_T3_END) | |
| 1769 { | |
| 1770 index = 0; | |
| 599 | 1771 indexOverrun = 1; |
| 496 | 1772 } |
| 1773 break; | |
| 1774 case ACTION_PITCH_NEG: | |
| 511 | 1775 if(index == 0) |
| 496 | 1776 { |
| 511 | 1777 index = lastViewIdx - 1; |
| 599 | 1778 indexOverrun = 1; |
| 496 | 1779 } |
| 1780 else | |
| 1781 { | |
| 511 | 1782 index--; |
| 496 | 1783 } |
| 1784 break; | |
| 1785 default: | |
| 1786 break; | |
|
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1787 } |
| 496 | 1788 |
| 837 | 1789 if((tX_customviews == cv_changelist_BS) && (t3_customview_disabled(tX_customviews[index]))) |
|
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1790 { |
|
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1791 iterate = 1; |
| 599 | 1792 if(*tX_selection_customview == tX_customviews[index]) |
| 1793 { | |
| 1794 useFallback = 1; /* the provided view is disabled => use fallback */ | |
| 1795 } | |
|
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
1796 } |
| 599 | 1797 else /* special case which are enabled but not to be displayed at the moment */ |
| 1798 { | |
| 1799 if(settingsGetPointer()->MotionDetection != MOTION_DETECT_SECTOR) /* no hiding in case of active sector view option (fixed mapping would change during dive) */ | |
| 1800 { | |
|
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:
758
diff
changeset
|
1801 const SDecoinfo * pDecoinfo = getDecoInfo(); |
| 601 | 1802 /* Skip TTS if value is 0 */ |
| 1803 if((tX_customviews[index] == CVIEW_T3_TTS) && (!pDecoinfo->output_time_to_surface_seconds)) | |
| 599 | 1804 { |
| 601 | 1805 if(*tX_selection_customview == tX_customviews[index]) |
| 1806 { | |
| 1807 useFallback = 1; /* the provided view is disabled => use fallback */ | |
| 1808 } | |
| 599 | 1809 iterate = 1; |
| 601 | 1810 if(fallbackSelection == CVIEW_noneOrDebug) |
| 1811 { | |
| 1812 fallbackSelection = CVIEW_T3_TTS; | |
| 1813 } | |
| 599 | 1814 } |
| 601 | 1815 /* Skip Deco if NDL is not set */ |
| 1816 if((tX_customviews[index] == CVIEW_T3_Decostop) && ((!pDecoinfo->output_ndl_seconds) && (!pDecoinfo->output_time_to_surface_seconds) && (timer_Safetystop_GetCountDown() == 0))) | |
| 599 | 1817 { |
| 601 | 1818 if(*tX_selection_customview == tX_customviews[index]) |
| 1819 { | |
| 1820 useFallback = 1; /* the provided view is disabled => use fallback */ | |
| 1821 } | |
| 1822 fallbackSelection = CVIEW_T3_Decostop; | |
| 599 | 1823 iterate = 1; |
| 1824 } | |
| 1825 } | |
| 1826 } | |
| 1827 if((iterate) && (action == ACTION_END)) /* ACTION_END is used to check the enable state of the provided view. If it is enable the function will return without change */ | |
| 496 | 1828 { |
| 1829 action = ACTION_BUTTON_ENTER; | |
| 1830 } | |
| 599 | 1831 }while ((iterate == 1) && (!((indexOverrun == 1) && (*tX_selection_customview == tX_customviews[index])))); /* no other available view found => use fallback */ |
| 38 | 1832 |
| 599 | 1833 if(*tX_selection_customview == tX_customviews[index]) |
| 1834 { | |
| 1835 if(useFallback) | |
| 1836 { | |
| 1837 *tX_selection_customview = fallbackSelection; /* no active view found => keep actual view or change to fallback if actual view is deactivated */ | |
| 1838 } | |
| 1839 } | |
| 1840 else | |
| 1841 { | |
| 1842 *tX_selection_customview = tX_customviews[index]; | |
| 1843 } | |
| 38 | 1844 } |
| 1845 | |
| 496 | 1846 point_t t3_compass_circle(uint8_t id, uint16_t degree, point_t center) |
| 38 | 1847 { |
| 1848 float fCos, fSin; | |
| 1849 const float piMult = ((2 * 3.14159) / 360); | |
| 1850 // const int radius[4] = {95,105,115,60}; | |
| 1851 const int radius[4] = {85,95,105,90}; | |
| 496 | 1852 static point_t forcenter = {.x = 900, .y = 500}; /* used to identify change of circle position */ |
| 38 | 1853 static point_t r[4][360] = { 0 }; |
| 1854 | |
| 496 | 1855 if((r[0][0].y == 0) || (forcenter.x != center.x) || (forcenter.y != center.y)) /* calculate values only once during first call or if center position changed */ |
| 38 | 1856 { |
| 1857 for(int i=0;i<360;i++) | |
| 1858 { | |
| 1859 fCos = cos(i * piMult); | |
| 1860 fSin = sin(i * piMult); | |
| 1861 for(int j=0;j<4;j++) | |
| 1862 { | |
| 496 | 1863 r[j][i].x = center.x + (int)(fSin * radius[j]); |
| 1864 r[j][i].y = center.y + (int)(fCos * radius[j]); | |
| 38 | 1865 } |
| 1866 } | |
| 496 | 1867 forcenter.x = center.x; |
| 1868 forcenter.y = center.y; | |
| 38 | 1869 } |
| 1870 if(id > 3) id = 0; | |
| 1871 if(degree > 359) degree = 0; | |
| 1872 return r[id][degree]; | |
| 1873 } | |
| 1874 | |
| 1875 | |
| 496 | 1876 void t3_basics_compass(GFX_DrawCfgScreen *tXscreen, point_t center, uint16_t ActualHeading, uint16_t UserSetHeading) |
| 38 | 1877 { |
| 496 | 1878 uint8_t loop = 0; |
| 38 | 1879 uint16_t LineHeading; |
| 496 | 1880 |
| 38 | 1881 static int32_t LastHeading = 0; |
| 1882 int32_t newHeading = 0; | |
| 1883 int32_t diff = 0; | |
| 1884 int32_t diff2 = 0; | |
| 1885 | |
| 1886 int32_t diffAbs = 0; | |
| 1887 int32_t diffAbs2 = 0; | |
| 1888 | |
| 1889 newHeading = ActualHeading; | |
| 1890 | |
| 1891 diff = newHeading - LastHeading; | |
| 1892 | |
| 1893 if(newHeading < LastHeading) | |
| 1894 diff2 = newHeading + 360 - LastHeading; | |
| 1895 else | |
| 1896 diff2 = newHeading - 360 - LastHeading; | |
| 1897 | |
| 1898 diffAbs = diff; | |
| 1899 if(diffAbs < 0) | |
| 1900 diffAbs *= -1; | |
| 1901 | |
| 1902 diffAbs2 = diff2; | |
| 1903 if(diffAbs2 < 0) | |
| 1904 diffAbs2 *= -1; | |
| 1905 | |
| 1906 if(diffAbs <= diffAbs2) | |
| 1907 newHeading = LastHeading + (diff / 2); | |
| 1908 else | |
| 1909 newHeading = LastHeading + (diff2 / 2); | |
| 1910 | |
| 1911 if(newHeading < 0) | |
| 1912 newHeading += 360; | |
| 1913 else | |
| 1914 if(newHeading >= 360) | |
| 1915 newHeading -= 360; | |
| 1916 | |
| 1917 LastHeading = newHeading; | |
| 1918 ActualHeading = newHeading; | |
| 1919 | |
| 1920 if (ActualHeading < 90) | |
| 1921 ActualHeading += 360; | |
| 1922 | |
| 1923 while(ActualHeading > 359) ActualHeading -= 360; | |
| 1924 | |
| 1925 LineHeading = 360 - ActualHeading; | |
| 496 | 1926 |
| 1927 GFX_draw_thick_line(9,tXscreen, t3_compass_circle(0,LineHeading, center), t3_compass_circle(2,LineHeading, center), CLUT_Font030); // North | |
| 38 | 1928 LineHeading += 90; |
| 496 | 1929 |
| 1930 for (loop = 0; loop < 3; loop++) | |
| 1931 { | |
| 1932 if(LineHeading > 359) LineHeading -= 360; | |
| 1933 GFX_draw_thick_line(9,tXscreen, t3_compass_circle(0,LineHeading, center), t3_compass_circle(2,LineHeading, center), CLUT_Font031); // Main Ticks | |
| 1934 LineHeading += 90; | |
| 1935 } | |
| 38 | 1936 |
| 1937 LineHeading = 360 - ActualHeading; | |
| 1938 LineHeading += 45; | |
| 496 | 1939 |
| 1940 for (loop = 0; loop < 4; loop++) | |
| 1941 { | |
| 1942 if(LineHeading > 359) LineHeading -= 360; | |
| 1943 GFX_draw_thick_line(5,tXscreen, t3_compass_circle(1,LineHeading, center), t3_compass_circle(2,LineHeading, center), CLUT_Font031); // Subtick | |
| 1944 LineHeading += 90; | |
| 1945 } | |
| 38 | 1946 |
| 1947 LineHeading = 360 - ActualHeading; | |
| 1948 LineHeading += 22; | |
| 496 | 1949 for (loop = 0; loop < 8; loop++) |
| 1950 { | |
| 1951 if(LineHeading > 359) LineHeading -= 360; | |
| 1952 GFX_draw_thick_line(3,tXscreen, t3_compass_circle(1,LineHeading, center), t3_compass_circle(2,LineHeading, center), CLUT_Font031); // Subtick | |
| 1953 LineHeading += 45; | |
| 1954 } | |
| 38 | 1955 if(UserSetHeading) |
| 1956 { | |
| 1957 LineHeading = UserSetHeading + 360 - ActualHeading; | |
| 1958 if(LineHeading > 359) LineHeading -= 360; | |
| 496 | 1959 GFX_draw_thick_line(9,tXscreen, t3_compass_circle(3,LineHeading, center), t3_compass_circle(2,LineHeading, center), CLUT_CompassUserHeadingTick); |
| 38 | 1960 |
| 1961 // R�ckpeilung, User Back Heading | |
| 1962 LineHeading = UserSetHeading + 360 + 180 - ActualHeading; | |
| 1963 if(LineHeading > 359) LineHeading -= 360; | |
| 1964 if(LineHeading > 359) LineHeading -= 360; | |
| 496 | 1965 GFX_draw_thick_line(9,tXscreen, t3_compass_circle(3,LineHeading, center), t3_compass_circle(2,LineHeading, center), CLUT_CompassUserBackHeadingTick); |
| 38 | 1966 } |
| 1967 | |
| 1968 GFX_draw_circle(tXscreen, center, 106, CLUT_Font030); | |
| 1969 GFX_draw_circle(tXscreen, center, 107, CLUT_Font030); | |
| 1970 GFX_draw_circle(tXscreen, center, 108, CLUT_Font030); | |
| 1971 } | |
|
384
427ae9f8e28e
Consider number of available t3 views in sector handling:
ideenmodellierer
parents:
272
diff
changeset
|
1972 |
|
427ae9f8e28e
Consider number of available t3 views in sector handling:
ideenmodellierer
parents:
272
diff
changeset
|
1973 uint8_t t3_GetEnabled_customviews() |
|
427ae9f8e28e
Consider number of available t3 views in sector handling:
ideenmodellierer
parents:
272
diff
changeset
|
1974 { |
| 496 | 1975 uint8_t *pViews; |
| 1976 uint8_t increment = 1; | |
|
384
427ae9f8e28e
Consider number of available t3 views in sector handling:
ideenmodellierer
parents:
272
diff
changeset
|
1977 uint8_t enabledViewCnt = 0; |
| 496 | 1978 |
| 837 | 1979 pViews = (uint8_t*)cv_changelist_BS; |
| 496 | 1980 while((*pViews != CVIEW_T3_END)) |
| 1981 { | |
| 1982 increment = 1; | |
| 1983 /* check if view is enabled */ | |
| 1984 if(t3_customview_disabled(*pViews)) | |
| 1985 { | |
| 1986 increment = 0; | |
| 1987 } | |
| 1988 pViews++; | |
| 1989 enabledViewCnt += increment; | |
| 1990 } | |
|
384
427ae9f8e28e
Consider number of available t3 views in sector handling:
ideenmodellierer
parents:
272
diff
changeset
|
1991 return enabledViewCnt; |
|
427ae9f8e28e
Consider number of available t3 views in sector handling:
ideenmodellierer
parents:
272
diff
changeset
|
1992 } |
|
427ae9f8e28e
Consider number of available t3 views in sector handling:
ideenmodellierer
parents:
272
diff
changeset
|
1993 |
| 518 | 1994 uint8_t t3_getCustomView(void) |
| 1995 { | |
| 1996 return t3_selection_customview; | |
| 1997 } | |
|
758
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
755
diff
changeset
|
1998 |
|
1014
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
1999 unsigned printScrubberText(char *text, size_t size, const SScrubberData scrubberData[], const SSettings *settings, bool useTwoLines) |
|
758
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
755
diff
changeset
|
2000 { |
|
1014
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2001 unsigned textIndex = 0; |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2002 for (unsigned timerId = 0; timerId < 2; timerId++) { |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2003 if (settings->scrubberActiveId & (1 << timerId)) { |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2004 const SScrubberData *currentScrubberData = &scrubberData[timerId]; |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2005 char colour = '\020'; |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2006 if (isScrubberError(currentScrubberData)) { |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2007 colour = '\025'; |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2008 } else if (isScrubberWarning(currentScrubberData)) { |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2009 colour = '\024'; |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2010 } |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2011 |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2012 if (useTwoLines) { |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2013 textIndex += snprintf(&text[textIndex], size, "\016\016"); |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2014 } |
|
758
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
755
diff
changeset
|
2015 |
|
1014
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2016 int16_t currentTimerMinutes = currentScrubberData->TimerCur; |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2017 if (settings->scrubTimerMode == SCRUB_TIMER_MINUTES || currentTimerMinutes < 0) { |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2018 textIndex += snprintf(&text[textIndex], size, "%c%3i'", colour, currentTimerMinutes); |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2019 } else { |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2020 if (useTwoLines) { |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2021 textIndex += snprintf(&text[textIndex], size, "%c%u%%", colour, currentTimerMinutes * 100 / settings->scrubberData[timerId].TimerMax); |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2022 } else { |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2023 textIndex += snprintf(&text[textIndex], size, "%c%u\016\016%%\017", colour, currentTimerMinutes * 100 / settings->scrubberData[timerId].TimerMax); |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2024 } |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2025 } |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2026 |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2027 if (settings->scrubberActiveId == 0x03 && timerId == 0) { |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2028 /* both timers are active => print separator */ |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2029 if (useTwoLines) { |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2030 textIndex += snprintf(&text[textIndex], size, "\r\n"); |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2031 } else { |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2032 textIndex += snprintf(&text[textIndex], size, "\020|"); |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2033 } |
| 998 | 2034 } |
|
1014
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2035 } |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2036 } |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
2037 |
| 998 | 2038 return textIndex; |
|
758
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
755
diff
changeset
|
2039 } |
| 838 | 2040 |
| 841 | 2041 void t3_AF_updateBorderConditions() |
| 2042 { | |
| 2043 uint16_t nextstopLengthSeconds = 0; | |
| 2044 uint8_t nextstopDepthMeter = 0; | |
| 2045 | |
| 2046 tHome_findNextStop(getDecoInfo()->output_stop_length_seconds, &nextstopDepthMeter, &nextstopLengthSeconds); | |
| 2047 AF_lastDecoDepth = nextstopDepthMeter; | |
| 2048 AF_lastTTS = (getDecoInfo()->output_time_to_surface_seconds / 60) / 10; | |
| 2049 } | |
| 2050 | |
| 2051 uint8_t t3_CheckAfCondition(uint8_t T3CView) | |
| 838 | 2052 { |
| 841 | 2053 uint8_t retVal = 0; |
| 2054 | |
| 2055 float pitch = stateRealGetPointer()->lifeData.compass_pitch; | |
| 2056 float roll = stateRealGetPointer()->lifeData.compass_roll; | |
| 2057 | |
| 2058 uint16_t nextstopLengthSeconds = 0; | |
| 2059 uint8_t nextstopDepthMeter = 0; | |
| 2060 | |
| 2061 switch (T3CView) | |
| 2062 { | |
| 2063 case CVIEW_T3_GasList: retVal = (stateUsed->warnings.betterGas) /* switch if better gas is available or depending on ppo2 if in OC mode */ | |
| 2064 || ((stateUsed->diveSettings.diveMode == DIVEMODE_OC) && ((stateUsed->warnings.ppO2Low) || (stateUsed->warnings.ppO2High))); | |
| 2065 | |
| 2066 break; | |
| 2067 case CVIEW_T3_Navigation: retVal = (pitch > -AF_COMPASS_ACTIVATION_ANGLE) && (pitch < AF_COMPASS_ACTIVATION_ANGLE) | |
| 2068 && (roll > -AF_COMPASS_ACTIVATION_ANGLE) && (roll < AF_COMPASS_ACTIVATION_ANGLE); | |
| 2069 | |
| 2070 break; | |
| 2071 case CVIEW_T3_DecoTTS: tHome_findNextStop(getDecoInfo()->output_stop_length_seconds, &nextstopDepthMeter, &nextstopLengthSeconds); | |
| 2072 /* A new deco step is added to the plan */ | |
| 2073 if(nextstopDepthMeter > AF_lastDecoDepth) | |
| 2074 { | |
| 2075 retVal = 1; | |
| 2076 } | |
| 838 | 2077 |
| 841 | 2078 /* Close to the next deco step or missed deco step */ |
| 2079 if((abs(stateUsed->lifeData.depth_meter - nextstopDepthMeter) < 2) || (stateUsed->warnings.decoMissed)) | |
| 2080 { | |
| 2081 retVal = 1; | |
| 2082 } | |
| 2083 /* Another 10 minutes to surface */ | |
| 2084 if((getDecoInfo()->output_time_to_surface_seconds) && ((uint16_t)((getDecoInfo()->output_time_to_surface_seconds / 60) / 10) > AF_lastTTS)) | |
| 2085 { | |
| 2086 retVal = 1; | |
| 2087 } | |
| 2088 break; | |
| 2089 default: break; | |
| 2090 } | |
| 2091 | |
| 2092 return retVal; | |
| 2093 } | |
| 2094 | |
| 2095 uint8_t t3_EvaluateAFCondition(uint8_t T3CView) | |
| 2096 { | |
| 2097 static uint8_t debounce[CVIEW_T3_END]; | |
| 2098 static uint8_t lastState[CVIEW_T3_END]; | |
| 2099 uint8_t detectionState = AF_VIEW_NOCHANGE; | |
| 2100 uint8_t cnt = 0; | |
| 2101 | |
| 2102 if(T3CView <= CVIEW_T3_END) | |
| 838 | 2103 { |
| 841 | 2104 if(T3CView == CVIEW_T3_END) |
| 838 | 2105 { |
| 841 | 2106 for(cnt = 0; cnt < CVIEW_T3_END; cnt++) |
| 2107 { | |
| 2108 debounce[cnt] = 0; | |
| 2109 lastState[cnt] = AF_VIEW_NOCHANGE; | |
| 2110 } | |
| 2111 } | |
| 2112 if(t3_CheckAfCondition(T3CView)) | |
| 2113 { | |
| 2114 if(debounce[T3CView] < 10) | |
| 2115 { | |
| 2116 debounce[T3CView]++; | |
| 2117 } | |
| 2118 else | |
| 2119 { | |
| 2120 detectionState = AF_VIEW_ACTIVATED; | |
| 2121 } | |
| 838 | 2122 } |
| 2123 else | |
| 2124 { | |
| 841 | 2125 if(debounce[T3CView] > 0) |
| 2126 { | |
| 2127 debounce[T3CView]--; | |
| 2128 } | |
| 2129 else | |
| 2130 { | |
| 2131 detectionState = AF_VIEW_DEACTIVATED; | |
| 2132 } | |
| 2133 } | |
| 2134 if(detectionState) /* no state change => return 0 */ | |
| 2135 { | |
| 2136 if((detectionState == lastState[T3CView])) | |
| 2137 { | |
| 2138 detectionState = AF_VIEW_NOCHANGE; | |
| 2139 } | |
| 2140 else | |
| 2141 { | |
| 2142 lastState[T3CView] = detectionState; | |
| 2143 } | |
| 838 | 2144 } |
| 2145 } | |
| 2146 return detectionState; | |
| 2147 } | |
| 2148 | |
| 835 | 2149 void t3_handleAutofocus(void) |
| 2150 { | |
| 2151 static uint8_t returnView = CVIEW_T3_END; | |
| 2152 | |
| 841 | 2153 uint8_t runningT3CView = 0; |
| 835 | 2154 |
| 841 | 2155 for (runningT3CView = 0; runningT3CView < CVIEW_T3_END; runningT3CView++) |
| 838 | 2156 { |
| 841 | 2157 if(stateUsed->diveSettings.activeAFViews & (1 << runningT3CView)) |
| 838 | 2158 { |
| 841 | 2159 switch(t3_EvaluateAFCondition(runningT3CView)) |
| 2160 { | |
| 2161 case AF_VIEW_ACTIVATED: returnView = t3_selection_customview; | |
| 2162 t3_select_customview(runningT3CView); | |
| 2163 t3_AF_updateBorderConditions(); | |
| 2164 break; | |
| 2165 case AF_VIEW_DEACTIVATED: if((returnView != CVIEW_T3_END) && (t3_selection_customview == runningT3CView)) | |
| 2166 { | |
| 2167 if(runningT3CView != CVIEW_T3_DecoTTS) /* some view does not switch back */ | |
| 2168 { | |
| 2169 t3_select_customview(returnView); | |
| 2170 } | |
| 2171 returnView = CVIEW_T3_END; | |
| 2172 } | |
| 2173 break; | |
| 2174 default: | |
| 2175 break; | |
| 2176 } | |
| 838 | 2177 } |
| 2178 } | |
| 835 | 2179 } |
| 945 | 2180 |
| 2181 #define ASCENT_GRAPH_YPIXEL 220 | |
| 2182 uint8_t t3_drawSlowExitGraph(GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXl1, GFX_DrawCfgWindow* tXr1) /* this function is only called if diver is below last last stop depth */ | |
| 2183 { | |
| 2184 static uint16_t countDownSec = 0; | |
| 2185 uint8_t drawingMeterStep; | |
| 2186 static float exitDepthMeter = 0.0; | |
| 2187 | |
| 2188 | |
| 2189 uint8_t index = 0; | |
| 2190 uint8_t color = 0; | |
| 2191 point_t start, stop; | |
| 2192 | |
| 2193 SSettings* pSettings; | |
| 2194 pSettings = settingsGetPointer(); | |
| 2195 | |
| 2196 | |
| 2197 if(calculateSlowExit(&countDownSec, &exitDepthMeter, &color)) /* graph to be drawn? */ | |
| 2198 { | |
| 2199 if(!pSettings->FlipDisplay) | |
| 2200 { | |
| 2201 start.y = tXl1->WindowY0 - 1; | |
| 2202 } | |
| 2203 else | |
| 2204 { | |
| 2205 start.y = tXl1->WindowY1 + 1; | |
| 2206 } | |
| 2207 | |
| 2208 drawingMeterStep = ASCENT_GRAPH_YPIXEL / pSettings->last_stop_depth_meter; /* based on 120 / 4 = 30 of standard ascent graph */ | |
| 2209 | |
| 2210 for(index = 0; index < pSettings->last_stop_depth_meter; index++) /* draw meter indicators */ | |
| 2211 { | |
| 2212 start.y += drawingMeterStep; | |
| 2213 stop.y = start.y; | |
| 2214 if(!pSettings->FlipDisplay) | |
| 2215 { | |
| 2216 start.x = tXl1->WindowX1 - 1; | |
| 2217 } | |
| 2218 else | |
| 2219 { | |
| 2220 start.x = tXr1->WindowX1 + 3; | |
| 2221 } | |
| 2222 stop.x = start.x - 43; | |
| 2223 GFX_draw_line(tXscreen, start, stop, 0); | |
| 2224 } | |
| 2225 | |
| 2226 /* draw cntdown bar */ | |
| 2227 | |
| 2228 if(!pSettings->FlipDisplay) | |
| 2229 { | |
| 2230 start.x -= 20; | |
| 2231 start.y = tXl1->WindowY0 + ASCENT_GRAPH_YPIXEL + 2; | |
| 2232 } | |
| 2233 else | |
| 2234 { | |
| 2235 start.x -= 25; | |
| 2236 start.y = tXl1->WindowY1 + ASCENT_GRAPH_YPIXEL + 5; | |
| 2237 } | |
| 2238 stop.x = start.x; | |
| 2239 stop.y = start.y - countDownSec * (ASCENT_GRAPH_YPIXEL / (float)(pSettings->slowExitTime * 60.0)); | |
| 2240 if(stop.y >= 470) stop.y = 470; | |
| 2241 if(!pSettings->FlipDisplay) | |
| 2242 { | |
| 2243 stop.y += 5; | |
| 2244 } | |
| 2245 GFX_draw_thick_line(15,tXscreen, start, stop, 3); | |
| 2246 /* mark diver depth */ | |
| 2247 if(!pSettings->FlipDisplay) | |
| 2248 { | |
| 2249 start.x = tXl1->WindowX1 - 32; | |
| 2250 stop.x = start.x + 24; | |
| 2251 } | |
| 2252 else | |
| 2253 { | |
| 2254 start.x = tXr1->WindowX1 - 33; | |
| 2255 stop.x = start.x + 24; | |
| 2256 } | |
| 2257 | |
| 2258 | |
| 2259 start.y = start.y - (stateUsed->lifeData.depth_meter * (ASCENT_GRAPH_YPIXEL) / pSettings->last_stop_depth_meter); | |
| 2260 stop.y = start.y; | |
| 2261 GFX_draw_thick_line(10,tXscreen, start, stop, 9); | |
| 2262 } | |
|
954
4e4fbd73e329
Slow exit graph draw normal ascent if slow exit is inactive:
Ideenmodellierer
parents:
951
diff
changeset
|
2263 else |
|
4e4fbd73e329
Slow exit graph draw normal ascent if slow exit is inactive:
Ideenmodellierer
parents:
951
diff
changeset
|
2264 { |
|
4e4fbd73e329
Slow exit graph draw normal ascent if slow exit is inactive:
Ideenmodellierer
parents:
951
diff
changeset
|
2265 color = 0xff; |
|
4e4fbd73e329
Slow exit graph draw normal ascent if slow exit is inactive:
Ideenmodellierer
parents:
951
diff
changeset
|
2266 } |
| 945 | 2267 return color; |
| 2268 } |
