annotate Discovery/Src/tMenuEditPlanner.c @ 574:01ee21dd311f

Improved focus detection: In previous version th calibration window was turned into the current one. At all two translations were used causing a jitter. Now the current view is translated into the calibration windows by one step increasing the quality of the prediction. Reworked detection of pitch/sector/scroll events: Sector and scroll uses pitch angles to calculate the view to show. Movment detection uses movment, which may also be out of focus for a short time. To improve all detections these two use cases are now handled individual. Sector and scroll have increased action angle in case yaw and roll stay stable.
author Ideenmodellierer
date Wed, 25 Nov 2020 20:26:01 +0100
parents 1c95f811967c
children 830de438e0b0
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/tMenuEditPlanner.c
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 /// \brief Menu Edit Planner 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 08-Jan-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 "tMenuEditPlanner.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 "ostc.h" // for MX_Bluetooth_PowerOff();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 #include "simulation.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
35 #include "tHome.h" //for tHome_gas_writer()
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36 #include "tMenuEdit.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 /* Private types -------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39 uint8_t resultPage = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40 int8_t first = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42 SDecoinfo* pDecoinfo;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44 uint16_t tMplan_pGasConsumption[6] = {0,0,0,0,0,0};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45 SSimDataSummary tMplan_Summary = {0};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47 /* Importend function prototypes ---------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48 extern uint8_t write_gas(char *text, uint8_t oxygen, uint8_t helium);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50 /* Imported variables --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51
567
1c95f811967c -Add 12HR Time Support
izzni
parents: 525
diff changeset
52 extern uint16_t tMplan_depth_meter, tMplan_intervall_time_minutes, tMplan_dive_time_minutes, tMplan_depth_editor;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54 /* Private variables ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 uint8_t gasChangeListDepthGasId[40];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57 /* Private function prototypes -----------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58 void openEdit_PlanInterval(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 void openEdit_PlanDiveTime(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 void openEdit_PlanMaxDepth(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61 void openEdit_PlanSettings(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62 void openEdit_PlanResult(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 /* Announced function prototypes -----------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 uint8_t OnAction_PlanInterval (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 uint8_t OnAction_PlanDiveTime (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 uint8_t OnAction_PlanMaxDepth (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68 uint8_t OnAction_PlanResultExit (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69 uint8_t OnAction_PlanSettings (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
73 void openEdit_Planner(uint8_t line)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75 set_globalState_Menu_Line(line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76 resetMenuEdit(CLUT_MenuPageDivePlanner);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77 resultPage = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79 switch(line)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81 case 1:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83 if(settingsGetPointer()->bluetoothActive != 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85 settingsGetPointer()->bluetoothActive = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86 MX_Bluetooth_PowerOff();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88 simulation_start(tMplan_depth_meter);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89 exitMenuEdit_to_Home();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
90 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
91 case 2:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92 openEdit_PlanInterval();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94 case 3:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95 openEdit_PlanDiveTime();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97 case 4:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98 openEdit_PlanMaxDepth();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100 case 5:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101 openEdit_PlanResult();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103 case 6:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104 openEdit_PlanSettings();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109 /* Private functions ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111 void openEdit_PlanInterval(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 char text[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116 text[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 text[2] = TXT2BYTE_Simulator;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118 text[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122 text[1] = TXT2BYTE_Intervall;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 write_label_var( 20, 550, ME_Y_LINE2, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125
567
1c95f811967c -Add 12HR Time Support
izzni
parents: 525
diff changeset
126 write_field_udigit(StMPLAN2_Interval, 400, 800, ME_Y_LINE2, &FontT48, "###\016\016min\017", (uint32_t)tMplan_intervall_time_minutes, 0, 0, 0);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127 setEvent(StMPLAN2_Interval, (uint32_t)OnAction_PlanInterval);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 startEdit();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132 void openEdit_PlanDiveTime(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134 char text[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 text[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138 text[2] = TXT2BYTE_Simulator;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 text[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 text[1] = TXT2BYTE_SimDiveTime;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145 write_label_var( 20, 550, ME_Y_LINE3, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146
567
1c95f811967c -Add 12HR Time Support
izzni
parents: 525
diff changeset
147 write_field_udigit(StMPLAN3_DiveTime, 400, 800, ME_Y_LINE3, &FontT48, "###\016\016min\017", (uint32_t)tMplan_dive_time_minutes, 0, 0, 0);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148 setEvent(StMPLAN3_DiveTime, (uint32_t)OnAction_PlanDiveTime);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149 startEdit();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 void openEdit_PlanMaxDepth(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155 char text[32];
567
1c95f811967c -Add 12HR Time Support
izzni
parents: 525
diff changeset
156 tMplan_depth_editor = unit_depth_integer(tMplan_depth_meter);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 text[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160 text[2] = TXT2BYTE_Simulator;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161 text[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165 text[1] = TXT2BYTE_SimMaxDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 write_label_var( 20, 550, ME_Y_LINE4, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168
567
1c95f811967c -Add 12HR Time Support
izzni
parents: 525
diff changeset
169 if(settingsGetPointer()->nonMetricalSystem)
1c95f811967c -Add 12HR Time Support
izzni
parents: 525
diff changeset
170 {
1c95f811967c -Add 12HR Time Support
izzni
parents: 525
diff changeset
171 write_field_udigit(StMPLAN4_MaxDepth, 400, 800, ME_Y_LINE4, &FontT48, "###\016\016ft\017", (uint32_t)tMplan_depth_editor, 0, 0, 0);
1c95f811967c -Add 12HR Time Support
izzni
parents: 525
diff changeset
172 }
1c95f811967c -Add 12HR Time Support
izzni
parents: 525
diff changeset
173 else
1c95f811967c -Add 12HR Time Support
izzni
parents: 525
diff changeset
174 {
1c95f811967c -Add 12HR Time Support
izzni
parents: 525
diff changeset
175 write_field_udigit(StMPLAN4_MaxDepth, 400, 800, ME_Y_LINE4, &FontT48, "###\016\016m\017", (uint32_t)tMplan_depth_editor, 0, 0, 0);
1c95f811967c -Add 12HR Time Support
izzni
parents: 525
diff changeset
176 }
1c95f811967c -Add 12HR Time Support
izzni
parents: 525
diff changeset
177
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178 setEvent(StMPLAN4_MaxDepth, (uint32_t)OnAction_PlanMaxDepth);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179 startEdit();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183 uint8_t OnAction_PlanInterval (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185 uint32_t newValue;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
187 if(action == ACTION_BUTTON_ENTER_FINAL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
188 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
189 evaluateNewString(editId, &newValue, 0, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
190 tMplan_intervall_time_minutes = newValue;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
191 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194 if(action == ACTION_BUTTON_NEXT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196 digitContent++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197 if(digitContent > '9')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 digitContent = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201 if(action == ACTION_BUTTON_BACK)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203 digitContent--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204 if(digitContent < '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205 digitContent = '9';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 return digitContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211 uint8_t OnAction_PlanDiveTime (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213 uint32_t newValue;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215 if(action == ACTION_BUTTON_ENTER_FINAL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 evaluateNewString(editId, &newValue, 0, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 tMplan_dive_time_minutes = newValue;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222 if(action == ACTION_BUTTON_NEXT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224 digitContent++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 if((digitNumber == 0) && (digitContent > '3'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 digitContent = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 if(digitContent > '9')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228 digitContent = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 if(action == ACTION_BUTTON_BACK)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233 digitContent--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 if((digitNumber == 0) && (digitContent < '0'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 digitContent = '3';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236 if(digitContent < '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237 digitContent = '9';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239 return digitContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
242
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243 uint8_t OnAction_PlanMaxDepth (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245 uint32_t newValue;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247 if(action == ACTION_BUTTON_ENTER_FINAL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249 evaluateNewString(editId, &newValue, 0, 0, 0);
567
1c95f811967c -Add 12HR Time Support
izzni
parents: 525
diff changeset
250 if(settingsGetPointer()->nonMetricalSystem)
1c95f811967c -Add 12HR Time Support
izzni
parents: 525
diff changeset
251 {
1c95f811967c -Add 12HR Time Support
izzni
parents: 525
diff changeset
252 tMplan_depth_editor = newValue * 10 / 33;
1c95f811967c -Add 12HR Time Support
izzni
parents: 525
diff changeset
253 }
1c95f811967c -Add 12HR Time Support
izzni
parents: 525
diff changeset
254 else
1c95f811967c -Add 12HR Time Support
izzni
parents: 525
diff changeset
255 {
1c95f811967c -Add 12HR Time Support
izzni
parents: 525
diff changeset
256 tMplan_depth_editor = newValue;
1c95f811967c -Add 12HR Time Support
izzni
parents: 525
diff changeset
257 }
1c95f811967c -Add 12HR Time Support
izzni
parents: 525
diff changeset
258 tMplan_depth_meter = tMplan_depth_editor;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
259 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
262 if(action == ACTION_BUTTON_NEXT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264 digitContent++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265 if((digitNumber == 0) && (digitContent > '3'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266 digitContent = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
267 if(digitContent > '9')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268 digitContent = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271 if(action == ACTION_BUTTON_BACK)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
273 digitContent--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
274 if((digitNumber == 0) && (digitContent < '0'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275 digitContent = '3';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276 if(digitContent < '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277 digitContent = '9';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279 return digitContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
281
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283 void openEdit_PlanSettings(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285 uint8_t travel_lbar, deco_lbar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286 uint16_t y_line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 char text[40];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
290 travel_lbar = pSettings->gasConsumption_travel_l_min;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
291 deco_lbar = pSettings->gasConsumption_deco_l_min;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
293 y_line = ME_Y_LINE_BASE + (6 * ME_Y_LINE_STEP);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
296 text[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297 text[2] = TXT2BYTE_SimConsumption;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 text[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302 text[1] = TXT2BYTE_SimConsumption;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304 write_label_var( 20, 800, y_line, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306 strncpy(text,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 " "
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308 "\016\016"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
309 " l\\min"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
310 "\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
311 " "
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
312 "\016\016"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
313 " deco"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
314 "\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
315 " "
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
316 "\016\016"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
317 " l\\min"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
318 "\017",
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
319 40
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
320 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
321 write_label_var( 400, 800, y_line, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
322
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
323 write_field_udigit(StMPLAN4_Settings, 400, 800, y_line, &FontT48, "## ##", (uint32_t)travel_lbar, (uint32_t)deco_lbar, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
324 // write_field_udigit(StMPLAN4_Settings, 400, 800, y_line, &FontT48, "##\016\016 l\\min\017 \016\016deco\017 ##\016\016 l\\min\017", (uint32_t)travel_lbar, (uint32_t)deco_lbar, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
325 // note : text max is 32 byte! -> ok and it does not like small fonts in between -> problem
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
326 write_buttonTextline(TXT2BYTE_ButtonMinus,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonPlus);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
327
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
328 setEvent(StMPLAN4_Settings, (uint32_t)OnAction_PlanSettings);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
329 startEdit();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
330
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
331 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
332 text[textPointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
333 text[textPointer++] = TXT2BYTE_SimConsumption;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
334 text[textPointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
335 textPointer += snprintf(&text[textPointer],30,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
336 "%u"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
337 "\016\016 l\\min\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
338 ,tMplan_gasConsumTravel);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
339 text[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
340 text[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
341 textPointer += snprintf(&text[textPointer],30,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
342 "\016\016deco\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
343 " %u"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
344 "\016\016 l\\min\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
345 ,tMplan_gasConsumDeco);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
346 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
347 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
348
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
349
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
350 uint8_t OnAction_PlanSettings (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
351 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
352 uint32_t newValueTravel, newValueDeco;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
353
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
354 if(action == ACTION_BUTTON_ENTER_FINAL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
355 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
356 evaluateNewString(editId, &newValueTravel, &newValueDeco, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
357 if(newValueTravel < 5 )
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
358 newValueTravel = 5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
359 if(newValueTravel > 30 )
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
360 newValueTravel = 30;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
361 if(newValueDeco < 5 )
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
362 newValueDeco = 5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
363 if(newValueDeco > 30 )
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
364 newValueDeco = 30;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
365
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
366 settingsGetPointer()->gasConsumption_travel_l_min = (uint8_t)newValueTravel;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
367 settingsGetPointer()->gasConsumption_deco_l_min = (uint8_t)newValueDeco;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
368
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
369 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
370 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
371 else if(action == ACTION_BUTTON_NEXT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
372 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
373 digitContent++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
374 if((digitNumber == 0) && (digitContent > '3'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
375 digitContent = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
376 if(digitContent > '9')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
377 digitContent = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
378 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
379 else if(action == ACTION_BUTTON_BACK)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
380 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
381 digitContent--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
382 if((digitNumber == 0) && (digitContent < '0'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
383 digitContent = '3';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
384 if(digitContent < '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
385 digitContent = '9';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
386 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
387
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
388 return digitContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
389 }
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 void openEdit_PlanResult(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
393 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
394 char text[256];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
395
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
396 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
397 text[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
398 text[2] = TXT2BYTE_Calculating;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
399 text[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
400
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
401 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
402
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
403 text[2] = TXT2BYTE_PleaseWait;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
404 write_label_var( 10, 790, ME_Y_LINE1, &FontT42, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
405
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
406 SSettings *pSettings = settingsGetPointer();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
407 uint8_t tMplan_gasConsumTravel = pSettings->gasConsumption_travel_l_min;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
408 uint8_t tMplan_gasConsumDeco = pSettings->gasConsumption_deco_l_min;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
409
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
410 resultPage = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
411 pDecoinfo = simulation_decoplaner(tMplan_depth_meter, tMplan_intervall_time_minutes, tMplan_dive_time_minutes, gasChangeListDepthGasId);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
412 simulation_gas_consumption(tMplan_pGasConsumption, tMplan_depth_meter, tMplan_dive_time_minutes, pDecoinfo, tMplan_gasConsumTravel, tMplan_gasConsumDeco, gasChangeListDepthGasId);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
413 simulation_helper_change_points(&tMplan_Summary, tMplan_depth_meter, tMplan_dive_time_minutes, pDecoinfo, gasChangeListDepthGasId);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
414
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
415 first = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
416 while((first < DECOINFO_STRUCT_MAX_STOPS-1) && pDecoinfo->output_stop_length_seconds[first+1])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
417 first++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
418 resultPage = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
419
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
420 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
421 text[1] = TXT2BYTE_ButtonNext;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
422 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
423 write_field_button(StMPLAN5_ExitResult, 30, 800, ME_Y_LINE6, &FontT48, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
424 setEvent(StMPLAN5_ExitResult, (uint32_t)OnAction_PlanResultExit);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
425 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
426
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
427
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
428
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
429 void refresh_PlanResult_helper(char *text, int start)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
430 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
431 uint8_t depthPrev, depthNext, depthLast, depthSecond, depthInc, depthChange, GasIdPrev, GasIdNextList[3], ListCount, oxygen_percentage, textptr;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
432 int lengthInMinutes;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
433
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
434 depthLast = (uint8_t)(stateUsed->diveSettings.last_stop_depth_bar * 10);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
435 depthSecond = (uint8_t)(stateUsed->diveSettings.input_second_to_last_stop_depth_bar * 10);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
436 depthInc = (uint8_t)(stateUsed->diveSettings.input_next_stop_increment_depth_bar * 10);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
437
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
438
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
439 if((start < 0) || (start >= DECOINFO_STRUCT_MAX_STOPS))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
440 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
441 *text = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
442 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
443 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
444
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
445 if(start == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
446 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
447 depthNext = depthLast;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
448 depthPrev = depthSecond;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
449 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
450 else if(start == 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
451 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
452 depthNext = depthSecond;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
453 depthPrev = depthSecond + depthInc;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
454 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
455 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
456 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
457 depthNext = depthSecond + (start - 1) * depthInc;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
458 depthPrev = depthNext + depthInc;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
459 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
460
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
461 /* gas changes ? */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
462 GasIdPrev = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
463 ListCount = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
464
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
465 for(int i = 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
466 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
467 if(stateSimGetPointer()->diveSettings.decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
468 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
469 depthChange = stateSimGetPointer()->diveSettings.decogaslist[i].change_during_ascent_depth_meter_otherwise_zero;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
470 if(depthPrev <= depthChange)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
471 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
472 GasIdPrev = i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
473 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
474 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
475 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
476 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
477 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
478 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
479
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
480 for(int i = GasIdPrev + 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
481 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
482 if(stateSimGetPointer()->diveSettings.decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
483 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
484 depthChange = stateSimGetPointer()->diveSettings.decogaslist[i].change_during_ascent_depth_meter_otherwise_zero;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
485 if((depthChange < depthPrev) && (depthChange >= depthNext))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
486 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
487 GasIdNextList[ListCount++] = i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
488 if(ListCount > 3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
489 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
490 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
491 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
492
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
493 /* text output */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
494 if(pDecoinfo->output_stop_length_seconds[start])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
495 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
496 textptr = snprintf(text,20,"\034%2u\016\016m\017 ",depthNext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
497 lengthInMinutes = (pDecoinfo->output_stop_length_seconds[start]+59)/60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
498
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
499 int i = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
500 while((i<lengthInMinutes) && (i<15))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
501 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
502 text[textptr++] = '_';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
503 i++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
504 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
505 for(int j=i;j<15;j++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
506 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
507 text[textptr++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
508 text[textptr++] = '_';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
509 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
510 textptr += snprintf(&text[textptr],20," %3i'", lengthInMinutes);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
511 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
512 else
525
1f557e5f4b5a Change color ID used in strings for light grey:
Ideenmodellierer
parents: 166
diff changeset
513 textptr = snprintf(text,20,"\031\034%2u\016\016m\017 ",depthNext);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
514
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
515 for(int i = 0; i < ListCount; i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
516 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
517 if(stateSimGetPointer()->diveSettings.decogaslist[GasIdNextList[i]].setPoint_cbar != stateSimGetPointer()->diveSettings.decogaslist[GasIdPrev].setPoint_cbar)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
518 snprintf(&text[textptr],20," %01.2f ", ((float)(stateSimGetPointer()->diveSettings.decogaslist[GasIdNextList[i]].setPoint_cbar))/100);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
519 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
520 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
521 oxygen_percentage = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
522 oxygen_percentage -= stateSimGetPointer()->diveSettings.decogaslist[GasIdNextList[i]].nitrogen_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
523 oxygen_percentage -= stateSimGetPointer()->diveSettings.decogaslist[GasIdNextList[i]].helium_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
524
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
525 text[textptr++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
526 textptr += tHome_gas_writer(oxygen_percentage, stateSimGetPointer()->diveSettings.decogaslist[GasIdNextList[i]].helium_percentage, &text[textptr]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
527 text[textptr++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
528 text[textptr] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
529 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
530 GasIdPrev = GasIdNextList[i];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
531 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
532 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
533
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
534
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
535 void refresh_PlanResult(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
536 {
166
255eedad4155 cleanup: get rid of some compile warnings
Jan Mulder <jlmulder@xs4all.nl>
parents: 38
diff changeset
537 char text[256];
255eedad4155 cleanup: get rid of some compile warnings
Jan Mulder <jlmulder@xs4all.nl>
parents: 38
diff changeset
538 uint8_t textpointer;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
539 uint16_t y_line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
540 uint8_t oxygen_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
541 int now;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
542
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
543 if(resultPage < 0xF0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
544 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
545 textpointer = snprintf(text,256,"\001 %u' @ %um",tMplan_dive_time_minutes,tMplan_depth_meter);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
546 if(tMplan_intervall_time_minutes)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
547 snprintf(&text[textpointer],256-textpointer," in %u'",tMplan_intervall_time_minutes);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
548 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
549 else if(resultPage == 0xFE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
550 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
551 textpointer = snprintf(text,30,"%c%c", TXT_2BYTE, TXT2BYTE_SimConsumption);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
552 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
553 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
554 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
555 textpointer = snprintf(text,30,"%c%c", TXT_2BYTE, TXT2BYTE_SimSummary);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
556 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
557 write_topline(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
558
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
559 switch (resultPage)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
560 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
561 case 0:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
562 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
563 case 0xFF: // summary
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
564 for(int j=0;j<4;j++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
565 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
566 y_line = ME_Y_LINE_BASE + ((j + 1) * ME_Y_LINE_STEP);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
567
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
568 // text
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
569 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
570 *text = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
571 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
572 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
573 text[textpointer++] = TXT2BYTE_SimDecTo + j; // see text_multilanguage.h
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
574 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
575 write_label_var( 10, 200, y_line, &FontT42, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
576
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
577 // depth
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
578 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
579 *text = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
580 switch(j)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
581 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
582 case 0: // descent
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
583 case 1: // level
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
584 textpointer = snprintf(&text[textpointer],20,"%u\016\016 m\017",tMplan_depth_meter);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
585 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
586 case 2: // first stop
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
587 textpointer = snprintf(&text[textpointer],20,"%u\016\016 m\017",tMplan_Summary.depthMeterFirstStop);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
588 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
589 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
590 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
591 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
592 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
593 write_label_var( 180, 400, y_line, &FontT42, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
594
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
595 // total time
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
596 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
597 *text = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
598 switch(j)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
599 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
600 case 0: // descent
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
601 textpointer = snprintf(&text[textpointer],20,"(%u')",tMplan_Summary.timeToBottom);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
602 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
603 case 1: // level
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
604 textpointer = snprintf(&text[textpointer],20,"(%u')",tMplan_Summary.timeAtBottom);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
605 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
606 case 2: // first stop
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
607 textpointer = snprintf(&text[textpointer],20,"(%u')",tMplan_Summary.timeToFirstStop);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
608 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
609 case 3: // surface
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
610 textpointer = snprintf(&text[textpointer],20,"(%u')",tMplan_Summary.timeToSurface);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
611 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
612 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
613 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
614 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
615 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
616 write_label_var( 320, 500, y_line, &FontT42, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
617
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
618 // ascent or descent rate or ppO2@bottom
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
619 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
620 *text = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
621 switch(j)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
622 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
623 case 0: // descent
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
624 textpointer = snprintf(&text[textpointer],20,"-%u\016\016 m\\min\017",tMplan_Summary.descentRateMeterPerMinute);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
625 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
626 case 1: // level
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
627 textpointer = snprintf(&text[textpointer],20,"%1.2f\016\016 %c\017",tMplan_Summary.ppO2AtBottom, TXT_ppO2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
628 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
629 case 2: // first stop
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
630 case 3: // surface
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
631 textpointer = snprintf(&text[textpointer],20,"%u\016\016 m\\min\017",tMplan_Summary.ascentRateMeterPerMinute);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
632 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
633 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
634 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
635 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
636 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
637 write_label_var( 500, 800, y_line, &FontT42, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
638 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
639 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
640 case 0xFE: // gas consumption
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
641 for(int j=1;j<6;j++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
642 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
643 y_line = ME_Y_LINE_BASE + ((j + 0) * ME_Y_LINE_STEP);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
644
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
645 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
646 *text = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
647 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
648
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
649 if(tMplan_pGasConsumption[j] == 0)
525
1f557e5f4b5a Change color ID used in strings for light grey:
Ideenmodellierer
parents: 166
diff changeset
650 text[textpointer++] = '\031';
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
651
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
652 textpointer += write_gas(&text[textpointer], settingsGetPointer()->gas[j].oxygen_percentage, settingsGetPointer()->gas[j].helium_percentage );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
653 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
654 write_label_var( 10, 390, y_line, &FontT42, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
655
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
656 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
657 *text = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
658 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
659
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
660 if(tMplan_pGasConsumption[j] == 0)
525
1f557e5f4b5a Change color ID used in strings for light grey:
Ideenmodellierer
parents: 166
diff changeset
661 text[textpointer++] = '\031';
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
662
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
663 textpointer += snprintf(&text[textpointer],20,"\002%u\016\016 ltr\017",tMplan_pGasConsumption[j]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
664 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
665 write_label_var( 350, 560, y_line, &FontT42, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
666 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
667 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
668
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
669 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
670 now = first -(5*(resultPage-1));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
671 for(int j=0;j<5;j++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
672 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
673 /* deco list */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
674 refresh_PlanResult_helper(text, now-j);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
675 y_line = ME_Y_LINE_BASE + ((j + 1) * ME_Y_LINE_STEP);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
676 if(*text != 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
677 write_label_var( 300, 790, y_line, &FontT42, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
678
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
679 /* common infos */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
680 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
681 *text = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
682 switch (j)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
683 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
684 case 0:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
685 if(stateUsed->diveSettings.deco_type.ub.standard == VPM_MODE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
686 textpointer += snprintf(&text[textpointer],20,"VPM +%u",stateUsed->diveSettings.vpm_conservatism);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
687 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
688 textpointer += snprintf(&text[textpointer],20,"GF %u/%u", stateUsed->diveSettings.gf_low, stateUsed->diveSettings.gf_high);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
689 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
690 case 1:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
691 if(settingsGetPointer()->dive_mode == DIVEMODE_CCR)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
692 text[textpointer++] = 'C';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
693 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
694 text[textpointer++] = 'O';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
695 text[textpointer++] = 'C';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
696 text[textpointer++] = ',';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
697 text[textpointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
698 oxygen_percentage = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
699 oxygen_percentage -= stateSimGetPointer()->lifeData.actualGas.nitrogen_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
700 oxygen_percentage -= stateSimGetPointer()->lifeData.actualGas.helium_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
701 textpointer += tHome_gas_writer(oxygen_percentage, stateSimGetPointer()->lifeData.actualGas.helium_percentage, &text[textpointer]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
702 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
703 case 2:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
704 textpointer += snprintf(&text[textpointer],20,"TTS: %u'", ((pDecoinfo->output_time_to_surface_seconds+59)/60));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
705 // alt: textpointer += snprintf(&text[textpointer],20,"TTS: %u'",tMplan_dive_time_minutes + ((pDecoinfo->output_time_to_surface_seconds+59)/60));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
706 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
707 case 3:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
708 textpointer += snprintf(&text[textpointer],20,"CNS:");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
709 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
710 case 4:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
711 textpointer += snprintf(&text[textpointer],20,"%.0f%%->%.0f%%",stateRealGetPointer()->lifeData.cns,stateSimGetPointer()->lifeData.cns);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
712 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
713 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
714 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
715 if(*text != 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
716 write_label_var( 10, 790, y_line, &FontT42, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
717 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
718 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
719 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
720
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
721 text[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
722 // if(first < (resultPage * 5))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
723 if(resultPage == 0xFF)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
724 text[1] = TXT2BYTE_Exit;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
725 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
726 text[1] = TXT2BYTE_ButtonNext;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
727 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
728 tMenuEdit_newButtonText(StMPLAN5_ExitResult, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
729 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonNext,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
730 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
731
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
732 uint8_t OnAction_PlanResultExit (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
733 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
734 resetEnterPressedToStateBeforeButtonAction();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
735 if(resultPage == 0xFF) // last extra page
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
736 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
737 resultPage = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
738 return EXIT_TO_MENU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
739 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
740 if(resultPage >= 0xF0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
741 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
742 resultPage++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
743 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
744 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
745 else if(first < (resultPage * 5))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
746 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
747 resultPage = 0xFE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
748 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
749 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
750 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
751 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
752 resultPage++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
753 return UNSPECIFIC_RETURN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
754 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
755 }