annotate Discovery/Src/tMenuEdit.c @ 135:5df4f1a315cb FlipDisplay

Restore old data copy locations Do first calculation based on ambient bar to avoid desaturation shift Added error handling for lost communication
author Ideenmodellierer
date Tue, 19 Feb 2019 18:18:37 +0100
parents e6b190f5fbc7
children cc9c18075e00
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/tMenuEdit.c
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 /// \brief Main Template file for Menu Setting Modifications
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 04-July-2014
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
8 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
9 /// \details
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
10 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 /// $Id$
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 ///////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 /// This program is free software: you can redistribute it and/or modify
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 /// it under the terms of the GNU General Public License as published by
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 /// the Free Software Foundation, either version 3 of the License, or
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 /// (at your option) any later version.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 /// This program is distributed in the hope that it will be useful,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21 /// but WITHOUT ANY WARRANTY; without even the implied warranty of
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 /// GNU General Public License for more details.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25 /// You should have received a copy of the GNU General Public License
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26 /// along with this program. If not, see <http://www.gnu.org/licenses/>.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 //////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29 /* Includes ------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30 #include "tMenuEdit.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32 #include "externLogbookFlash.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 #include "gfx_fonts.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 #include "tHome.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
35 #include "tInfoCompass.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36 #include "tMenuEditHardware.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37 #include "tMenuEditPlanner.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 #include "tMenuEditSystem.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39 #include "tMenuEditXtra.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41 /* Private types -------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42 #define TEXTSIZE 16
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46 uint32_t pEventFunction;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47 uint32_t callerID;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48 } SEventHandler;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52 uint32_t pEventFunction;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53 uint8_t functionParameter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54 uint8_t line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 } SBackMenuHandler;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 char orgText[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 char newText[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61 uint16_t input[4];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62 uint16_t coord[3];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63 int8_t begin[4], size[4];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 tFont *fontUsed;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 uint32_t callerID;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 uint8_t maintype;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 uint8_t subtype;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68 } SEditIdent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70 typedef enum
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72 FIELD_NUMBERS = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
73 FIELD_BUTTON,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74 FIELD_SELECT,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75 FIELD_SYMBOL,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76 FIELD_TOGGLE,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77 FIELD_ON_OFF,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78 FIELD_UDIGIT,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79 FIELD_2DIGIT,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80 FIELD_3DIGIT,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81 FIELD_FLOAT,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82 FIELD_END
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83 } SField;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85 /* Private variables ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86 GFX_DrawCfgScreen tMEscreen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87 GFX_DrawCfgScreen tMEcursor;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88 GFX_DrawCfgScreen tMEcursorNew;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
90 uint32_t menuID;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
91 uint8_t menuColor;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93 int8_t id = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94 int8_t idLast = -1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95 SEditIdent ident[10];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96 int8_t tME_stop = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98 int8_t evid = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99 int8_t evidLast = -1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100 SEventHandler event[10];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 SBackMenuHandler backmenu;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104 int8_t block = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105 int8_t subBlockPosition = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107 _Bool EnterPressedBeforeButtonAction = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108 _Bool EnterPressed = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110 _Bool WriteSettings = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112 /* Private function prototypes -----------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 void draw_tMEdesign(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114 void set_cursor(uint8_t forThisIdentID);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 void set_cursorNew(uint8_t forThisIdentID);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116 void startMenuEditFieldSelect(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 void create_newText_for_actual_Id(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118 void write_content_of_actual_Id(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 void clean_content_of_actual_Id(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 void write_content_without_Id(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122 void nextMenuEditFieldDigit(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123 void upMenuEditFieldDigit(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 void downMenuEditFieldDigit(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126 void draw_tMEcursorNewDesign(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 void exitMenuEdit(uint8_t writeSettingsIfEnterPressed);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129 uint8_t split_Content_to_Digit_helper(uint8_t inContentAscii, uint8_t *outDigit100, uint8_t *outDigit10, uint8_t *outDigit1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 void tMenuEdit_init(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135 tMEcursor.FBStartAdress = getFrame(7);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 tMEcursor.ImageHeight = 480;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 tMEcursor.ImageWidth = 800;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138 tMEcursor.LayerIndex = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 GFX_fill_buffer(tMEcursor.FBStartAdress, 0xFF, CLUT_MenuEditCursor);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142 tMEcursorNew.FBStartAdress = getFrame(8);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 tMEcursorNew.ImageHeight = 390;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144 tMEcursorNew.ImageWidth = 800;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145 tMEcursorNew.LayerIndex = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147 draw_tMEcursorNewDesign();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150 void stop_cursor_fields(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 tME_stop = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155 void resetMenuEdit(uint8_t color)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157 id = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 idLast = -1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 evid = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160 evidLast = -1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161 tME_stop = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 EnterPressed = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163 EnterPressedBeforeButtonAction = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165 setBackMenu(0,0,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 releaseFrame(9,tMEscreen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169 tMEscreen.FBStartAdress = getFrame(9);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170 tMEscreen.ImageHeight = 480;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
171 tMEscreen.ImageWidth = 800;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
172 tMEscreen.LayerIndex = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
173
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175 write_content_simple(&tMEscreen, 0, 38, 0, &Awe48,"x",CLUT_ButtonSymbols);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176 write_content_simple(&tMEscreen, 800-46, 800, 0, &Awe48,"u",CLUT_ButtonSymbols);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177 write_content_simple(&tMEscreen, 0, 45, 480-45, &Awe48,"d",CLUT_ButtonSymbols);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178 write_content_simple(&tMEscreen, 800-48, 800, 480-45, &Awe48,"e",CLUT_ButtonSymbols);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180 menuID = get_globalState();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182 menuColor = color;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184 // draw_tMEdesign();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185 // GFX_SetFramesTopBottom(tMEscreen.FBStartAdress, tMEcursor.FBStartAdress,480);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186 uint8_t line = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
187 // GFX_SetFramesTopBottom(tMEscreen.FBStartAdress, (tMEcursorNew.FBStartAdress) + 65*2*(line - 1),390);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
188 GFX_SetFrameTop(tMEscreen.FBStartAdress);
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
189 if(!settingsGetPointer()->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
190 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
191 GFX_SetFrameBottom((tMEcursorNew.FBStartAdress) + 65*2*(line - 1), 0, 25, 800, 390);
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
192 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
193 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
194 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
195 GFX_SetFrameBottom((tMEcursorNew.FBStartAdress)+ (390 - 65 *(line)) *2, 0, 480-390-25, 800, 390);
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
196 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200 void tMenuEdit_refresh_live_content(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203 if(get_globalState() == (StMHARD3_O2_Sensor1 & MaskFieldDigit))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205 uint32_t rememberPage = tMEscreen.FBStartAdress;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 tMEscreen.FBStartAdress = getFrame(9);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 // draw_tMEdesign();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208 refresh_O2Sensors();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209 GFX_SetFrameTop(tMEscreen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210 releaseFrame(9,rememberPage);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 else if(get_globalState() == (StMHARD2_Compass_SetCourse & MaskFieldDigit))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214 uint32_t rememberPage = tMEscreen.FBStartAdress;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215 tMEscreen.FBStartAdress = getFrame(9);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 refresh_CompassEdit();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 GFX_SetFrameTop(tMEscreen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 releaseFrame(9,rememberPage);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 else if(get_globalState() == (StMXTRA_CompassHeading & MaskFieldDigit))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222 uint32_t rememberPage = tMEscreen.FBStartAdress;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 tMEscreen.FBStartAdress = getFrame(9);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224 // draw_tMEdesign();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 refresh_CompassHeading();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 GFX_SetFrameTop(tMEscreen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 releaseFrame(9,rememberPage);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229 else if(get_globalState() == (StMSYS5_Info & MaskFieldDigit))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 uint32_t rememberPage = tMEscreen.FBStartAdress;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 tMEscreen.FBStartAdress = getFrame(9);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233 refresh_InformationPage();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 GFX_SetFrameTop(tMEscreen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 releaseFrame(9,rememberPage);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237 else if(get_globalState() == (StMPLAN5_ExitResult & MaskFieldDigit))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239 uint32_t rememberPage = tMEscreen.FBStartAdress;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240 tMEscreen.FBStartAdress = getFrame(9);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 refresh_PlanResult();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
242 GFX_SetFrameTop(tMEscreen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243 releaseFrame(9,rememberPage);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245 else if(get_globalState() == (StMHARD5_Button1 & MaskFieldDigit)) // will not be executed in EditFieldMode as global state is different
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247 uint32_t rememberPage = tMEscreen.FBStartAdress;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248 tMEscreen.FBStartAdress = getFrame(9);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249 refresh_ButtonValuesFromPIC();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250 GFX_SetFrameTop(tMEscreen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251 releaseFrame(9,rememberPage);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254 else if(get_globalState() == (StMHARD6_ScooterDrag & MaskFieldDigit))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256 uint32_t rememberPage = tMEscreen.FBStartAdress;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
257 tMEscreen.FBStartAdress = getFrame(9);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
258 refresh_ScooterControl();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
259 GFX_SetFrameTop(tMEscreen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260 releaseFrame(9,rememberPage);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
262 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263 else if(get_globalState() == (StMSYS3_Units & MaskFieldDigit))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265 uint32_t rememberPage = tMEscreen.FBStartAdress;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266 tMEscreen.FBStartAdress = getFrame(9);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
267 refresh_Design();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268 GFX_SetFrameTop(tMEscreen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269 releaseFrame(9,rememberPage);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271 else if(get_globalState() == (StMSYS4_CViewTimeout & MaskFieldDigit))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
273 uint32_t rememberPage = tMEscreen.FBStartAdress;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
274 tMEscreen.FBStartAdress = getFrame(9);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275 refresh_Customviews();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276 GFX_SetFrameTop(tMEscreen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277 releaseFrame(9,rememberPage);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
281 void tMenuEdit_writeSettingsToFlash(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283 if(WriteSettings)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285 GFX_logoAutoOff();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286 ext_flash_write_settings();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 WriteSettings = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
290
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
291 void helperLeaveMenuEditField(uint8_t idID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
293 if(ident[idID].maintype == FIELD_NUMBERS)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295 change_CLUT_entry((CLUT_MenuEditField0 + idID), CLUT_MenuEditFieldRegular);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
296 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300 void helperGotoMenuEditField(uint8_t idID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303 if(ident[idID].maintype == FIELD_NUMBERS)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305 change_CLUT_entry((CLUT_MenuEditField0 + idID), CLUT_MenuEditFieldSelected);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308 set_cursorNew(idID);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
309 // set_cursor(idID);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
310 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
311
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
312
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
313 void exitMenuEdit_to_BackMenu(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
314 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
315 _Bool EnterPressedBackup = EnterPressed;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
316
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
317 if(backmenu.pEventFunction)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
318 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
319 ((void (*)(uint8_t))(backmenu.pEventFunction))(backmenu.functionParameter);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
320
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
321 EnterPressed = EnterPressedBackup;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
322 // if(backmenu.line > 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
323 // helperGotoMenuEditField(backmenu.line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
324 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
325 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
326
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
327
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
328 void exitMenuEdit_to_Menu_with_Menu_Update(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
329 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
330 EnterPressed = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
331 exitMenuEdit(1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
332 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
333
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
334
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
335 void exitMenuEdit_to_Menu_with_Menu_Update_do_not_write_settings_for_this_only(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
336 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
337 EnterPressed = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
338 exitMenuEdit(0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
339 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
340
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
341
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
342 void exitMenuEdit_to_Home_with_Menu_Update(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
343 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
344 EnterPressed = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
345 exitMenuEdit(1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
346 set_globalState_tHome();
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 void exitMenuEdit_to_InfoCompassCalibration(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
351 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
352 exitMenuEdit(1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
353 openInfo_Compass();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
354 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
355
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
356
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
357 void exitMenuEdit_to_Home(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
358 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
359 exitMenuEdit(1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
360 set_globalState_tHome();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
361 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
362
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
363
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
364 void exitMenuEdit(uint8_t writeSettingsIfEnterPressed)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
365 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
366 openMenu(0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
367 if(EnterPressed)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
368 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
369 updateMenu();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
370 if((stateUsed->mode == MODE_SURFACE) && writeSettingsIfEnterPressed)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
371 WriteSettings = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
372 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
373 releaseFrame(9,tMEscreen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
374 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
375
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
376
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
377 void exitMenuEditBackMenuOption(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
378 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
379 if(backmenu.pEventFunction == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
380 exitMenuEdit(1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
381 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
382 exitMenuEdit_to_BackMenu();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
383 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
384
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
385
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
386 void startMenuEditFieldSelect(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
387 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
388 id = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
389 helperGotoMenuEditField(id);
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
393 void nextMenuEditField(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
394 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
395 helperLeaveMenuEditField(id);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
396
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
397 if(id < idLast)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
398 id++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
399 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
400 id = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
401 helperGotoMenuEditField(id);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
402 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
403
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
404 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
405 void previousMenuEditField(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
406 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
407 helperLeaveMenuEditField(id);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
408 if(id > 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
409 id--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
410 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
411 id = idLast;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
412 helperGotoMenuEditField(id);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
413 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
414 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
415
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
416 _Bool inc_subBlock_or_block_of_actual_id(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
417 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
418 if(event[evid].callerID != ident[id].callerID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
419 return 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
420
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
421 if((ident[id].subtype != FIELD_3DIGIT) && (ident[id].subtype != FIELD_2DIGIT) && ((subBlockPosition + 1) < ident[id].size[block]))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
422 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
423 subBlockPosition++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
424 return 1;
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 if(((block + 1) < 4) && (ident[id].size[block+1] > 0))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
428 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
429 block++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
430 subBlockPosition = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
431 return 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
432 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
433
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
434 return 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
435 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
436
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
437
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
438 uint8_t get_newContent_of_actual_id_block_and_subBlock(uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
439 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
440 uint8_t (*onActionFunc)(uint32_t, uint8_t, uint8_t, uint8_t, uint8_t);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
441 uint8_t content;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
442
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
443 if(event[evid].callerID != ident[id].callerID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
444 return 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
445
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
446 onActionFunc = (uint8_t (*)(uint32_t, uint8_t, uint8_t, uint8_t, uint8_t))(event[evid].pEventFunction);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
447
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
448 if((ident[id].maintype == FIELD_NUMBERS) && (ident[id].subtype == FIELD_3DIGIT))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
449 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
450 content = 100 * ( ident[id].newText[ident[id].begin[block] + 0] - '0');
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
451 content += 10 * ( ident[id].newText[ident[id].begin[block] + 1] - '0');
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
452 content += ident[id].newText[ident[id].begin[block] + 2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
453 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
454 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
455 if((ident[id].maintype == FIELD_NUMBERS) && (ident[id].subtype == FIELD_2DIGIT))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
456 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
457 content = 10 * (ident[id].newText[ident[id].begin[block] + 0] - '0');
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
458 content += ident[id].newText[ident[id].begin[block] + 1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
459 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
460 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
461 if(ident[id].maintype == FIELD_NUMBERS)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
462 content = ident[id].newText[ident[id].begin[block] + subBlockPosition];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
463 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
464 if(ident[id].maintype == FIELD_ON_OFF)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
465 content = ident[id].input[block];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
466 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
467 content = 0; /* just a default for protection */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
468
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
469 return onActionFunc(ident[id].callerID, block, subBlockPosition, content, action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
470 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
471
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
472 void mark_digit_of_actual_id_with_this_block_and_subBlock(int8_t oldblock, int8_t oldsubblockpos)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
473 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
474 char oneCharText[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
475 uint16_t positionOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
476
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
477 if(event[evid].callerID != ident[id].callerID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
478 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
479
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
480 if(ident[id].maintype == FIELD_NUMBERS)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
481 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
482 oneCharText[0] = ident[id].newText[ident[id].begin[oldblock] + oldsubblockpos];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
483 oneCharText[1] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
484 positionOffset = GFX_return_offset(ident[id].fontUsed, ident[id].newText, ident[id].begin[oldblock] + oldsubblockpos);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
485 write_content( ident[id].coord[0] + positionOffset, ident[id].coord[1], ident[id].coord[2], ident[id].fontUsed, oneCharText, CLUT_MenuEditFieldSelected);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
486 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
487 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
488
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
489
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
490 void mark_new_2digit_of_actual_id_block(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
491 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
492 char oneCharText[3];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
493 uint16_t positionOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
494
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
495 if(event[evid].callerID != ident[id].callerID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
496 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
497
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
498 if(ident[id].maintype == FIELD_NUMBERS)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
499 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
500 oneCharText[0] = ident[id].newText[ident[id].begin[block] + 0];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
501 oneCharText[1] = ident[id].newText[ident[id].begin[block] + 1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
502 oneCharText[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
503 positionOffset = GFX_return_offset(ident[id].fontUsed, ident[id].newText, ident[id].begin[block] + 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
504 write_content( ident[id].coord[0] + positionOffset, ident[id].coord[1], ident[id].coord[2], ident[id].fontUsed, oneCharText, CLUT_MenuEditDigit);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
505 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
506 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
507
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
508
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
509 void mark_new_3digit_of_actual_id_block(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
510 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
511 char oneCharText[4];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
512 uint16_t positionOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
513
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
514 if(event[evid].callerID != ident[id].callerID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
515 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
516
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
517 if(ident[id].maintype == FIELD_NUMBERS)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
518 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
519 oneCharText[0] = ident[id].newText[ident[id].begin[block] + 0];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
520 oneCharText[1] = ident[id].newText[ident[id].begin[block] + 1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
521 oneCharText[2] = ident[id].newText[ident[id].begin[block] + 2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
522 oneCharText[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
523 positionOffset = GFX_return_offset(ident[id].fontUsed, ident[id].newText, ident[id].begin[block] + 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
524 write_content( ident[id].coord[0] + positionOffset, ident[id].coord[1], ident[id].coord[2], ident[id].fontUsed, oneCharText, CLUT_MenuEditDigit);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
525 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
526 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
527
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
528
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
529 void mark_new_digit_of_actual_id_block_and_subBlock(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
530 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
531 char oneCharText[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
532 uint16_t positionOffset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
533
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
534 if(event[evid].callerID != ident[id].callerID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
535 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
536
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
537 if(ident[id].maintype == FIELD_NUMBERS)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
538 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
539 oneCharText[0] = ident[id].newText[ident[id].begin[block] + subBlockPosition];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
540 oneCharText[1] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
541 positionOffset = GFX_return_offset(ident[id].fontUsed, ident[id].newText, ident[id].begin[block] + subBlockPosition);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
542 write_content( ident[id].coord[0] + positionOffset, ident[id].coord[1], ident[id].coord[2], ident[id].fontUsed, oneCharText, CLUT_MenuEditDigit);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
543 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
544 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
545
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
546
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
547 void enterMenuEditField(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
548 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
549 uint8_t newContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
550 uint8_t digit100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
551 uint8_t digit10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
552 uint8_t digit1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
553
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
554 evid = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
555 while((evid < evidLast) && (event[evid].callerID != ident[id].callerID))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
556 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
557 evid++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
558 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
559
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
560 if(event[evid].callerID != ident[id].callerID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
561 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
562
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
563 set_globalState(event[evid].callerID);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
564 block = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
565 subBlockPosition = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
566
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
567
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
568 if(ident[id].maintype == FIELD_NUMBERS)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
569 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
570 change_CLUT_entry(CLUT_MenuEditLineSelected, CLUT_MenuEditCursor);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
571 // old stuff? hw 150916, reactivated 150923, this shows which digit will be changed now as it marks the other grey/black
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
572 // now fixed for button settings with newContent <= '0'+99 condition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
573 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditFieldSelected);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
574 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
575
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
576 newContent = get_newContent_of_actual_id_block_and_subBlock(ACTION_BUTTON_ENTER);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
577
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
578 if (((newContent == UPDATE_DIVESETTINGS) || (newContent == UPDATE_AND_EXIT_TO_HOME) || (newContent == UPDATE_AND_EXIT_TO_MENU)) && (actual_menu_content == MENU_SURFACE))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
579 createDiveSettings();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
580
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
581 if(newContent == EXIT_TO_MENU_WITH_LOGO)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
582 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
583 GFX_logoAutoOff();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
584 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
585
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
586 if((newContent == EXIT_TO_MENU) || (newContent == UPDATE_AND_EXIT_TO_MENU) || (newContent == EXIT_TO_MENU_WITH_LOGO))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
587 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
588 if(backmenu.pEventFunction == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
589 exitMenuEdit(1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
590 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
591 exitMenuEdit_to_BackMenu();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
592 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
593 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
594
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
595 if((newContent == EXIT_TO_HOME) || (newContent == UPDATE_AND_EXIT_TO_HOME))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
596 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
597 exitMenuEdit_to_Home();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
598 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
599 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
600
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
601 if(newContent == EXIT_TO_INFO_COMPASS)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
602 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
603 exitMenuEdit_to_InfoCompassCalibration();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
604 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
605 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
606
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
607
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
608 switch(ident[id].maintype)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
609 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
610 case FIELD_NUMBERS:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
611 write_buttonTextline(TXT2BYTE_ButtonMinus,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonPlus);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
612
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
613 if(ident[id].subtype == FIELD_UDIGIT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
614 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
615 if((newContent >= '0') && (newContent <= '9'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
616 ident[id].newText[ident[id].begin[block] + subBlockPosition] = newContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
617
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
618 mark_new_digit_of_actual_id_block_and_subBlock();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
619 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
620 else if(ident[id].subtype == FIELD_3DIGIT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
621 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
622 if((newContent >= '0') && (newContent <= '0'+200))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
623 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
624 split_Content_to_Digit_helper( newContent, &digit100, &digit10, &digit1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
625 ident[id].newText[ident[id].begin[block] + 0] = '0' + digit100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
626 ident[id].newText[ident[id].begin[block] + 1] = '0' + digit10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
627 ident[id].newText[ident[id].begin[block] + 2] = '0' + digit1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
628 mark_new_3digit_of_actual_id_block();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
629 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
630 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
631 else // FIELD_2DIGIT
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
632 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
633 if((newContent >= '0') && (newContent <= '0'+99))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
634 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
635 ident[id].newText[ident[id].begin[block]] = '0' + (newContent - '0')/10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
636 ident[id].newText[ident[id].begin[block] + 1] = '0' + ((newContent - '0') - (10*((newContent - '0')/10)));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
637 mark_new_2digit_of_actual_id_block();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
638 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
639 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
640 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
641 case FIELD_BUTTON:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
642 set_globalState(menuID);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
643 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
644 case FIELD_ON_OFF:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
645 set_globalState(menuID);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
646 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
647 case FIELD_SYMBOL:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
648 ident[id].input[0] += 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
649 if(ident[id].input[0] >= ident[id].input[1])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
650 ident[id].input[0] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
651 ident[id].newText[0] = ident[id].orgText[ident[id].input[0]];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
652 write_content_of_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
653 set_globalState(menuID);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
654 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
655 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
656 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
657
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
658
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
659 void exitMenuEditField(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
660 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
661 uint8_t newContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
662
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
663 set_globalState(menuID);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
664
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
665 if(event[evid].callerID != ident[id].callerID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
666 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
667
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
668 newContent = get_newContent_of_actual_id_block_and_subBlock(ACTION_TIMEOUT);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
669
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
670 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
671 uint8_t (*onActionFunc)(uint32_t, uint8_t, uint8_t, uint8_t, uint8_t);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
672 uint8_t newContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
673
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
674 onActionFunc = (uint8_t (*)(uint32_t, uint8_t, uint8_t, uint8_t, uint8_t))(event[evid].pEventFunction);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
675
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
676 newContent = onActionFunc(ident[id].callerID, 0, 0, 255, ACTION_BUTTON_BACK);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
677 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
678
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
679 /* destroy changes of editing in newText */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
680 change_CLUT_entry(CLUT_MenuEditLineSelected, CLUT_MenuLineSelected);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
681 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditFieldRegular);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
682
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
683 create_newText_for_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
684 write_content_of_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
685
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
686 if((newContent == EXIT_TO_MENU) || (newContent == UPDATE_AND_EXIT_TO_MENU))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
687 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
688 exitMenuEdit(1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
689 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
690 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
691
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
692 if((newContent == EXIT_TO_HOME) || (newContent == UPDATE_AND_EXIT_TO_HOME))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
693 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
694 exitMenuEdit_to_Home();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
695 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
696 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
697
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
698 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
699
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
700 void nextMenuEditFieldDigit(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
701 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
702 uint8_t action;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
703 uint8_t newContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
704 int8_t blockOld = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
705 int8_t subBlockPositionOld = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
706
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
707 if(event[evid].callerID != ident[id].callerID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
708 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
709
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
710 blockOld = block;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
711 subBlockPositionOld = subBlockPosition;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
712
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
713 if(inc_subBlock_or_block_of_actual_id())
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
714 action = ACTION_BUTTON_ENTER;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
715 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
716 action = ACTION_BUTTON_ENTER_FINAL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
717
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
718 newContent = get_newContent_of_actual_id_block_and_subBlock(action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
719
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
720 if(action == ACTION_BUTTON_ENTER_FINAL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
721 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
722 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
723
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
724 change_CLUT_entry(CLUT_MenuEditLineSelected, CLUT_MenuLineSelected);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
725 for(int i = 0;i<=9;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
726 change_CLUT_entry((CLUT_MenuEditField0 + i), CLUT_MenuEditFieldRegular);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
727
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
728 if(((newContent == UPDATE_DIVESETTINGS) || (newContent == UPDATE_AND_EXIT_TO_HOME) || (newContent == UPDATE_AND_EXIT_TO_MENU)) && (actual_menu_content == MENU_SURFACE))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
729 createDiveSettings();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
730
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
731 if((newContent == EXIT_TO_MENU) || (newContent == UPDATE_AND_EXIT_TO_MENU))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
732 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
733 exitMenuEdit(1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
734 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
735 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
736
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
737 if((newContent == EXIT_TO_HOME) || (newContent == UPDATE_AND_EXIT_TO_HOME))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
738 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
739 exitMenuEdit_to_Home();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
740 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
741 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
742 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
743
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
744 if((ident[id].maintype == FIELD_NUMBERS) && (ident[id].subtype == FIELD_3DIGIT) && (action == ACTION_BUTTON_ENTER) &&(newContent >= '0') && (newContent <= '0' + 99))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
745 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
746 ident[id].newText[ident[id].begin[block] + 0] = '0' + (newContent - '0')/100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
747 ident[id].newText[ident[id].begin[block] + 1] = '0' + (newContent - '0')/10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
748 ident[id].newText[ident[id].begin[block] + 2] = '0' + ((newContent - '0') - (10*((newContent - '0')/10)));
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 if((ident[id].maintype == FIELD_NUMBERS) && (ident[id].subtype == FIELD_2DIGIT) && (action == ACTION_BUTTON_ENTER) &&(newContent >= '0') && (newContent <= '0' + 99))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
752 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
753 ident[id].newText[ident[id].begin[block] + 0] = '0' + (newContent - '0')/10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
754 ident[id].newText[ident[id].begin[block] + 1] = '0' + ((newContent - '0') - (10*((newContent - '0')/10)));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
755 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
756 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
757 if((ident[id].maintype == FIELD_NUMBERS) && (action == ACTION_BUTTON_ENTER) && (newContent >= '0') && (newContent <= '9'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
758 ident[id].newText[ident[id].begin[block] + subBlockPosition] = newContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
759
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
760 if(action == ACTION_BUTTON_ENTER)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
761 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
762 if((ident[id].maintype == FIELD_NUMBERS) && (ident[id].subtype == FIELD_3DIGIT))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
763 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
764 mark_new_3digit_of_actual_id_block();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
765 mark_digit_of_actual_id_with_this_block_and_subBlock(blockOld,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
766 mark_digit_of_actual_id_with_this_block_and_subBlock(blockOld,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
767 mark_digit_of_actual_id_with_this_block_and_subBlock(blockOld,2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
768 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
769 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
770 if((ident[id].maintype == FIELD_NUMBERS) && (ident[id].subtype == FIELD_2DIGIT))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
771 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
772 mark_new_2digit_of_actual_id_block();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
773 mark_digit_of_actual_id_with_this_block_and_subBlock(blockOld,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
774 mark_digit_of_actual_id_with_this_block_and_subBlock(blockOld,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
775 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
776 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
777 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
778 mark_new_digit_of_actual_id_block_and_subBlock();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
779 mark_digit_of_actual_id_with_this_block_and_subBlock(blockOld,subBlockPositionOld);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
780 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
781 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
782 else /* action == ACTION_BUTTON_ENTER_FINAL */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
783 set_globalState(menuID);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
784 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
785
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
786 uint8_t split_Content_to_Digit_helper(uint8_t inContentAscii, uint8_t *outDigit100, uint8_t *outDigit10, uint8_t *outDigit1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
787 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
788 uint8_t newContent, tempDigit, CopyContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
789
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
790 newContent = inContentAscii - '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
791 CopyContent = newContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
792
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
793 tempDigit = newContent / 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
794 newContent -= tempDigit * 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
795 if(outDigit100)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
796 *outDigit100 = tempDigit;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
797
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
798 tempDigit = newContent / 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
799 newContent -= tempDigit * 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
800 if(outDigit10)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
801 *outDigit10 = tempDigit;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
802
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
803 tempDigit = newContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
804 if(outDigit1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
805 *outDigit1 = tempDigit;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
806
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
807 return CopyContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
808 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
809
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
810 void upMenuEditFieldDigit(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
811 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
812 uint8_t newContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
813 uint8_t digit100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
814 uint8_t digit10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
815 uint8_t digit1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
816
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
817 if(event[evid].callerID != ident[id].callerID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
818 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
819
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
820 newContent = get_newContent_of_actual_id_block_and_subBlock(ACTION_BUTTON_NEXT);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
821
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
822 if((ident[id].maintype == FIELD_NUMBERS) && (ident[id].subtype == FIELD_3DIGIT) &&(newContent >= '0') && (newContent <= '0' + 200))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
823 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
824 split_Content_to_Digit_helper( newContent, &digit100, &digit10, &digit1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
825 ident[id].newText[ident[id].begin[block] + 0] = '0' + digit100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
826 ident[id].newText[ident[id].begin[block] + 1] = '0' + digit10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
827 ident[id].newText[ident[id].begin[block] + 2] = '0' + digit1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
828 mark_new_3digit_of_actual_id_block();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
829 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
830 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
831
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
832 if((ident[id].maintype == FIELD_NUMBERS) && (ident[id].subtype == FIELD_2DIGIT) &&(newContent >= '0') && (newContent <= '0' + 99))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
833 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
834 ident[id].newText[ident[id].begin[block] + 0] = '0' + (newContent - '0')/10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
835 ident[id].newText[ident[id].begin[block] + 1] = '0' + ((newContent - '0') - (10*((newContent - '0')/10)));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
836 mark_new_2digit_of_actual_id_block();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
837 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
838 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
839
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
840 if((ident[id].maintype == FIELD_NUMBERS) && (newContent >= '0') && (newContent <= '9'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
841 ident[id].newText[ident[id].begin[block] + subBlockPosition] = newContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
842
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
843 mark_new_digit_of_actual_id_block_and_subBlock();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
844 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
845
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
846
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
847 void downMenuEditFieldDigit(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
848 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
849 uint8_t newContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
850 uint8_t digit100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
851 uint8_t digit10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
852 uint8_t digit1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
853
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
854 if(event[evid].callerID != ident[id].callerID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
855 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
856
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
857 newContent = get_newContent_of_actual_id_block_and_subBlock(ACTION_BUTTON_BACK);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
858
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
859 if((ident[id].maintype == FIELD_NUMBERS) && (ident[id].subtype == FIELD_3DIGIT) &&(newContent >= '0') && (newContent <= '0' + 200))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
860 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
861 split_Content_to_Digit_helper( newContent, &digit100, &digit10, &digit1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
862 ident[id].newText[ident[id].begin[block] + 0] = '0' + digit100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
863 ident[id].newText[ident[id].begin[block] + 1] = '0' + digit10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
864 ident[id].newText[ident[id].begin[block] + 2] = '0' + digit1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
865 mark_new_3digit_of_actual_id_block();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
866 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
867 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
868
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
869 if((ident[id].maintype == FIELD_NUMBERS) && (ident[id].subtype == FIELD_2DIGIT) &&(newContent >= '0') && (newContent <= '0' + 99))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
870 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
871 ident[id].newText[ident[id].begin[block] + 0] = '0' + (newContent - '0')/10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
872 ident[id].newText[ident[id].begin[block] + 1] = '0' + ((newContent - '0') - (10*((newContent - '0')/10)));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
873 mark_new_2digit_of_actual_id_block();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
874 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
875 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
876
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
877 if((ident[id].maintype == FIELD_NUMBERS) && (newContent >= '0') && (newContent <= '9'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
878 ident[id].newText[ident[id].begin[block] + subBlockPosition] = newContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
879
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
880 mark_new_digit_of_actual_id_block_and_subBlock();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
881 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
882
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
883
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
884 void evaluateNewString(uint32_t editID, uint32_t *pNewValue1, uint32_t *pNewValue2, uint32_t *pNewValue3, uint32_t *pNewValue4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
885 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
886 if(editID != ident[id].callerID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
887 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
888
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
889 uint8_t i, digitCount, digit;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
890 uint32_t sum[4], multiplier;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
891
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
892 for(i=0;i<4;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
893 sum[i] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
894
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
895 i = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
896 while( ident[id].size[i] && (i < 4))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
897 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
898 multiplier = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
899 for(digitCount = 1; digitCount < ident[id].size[i]; digitCount++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
900 multiplier *= 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
901
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
902 for(digitCount = 0; digitCount < ident[id].size[i]; digitCount++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
903 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
904 digit = ident[id].newText[ident[id].begin[i] + digitCount];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
905
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
906 if(digit > '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
907 digit -= '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
908 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
909 digit = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
910
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
911 if(digit > 9)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
912 digit = 9;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
913
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
914 sum[i] += digit * multiplier;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
915
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
916 if(multiplier >= 10)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
917 multiplier /= 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
918 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
919 multiplier = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
920 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
921 i++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
922 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
923
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
924 *pNewValue1 = sum[0];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
925 *pNewValue2 = sum[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
926 *pNewValue3 = sum[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
927 *pNewValue4 = sum[3];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
928 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
929
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
930
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
931 uint8_t get_id_of(uint32_t editID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
932 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
933 uint8_t temp_id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
934
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
935 if(editID == ident[id].callerID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
936 return id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
937 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
938 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
939 temp_id = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
940 while((temp_id < 9) && (editID != ident[temp_id].callerID))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
941 temp_id++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
942 if(editID != ident[temp_id].callerID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
943 temp_id = 255;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
944 return temp_id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
945 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
946 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
947
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
948
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
949 void tMenuEdit_newButtonText(uint32_t editID, char *text)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
950 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
951 uint8_t backup_id, temp_id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
952
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
953 temp_id = get_id_of(editID);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
954 if(temp_id == 255)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
955 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
956
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
957 backup_id = id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
958 id = temp_id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
959
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
960 strncpy(ident[id].newText, text, 32);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
961 ident[id].newText[31] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
962
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
963 clean_content_of_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
964 write_content_of_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
965
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
966 id = backup_id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
967 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
968
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
969
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
970 void tMenuEdit_set_on_off(uint32_t editID, uint32_t int1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
971 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
972 uint8_t backup_id, temp_id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
973
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
974 temp_id = get_id_of(editID);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
975 if(temp_id == 255)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
976 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
977
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
978 backup_id = id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
979 id = temp_id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
980
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
981 ident[id].input[0] = int1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
982
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
983 if(int1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
984 ident[id].newText[0] = '\005';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
985 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
986 ident[id].newText[0] = '\006';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
987
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
988 clean_content_of_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
989 write_content_of_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
990
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
991 id = backup_id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
992 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
993
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
994
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
995 void tMenuEdit_select(uint32_t editID, uint32_t int1, uint32_t int2, uint32_t int3, uint32_t int4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
996 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
997 if(int1 > 4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
998 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
999
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1000 uint8_t backup_id, temp_id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1001
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1002 temp_id = get_id_of(editID);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1003 if(temp_id == 255)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1004 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1005
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1006 backup_id = id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1007 id = temp_id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1008
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1009 ident[id].input[0] = int1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1010 ident[id].input[1] = int1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1011 ident[id].input[2] = int1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1012 ident[id].input[3] = int1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1013
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1014 create_newText_for_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1015 clean_content_of_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1016 write_content_of_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1017
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1018 id = backup_id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1019 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1020
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1021
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1022 void tMenuEdit_newInput(uint32_t editID, uint32_t int1, uint32_t int2, uint32_t int3, uint32_t int4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1023 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1024 uint8_t backup_id, temp_id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1025
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1026 temp_id = get_id_of(editID);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1027 if(temp_id == 255)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1028 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1029
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1030 backup_id = id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1031 id = temp_id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1032
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1033 if(editID != ident[id].callerID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1034 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1035 temp_id = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1036 while((temp_id < 9) && (editID != ident[temp_id].callerID))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1037 temp_id++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1038 if(editID != ident[temp_id].callerID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1039 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1040 id = temp_id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1041 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1042 ident[id].input[0] = int1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1043 ident[id].input[1] = int2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1044 ident[id].input[2] = int3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1045 ident[id].input[3] = int4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1046
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1047 create_newText_for_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1048 if(id <= idLast)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1049 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditFieldRegular);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1050 write_content_of_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1051
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1052 id = backup_id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1053 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1054
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1055
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1056 void resetEnterPressedToStateBeforeButtonAction(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1057 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1058 EnterPressed = EnterPressedBeforeButtonAction;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1059 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1060
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1061
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1062 void sendActionToMenuEdit(uint8_t sendAction)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1063 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1064 if(get_globalState() == menuID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1065 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1066 switch(sendAction)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1067 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1068 case ACTION_BUTTON_ENTER:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1069 EnterPressedBeforeButtonAction = EnterPressed;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1070 EnterPressed = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1071 enterMenuEditField();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1072 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1073 case ACTION_BUTTON_NEXT:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1074 nextMenuEditField();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1075 // previousMenuEditField();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1076 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1077 case ACTION_BUTTON_BACK:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1078 exitMenuEditBackMenuOption();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1079 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1080 case ACTION_TIMEOUT:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1081 case ACTION_MODE_CHANGE:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1082 exitMenuEdit(1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1083 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1084 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1085 case ACTION_IDLE_TICK:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1086 case ACTION_IDLE_SECOND:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1087 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1088 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1089 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1090 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1091 if(get_globalState() == event[evid].callerID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1092 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1093 switch(sendAction)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1094 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1095 case ACTION_BUTTON_ENTER:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1096 nextMenuEditFieldDigit();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1097 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1098 case ACTION_BUTTON_NEXT:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1099 upMenuEditFieldDigit();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1100 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1101 case ACTION_BUTTON_BACK:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1102 downMenuEditFieldDigit();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1103 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1104 case ACTION_TIMEOUT:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1105 case ACTION_MODE_CHANGE:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1106 exitMenuEditField();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1107 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1108 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1109 case ACTION_IDLE_TICK:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1110 case ACTION_IDLE_SECOND:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1111 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1112 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1113 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1114 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1115 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1116 switch(sendAction)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1117 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1118 case ACTION_BUTTON_ENTER:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1119 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1120 case ACTION_BUTTON_NEXT:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1121 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1122 case ACTION_BUTTON_BACK:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1123 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1124 case ACTION_TIMEOUT:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1125 case ACTION_MODE_CHANGE:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1126 exitMenuEdit(1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1127 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1128 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1129 case ACTION_IDLE_TICK:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1130 case ACTION_IDLE_SECOND:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1131 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1132 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1133 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1134 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1135
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1136
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1137 void create_newText_for_actual_Id_and_field_select(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1138 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1139 uint8_t i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1140
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1141 i = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1142 while( ident[id].size[i] && (i < 4))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1143 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1144 if(ident[id].input[i])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1145 ident[id].newText[ident[id].begin[i]] = '\005';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1146 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1147 ident[id].newText[ident[id].begin[i]] = '\006';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1148 i++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1149 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1150 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1151
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1152
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1153 void create_newText_for_actual_Id(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1154 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1155 if( ident[id].maintype == FIELD_SELECT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1156 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1157 create_newText_for_actual_Id_and_field_select();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1158 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1159 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1160
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1161 uint8_t i, digitCount;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1162 uint32_t remainder, digit, divider;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1163
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1164 i = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1165 while( ident[id].size[i] && (i < 4))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1166 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1167 remainder = ident[id].input[i];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1168 divider = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1169
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1170 for(digitCount = 1; digitCount < ident[id].size[i]; digitCount++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1171 divider *= 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1172
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1173 for(digitCount = 0; digitCount < ident[id].size[i]; digitCount++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1174 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1175 digit = remainder / divider;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1176 remainder -= digit * divider;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1177 divider /= 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1178 if(digit < 10)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1179 ident[id].newText[ident[id].begin[i] + digitCount] = digit + '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1180 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1181 ident[id].newText[ident[id].begin[i] + digitCount] = 'x';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1182 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1183 i++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1184 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1185 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1186
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1187
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1188 void write_content_without_Id(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1189 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1190 write_content( ident[id].coord[0], ident[id].coord[1], ident[id].coord[2], ident[id].fontUsed, ident[id].newText, CLUT_MenuEditFieldRegular);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1191 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1192
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1193
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1194 void write_content_of_actual_Id(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1195 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1196 write_content( ident[id].coord[0], ident[id].coord[1], ident[id].coord[2], ident[id].fontUsed, ident[id].newText, (CLUT_MenuEditField0 + id));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1197 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1198
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1199
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1200 void clean_content_of_actual_Id(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1201 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1202 clean_content( ident[id].coord[0], ident[id].coord[1], ident[id].coord[2], ident[id].fontUsed);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1203 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1204
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1205
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1206 void write_field_udigit_and_2digit(uint8_t subtype, uint32_t editID, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text, uint32_t int1, uint32_t int2, uint32_t int3, uint32_t int4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1207 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1208 if(id >= 9)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1209 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1210
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1211 ident[id].maintype = FIELD_NUMBERS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1212 ident[id].subtype = subtype;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1213
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1214 ident[id].coord[0] = XleftGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1215 ident[id].coord[1] = XrightGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1216 ident[id].coord[2] = YtopGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1217 ident[id].fontUsed = (tFont *)Font;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1218 ident[id].callerID = editID;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1219
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1220 strncpy(ident[id].orgText, text, 32);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1221 strncpy(ident[id].newText, text, 32);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1222 ident[id].orgText[31] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1223 ident[id].newText[31] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1224
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1225 /* uint32_t has max 10 digits */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1226
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1227 int8_t beginTmp, sizeTmp;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1228 uint8_t i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1229
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1230 ident[id].input[0] = int1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1231 ident[id].input[1] = int2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1232 ident[id].input[2] = int3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1233 ident[id].input[3] = int4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1234
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1235 for(i=0;i<4;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1236 ident[id].size[i] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1237
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1238 beginTmp = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1239 for(i=0;i<4;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1240 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1241 while((ident[id].orgText[beginTmp] != '#')&& ident[id].orgText[beginTmp])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1242 beginTmp++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1243
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1244 if(ident[id].orgText[beginTmp] == '#')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1245 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1246 sizeTmp = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1247 while(ident[id].orgText[beginTmp + sizeTmp] == '#')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1248 sizeTmp++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1249
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1250 ident[id].begin[i] = beginTmp;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1251 ident[id].size[i] = sizeTmp;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1252 beginTmp = ident[id].begin[i] + ident[id].size[i];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1253 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1254 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1255 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1256 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1257
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1258 if(!tME_stop)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1259 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditFieldRegular);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1260 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1261 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditInfo);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1262
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1263 create_newText_for_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1264
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1265 if(editID == NULL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1266 write_content_without_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1267 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1268 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1269 write_content_of_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1270 if(!tME_stop)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1271 idLast = id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1272 id++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1273 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1274 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1275
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1276 void write_field_udigit(uint32_t editID, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text, uint32_t int1, uint32_t int2, uint32_t int3, uint32_t int4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1277 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1278 write_field_udigit_and_2digit(FIELD_UDIGIT, editID,XleftGimpStyle,XrightGimpStyle,YtopGimpStyle,Font,text,int1,int2,int3,int4);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1279 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1280
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1281 void write_field_2digit(uint32_t editID, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text, uint32_t int1, uint32_t int2, uint32_t int3, uint32_t int4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1282 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1283 write_field_udigit_and_2digit(FIELD_2DIGIT, editID,XleftGimpStyle,XrightGimpStyle,YtopGimpStyle,Font,text,int1,int2,int3,int4);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1284 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1285
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1286 void write_field_3digit(uint32_t editID, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text, uint32_t int1, uint32_t int2, uint32_t int3, uint32_t int4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1287 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1288 write_field_udigit_and_2digit(FIELD_3DIGIT, editID,XleftGimpStyle,XrightGimpStyle,YtopGimpStyle,Font,text,int1,int2,int3,int4);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1289 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1290
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1291 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1292 void write_field_sdigit(uint32_t editID, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text, int32_t int1, int32_t int2, int32_t int3, int32_t int4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1293 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1294 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1295 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1296
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1297 void write_field_select(uint32_t editID, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text, uint8_t int1, uint8_t int2, uint8_t int3, uint8_t int4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1298 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1299 if(id >= 9)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1300 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1301
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1302 int8_t beginTmp;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1303
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1304 ident[id].maintype = FIELD_SELECT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1305 ident[id].subtype = FIELD_SELECT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1306
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1307 ident[id].coord[0] = XleftGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1308 ident[id].coord[1] = XrightGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1309 ident[id].coord[2] = YtopGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1310 ident[id].fontUsed = (tFont *)Font;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1311 ident[id].callerID = editID;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1312
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1313 strncpy(ident[id].orgText, text, 32);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1314 strncpy(ident[id].newText, text, 32);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1315 ident[id].orgText[31] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1316 ident[id].newText[31] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1317
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1318 ident[id].input[0] = int1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1319 ident[id].input[1] = int2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1320 ident[id].input[2] = int3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1321 ident[id].input[3] = int4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1322
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1323 for(int i=0;i<4;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1324 ident[id].size[i] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1325
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1326 beginTmp = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1327 for(int i=0;i<4;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1328 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1329 while((ident[id].orgText[beginTmp] != '#')&& ident[id].orgText[beginTmp])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1330 beginTmp++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1331
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1332 if(ident[id].orgText[beginTmp] == '#')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1333 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1334
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1335 ident[id].begin[i] = beginTmp;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1336 ident[id].size[i] = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1337 beginTmp = ident[id].begin[i] + ident[id].size[i];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1338 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1339 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1340 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1341 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1342
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1343 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditFieldRegular);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1344
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1345 create_newText_for_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1346
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1347 if(editID == NULL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1348 write_content_without_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1349 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1350 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1351 write_content_of_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1352 if(!tME_stop)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1353 idLast = id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1354 id++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1355 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1356 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1357
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1358 void write_field_button(uint32_t editID, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1359 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1360 if(id >= 9)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1361 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1362
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1363 ident[id].maintype = FIELD_BUTTON;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1364 ident[id].subtype = FIELD_BUTTON;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1365
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1366 ident[id].coord[0] = XleftGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1367 ident[id].coord[1] = XrightGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1368 ident[id].coord[2] = YtopGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1369 ident[id].fontUsed = (tFont *)Font;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1370 ident[id].callerID = editID;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1371
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1372 strncpy(ident[id].orgText, text, 32);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1373 strncpy(ident[id].newText, text, 32);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1374 ident[id].orgText[31] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1375 ident[id].newText[31] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1376
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1377 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditButtonColor1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1378
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1379 if(editID == NULL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1380 write_content_without_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1381 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1382 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1383 write_content_of_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1384 if(!tME_stop)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1385 idLast = id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1386 id++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1387 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1388 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1389
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1390
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1391 void write_field_symbol(uint32_t editID, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text, uint8_t int1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1392 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1393 if(id >= 9)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1394 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1395
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1396 ident[id].maintype = FIELD_SYMBOL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1397 ident[id].subtype = FIELD_SYMBOL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1398
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1399 ident[id].coord[0] = XleftGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1400 ident[id].coord[1] = XrightGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1401 ident[id].coord[2] = YtopGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1402 ident[id].fontUsed = (tFont *)Font;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1403 ident[id].callerID = editID;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1404
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1405 strncpy(ident[id].orgText, text, 32);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1406 strncpy(ident[id].newText, text, 32);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1407 ident[id].orgText[31] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1408
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1409 ident[id].newText[0] = text[0];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1410 ident[id].newText[1] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1411
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1412 ident[id].input[0] = int1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1413 ident[id].input[1] = strlen(ident[id].orgText);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1414
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1415 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditButtonColor1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1416
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1417 if(editID == NULL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1418 write_content_without_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1419 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1420 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1421 write_content_of_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1422 if(!tME_stop)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1423 idLast = id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1424 id++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1425 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1426 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1427
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1428
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1429 /* was build for field_on_off
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1430 * to be tested for other purposes first
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1431 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1432 void tMenuEdit_refresh_field(uint32_t editID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1433 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1434 uint8_t temp_id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1435
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1436 temp_id = get_id_of(editID);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1437 if(temp_id == 255)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1438 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1439
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1440 clean_content( ident[temp_id].coord[0], ident[temp_id].coord[1], ident[temp_id].coord[2], ident[temp_id].fontUsed);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1441 write_content( ident[temp_id].coord[0], ident[temp_id].coord[1], ident[temp_id].coord[2], ident[temp_id].fontUsed, ident[temp_id].newText, (CLUT_MenuEditField0 + temp_id));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1442 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1443
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1444
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1445 void write_field_on_off(uint32_t editID, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text, uint8_t int1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1446 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1447 if(id >= 9)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1448 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1449
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1450 ident[id].maintype = FIELD_ON_OFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1451 ident[id].subtype = FIELD_ON_OFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1452
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1453 ident[id].coord[0] = XleftGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1454 ident[id].coord[1] = XrightGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1455 ident[id].coord[2] = YtopGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1456 ident[id].fontUsed = (tFont *)Font;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1457 ident[id].callerID = editID;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1458
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1459 if(int1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1460 ident[id].orgText[0] = '\005';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1461 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1462 ident[id].orgText[0] = '\006';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1463
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1464 ident[id].orgText[1] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1465
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1466 strncpy(&ident[id].orgText[2], text, 30);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1467 strncpy(ident[id].newText, ident[id].orgText, 32);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1468 ident[id].orgText[31] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1469 ident[id].newText[31] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1470
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1471 if(!tME_stop)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1472 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditFieldRegular);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1473 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1474 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditInfo);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1475
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1476 if(editID == NULL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1477 write_content_without_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1478 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1479 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1480 write_content_of_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1481 if(!tME_stop)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1482 idLast = id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1483 id++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1484 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1485 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1486
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1487
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1488 void write_field_fpoint(uint32_t editID, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text, float input)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1489 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1490 if(id >= 9)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1491 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1492
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1493 ident[id].maintype = FIELD_NUMBERS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1494 ident[id].subtype = FIELD_FLOAT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1495
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1496 ident[id].coord[0] = XleftGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1497 ident[id].coord[1] = XrightGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1498 ident[id].coord[2] = YtopGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1499 ident[id].fontUsed = (tFont *)Font;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1500 ident[id].callerID = editID;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1501
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1502 strncpy(ident[id].orgText, text, 32);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1503 strncpy(ident[id].newText, text, 32);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1504 ident[id].orgText[31] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1505 ident[id].newText[31] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1506
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1507 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditFieldRegular);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1508
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1509 if(editID == NULL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1510 write_content_without_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1511 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1512 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1513 write_content_of_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1514 if(!tME_stop)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1515 idLast = id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1516 id++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1517 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1518 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1519
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1520
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1521 void setBackMenu(uint32_t inputFunctionCall, uint8_t functionCallParameter, uint8_t gotoMenuEditField)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1522 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1523 backmenu.pEventFunction = inputFunctionCall;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1524 backmenu.functionParameter = functionCallParameter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1525 backmenu.line = gotoMenuEditField;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1526 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1527
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1528
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1529 void setEvent(uint32_t inputEventID, uint32_t inputFunctionCall)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1530 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1531 if(evidLast >= 9)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1532 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1533
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1534 /* set cursor to first field */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1535 if(evidLast < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1536 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1537 startMenuEditFieldSelect();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1538 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1539
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1540 event[evid].callerID = inputEventID;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1541 event[evid].pEventFunction = inputFunctionCall;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1542
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1543 evidLast = evid;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1544 evid++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1545 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1546
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1547 void startEdit(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1548 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1549 EnterPressed = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1550 helperGotoMenuEditField(0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1551 enterMenuEditField();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1552 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1553
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1554 void exitEditWithUpdate(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1555 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1556 createDiveSettings();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1557 EnterPressed = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1558 exitMenuEdit(1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1559 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1560
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1561 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1562 void set_cursor(uint8_t forThisIdentID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1563 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1564 int16_t x0, x1, y0, y1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1565
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1566 uint32_t xtra_left_right = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1567 uint32_t xtra_top_bottom = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1568
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1569 // y geht von 0 bis 799
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1570 // x geht von 0 bis 479
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1571
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1572 x0 = (int16_t)ident[forThisIdentID].coord[0];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1573 x1 = (int16_t)ident[forThisIdentID].coord[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1574 y0 = (int16_t)ident[forThisIdentID].coord[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1575 y1 = y0 + (int16_t)ident[forThisIdentID].fontUsed->height;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1576
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1577 if(((int16_t)ident[forThisIdentID].fontUsed->height) > 70)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1578 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1579 xtra_left_right = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1580 xtra_top_bottom = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1581 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1582 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1583 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1584 xtra_left_right = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1585 xtra_top_bottom = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1586 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1587
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1588 x0 -= xtra_left_right;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1589 x1 += xtra_left_right;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1590 y0 -= xtra_top_bottom;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1591 y1 += xtra_top_bottom;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1592
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1593 GFX_SetWindowLayer0(tMEcursor.FBStartAdress, x0, x1, y0, y1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1594 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1595 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1596
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1597 void set_cursorNew(uint8_t forThisIdentID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1598 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1599 int16_t y0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1600 uint8_t lineMinusOne;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1601
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1602 if(!settingsGetPointer()->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1603 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1604 y0 = (int16_t)ident[forThisIdentID].coord[2];
117
e6b190f5fbc7 Submenus may have 6 items
Ideenmodellierer
parents: 110
diff changeset
1605 y0 -= ME_Y_LINE1;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1606 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1607 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1608 {
117
e6b190f5fbc7 Submenus may have 6 items
Ideenmodellierer
parents: 110
diff changeset
1609 y0 = 390 + 25 - (int16_t)ident[forThisIdentID].coord[2];
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1610 }
117
e6b190f5fbc7 Submenus may have 6 items
Ideenmodellierer
parents: 110
diff changeset
1611
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1612 y0 /= ME_Y_LINE_STEP;
117
e6b190f5fbc7 Submenus may have 6 items
Ideenmodellierer
parents: 110
diff changeset
1613 if((y0 >= 0) && (y0 <=6))
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1614 lineMinusOne = y0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1615 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1616 lineMinusOne = 0;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1617
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1618 if(!settingsGetPointer()->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1619 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1620 GFX_SetFrameBottom((tMEcursorNew.FBStartAdress) + 65*2*(lineMinusOne), 0, 25, 800, 390);
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1621 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1622 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1623 {
117
e6b190f5fbc7 Submenus may have 6 items
Ideenmodellierer
parents: 110
diff changeset
1624 GFX_SetFrameBottom((tMEcursorNew.FBStartAdress)+ (390 - 65 *(6-lineMinusOne)) *2, 0, 480-390-25, 800, 390);
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1625 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1626 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1627
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1628
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1629 void write_topline( char *text)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1630 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1631 GFX_DrawCfgWindow hgfx;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1632 const tFont *Font = &FontT48;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1633
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1634 hgfx.Image = &tMEscreen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1635 hgfx.WindowNumberOfTextLines = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1636 hgfx.WindowLineSpacing = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1637 hgfx.WindowTab = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1638 hgfx.WindowX0 = 20;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1639 hgfx.WindowX1 = 779;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1640 if(!settingsGetPointer()->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1641 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1642 hgfx.WindowY1 = 479;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1643 hgfx.WindowY0 = hgfx.WindowY1 - Font->height;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1644 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1645 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1646 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1647 hgfx.WindowY0 = 0;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1648 hgfx.WindowY1 = hgfx.WindowY0 + Font->height;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1649 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1650 GFX_write_label(Font, &hgfx, text, menuColor);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1651 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1652
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1653
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1654 void write_buttonTextline( uint8_t left2ByteCode, char middle2ByteCode, char right2ByteCode)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1655 {
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1656
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1657 SSettings* pSettings;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1658 pSettings = settingsGetPointer();
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1659
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1660 if(!pSettings->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1661 {
117
e6b190f5fbc7 Submenus may have 6 items
Ideenmodellierer
parents: 110
diff changeset
1662 GFX_clean_area(&tMEscreen, 0, 800, 479-24,480);
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1663 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1664 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1665 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1666 GFX_clean_area(&tMEscreen, 0, 800, 0, 24);
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1667 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1668
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1669 char localtext[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1670
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1671 if(left2ByteCode)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1672 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1673 localtext[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1674 localtext[1] = left2ByteCode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1675 localtext[2] = 0;
117
e6b190f5fbc7 Submenus may have 6 items
Ideenmodellierer
parents: 110
diff changeset
1676
e6b190f5fbc7 Submenus may have 6 items
Ideenmodellierer
parents: 110
diff changeset
1677 write_content_simple(&tMEscreen, 0, 800, 479-24, &FontT24,localtext,CLUT_ButtonSurfaceScreen);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1678 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1679
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1680 if(middle2ByteCode)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1681 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1682 localtext[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1683 localtext[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1684 localtext[2] = middle2ByteCode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1685 localtext[3] = 0;
117
e6b190f5fbc7 Submenus may have 6 items
Ideenmodellierer
parents: 110
diff changeset
1686
e6b190f5fbc7 Submenus may have 6 items
Ideenmodellierer
parents: 110
diff changeset
1687 write_content_simple(&tMEscreen, 0, 800, 479-24, &FontT24,localtext,CLUT_ButtonSurfaceScreen);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1688 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1689
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1690 if(right2ByteCode)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1691 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1692 localtext[0] = '\002';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1693 localtext[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1694 localtext[2] = right2ByteCode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1695 localtext[3] = 0;
117
e6b190f5fbc7 Submenus may have 6 items
Ideenmodellierer
parents: 110
diff changeset
1696
e6b190f5fbc7 Submenus may have 6 items
Ideenmodellierer
parents: 110
diff changeset
1697 write_content_simple(&tMEscreen, 0, 800, 479-24, &FontT24,localtext,CLUT_ButtonSurfaceScreen);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1698 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1699 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1700
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1701
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1702
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1703 void write_label_var(uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1704 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1705 GFX_DrawCfgWindow hgfx;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1706
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1707 if(XrightGimpStyle > 799)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1708 XrightGimpStyle = 799;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1709 if(XleftGimpStyle >= XrightGimpStyle)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1710 XleftGimpStyle = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1711 if(YtopGimpStyle > 479)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1712 YtopGimpStyle = 479;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1713 hgfx.Image = &tMEscreen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1714 hgfx.WindowNumberOfTextLines = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1715 hgfx.WindowLineSpacing = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1716 hgfx.WindowTab = 0;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1717 if(!settingsGetPointer()->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1718 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1719 hgfx.WindowX0 = XleftGimpStyle;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1720 hgfx.WindowX1 = XrightGimpStyle;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1721 hgfx.WindowY1 = 479 - YtopGimpStyle;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1722 if(hgfx.WindowY1 < Font->height)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1723 hgfx.WindowY0 = 0;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1724 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1725 hgfx.WindowY0 = hgfx.WindowY1 - Font->height;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1726 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1727 else
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1728 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1729 hgfx.WindowX0 = 800 - XrightGimpStyle;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1730 hgfx.WindowX1 = 800 - XleftGimpStyle;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1731 hgfx.WindowY0 = YtopGimpStyle;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1732 if(hgfx.WindowY0 < Font->height)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1733 hgfx.WindowY1 = 0;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1734 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1735 hgfx.WindowY1 = hgfx.WindowY0 + Font->height;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1736 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1737 GFX_write_label(Font, &hgfx, text, 0);/*menuColor);*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1738 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1739
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1740
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1741 void write_content(uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text, uint8_t color)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1742 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1743 GFX_DrawCfgWindow hgfx;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1744
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1745 if(XrightGimpStyle > 799)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1746 XrightGimpStyle = 799;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1747 if(XleftGimpStyle >= XrightGimpStyle)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1748 XleftGimpStyle = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1749 if(YtopGimpStyle > 479)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1750 YtopGimpStyle = 479;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1751 hgfx.Image = &tMEscreen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1752 hgfx.WindowNumberOfTextLines = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1753 hgfx.WindowLineSpacing = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1754 hgfx.WindowTab = 0;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1755
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1756 if(!settingsGetPointer()->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1757 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1758 hgfx.WindowX0 = XleftGimpStyle;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1759 hgfx.WindowX1 = XrightGimpStyle;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1760 hgfx.WindowY1 = 479 - YtopGimpStyle;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1761 if(hgfx.WindowY1 < Font->height)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1762 hgfx.WindowY0 = 0;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1763 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1764 hgfx.WindowY0 = hgfx.WindowY1 - Font->height;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1765 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1766 else
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1767 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1768 hgfx.WindowX0 = 800 - XrightGimpStyle;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1769 hgfx.WindowX1 = 800 - XleftGimpStyle;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1770 hgfx.WindowY0 = YtopGimpStyle;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1771 if(hgfx.WindowY0 < Font->height)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1772 hgfx.WindowY1 = 0;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1773 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1774 hgfx.WindowY1 = hgfx.WindowY0 + Font->height;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1775 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1776 GFX_write_label(Font, &hgfx, text, color);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1777 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1778
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1779
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1780 void write_label_fix(uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char textId)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1781 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1782 char text[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1783
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1784 text[0] = textId;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1785 text[1] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1786
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1787 write_label_var(XleftGimpStyle, XrightGimpStyle, YtopGimpStyle, Font, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1788 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1789
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1790
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1791 void clean_content(uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1792 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1793 GFX_DrawCfgWindow hgfx;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1794
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1795 if(XrightGimpStyle > 799)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1796 XrightGimpStyle = 799;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1797 if(XleftGimpStyle >= XrightGimpStyle)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1798 XleftGimpStyle = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1799 if(YtopGimpStyle > 479)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1800 YtopGimpStyle = 479;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1801 hgfx.Image = &tMEscreen;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1802 if(!settingsGetPointer()->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1803 {
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1804 hgfx.WindowX0 = XleftGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1805 hgfx.WindowX1 = XrightGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1806 hgfx.WindowY1 = 479 - YtopGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1807 if(hgfx.WindowY1 < Font->height)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1808 hgfx.WindowY0 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1809 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1810 hgfx.WindowY0 = hgfx.WindowY1 - Font->height;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1811 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1812 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1813 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1814 hgfx.WindowX0 = 800 - XrightGimpStyle;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1815 hgfx.WindowX1 = 800 - XleftGimpStyle;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1816 hgfx.WindowY0 = YtopGimpStyle;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1817 if(hgfx.WindowY0 < Font->height)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1818 hgfx.WindowY1 = 0;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1819 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1820 hgfx.WindowY1 = hgfx.WindowY0 + Font->height;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
1821 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1822 GFX_clear_window_immediately(&hgfx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1823 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1824
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1825
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1826 /* Private functions ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1827
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1828 void draw_tMEdesign(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1829 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1830 GFX_draw_header(&tMEscreen,menuColor);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1831 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1832
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1833 void draw_tMEdesignSubUnselected(uint32_t *ppDestination)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1834 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1835 union al88_u
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1836 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1837 uint8_t al8[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1838 uint16_t al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1839 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1840
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1841 union al88_u color_seperator;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1842 union al88_u color_unselected;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1843 int i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1844
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1845 color_seperator.al8[0] = CLUT_MenuLineUnselectedSeperator;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1846 color_unselected.al8[0] = CLUT_MenuLineUnselected;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1847
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1848 color_seperator.al8[1] = 0xFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1849 color_unselected.al8[1] = 0xFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1850
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1851 *(__IO uint16_t*)*ppDestination = color_seperator.al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1852 *ppDestination += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1853 *(__IO uint16_t*)*ppDestination = color_seperator.al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1854 *ppDestination += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1855
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1856 for(i = 61; i > 0; i--)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1857 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1858 *(__IO uint16_t*)*ppDestination = color_unselected.al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1859 *ppDestination += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1860 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1861
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1862 *(__IO uint16_t*)*ppDestination = color_seperator.al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1863 *ppDestination += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1864 *(__IO uint16_t*)*ppDestination = color_seperator.al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1865 *ppDestination += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1866 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1867
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1868
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1869 void draw_tMEdesignSubSelected(uint32_t *ppDestination)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1870 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1871 union al88_u
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1872 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1873 uint8_t al8[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1874 uint16_t al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1875 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1876
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1877 union al88_u color_selected;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1878 union al88_u color_seperator;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1879 int i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1880
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1881 color_selected.al8[0] = CLUT_MenuEditLineSelected;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1882 color_selected.al8[1] = 0xFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1883
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1884 color_seperator.al8[0] = CLUT_MenuLineSelectedSeperator;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1885 color_seperator.al8[1] = 0xFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1886
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1887 *(__IO uint16_t*)*ppDestination = color_seperator.al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1888 *ppDestination += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1889 *(__IO uint16_t*)*ppDestination = color_seperator.al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1890 *ppDestination += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1891
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1892 for(i = 61; i > 0; i--)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1893 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1894 *(__IO uint16_t*)*ppDestination = color_selected.al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1895 *ppDestination += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1896 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1897
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1898 *(__IO uint16_t*)*ppDestination = color_seperator.al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1899 *ppDestination += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1900 *(__IO uint16_t*)*ppDestination = color_seperator.al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1901 *ppDestination += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1902 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1903
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1904
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1905 void draw_tMEdesignSubSelectedBorder(uint32_t *ppDestination)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1906 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1907 union al88_u
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1908 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1909 uint8_t al8[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1910 uint16_t al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1911 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1912
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1913 union al88_u color_selected_sides;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1914
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1915 int i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1916
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1917 color_selected_sides.al8[0] = CLUT_MenuLineSelectedSides;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1918 color_selected_sides.al8[1] = 0xFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1919
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1920 for(i = 65; i > 0; i--)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1921 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1922 *(__IO uint16_t*)*ppDestination = color_selected_sides.al88;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1923 *ppDestination += 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1924 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1925 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1926
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1927
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1928 void draw_tMEcursorNewDesign(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1929 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1930 int i,j;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1931 uint32_t pDestination;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1932
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1933 pDestination = tMEcursorNew.FBStartAdress;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1934
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1935 for(j = 801; j > 0; j--)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1936 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1937 for(i = 5; i > 0; i--)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1938 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1939 draw_tMEdesignSubUnselected(&pDestination);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1940 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1941 if((j > 787) || (j < 17))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1942 draw_tMEdesignSubSelectedBorder(&pDestination);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1943 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1944 draw_tMEdesignSubSelected(&pDestination);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1945 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1946 }