Mercurial > public > ostc4
annotate Discovery/Src/tMenuEditXtra.c @ 926:875933272056 Evo_2_23 tip
Bugfix sensor de-/activation handling:
In the previous version a CO2 sensor could cause a not used analog channel to be displayed. Rootcause was that all sensor type, not only o2 sensors, were used for o2 sensor deactivation evaluation. The deactivation state is the criteria if a value is displayed or not.
In the new version only o2 sensor type are used for handling of sensor de-/activation state.
In addition the cursor will now be set to the first valid sensor entry in case sensor slot 0 is empty.
author | Ideenmodellierer |
---|---|
date | Thu, 14 Nov 2024 20:13:18 +0100 |
parents | 49ee233c7a74 |
children |
rev | line source |
---|---|
38 | 1 /////////////////////////////////////////////////////////////////////////////// |
2 /// -*- coding: UTF-8 -*- | |
3 /// | |
4 /// \file Discovery/Src/tMenuEditXtra.c | |
5 /// \brief Menu Edit Xtra - Specials in Divemode like Reset Stopwatch | |
6 /// \author heinrichs weikamp gmbh | |
7 /// \date 02-Mar-2015 | |
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 ------------------------------------------------------------------*/ | |
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:
769
diff
changeset
|
30 #include <stdbool.h> |
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:
769
diff
changeset
|
31 |
38 | 32 #include "tMenuEditXtra.h" |
33 | |
34 #include "gfx_fonts.h" | |
35 #include "simulation.h" | |
36 #include "timer.h" | |
37 #include "tMenuEdit.h" | |
347
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
288
diff
changeset
|
38 #include "data_exchange_main.h" |
547 | 39 #include "motion.h" |
662 | 40 #include "configuration.h" |
845 | 41 #include "tInfoPreDive.h" |
347
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
288
diff
changeset
|
42 |
38 | 43 |
44 /* Private function prototypes -----------------------------------------------*/ | |
45 void openEdit_CompassHeading(void); | |
46 void openEdit_ResetStopwatch(void); | |
47 void openEdit_SimFollowDecostops(void); | |
48 void openEdit_SetManualMarker(void); | |
347
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
288
diff
changeset
|
49 void openEdit_SetEndDive(void); |
552
531e7818b737
Added menu structure to acces viewport calibration:
Ideenmodellierer
parents:
547
diff
changeset
|
50 void openEdit_CalibViewport(void); |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
51 |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
52 static void openEdit_CCRModeSensorOrFixedSP(void); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
53 static void openEdit_Fallback(void); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
54 static void openEdit_Scrubber(void); |
662 | 55 #ifdef ENABLE_PSCR_MODE |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
56 static void openEdit_PSCR(void); |
662 | 57 #endif |
38 | 58 |
59 /* Announced function prototypes -----------------------------------------------*/ | |
60 uint8_t OnAction_CompassHeading (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
710 | 61 uint8_t OnAction_ScrubberTimerId(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
62 static uint8_t OnAction_ScrubberTimerMax(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
63 static uint8_t OnAction_ScrubberReset(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
64 static uint8_t OnAction_ScrubberMode(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
662 | 65 #ifdef ENABLE_PSCR_MODE |
66 static uint8_t OnAction_PSCRO2Drop(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
67 static uint8_t OnAction_PSCRLungRation(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
68 #endif | |
69 | |
38 | 70 /* Exported functions --------------------------------------------------------*/ |
71 | |
710 | 72 |
38 | 73 void openEdit_Xtra(uint8_t line) |
74 { | |
75 set_globalState_Menu_Line(line); | |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
76 |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
77 /* DIVE MODE */ |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
78 if(actual_menu_content != MENU_SURFACE) |
38 | 79 { |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
80 resetMenuEdit(CLUT_MenuPageXtra); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
81 |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
82 switch(line) |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
83 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
84 case 1: |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
85 default: |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
86 openEdit_ResetStopwatch(); |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
87 break; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
88 case 2: |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
89 openEdit_CompassHeading(); |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
90 break; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
91 case 3: |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
92 openEdit_SetManualMarker(); |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
93 break; |
906
49ee233c7a74
Bugfix de-/activation of deco stop consideration in simulator:
ideenmodellierer
parents:
883
diff
changeset
|
94 #ifdef ENABLE_MOTION_CONTROL |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
95 case 4: |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
96 openEdit_CalibViewport(); |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
97 break; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
98 case 5: |
906
49ee233c7a74
Bugfix de-/activation of deco stop consideration in simulator:
ideenmodellierer
parents:
883
diff
changeset
|
99 #else |
49ee233c7a74
Bugfix de-/activation of deco stop consideration in simulator:
ideenmodellierer
parents:
883
diff
changeset
|
100 case 4: |
49ee233c7a74
Bugfix de-/activation of deco stop consideration in simulator:
ideenmodellierer
parents:
883
diff
changeset
|
101 #endif |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
102 if(is_stateUsedSetToSim()) |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
103 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
104 openEdit_SimFollowDecostops(); |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
105 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
106 else |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
107 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
108 openEdit_SetEndDive(); |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
109 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
110 break; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
111 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
112 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
113 else /* surface mode */ |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
114 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
115 switch(line) |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
116 { |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
117 case 1: openEdit_CCRModeSensorOrFixedSP(); |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
118 break; |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
119 case 2: openEdit_Fallback(); |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
120 break; |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
121 case 3: openEdit_Scrubber(); |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
122 break; |
662 | 123 #ifdef ENABLE_PSCR_MODE |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
124 case 4: openEdit_PSCR(); |
662 | 125 break; |
126 #endif | |
883
7755a476f164
Added compile switch for predive check menu:
Ideenmodellierer
parents:
845
diff
changeset
|
127 #ifdef ENABLE_PREDIVE_CHECK |
845 | 128 case 5: openInfo_PreDive(); |
129 break; | |
883
7755a476f164
Added compile switch for predive check menu:
Ideenmodellierer
parents:
845
diff
changeset
|
130 #endif |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
131 default: |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
132 break; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
133 } |
38 | 134 } |
135 } | |
136 | |
137 /* Private functions ---------------------------------------------------------*/ | |
138 void openEdit_ResetStopwatch(void) | |
139 { | |
140 timer_Stopwatch_Restart(); | |
141 exitMenuEdit_to_Home(); | |
142 } | |
143 | |
144 void openEdit_SetManualMarker(void) | |
145 { | |
288
ba229a012ac7
cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents:
272
diff
changeset
|
146 stateUsedWrite->events.manualMarker = 1; |
38 | 147 exitMenuEdit_to_Home(); |
148 } | |
149 | |
347
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
288
diff
changeset
|
150 void openEdit_SetEndDive(void) |
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
288
diff
changeset
|
151 { |
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
288
diff
changeset
|
152 dataOutGetPointer()->setEndDive = 1; |
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
288
diff
changeset
|
153 exitMenuEdit_to_Home(); |
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
288
diff
changeset
|
154 } |
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
288
diff
changeset
|
155 |
38 | 156 void openEdit_SimFollowDecostops(void) |
157 { | |
158 simulation_set_heed_decostops(!simulation_get_heed_decostops()); | |
159 exitMenuEdit_to_Menu_with_Menu_Update(); | |
160 } | |
161 | |
547 | 162 void openEdit_CalibViewport(void) |
163 { | |
164 calibrateViewport(stateUsed->lifeData.compass_roll, stateUsed->lifeData.compass_pitch, stateUsed->lifeData.compass_heading); | |
648
ff2b393e290f
Motion detection: Enable focus after focus calibration:
Ideenmodellierer
parents:
552
diff
changeset
|
165 suspendMotionDetection(0); /* exit to focus mode directly */ |
547 | 166 exitMenuEdit_to_Home(); |
167 } | |
168 | |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
169 |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
170 static void openEdit_CCRModeSensorOrFixedSP(void) |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
171 { |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
172 SSettings *pSettings = settingsGetPointer(); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
173 |
816
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
174 if(pSettings->CCR_Mode == CCRMODE_Sensors) { |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
175 pSettings->CCR_Mode = CCRMODE_FixedSetpoint; |
816
c4ee952b9425
Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents:
811
diff
changeset
|
176 } else { |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
177 pSettings->CCR_Mode = CCRMODE_Sensors; |
811
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
793
diff
changeset
|
178 } |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
179 |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
180 exitEditWithUpdate(); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
181 } |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
182 |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
183 static void openEdit_Fallback(void) |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
184 { |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
185 /* does not work like this resetEnterPressedToStateBeforeButtonAction(); */ |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
186 |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
187 SSettings *pSettings = settingsGetPointer(); |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
188 |
769
6b248bcdbf28
Deactivation of the 'fallback' option when the CCR mode is set to 'Fixed' - this makes it a little clearer that the option has no influence in this mode.
heinrichsweikamp
parents:
758
diff
changeset
|
189 if (pSettings->CCR_Mode == CCRMODE_Sensors) { |
6b248bcdbf28
Deactivation of the 'fallback' option when the CCR mode is set to 'Fixed' - this makes it a little clearer that the option has no influence in this mode.
heinrichsweikamp
parents:
758
diff
changeset
|
190 pSettings->fallbackToFixedSetpoint = (pSettings->fallbackToFixedSetpoint + 1) % 2; |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
191 } |
769
6b248bcdbf28
Deactivation of the 'fallback' option when the CCR mode is set to 'Fixed' - this makes it a little clearer that the option has no influence in this mode.
heinrichsweikamp
parents:
758
diff
changeset
|
192 |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
193 exitMenuEdit_to_Menu_with_Menu_Update_do_not_write_settings_for_this_only(); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
194 } |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
195 |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
196 |
758
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
748
diff
changeset
|
197 static void printScrubberResetText(char *text, SSettings *settings) |
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
748
diff
changeset
|
198 { |
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
748
diff
changeset
|
199 int16_t currentTimerMinutes = settings->scrubberData[settings->scubberActiveId].TimerCur; |
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
748
diff
changeset
|
200 char colour = '\020'; |
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
748
diff
changeset
|
201 if (currentTimerMinutes <= 0) { |
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
748
diff
changeset
|
202 colour = '\025'; |
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
748
diff
changeset
|
203 } else if (currentTimerMinutes <= 30) { |
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
748
diff
changeset
|
204 colour = '\024'; |
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
748
diff
changeset
|
205 } |
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
748
diff
changeset
|
206 snprintf(text, 32, "%c\002%c%03i\016\016 %c\017", TXT_ScrubTimeReset, colour, currentTimerMinutes, TXT_Minutes); |
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
748
diff
changeset
|
207 } |
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
748
diff
changeset
|
208 |
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
748
diff
changeset
|
209 |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
210 static void openEdit_Scrubber(void) |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
211 { |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
212 char text[32]; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
213 uint8_t textIndex = 0; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
214 uint16_t localScrubTimer; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
215 |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
216 SSettings *pSettings = settingsGetPointer(); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
217 |
710 | 218 localScrubTimer = pSettings->scrubberData[pSettings->scubberActiveId].TimerMax; |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
219 |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
220 resetMenuEdit(CLUT_MenuPageXtra); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
221 |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
222 |
710 | 223 snprintf(&text[0], 32,"\001%c",TXT_ScrubTime); |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
224 write_topline(text); |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
225 |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
226 |
710 | 227 snprintf(&text[0], 32,"%c \002#%d",TXT_ScrubTime,pSettings->scubberActiveId); |
228 write_field_button(StMXTRA_ScrubTimer, 20, 780, ME_Y_LINE1, &FontT48, text); | |
229 | |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
230 snprintf(&text[textIndex], 32,\ |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
231 "%c" |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
232 "\016\016(%c)\017" |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
233 ,TXT_ScrubTime |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
234 ,TXT_Maximum); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
235 |
710 | 236 write_label_var( 20, 340, ME_Y_LINE2, &FontT48, text); |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
237 snprintf(&text[textIndex], 32, "\002###\016\016 %c\017",TXT_Minutes); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
238 |
710 | 239 write_field_udigit(StMXTRA_ScrubTimer_Max, 610, 780, ME_Y_LINE2, &FontT48, text,localScrubTimer, 0, 0, 0); |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
240 |
758
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
748
diff
changeset
|
241 printScrubberResetText(text, pSettings); |
710 | 242 write_field_button(StMXTRA_ScrubTimer_Reset, 20, 780, ME_Y_LINE3, &FontT48, text); |
243 | |
244 if(pSettings->scrubberData[pSettings->scubberActiveId].lastDive.WeekDay != 0) | |
245 { | |
246 snprintf(&text[0], 32,"%c%c\002 %02d.%02d.%02d", TXT_2BYTE, TXT2BYTE_SimDiveTime, pSettings->scrubberData[pSettings->scubberActiveId].lastDive.Date, | |
247 pSettings->scrubberData[pSettings->scubberActiveId].lastDive.Month, | |
248 pSettings->scrubberData[pSettings->scubberActiveId].lastDive.Year); | |
249 } | |
250 else | |
251 { | |
252 snprintf(&text[0], 32,"%c%c\002 --.--.--", TXT_2BYTE, TXT2BYTE_SimDiveTime); | |
253 } | |
254 write_label_var( 20, 780, ME_Y_LINE4, &FontT48, text); | |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
255 |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
256 switch(pSettings->scrubTimerMode) |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
257 { |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
258 case SCRUB_TIMER_OFF: |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
259 default: snprintf(&text[0], 32,"%c\002%c%c",TXT_ScrubTimeMode, TXT_2BYTE, TXT2BYTE_MoCtrlNone ); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
260 break; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
261 case SCRUB_TIMER_MINUTES: snprintf(&text[0], 32,"%c\002%c",TXT_ScrubTimeMode, TXT_Minutes ); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
262 break; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
263 case SCRUB_TIMER_PERCENT: snprintf(&text[0], 32,"%c\002%c",TXT_ScrubTimeMode, TXT_Percent ); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
264 break; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
265 } |
710 | 266 write_field_button(StMXTRA_ScrubTimer_OP_Mode, 20, 780, ME_Y_LINE5, &FontT48, text); |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
267 |
710 | 268 setEvent(StMXTRA_ScrubTimer, (uint32_t)OnAction_ScrubberTimerId); |
269 setEvent(StMXTRA_ScrubTimer_Max, (uint32_t)OnAction_ScrubberTimerMax); | |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
270 setEvent(StMXTRA_ScrubTimer_Reset, (uint32_t)OnAction_ScrubberReset); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
271 setEvent(StMXTRA_ScrubTimer_OP_Mode, (uint32_t)OnAction_ScrubberMode); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
272 |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
273 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
274 |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
275 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
276 |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
277 static void openEdit_PSCR(void) |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
278 { |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
279 uint8_t localO2Drop,localLungRatio; |
662 | 280 char text[32]; |
281 SSettings *pSettings = settingsGetPointer(); | |
282 localO2Drop = pSettings->pscr_o2_drop; | |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
283 localLungRatio = pSettings->pscr_lung_ratio; |
662 | 284 |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
285 resetMenuEdit(CLUT_MenuPageXtra); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
286 |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
287 snprintf(text, 32, "\001%c",TXT_PSClosedCircuit); |
662 | 288 write_topline(text); |
289 | |
290 text[0] = '\002'; | |
291 text[1] = '\016'; | |
292 text[2] = '\016'; | |
293 text[3] = '%'; | |
294 text[4] = 0; | |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
295 write_label_fix( 20, 800, ME_Y_LINE1, &FontT48, TXT_PSCRO2Drop); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
296 write_label_var( 435, 780, ME_Y_LINE1, &FontT48, text); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
297 write_field_udigit(StMXTRA_PSCR_O2_Drop, 710, 779, ME_Y_LINE1, &FontT48, "##", (uint32_t)localO2Drop, 0, 0, 0); |
662 | 298 |
299 | |
300 text[0] = '\002'; | |
301 text[1] = '1'; | |
302 text[2] = '/'; | |
303 text[3] = 0; | |
304 | |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
305 write_label_fix( 20, 800, ME_Y_LINE2, &FontT48, TXT_PSCRLungRatio); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
306 write_label_var( 435, 710, ME_Y_LINE2, &FontT48, text); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
307 write_field_udigit(StMXTRA_PSCR_LUNG_RATIO, 710, 779, ME_Y_LINE2, &FontT48, "##", (uint32_t)localLungRatio, 0, 0, 0); |
662 | 308 |
712 | 309 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); |
662 | 310 |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
311 setEvent(StMXTRA_PSCR_O2_Drop, (uint32_t)OnAction_PSCRO2Drop); |
662 | 312 setEvent(StMXTRA_PSCR_LUNG_RATIO, (uint32_t)OnAction_PSCRLungRation); |
313 } | |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
314 |
662 | 315 |
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:
769
diff
changeset
|
316 |
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:
769
diff
changeset
|
317 static uint8_t OnAction_CompassHeadingClear(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) |
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:
769
diff
changeset
|
318 { |
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:
769
diff
changeset
|
319 stateUsedWrite->diveSettings.compassHeading = 0; |
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:
769
diff
changeset
|
320 |
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:
769
diff
changeset
|
321 exitMenuEdit_to_Home_with_Menu_Update(); |
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:
769
diff
changeset
|
322 |
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:
769
diff
changeset
|
323 return EXIT_TO_HOME; |
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:
769
diff
changeset
|
324 } |
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:
769
diff
changeset
|
325 |
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:
769
diff
changeset
|
326 |
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:
769
diff
changeset
|
327 static uint8_t OnAction_CompassHeadingReset(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) |
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:
769
diff
changeset
|
328 { |
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:
769
diff
changeset
|
329 stateUsedWrite->diveSettings.compassHeading = settingsGetPointer()->compassBearing; |
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:
769
diff
changeset
|
330 |
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:
769
diff
changeset
|
331 exitMenuEdit_to_Home_with_Menu_Update(); |
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:
769
diff
changeset
|
332 |
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:
769
diff
changeset
|
333 return EXIT_TO_HOME; |
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:
769
diff
changeset
|
334 } |
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:
769
diff
changeset
|
335 |
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:
769
diff
changeset
|
336 |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
337 static void drawCompassHeadingMenu(bool isRefresh) |
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:
769
diff
changeset
|
338 { |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
339 SSettings *settings = settingsGetPointer(); |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
340 |
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:
769
diff
changeset
|
341 char text[32]; |
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:
769
diff
changeset
|
342 snprintf(text, 32, "\001%c%c", TXT_2BYTE, TXT2BYTE_CompassHeading); |
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:
769
diff
changeset
|
343 write_topline(text); |
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:
769
diff
changeset
|
344 |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
345 uint16_t heading; |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
346 if (settings->compassInertia) { |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
347 heading = (uint16_t)compass_getCompensated(); |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
348 } else { |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
349 heading = (uint16_t)stateUsed->lifeData.compass_heading; |
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
350 } |
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:
769
diff
changeset
|
351 snprintf(text,32,"\001%03i`",heading); |
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:
769
diff
changeset
|
352 write_label_var(0, 800, ME_Y_LINE1, &FontT54, text); |
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:
769
diff
changeset
|
353 |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
354 if (!isRefresh) { |
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:
769
diff
changeset
|
355 snprintf(text, 32, "%c%c", TXT_2BYTE, TXT2BYTE_Set); |
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:
769
diff
changeset
|
356 write_field_button(StMXTRA_CompassHeading, 20, 800, ME_Y_LINE2, &FontT48, text); |
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:
769
diff
changeset
|
357 } else { |
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:
769
diff
changeset
|
358 tMenuEdit_refresh_field(StMXTRA_CompassHeading); |
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:
769
diff
changeset
|
359 } |
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:
769
diff
changeset
|
360 |
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:
769
diff
changeset
|
361 bool headingIsSet = stateUsed->diveSettings.compassHeading; |
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:
769
diff
changeset
|
362 snprintf(text, 32, "%s%c%c", makeGrey(!headingIsSet), TXT_2BYTE, TXT2BYTE_Clear); |
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:
769
diff
changeset
|
363 if (headingIsSet) { |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
364 if (!isRefresh) { |
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:
769
diff
changeset
|
365 write_field_button(StMXTRA_CompassHeadingClear, 20, 800, ME_Y_LINE3, &FontT48, text); |
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:
769
diff
changeset
|
366 } else { |
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:
769
diff
changeset
|
367 tMenuEdit_refresh_field(StMXTRA_CompassHeadingClear); |
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:
769
diff
changeset
|
368 } |
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:
769
diff
changeset
|
369 } else { |
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:
769
diff
changeset
|
370 write_label_var(20, 800, ME_Y_LINE3, &FontT48, text); |
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:
769
diff
changeset
|
371 } |
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:
769
diff
changeset
|
372 |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
373 int16_t compassBearing = settings->compassBearing; |
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:
769
diff
changeset
|
374 bool canSetBearing = compassBearing && compassBearing != stateUsed->diveSettings.compassHeading; |
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:
769
diff
changeset
|
375 snprintf(text, 32, "%s%c%c (%03u`)", makeGrey(!canSetBearing), TXT_2BYTE, TXT2BYTE_Reset, compassBearing); |
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:
769
diff
changeset
|
376 if (canSetBearing) { |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
377 if (!isRefresh) { |
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:
769
diff
changeset
|
378 write_field_button(StMXTRA_CompassHeadingReset, 20, 800, ME_Y_LINE4, &FontT48, text); |
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:
769
diff
changeset
|
379 } else { |
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:
769
diff
changeset
|
380 tMenuEdit_refresh_field(StMXTRA_CompassHeadingReset); |
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:
769
diff
changeset
|
381 } |
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:
769
diff
changeset
|
382 } else { |
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:
769
diff
changeset
|
383 write_label_var(20, 800, ME_Y_LINE4, &FontT48, text); |
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:
769
diff
changeset
|
384 } |
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:
769
diff
changeset
|
385 |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
386 if (!isRefresh) { |
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:
769
diff
changeset
|
387 setEvent(StMXTRA_CompassHeading, (uint32_t)OnAction_CompassHeading); |
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:
769
diff
changeset
|
388 setEvent(StMXTRA_CompassHeadingClear, (uint32_t)OnAction_CompassHeadingClear); |
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:
769
diff
changeset
|
389 setEvent(StMXTRA_CompassHeadingReset, (uint32_t)OnAction_CompassHeadingReset); |
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:
769
diff
changeset
|
390 } |
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:
769
diff
changeset
|
391 |
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:
769
diff
changeset
|
392 write_buttonTextline(TXT2BYTE_ButtonBack, TXT2BYTE_ButtonEnter, TXT2BYTE_ButtonNext); |
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:
769
diff
changeset
|
393 } |
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:
769
diff
changeset
|
394 |
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:
769
diff
changeset
|
395 |
38 | 396 void refresh_CompassHeading(void) |
397 { | |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
398 drawCompassHeadingMenu(true); |
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:
769
diff
changeset
|
399 } |
38 | 400 |
401 | |
402 void openEdit_CompassHeading(void) | |
403 { | |
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
404 drawCompassHeadingMenu(false); |
38 | 405 } |
406 | |
407 | |
408 uint8_t OnAction_CompassHeading (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
409 { | |
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:
769
diff
changeset
|
410 setCompassHeading((uint16_t)stateUsed->lifeData.compass_heading); |
38 | 411 exitMenuEdit_to_Home_with_Menu_Update(); |
412 return EXIT_TO_HOME; | |
413 } | |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
414 |
710 | 415 |
416 uint8_t OnAction_ScrubberTimerId(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
417 { | |
418 char text[32]; | |
419 SSettings *pSettings; | |
420 pSettings = settingsGetPointer(); | |
421 | |
422 if(pSettings->scubberActiveId == 0) | |
423 { | |
424 pSettings->scubberActiveId = 1; | |
425 } | |
426 else | |
427 { | |
428 pSettings->scubberActiveId = 0; | |
429 } | |
430 | |
431 | |
432 snprintf(&text[0], 32,"%c \002#%d",TXT_ScrubTime,pSettings->scubberActiveId); | |
433 tMenuEdit_newButtonText(StMXTRA_ScrubTimer, text); | |
434 | |
758
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
748
diff
changeset
|
435 printScrubberResetText(text, pSettings); |
710 | 436 tMenuEdit_newButtonText(StMXTRA_ScrubTimer_Reset, text); |
437 | |
438 tMenuEdit_newInput(StMXTRA_ScrubTimer_Max, pSettings->scrubberData[pSettings->scubberActiveId].TimerMax, 0, 0, 0); | |
439 | |
440 if(pSettings->scrubberData[pSettings->scubberActiveId].lastDive.WeekDay != 0) | |
441 { | |
442 snprintf(&text[0], 32,"%c%c\002 %02d.%02d.%02d", TXT_2BYTE, TXT2BYTE_SimDiveTime, pSettings->scrubberData[pSettings->scubberActiveId].lastDive.Date, | |
443 pSettings->scrubberData[pSettings->scubberActiveId].lastDive.Month, | |
444 pSettings->scrubberData[pSettings->scubberActiveId].lastDive.Year); | |
445 } | |
446 else | |
447 { | |
448 snprintf(&text[0], 32,"%c%c\002 --.--.--", TXT_2BYTE, TXT2BYTE_SimDiveTime); | |
449 } | |
450 clean_content( 20, 780, ME_Y_LINE4, &FontT48); | |
451 write_label_var( 20, 780, ME_Y_LINE4, &FontT48, text); | |
452 | |
453 return UNSPECIFIC_RETURN; | |
454 } | |
455 | |
456 static uint8_t OnAction_ScrubberTimerMax(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
457 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
458 SSettings *pSettings; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
459 uint8_t digitContentNew = EXIT_TO_MENU; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
460 uint32_t newScrubberTime; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
461 |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
462 if(action == ACTION_BUTTON_ENTER) |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
463 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
464 return digitContent; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
465 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
466 if(action == ACTION_BUTTON_ENTER_FINAL) |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
467 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
468 evaluateNewString(editId, &newScrubberTime, 0, 0, 0); |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
469 |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
470 if(newScrubberTime > MAX_SCRUBBER_TIME) |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
471 newScrubberTime = MAX_SCRUBBER_TIME; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
472 |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
473 pSettings = settingsGetPointer(); |
710 | 474 pSettings->scrubberData[pSettings->scubberActiveId].TimerMax = newScrubberTime; |
475 if(pSettings->scrubberData[pSettings->scubberActiveId].TimerCur > newScrubberTime) | |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
476 { |
710 | 477 pSettings->scrubberData[pSettings->scubberActiveId].TimerCur = newScrubberTime; |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
478 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
479 |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
480 tMenuEdit_newInput(editId, newScrubberTime, 0, 0, 0); |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
481 digitContentNew = UNSPECIFIC_RETURN; |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
482 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
483 if(action == ACTION_BUTTON_NEXT) |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
484 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
485 digitContentNew = digitContent + 1; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
486 if(digitContentNew > '9') |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
487 digitContentNew = '0'; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
488 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
489 if(action == ACTION_BUTTON_BACK) |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
490 { |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
491 digitContentNew = digitContent - 1; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
492 if(digitContentNew < '0') |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
493 digitContentNew = '9'; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
494 } |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
495 return digitContentNew; |
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
496 } |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
497 |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
498 uint8_t OnAction_ScrubberReset(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
499 { |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
500 char text[32]; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
501 SSettings *pSettings; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
502 pSettings = settingsGetPointer(); |
710 | 503 pSettings->scrubberData[pSettings->scubberActiveId].TimerCur = pSettings->scrubberData[pSettings->scubberActiveId].TimerMax; |
504 pSettings->scrubberData[pSettings->scubberActiveId].lastDive.WeekDay = 0; /* invalidate date */ | |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
505 |
758
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
748
diff
changeset
|
506 printScrubberResetText(text, pSettings); |
710 | 507 tMenuEdit_newButtonText(StMXTRA_ScrubTimer_Reset, text); |
508 | |
509 snprintf(&text[0], 32,"%c%c\002 --.--.--", TXT_2BYTE, TXT2BYTE_SimDiveTime); | |
510 clean_content( 20, 780, ME_Y_LINE4, &FontT48); | |
511 write_label_var( 20, 780, ME_Y_LINE4, &FontT48, text); | |
512 | |
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
513 |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
514 return UNSPECIFIC_RETURN; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
515 } |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
516 |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
517 uint8_t OnAction_ScrubberMode(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
518 { |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
519 char text[32]; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
520 uint8_t newMode; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
521 SSettings *pSettings; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
522 pSettings = settingsGetPointer(); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
523 newMode = pSettings->scrubTimerMode + 1; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
524 if(newMode >= SCRUB_TIMER_END) |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
525 { |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
526 newMode = SCRUB_TIMER_OFF; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
527 } |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
528 pSettings->scrubTimerMode = newMode; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
529 |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
530 switch(pSettings->scrubTimerMode) |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
531 { |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
532 case SCRUB_TIMER_OFF: |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
533 default: snprintf(&text[0], 32,"%c\002%c%c",TXT_ScrubTimeMode, TXT_2BYTE, TXT2BYTE_MoCtrlNone ); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
534 break; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
535 case SCRUB_TIMER_MINUTES: snprintf(&text[0], 32,"%c\002%c",TXT_ScrubTimeMode, TXT_Minutes ); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
536 break; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
537 case SCRUB_TIMER_PERCENT: snprintf(&text[0], 32,"%c\002%c",TXT_ScrubTimeMode, TXT_Percent ); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
538 break; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
539 } |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
540 tMenuEdit_newButtonText(StMXTRA_ScrubTimer_OP_Mode, text); |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
541 |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
542 return UNSPECIFIC_RETURN; |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
543 } |
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
544 |
662 | 545 #ifdef ENABLE_PSCR_MODE |
546 static uint8_t OnAction_PSCRO2Drop(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
547 { | |
548 SSettings *pSettings; | |
549 uint8_t digitContentNew = EXIT_TO_MENU; | |
550 uint32_t newO2Drop; | |
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
551 |
662 | 552 if(action == ACTION_BUTTON_ENTER) |
553 { | |
554 return digitContent; | |
555 } | |
556 if(action == ACTION_BUTTON_ENTER_FINAL) | |
557 { | |
558 evaluateNewString(editId, &newO2Drop, 0, 0, 0); | |
559 | |
560 if(newO2Drop > PSCR_MAX_O2_DROP) | |
561 newO2Drop = PSCR_MAX_O2_DROP; | |
562 | |
563 pSettings = settingsGetPointer(); | |
564 pSettings->pscr_o2_drop = newO2Drop; | |
565 | |
566 tMenuEdit_newInput(editId, newO2Drop, 0, 0, 0); | |
793 | 567 digitContentNew = UPDATE_DIVESETTINGS; |
662 | 568 } |
569 if(action == ACTION_BUTTON_NEXT) | |
570 { | |
571 digitContentNew = digitContent + 1; | |
572 if(digitContentNew > '9') | |
573 digitContentNew = '0'; | |
574 } | |
575 if(action == ACTION_BUTTON_BACK) | |
576 { | |
577 digitContentNew = digitContent - 1; | |
578 if(digitContentNew < '0') | |
579 digitContentNew = '9'; | |
580 } | |
581 return digitContentNew; | |
582 } | |
583 | |
584 static uint8_t OnAction_PSCRLungRation(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
585 { | |
586 SSettings *pSettings; | |
587 uint8_t digitContentNew = EXIT_TO_MENU; | |
588 uint32_t newLungRatio; | |
589 | |
590 if(action == ACTION_BUTTON_ENTER) | |
591 { | |
592 return digitContent; | |
593 } | |
594 if(action == ACTION_BUTTON_ENTER_FINAL) | |
595 { | |
596 evaluateNewString(editId, &newLungRatio, 0, 0, 0); | |
597 | |
598 if(newLungRatio > PSCR_MAX_LUNG_RATIO) | |
599 newLungRatio = PSCR_MAX_LUNG_RATIO; | |
600 | |
601 if(newLungRatio < PSCR_MIN_LUNG_RATIO) | |
602 newLungRatio = PSCR_MIN_LUNG_RATIO; | |
603 | |
604 pSettings = settingsGetPointer(); | |
605 pSettings->pscr_lung_ratio = newLungRatio; | |
606 | |
607 tMenuEdit_newInput(editId, newLungRatio, 0, 0, 0); | |
793 | 608 digitContentNew = UPDATE_DIVESETTINGS; |
662 | 609 } |
610 if(action == ACTION_BUTTON_NEXT) | |
611 { | |
612 digitContentNew = digitContent + 1; | |
613 if(digitContentNew > '9') | |
614 digitContentNew = '0'; | |
615 } | |
616 if(action == ACTION_BUTTON_BACK) | |
617 { | |
618 digitContentNew = digitContent - 1; | |
619 if(digitContentNew < '0') | |
620 digitContentNew = '9'; | |
621 } | |
622 return digitContentNew; | |
623 } | |
624 #endif | |
625 | |
626 |