Mercurial > public > ostc4
comparison Discovery/Src/tMenuGas.c @ 1061:f501d7c35c8f Icon_Integration
Show/ edit bottle size and pressure:
The function to visualize bottle data was already present in an earlier implementation. The functions have be reactivated and may now be added using the compile switch "ENABLE_ADVANCED_GAS". The size of a bottle may be selected and pressure information will be displayed if it is available.
| author | Ideenmodellierer |
|---|---|
| date | Sat, 07 Feb 2026 21:39:40 +0100 |
| parents | 1b995079c045 |
| children | eceb5cb2a8e3 |
comparison
equal
deleted
inserted
replaced
| 1060:3d9994033ae6 | 1061:f501d7c35c8f |
|---|---|
| 77 | 77 |
| 78 uint8_t gasId, oxygen, helium, depthUp, active, first, typeDeco; | 78 uint8_t gasId, oxygen, helium, depthUp, active, first, typeDeco; |
| 79 float fPpO2limitHigh = 0; | 79 float fPpO2limitHigh = 0; |
| 80 float fPpO2ofGasAtThisDepth = 0; | 80 float fPpO2ofGasAtThisDepth = 0; |
| 81 //uint8_t senderCode, depthDown,; | 81 //uint8_t senderCode, depthDown,; |
| 82 //uint16_t bar; | 82 #ifdef ENABLE_ADVANCED_GAS |
| 83 uint16_t textPointer, mod, ltr; | 83 uint16_t bar, ltr; |
| 84 #endif | |
| 85 uint16_t textPointer, mod; | |
| 84 | 86 |
| 85 if(actual_menu_content == MENU_SURFACE) | 87 if(actual_menu_content == MENU_SURFACE) |
| 86 { | 88 { |
| 87 pGasLine = settingsGetPointer()->gas; | 89 pGasLine = settingsGetPointer()->gas; |
| 88 } | 90 } |
| 140 //senderCode = pGasLine[gasId].note.ub.senderCode; | 142 //senderCode = pGasLine[gasId].note.ub.senderCode; |
| 141 active = pGasLine[gasId].note.ub.active; | 143 active = pGasLine[gasId].note.ub.active; |
| 142 first = pGasLine[gasId].note.ub.first; | 144 first = pGasLine[gasId].note.ub.first; |
| 143 typeDeco = pGasLine[gasId].note.ub.deco; | 145 typeDeco = pGasLine[gasId].note.ub.deco; |
| 144 mod = calc_MOD(gasId); | 146 mod = calc_MOD(gasId); |
| 147 #ifdef ENABLE_ADVANCED_GAS | |
| 145 ltr = pGasLine[gasId].bottle_size_liter; | 148 ltr = pGasLine[gasId].bottle_size_liter; |
| 146 //bar = stateUsed->lifeData.bottle_bar[gasId]; | 149 bar = stateUsed->lifeData.bottle_bar[gasId]; |
| 150 #endif | |
| 147 | 151 |
| 148 #ifdef ENABLE_UNUSED_GAS_HIDING | 152 #ifdef ENABLE_UNUSED_GAS_HIDING |
| 149 if(pGasLine[gasId].note.ub.off) | 153 if(pGasLine[gasId].note.ub.off) |
| 150 { | 154 { |
| 151 strcpy(&text[textPointer++],"\021"); | 155 strcpy(&text[textPointer++],"\021"); |
| 174 strcpy(&text[textPointer++],"\t"); | 178 strcpy(&text[textPointer++],"\t"); |
| 175 | 179 |
| 176 if(gasMode == OCGAS_BAILOUT_INACTIVE) | 180 if(gasMode == OCGAS_BAILOUT_INACTIVE) |
| 177 { | 181 { |
| 178 textPointer += snprintf(&text[textPointer], 59,\ | 182 textPointer += snprintf(&text[textPointer], 59,\ |
| 179 "\024" | 183 "\024 Bailout\031\034 %3u\016\016%c%c\017" |
| 180 " Bailout" | 184 #ifdef ENABLE_ADVANCED_GAS |
| 181 "\031" | 185 |
| 182 "\034" | 186 #endif |
| 183 " %3u" | 187 "\035" |
| 184 "\016\016" | |
| 185 " %c%c" | |
| 186 "\017" | |
| 187 "\035" | |
| 188 "\n\r", | 188 "\n\r", |
| 189 unit_depth_integer(mod), | 189 unit_depth_integer(mod), |
| 190 unit_depth_char1(), | 190 unit_depth_char1(), |
| 191 unit_depth_char2() | 191 unit_depth_char2()); |
| 192 ); | 192 #ifdef ENABLE_ADVANCED_GAS |
| 193 /* | 193 if( ltr != 0) |
| 194 textPointer += snprintf(&text[textPointer], 57,\ | 194 { |
| 195 "\024" | 195 textPointer += snprintf(&text[textPointer], 20,"\007 %2u\016\016ltr\017",ltr); |
| 196 " Bailout" | 196 } |
| 197 "\031" | 197 else |
| 198 "\034" | 198 { |
| 199 " %3u" | 199 text[textPointer++] = '\007'; |
| 200 "\016\016" | 200 text[textPointer++] = '\007'; |
| 201 "m" | 201 text[textPointer++] = '\007'; |
| 202 "\017" | 202 } |
| 203 " %2u" | 203 if( bar != 0) |
| 204 "\016\016" | 204 { |
| 205 "ltr" | 205 textPointer += snprintf(&text[textPointer], 20,"\007 %2u\016\016bar\017",bar); |
| 206 "\017" | 206 } |
| 207 " %3u" | 207 |
| 208 "\016\016" | 208 #endif |
| 209 "bar" | |
| 210 "\017" | |
| 211 "\035" | |
| 212 "\n\r", | |
| 213 mod, ltr, bar | |
| 214 ); | |
| 215 */ | |
| 216 } | 209 } |
| 217 else | 210 else |
| 218 { | 211 { |
| 219 if(first == 0) | 212 if(first == 0) |
| 220 strcpy(&text[textPointer++],"\177"); | 213 strcpy(&text[textPointer++],"\177"); |
| 251 " " | 244 " " |
| 252 "\034" | 245 "\034" |
| 253 "%c" | 246 "%c" |
| 254 "%3u" | 247 "%3u" |
| 255 "\016\016" | 248 "\016\016" |
| 256 " %c%c" | 249 "%c%c" |
| 257 "\017", | 250 "\017", |
| 258 color[0], | 251 color[0], |
| 259 unit_depth_integer(mod), | 252 unit_depth_integer(mod), |
| 260 unit_depth_char1(), | 253 unit_depth_char1(), |
| 261 unit_depth_char2() | 254 unit_depth_char2() |
| 266 { | 259 { |
| 267 textPointer += snprintf(&text[textPointer], 14,\ | 260 textPointer += snprintf(&text[textPointer], 14,\ |
| 268 "%c" | 261 "%c" |
| 269 "%3u" | 262 "%3u" |
| 270 "\016\016" | 263 "\016\016" |
| 271 " %c%c" | 264 "%c%c" |
| 272 "\017", | 265 "\017", |
| 273 color[1], | 266 color[1], |
| 274 unit_depth_integer(depthUp), | 267 unit_depth_integer(depthUp), |
| 275 unit_depth_char1(), | 268 unit_depth_char1(), |
| 276 unit_depth_char2() | 269 unit_depth_char2() |
| 281 text[textPointer++] = '\x7F'; | 274 text[textPointer++] = '\x7F'; |
| 282 text[textPointer++] = '\x7F'; | 275 text[textPointer++] = '\x7F'; |
| 283 text[textPointer++] = 3*25 + 20; | 276 text[textPointer++] = 3*25 + 20; |
| 284 } | 277 } |
| 285 /* liter */ | 278 /* liter */ |
| 286 /* | 279 #ifdef ENABLE_ADVANCED_GAS |
| 287 textPointer += snprintf(&text[textPointer], 12,\ | 280 if(ltr != 0) |
| 288 "%c" | 281 { |
| 289 " %2u" | 282 textPointer += snprintf(&text[textPointer], 12,\ |
| 290 "\016\016" | 283 "%c" |
| 291 "ltr" | 284 "\007\007%2u" |
| 292 "\017" | 285 "\016\016" |
| 293 , color[2],ltr | 286 "ltr" |
| 294 ); | 287 "\017" |
| 295 */ | 288 , color[2],ltr |
| 289 ); | |
| 290 } | |
| 291 else | |
| 292 { | |
| 293 text[textPointer++] = '\007'; | |
| 294 text[textPointer++] = '\007'; | |
| 295 text[textPointer++] = '\007'; | |
| 296 } | |
| 296 /* bar */ | 297 /* bar */ |
| 297 /* | 298 if(bar != 0) |
| 298 textPointer += snprintf(&text[textPointer], 12,\ | 299 { |
| 299 "%c" | 300 textPointer += snprintf(&text[textPointer], 12,\ |
| 300 " %3u" | 301 "%c" |
| 301 "\016\016" | 302 "\007%3u" |
| 302 "bar" | 303 "\016\016" |
| 303 "\017", | 304 "bar" |
| 304 color[3], bar | 305 "\017", |
| 305 ); | 306 color[3], bar); |
| 306 */ | 307 } |
| 308 #endif | |
| 307 text[textPointer++] = '\035'; | 309 text[textPointer++] = '\035'; |
| 308 text[textPointer++] = '\n'; | 310 text[textPointer++] = '\n'; |
| 309 text[textPointer++] = '\r'; | 311 text[textPointer++] = '\r'; |
| 310 text[textPointer] = 0; | 312 text[textPointer] = 0; |
| 311 } | 313 } |
