Mercurial > public > ostc4
comparison Discovery/Src/tMenuGas.c @ 528:a9c195be907e
Added new option to gas configuration: "Off":
Added functionality needed to handle the new state
| author | Ideenmodellierer |
|---|---|
| date | Sun, 13 Sep 2020 20:59:38 +0200 |
| parents | 3f09b283d993 |
| children | 15f6f0b5786c |
comparison
equal
deleted
inserted
replaced
| 527:962d7b2c18c6 | 528:a9c195be907e |
|---|---|
| 30 #include "tMenu.h" | 30 #include "tMenu.h" |
| 31 #include "tMenuGas.h" | 31 #include "tMenuGas.h" |
| 32 #include "check_warning.h" | 32 #include "check_warning.h" |
| 33 #include "decom.h" | 33 #include "decom.h" |
| 34 #include "unit.h" | 34 #include "unit.h" |
| 35 #include "configuration.h" | |
| 35 | 36 |
| 36 #define OCGAS_STANDARD (0) | 37 #define OCGAS_STANDARD (0) |
| 37 #define OCGAS_BAILOUT_INACTIVE (1) | 38 #define OCGAS_BAILOUT_INACTIVE (1) |
| 38 #define OCGAS_BAILOUT_ACTIVE (2) | 39 #define OCGAS_BAILOUT_ACTIVE (2) |
| 39 #define CCGAS_STANDARD (0) | 40 #define CCGAS_STANDARD (0) |
| 142 typeDeco = pGasLine[gasId].note.ub.deco; | 143 typeDeco = pGasLine[gasId].note.ub.deco; |
| 143 mod = calc_MOD(gasId); | 144 mod = calc_MOD(gasId); |
| 144 ltr = pGasLine[gasId].bottle_size_liter; | 145 ltr = pGasLine[gasId].bottle_size_liter; |
| 145 //bar = stateUsed->lifeData.bottle_bar[gasId]; | 146 //bar = stateUsed->lifeData.bottle_bar[gasId]; |
| 146 | 147 |
| 148 #ifdef ENABLE_UNUSED_GAS_HIDING | |
| 149 if(pGasLine[gasId].note.ub.off) | |
| 150 { | |
| 151 strcpy(&text[textPointer++],"\021"); | |
| 152 } | |
| 153 else | |
| 154 #endif | |
| 147 if(active) | 155 if(active) |
| 148 { | 156 { |
| 149 if(actual_menu_content == MENU_SURFACE) | 157 if(actual_menu_content == MENU_SURFACE) |
| 150 strcpy(&text[textPointer++],"\020"); | 158 strcpy(&text[textPointer++],"\020"); |
| 151 else | 159 else |
| 156 else | 164 else |
| 157 strcpy(&text[textPointer++],"\020"); | 165 strcpy(&text[textPointer++],"\020"); |
| 158 } | 166 } |
| 159 } | 167 } |
| 160 else | 168 else |
| 161 strcpy(&text[textPointer++],"\021"); | 169 { |
| 162 | 170 strcpy(&text[textPointer++],"\031"); |
| 171 } | |
| 163 textPointer += write_gas(&text[textPointer], oxygen, helium); | 172 textPointer += write_gas(&text[textPointer], oxygen, helium); |
| 164 | 173 |
| 165 strcpy(&text[textPointer++],"\t"); | 174 strcpy(&text[textPointer++],"\t"); |
| 166 | 175 |
| 167 if(gasMode == OCGAS_BAILOUT_INACTIVE) | 176 if(gasMode == OCGAS_BAILOUT_INACTIVE) |
| 168 { | 177 { |
| 169 textPointer += snprintf(&text[textPointer], 59,\ | 178 textPointer += snprintf(&text[textPointer], 59,\ |
| 170 "\024" | 179 "\024" |
| 171 " Bailout" | 180 " Bailout" |
| 172 "\021" | 181 "\031" |
| 173 "\034" | 182 "\034" |
| 174 " %3u" | 183 " %3u" |
| 175 "\016\016" | 184 "\016\016" |
| 176 " %c%c" | 185 " %c%c" |
| 177 "\017" | 186 "\017" |
| 183 ); | 192 ); |
| 184 /* | 193 /* |
| 185 textPointer += snprintf(&text[textPointer], 57,\ | 194 textPointer += snprintf(&text[textPointer], 57,\ |
| 186 "\024" | 195 "\024" |
| 187 " Bailout" | 196 " Bailout" |
| 188 "\021" | 197 "\031" |
| 189 "\034" | 198 "\034" |
| 190 " %3u" | 199 " %3u" |
| 191 "\016\016" | 200 "\016\016" |
| 192 "m" | 201 "m" |
| 193 "\017" | 202 "\017" |
| 209 { | 218 { |
| 210 if(first == 0) | 219 if(first == 0) |
| 211 strcpy(&text[textPointer++],"\177"); | 220 strcpy(&text[textPointer++],"\177"); |
| 212 | 221 |
| 213 /* color active / inactive for gas changes */ | 222 /* color active / inactive for gas changes */ |
| 214 char color[5] = {'\021','\021','\021','\021','\021'}; | 223 char color[5] = {'\031','\031','\031','\031','\031'}; |
| 215 if(active) | 224 if(active) |
| 216 { | 225 { |
| 217 /* mod */ | 226 /* mod */ |
| 218 color[0] = '\023'; | 227 color[0] = '\023'; |
| 219 /* deco */ | 228 /* deco */ |
