Mercurial > public > ostc4
annotate Discovery/Src/tMenuCvOption.c @ 1018:808153ba3fec GasConsumption
Disable the menu items for editing scrubber timer parameters if an
inactive scrubber timer is selected.
This removes the confusion when users edit a scrubber that is not
active, and are then surprised when the scrubber timer does not work
during the dive. (mikeller)
| author | heinrichsweikamp |
|---|---|
| date | Mon, 09 Jun 2025 09:42:16 +0200 |
| parents | 8c0134a287da |
| children | 33b91584d827 |
| rev | line source |
|---|---|
| 999 | 1 /////////////////////////////////////////////////////////////////////////////// |
| 2 /// -*- coding: UTF-8 -*- | |
| 3 /// | |
| 4 /// \file Discovery/Src/tMenuCvOption.c | |
| 5 /// \brief Main Template file for Menu Page System settings | |
| 6 /// \author heinrichs weikamp gmbh | |
| 7 /// \date 24-Apr-2025 | |
| 8 /// | |
| 9 /// \details | |
| 10 /// | |
| 11 /// $Id$ | |
| 12 /////////////////////////////////////////////////////////////////////////////// | |
| 13 /// \par Copyright (c) 2014-2025 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 "tMenu.h" | |
| 31 #include "tMenuCvOption.h" | |
| 32 #include "tHome.h" // for enum CUSTOMVIEWS and init_t7_compass() | |
| 33 #include "t7.h" | |
| 34 | |
| 35 /* Private function prototypes -----------------------------------------------*/ | |
| 36 | |
| 37 /* Exported functions --------------------------------------------------------*/ | |
| 38 | |
| 39 uint32_t tMCvOption_refresh(uint8_t line, char *text, uint16_t *tab, char *subtext) | |
| 40 { | |
| 41 SSettings *data; | |
| 42 uint8_t textPointer; | |
| 43 | |
| 44 data = settingsGetPointer(); | |
| 45 textPointer = 0; | |
| 46 *tab = 300; | |
| 47 *subtext = 0; | |
| 48 | |
| 49 resetLineMask(StMOption); | |
| 50 | |
| 51 if((line == 0) || (line == 1)) | |
| 52 { | |
| 53 text[textPointer++] = TXT_2BYTE; | |
| 54 text[textPointer++] = TXT2BYTE_Compass; | |
| 55 text[textPointer++] = '\t'; | |
| 56 | |
| 57 if(settingsGetPointer()->compassBearing != 0) | |
| 58 { | |
| 59 textPointer += snprintf(&text[textPointer], 20, "(%03u`)", settingsGetPointer()->compassBearing % 360); | |
| 60 } | |
| 61 text[textPointer] = 0; | |
| 62 } | |
| 63 nextline(text,&textPointer); | |
| 64 if (line == 0 || line == 2) | |
| 65 { | |
| 66 if(t7_customview_disabled(CVIEW_Timer)) | |
| 67 { | |
| 68 text[textPointer++] = '\031'; /* change text color */ | |
| 69 textPointer += snprintf(&text[textPointer], 21, "%c%c\t%u:%02u \016\016[m:ss]\017", TXT_2BYTE, TXT2BYTE_Timer, data->timerDurationS / 60, data->timerDurationS % 60); | |
| 70 text[textPointer++] = '\020'; /* restore text color */ | |
| 71 } | |
| 72 else | |
| 73 { | |
| 74 textPointer += snprintf(&text[textPointer], 21, "%c%c\t%u:%02u \016\016[m:ss]\017", TXT_2BYTE, TXT2BYTE_Timer, data->timerDurationS / 60, data->timerDurationS % 60); | |
| 75 } | |
| 76 } | |
| 77 nextline(text,&textPointer); | |
| 78 | |
| 79 return StMOption; | |
| 80 } | |
| 81 void tMCvOption_checkLineStatus(void) | |
| 82 { | |
| 83 uint8_t localLineMask = 0; | |
|
1001
21142f4fa968
Cleanup menu structucture afer menu shift:
Ideenmodellierer
parents:
999
diff
changeset
|
84 uint8_t lineMask = getLineMask(StMOption); |
|
21142f4fa968
Cleanup menu structucture afer menu shift:
Ideenmodellierer
parents:
999
diff
changeset
|
85 |
| 999 | 86 if(t7_customview_disabled(CVIEW_Timer)) |
| 87 { | |
| 88 localLineMask |= 1 << 2; | |
| 89 } | |
|
1001
21142f4fa968
Cleanup menu structucture afer menu shift:
Ideenmodellierer
parents:
999
diff
changeset
|
90 |
| 999 | 91 if(lineMask != localLineMask) |
| 92 { | |
| 93 updateMenu(); | |
| 94 } | |
| 95 } | |
| 96 | |
| 97 /* Private functions ---------------------------------------------------------*/ |
