annotate Discovery/Src/tInfo.c @ 1031:cd4561c33758 Puls_Integration

New Logger View: The logger view allows developers to display development messages on the screen. This is done by rerouting the refresh function to the logger view. The view is opened when a new string is received and is closing after a certain time while no new message was entered. For better communication protocol visualization it is possible to mark a scring as received or transmitted. The strind will then be displayed left / right aligned
author Ideenmodellierer
date Mon, 28 Jul 2025 18:32:23 +0200
parents 65d35e66efb9
children 5b913cdaa9dc
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/tInfo.c
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 /// \brief Main Template file for Info menu page on left side
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 11-Aug-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 "tInfo.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32 #include "data_exchange.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 #include "tDebug.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 #include "gfx_fonts.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
35 #include "tHome.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36 //#include "tInfoDive.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37 //#include "tInfoSurface.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 #include "tInfoCompass.h"
718
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
39 #include "tInfoSensor.h"
845
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
40 #include "tInfoPreDive.h"
1031
cd4561c33758 New Logger View:
Ideenmodellierer
parents: 1007
diff changeset
41 #include "tInfoLogger.h"
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42 #include "tMenu.h"
718
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
43 #include "tMenuEdit.h"
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45 #include <string.h>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47 /* Private types -------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51 uint32_t pEventFunction;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52 uint32_t callerID;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53 } SInfoEventHandler;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57 char orgText[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58 char newText[32];
699
01f40cb1057e Cleanup warnings:
Ideenmodellierer
parents: 243
diff changeset
59 uint8_t input;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 char symbolCounter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61 int8_t begin[4], size[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 tFont *fontUsed;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 uint32_t callerID;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 uint8_t maintype;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 uint8_t subtype;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 } SInfoIdent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69 typedef enum
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 FIELD_BUTTON = 1,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72 FIELD_SELECT,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
73 FIELD_SYMBOL,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74 FIELD_TOGGLE,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75 FIELD_ON_OFF,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76 FIELD_END
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77 } SInfoField;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79 /* Private variables ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80 GFX_DrawCfgScreen tIscreen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81 GFX_DrawCfgScreen tIcursor;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83 uint8_t infoColor = CLUT_InfoSurface;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85 int8_t TIid = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86 int8_t TIidLast = -1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87 SInfoIdent TIident[10];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89 int8_t TIevid = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
90 int8_t TIevidLast = -1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
91 SInfoEventHandler TIevent[10];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93 /* Private function prototypes -----------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94 void tInfo_build_page(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96 void tI_set_cursor(uint8_t forThisIdentID);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97 void tI_startInfoFieldSelect(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98 void tInfo_write_content_of_actual_Id(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99 void tI_clean_content_of_actual_Id(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100 void tInfo_write_content_without_Id(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 void tI_clean_content(uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103 void tInfo_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
104
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105 void tI_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
106
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107 //void tI_tInfo_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
108 //void tI_tInfo_newButtonText (uint32_t editID, char *text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110 void tI_enterInfoField(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111 void tI_nextInfoField(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 /* Announced function prototypes -----------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114 //uint8_t OnAction_ILoglist (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 //uint8_t OnAction_ISimulator (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 void tI_init(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 tIscreen.FBStartAdress = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122 tIscreen.ImageHeight = 480;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123 tIscreen.ImageWidth = 800;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 tIscreen.LayerIndex = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126 tIcursor.FBStartAdress = getFrame(12);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127 tIcursor.ImageHeight = 480;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 tIcursor.ImageWidth = 800;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129 tIcursor.LayerIndex = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131 GFX_fill_buffer(tIcursor.FBStartAdress, 0xFF, CLUT_InfoCursor);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135 void openInfo(uint32_t modeToStart)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 if((modeToStart != StILOGLIST) && (modeToStart != StIDEBUG))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 TIid = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141 TIidLast = -1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142 TIevid = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 TIevidLast = -1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145 if(tIscreen.FBStartAdress)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 releaseFrame(14,tIscreen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147 tIscreen.FBStartAdress = getFrame(14);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149 // GFX_SetFramesTopBottom(tIscreen.FBStartAdress, tIcursor.FBStartAdress,480);
166
255eedad4155 cleanup: get rid of some compile warnings
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
150 GFX_SetFramesTopBottom(tIscreen.FBStartAdress, 0,480);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151 infoColor = CLUT_InfoSurface;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 if(modeToStart == StIDEBUG)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155 tDebug_start();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 openLog(0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161 // openInfoLogLastDive();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165 void openInfo(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 if((stateUsed->mode == MODE_DIVE) && (!is_stateUsedSetToSim()))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
171
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
172 TIid = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
173 TIidLast = -1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174 TIevid = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175 TIevidLast = -1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177 if(tIscreen.FBStartAdress)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178 releaseFrame(14,tIscreen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179 tIscreen.FBStartAdress = getFrame(14);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181 GFX_SetFramesTopBottom(tIscreen.FBStartAdress, tIcursor.FBStartAdress,480);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183 if(stateUsed->mode == MODE_DIVE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185 infoColor = CLUT_InfoSurface;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186 openInfo_Dive();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
187 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
188 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
189 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
190 infoColor = CLUT_InfoDive;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
191 openInfo_Surface();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197 uint8_t OnAction_ILoglist (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 return 255;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200 }
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 void tInfo_refresh(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205 uint32_t oldIscreen;
718
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
206 uint32_t globalState = get_globalState();
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 oldIscreen = tIscreen.FBStartAdress;
718
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
208
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209 if(inDebugMode())
718
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
210 {
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
211 tIscreen.FBStartAdress = getFrame(14);
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
212 infoColor = CLUT_InfoCompass;
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
213 tDebug_refresh();
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
214 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215 else
718
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
216 {
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
217 switch(globalState)
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
218 {
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
219 case StICOMPASS: tIscreen.FBStartAdress = getFrame(14);
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
220 infoColor = CLUT_InfoCompass;
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
221 refreshInfo_Compass(tIscreen);
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
222 break;
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
223 case StISENINFO: tIscreen.FBStartAdress = getFrame(14);
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
224 infoColor = CLUT_MenuPageHardware;
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
225 refreshInfo_Sensor(tIscreen);
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
226 break;
845
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
227 case StIPREDIVE: tIscreen.FBStartAdress = getFrame(14);
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
228 infoColor = CLUT_MenuPageGasCC;
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
229 refreshInfo_PreDive(tIscreen);
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
230 break;
1031
cd4561c33758 New Logger View:
Ideenmodellierer
parents: 1007
diff changeset
231 case StILOGGER: tIscreen.FBStartAdress = getFrame(14);
cd4561c33758 New Logger View:
Ideenmodellierer
parents: 1007
diff changeset
232 infoColor = CLUT_MenuPageCvOption;
cd4561c33758 New Logger View:
Ideenmodellierer
parents: 1007
diff changeset
233 refreshInfo_Logger(tIscreen);
cd4561c33758 New Logger View:
Ideenmodellierer
parents: 1007
diff changeset
234 break;
845
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
235
718
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
236 default:
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
237 break;
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
238 }
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
239 }
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
240 if(oldIscreen != tIscreen.FBStartAdress)
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
241 {
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
242 GFX_SetFramesTopBottom(tIscreen.FBStartAdress, 0,480);
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
243 if(oldIscreen)
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
244 {
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
245 releaseFrame(14,oldIscreen);
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
246 }
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
247 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251 void exitInfo(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253 set_globalState_tHome();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254 releaseFrame(14,tIscreen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255 exitDebugMode();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
257
718
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
258 void exitInfoToBack(void)
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
259 {
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
260 releaseFrame(14,tIscreen.FBStartAdress);
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
261 exitMenuEdit_to_BackMenu();
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
262 }
b9f699d2e3d0 Updated menu structure to support new sensor information page:
Ideenmodellierer
parents: 699
diff changeset
263
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265 void sendActionToInfo(uint8_t sendAction)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
267 if(inDebugMode())
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269 tDebugControl(sendAction);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
273 if(get_globalState() == StICOMPASS)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
274 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276 switch(sendAction)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278 case ACTION_BUTTON_ENTER:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279 tI_enterInfoField();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
281 case ACTION_BUTTON_NEXT:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282 tI_nextInfoField();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284 case ACTION_TIMEOUT:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285 case ACTION_MODE_CHANGE:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286 case ACTION_BUTTON_BACK:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 exitInfo();
130
b7689d9e888a Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents: 38
diff changeset
288 break;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
290 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
291 case ACTION_IDLE_TICK:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292 case ACTION_IDLE_SECOND:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
293 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295
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 /* Private functions ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300 void tInfo_build_page(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302 tInfo_write_content_simple( 30, 340, 90, &FontT48, "Logbook", CLUT_Font020);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305
1007
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
306
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
307 void tInfo_drawPixel(int16_t x, int16_t y, uint8_t color)
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
308 {
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
309 int8_t xoff;
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
310 int8_t yoff;
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
311
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
312 for (xoff = -1; xoff < 2; xoff++)
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
313 {
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
314 for (yoff = -1; yoff < 2; yoff++)
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
315 {
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
316 GFX_draw_pixel(&tIscreen, x + xoff, y + yoff, color);
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
317 }
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
318 }
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
319 GFX_draw_pixel(&tIscreen, x, y, color);
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
320 }
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
321
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
322 void tInfo_draw_colorline(point_t start, point_t stop, uint8_t color)
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
323 {
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
324 GFX_draw_colorline(&tIscreen, start, stop, color);
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
325 }
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
326
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
327 void t_Info_draw_circle(point_t center, uint8_t radius, int8_t color)
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
328 {
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
329 GFX_draw_circle(&tIscreen, center, radius, color);
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
330 }
65d35e66efb9 Improve compass calibration dialog:
Ideenmodellierer
parents: 848
diff changeset
331
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
332 void tInfo_write_content_simple(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
333 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
334 GFX_DrawCfgWindow hgfx;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
335
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
336 if(XrightGimpStyle > 799)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
337 XrightGimpStyle = 799;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
338 if(XleftGimpStyle >= XrightGimpStyle)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
339 XleftGimpStyle = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
340 if(YtopGimpStyle > 479)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
341 YtopGimpStyle = 479;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
342 hgfx.Image = &tIscreen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
343 hgfx.WindowNumberOfTextLines = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
344 hgfx.WindowLineSpacing = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
345 hgfx.WindowTab = 400;
826
a370741a743b Bugfix Line order of info screen with flip screen active:
Ideenmodellierer
parents: 718
diff changeset
346
a370741a743b Bugfix Line order of info screen with flip screen active:
Ideenmodellierer
parents: 718
diff changeset
347 if(!settingsGetPointer()->FlipDisplay)
a370741a743b Bugfix Line order of info screen with flip screen active:
Ideenmodellierer
parents: 718
diff changeset
348 {
848
92a5dc16d52b Bugfix tInfo_write_content_simple flip:
Ideenmodellierer
parents: 845
diff changeset
349 hgfx.WindowX0 = XleftGimpStyle;
92a5dc16d52b Bugfix tInfo_write_content_simple flip:
Ideenmodellierer
parents: 845
diff changeset
350 hgfx.WindowX1 = XrightGimpStyle;
92a5dc16d52b Bugfix tInfo_write_content_simple flip:
Ideenmodellierer
parents: 845
diff changeset
351
826
a370741a743b Bugfix Line order of info screen with flip screen active:
Ideenmodellierer
parents: 718
diff changeset
352 hgfx.WindowY1 = 479 - YtopGimpStyle;
a370741a743b Bugfix Line order of info screen with flip screen active:
Ideenmodellierer
parents: 718
diff changeset
353 if(hgfx.WindowY1 < Font->height)
a370741a743b Bugfix Line order of info screen with flip screen active:
Ideenmodellierer
parents: 718
diff changeset
354 hgfx.WindowY0 = 0;
a370741a743b Bugfix Line order of info screen with flip screen active:
Ideenmodellierer
parents: 718
diff changeset
355 else
a370741a743b Bugfix Line order of info screen with flip screen active:
Ideenmodellierer
parents: 718
diff changeset
356 hgfx.WindowY0 = hgfx.WindowY1 - Font->height;
a370741a743b Bugfix Line order of info screen with flip screen active:
Ideenmodellierer
parents: 718
diff changeset
357 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
358 else
826
a370741a743b Bugfix Line order of info screen with flip screen active:
Ideenmodellierer
parents: 718
diff changeset
359 {
848
92a5dc16d52b Bugfix tInfo_write_content_simple flip:
Ideenmodellierer
parents: 845
diff changeset
360 hgfx.WindowX0 = 800 - XrightGimpStyle;
92a5dc16d52b Bugfix tInfo_write_content_simple flip:
Ideenmodellierer
parents: 845
diff changeset
361 hgfx.WindowX1 = 800 - XleftGimpStyle;
826
a370741a743b Bugfix Line order of info screen with flip screen active:
Ideenmodellierer
parents: 718
diff changeset
362 hgfx.WindowY0 = YtopGimpStyle;
a370741a743b Bugfix Line order of info screen with flip screen active:
Ideenmodellierer
parents: 718
diff changeset
363 hgfx.WindowY1 = YtopGimpStyle + Font->height;
a370741a743b Bugfix Line order of info screen with flip screen active:
Ideenmodellierer
parents: 718
diff changeset
364 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
365
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
366 GFX_write_string_color(Font, &hgfx, text, 0, color);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
367 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
368
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
369 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
370
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
371 void tI_startInfoFieldSelect(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
372 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
373 TIid = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
374 tI_set_cursor(TIid);
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
378 void tI_nextInfoField(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
379 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
380 if(TIid < TIidLast)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
381 TIid++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
382 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
383 TIid = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
384 tI_set_cursor(TIid);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
385 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
386
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
387
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
388 void tI_previousInfoField(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
389 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
390 if(TIid > 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
391 TIid--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
392 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
393 TIid = TIidLast;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
394 tI_set_cursor(TIid);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
395 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
396
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
397
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
398 uint8_t tI_get_newContent_of_actual_id_block_and_subBlock(uint8_t action)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
399 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
400 uint8_t (*onActionFunc)(uint32_t, uint8_t, uint8_t, uint8_t, uint8_t);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
401 uint8_t content;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
402
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
403 if(TIevent[TIevid].callerID != TIident[TIid].callerID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
404 return 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
405
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
406 onActionFunc = (uint8_t (*)(uint32_t, uint8_t, uint8_t, uint8_t, uint8_t))(TIevent[TIevid].pEventFunction);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
407
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
408 if(TIident[TIid].maintype == FIELD_ON_OFF)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
409 content = TIident[TIid].input;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
410 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
411 content = 0; /* just a default for protection */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
412
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
413 return onActionFunc(TIident[TIid].callerID, 0, 0, content, action);
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
417 void tI_enterInfoField(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
418 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
419 uint8_t newContent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
420
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
421 TIevid = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
422 while((TIevid < TIevidLast) && (TIevent[TIevid].callerID != TIident[TIid].callerID))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
423 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
424 TIevid++;
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(TIevent[TIevid].callerID != TIident[TIid].callerID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
428 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
429
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
430 newContent = tI_get_newContent_of_actual_id_block_and_subBlock(ACTION_BUTTON_ENTER);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
431
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
432 if(newContent == 255)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
433 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
434 exitInfo();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
435 return;
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 switch(TIident[TIid].maintype)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
439 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
440 case FIELD_BUTTON:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
441 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
442 case FIELD_ON_OFF:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
443 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
444 case FIELD_SYMBOL:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
445 TIident[TIid].input += 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
446 if(TIident[TIid].input >= TIident[TIid].symbolCounter)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
447 TIident[TIid].input = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
448 TIident[TIid].newText[0] = TIident[TIid].orgText[TIident[TIid].input];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
449 tInfo_write_content_of_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
450 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
451 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
452 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
453
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
454
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
455 void tI_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
456 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
457 if(editID != TIident[TIid].callerID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
458 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
459
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
460 uint8_t i, digitCount, digit;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
461 uint32_t sum[4], multiplier;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
462
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
463 for(i=0;i<4;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
464 sum[i] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
465
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
466 i = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
467 while( TIident[TIid].size[i] && (i < 4))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
468 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
469 multiplier = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
470 for(digitCount = 1; digitCount < TIident[TIid].size[i]; digitCount++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
471 multiplier *= 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
472
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
473 for(digitCount = 0; digitCount < TIident[TIid].size[i]; digitCount++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
474 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
475 digit = TIident[TIid].newText[TIident[TIid].begin[i] + digitCount];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
476
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
477 if(digit > '0')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
478 digit -= '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
479 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
480 digit = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
481
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
482 if(digit > 9)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
483 digit = 9;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
484
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
485 sum[i] += digit * multiplier;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
486
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
487 if(multiplier >= 10)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
488 multiplier /= 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
489 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
490 multiplier = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
491 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
492 i++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
493 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
494
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
495 *pNewValue1 = sum[0];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
496 *pNewValue2 = sum[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
497 *pNewValue3 = sum[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
498 *pNewValue4 = sum[3];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
499 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
500
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
501
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
502 uint8_t tI_get_id_of(uint32_t editID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
503 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
504 uint8_t temp_id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
505
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
506 if(editID == TIident[TIid].callerID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
507 return TIid;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
508 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
509 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
510 temp_id = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
511 while((temp_id < 9) && (editID != TIident[temp_id].callerID))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
512 temp_id++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
513 if(editID != TIident[temp_id].callerID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
514 temp_id = 255;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
515 return temp_id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
516 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
517 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
518
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
519
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
520 void tI_newButtonText(uint32_t editID, char *text)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
521 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
522 uint8_t backup_id, temp_id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
523
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
524 temp_id = tI_get_id_of(editID);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
525 if(temp_id == 255)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
526 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
527
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
528 backup_id = TIid;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
529 TIid = temp_id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
530
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
531 strncpy(TIident[TIid].newText, text, 32);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
532 TIident[TIid].newText[31] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
533
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
534 tI_clean_content_of_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
535 tInfo_write_content_of_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
536
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
537 TIid = backup_id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
538 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
539
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
540
699
01f40cb1057e Cleanup warnings:
Ideenmodellierer
parents: 243
diff changeset
541 void tInfo_set_on_off(uint32_t editID, uint8_t int1)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
542 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
543 uint8_t backup_id, temp_id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
544
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
545 temp_id = tI_get_id_of(editID);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
546 if(temp_id == 255)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
547 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
548
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
549 backup_id = TIid;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
550 TIid = temp_id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
551
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
552 TIident[TIid].input = int1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
553
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
554 if(int1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
555 change_CLUT_entry((CLUT_InfoField0 + TIid), CLUT_InfoActive);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
556 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
557 change_CLUT_entry((CLUT_InfoField0 + TIid), CLUT_InfoInActive);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
558
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
559 tInfo_write_content_of_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
560
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
561 TIid = backup_id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
562 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
563
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
564
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
565 void tInfo_write_content_without_Id(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
566 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
567 tInfo_write_content( TIident[TIid].coord[0], TIident[TIid].coord[1], TIident[TIid].coord[2], TIident[TIid].fontUsed, TIident[TIid].newText, CLUT_InfoFieldRegular);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
568 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
569
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
570
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
571 void tInfo_write_content_of_actual_Id(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
572 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
573 tInfo_write_content( TIident[TIid].coord[0], TIident[TIid].coord[1], TIident[TIid].coord[2], TIident[TIid].fontUsed, TIident[TIid].newText, (CLUT_InfoField0 + TIid));
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
577 void tI_clean_content_of_actual_Id(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
578 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
579 tI_clean_content( TIident[TIid].coord[0], TIident[TIid].coord[1], TIident[TIid].coord[2], TIident[TIid].fontUsed);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
580 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
581
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
582
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
583 void tInfo_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
584 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
585 if(TIidLast >= 9)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
586 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
587
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
588 TIident[TIid].maintype = FIELD_BUTTON;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
589 TIident[TIid].subtype = FIELD_BUTTON;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
590
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
591 TIident[TIid].coord[0] = XleftGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
592 TIident[TIid].coord[1] = XrightGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
593 TIident[TIid].coord[2] = YtopGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
594 TIident[TIid].fontUsed = (tFont *)Font;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
595 TIident[TIid].callerID = editID;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
596
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
597 strncpy(TIident[TIid].orgText, text, 32);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
598 strncpy(TIident[TIid].newText, text, 32);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
599 TIident[TIid].orgText[31] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
600 TIident[TIid].newText[31] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
601
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
602 change_CLUT_entry((CLUT_InfoField0 + TIid), CLUT_InfoButtonColor1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
603
166
255eedad4155 cleanup: get rid of some compile warnings
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
604 if(editID == 0)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
605 tInfo_write_content_without_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
606 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
607 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
608 tInfo_write_content_of_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
609 TIidLast = TIid;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
610 TIid++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
611 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
612 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
613
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
614
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
615 void tInfo_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
616 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
617 if(TIidLast >= 9)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
618 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
619
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
620 TIident[TIid].maintype = FIELD_SYMBOL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
621 TIident[TIid].subtype = FIELD_SYMBOL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
622
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
623 TIident[TIid].coord[0] = XleftGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
624 TIident[TIid].coord[1] = XrightGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
625 TIident[TIid].coord[2] = YtopGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
626 TIident[TIid].fontUsed = (tFont *)Font;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
627 TIident[TIid].callerID = editID;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
628
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
629 strncpy(TIident[TIid].orgText, text, 32);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
630 strncpy(TIident[TIid].newText, text, 32);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
631 TIident[TIid].orgText[31] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
632
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
633 TIident[TIid].newText[0] = text[0];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
634 TIident[TIid].newText[1] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
635
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
636 TIident[TIid].input = int1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
637 TIident[TIid].symbolCounter = strlen(TIident[TIid].orgText);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
638
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
639 change_CLUT_entry((CLUT_InfoField0 + TIid), CLUT_InfoButtonColor1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
640
166
255eedad4155 cleanup: get rid of some compile warnings
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
641 if(editID == 0)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
642 tInfo_write_content_without_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
643 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
644 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
645 tInfo_write_content_of_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
646 TIidLast = TIid;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
647 TIid++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
648 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
649 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
650
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
651
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
652 void tInfo_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
653 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
654 if(TIidLast >= 9)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
655 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
656
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
657 TIident[TIid].maintype = FIELD_ON_OFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
658 TIident[TIid].subtype = FIELD_ON_OFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
659
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
660 TIident[TIid].coord[0] = XleftGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
661 TIident[TIid].coord[1] = XrightGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
662 TIident[TIid].coord[2] = YtopGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
663 TIident[TIid].fontUsed = (tFont *)Font;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
664 TIident[TIid].callerID = editID;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
665
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
666 strncpy(TIident[TIid].orgText, text, 32);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
667 strncpy(TIident[TIid].newText, text, 32);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
668 TIident[TIid].orgText[31] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
669 TIident[TIid].newText[31] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
670
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
671
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
672 if(int1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
673 change_CLUT_entry((CLUT_InfoField0 + TIid), CLUT_InfoActive);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
674 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
675 change_CLUT_entry((CLUT_InfoField0 + TIid), CLUT_InfoInActive);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
676
166
255eedad4155 cleanup: get rid of some compile warnings
Jan Mulder <jlmulder@xs4all.nl>
parents: 130
diff changeset
677 if(editID == 0)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
678 tInfo_write_content_without_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
679 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
680 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
681 tInfo_write_content_of_actual_Id();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
682 TIidLast = TIid;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
683 TIid++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
684 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
685 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
686
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
687
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
688 void tInfo_setEvent(uint32_t inputEventID, uint32_t inputFunctionCall)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
689 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
690 if(TIevidLast >= 9)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
691 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
692
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
693 /* set cursor to first field */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
694 if(TIevidLast < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
695 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
696 tI_startInfoFieldSelect();
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 TIevent[TIevid].callerID = inputEventID;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
700 TIevent[TIevid].pEventFunction = inputFunctionCall;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
701
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
702 TIevidLast = TIevid;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
703 TIevid++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
704 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
705
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
706
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
707 void tI_set_cursor(uint8_t forThisIdentID)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
708 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
709 int16_t x0, x1, y0, y1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
710
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
711 uint32_t xtra_left_right = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
712 uint32_t xtra_top_bottom = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
713
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
714 /* y geht von 0 bis 799 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
715 /* x geht von 0 bis 479 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
716
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
717 x0 = (int16_t)TIident[forThisIdentID].coord[0];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
718 x1 = (int16_t)TIident[forThisIdentID].coord[1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
719 y0 = (int16_t)TIident[forThisIdentID].coord[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
720 y1 = y0 + (int16_t)TIident[forThisIdentID].fontUsed->height;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
721
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
722 if(((int16_t)TIident[forThisIdentID].fontUsed->height) > 70)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
723 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
724 xtra_left_right = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
725 xtra_top_bottom = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
726 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
727 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
728 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
729 xtra_left_right = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
730 xtra_top_bottom = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
731 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
732
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
733 x0 -= xtra_left_right;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
734 x1 += xtra_left_right;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
735 y0 -= xtra_top_bottom;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
736 y1 += xtra_top_bottom;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
737
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
738 GFX_SetWindowLayer0(tIcursor.FBStartAdress, x0, x1, y0, y1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
739 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
740
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
741
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
742 void tInfo_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
743 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
744 GFX_DrawCfgWindow hgfx;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
745
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
746 if(XrightGimpStyle > 799)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
747 XrightGimpStyle = 799;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
748 if(XleftGimpStyle >= XrightGimpStyle)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
749 XleftGimpStyle = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
750 if(YtopGimpStyle > 479)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
751 YtopGimpStyle = 479;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
752 hgfx.Image = &tIscreen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
753 hgfx.WindowNumberOfTextLines = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
754 hgfx.WindowLineSpacing = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
755 hgfx.WindowTab = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
756 hgfx.WindowX0 = XleftGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
757 hgfx.WindowX1 = XrightGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
758 hgfx.WindowY1 = 479 - YtopGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
759 if(hgfx.WindowY1 < Font->height)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
760 hgfx.WindowY0 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
761 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
762 hgfx.WindowY0 = hgfx.WindowY1 - Font->height;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
763
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
764 GFX_write_label(Font, &hgfx, text, infoColor);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
765 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
766
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
767
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
768 void tInfo_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
769 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
770 GFX_DrawCfgWindow hgfx;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
771
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
772 if(XrightGimpStyle > 799)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
773 XrightGimpStyle = 799;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
774 if(XleftGimpStyle >= XrightGimpStyle)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
775 XleftGimpStyle = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
776 if(YtopGimpStyle > 479)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
777 YtopGimpStyle = 479;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
778 hgfx.Image = &tIscreen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
779 hgfx.WindowNumberOfTextLines = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
780 hgfx.WindowLineSpacing = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
781 hgfx.WindowTab = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
782 hgfx.WindowX0 = XleftGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
783 hgfx.WindowX1 = XrightGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
784 hgfx.WindowY1 = 479 - YtopGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
785 if(hgfx.WindowY1 < Font->height)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
786 hgfx.WindowY0 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
787 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
788 hgfx.WindowY0 = hgfx.WindowY1 - Font->height;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
789
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
790 GFX_write_label(Font, &hgfx, text, color);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
791 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
792
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
793
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
794 void tInfo_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
795 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
796 char text[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
797
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
798 text[0] = textId;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
799 text[1] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
800
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
801 tInfo_write_label_var(XleftGimpStyle, XrightGimpStyle, YtopGimpStyle, Font, text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
802 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
803
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
804
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
805 void tI_clean_content(uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
806 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
807 GFX_DrawCfgWindow hgfx;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
808
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
809 if(XrightGimpStyle > 799)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
810 XrightGimpStyle = 799;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
811 if(XleftGimpStyle >= XrightGimpStyle)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
812 XleftGimpStyle = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
813 if(YtopGimpStyle > 479)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
814 YtopGimpStyle = 479;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
815 hgfx.Image = &tIscreen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
816 hgfx.WindowX0 = XleftGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
817 hgfx.WindowX1 = XrightGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
818 hgfx.WindowY1 = 479 - YtopGimpStyle;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
819 if(hgfx.WindowY1 < Font->height)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
820 hgfx.WindowY0 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
821 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
822 hgfx.WindowY0 = hgfx.WindowY1 - Font->height;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
823
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
824 GFX_clear_window_immediately(&hgfx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
825 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
826
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
827
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
828 void tInfo_write_buttonTextline(GFX_DrawCfgScreen *screenPtr, uint8_t left2ByteCode, char middle2ByteCode, char right2ByteCode)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
829 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
830 GFX_clean_area(&tIscreen, 0, 800, 480-24,480);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
831
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
832 char localtext[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
833
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
834 if(left2ByteCode)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
835 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
836 localtext[0] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
837 localtext[1] = left2ByteCode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
838 localtext[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
839 write_content_simple(screenPtr, 0, 800, 480-24, &FontT24,localtext,CLUT_ButtonSurfaceScreen);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
840 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
841
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
842 if(middle2ByteCode)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
843 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
844 localtext[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
845 localtext[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
846 localtext[2] = middle2ByteCode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
847 localtext[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
848 write_content_simple(screenPtr, 0, 800, 480-24, &FontT24,localtext,CLUT_ButtonSurfaceScreen);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
849 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
850
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
851 if(right2ByteCode)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
852 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
853 localtext[0] = '\002';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
854 localtext[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
855 localtext[2] = right2ByteCode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
856 localtext[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
857 write_content_simple(screenPtr, 0, 800, 480-24, &FontT24,localtext,CLUT_ButtonSurfaceScreen);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
858 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
859 }
845
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
860 void tInfo_write_buttonTextline_simple(uint8_t left2ByteCode, char middle2ByteCode, char right2ByteCode)
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
861 {
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
862 char localtext[32];
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
863
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
864 if(left2ByteCode)
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
865 {
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
866 localtext[0] = TXT_2BYTE;
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
867 localtext[1] = left2ByteCode;
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
868 localtext[2] = 0;
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
869 tInfo_write_content_simple(0, 800, 480-24, &FontT24,localtext,CLUT_ButtonSurfaceScreen);
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
870 }
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
871
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
872 if(middle2ByteCode)
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
873 {
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
874 localtext[0] = '\001';
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
875 localtext[1] = TXT_2BYTE;
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
876 localtext[2] = middle2ByteCode;
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
877 localtext[3] = 0;
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
878 tInfo_write_content_simple(0, 800, 480-24, &FontT24,localtext,CLUT_ButtonSurfaceScreen);
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
879 }
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
880
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
881 if(right2ByteCode)
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
882 {
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
883 localtext[0] = '\002';
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
884 localtext[1] = TXT_2BYTE;
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
885 localtext[2] = right2ByteCode;
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
886 localtext[3] = 0;
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
887 tInfo_write_content_simple(0, 800, 480-24, &FontT24,localtext,CLUT_ButtonSurfaceScreen);
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
888 }
17d9d6eddd8d Added new PreDiveCheck info page:
Ideenmodellierer
parents: 826
diff changeset
889 }