comparison Discovery/Src/tMenuEditHardware.c @ 689:4dd487b407f7 Betatest

Added Sentinel as O2 sensor source: The Sentinel rebrather may now be selected as input for sensor data (only if compile switch is activated)
author Ideenmodellierer
date Fri, 05 Aug 2022 15:15:01 +0200
parents d7c5d592076b
children 2f457024049b
comparison
equal deleted inserted replaced
688:8c92f7743e14 689:4dd487b407f7
334 write_label_var( 30, 340, ME_Y_LINE6, &FontT48, text); 334 write_label_var( 30, 340, ME_Y_LINE6, &FontT48, text);
335 text[0] = TXT_2BYTE; 335 text[0] = TXT_2BYTE;
336 switch(settingsGetPointer()->ppo2sensors_source) 336 switch(settingsGetPointer()->ppo2sensors_source)
337 { 337 {
338 default: 338 default:
339 case O2_SENSOR_SOURCE_OPTIC: text[1] = TXT2BYTE_O2IFOptic; 339 case O2_SENSOR_SOURCE_OPTIC: text[1] = TXT2BYTE_O2IFOptic;
340 text[2] = 0;
340 break; 341 break;
341 case O2_SENSOR_SOURCE_ANALOG: text[1] = TXT2BYTE_O2IFAnalog; 342 case O2_SENSOR_SOURCE_ANALOG: text[1] = TXT2BYTE_O2IFAnalog;
343 text[2] = 0;
344 break;
345 #ifdef ENABLE_SENTINEL_MODE
346 case O2_SENSOR_SOURCE_SENTINEL: snprintf(text, 10,"Sentinel");
347 break;
348 #endif
342 } 349 }
343 text[2] = 0; 350
344 write_label_var( 400, 800, ME_Y_LINE6, &FontT48, text); 351 write_label_var( 400, 800, ME_Y_LINE6, &FontT48, text);
345 } 352 }
346 tMenuEdit_refresh_field(StMHARD3_O2_Sensor1); 353 tMenuEdit_refresh_field(StMHARD3_O2_Sensor1);
347 tMenuEdit_refresh_field(StMHARD3_O2_Sensor2); 354 tMenuEdit_refresh_field(StMHARD3_O2_Sensor2);
348 tMenuEdit_refresh_field(StMHARD3_O2_Sensor3); 355 tMenuEdit_refresh_field(StMHARD3_O2_Sensor3);
376 383
377 write_field_on_off(StMHARD3_O2_Sensor1, 30, 95, ME_Y_LINE1, &FontT48, "", sensorActive[0]); 384 write_field_on_off(StMHARD3_O2_Sensor1, 30, 95, ME_Y_LINE1, &FontT48, "", sensorActive[0]);
378 write_field_on_off(StMHARD3_O2_Sensor2, 30, 95, ME_Y_LINE2, &FontT48, "", sensorActive[1]); 385 write_field_on_off(StMHARD3_O2_Sensor2, 30, 95, ME_Y_LINE2, &FontT48, "", sensorActive[1]);
379 write_field_on_off(StMHARD3_O2_Sensor3, 30, 95, ME_Y_LINE3, &FontT48, "", sensorActive[2]); 386 write_field_on_off(StMHARD3_O2_Sensor3, 30, 95, ME_Y_LINE3, &FontT48, "", sensorActive[2]);
380 387
381 if(settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG) 388 if((settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG)
389 #ifdef ENABLE_SENTINEL_MODE
390 || (settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_SENTINEL)
391 #endif
392 )
382 { 393 {
383 write_label_fix( 30, 800, ME_Y_LINE4, &FontT48, TXT2BYTE_O2Calib); 394 write_label_fix( 30, 800, ME_Y_LINE4, &FontT48, TXT2BYTE_O2Calib);
384 write_label_var( 400, 800, ME_Y_LINE4, &FontT48, "\016\016 %\017"); 395 write_label_var( 400, 800, ME_Y_LINE4, &FontT48, "\016\016 %\017");
385 396
386 write_field_toggle(StMHARD3_O2_Calibrate, 400, 800, ME_Y_LINE4, &FontT48, "", 21, 98); 397 write_field_toggle(StMHARD3_O2_Calibrate, 400, 800, ME_Y_LINE4, &FontT48, "", 21, 98);
397 } 408 }
398 409
399 setEvent(StMHARD3_O2_Sensor1, (uint32_t)OnAction_Sensor1); 410 setEvent(StMHARD3_O2_Sensor1, (uint32_t)OnAction_Sensor1);
400 setEvent(StMHARD3_O2_Sensor2, (uint32_t)OnAction_Sensor2); 411 setEvent(StMHARD3_O2_Sensor2, (uint32_t)OnAction_Sensor2);
401 setEvent(StMHARD3_O2_Sensor3, (uint32_t)OnAction_Sensor3); 412 setEvent(StMHARD3_O2_Sensor3, (uint32_t)OnAction_Sensor3);
402 if(settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG) 413 if((settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG)
414 #ifdef ENABLE_SENTINEL_MODE
415 || (settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_SENTINEL)
416 #endif
417 )
403 { 418 {
404 setEvent(StMHARD3_O2_Calibrate, (uint32_t)OnAction_O2_Calibrate); 419 setEvent(StMHARD3_O2_Calibrate, (uint32_t)OnAction_O2_Calibrate);
405 } 420 }
406 setEvent(StMHARD3_O2_Fallback, (uint32_t)OnAction_O2_Fallback); 421 setEvent(StMHARD3_O2_Fallback, (uint32_t)OnAction_O2_Fallback);
407 if(DataEX_external_ADC_Present()) 422 if(DataEX_external_ADC_Present())
535 } 550 }
536 uint8_t OnAction_O2_Source (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) 551 uint8_t OnAction_O2_Source (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
537 { 552 {
538 uint8_t source = settingsGetPointer()->ppo2sensors_source; 553 uint8_t source = settingsGetPointer()->ppo2sensors_source;
539 554
540 if(source == O2_SENSOR_SOURCE_OPTIC) 555 source++;
541 { 556 if(source == O2_SENSOR_SOURCE_MAX)
542 source = O2_SENSOR_SOURCE_ANALOG;
543 }
544 else
545 { 557 {
546 source = O2_SENSOR_SOURCE_OPTIC; 558 source = O2_SENSOR_SOURCE_OPTIC;
547 } 559 }
548 560
549 settingsGetPointer()->ppo2sensors_source = source; 561 settingsGetPointer()->ppo2sensors_source = source;