annotate Discovery/Src/tInfoLog.c @ 169:842f57bbaaad cleanup-1

Bugfix: highlight the menu underline correctly on selected state This fixes an optical bug. In dive and simulation mode, the underline in the top menu was not highlighted correctly for the DECO ans SYS submenu's. The check when to highlight simply was not correct. And, yes, this part of the code is rather obfuscated, and deserves some attention later on. Reported-by: Matthias Heinrichs <matthias.heinrichs@heinrichsweikamp.com> Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
author Jan Mulder <jlmulder@xs4all.nl>
date Sun, 10 Mar 2019 10:09:58 +0100
parents cc8e24374b83
children f11f0bf6ef2d
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/tInfoLog.c
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 /// \brief Main Template file for Menu Page Deco
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6 /// \author heinrichs weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7 /// \date 31-July-2014
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
8 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
9 /// \details
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
10 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 /// $Id$
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 ///////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 /// This program is free software: you can redistribute it and/or modify
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 /// it under the terms of the GNU General Public License as published by
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 /// the Free Software Foundation, either version 3 of the License, or
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 /// (at your option) any later version.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 /// This program is distributed in the hope that it will be useful,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21 /// but WITHOUT ANY WARRANTY; without even the implied warranty of
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 /// GNU General Public License for more details.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25 /// You should have received a copy of the GNU General Public License
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26 /// along with this program. If not, see <http://www.gnu.org/licenses/>.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 //////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29 /* Includes ------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30 #include "tInfoLog.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32 #include "gfx_fonts.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 #include "logbook.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 #include "show_logbook.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 "tInfo.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37 #include "tMenu.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 #include "unit.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40 /* Exported variables --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42 /* Private types -------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45 uint8_t page;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46 uint8_t line;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47 uint8_t linesAvailableForPage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48 uint8_t modeFlipPages;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 uint8_t maxpages;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50 } SInfoLogMemory;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52 /* Private variables ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53 GFX_DrawCfgScreen INFOLOGscreen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54 GFX_DrawCfgScreen *pMenuCursor, *pMenuCursorDesignSolo;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 GFX_DrawCfgWindow INFOLOGwindow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57 SInfoLogMemory infolog;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 /* Private function prototypes -----------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 void nextLineInfoLog(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61 void tInfoLog_BuildAndShowNextPage(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62 void tInfoLog_nextLine(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63 void showLog(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 void showNextLogPage(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 void stepBackInfo(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 void stepForwardInfo(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 void showLogExit(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70 void tInfoLog_init(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72 INFOLOGscreen.FBStartAdress = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
73 INFOLOGscreen.ImageHeight = 480;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74 INFOLOGscreen.ImageWidth = 800;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75 INFOLOGscreen.LayerIndex = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77 INFOLOGwindow.Image = &INFOLOGscreen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78 INFOLOGwindow.WindowNumberOfTextLines = 6;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79 INFOLOGwindow.WindowLineSpacing = 65;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80 INFOLOGwindow.WindowTab = 400;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81 INFOLOGwindow.WindowX0 = 20;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82 INFOLOGwindow.WindowX1 = 779;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
83 if(!settingsGetPointer()->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
84 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
85 INFOLOGwindow.WindowY0 = 4 + 25;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
86 INFOLOGwindow.WindowY1 = 390 + 25;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
87 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
88 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
89 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
90 INFOLOGwindow.WindowY0 = 479 - 390;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
91 INFOLOGwindow.WindowY1 = 479 - 25;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
92 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96 void openInfoLogLastDive(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98 infolog.page = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99 SLogbookHeader logbookHeader;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100 if(logbook_getHeader(0,&logbookHeader))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 set_globalState(StILOGSHOW); // all the rest with zeros
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103 infolog.page = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104 infolog.line = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105 show_logbook_test(1, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108 openLog(0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112 void openLog(_Bool recallKeepPage)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114 if(recallKeepPage && infolog.page)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 infolog.page--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 infolog.page = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 infolog.modeFlipPages = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 set_globalState_Log_Page(infolog.page);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 infolog.maxpages = (logbook_getNumberOfHeaders() + 5) / 6;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122 tInfoLog_BuildAndShowNextPage();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 pMenuCursor = get_PointerMenuCursorScreen();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125 pMenuCursorDesignSolo = get_PointerMenuCursorDesignSoloScreen();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127 change_CLUT_entry(CLUT_MenuLineSelectedSides, CLUT_InfoPageLogbook);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 change_CLUT_entry(CLUT_MenuLineSelectedSeperator, CLUT_InfoPageLogbook);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130 //GFX_ResetLayer(TOP_LAYER);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131 //GFX_ResetLayer(BACKGRD_LAYER);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 if(infolog.page == 255)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134 GFX_SetFrameBottom((INFOLOGscreen.FBStartAdress), 0, 0, 800, 480);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 // very old: GFX_SetFrameBottom((pMenuCursor->FBStartAdress), 0, 0, 800, 390);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138 // no, set cursor to firt line instead with tInfoLog_nextLine() GFX_SetFrameBottom((pMenuCursorDesignSolo->FBStartAdress), 0, 25, 800, 390);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 tInfoLog_nextLine();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144 void sendActionToInfoLogList(uint8_t sendAction)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 switch(sendAction)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148 case ACTION_BUTTON_ENTER:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149 stepForwardInfo();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151 case ACTION_BUTTON_NEXT:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 if(infolog.modeFlipPages)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155 tInfoLog_BuildAndShowNextPage();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156 // GFX_SetFrameBottom((pMenuCursor->FBStartAdress), 0, 25, 800, 390);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 tInfoLog_nextLine();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161 case ACTION_TIMEOUT:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 case ACTION_MODE_CHANGE:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163 case ACTION_BUTTON_BACK:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164 stepBackInfo();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 case ACTION_IDLE_TICK:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168 case ACTION_IDLE_SECOND:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169 break;
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
173
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174 void sendActionToInfoLogShow(uint8_t sendAction)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176 switch(sendAction)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178 case ACTION_BUTTON_ENTER:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180 case ACTION_BUTTON_NEXT:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181 showNextLogPage();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183 case ACTION_TIMEOUT:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184 case ACTION_MODE_CHANGE:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185 case ACTION_BUTTON_BACK:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186 if(get_globalState() == StILOGSHOW) // no page nor line
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
187 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
188 openLog(1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
189 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
190 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
191 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192 showLogExit();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194 show_logbook_exit();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197 case ACTION_IDLE_TICK:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 case ACTION_IDLE_SECOND:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 break;
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204 /* Private functions ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 void exitLog(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208 //set_globalState_tHome();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209 exitInfo();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210 releaseFrame(15,INFOLOGscreen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214 void stepBackInfo(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 if(infolog.modeFlipPages == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 infolog.line = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219 infolog.modeFlipPages = 1;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
220
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
221 if(!settingsGetPointer()->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
222 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
223 GFX_SetFrameBottom(pMenuCursorDesignSolo->FBStartAdress, 0, 25, 800, 390);
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
224 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
225 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
226 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
227 GFX_SetFrameBottom(pMenuCursorDesignSolo->FBStartAdress, 0, 65, 800, 390);
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
228 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
229
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 exitLog();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236 void stepForwardInfo(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238 if(infolog.modeFlipPages == 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240 tInfoLog_nextLine();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
242 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243 showLog();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247 void tInfoLog_BuildAndShowNextPage(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249 char text[MAX_PAGE_TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250 uint16_t textPointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251 SLogbookHeader logbookHeader;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252 // uint16_t divetime = logbookHeader.diveTimeMinutes;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253 // uint16_t maxDepth = logbookHeader.maxDepth/100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254 int i = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255 uint8_t date[2], month,day;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
257 if(INFOLOGscreen.FBStartAdress)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
258 releaseFrame(15,INFOLOGscreen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
259 INFOLOGscreen.FBStartAdress = getFrame(15);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261 infolog.page += 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
262 infolog.linesAvailableForPage = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264 if((infolog.page < 1) || (infolog.page > 43)) /* max with 256 entries */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265 infolog.page = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
267
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268 text[0] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269 text[1] = TXT_Logbook;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270 text[2] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271 gfx_write_topline_simple(&INFOLOGscreen, text, CLUT_InfoPageLogbook);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
273 *text = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
274 if(!logbook_getHeader((infolog.page - 1) * 6,&logbookHeader))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276 infolog.page = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277 if(!logbook_getHeader((infolog.page - 1) * 6,&logbookHeader))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279 infolog.page = 255;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280 infolog.linesAvailableForPage = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
281 text[0] = TXT_LogbookEmpty;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282 text[1] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286 if((*text == 0) && (infolog.maxpages > 1))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288 snprintf(text,8, "\002" "%u/%u", infolog.page, infolog.maxpages);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289 gfx_write_topline_simple(&INFOLOGscreen, text, CLUT_InfoPageLogbook);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
290 *text = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
291 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
293 if(*text == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295 infolog.line = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
296 textPointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297 if(settingsGetPointer()->date_format == DDMMYY)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299 day = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300 month = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304 day = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305 month = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 for(i = 0; i < 6; i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
309 if(i)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
310 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
311 if(!logbook_getHeader(((infolog.page - 1) * 6) + i, &logbookHeader))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
312 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
313 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
314 infolog.linesAvailableForPage += 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
315 uint16_t divetime = logbookHeader.diveTimeMinutes;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
316 uint16_t maxDepthMeter = logbookHeader.maxDepth/100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
317 uint16_t maxDepthSubmeter = (logbookHeader.maxDepth - maxDepthMeter * 100)/10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
318 uint16_t number = ((infolog.page - 1) * 6) + i + 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
319 if(settingsGetPointer()->logbookOffset)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
320 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
321 if(number <= settingsGetPointer()->logbookOffset)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
322 number = settingsGetPointer()->logbookOffset + 1 - number;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
323 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
324 date[day] = logbookHeader.dateDay;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
325 date[month] = logbookHeader.dateMonth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
326
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
327 text[textPointer++] = '\034';// monospaced space large size mode
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
328 textPointer += snprintf(&text[textPointer], 20,"\021%04u \020", number);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
329 /* if(number < 1000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
330 textPointer += snprintf(&text[textPointer], 20,"\021%2u \020", number);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
331 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
332 textPointer += snprintf(&text[textPointer], 20,"\021\016\016%3u \017\020", number);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
333 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
334 textPointer += snprintf(&text[textPointer], 20,"%02d.%02d ",date[0],date[1]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
335 textPointer += snprintf(&text[textPointer], 20,"%02d:%02d ",logbookHeader.timeHour,logbookHeader.timeMinute);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
336 switch(logbookHeader.decoModel)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
337 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
338 case 1:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
339 textPointer += snprintf(&text[textPointer],20,"\016\016 GF \017");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
340 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
341 case 2:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
342 textPointer += snprintf(&text[textPointer],20,"\016\016 VPM \017");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
343 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
344 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
345 textPointer += snprintf(&text[textPointer],20,"\016\016 * \017");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
346 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
347 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
348
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
349 if(settingsGetPointer()->nonMetricalSystem)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
350 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
351 float maxDepthFeet = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
352 maxDepthFeet = unit_depth_float(((float)logbookHeader.maxDepth)/100);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
353 textPointer += snprintf(&text[textPointer], 20,"%3.0f\016\016ft\017 ", maxDepthFeet);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
354 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
355 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
356 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
357 textPointer += snprintf(&text[textPointer], 20,"%3d.%d\016\016m\017 ", maxDepthMeter,maxDepthSubmeter);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
358 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
359 textPointer += snprintf(&text[textPointer], 20,"%3d'\n\r", divetime);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
360 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
361 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
362 GFX_write_string(&FontT48, &INFOLOGwindow, text,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
363
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
364 if(infolog.linesAvailableForPage > 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
365 tInfo_write_buttonTextline(&INFOLOGscreen, TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
366 else if(infolog.page == 255)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
367 tInfo_write_buttonTextline(&INFOLOGscreen, TXT2BYTE_ButtonBack,0,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
368 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
369 tInfo_write_buttonTextline(&INFOLOGscreen, TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
370
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
371 GFX_SetFrameTop(INFOLOGscreen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
372 set_globalState_Log_Page(infolog.page);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
373 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
374
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
375
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
376 void tInfoLog_nextLine(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
377 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
378 if(infolog.linesAvailableForPage == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
379 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
380
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
381 infolog.line += 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
382 if(infolog.line > infolog.linesAvailableForPage)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
383 infolog.line = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
384
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
385 infolog.modeFlipPages = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
386
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
387 if(!settingsGetPointer()->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
388 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
389 GFX_SetFrameBottom((pMenuCursor->FBStartAdress) + 65*2*(infolog.line - 1), 0, 25, 800, 390);
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
390 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
391 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
392 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
393 GFX_SetFrameBottom((pMenuCursor->FBStartAdress)+ (390 - 65 *(infolog.line)) *2, 0, 480-390-25, 800, 390);
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
394 }
38
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 void showLogExit(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
399 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
400 GFX_SetFrameTop(INFOLOGscreen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
401 GFX_SetFrameBottom((pMenuCursor->FBStartAdress) + 65*2*(infolog.line - 1), 0, 25, 800, 390);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
402 set_globalState_Log_Page(infolog.page);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
403 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
404
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
405
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
406 void showLog(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
407 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
408 uint8_t stepBack;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
409
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
410 if(infolog.page == 255)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
411 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
412
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
413 stepBack = (6 * (infolog.page - 1)) + infolog.line - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
414 //build_logbook_test();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
415 show_logbook_test(1, stepBack);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
416 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
417
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
418
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
419 void showNextLogPage(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
420 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
421 uint8_t stepBack;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
422
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
423 if(infolog.page == 255)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
424 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
425
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
426 stepBack = (6 * (infolog.page - 1)) + infolog.line - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
427 //build_logbook_test();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
428 show_logbook_test(0, stepBack);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
429 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
430
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
431