Mercurial > public > ostc4
annotate Discovery/Src/tHome.c @ 775:46c6d2380d4e
Add a shortcuts to change the setpoint to the loop to the 'normal' display when diving. It is only shown when diving in CCR mode and on the loop.
Uses the configured setpoint with the highest / lowest switch depth as the high / low setpoints respectively. (mikeller)
| author | heinrichsweikamp |
|---|---|
| date | Thu, 11 May 2023 12:13:03 +0200 |
| parents | 6169309d6eb9 |
| children | 6a8cf91e5b22 |
| rev | line source |
|---|---|
| 38 | 1 /////////////////////////////////////////////////////////////////////////////// |
| 2 /// -*- coding: UTF-8 -*- | |
| 3 /// | |
| 4 /// \file Discovery/Src/tHome.c | |
| 5 /// \brief Control for Surface and Dive Templates | |
| 6 /// \author heinrichs weikamp gmbh | |
| 7 /// \date 10-November-2014 | |
| 8 /// | |
| 9 /// \details | |
| 10 /// | |
| 11 /// $Id$ | |
| 12 /////////////////////////////////////////////////////////////////////////////// | |
| 13 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh | |
| 14 /// | |
| 15 /// This program is free software: you can redistribute it and/or modify | |
| 16 /// it under the terms of the GNU General Public License as published by | |
| 17 /// the Free Software Foundation, either version 3 of the License, or | |
| 18 /// (at your option) any later version. | |
| 19 /// | |
| 20 /// This program is distributed in the hope that it will be useful, | |
| 21 /// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 22 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 23 /// GNU General Public License for more details. | |
| 24 /// | |
| 25 /// You should have received a copy of the GNU General Public License | |
| 26 /// along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 27 ////////////////////////////////////////////////////////////////////////////// | |
| 28 | |
| 29 /* Includes ------------------------------------------------------------------*/ | |
| 30 #include "tHome.h" | |
| 31 | |
| 32 #include "data_exchange_main.h" // for dataOutGetPointer() | |
| 33 #include "gfx_fonts.h" | |
| 34 #include "t3.h" | |
| 35 #include "t4_tetris.h" | |
| 36 #include "t5_gauge.h" | |
| 37 #include "t6_apnea.h" | |
| 38 #include "t7.h" | |
| 39 #include "tDebug.h" | |
| 40 #include "timer.h" // for timer_Stopwatch_Restart | |
| 41 #include "tMenu.h" | |
| 42 #include "tMenuEditGasOC.h" // for openEdit_DiveSelectBetterGas() | |
| 43 #include "tMenuEditSetpoint.h" // for openEdit_DiveSelectBetterSetpoint() | |
| 44 #include "simulation.h" | |
|
361
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
289
diff
changeset
|
45 #include "motion.h" |
|
619
8fa2de4414a8
Added t3 quick menu for marker synchronisation:
Ideenmodellierer
parents:
613
diff
changeset
|
46 #include "logbook_miniLive.h" |
| 38 | 47 |
| 48 /* Private types -------------------------------------------------------------*/ | |
| 49 | |
| 50 /* Exported variables --------------------------------------------------------*/ | |
| 51 _Bool warning_count_high_time = 0; | |
| 52 _Bool display_count_high_time = 0; | |
| 53 | |
| 54 uint8_t errorsInSettings = 0; | |
| 55 /* Private variables ---------------------------------------------------------*/ | |
| 56 static uint8_t warning_toogle_count; | |
| 57 static uint16_t display_toogle_count; | |
| 58 static uint16_t tHome_tick_count_cview; | |
| 59 static uint16_t tHome_tick_count_field; | |
| 576 | 60 static uint16_t tHome_tick_count_o2sens; |
| 38 | 61 |
| 379 | 62 const uint8_t cv_changelist[] = {CVIEW_Compass, CVIEW_SummaryOfLeftCorner, CVIEW_Tissues, CVIEW_Profile, CVIEW_EADTime, CVIEW_Gaslist, CVIEW_noneOrDebug, CVIEW_Decolist,CVIEW_sensors,CVIEW_sensors_mV, CVIEW_END}; |
|
594
280c11153080
Added compile switch for new T3 View Profile
Ideenmodellierer
parents:
576
diff
changeset
|
63 const uint8_t cv_changelist_BS[] = {CVIEW_T3_Decostop, CVIEW_sensors, CVIEW_Compass, CVIEW_T3_MaxDepth,CVIEW_T3_StopWatch, CVIEW_T3_TTS, CVIEW_T3_GasList, CVIEW_T3_ppO2andGas, CVIEW_noneOrDebug, |
|
280c11153080
Added compile switch for new T3 View Profile
Ideenmodellierer
parents:
576
diff
changeset
|
64 CVIEW_T3_Navigation, CVIEW_T3_DepthData, CVIEW_T3_DecoTTS, |
|
280c11153080
Added compile switch for new T3 View Profile
Ideenmodellierer
parents:
576
diff
changeset
|
65 #ifdef ENABLE_T3_PROFILE_VIEW |
|
280c11153080
Added compile switch for new T3 View Profile
Ideenmodellierer
parents:
576
diff
changeset
|
66 CVIEW_T3_Profile, |
|
280c11153080
Added compile switch for new T3 View Profile
Ideenmodellierer
parents:
576
diff
changeset
|
67 #endif |
|
280c11153080
Added compile switch for new T3 View Profile
Ideenmodellierer
parents:
576
diff
changeset
|
68 CVIEW_T3_END}; |
| 38 | 69 |
| 70 /* Private function prototypes -----------------------------------------------*/ | |
| 71 | |
| 576 | 72 #define AUTORETURN_O2SENS (200u) /* return to sensor view after 20 seconds in case sensor is connected */ |
| 73 | |
| 74 | |
| 38 | 75 /* Exported functions --------------------------------------------------------*/ |
| 76 | |
| 77 void set_globalState_tHome(void) | |
| 78 { | |
| 79 if(stateUsed->mode == MODE_DIVE) | |
| 739 | 80 { |
| 81 if(settingsGetPointer()->extraDisplay == EXTRADISPLAY_BFACTIVE) | |
| 82 { | |
| 83 settingsGetPointer()->design = 3; | |
| 84 } | |
| 38 | 85 set_globalState(StD); |
| 739 | 86 } |
| 38 | 87 else |
| 88 set_globalState(StS); | |
| 89 } | |
| 90 | |
| 91 | |
| 92 void tHome_init(void) | |
| 93 { | |
| 94 t7_init(); // standard + surface | |
| 95 t3_init(); // big font | |
| 96 t4_init(); // game | |
| 97 t5_init(); // gauge | |
| 98 t6_init(); // apnea | |
| 99 } | |
| 100 | |
| 101 | |
| 102 void tHome_init_compass(void) | |
| 103 { | |
| 104 init_t7_compass(); | |
| 105 } | |
| 106 | |
| 107 | |
| 108 void tHome_refresh(void) | |
| 109 { | |
| 110 SSettings* pSettings = settingsGetPointer(); | |
| 111 | |
| 112 warning_toogle_count++; | |
| 113 if(warning_toogle_count >= 2* pSettings->warning_blink_dsec) | |
| 114 warning_toogle_count = 0; | |
| 115 | |
| 116 if(warning_toogle_count >= pSettings->warning_blink_dsec) | |
| 117 warning_count_high_time = 1; | |
| 118 else | |
| 119 warning_count_high_time = 0; | |
| 120 | |
| 121 | |
| 122 display_toogle_count++; | |
| 123 if(display_toogle_count >= 2* pSettings->display_toogle_desc) | |
| 124 display_toogle_count = 0; | |
| 125 | |
| 126 if(display_toogle_count >= pSettings->display_toogle_desc) | |
| 127 display_count_high_time = 1; | |
| 128 else | |
| 129 display_count_high_time = 0; | |
| 130 | |
| 131 | |
| 132 if(pSettings->design == 6) | |
| 133 t6_refresh(); | |
| 134 else | |
| 135 if(pSettings->design == 5) | |
| 136 t5_refresh(); | |
| 137 else | |
| 138 if(pSettings->design == 4) | |
| 139 t4_refresh(); | |
| 140 else | |
| 141 if(pSettings->design == 3) | |
| 142 t3_refresh(); | |
| 143 else | |
| 144 if(pSettings->design == 7) | |
| 145 t7_refresh(); | |
| 146 else | |
| 147 { | |
| 148 pSettings->design = 7; | |
| 149 t7_refresh(); | |
| 150 } | |
| 151 } | |
| 152 | |
| 153 | |
| 154 void tHome_sleepmode_fun(void) | |
| 155 { | |
| 156 t7_refresh_sleepmode_fun(); | |
| 157 } | |
| 158 | |
| 159 | |
|
773
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
160 static void checkSetStateSim(SSettings *settings) |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
161 { |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
162 if (is_stateUsedSetToSim()) { |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
163 if (settings->design != 3) { |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
164 set_globalState(StDSIM1); |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
165 } else { |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
166 #ifdef ENABLE_T3_PPO_SIM |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
167 if (stateUsed->diveSettings.ppo2sensors_deactivated & 0x01 == 0) { |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
168 set_globalState(StDSIM1); |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
169 } else if (stateUsed->diveSettings.ppo2sensors_deactivated & 0x02 == 0) { |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
170 set_globalState(StDSIM3); |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
171 } else if (stateUsed->diveSettings.ppo2sensors_deactivated & 0x04 == 0) { |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
172 set_globalState(StDSIM5); |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
173 } else { |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
174 set_globalState(StD); |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
175 } |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
176 #endif |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
177 } |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
178 } else { |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
179 set_globalState(StD); |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
180 } |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
181 } |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
182 |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
183 |
| 38 | 184 void tHomeDiveMenuControl(uint8_t sendAction) |
| 185 { | |
|
773
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
186 SSettings *settings = settingsGetPointer(); |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
187 |
| 38 | 188 if(sendAction == ACTION_BUTTON_NEXT) |
| 189 { | |
| 190 if(settingsGetPointer()->design == 4) | |
| 191 return; | |
| 192 | |
| 193 switch(get_globalState()) | |
| 194 { | |
|
516
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
195 case StD: |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
196 if(settingsGetPointer()->design == 6) |
| 38 | 197 { |
| 198 if(is_stateUsedSetToSim()) | |
| 199 set_globalState(StDSIM1); | |
| 200 else | |
| 201 set_globalState(StDQUIT); | |
| 202 break; | |
| 203 } | |
| 204 | |
| 205 if(settingsGetPointer()->design == 5) | |
| 206 { | |
| 207 if(t5_getCustomView() == CVIEW_Compass) | |
| 208 set_globalState(StDBEAR); | |
| 209 else | |
| 210 set_globalState(StDRAVG); | |
| 211 break; | |
| 212 } | |
| 213 | |
|
516
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
214 if(settingsGetPointer()->design == 3) |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
215 { |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
216 switch(t3_getCustomView()) |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
217 { |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
218 case CVIEW_T3_Navigation: |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
219 case CVIEW_Compass: set_globalState(StDBEAR); |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
220 break; |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
221 case CVIEW_T3_StopWatch: set_globalState(StDRAVG); |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
222 break; |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
223 case CVIEW_T3_GasList: if(stateUsed->warnings.betterGas) |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
224 { |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
225 set_globalState(StDMGAS); |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
226 } |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
227 break; |
|
633
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
228 #ifdef ENABLE_T3_PPO_SIM |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
229 case CVIEW_sensors: if(is_stateUsedSetToSim()) |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
230 { |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
231 set_globalState(StDSIM1); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
232 } |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
233 break; |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
234 #endif |
|
628
db2bcd2f6778
Added compile switch for T3_PROFILE menu operation option
Ideenmodellierer
parents:
619
diff
changeset
|
235 #ifdef ENABLE_T3_PROFILE_VIEW |
| 613 | 236 case CVIEW_T3_Profile: set_globalState(StDMARK); |
|
628
db2bcd2f6778
Added compile switch for T3_PROFILE menu operation option
Ideenmodellierer
parents:
619
diff
changeset
|
237 #endif |
| 613 | 238 break; |
|
516
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
239 default: |
| 739 | 240 set_globalState(StDMENU); |
|
516
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
241 break; |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
242 } |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
243 break; |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
244 } |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
245 |
| 38 | 246 if(stateUsed->warnings.betterGas) |
| 247 set_globalState(StDMGAS); | |
| 248 else | |
| 249 if(stateUsed->warnings.betterSetpoint) | |
| 250 set_globalState(StDMSPT); | |
| 251 else | |
| 252 set_globalState(StDMENU); | |
| 253 break; | |
| 254 | |
| 255 case StDMGAS: | |
|
516
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
256 if(settingsGetPointer()->design == 3) |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
257 { |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
258 set_globalState(StD); |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
259 } |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
260 else |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
261 { |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
262 if(stateUsed->warnings.betterSetpoint) |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
263 set_globalState(StDMSPT); |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
264 else |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
265 set_globalState(StDMENU); |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
266 } |
| 38 | 267 break; |
| 268 | |
| 269 case StDMSPT: | |
| 270 set_globalState(StDMENU); | |
| 271 break; | |
| 272 | |
| 273 case StDMENU: | |
|
773
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
274 if (settings->design == 7 && isLoopMode(settings->dive_mode)) { |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
275 set_globalState(StDBAILOUT); |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
276 |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
277 break; |
|
633
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
278 } |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
279 |
|
773
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
280 checkSetStateSim(settings); |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
281 |
| 38 | 282 break; |
|
773
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
283 case StDBAILOUT: |
|
775
46c6d2380d4e
Add a shortcuts to change the setpoint to the loop to the 'normal' display when diving. It is only shown when diving in CCR mode and on the loop.
heinrichsweikamp
parents:
774
diff
changeset
|
284 if (settingsGetPointer()->dive_mode == DIVEMODE_CCR && isLoopMode(stateUsed->diveSettings.diveMode) && findSwitchToSetpoint()) { |
|
46c6d2380d4e
Add a shortcuts to change the setpoint to the loop to the 'normal' display when diving. It is only shown when diving in CCR mode and on the loop.
heinrichsweikamp
parents:
774
diff
changeset
|
285 set_globalState(StDSETPOINT); |
|
46c6d2380d4e
Add a shortcuts to change the setpoint to the loop to the 'normal' display when diving. It is only shown when diving in CCR mode and on the loop.
heinrichsweikamp
parents:
774
diff
changeset
|
286 |
|
46c6d2380d4e
Add a shortcuts to change the setpoint to the loop to the 'normal' display when diving. It is only shown when diving in CCR mode and on the loop.
heinrichsweikamp
parents:
774
diff
changeset
|
287 break; |
|
46c6d2380d4e
Add a shortcuts to change the setpoint to the loop to the 'normal' display when diving. It is only shown when diving in CCR mode and on the loop.
heinrichsweikamp
parents:
774
diff
changeset
|
288 } |
|
46c6d2380d4e
Add a shortcuts to change the setpoint to the loop to the 'normal' display when diving. It is only shown when diving in CCR mode and on the loop.
heinrichsweikamp
parents:
774
diff
changeset
|
289 |
|
46c6d2380d4e
Add a shortcuts to change the setpoint to the loop to the 'normal' display when diving. It is only shown when diving in CCR mode and on the loop.
heinrichsweikamp
parents:
774
diff
changeset
|
290 checkSetStateSim(settings); |
|
46c6d2380d4e
Add a shortcuts to change the setpoint to the loop to the 'normal' display when diving. It is only shown when diving in CCR mode and on the loop.
heinrichsweikamp
parents:
774
diff
changeset
|
291 |
|
46c6d2380d4e
Add a shortcuts to change the setpoint to the loop to the 'normal' display when diving. It is only shown when diving in CCR mode and on the loop.
heinrichsweikamp
parents:
774
diff
changeset
|
292 break; |
|
46c6d2380d4e
Add a shortcuts to change the setpoint to the loop to the 'normal' display when diving. It is only shown when diving in CCR mode and on the loop.
heinrichsweikamp
parents:
774
diff
changeset
|
293 case StDSETPOINT: |
|
773
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
294 checkSetStateSim(settings); |
| 38 | 295 |
|
773
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
296 break; |
| 38 | 297 case StDSIM1: |
| 298 set_globalState(StDSIM2); | |
| 299 break; | |
| 300 | |
| 301 case StDSIM2: | |
|
633
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
302 if(settingsGetPointer()->design != 3) |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
303 { |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
304 set_globalState(StDSIM3); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
305 } |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
306 else |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
307 { |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
308 #ifdef ENABLE_T3_PPO_SIM |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
309 if((stateUsed->diveSettings.ppo2sensors_deactivated & 0x02) == 0) |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
310 { |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
311 set_globalState(StDSIM3); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
312 } |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
313 else if((stateUsed->diveSettings.ppo2sensors_deactivated & 0x04) == 0) |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
314 { |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
315 set_globalState(StDSIM5); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
316 } |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
317 else |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
318 { |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
319 set_globalState(StD); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
320 } |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
321 #endif |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
322 } |
| 38 | 323 break; |
| 324 | |
| 325 case StDSIM3: | |
| 326 set_globalState(StDSIM4); | |
| 327 break; | |
| 328 | |
| 329 case StDSIM4: | |
|
633
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
330 if(settingsGetPointer()->design != 3) |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
331 { |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
332 set_globalState(StD); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
333 } |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
334 else |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
335 { |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
336 #ifdef ENABLE_T3_PPO_SIM |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
337 if((stateUsed->diveSettings.ppo2sensors_deactivated & 0x04) == 0) |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
338 { |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
339 set_globalState(StDSIM5); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
340 } |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
341 else |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
342 { |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
343 set_globalState(StD); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
344 } |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
345 #endif |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
346 } |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
347 break; |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
348 #ifdef ENABLE_T3_PPO_SIM |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
349 case StDSIM5: |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
350 set_globalState(StDSIM6); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
351 break; |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
352 |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
353 case StDSIM6: |
| 38 | 354 set_globalState(StD); |
| 355 break; | |
|
633
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
356 #endif |
|
516
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
357 case StDBEAR: |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
358 if(settingsGetPointer()->design == 5) |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
359 { |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
360 set_globalState(StDRAVG); |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
361 } |
| 38 | 362 |
|
516
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
363 if(settingsGetPointer()->design == 3) |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
364 { |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
365 if(t3_getCustomView() == CVIEW_T3_Navigation) |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
366 { |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
367 set_globalState(StDRAVG); |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
368 } |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
369 else |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
370 { |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
371 set_globalState(StD); |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
372 } |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
373 } |
| 38 | 374 break; |
|
516
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
375 case StDRAVG: |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
376 if(settingsGetPointer()->design == 5) |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
377 { |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
378 if(is_stateUsedSetToSim()) |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
379 set_globalState(StDSIM1); |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
380 else |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
381 set_globalState(StD); |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
382 break; |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
383 } |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
384 else |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
385 { |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
386 set_globalState(StD); |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
387 } |
|
bd66f4910993
Added quick menu function to big font view:
Ideenmodellierer
parents:
505
diff
changeset
|
388 break; |
| 38 | 389 case StDQUIT: // t6_apnea |
| 390 set_globalState(StD); | |
| 391 break; | |
| 392 | |
|
619
8fa2de4414a8
Added t3 quick menu for marker synchronisation:
Ideenmodellierer
parents:
613
diff
changeset
|
393 case StDMARK: |
|
8fa2de4414a8
Added t3 quick menu for marker synchronisation:
Ideenmodellierer
parents:
613
diff
changeset
|
394 if((settingsGetPointer()->design == 3) && (MiniLiveLogbook_getNextMarkerIndex(0) != 0)) |
|
8fa2de4414a8
Added t3 quick menu for marker synchronisation:
Ideenmodellierer
parents:
613
diff
changeset
|
395 { |
|
8fa2de4414a8
Added t3 quick menu for marker synchronisation:
Ideenmodellierer
parents:
613
diff
changeset
|
396 set_globalState(StDCHECK); |
|
8fa2de4414a8
Added t3 quick menu for marker synchronisation:
Ideenmodellierer
parents:
613
diff
changeset
|
397 } |
|
8fa2de4414a8
Added t3 quick menu for marker synchronisation:
Ideenmodellierer
parents:
613
diff
changeset
|
398 else |
|
8fa2de4414a8
Added t3 quick menu for marker synchronisation:
Ideenmodellierer
parents:
613
diff
changeset
|
399 { |
|
8fa2de4414a8
Added t3 quick menu for marker synchronisation:
Ideenmodellierer
parents:
613
diff
changeset
|
400 set_globalState(StD); |
|
8fa2de4414a8
Added t3 quick menu for marker synchronisation:
Ideenmodellierer
parents:
613
diff
changeset
|
401 } |
|
8fa2de4414a8
Added t3 quick menu for marker synchronisation:
Ideenmodellierer
parents:
613
diff
changeset
|
402 break; |
|
8fa2de4414a8
Added t3 quick menu for marker synchronisation:
Ideenmodellierer
parents:
613
diff
changeset
|
403 |
| 38 | 404 default: |
| 405 set_globalState(StD); | |
| 406 } | |
| 407 } | |
| 408 | |
| 409 if(sendAction == ACTION_BUTTON_ENTER) | |
| 410 { | |
| 411 if(settingsGetPointer()->design == 4) | |
| 412 return; | |
| 413 | |
| 414 switch(get_globalState()) | |
| 415 { | |
| 416 case StDMGAS: | |
|
773
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
417 openEdit_DiveSelectBetterGas(false); |
| 38 | 418 set_globalState(StD); |
| 419 break; | |
| 420 case StDMSPT: | |
|
773
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
421 openEdit_DiveSelectBetterSetpoint(false); |
| 38 | 422 set_globalState(StD); |
| 423 break; | |
| 424 | |
| 425 case StDMENU: | |
| 426 openMenu_first_page_with_OC_gas_update(); | |
| 427 break; | |
| 428 | |
| 429 case StDSIM1: | |
|
633
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
430 if(settingsGetPointer()->design != 3) |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
431 { |
| 38 | 432 Sim_Quit(); |
|
633
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
433 } |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
434 else |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
435 { |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
436 Sim_IncreasePPO(0); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
437 } |
| 38 | 438 break; |
| 439 | |
| 440 case StDSIM2: | |
|
633
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
441 if(settingsGetPointer()->design != 3) |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
442 { |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
443 Sim_Ascend(); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
444 } |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
445 else |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
446 { |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
447 Sim_DecreasePPO(0); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
448 } |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
449 |
| 38 | 450 break; |
| 451 | |
| 452 case StDSIM3: | |
|
633
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
453 if(settingsGetPointer()->design != 3) |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
454 { |
| 38 | 455 Sim_Descend(); |
|
633
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
456 } |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
457 else |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
458 { |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
459 Sim_IncreasePPO(1); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
460 } |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
461 |
| 38 | 462 break; |
| 463 | |
| 464 case StDSIM4: | |
|
633
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
465 if(settingsGetPointer()->design != 3) |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
466 { |
| 38 | 467 Sim_Divetime(); |
|
633
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
468 } |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
469 else |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
470 { |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
471 Sim_DecreasePPO(1); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
472 } |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
473 |
| 38 | 474 break; |
|
633
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
475 #ifdef ENABLE_T3_PPO_SIM |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
476 case StDSIM5: |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
477 Sim_IncreasePPO(2); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
478 break; |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
479 case StDSIM6: |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
480 Sim_DecreasePPO(2); |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
481 break; |
|
68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
Ideenmodellierer
parents:
628
diff
changeset
|
482 #endif |
|
773
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
483 case StDBAILOUT: |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
484 if (isLoopMode(stateUsed->diveSettings.diveMode)) { |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
485 tMEGas_check_switch_to_bailout(); |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
486 |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
487 openEdit_DiveSelectBetterGas(true); |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
488 } else { |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
489 checkSwitchToLoop(); |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
490 |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
491 openEdit_DiveSelectBetterSetpoint(true); |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
492 } |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
493 |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
494 set_globalState(StD); |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
495 |
|
2c243233c999
Menu shortcut for bailout / return to circuit when diving in CCR mode (mikeller)
heinrichsweikamp
parents:
739
diff
changeset
|
496 break; |
|
775
46c6d2380d4e
Add a shortcuts to change the setpoint to the loop to the 'normal' display when diving. It is only shown when diving in CCR mode and on the loop.
heinrichsweikamp
parents:
774
diff
changeset
|
497 case StDSETPOINT: |
|
46c6d2380d4e
Add a shortcuts to change the setpoint to the loop to the 'normal' display when diving. It is only shown when diving in CCR mode and on the loop.
heinrichsweikamp
parents:
774
diff
changeset
|
498 checkSwitchSetpoint(); |
|
46c6d2380d4e
Add a shortcuts to change the setpoint to the loop to the 'normal' display when diving. It is only shown when diving in CCR mode and on the loop.
heinrichsweikamp
parents:
774
diff
changeset
|
499 |
|
46c6d2380d4e
Add a shortcuts to change the setpoint to the loop to the 'normal' display when diving. It is only shown when diving in CCR mode and on the loop.
heinrichsweikamp
parents:
774
diff
changeset
|
500 set_globalState(StD); |
|
46c6d2380d4e
Add a shortcuts to change the setpoint to the loop to the 'normal' display when diving. It is only shown when diving in CCR mode and on the loop.
heinrichsweikamp
parents:
774
diff
changeset
|
501 |
|
46c6d2380d4e
Add a shortcuts to change the setpoint to the loop to the 'normal' display when diving. It is only shown when diving in CCR mode and on the loop.
heinrichsweikamp
parents:
774
diff
changeset
|
502 break; |
| 38 | 503 case StDBEAR: // t5_gauge |
|
774
6169309d6eb9
more menu items for the compass menu: Delete bearing, and reset to land based bearing. I have also re-enabled the real time bearing display in the menu - makes it easier to set the correct bearing. (mikeller)
heinrichsweikamp
parents:
773
diff
changeset
|
504 setCompassHeading((uint16_t)stateUsed->lifeData.compass_heading); |
| 38 | 505 set_globalState(StD); |
| 506 break; | |
| 507 | |
| 508 case StDRAVG: // t5_gauge | |
| 509 timer_Stopwatch_Restart(); | |
| 510 set_globalState(StD); | |
| 511 break; | |
| 512 | |
| 513 case StDQUIT: // t6_apnea | |
| 514 set_globalState(StD); // used to end StDQUIT, is called before everything else because changes are made in the next lines | |
| 515 if(is_stateUsedSetToSim()) | |
| 516 Sim_Quit(); | |
| 517 else | |
| 518 dataOutGetPointer()->setEndDive = 1; | |
| 519 break; | |
| 613 | 520 case StDMARK: stateUsedWrite->events.manualMarker = 1; |
| 521 set_globalState(StD); | |
| 522 break; | |
| 38 | 523 |
|
619
8fa2de4414a8
Added t3 quick menu for marker synchronisation:
Ideenmodellierer
parents:
613
diff
changeset
|
524 case StDCHECK: MiniLiveLogbook_checkMarker(); |
|
8fa2de4414a8
Added t3 quick menu for marker synchronisation:
Ideenmodellierer
parents:
613
diff
changeset
|
525 break; |
| 38 | 526 default: |
| 527 break; | |
| 528 } | |
| 529 } | |
| 530 } | |
| 531 | |
| 532 | |
| 533 void tHome_findNextStop(const uint16_t *list, uint8_t *depthOutMeter, uint16_t *lengthOutSeconds) | |
| 534 { | |
| 535 uint8_t ptr = DECOINFO_STRUCT_MAX_STOPS - 1; | |
| 536 | |
| 537 while(ptr && !list[ptr]) | |
| 538 ptr--; | |
| 539 | |
| 540 *lengthOutSeconds = list[ptr]; | |
| 541 if(!(*lengthOutSeconds)) | |
| 542 { | |
| 543 *depthOutMeter = 0; | |
| 544 } | |
| 545 else | |
| 546 if(ptr == 0) | |
| 547 { | |
| 548 *depthOutMeter = (uint8_t)((stateUsed->diveSettings.last_stop_depth_bar*10.0f) + 0.1f); | |
| 549 } | |
| 550 else | |
| 551 { | |
| 552 ptr -= 1; | |
| 553 *depthOutMeter = (uint8_t)(((stateUsed->diveSettings.input_second_to_last_stop_depth_bar + (stateUsed->diveSettings.input_next_stop_increment_depth_bar * ptr))*10.0f) + 0.1f); | |
| 554 } | |
| 555 } | |
| 556 | |
| 557 | |
| 558 void tHome_change_field_button_pressed(void) | |
| 559 { | |
| 560 tHome_tick_count_field = 0; | |
| 576 | 561 tHome_tick_count_o2sens = 0; |
| 38 | 562 if(settingsGetPointer()->design == 7) |
| 563 t7_change_field(); | |
| 564 } | |
| 565 | |
| 566 | |
|
361
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
289
diff
changeset
|
567 void tHome_change_customview_button_pressed(uint8_t action) |
| 38 | 568 { |
| 569 tHome_tick_count_cview = 0; | |
| 576 | 570 tHome_tick_count_o2sens = 0; |
| 571 | |
| 38 | 572 if(settingsGetPointer()->design == 7) |
|
361
b111fc4250e9
Pass action to customer vie update function.
Ideenmodellierer
parents:
289
diff
changeset
|
573 t7_change_customview(action); |
| 38 | 574 else |
| 575 if(settingsGetPointer()->design == 3) | |
|
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
576 t3_change_customview(action); |
| 38 | 577 else |
| 578 if(settingsGetPointer()->design == 5) | |
|
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
579 t5_change_customview(action); |
| 38 | 580 else |
| 581 if(settingsGetPointer()->design == 6) | |
|
386
39c147e47c1c
Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents:
384
diff
changeset
|
582 t6_change_customview(action); |
| 38 | 583 } |
| 584 | |
| 505 | 585 uint8_t tHome_getNumberOfAvailableCVs(const uint8_t* pcv_list) |
| 586 { | |
| 587 uint8_t cnt = 0; | |
| 588 | |
| 589 while((pcv_list[cnt] != CVIEW_END) && (pcv_list[cnt] != CVIEW_T3_END)) | |
| 590 { | |
| 591 cnt++; | |
| 592 if (cnt > 100) /* just in case an invalid list has been provided... */ | |
| 593 { | |
| 594 break; | |
| 595 } | |
| 596 } | |
| 597 cnt--; /* do not count end token */ | |
| 598 return cnt; | |
| 599 } | |
| 38 | 600 |
| 601 void tHome_tick(void) | |
| 602 { | |
| 603 uint16_t field = settingsGetPointer()->tX_userselectedLeftLowerCornerTimeout; | |
| 604 uint16_t cview = settingsGetPointer()->tX_customViewTimeout; | |
| 605 | |
| 606 if(field) | |
| 607 { | |
| 608 tHome_tick_count_field++; | |
| 609 if(tHome_tick_count_field > (field * 10)) | |
| 610 { | |
| 611 tHome_tick_count_field = 0; | |
| 612 if(settingsGetPointer()->design == 7) | |
| 613 { | |
| 614 t7_set_field_to_primary(); | |
| 615 } | |
| 616 } | |
| 617 } | |
| 618 | |
| 619 if(cview) | |
| 620 { | |
| 621 tHome_tick_count_cview++; | |
| 622 if(tHome_tick_count_cview > (cview *10)) | |
| 623 { | |
| 624 tHome_tick_count_cview = 0; | |
| 625 if(settingsGetPointer()->design == 7) | |
| 626 { | |
| 627 t7_set_customview_to_primary(); | |
| 628 } | |
|
541
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
516
diff
changeset
|
629 if(settingsGetPointer()->design == 3) |
|
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
516
diff
changeset
|
630 { |
|
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
516
diff
changeset
|
631 t3_set_customview_to_primary(); |
|
6fbf7cd391cb
Added default view selection and auto return to view to t3 visualization:
Ideenmodellierer
parents:
516
diff
changeset
|
632 } |
| 38 | 633 } |
| 634 } | |
| 576 | 635 |
|
685
980d7f8d5530
Bugfix automatic switch to o2 sensor custom view:
Ideenmodellierer
parents:
633
diff
changeset
|
636 if((stateUsed->mode == MODE_SURFACE) && (stateUsed->diveSettings.ppo2sensors_deactivated != 0x07) && (stateUsed->diveSettings.ccrOption != 0) && (!t7_customview_disabled(CVIEW_sensors))) |
| 576 | 637 { |
| 638 tHome_tick_count_o2sens++; | |
| 639 if(tHome_tick_count_o2sens > AUTORETURN_O2SENS) | |
| 640 { | |
| 641 tHome_tick_count_o2sens = 0; | |
| 642 t7_select_customview(CVIEW_sensors); | |
| 643 } | |
| 644 } | |
| 38 | 645 } |
| 646 | |
| 647 | |
| 648 uint32_t tHome_DateCode(RTC_DateTypeDef *dateInput) | |
| 649 { | |
| 650 uint32_t answer = 0; | |
| 651 | |
| 652 answer = 0; | |
| 653 answer += (dateInput->Year & 0x7F)<< 9; | |
| 654 answer += (dateInput->Month & 0x0F)<< 5; | |
| 655 answer += (dateInput->Date & 0x1F); | |
| 656 | |
| 657 return answer; | |
| 658 } | |
| 659 | |
| 660 | |
| 661 uint8_t tHome_gas_writer(uint8_t oxygen_percentage, uint8_t helium_percentage, char *text) | |
| 662 { | |
| 663 if(oxygen_percentage == 100) | |
| 664 return (uint8_t) snprintf(text,10,"Oxy"); | |
| 665 else if((oxygen_percentage == 21) && (!helium_percentage)) | |
| 666 return (uint8_t) snprintf(text,10,"Air"); | |
| 667 else if(!helium_percentage) | |
| 668 return (uint8_t) snprintf(text,10,"NX%02i",oxygen_percentage); | |
| 669 else if((oxygen_percentage + helium_percentage) == 100) | |
| 670 return (uint8_t) snprintf(text,10,"HX%02i",oxygen_percentage); | |
| 671 else | |
| 672 return (uint8_t) snprintf(text,10,"%02i/%02i",oxygen_percentage,helium_percentage); | |
| 673 } | |
| 674 | |
| 675 uint8_t tHome_show_lost_connection_count(GFX_DrawCfgScreen *ScreenToWriteOn) | |
| 676 { | |
| 208 | 677 static uint8_t LastKnowRTEState = SPI_RX_STATE_INVALID; |
| 678 | |
| 99 | 679 if(!SPI_MIN_ERROR_SHOW) return 0; |
|
172
c659fda83e44
Minor: Button defaults, release date adjusted, use SPI_SHOW_SYNC_STATS
heinrichsweikamp
parents:
138
diff
changeset
|
680 if(DataEX_lost_connection_count()>=SPI_MIN_ERROR_SHOW && SPI_SHOW_SYNC_STATS){ |
| 38 | 681 |
| 99 | 682 char text[64]; |
| 38 | 683 |
| 82 | 684 SDataExchangeSlaveToMaster* dataIn=get_dataInPointer(); |
| 208 | 685 SDataReceiveFromMaster* pDataOut = dataOutGetPointer(); |
| 82 | 686 |
|
493
b560e474e319
Added possibility to switch between "classic" bigfont views and a selection with a new information combination
Ideenmodellierer
parents:
386
diff
changeset
|
687 snprintf(text,32,"spi err:\002 %ld/%ld",DataEX_lost_connection_count(),get_num_SPI_CALLBACKS()); |
| 99 | 688 Gfx_write_label_var(ScreenToWriteOn, 100,300, 0,&FontT24,CLUT_ButtonSymbols,text); |
| 82 | 689 |
| 104 | 690 // snprintf(text,32,"header:\002%X%X%X%X",dataIn->header.checkCode[0],dataIn->header.checkCode[1],dataIn->header.checkCode[2],dataIn->header.checkCode[3]); |
| 691 // Gfx_write_label_var(ScreenToWriteOn, 350,550, 0,&FontT24,CLUT_ButtonSymbols,text); | |
| 82 | 692 |
| 208 | 693 //snprintf(text,32,"footer:\002%X%X%X%X",dataIn->footer.checkCode[0],dataIn->footer.checkCode[1],dataIn->footer.checkCode[2],dataIn->footer.checkCode[3]); |
| 694 | |
| 695 /* data shifted => ignore received data */ | |
| 696 if((pDataOut->header.checkCode[SPI_HEADER_INDEX_RX_STATE] == SPI_RX_STATE_SHIFTED) || (pDataOut->header.checkCode[SPI_HEADER_INDEX_RX_STATE] == SPI_RX_STATE_OFFLINE)) | |
| 697 { | |
| 698 dataIn->header.checkCode[SPI_HEADER_INDEX_RX_STATE] = LastKnowRTEState; | |
| 699 } | |
| 700 else | |
| 701 { | |
| 702 LastKnowRTEState =dataIn->header.checkCode[SPI_HEADER_INDEX_RX_STATE]; | |
| 703 } | |
| 704 snprintf(text,32,"RX State M|R:\002%X|%X",pDataOut->header.checkCode[SPI_HEADER_INDEX_RX_STATE], dataIn->header.checkCode[SPI_HEADER_INDEX_RX_STATE] ); | |
| 99 | 705 Gfx_write_label_var(ScreenToWriteOn, 600,800, 0,&FontT24,CLUT_ButtonSymbols,text); |
| 706 } | |
| 82 | 707 |
| 99 | 708 |
| 709 | |
| 710 // snprintf(text,32,"cpt:\002%i",get_num_SPI_CALLBACKS()); | |
| 711 // Gfx_write_label_var(ScreenToWriteOn, 600,800, 90,&FontT24,CLUT_ButtonSymbols,text); | |
| 82 | 712 |
| 713 // snprintf(text,10,"i2c:\002%i",get_DataEX_Error_place()); | |
| 714 // Gfx_write_label_var(ScreenToWriteOn, 600,800, 90,&FontT24,CLUT_ButtonSymbols,text); | |
| 38 | 715 |
| 716 return DataEX_lost_connection_count(); | |
| 717 } |
