From ef7f9229a23e3ade8c6b5c33cbfaa684b80909b2 Mon Sep 17 00:00:00 2001 From: cnlohr Date: Sat, 24 Mar 2018 03:44:02 -0400 Subject: add option to log lightdata to separate file. --- src/survive_disambiguator.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/survive_disambiguator.c') diff --git a/src/survive_disambiguator.c b/src/survive_disambiguator.c index 39b23b6..cf89068 100644 --- a/src/survive_disambiguator.c +++ b/src/survive_disambiguator.c @@ -1,3 +1,16 @@ #include "survive.h" +#include +#include -void handle_lightcap(SurviveObject *so, LightcapElement *le) { so->ctx->lightcapfunction(so, le); } +//#define LOG_LIGHTDATA + +void handle_lightcap(SurviveObject *so, LightcapElement *le) +{ +#ifdef LOG_LIGHTDATA + static FILE * flog; + static double start = 0; + if( !flog ) { flog = fopen( "lightcap.txt", "wb" ); start = OGGetAbsoluteTime(); } + fprintf( flog, "%.6f %2d %4d %9d\n", OGGetAbsoluteTime()-start, le->sensor_id, le->length, le->timestamp ); +#endif + so->ctx->lightcapfunction(so, le); +} -- cgit v1.2.3