Mercurial > public > ostc4
annotate Discovery/Inc/simulation.h @ 1014:8c0134a287da GasConsumption
Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
is decremented. The event contains a 12 bit signed integer for the remaining scrubber duration, and two
flags for scrubber warning (0x2000, <= 30 minutes remaining) and scrubber error (0x4000, <= 0 minutes remaining).
(mikeller)
| author | heinrichsweikamp |
|---|---|
| date | Sun, 11 May 2025 16:18:20 +0200 |
| parents | c317130aaafc |
| children |
| rev | line source |
|---|---|
| 38 | 1 /////////////////////////////////////////////////////////////////////////////// |
| 2 /// -*- coding: UTF-8 -*- | |
| 3 /// | |
| 4 /// \file Discovery/Inc/simulation.h | |
| 5 /// \brief | |
| 6 /// \author Heinrichs Weikamp | |
| 7 /// \date 2018 | |
| 8 /// | |
| 9 /// $Id$ | |
| 10 /////////////////////////////////////////////////////////////////////////////// | |
| 11 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh | |
| 12 /// | |
| 13 /// This program is free software: you can redistribute it and/or modify | |
| 14 /// it under the terms of the GNU General Public License as published by | |
| 15 /// the Free Software Foundation, either version 3 of the License, or | |
| 16 /// (at your option) any later version. | |
| 17 /// | |
| 18 /// This program is distributed in the hope that it will be useful, | |
| 19 /// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 20 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 21 /// GNU General Public License for more details. | |
| 22 /// | |
| 23 /// You should have received a copy of the GNU General Public License | |
| 24 /// along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 25 ////////////////////////////////////////////////////////////////////////////// | |
| 26 | |
| 27 #ifndef SIMULATION_H | |
| 28 #define SIMULATION_H | |
| 29 | |
| 30 #include "stm32f4xx_hal.h" | |
| 31 #include "data_central.h" | |
| 32 | |
| 983 | 33 #define GAS_CHANGE_LIST_ITEMS (10) |
| 34 typedef struct | |
| 35 { | |
| 36 uint8_t depth; | |
| 37 uint8_t gasId; | |
| 38 } SgasChangeList; | |
| 39 | |
| 38 | 40 typedef struct |
| 41 { | |
| 42 uint8_t depthMeterFirstStop; | |
| 43 uint8_t descentRateMeterPerMinute; | |
| 44 uint8_t ascentRateMeterPerMinute; | |
| 45 uint16_t timeToBottom; | |
| 46 uint16_t timeAtBottom; | |
| 47 uint16_t timeToFirstStop; | |
| 48 uint16_t timeToSurface; | |
| 49 float ppO2AtBottom; | |
| 50 } SSimDataSummary; | |
| 51 | |
|
760
21949c88da90
Quit simualted dives after the dive time set in the SIM tab.
heinrichsweikamp
parents:
629
diff
changeset
|
52 void simulation_start(int aim_depth, uint16_t aim_time_minutes); |
| 38 | 53 void simulation_exit(void); |
| 54 | |
| 55 void simulation_set_heed_decostops(_Bool heed_decostops_while_ascending); | |
| 56 | |
| 57 void simulation_UpdateLifeData( _Bool checkOncePerSecond); | |
| 58 void simulation_set_zero_time_descent(void); | |
| 59 | |
| 60 uint16_t simulation_get_aim_depth(void); | |
| 61 _Bool simulation_get_heed_decostops(void); | |
| 983 | 62 SDecoinfo* simulation_decoplaner(uint16_t depth_meter, uint16_t intervall_time_minutes, uint16_t dive_time_minutes, SgasChangeList *pGasChangeList); |
| 63 SDecoinfo* simulation_decoplaner_Bachelorarbeit_VPM(uint16_t depth_meter, uint16_t intervall_time_minutes, uint16_t dive_time_minutes, SgasChangeList *pGasChangeList); | |
| 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); | |
| 65 void simulation_helper_change_points(SSimDataSummary *outputSummary, uint16_t depth_meter, uint16_t dive_time_minutes, SDecoinfo *decoInfoInput, const SgasChangeList *pGasChangeList); | |
| 989 | 66 void simulation_evaluate_profil(uint16_t *outputConsumptionList, |
| 67 SSimDataSummary *outputSummary, | |
| 68 uint16_t depth_meter, uint16_t dive_time_minutes,uint8_t gasConsumTravelInput, uint8_t gasConsumDecoInput, | |
| 69 SDecoinfo *decoInfoInput, | |
| 70 const SgasChangeList *pGasChangeList); | |
| 38 | 71 |
| 72 void Sim_Descend (void); | |
| 73 void Sim_Ascend (void); | |
| 74 void Sim_Divetime (void); | |
| 75 void Sim_Quit (void); | |
| 76 | |
|
629
55a9aa740f13
Added functionality to add ppo2 mV offset:
Ideenmodellierer
parents:
225
diff
changeset
|
77 void Sim_IncreasePPO(uint8_t sensorIdx); |
|
55a9aa740f13
Added functionality to add ppo2 mV offset:
Ideenmodellierer
parents:
225
diff
changeset
|
78 void Sim_DecreasePPO(uint8_t sensorIdx); |
|
55a9aa740f13
Added functionality to add ppo2 mV offset:
Ideenmodellierer
parents:
225
diff
changeset
|
79 |
| 38 | 80 |
| 81 #endif /* SIMULATION_H */ |
