Mercurial > public > ostc4
comparison Discovery/Src/data_exchange_main.c @ 899:2225c467f1e9 Evo_2_23
Added data path and visualization for position data:
The GNSS data exchange is now initialized and triggered on a cyclic basis (once a second). RTE verion has been increased because of interface change. For now only the position data is shown in a T7 surface views. The functionality may be switched on/off using the compile switch ENABLE_GNSS.
author | Ideenmodellierer |
---|---|
date | Mon, 30 Sep 2024 21:56:05 +0200 |
parents | c3dd461ca3f9 |
children | 46a21ff3f5ab |
comparison
equal
deleted
inserted
replaced
898:fac13aa6ba93 | 899:2225c467f1e9 |
---|---|
477 void DataEX_copy_to_deco(void) | 477 void DataEX_copy_to_deco(void) |
478 { | 478 { |
479 if(decoLock == DECO_CALC_running) | 479 if(decoLock == DECO_CALC_running) |
480 return; | 480 return; |
481 | 481 |
482 if(decoLock == DECO_CALC_init_as_is_start_of_dive) | 482 if(decoLock == DECO_CALC_init_as_is_start_of_dive) |
483 { | 483 { |
484 vpm_init(&stateUsedWrite->vpm, stateUsedWrite->diveSettings.vpm_conservatism, 0, 0); | 484 vpm_init(&stateUsedWrite->vpm, stateUsedWrite->diveSettings.vpm_conservatism, 0, 0); |
485 buehlmann_init(); | 485 buehlmann_init(); |
486 timer_init(); | 486 timer_init(); |
487 resetEvents(stateUsedWrite); | 487 resetEvents(stateUsedWrite); |
488 stateUsedWrite->diveSettings.internal__pressure_first_stop_ambient_bar_as_upper_limit_for_gf_low_otherwise_zero = 0; | 488 stateUsedWrite->diveSettings.internal__pressure_first_stop_ambient_bar_as_upper_limit_for_gf_low_otherwise_zero = 0; |
489 } | 489 } |
490 | 490 |
491 if(decoLock == DECO_CALC_FINSHED_Buehlmann) | 491 if(decoLock == DECO_CALC_FINSHED_Buehlmann) |
492 { | 492 { |
493 | 493 |
494 } | 494 } |
495 switch(decoLock) | 495 switch(decoLock) |
496 { | 496 { |
528 } | 528 } |
529 | 529 |
530 //Copy Inputdata from stateReal to stateDeco | 530 //Copy Inputdata from stateReal to stateDeco |
531 memcpy(&stateDeco.lifeData,&stateUsedWrite->lifeData,sizeof(SLifeData)); | 531 memcpy(&stateDeco.lifeData,&stateUsedWrite->lifeData,sizeof(SLifeData)); |
532 memcpy(&stateDeco.diveSettings,&stateUsedWrite->diveSettings,sizeof(SDiveSettings)); | 532 memcpy(&stateDeco.diveSettings,&stateUsedWrite->diveSettings,sizeof(SDiveSettings)); |
533 memcpy(&stateDeco.decolistVPM,&stateUsedWrite->decolistVPM,sizeof(SDecoinfo)); | |
533 | 534 |
534 stateDeco.vpm.deco_zone_reached = stateUsedWrite->vpm.deco_zone_reached; | 535 stateDeco.vpm.deco_zone_reached = stateUsedWrite->vpm.deco_zone_reached; |
535 // memcpy(&stateDeco.vpm,&pStateUsed->vpm,sizeof(SVpm)); | 536 // memcpy(&stateDeco.vpm,&pStateUsed->vpm,sizeof(SVpm)); |
536 for(int i = 0; i< 16; i++) | 537 for(int i = 0; i< 16; i++) |
537 { | 538 { |
538 stateDeco.vpm.max_crushing_pressure_he[i] = stateUsedWrite->vpm.max_crushing_pressure_he[i]; | 539 stateDeco.vpm.max_crushing_pressure_he[i] = stateUsedWrite->vpm.max_crushing_pressure_he[i]; |
539 stateDeco.vpm.max_crushing_pressure_n2[i] = stateUsedWrite->vpm.max_crushing_pressure_n2[i]; | 540 stateDeco.vpm.max_crushing_pressure_n2[i] = stateUsedWrite->vpm.max_crushing_pressure_n2[i]; |
540 stateDeco.vpm.adjusted_critical_radius_he[i] = stateUsedWrite->vpm.adjusted_critical_radius_he[i]; | 541 stateDeco.vpm.adjusted_critical_radius_he[i] = stateUsedWrite->vpm.adjusted_critical_radius_he[i]; |
541 stateDeco.vpm.adjusted_critical_radius_n2[i] = stateUsedWrite->vpm.adjusted_critical_radius_n2[i]; | 542 stateDeco.vpm.adjusted_critical_radius_n2[i] = stateUsedWrite->vpm.adjusted_critical_radius_n2[i]; |
542 } | 543 } |
543 decoLock = DECO_CALC_ready; | 544 decoLock = DECO_CALC_ready; |
544 } | 545 } |
545 | 546 |
546 | 547 |
547 static void DataEX_helper_copy_deviceData(SDeviceLine *lineWrite, const SDeviceLine *lineRead) | 548 static void DataEX_helper_copy_deviceData(SDeviceLine *lineWrite, const SDeviceLine *lineRead) |
548 { | 549 { |
1004 pStateReal->pressure_uTick_new = dataIn.data[dataIn.boolPressureData].pressure_uTick; | 1005 pStateReal->pressure_uTick_new = dataIn.data[dataIn.boolPressureData].pressure_uTick; |
1005 pStateReal->pressure_uTick_local_new = HAL_GetTick(); | 1006 pStateReal->pressure_uTick_local_new = HAL_GetTick(); |
1006 | 1007 |
1007 pStateReal->lifeData.dateBinaryFormat = dataIn.data[dataIn.boolTimeData].localtime_rtc_dr; | 1008 pStateReal->lifeData.dateBinaryFormat = dataIn.data[dataIn.boolTimeData].localtime_rtc_dr; |
1008 pStateReal->lifeData.timeBinaryFormat = dataIn.data[dataIn.boolTimeData].localtime_rtc_tr; | 1009 pStateReal->lifeData.timeBinaryFormat = dataIn.data[dataIn.boolTimeData].localtime_rtc_tr; |
1010 | |
1011 pStateReal->lifeData.gnssPosition.Latitude = dataIn.data[0].fLat; | |
1012 pStateReal->lifeData.gnssPosition.Longitude = dataIn.data[0].fLon; | |
1009 } | 1013 } |
1010 | 1014 |
1011 if(pStateReal->data_old__lost_connection_to_slave == 0) | 1015 if(pStateReal->data_old__lost_connection_to_slave == 0) |
1012 { | 1016 { |
1013 //Start of diveMode? | 1017 //Start of diveMode? |