Mercurial > public > ostc4
annotate Discovery/Src/tMenuXtra.c @ 503:734f7ad46bca
Bugfix display of disabled screen.
It is possible to select a screen as default which is in parallel disabled in the selection view. To avoid this the enable / disable state is not also checked when entering dive mode. The check function was depending on an ACTION. The functionality has been changed to allow the function call without ACTION.
Changed setting of compass circle position from constant position to variable
This was needed to reuse the same function in several views with different compass position
Added new views Navigation and Depth data
Both views were basically already available but the idea behind the layout is to combine all information needed for navigation dives (compass + timer) in one view. The classic maxdepth view just showed the maxdepth with a black box on the right side. this box is now used for display of average depth (shown in classic view Stopwatch)
Minor changes in compass paint function to improve code readability
Use same Y offset for all views
While switching across the views some number were shown ~20 pixel higher than others. This was caused by the usage of the line selection which works for some fonts but not for all => set linenumber to 0 for all views
author | Ideenmodellierer |
---|---|
date | Mon, 24 Aug 2020 19:53:27 +0200 |
parents | 77de014928d6 |
children | 12f8745c8a94 |
rev | line source |
---|---|
38 | 1 /////////////////////////////////////////////////////////////////////////////// |
2 /// -*- coding: UTF-8 -*- | |
3 /// | |
4 /// \file Discovery/Src/tMenuXtra.c | |
5 /// \brief Menu Xtra - Specials in Divemode like Reset Stopwatch | |
6 /// \author heinrichs weikamp gmbh | |
7 /// \date 02-Mar-2015 | |
8 /// | |
9 /// \details | |
10 /// | |
11 /// $Id$ | |
12 /////////////////////////////////////////////////////////////////////////////// | |
13 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh | |
14 /// | |
15 /// This program is free software: you can redistribute it and/or modify | |
16 /// it under the terms of the GNU General Public License as published by | |
17 /// the Free Software Foundation, either version 3 of the License, or | |
18 /// (at your option) any later version. | |
19 /// | |
20 /// This program is distributed in the hope that it will be useful, | |
21 /// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
22 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
23 /// GNU General Public License for more details. | |
24 /// | |
25 /// You should have received a copy of the GNU General Public License | |
26 /// along with this program. If not, see <http://www.gnu.org/licenses/>. | |
27 ////////////////////////////////////////////////////////////////////////////// | |
28 | |
29 /* Includes ------------------------------------------------------------------*/ | |
30 #include <stdio.h> | |
31 #include <string.h> | |
32 #include "tMenu.h" | |
33 #include "tStructure.h" | |
34 #include "tMenuXtra.h" | |
35 #include "text_multilanguage.h" | |
36 #include "data_central.h" | |
37 #include "simulation.h" | |
38 | |
39 /* Exported functions --------------------------------------------------------*/ | |
40 | |
41 uint32_t tMXtra_refresh(uint8_t line, char *text, uint16_t *tab, char *subtext) | |
42 { | |
43 uint8_t textPointer; | |
44 | |
45 textPointer = 0; | |
46 *tab = 500; | |
47 *subtext = 0; | |
48 | |
49 if((line == 0) || (line == 1)) | |
50 { | |
51 text[textPointer++] = TXT_2BYTE; | |
52 text[textPointer++] = TXT2BYTE_ResetStopwatch; | |
53 } | |
54 strcpy(&text[textPointer],"\n\r"); | |
55 textPointer += 2; | |
56 /* | |
57 if((line == 0) || (line == 2)) | |
58 { | |
59 text[textPointer++] = TXT_2BYTE; | |
60 text[textPointer++] = TXT2BYTE_ResetAvgDepth; | |
61 } | |
62 strcpy(&text[textPointer],"\n\r"); | |
63 textPointer += 2; | |
64 */ | |
65 if((line == 0) || (line == 2)) | |
66 { | |
67 text[textPointer++] = TXT_2BYTE; | |
68 text[textPointer++] = TXT2BYTE_CompassHeading; | |
69 } | |
70 strcpy(&text[textPointer],"\n\r"); | |
71 textPointer += 2; | |
72 | |
73 if((line == 0) || (line == 3)) | |
74 { | |
75 text[textPointer++] = TXT_2BYTE; | |
76 text[textPointer++] = TXT2BYTE_SetMarker; | |
77 } | |
78 strcpy(&text[textPointer],"\n\r"); | |
79 textPointer += 2; | |
80 | |
81 if(is_stateUsedSetToSim()) | |
82 { | |
83 if((line == 0) || (line == 4)) | |
84 { | |
85 text[textPointer++] = TXT_2BYTE; | |
86 text[textPointer++] = TXT2BYTE_SimFollowDecoStops; | |
87 text[textPointer++] = ' '; | |
88 text[textPointer++] = ' '; | |
89 if(simulation_get_heed_decostops()) | |
90 text[textPointer++] = '\005'; | |
91 else | |
92 text[textPointer++] = '\006'; | |
93 } | |
94 strcpy(&text[textPointer],"\n\r"); | |
95 textPointer += 2; | |
96 } | |
347
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
38
diff
changeset
|
97 else |
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
38
diff
changeset
|
98 { |
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
38
diff
changeset
|
99 if((line == 0) || (line == 4)) /* end dive mode only used during real dives */ |
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
38
diff
changeset
|
100 { |
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
38
diff
changeset
|
101 text[textPointer++] = TXT_2BYTE; |
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
38
diff
changeset
|
102 text[textPointer++] = TXT2BYTE_EndDiveMode; |
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
38
diff
changeset
|
103 } |
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
38
diff
changeset
|
104 strcpy(&text[textPointer],"\n\r"); |
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
38
diff
changeset
|
105 textPointer += 2; |
77de014928d6
Added option to manually leave dive mode to system menu
ideenmodellierer
parents:
38
diff
changeset
|
106 } |
38 | 107 |
108 return StMXTRA; | |
109 } | |
110 |