aboutsummaryrefslogtreecommitdiff
path: root/src/survive_disambiguator.c
diff options
context:
space:
mode:
authorcnlohr <lohr85@gmail.com>2018-03-24 03:44:02 -0400
committercnlohr <lohr85@gmail.com>2018-03-24 03:44:02 -0400
commitef7f9229a23e3ade8c6b5c33cbfaa684b80909b2 (patch)
tree72543f95369d730b1d21333da883b254ef79e191 /src/survive_disambiguator.c
parent378b6e58d4cb0e9873062cfabefa271e43794bd6 (diff)
downloadlibsurvive-ef7f9229a23e3ade8c6b5c33cbfaa684b80909b2.tar.gz
libsurvive-ef7f9229a23e3ade8c6b5c33cbfaa684b80909b2.tar.bz2
add option to log lightdata to separate file.
Diffstat (limited to 'src/survive_disambiguator.c')
-rw-r--r--src/survive_disambiguator.c15
1 files changed, 14 insertions, 1 deletions
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 <os_generic.h>
+#include <stdio.h>
-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);
+}