comparison Discovery/Inc/simulation.h @ 983:7891160acde3 GasConsumption

Bugfix calculation of needed gas: Sometimes a gas was not calculated because of it's change depth calculation. Rootcause was a problem in the setup of the gas change list. The old function collecting milestones like time to first stop etc. has been removed because after the deco compression the complete profile is available. Instead of doing another way of profile calculation the existing profil is now evaluated and the time stamps / gas consumption derived from there.
author Ideenmodellierer
date Sun, 02 Mar 2025 21:43:08 +0100
parents 21949c88da90
children c317130aaafc
comparison
equal deleted inserted replaced
982:22d5b477c903 983:7891160acde3
28 #define SIMULATION_H 28 #define SIMULATION_H
29 29
30 #include "stm32f4xx_hal.h" 30 #include "stm32f4xx_hal.h"
31 #include "data_central.h" 31 #include "data_central.h"
32 32
33 #define GAS_CHANGE_LIST_ITEMS (10)
34 typedef struct
35 {
36 uint8_t depth;
37 uint8_t gasId;
38 } SgasChangeList;
39
33 typedef struct 40 typedef struct
34 { 41 {
35 uint8_t depthMeterFirstStop; 42 uint8_t depthMeterFirstStop;
36 uint8_t descentRateMeterPerMinute; 43 uint8_t descentRateMeterPerMinute;
37 uint8_t ascentRateMeterPerMinute; 44 uint8_t ascentRateMeterPerMinute;
50 void simulation_UpdateLifeData( _Bool checkOncePerSecond); 57 void simulation_UpdateLifeData( _Bool checkOncePerSecond);
51 void simulation_set_zero_time_descent(void); 58 void simulation_set_zero_time_descent(void);
52 59
53 uint16_t simulation_get_aim_depth(void); 60 uint16_t simulation_get_aim_depth(void);
54 _Bool simulation_get_heed_decostops(void); 61 _Bool simulation_get_heed_decostops(void);
55 SDecoinfo* simulation_decoplaner(uint16_t depth_meter, uint16_t intervall_time_minutes, uint16_t dive_time_minutes, uint8_t *gasChangeListDepthGas20x2); 62 SDecoinfo* simulation_decoplaner(uint16_t depth_meter, uint16_t intervall_time_minutes, uint16_t dive_time_minutes, SgasChangeList *pGasChangeList);
56 SDecoinfo* simulation_decoplaner_Bachelorarbeit_VPM(uint16_t depth_meter, uint16_t intervall_time_minutes, uint16_t dive_time_minutes, uint8_t *gasChangeListDepthGas20x2); 63 SDecoinfo* simulation_decoplaner_Bachelorarbeit_VPM(uint16_t depth_meter, uint16_t intervall_time_minutes, uint16_t dive_time_minutes, SgasChangeList *pGasChangeList);
57 void simulation_gas_consumption(uint16_t *outputConsumptionList, uint16_t depth_meter, uint16_t dive_time_minutes, SDecoinfo *decoInfoInput, uint8_t gasConsumTravelInput, uint8_t gasConsumDecoInput, const uint8_t *gasChangeListDepthGas20x2); 64 void simulation_gas_consumption(uint16_t *outputConsumptionList, uint16_t depth_meter, uint16_t dive_time_minutes, SDecoinfo *decoInfoInput, uint8_t gasConsumTravelInput, uint8_t gasConsumDecoInput, const SgasChangeList *pGasChangeList);
58 void simulation_helper_change_points(SSimDataSummary *outputSummary, uint16_t depth_meter, uint16_t dive_time_minutes, SDecoinfo *decoInfoInput, const uint8_t *gasChangeListDepthGas20x2); 65 void simulation_helper_change_points(SSimDataSummary *outputSummary, uint16_t depth_meter, uint16_t dive_time_minutes, SDecoinfo *decoInfoInput, const SgasChangeList *pGasChangeList);
59 66
60 67
61 void Sim_Descend (void); 68 void Sim_Descend (void);
62 void Sim_Ascend (void); 69 void Sim_Ascend (void);
63 void Sim_Divetime (void); 70 void Sim_Divetime (void);