Mercurial > public > ostc4
comparison Discovery/Src/tMenuEditHardware.c @ 754:ec7b62983a8c
Only show autodetection in sensor menu if external interface is present:
In the previous version the autodetection was visible even if not supported by hardware. The autodetection will now only be shown if the ADC is available (new HW revision). A future improvment could be to make the decision based on a special HW number which indicates a OSTC4 version with external pin connector.
author | Ideenmodellierer |
---|---|
date | Tue, 07 Mar 2023 19:55:13 +0100 |
parents | be25ab2d902c |
children | 45b8f3c2acce |
comparison
equal
deleted
inserted
replaced
753:4a28402e4aca | 754:ec7b62983a8c |
---|---|
423 write_label_var( 480, 800, ME_Y_LINE4, &FontT48, strSensorId); | 423 write_label_var( 480, 800, ME_Y_LINE4, &FontT48, strSensorId); |
424 } | 424 } |
425 else | 425 else |
426 { | 426 { |
427 if((pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG) || (pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_ANADIG) | 427 if((pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG) || (pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_ANADIG) |
428 #ifdef ENABLE_CO2_SUPPORT | 428 #ifdef ENABLE_SENTINEL_MODE |
429 || (pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_SENTINEL) | 429 || (pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_SENTINEL) |
430 #endif | 430 #endif |
431 ) | 431 ) |
432 { | 432 { |
433 strSensorId[0] = TXT_2BYTE; | 433 strSensorId[0] = TXT_2BYTE; |
437 snprintf(strSensorId, 20,"%d%%", O2_calib_gas); | 437 snprintf(strSensorId, 20,"%d%%", O2_calib_gas); |
438 write_label_var( 480, 800, ME_Y_LINE4, &FontT48, strSensorId); | 438 write_label_var( 480, 800, ME_Y_LINE4, &FontT48, strSensorId); |
439 } | 439 } |
440 } | 440 } |
441 | 441 |
442 strSensorId[0] = TXT_2BYTE; | 442 if(DataEX_external_ADC_Present()) |
443 strSensorId[1] = TXT2BYTE_SensorDetect; | 443 { |
444 strSensorId[2] = 0; | 444 strSensorId[0] = TXT_2BYTE; |
445 | 445 strSensorId[1] = TXT2BYTE_SensorDetect; |
446 write_label_var( 30, 340, ME_Y_LINE6, &FontT48, strSensorId); | 446 strSensorId[2] = 0; |
447 | |
448 write_label_var( 30, 340, ME_Y_LINE6, &FontT48, strSensorId); | |
449 } | |
447 | 450 |
448 if(haveSensorInfo == 1) | 451 if(haveSensorInfo == 1) |
449 { | 452 { |
450 strSensorId[0] = TXT_Sensor; | 453 strSensorId[0] = TXT_Sensor; |
451 strSensorId[1] = ' '; | 454 strSensorId[1] = ' '; |
543 if(haveSensorInfo != 0) | 546 if(haveSensorInfo != 0) |
544 { | 547 { |
545 write_field_button(StMHARD3_Sensor_Info, 30, 800, ME_Y_LINE5, &FontT48, ""); | 548 write_field_button(StMHARD3_Sensor_Info, 30, 800, ME_Y_LINE5, &FontT48, ""); |
546 } | 549 } |
547 | 550 |
548 text[0] = TXT_2BYTE; | 551 if(DataEX_external_ADC_Present()) |
549 text[1] = TXT2BYTE_SensorDetect; | 552 { |
550 text[2] = 0; | 553 text[0] = TXT_2BYTE; |
551 | 554 text[1] = TXT2BYTE_SensorDetect; |
552 write_label_var( 30, 340, ME_Y_LINE6, &FontT48, text); | 555 text[2] = 0; |
553 | 556 |
554 write_field_button(StMHARD3_Sensor_Detect, 30, 800, ME_Y_LINE6, &FontT48, text); | 557 write_label_var( 30, 340, ME_Y_LINE6, &FontT48, text); |
558 | |
559 write_field_button(StMHARD3_Sensor_Detect, 30, 800, ME_Y_LINE6, &FontT48, text); | |
560 } | |
555 | 561 |
556 if((pSettings->ext_sensor_map[0] >= SENSOR_OPTIC) && (pSettings->ext_sensor_map[0] < SENSOR_TYPE_O2_END)) | 562 if((pSettings->ext_sensor_map[0] >= SENSOR_OPTIC) && (pSettings->ext_sensor_map[0] < SENSOR_TYPE_O2_END)) |
557 { | 563 { |
558 setEvent(StMHARD3_O2_Sensor1, (uint32_t)OnAction_Sensor1); | 564 setEvent(StMHARD3_O2_Sensor1, (uint32_t)OnAction_Sensor1); |
559 } | 565 } |
578 if(haveSensorInfo != 0) | 584 if(haveSensorInfo != 0) |
579 { | 585 { |
580 setEvent(StMHARD3_Sensor_Info, (uint32_t)OnAction_Sensor_Info); | 586 setEvent(StMHARD3_Sensor_Info, (uint32_t)OnAction_Sensor_Info); |
581 } | 587 } |
582 | 588 |
583 setEvent(StMHARD3_Sensor_Detect, (uint32_t)OnAction_Sensor_Detect); | 589 if(DataEX_external_ADC_Present()) |
590 { | |
591 setEvent(StMHARD3_Sensor_Detect, (uint32_t)OnAction_Sensor_Detect); | |
592 } | |
584 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); | 593 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); |
585 } | 594 } |
586 | 595 |
587 | 596 |
588 uint8_t OnAction_Sensor1(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | 597 uint8_t OnAction_Sensor1(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) |