Mercurial > public > ostc4
diff Discovery/Inc/logbook.h @ 270:2e58a4094770 write-from-sim
feature, debug: make simulator write a logbook entry
When compiling the code with -DSIM_WRITES_LOGBOOK, the simulator writes
to the logbook. This is for debug purpose only. This commit does *not*
define this SIM_WRITES_LOGBOOK, so when compiled, things are functionally
unchanged.
Caveat 1: a simulator generated log cannot be advanced with +5 min. It needs
to run in real time.
Caveat 2: The generated log is currently not "complete". For example, CCR
setpoint switches are not logged. There are likely more small events not
logged. This means that a sim generated log is not a full replacement for
real dive testing.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
author | Jan Mulder <jlmulder@xs4all.nl> |
---|---|
date | Wed, 24 Apr 2019 17:10:51 +0200 |
parents | 6e78137952af |
children | 928a14568689 |
line wrap: on
line diff
--- a/Discovery/Inc/logbook.h Tue Apr 23 21:03:24 2019 +0200 +++ b/Discovery/Inc/logbook.h Wed Apr 24 17:10:51 2019 +0200 @@ -199,7 +199,7 @@ int8_t percentageHe; } SManualGas; -void logbook_writeSample(SDiveState *state); +void logbook_writeSample(const SDiveState *state); void logbook_initNewdiveProfile(const SDiveState* pInfo, SSettings* pSettings); void logbook_EndDive(void); @@ -211,7 +211,7 @@ uint8_t logbook_getHeader(uint8_t StepBackwards,SLogbookHeader* pLogbookHeader); uint16_t logbook_readSampleData(uint8_t StepBackwards, uint16_t length,uint16_t* depth, uint8_t* gasid, int16_t* temperature, uint16_t* ppo2, uint16_t* setpoint, uint16_t* sensor1, uint16_t* sensor2, uint16_t* sensor3, uint16_t* cns, uint8_t* bailout, uint16_t* decostopDepth); void logbook_test(void); -void logbook_InitAndWrite(void); +void logbook_InitAndWrite(const SDiveState* pStateReal); void logbook_recover_brokenlog(uint8_t headerId); uint16_t logbook_lastDive_diveNumber(void);