annotate Discovery/Src/tMenuEditDeco.c @ 698:2c2b9c6eb089

Bugfix Empty menu: In previous version an empty menu was shown sporadically. After pressing back button the menu was shown correctly again. Potential root cause is the call of the Set Top/Bottom Frame function while updating the cursor position. To handle multible updated is previous toggle bugger has been changed into a ringbuffer allowing to send several update frames after each other. Beside this some old debug code has been removed.
author Ideenmodellierer
date Sun, 25 Sep 2022 21:13:45 +0200
parents 1b995079c045
children e81afd727993
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1 ///////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2 /// -*- coding: UTF-8 -*-
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4 /// \file Discovery/Src/tMenuEditDeco.c
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 /// \brief Main Template file for Menu Edit Deco Parameters
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6 /// \author heinrichs weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7 /// \date 31-July-2014
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
8 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
9 /// \details
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
10 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 /// $Id$
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 ///////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 /// This program is free software: you can redistribute it and/or modify
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 /// it under the terms of the GNU General Public License as published by
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 /// the Free Software Foundation, either version 3 of the License, or
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 /// (at your option) any later version.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 /// This program is distributed in the hope that it will be useful,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21 /// but WITHOUT ANY WARRANTY; without even the implied warranty of
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 /// GNU General Public License for more details.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25 /// You should have received a copy of the GNU General Public License
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26 /// along with this program. If not, see <http://www.gnu.org/licenses/>.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 //////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29 /* Includes ------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30 #include "tMenuEditDeco.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32 #include "gfx_fonts.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 #include "tMenuEdit.h"
130
b7689d9e888a Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents: 38
diff changeset
34 #include "unit.h"
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
35 #include "configuration.h"
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37 /* Private variables ---------------------------------------------------------*/
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
38 static uint8_t lineSelected = 0;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40 /* Private function prototypes -----------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
42 static void openEdit_DiveMode(void);
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
43 static void openEdit_CCRModeSensorOrFixedSP(void);
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
44 static void openEdit_ppO2max(void);
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
45 static void openEdit_SafetyStop(void);
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
46 static void openEdit_FutureTTS(void);
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
47 static void openEdit_Salinity(void);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 /* Announced function prototypes -----------------------------------------------*/
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
50 static uint8_t OnAction_setMode (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
51 static uint8_t OnAction_FutureTTS (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
52 static uint8_t OnAction_ppO2Max (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
53 static uint8_t OnAction_SafetyStop (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
54 static uint8_t OnAction_Salinity (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57 void openEdit_Deco(uint8_t line)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 set_globalState_Menu_Line(line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 resetMenuEdit(CLUT_MenuPageDeco);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62 SSettings *data = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 lineSelected = line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
66 if((!isLoopMode(data->dive_mode)) && (line > 1))
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 line += 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69 switch(line)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 case 1:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
73 openEdit_DiveMode();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75 case 2:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76 openEdit_CCRModeSensorOrFixedSP();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78 case 3:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79 openEdit_ppO2max();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81 case 4:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82 openEdit_SafetyStop();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84 case 5:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85 openEdit_FutureTTS();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87 case 6:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88 openEdit_Salinity();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
90 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
91 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93 /* Private functions ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
96 static void openEdit_DiveMode(void)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98 #define APNEAANDGAUGE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100 char text[32];
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
101 uint8_t lineOffset = 0;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 uint8_t actualDiveMode, active;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104 actualDiveMode = pSettings->dive_mode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107 text[1] = TXT_DiveMode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111 text[1] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
114 #ifdef ENABLE_PSCR_MODE
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
115 lineOffset = ME_Y_LINE_STEP;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
116 #endif
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
117
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118 text[0] = TXT_OpenCircuit;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 if(actualDiveMode == DIVEMODE_OC)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122 active = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123 write_field_on_off(StMDECO1_OC, 30, 500, ME_Y_LINE1, &FontT48, text, active);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125 text[0] = TXT_ClosedCircuit;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126 if(actualDiveMode == DIVEMODE_CCR)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127 active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129 active = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130 write_field_on_off(StMDECO1_CC, 30, 500, ME_Y_LINE2, &FontT48, text, active);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
132 #ifdef ENABLE_PSCR_MODE
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
133 text[0] = TXT_PSClosedCircuit;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
134 if(actualDiveMode == DIVEMODE_PSCR)
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
135 active = 1;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
136 else
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
137 active = 0;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
138 write_field_on_off(StMDECO1_PSCR, 30, 500, ME_Y_LINE3, &FontT48, text, active);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
139 #endif
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
140 #ifdef APNEAANDGAUGE
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141 text[0] = TXT_Apnoe;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142 if(actualDiveMode == DIVEMODE_Apnea)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145 active = 0;
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
146 write_field_on_off(StMDECO1_Apnea, 30, 500, ME_Y_LINE3 + lineOffset, &FontT48, text, active);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148 text[0] = TXT_Gauge;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149 if(actualDiveMode == DIVEMODE_Gauge)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150 active = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 active = 0;
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
153 write_field_on_off(StMDECO1_Gauge, 30, 500, ME_Y_LINE4 + lineOffset, &FontT48, text, active);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
154 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
156 setEvent(StMDECO1_OC, (uint32_t)OnAction_setMode);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
157 setEvent(StMDECO1_CC, (uint32_t)OnAction_setMode);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
158 #ifdef ENABLE_PSCR_MODE
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
159 setEvent(StMDECO1_PSCR, (uint32_t)OnAction_setMode);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
160 #endif
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
161
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
162 #ifdef APNEAANDGAUGE
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
163 setEvent(StMDECO1_Apnea, (uint32_t)OnAction_setMode);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
164 setEvent(StMDECO1_Gauge, (uint32_t)OnAction_setMode);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
165 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
170
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
171 static uint8_t OnAction_setMode (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) //(uint32_t newMode)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
172 {
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
173 uint32_t modeArray[] = {StMDECO1_OC, StMDECO1_CC, StMDECO1_Gauge, StMDECO1_Apnea /* definition needs to follow order of DIVEMODE (settings.h) */
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
174 #ifdef ENABLE_PSCR_MODE
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
175 , StMDECO1_PSCR
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
176 #endif
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
177 };
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
178
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
179 uint8_t index = 0;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
180 SSettings *pSettings = settingsGetPointer();
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
181 uint8_t retVal = EXIT_TO_MENU;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
182 uint8_t lastMode = pSettings->dive_mode;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
185 setActualGasFirst(&stateRealGetPointerWrite()->lifeData);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
186 while(index < sizeof(modeArray) / 4) /* calculate number of items out of array size (bytes) */
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
187 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
188 if(editId == modeArray[index])
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
189 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
190 if(pSettings->dive_mode != index)
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
191 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
192 tMenuEdit_set_on_off(modeArray[index], 1);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
193 pSettings->dive_mode = index;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
194 retVal = UPDATE_DIVESETTINGS;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
195 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
196 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
197 else
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
198 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
199 if(lastMode == index) /* reset state of previous mode selection */
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
200 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
201 tMenuEdit_set_on_off(modeArray[index], 0);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
202 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
203 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
204 index++;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
205 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 288
diff changeset
206 return retVal;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
210 static void openEdit_CCRModeSensorOrFixedSP(void)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214 if(pSettings->CCR_Mode == CCRMODE_Sensors)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215 pSettings->CCR_Mode = CCRMODE_FixedSetpoint;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 pSettings->CCR_Mode = CCRMODE_Sensors;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219 exitEditWithUpdate();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
223 static void openEdit_SafetyStop(void)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 uint32_t safetystopDuration, safetystopDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 char text[64];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 uint16_t y_line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229 safetystopDuration = settingsGetPointer()->safetystopDuration;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 safetystopDepth = settingsGetPointer()->safetystopDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 y_line = ME_Y_LINE_BASE + (lineSelected * ME_Y_LINE_STEP);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 text[1] = TXT_SafetyStop;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239 write_label_fix( 20, 800, y_line, &FontT48, TXT_SafetyStop);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 strcpy(text,"\016\016");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
242 text[2] = TXT_Minutes;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243 if(settingsGetPointer()->nonMetricalSystem)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245 strcpy(&text[3],
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246 "\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247 " @ "
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248 "\016\016"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249 " ft"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250 "\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255 strcpy(&text[3],
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256 "\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
257 " @ "
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
258 "\016\016"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
259 " m"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260 "\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
262 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263 write_label_var( 410, 800, y_line, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265 if(settingsGetPointer()->nonMetricalSystem)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
267 write_field_2digit(StMDECO4_SafetyStop, 350, 800, y_line, &FontT48, "## ##", safetystopDuration, unit_depth_integer(safetystopDepth), 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271 write_field_udigit(StMDECO4_SafetyStop, 370, 800, y_line, &FontT48, "# #", safetystopDuration, safetystopDepth, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
273
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
274 write_buttonTextline(TXT2BYTE_ButtonMinus,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonPlus);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276 setEvent(StMDECO4_SafetyStop, (uint32_t)OnAction_SafetyStop);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277 startEdit();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
281 static uint8_t OnAction_SafetyStop (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283 uint8_t digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284 uint32_t newSafetystopDuration, newSafetystopDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286 if(action == ACTION_BUTTON_ENTER)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288 return digitContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
290 if(action == ACTION_BUTTON_ENTER_FINAL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
291 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292 evaluateNewString(editId, &newSafetystopDuration, &newSafetystopDepth, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
293
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294 if(settingsGetPointer()->nonMetricalSystem != 0) // new hw 170718
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
296 newSafetystopDepth += 2; // f�r rundung
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297 newSafetystopDepth = (newSafetystopDepth * 3) / 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 settingsGetPointer()->safetystopDuration = newSafetystopDuration;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302 settingsGetPointer()->safetystopDepth = newSafetystopDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304 tMenuEdit_newInput(editId, newSafetystopDuration, newSafetystopDepth, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305 return UPDATE_AND_EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 if(action == ACTION_BUTTON_NEXT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
309 digitContentNew = digitContent + 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
310 if(blockNumber == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
311 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
312 if(digitContentNew > '5')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
313 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
314 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
315 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
316 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
317 if(settingsGetPointer()->nonMetricalSystem == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
318 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
319 if(digitContentNew > '6')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
320 digitContentNew = '3';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
321 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
322 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
323 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
324 if(digitContent < 13 + '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
325 digitContentNew = 13 + '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
326 else if(digitContent < 16 + '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
327 digitContentNew = 16 + '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
328 else if(digitContent < 20 + '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
329 digitContentNew = 20 + '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
330 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
331 digitContentNew = 10 + '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
332 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
333 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
334 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
335 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
336 if(action == ACTION_BUTTON_BACK)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
337 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
338 digitContentNew = digitContent - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
339 if(blockNumber == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
340 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
341 if(digitContentNew < '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
342 digitContentNew = '5';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
343 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
344 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
345 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
346 if(settingsGetPointer()->nonMetricalSystem == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
347 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
348 if(digitContentNew < '3')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
349 digitContentNew = '6';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
350 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
351 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
352 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
353 if(digitContent >= 20 + '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
354 digitContentNew = 16 + '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
355 else if(digitContent >= 16 + '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
356 digitContentNew = 13 + '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
357 else if(digitContent >= 13 + '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
358 digitContentNew = 10 + '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
359 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
360 digitContentNew = 20 + '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
361 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
362 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
363 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
364 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
365 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
366 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
367
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
368
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
369 static void openEdit_Salinity(void)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
370 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
371 char text[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
372 uint16_t y_line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
373
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
374 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
375 text[1] = TXT_Salinity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
376 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
377 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
378
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
379 y_line = ME_Y_LINE_BASE + (lineSelected * ME_Y_LINE_STEP);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
380
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
381 write_label_fix( 30, 800, y_line, &FontT48, TXT_Salinity);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
382 write_label_var( 400, 800, y_line, &FontT48, "\016\016 %\017");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
383
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
384 write_field_udigit(StMDECO6_SALINITY, 370, 800, y_line, &FontT48, "#", (uint32_t)settingsGetPointer()->salinity, 0, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
385
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
386 write_buttonTextline(TXT2BYTE_ButtonMinus,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonPlus);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
387
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
388 setEvent(StMDECO6_SALINITY, (uint32_t)OnAction_Salinity);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
389 startEdit();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
390 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
391
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
392
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
393 static uint8_t OnAction_Salinity(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
394 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
395 SSettings *pSettings;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
396 uint8_t digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
397 uint32_t salinity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
398
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
399 if(action == ACTION_BUTTON_ENTER)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
400 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
401 return digitContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
402 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
403 if(action == ACTION_BUTTON_ENTER_FINAL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
404 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
405 evaluateNewString(editId, &salinity, 0, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
406
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
407 if(salinity >= 4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
408 salinity = 4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
409
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
410 pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
411
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
412 pSettings->salinity = salinity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
413
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
414 tMenuEdit_newInput(editId, salinity, 0, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
415 return UPDATE_AND_EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
416 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
417 if(action == ACTION_BUTTON_NEXT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
418 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
419 digitContentNew = digitContent + 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
420 if(digitContentNew > '4')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
421 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
422 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
423 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
424 if(action == ACTION_BUTTON_BACK)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
425 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
426 digitContentNew = digitContent - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
427 if(digitContentNew < '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
428 digitContentNew = '4';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
429 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
430 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
431
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
432 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
433 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
434
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
435
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
436 static void openEdit_ppO2max(void)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
437 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
438 uint8_t maxL_std, maxL_deco;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
439 uint16_t y_line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
440 char text[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
441 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
442
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
443 maxL_std = pSettings->ppO2_max_std - 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
444 maxL_deco = pSettings->ppO2_max_deco - 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
445
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
446 y_line = ME_Y_LINE_BASE + (lineSelected * ME_Y_LINE_STEP);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
447
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
448 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
449 text[1] = TXT_ppO2Name;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
450 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
451 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
452
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
453 strcpy(text,"ppO2\016\016max\017");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
454 write_label_var( 20, 800, y_line, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
455 strcpy(text,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
456 "\016\016"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
457 " bar "
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
458 " deco "
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
459 "\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
460 " "
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
461 "\016\016"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
462 " bar"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
463 "\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
464 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
465 write_label_var( 460, 800, y_line, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
466
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
467 // write_field_udigit(StMDECO4_PPO2Max, 410, 800, y_line, &FontT48, "## ##", (uint32_t)maxL_std, (uint32_t)maxL_deco, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
468 write_field_udigit(StMDECO3_PPO2Max, 370, 800, y_line, &FontT48, "1.## 1.##", (uint32_t)maxL_std, (uint32_t)maxL_deco, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
469
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
470 write_buttonTextline(TXT2BYTE_ButtonMinus,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonPlus);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
471
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
472 setEvent(StMDECO3_PPO2Max, (uint32_t)OnAction_ppO2Max);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
473 startEdit();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
474 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
475
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
476
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
477 static uint8_t OnAction_ppO2Max(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
478 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
479 SSettings *pSettings;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
480 uint8_t digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
481 uint32_t newPPO2LStd, newPPO2LDeco;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
482
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
483 if(action == ACTION_BUTTON_ENTER)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
484 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
485 return digitContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
486 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
487 if(action == ACTION_BUTTON_ENTER_FINAL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
488 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
489 evaluateNewString(editId, &newPPO2LStd, &newPPO2LDeco, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
490
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
491 if(newPPO2LStd > 90)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
492 newPPO2LStd = 90;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
493
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
494 if(newPPO2LDeco > 90)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
495 newPPO2LDeco = 90;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
496
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
497 pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
498 pSettings->ppO2_max_std = 100 + newPPO2LStd;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
499 pSettings->ppO2_max_deco = 100 + newPPO2LDeco;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
500
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
501 tMenuEdit_newInput(editId, newPPO2LStd, newPPO2LDeco, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
502 return UPDATE_AND_EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
503 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
504 if(action == ACTION_BUTTON_NEXT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
505 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
506 digitContentNew = digitContent + 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
507 if(digitContentNew > '9')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
508 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
509 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
510 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
511 if(action == ACTION_BUTTON_BACK)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
512 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
513 digitContentNew = digitContent - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
514 if(digitContentNew < '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
515 digitContentNew = '9';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
516 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
517 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
518 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
519 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
520
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
521
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
522 static void openEdit_FutureTTS(void)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
523 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
524 uint8_t futureTTS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
525 uint16_t y_line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
526
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
527 char text[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
528 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
529 futureTTS = pSettings->future_TTS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
530
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
531 y_line = ME_Y_LINE_BASE + (lineSelected * ME_Y_LINE_STEP);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
532
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
533 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
534 text[1] = TXT_FutureTTS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
535 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
536 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
537
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
538 strcpy(text,"\016\016");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
539 text[2] = TXT_Minutes;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
540 text[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
541 write_label_fix( 20, 800, y_line, &FontT48, TXT_FutureTTS);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
542 write_label_var( 435, 800, y_line, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
543 write_field_2digit(StMDECO5_FUTURE, 370, 500, y_line, &FontT48, "##", (uint32_t)futureTTS, 0, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
544
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
545 write_buttonTextline(TXT2BYTE_ButtonMinus,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonPlus);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
546
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
547 setEvent(StMDECO5_FUTURE, (uint32_t)OnAction_FutureTTS);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
548 startEdit();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
549 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
550
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
551
288
ba229a012ac7 cleanup: no useless checks for simulator state
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
552 static uint8_t OnAction_FutureTTS(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
553 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
554 SSettings *pSettings;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
555 int8_t digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
556 uint32_t newFutureTTS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
557
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
558 if(action == ACTION_BUTTON_ENTER)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
559 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
560 return digitContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
561 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
562 if(action == ACTION_BUTTON_ENTER_FINAL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
563 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
564 evaluateNewString(editId, &newFutureTTS, 0, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
565
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
566 if(newFutureTTS > 15)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
567 newFutureTTS = 15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
568
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
569 pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
570 pSettings->future_TTS = newFutureTTS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
571
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
572 tMenuEdit_newInput(editId, newFutureTTS, 0, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
573 return UPDATE_AND_EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
574 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
575 if(action == ACTION_BUTTON_NEXT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
576 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
577 digitContentNew = digitContent + 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
578 if(digitContentNew > '0'+ 15)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
579 digitContentNew = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
580 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
581 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
582 if(action == ACTION_BUTTON_BACK)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
583 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
584 digitContentNew = digitContent - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
585 if(digitContentNew < '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
586 digitContentNew = '0' + 15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
587 return digitContentNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
588 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
589 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
590 }