Mercurial > public > ostc4
annotate Discovery/Src/tMenuEditXtra.c @ 1042:7efc8baa3ffa GasConsumption
Reset timeout after Bluetooth disconnect:
The counter triggering the shutdown for the OSTC was not reseted after closing the Bluetooth connection. As result an unintendet shutdown could happen. To avoid this the counter is now reseted during disconnection.
| author | Ideenmodellierer |
|---|---|
| date | Mon, 27 Oct 2025 20:06:27 +0100 |
| parents | 808153ba3fec |
| children | 52fd91414b6c |
| 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 |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
44 #define SCRUBBER_COUNT 2 |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
45 |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
46 |
| 38 | 47 /* Private function prototypes -----------------------------------------------*/ |
| 48 void openEdit_CompassHeading(void); | |
| 49 void openEdit_ResetStopwatch(void); | |
| 50 void openEdit_SimFollowDecostops(void); | |
| 51 void openEdit_SetManualMarker(void); | |
|
347
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
288
diff
changeset
|
52 void openEdit_SetEndDive(void); |
|
552
531e7818b737
Added menu structure to acces viewport calibration:
Ideenmodellierer
parents:
547
diff
changeset
|
53 void openEdit_CalibViewport(void); |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
54 |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
55 static void openEdit_CCRModeSensorOrFixedSP(void); |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
56 static void openEdit_Fallback(void); |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
57 static void openEdit_Scrubber(void); |
| 662 | 58 #ifdef ENABLE_PSCR_MODE |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
59 static void openEdit_PSCR(void); |
| 662 | 60 #endif |
| 38 | 61 |
| 62 /* Announced function prototypes -----------------------------------------------*/ | |
| 63 uint8_t OnAction_CompassHeading (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
| 710 | 64 uint8_t OnAction_ScrubberTimerId(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 65 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
|
66 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
|
67 static uint8_t OnAction_ScrubberMode(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 998 | 68 static uint8_t OnAction_ScrubberActive(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 662 | 69 #ifdef ENABLE_PSCR_MODE |
| 70 static uint8_t OnAction_PSCRO2Drop(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
| 71 static uint8_t OnAction_PSCRLungRation(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
| 72 #endif | |
| 73 | |
| 38 | 74 /* Exported functions --------------------------------------------------------*/ |
| 75 | |
| 998 | 76 static uint8_t scrubberMenuId = 0; |
| 710 | 77 |
| 38 | 78 void openEdit_Xtra(uint8_t line) |
| 79 { | |
| 80 set_globalState_Menu_Line(line); | |
|
707
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 /* DIVE MODE */ |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
83 if(actual_menu_content != MENU_SURFACE) |
| 38 | 84 { |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
85 resetMenuEdit(CLUT_MenuPageXtra); |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
86 |
|
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
87 switch(line) |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
88 { |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
89 case 1: |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
90 default: |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
91 openEdit_ResetStopwatch(); |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
92 break; |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
93 case 2: |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
94 openEdit_CompassHeading(); |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
95 break; |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
96 case 3: |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
97 openEdit_SetManualMarker(); |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
98 break; |
|
906
49ee233c7a74
Bugfix de-/activation of deco stop consideration in simulator:
ideenmodellierer
parents:
883
diff
changeset
|
99 #ifdef ENABLE_MOTION_CONTROL |
|
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
100 case 4: |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
101 openEdit_CalibViewport(); |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
102 break; |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
103 case 5: |
|
906
49ee233c7a74
Bugfix de-/activation of deco stop consideration in simulator:
ideenmodellierer
parents:
883
diff
changeset
|
104 #else |
|
49ee233c7a74
Bugfix de-/activation of deco stop consideration in simulator:
ideenmodellierer
parents:
883
diff
changeset
|
105 case 4: |
|
49ee233c7a74
Bugfix de-/activation of deco stop consideration in simulator:
ideenmodellierer
parents:
883
diff
changeset
|
106 #endif |
|
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
107 if(is_stateUsedSetToSim()) |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
108 { |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
109 openEdit_SimFollowDecostops(); |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
110 } |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
111 else |
|
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 openEdit_SetEndDive(); |
|
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 break; |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
116 } |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
117 } |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
118 else /* surface mode */ |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
119 { |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
120 switch(line) |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
121 { |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
122 case 1: openEdit_CCRModeSensorOrFixedSP(); |
|
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
123 break; |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
124 case 2: openEdit_Fallback(); |
|
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
125 break; |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
126 case 3: openEdit_Scrubber(); |
|
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
127 break; |
| 662 | 128 #ifdef ENABLE_PSCR_MODE |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
129 case 4: openEdit_PSCR(); |
| 662 | 130 break; |
| 131 #endif | |
|
883
7755a476f164
Added compile switch for predive check menu:
Ideenmodellierer
parents:
845
diff
changeset
|
132 #ifdef ENABLE_PREDIVE_CHECK |
| 845 | 133 case 5: openInfo_PreDive(); |
| 134 break; | |
|
883
7755a476f164
Added compile switch for predive check menu:
Ideenmodellierer
parents:
845
diff
changeset
|
135 #endif |
|
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
136 default: |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
137 break; |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
138 } |
| 38 | 139 } |
| 140 } | |
| 141 | |
| 142 /* Private functions ---------------------------------------------------------*/ | |
| 143 void openEdit_ResetStopwatch(void) | |
| 144 { | |
| 145 timer_Stopwatch_Restart(); | |
| 146 exitMenuEdit_to_Home(); | |
| 147 } | |
| 148 | |
| 149 void openEdit_SetManualMarker(void) | |
| 150 { | |
|
288
ba229a012ac7
cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents:
272
diff
changeset
|
151 stateUsedWrite->events.manualMarker = 1; |
| 38 | 152 exitMenuEdit_to_Home(); |
| 153 } | |
| 154 | |
|
347
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
288
diff
changeset
|
155 void openEdit_SetEndDive(void) |
|
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
288
diff
changeset
|
156 { |
|
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
288
diff
changeset
|
157 dataOutGetPointer()->setEndDive = 1; |
|
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
288
diff
changeset
|
158 exitMenuEdit_to_Home(); |
|
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
288
diff
changeset
|
159 } |
|
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
288
diff
changeset
|
160 |
| 38 | 161 void openEdit_SimFollowDecostops(void) |
| 162 { | |
| 163 simulation_set_heed_decostops(!simulation_get_heed_decostops()); | |
| 164 exitMenuEdit_to_Menu_with_Menu_Update(); | |
| 165 } | |
| 166 | |
| 547 | 167 void openEdit_CalibViewport(void) |
| 168 { | |
| 169 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
|
170 suspendMotionDetection(0); /* exit to focus mode directly */ |
| 547 | 171 exitMenuEdit_to_Home(); |
| 172 } | |
| 173 | |
|
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
174 |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
175 static void openEdit_CCRModeSensorOrFixedSP(void) |
|
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
176 { |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
177 SSettings *pSettings = settingsGetPointer(); |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
178 |
|
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
|
179 if(pSettings->CCR_Mode == CCRMODE_Sensors) { |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
180 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
|
181 } else { |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
182 pSettings->CCR_Mode = CCRMODE_Sensors; |
|
811
4c41d9a18c7f
Added function to skip lines which are not needed for operation:
Ideenmodellierer
parents:
793
diff
changeset
|
183 } |
|
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
184 |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
185 exitEditWithUpdate(); |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
186 } |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
187 |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
188 static void openEdit_Fallback(void) |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
189 { |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
190 /* does not work like this resetEnterPressedToStateBeforeButtonAction(); */ |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
191 |
|
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
192 SSettings *pSettings = settingsGetPointer(); |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
193 |
|
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
|
194 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
|
195 pSettings->fallbackToFixedSetpoint = (pSettings->fallbackToFixedSetpoint + 1) % 2; |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
196 } |
|
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
|
197 |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
198 exitMenuEdit_to_Menu_with_Menu_Update_do_not_write_settings_for_this_only(); |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
199 } |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
200 |
|
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
201 |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
202 static void printScrubberResetText(char *text, SSettings *settings, uint8_t scrubberId, bool isActive) |
|
758
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
748
diff
changeset
|
203 { |
| 998 | 204 int16_t currentTimerMinutes = settings->scrubberData[scrubberId].TimerCur; |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
205 |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
206 char *colour = ""; |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
207 if (isActive) { |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
208 if (currentTimerMinutes <= 0) { |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
209 colour = "\025"; |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
210 } else if (currentTimerMinutes <= 30) { |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
211 colour = "\024"; |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
212 } |
|
758
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
748
diff
changeset
|
213 } |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
214 snprintf(text, 32, "%s%c\002%s%03i\016\016 %c\017", makeGrey(!isActive), TXT_ScrubTimeReset, colour, currentTimerMinutes, TXT_Minutes); |
|
758
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
748
diff
changeset
|
215 } |
|
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
748
diff
changeset
|
216 |
|
b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
heinrichsweikamp
parents:
748
diff
changeset
|
217 |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
218 static void drawScrubberMenu(bool isRefresh) |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
219 { |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
220 SSettings *settings = settingsGetPointer(); |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
221 |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
222 resetMenuContentStructure(); |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
223 |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
224 char text[32]; |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
225 snprintf(text, 32, "%c \002#%d", TXT_ScrubTime, scrubberMenuId); |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
226 if (isRefresh) { |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
227 clean_content(20, 780, ME_Y_LINE1, &FontT48); |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
228 } |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
229 write_field_button(StMXTRA_ScrubTimer, 20, 780, ME_Y_LINE1, &FontT48, text); |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
230 |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
231 bool currentScrubberIsActive = settings->scrubberActiveId & (1 << scrubberMenuId); |
| 710 | 232 |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
233 snprintf(text, 32, "%c %c \002%c", TXT_ScrubTime, TXT_Active, printCheckbox(currentScrubberIsActive)); |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
234 if (isRefresh) { |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
235 clean_content(20, 780, ME_Y_LINE2, &FontT48); |
| 998 | 236 } |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
237 write_field_button(StMXTRA_ScrubTimer_Active, 20, 780, ME_Y_LINE2, &FontT48, text); |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
238 |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
239 snprintf(text, 32, "%s%c\016\016(%c)\017", makeGrey(!currentScrubberIsActive), TXT_ScrubTime, TXT_Maximum); |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
240 if (isRefresh) { |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
241 clean_content(20, 340, ME_Y_LINE3, &FontT48); |
| 998 | 242 } |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
243 write_label_var(20, 340, ME_Y_LINE3, &FontT48, text); |
| 998 | 244 |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
245 uint16_t timerMax = settings->scrubberData[scrubberMenuId].TimerMax; |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
246 if (isRefresh) { |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
247 clean_content(610, 780, ME_Y_LINE3, &FontT48); |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
248 } |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
249 if (currentScrubberIsActive) { |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
250 snprintf(text, 32, "%s\002###\016\016 %c\017", makeGrey(!currentScrubberIsActive), TXT_Minutes); |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
251 write_field_udigit(StMXTRA_ScrubTimer_Max, 610, 780, ME_Y_LINE3, &FontT48, text, timerMax, 0, 0, 0); |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
252 } else { |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
253 snprintf(text, 32, "%s\002%03i\016\016 %c\017", makeGrey(!currentScrubberIsActive), timerMax, TXT_Minutes); |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
254 write_label_var(610, 780, ME_Y_LINE3, &FontT48, text); |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
255 } |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
256 |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
257 printScrubberResetText(text, settings, scrubberMenuId, currentScrubberIsActive); |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
258 if (isRefresh) { |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
259 clean_content(20, 780, ME_Y_LINE4, &FontT48); |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
260 } |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
261 if (currentScrubberIsActive) { |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
262 write_field_button(StMXTRA_ScrubTimer_Reset, 20, 780, ME_Y_LINE4, &FontT48, text); |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
263 } else { |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
264 write_label_var(20, 780, ME_Y_LINE4, &FontT48, text); |
| 710 | 265 } |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
266 |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
267 if (settings->scrubberData[scrubberMenuId].lastDive.WeekDay != 0) { |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
268 snprintf(text, 32, "%s%c%c\002 %02d.%02d.%02d", makeGrey(!currentScrubberIsActive), TXT_2BYTE, TXT2BYTE_SimDiveTime, settings->scrubberData[scrubberMenuId].lastDive.Date, settings->scrubberData[scrubberMenuId].lastDive.Month, settings->scrubberData[scrubberMenuId].lastDive.Year); |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
269 } else { |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
270 snprintf(&text[0], 32, "%s%c%c\002 --.--.--", makeGrey(!currentScrubberIsActive), TXT_2BYTE, TXT2BYTE_SimDiveTime); |
| 710 | 271 } |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
272 if (isRefresh) { |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
273 clean_content(20, 780, ME_Y_LINE5, &FontT48); |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
274 } |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
275 write_label_var(20, 780, ME_Y_LINE5, &FontT48, text); |
|
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
276 |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
277 if (isRefresh) { |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
278 switch (settings->scrubTimerMode) { |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
279 case SCRUB_TIMER_MINUTES: |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
280 default: |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
281 snprintf(text, 32, "%c\002%c", TXT_ScrubTimeMode, TXT_Minutes); |
|
1014
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
282 |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
283 break; |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
284 case SCRUB_TIMER_PERCENT: |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
285 snprintf(text, 32, "%c\002%c", TXT_ScrubTimeMode, TXT_Percent); |
|
1014
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
286 |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
287 break; |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
288 } |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
289 write_field_button(StMXTRA_ScrubTimer_OP_Mode, 20, 780, ME_Y_LINE6, &FontT48, text); |
|
1014
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
290 } |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
291 |
| 710 | 292 setEvent(StMXTRA_ScrubTimer, (uint32_t)OnAction_ScrubberTimerId); |
| 998 | 293 setEvent(StMXTRA_ScrubTimer_Active, (uint32_t)OnAction_ScrubberActive); |
| 710 | 294 setEvent(StMXTRA_ScrubTimer_Max, (uint32_t)OnAction_ScrubberTimerMax); |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
295 setEvent(StMXTRA_ScrubTimer_Reset, (uint32_t)OnAction_ScrubberReset); |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
296 setEvent(StMXTRA_ScrubTimer_OP_Mode, (uint32_t)OnAction_ScrubberMode); |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
297 } |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
298 |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
299 static void openEdit_Scrubber(void) |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
300 { |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
301 char text[32]; |
| 998 | 302 |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
303 resetMenuEdit(CLUT_MenuPageXtra); |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
304 |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
305 snprintf(text, 32, "\001%c", TXT_ScrubTime); |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
306 write_topline(text); |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
307 |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
308 drawScrubberMenu(false); |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
309 |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
310 write_buttonTextline(TXT2BYTE_ButtonBack, TXT2BYTE_ButtonEnter, TXT2BYTE_ButtonNext); |
|
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
311 } |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
312 |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
313 static void openEdit_PSCR(void) |
|
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
314 { |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
315 uint8_t localO2Drop,localLungRatio; |
| 662 | 316 char text[32]; |
| 317 SSettings *pSettings = settingsGetPointer(); | |
| 318 localO2Drop = pSettings->pscr_o2_drop; | |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
319 localLungRatio = pSettings->pscr_lung_ratio; |
| 662 | 320 |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
321 resetMenuEdit(CLUT_MenuPageXtra); |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
322 |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
323 snprintf(text, 32, "\001%c",TXT_PSClosedCircuit); |
| 662 | 324 write_topline(text); |
| 325 | |
| 326 text[0] = '\002'; | |
| 327 text[1] = '\016'; | |
| 328 text[2] = '\016'; | |
| 329 text[3] = '%'; | |
| 330 text[4] = 0; | |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
331 write_label_fix( 20, 800, ME_Y_LINE1, &FontT48, TXT_PSCRO2Drop); |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
332 write_label_var( 435, 780, ME_Y_LINE1, &FontT48, text); |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
333 write_field_udigit(StMXTRA_PSCR_O2_Drop, 710, 779, ME_Y_LINE1, &FontT48, "##", (uint32_t)localO2Drop, 0, 0, 0); |
| 662 | 334 |
| 335 | |
| 336 text[0] = '\002'; | |
| 337 text[1] = '1'; | |
| 338 text[2] = '/'; | |
| 339 text[3] = 0; | |
| 340 | |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
341 write_label_fix( 20, 800, ME_Y_LINE2, &FontT48, TXT_PSCRLungRatio); |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
342 write_label_var( 435, 710, ME_Y_LINE2, &FontT48, text); |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
343 write_field_udigit(StMXTRA_PSCR_LUNG_RATIO, 710, 779, ME_Y_LINE2, &FontT48, "##", (uint32_t)localLungRatio, 0, 0, 0); |
| 662 | 344 |
| 712 | 345 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); |
| 662 | 346 |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
347 setEvent(StMXTRA_PSCR_O2_Drop, (uint32_t)OnAction_PSCRO2Drop); |
| 662 | 348 setEvent(StMXTRA_PSCR_LUNG_RATIO, (uint32_t)OnAction_PSCRLungRation); |
| 349 } | |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
350 |
| 662 | 351 |
|
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
|
352 |
|
967
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
353 static uint8_t OnAction_CompassHeadingReverse(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) |
|
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
354 { |
|
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
355 setCompassHeading((stateUsed->diveSettings.compassHeading + 180) % 360); |
|
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
356 |
|
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
357 exitMenuEdit_to_Home_with_Menu_Update(); |
|
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
358 |
|
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
359 return EXIT_TO_HOME; |
|
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
360 } |
|
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
361 |
|
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
362 |
|
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
|
363 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
|
364 { |
|
929
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
365 clearCompassHeading(); |
|
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
|
366 |
|
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 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
|
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 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
|
370 } |
|
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 |
|
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
|
373 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
|
374 { |
|
929
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
375 setCompassHeading(settingsGetPointer()->compassBearing); |
|
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
376 |
|
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
377 exitMenuEdit_to_Home_with_Menu_Update(); |
|
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
378 |
|
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
379 return EXIT_TO_HOME; |
|
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
380 } |
|
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
381 |
|
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
382 |
|
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
383 static uint8_t OnAction_CompassHeadingLog(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) |
|
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
384 { |
|
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
385 logCompassHeading((uint16_t)stateUsed->lifeData.compass_heading); |
|
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
|
386 |
|
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 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
|
388 |
|
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 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
|
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 |
|
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
393 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
|
394 { |
|
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
395 SSettings *settings = settingsGetPointer(); |
|
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
396 |
|
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
|
397 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
|
398 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
|
399 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
|
400 |
|
967
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
401 if (!isRefresh) { |
|
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
402 snprintf(text, 32, "%c%c", TXT_2BYTE, TXT2BYTE_Set); |
|
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
403 write_field_button(StMXTRA_CompassHeading, 20, 800, ME_Y_LINE1, &FontT48, text); |
|
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
404 } else { |
|
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
405 tMenuEdit_refresh_field(StMXTRA_CompassHeading); |
|
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
406 } |
|
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
407 |
|
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
408 uint16_t heading; |
|
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
409 if (settings->compassInertia) { |
|
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
410 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
|
411 } else { |
|
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
412 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
|
413 } |
|
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
|
414 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
|
415 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
|
416 |
|
967
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
417 bool headingIsSet = stateUsed->diveSettings.compassHeading; |
|
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
418 snprintf(text, 32, "%s%c%c", makeGrey(!headingIsSet), TXT_2BYTE, TXT2BYTE_Reverse); |
|
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
419 if (headingIsSet) { |
|
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
420 if (!isRefresh) { |
|
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
421 write_field_button(StMXTRA_CompassHeadingReverse, 20, 800, ME_Y_LINE2, &FontT48, text); |
|
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
422 } else { |
|
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
423 tMenuEdit_refresh_field(StMXTRA_CompassHeadingReverse); |
|
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
424 } |
|
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
|
425 } else { |
|
967
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
426 write_label_var(20, 800, ME_Y_LINE2, &FontT48, text); |
|
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
|
427 } |
|
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
|
428 |
|
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
|
429 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
|
430 if (headingIsSet) { |
|
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
431 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
|
432 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
|
433 } 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
|
434 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
|
435 } |
|
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
|
436 } 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
|
437 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
|
438 } |
|
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
|
439 |
|
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
440 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
|
441 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
|
442 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
|
443 if (canSetBearing) { |
|
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
444 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
|
445 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
|
446 } 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
|
447 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
|
448 } |
|
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
|
449 } 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
|
450 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
|
451 } |
|
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
|
452 |
|
929
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
453 snprintf(text, 32, "%c%c", TXT_2BYTE, TXT2BYTE_Log); |
|
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
454 if (!isRefresh) { |
|
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
455 write_field_button(StMXTRA_CompassHeadingLog, 20, 800, ME_Y_LINE5, &FontT48, text); |
|
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
456 } else { |
|
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
457 tMenuEdit_refresh_field(StMXTRA_CompassHeadingLog); |
|
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
458 } |
|
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
459 |
|
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
460 if (headingIsSet) { |
|
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
461 snprintf(text, 32, "%s%c%c (%03u`)", makeGrey(true), TXT_2BYTE, TXT2BYTE_Current, stateUsed->diveSettings.compassHeading); |
|
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
462 write_label_var(20, 800, ME_Y_LINE6, &FontT48, text); |
|
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
463 } |
|
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
464 |
|
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
465 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
|
466 setEvent(StMXTRA_CompassHeading, (uint32_t)OnAction_CompassHeading); |
|
967
9b418e63dbc2
Add a 'Reverse' action to the compass heading dive menu.
heinrichsweikamp
parents:
929
diff
changeset
|
467 setEvent(StMXTRA_CompassHeadingReverse, (uint32_t)OnAction_CompassHeadingReverse); |
|
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
|
468 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
|
469 setEvent(StMXTRA_CompassHeadingReset, (uint32_t)OnAction_CompassHeadingReset); |
|
929
63c340abd70e
Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents:
906
diff
changeset
|
470 setEvent(StMXTRA_CompassHeadingLog, (uint32_t)OnAction_CompassHeadingLog); |
|
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
|
471 } |
|
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
|
472 |
|
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
|
473 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
|
474 } |
|
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
|
475 |
|
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
|
476 |
| 38 | 477 void refresh_CompassHeading(void) |
| 478 { | |
|
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
479 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
|
480 } |
| 38 | 481 |
| 482 | |
| 483 void openEdit_CompassHeading(void) | |
| 484 { | |
|
776
45b8f3c2acce
Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents:
774
diff
changeset
|
485 drawCompassHeadingMenu(false); |
| 38 | 486 } |
| 487 | |
| 488 | |
| 489 uint8_t OnAction_CompassHeading (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 490 { | |
|
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
|
491 setCompassHeading((uint16_t)stateUsed->lifeData.compass_heading); |
| 38 | 492 exitMenuEdit_to_Home_with_Menu_Update(); |
| 493 return EXIT_TO_HOME; | |
| 494 } | |
|
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
495 |
| 710 | 496 |
| 497 uint8_t OnAction_ScrubberTimerId(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 498 { | |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
499 scrubberMenuId = (scrubberMenuId + 1) % SCRUBBER_COUNT; |
| 710 | 500 |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
501 drawScrubberMenu(true); |
| 710 | 502 |
| 503 return UNSPECIFIC_RETURN; | |
| 504 } | |
| 505 | |
| 506 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
|
507 { |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
508 SSettings *pSettings; |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
509 uint8_t digitContentNew = EXIT_TO_MENU; |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
510 uint32_t newScrubberTime; |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
511 |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
512 if(action == ACTION_BUTTON_ENTER) |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
513 { |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
514 return digitContent; |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
515 } |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
516 if(action == ACTION_BUTTON_ENTER_FINAL) |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
517 { |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
518 evaluateNewString(editId, &newScrubberTime, 0, 0, 0); |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
519 |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
520 if(newScrubberTime > MAX_SCRUBBER_TIME) |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
521 newScrubberTime = MAX_SCRUBBER_TIME; |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
522 |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
523 pSettings = settingsGetPointer(); |
| 998 | 524 pSettings->scrubberData[scrubberMenuId].TimerMax = newScrubberTime; |
| 525 if(pSettings->scrubberData[scrubberMenuId].TimerCur > newScrubberTime) | |
|
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
526 { |
| 998 | 527 pSettings->scrubberData[scrubberMenuId].TimerCur = newScrubberTime; |
|
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
528 } |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
529 |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
530 tMenuEdit_newInput(editId, newScrubberTime, 0, 0, 0); |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
531 digitContentNew = UNSPECIFIC_RETURN; |
|
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
532 } |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
533 if(action == ACTION_BUTTON_NEXT) |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
534 { |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
535 digitContentNew = digitContent + 1; |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
536 if(digitContentNew > '9') |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
537 digitContentNew = '0'; |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
538 } |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
539 if(action == ACTION_BUTTON_BACK) |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
540 { |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
541 digitContentNew = digitContent - 1; |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
542 if(digitContentNew < '0') |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
543 digitContentNew = '9'; |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
544 } |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
545 return digitContentNew; |
|
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
546 } |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
547 |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
548 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
|
549 { |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
550 SSettings *pSettings = settingsGetPointer(); |
| 998 | 551 pSettings->scrubberData[scrubberMenuId].TimerCur = pSettings->scrubberData[scrubberMenuId].TimerMax; |
| 552 pSettings->scrubberData[scrubberMenuId].lastDive.WeekDay = 0; /* invalidate date */ | |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
553 |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
554 drawScrubberMenu(true); |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
555 |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
556 return UNSPECIFIC_RETURN; |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
557 } |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
558 |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
559 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
|
560 { |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
561 char text[32]; |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
562 uint8_t newMode; |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
563 SSettings *pSettings; |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
564 pSettings = settingsGetPointer(); |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
565 newMode = pSettings->scrubTimerMode + 1; |
|
1014
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
566 if (newMode >= SCRUB_TIMER_END) { |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
567 newMode = SCRUB_TIMER_MINUTES; |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
568 } |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
569 pSettings->scrubTimerMode = newMode; |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
570 |
|
1014
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
571 switch (pSettings->scrubTimerMode) { |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
572 case SCRUB_TIMER_MINUTES: |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
573 default: |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
574 snprintf(&text[0], 32,"%c\002%c",TXT_ScrubTimeMode, TXT_Minutes ); |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
575 |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
576 break; |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
577 case SCRUB_TIMER_PERCENT: |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
578 snprintf(&text[0], 32,"%c\002%c",TXT_ScrubTimeMode, TXT_Percent ); |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
579 |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
580 break; |
|
8c0134a287da
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents:
998
diff
changeset
|
581 } |
|
707
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
582 tMenuEdit_newButtonText(StMXTRA_ScrubTimer_OP_Mode, text); |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
583 |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
584 return UNSPECIFIC_RETURN; |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
585 } |
|
e81afd727993
Menu cleanup rebreather specific settings:
Ideenmodellierer
parents:
662
diff
changeset
|
586 |
| 998 | 587 uint8_t OnAction_ScrubberActive(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) |
| 588 { | |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
589 SSettings *pSettings = settingsGetPointer(); |
| 998 | 590 |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
591 if (pSettings->scrubberActiveId & (1 << scrubberMenuId)) { |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
592 pSettings->scrubberActiveId &= ~(1 << scrubberMenuId); |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
593 } else { |
|
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
594 pSettings->scrubberActiveId |= (1 << scrubberMenuId); |
| 998 | 595 } |
| 596 | |
|
1018
808153ba3fec
Disable the menu items for editing scrubber timer parameters if an
heinrichsweikamp
parents:
1014
diff
changeset
|
597 drawScrubberMenu(true); |
| 998 | 598 |
| 599 return UNSPECIFIC_RETURN; | |
| 600 } | |
| 601 | |
| 662 | 602 #ifdef ENABLE_PSCR_MODE |
| 603 static uint8_t OnAction_PSCRO2Drop(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 604 { | |
| 605 SSettings *pSettings; | |
| 606 uint8_t digitContentNew = EXIT_TO_MENU; | |
| 607 uint32_t newO2Drop; | |
|
654
890440ab993a
Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents:
648
diff
changeset
|
608 |
| 662 | 609 if(action == ACTION_BUTTON_ENTER) |
| 610 { | |
| 611 return digitContent; | |
| 612 } | |
| 613 if(action == ACTION_BUTTON_ENTER_FINAL) | |
| 614 { | |
| 615 evaluateNewString(editId, &newO2Drop, 0, 0, 0); | |
| 616 | |
| 617 if(newO2Drop > PSCR_MAX_O2_DROP) | |
| 618 newO2Drop = PSCR_MAX_O2_DROP; | |
| 619 | |
| 620 pSettings = settingsGetPointer(); | |
| 621 pSettings->pscr_o2_drop = newO2Drop; | |
| 622 | |
| 623 tMenuEdit_newInput(editId, newO2Drop, 0, 0, 0); | |
| 793 | 624 digitContentNew = UPDATE_DIVESETTINGS; |
| 662 | 625 } |
| 626 if(action == ACTION_BUTTON_NEXT) | |
| 627 { | |
| 628 digitContentNew = digitContent + 1; | |
| 629 if(digitContentNew > '9') | |
| 630 digitContentNew = '0'; | |
| 631 } | |
| 632 if(action == ACTION_BUTTON_BACK) | |
| 633 { | |
| 634 digitContentNew = digitContent - 1; | |
| 635 if(digitContentNew < '0') | |
| 636 digitContentNew = '9'; | |
| 637 } | |
| 638 return digitContentNew; | |
| 639 } | |
| 640 | |
| 641 static uint8_t OnAction_PSCRLungRation(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 642 { | |
| 643 SSettings *pSettings; | |
| 644 uint8_t digitContentNew = EXIT_TO_MENU; | |
| 645 uint32_t newLungRatio; | |
| 646 | |
| 647 if(action == ACTION_BUTTON_ENTER) | |
| 648 { | |
| 649 return digitContent; | |
| 650 } | |
| 651 if(action == ACTION_BUTTON_ENTER_FINAL) | |
| 652 { | |
| 653 evaluateNewString(editId, &newLungRatio, 0, 0, 0); | |
| 654 | |
| 655 if(newLungRatio > PSCR_MAX_LUNG_RATIO) | |
| 656 newLungRatio = PSCR_MAX_LUNG_RATIO; | |
| 657 | |
| 658 if(newLungRatio < PSCR_MIN_LUNG_RATIO) | |
| 659 newLungRatio = PSCR_MIN_LUNG_RATIO; | |
| 660 | |
| 661 pSettings = settingsGetPointer(); | |
| 662 pSettings->pscr_lung_ratio = newLungRatio; | |
| 663 | |
| 664 tMenuEdit_newInput(editId, newLungRatio, 0, 0, 0); | |
| 793 | 665 digitContentNew = UPDATE_DIVESETTINGS; |
| 662 | 666 } |
| 667 if(action == ACTION_BUTTON_NEXT) | |
| 668 { | |
| 669 digitContentNew = digitContent + 1; | |
| 670 if(digitContentNew > '9') | |
| 671 digitContentNew = '0'; | |
| 672 } | |
| 673 if(action == ACTION_BUTTON_BACK) | |
| 674 { | |
| 675 digitContentNew = digitContent - 1; | |
| 676 if(digitContentNew < '0') | |
| 677 digitContentNew = '9'; | |
| 678 } | |
| 679 return digitContentNew; | |
| 680 } | |
| 681 #endif | |
| 682 | |
| 683 |
