annotate Discovery/Src/tMenuXtra.c @ 852:b2aad621aeb0 Evo_2_23

Bugfix Selection of custom views: In case less than 5 views were displayed on a page it could happen that the cursor was put in a wrong position in case the next page was selected. Rootcause was the setting of the element events which was only update in case the menu was entered via the open function.
author Ideenmodellierer
date Thu, 07 Mar 2024 21:46:49 +0100
parents bc2fcd002fc4
children 48b6a3b1f3f8
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/tMenuXtra.c
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 /// \brief Menu Xtra - Specials in Divemode like Reset Stopwatch
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 02-Mar-2015
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 <stdio.h>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31 #include <string.h>
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: 707
diff changeset
32 #include <stdbool.h>
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 #include "tMenu.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 #include "tStructure.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
35 #include "tMenuXtra.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36 #include "text_multilanguage.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37 #include "data_central.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 #include "simulation.h"
609
1b243c6c7067 Bugfix: CalibViewport were shown even in case the compile switch had not been set:
Ideenmodellierer
parents: 547
diff changeset
39 #include "configuration.h"
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40
850
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
41
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44 uint32_t tMXtra_refresh(uint8_t line, char *text, uint16_t *tab, char *subtext)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45 {
707
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
46 uint8_t textPointer = 0;
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
47 uint8_t CcrModusTxtId = 0;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 textPointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50 *tab = 500;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51 *subtext = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 654
diff changeset
53 SSettings *pSettings = settingsGetPointer();
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 654
diff changeset
54
654
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
55 /* DIVE MODE */
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
56 if(actual_menu_content != MENU_SURFACE)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57 {
654
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
58 if((line == 0) || (line == 1))
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
59 {
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
60 text[textPointer++] = TXT_2BYTE;
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
61 text[textPointer++] = TXT2BYTE_ResetStopwatch;
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
62 }
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
63 strcpy(&text[textPointer],"\n\r");
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
64 textPointer += 2;
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
65 /*
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
66 if((line == 0) || (line == 2))
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
67 {
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
68 text[textPointer++] = TXT_2BYTE;
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
69 text[textPointer++] = TXT2BYTE_ResetAvgDepth;
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
70 }
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
71 strcpy(&text[textPointer],"\n\r");
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
72 textPointer += 2;
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
73 */
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
74 if((line == 0) || (line == 2))
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
75 {
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
76 text[textPointer++] = TXT_2BYTE;
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
77 text[textPointer++] = TXT2BYTE_CompassHeading;
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
78 }
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
79 strcpy(&text[textPointer],"\n\r");
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
80 textPointer += 2;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81
654
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
82 if((line == 0) || (line == 3))
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
83 {
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
84 text[textPointer++] = TXT_2BYTE;
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
85 text[textPointer++] = TXT2BYTE_SetMarker;
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
86 }
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
87 strcpy(&text[textPointer],"\n\r");
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
88 textPointer += 2;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89
609
1b243c6c7067 Bugfix: CalibViewport were shown even in case the compile switch had not been set:
Ideenmodellierer
parents: 547
diff changeset
90 #ifdef ENABLE_MOTION_CONTROL
654
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
91 if((line == 0) || (line == 4))
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
92 {
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
93 text[textPointer++] = TXT_2BYTE;
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
94 text[textPointer++] = TXT2BYTE_CalibView;
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
95 }
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
96 strcpy(&text[textPointer],"\n\r");
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
97 textPointer += 2;
609
1b243c6c7067 Bugfix: CalibViewport were shown even in case the compile switch had not been set:
Ideenmodellierer
parents: 547
diff changeset
98 #endif
547
12f8745c8a94 Added viewport calibration to dive menu:
Ideenmodellierer
parents: 347
diff changeset
99
654
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
100 if(is_stateUsedSetToSim())
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
101 {
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
102 if((line == 0) || (line == 5))
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
103 {
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
104 text[textPointer++] = TXT_2BYTE;
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
105 text[textPointer++] = TXT2BYTE_SimFollowDecoStops;
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
106 text[textPointer++] = ' ';
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
107 text[textPointer++] = ' ';
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
108 if(simulation_get_heed_decostops())
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
109 text[textPointer++] = '\005';
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
110 else
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
111 text[textPointer++] = '\006';
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
112 }
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
113 strcpy(&text[textPointer],"\n\r");
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
114 textPointer += 2;
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
115 }
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
116 else
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
117 {
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
118 if((line == 0) || (line == 5)) /* end dive mode only used during real dives */
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
119 {
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
120 text[textPointer++] = TXT_2BYTE;
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
121 text[textPointer++] = TXT2BYTE_EndDiveMode;
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
122 }
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
123 strcpy(&text[textPointer],"\n\r");
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
124 textPointer += 2;
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
125 }
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
126 }
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
127 else /* Surface MODE */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 {
707
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
129
654
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
130 if((line == 0) || (line == 1))
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131 {
707
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
132 switch(pSettings->CCR_Mode)
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
133 {
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
134 case CCRMODE_Sensors: CcrModusTxtId = TXT_Sensor;
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
135 break;
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
136 case CCRMODE_FixedSetpoint: CcrModusTxtId = TXT_FixedSP;
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
137 break;
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
138 case CCRMODE_Simulation: CcrModusTxtId = TXT_SimPpo2;
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
139 break;
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
140 default: CcrModusTxtId = 'X';
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
141 break;
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
142 }
654
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
143 textPointer += snprintf(&text[textPointer], 60,\
707
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
144 "%c"
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
145 "\t"
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
146 "%c"
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
147 , TXT_CCRmode
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
148 , CcrModusTxtId
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
149 );
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
150
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
151 strcpy(&text[textPointer],"\n\r");
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
152 textPointer += 2;
654
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
153 }
707
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
154
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
155 if((line == 0) || (line == 2))
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
156 {
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
157 bool canDoFallback = pSettings->CCR_Mode == CCRMODE_Sensors;
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
158 if (!canDoFallback) {
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
159 text[textPointer++] = '\031';
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
160 }
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
161 textPointer += snprintf(&text[textPointer], 60,\
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
162 "%c"
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
163 ,TXT_Fallback
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
164 );
707
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
165
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
166 text[textPointer++] = '\t';
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
167 if(settingsGetPointer()->fallbackToFixedSetpoint && canDoFallback)
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
168 text[textPointer++] = '\005';
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
169 else
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
170 text[textPointer++] = '\006';
707
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
171
850
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
172 if (!canDoFallback)
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
173 {
816
c4ee952b9425 Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
heinrichsweikamp
parents: 811
diff changeset
174 text[textPointer++] = '\020';
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
175 disableLine(StMXTRA_O2_Fallback);
850
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
176 } else
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
177 {
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
178 enableLine(StMXTRA_O2_Fallback);
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 }
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
180 strcpy(&text[textPointer],"\n\r");
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 textPointer += 2;
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
182 }
707
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
183
e81afd727993 Menu cleanup rebreather specific settings:
Ideenmodellierer
parents: 662
diff changeset
184
654
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
185 if((line == 0) || (line == 3))
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
186 {
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
187 textPointer += snprintf(&text[textPointer], 60,\
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
188 "%c"
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
189 ,TXT_ScrubTime
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
190 );
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
191 strcpy(&text[textPointer],"\n\r");
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
192 textPointer += 2;
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
193 }
654
890440ab993a Introduced new menu tab for addition CCR options:
Ideenmodellierer
parents: 609
diff changeset
194
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 654
diff changeset
195 #ifdef ENABLE_PSCR_MODE
845
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 827
diff changeset
196 if((line == 0) || (line == 4))
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 827
diff changeset
197 {
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 827
diff changeset
198 if(pSettings->dive_mode == DIVEMODE_PSCR)
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 827
diff changeset
199 {
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 827
diff changeset
200 textPointer += snprintf(&text[textPointer], 60, "%c",TXT_PSClosedCircuit);
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 827
diff changeset
201 enableLine(StMXTRA_PSCR_O2_Drop);
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 827
diff changeset
202 }
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 827
diff changeset
203 else
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 827
diff changeset
204 {
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 827
diff changeset
205 text[textPointer++] = '\031'; /* change text color */
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 827
diff changeset
206 textPointer += snprintf(&text[textPointer], 60,"%c",TXT_PSClosedCircuit);
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 827
diff changeset
207 text[textPointer++] = '\020'; /* restore text color */
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 827
diff changeset
208 disableLine(StMXTRA_PSCR_O2_Drop);
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 827
diff changeset
209 }
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 827
diff changeset
210 strcpy(&text[textPointer],"\n\r");
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 827
diff changeset
211 textPointer += 2;
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 827
diff changeset
212 }
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 827
diff changeset
213 #endif
850
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
214 if((line == 0) || (line == 5))
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 654
diff changeset
215 {
850
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
216 if((pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_ANADIG) || (pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_DIGITAL))
845
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 827
diff changeset
217 {
850
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
218 textPointer += snprintf(&text[textPointer], 60,"%c",TXT_PreDive);
845
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 827
diff changeset
219 }
850
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
220 else
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
221 {
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
222 text[textPointer++] = '\031'; /* change text color */
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
223 textPointer += snprintf(&text[textPointer], 60,"%c",TXT_PreDive);
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
224 text[textPointer++] = '\020'; /* restore text color */
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
225 disableLine(StMXTRA_Predive_Check);
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
226 }
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
227 strcpy(&text[textPointer],"\n\r");
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
228 textPointer += 2;
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 654
diff changeset
229 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 return StMXTRA;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233
850
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
234 void tMXtra_checkLineStatus(void)
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
235 {
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
236 uint8_t localLineMask = 0;
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
237 uint8_t lineMask = getLineMask(StMXTRA);
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
238 SSettings *pSettings = settingsGetPointer();
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
239
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
240 if(pSettings->CCR_Mode != CCRMODE_Sensors)
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
241 {
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
242 localLineMask |= 1 << 2;
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
243 }
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
244 if(pSettings->dive_mode != DIVEMODE_PSCR)
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
245 {
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
246 localLineMask |= 1 << 4;
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
247 }
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
248 if((pSettings->ppo2sensors_source != O2_SENSOR_SOURCE_ANADIG) && (pSettings->ppo2sensors_source != O2_SENSOR_SOURCE_DIGITAL))
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
249 {
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
250 localLineMask |= 1 << 5;
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
251 }
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
252
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
253 if(lineMask != localLineMask)
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
254 {
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
255 updateMenu();
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
256 }
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
257 }
bc2fcd002fc4 Check line enable/disable state when a new page is selected:
Ideenmodellierer
parents: 845
diff changeset
258