comparison Discovery/Src/tMenuSetpoint.c @ 792:25103f5c7e29

Avoid a configuration warning after the firmware upgrade by disabling automatic setpoint switching. This makes sure the user's automatic setpoint configuration is not overwritten by the validity checks if the settings are not in the correct spots for the new configuration. Users will have to manually re-create the automatic setpoint switching configuration in the new format; Add a checkbox to 'SPdeco' in the menu - this will make it obvious to users that this setpoint can be disabled. (mikeller)
author heinrichsweikamp
date Sat, 05 Aug 2023 11:52:08 +0200
parents b7cd0c5c8e43
children 4c41d9a18c7f
comparison
equal deleted inserted replaced
791:92ac192e98d5 792:25103f5c7e29
75 75
76 setpoint_cbar = pSetpointLine[spId].setpoint_cbar; 76 setpoint_cbar = pSetpointLine[spId].setpoint_cbar;
77 depthUp = pSetpointLine[spId].depth_meter; 77 depthUp = pSetpointLine[spId].depth_meter;
78 first = pSetpointLine[spId].note.ub.first; 78 first = pSetpointLine[spId].note.ub.first;
79 79
80 char colour;
80 if (settings->autoSetpoint && spId == SETPOINT_INDEX_AUTO_DECO && !pSetpointLine[spId].note.ub.active) { 81 if (settings->autoSetpoint && spId == SETPOINT_INDEX_AUTO_DECO && !pSetpointLine[spId].note.ub.active) {
81 strcpy(&text[textPointer++],"\031"); 82 colour = '\031';
82 } else { 83 } else {
83 strcpy(&text[textPointer++],"\020"); 84 colour = '\020';
84 } 85 }
85 86
86 uint8_t setpointBar = setpoint_cbar / 100; 87 uint8_t setpointBar = setpoint_cbar / 100;
87 88
88 textPointer += snprintf(&text[textPointer], 4, "%c%c", TXT_2BYTE, TXT2BYTE_SetpointShort); 89 textPointer += snprintf(&text[textPointer], 4, "%c%c%c", colour, TXT_2BYTE, TXT2BYTE_SetpointShort);
89 textPointer += printSetpointName(&text[textPointer], spId, settings, true); 90 textPointer += printSetpointName(&text[textPointer], spId, settings, true);
90 text[textPointer++] = '\t'; 91
92 text[textPointer++] = '\t';
91 93
92 if (first == 0 || actual_menu_content != MENU_SURFACE) { 94 if (first == 0 || actual_menu_content != MENU_SURFACE) {
93 strcpy(&text[textPointer++],"\177"); 95 strcpy(&text[textPointer++],"\177");
94 } 96 }
95 97
96 textPointer += snprintf(&text[textPointer], 40, "* %u.%02u\016\016 bar\017\034 \016\016 \017", setpointBar, setpoint_cbar - (100 * setpointBar)); 98 textPointer += snprintf(&text[textPointer], 40, "* %u.%02u\016\016 bar\017\034 \016\016 \017", setpointBar, setpoint_cbar - (100 * setpointBar));
97 if (!settings->autoSetpoint || spId < SETPOINT_INDEX_AUTO_DECO) { 99 if (!settings->autoSetpoint || spId < SETPOINT_INDEX_AUTO_DECO) {
98 char color = '\031'; 100 if (depthUp) {
99 if(depthUp) 101 colour = '\020';
100 color = '\020'; 102 } else {
103 colour = '\031';
104 }
101 105
102 textPointer += snprintf(&text[textPointer], 40, "%c%3u\016\016 %c%c\017\035\n\r", color, unit_depth_integer(depthUp), unit_depth_char1(), unit_depth_char2()); 106 textPointer += snprintf(&text[textPointer], 40, "%c%3u\016\016 \035%c%c\017\n\r", colour, unit_depth_integer(depthUp), unit_depth_char1(), unit_depth_char2());
103 } else { 107 } else {
104 textPointer += snprintf(&text[textPointer], 3, "\n\r"); 108 textPointer += snprintf(&text[textPointer], 14, " %c\016\016 \035%c%c\017\n\r", pSetpointLine[spId].note.ub.active ? '\005' : '\006', TXT_2BYTE, TXT2BYTE_Enabled);
105 } 109 }
106 } 110 }
107 } 111 }
108 if (actual_menu_content != MENU_SURFACE) { 112 if (actual_menu_content != MENU_SURFACE) {
109 text[textPointer++] = '\020'; 113 text[textPointer++] = '\020';