From c7b43782cea8c203179028b1e611ae4889f260dd Mon Sep 17 00:00:00 2001 From: Phil Hord Date: Mon, 25 Nov 2013 18:23:10 -0500 Subject: [PATCH] datalog: add a tip showing gnuplot usage Add a comment to the datalog output showing how it can be viewed with gnuplot. It would be trivial to add this as a .plot script, but it's even easier in the datalog output. --- simulator/data_recorder.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/simulator/data_recorder.c b/simulator/data_recorder.c index 263ba4a..461fd7a 100644 --- a/simulator/data_recorder.c +++ b/simulator/data_recorder.c @@ -36,6 +36,11 @@ void recorder_init(const char* filename) { time_t t = time(NULL); fprintf(file, "# Teacup_Firmware simulator v1.0\n"); fprintf(file, "# Recorded %s\n", asctime(localtime(&t))); + fprintf(file, "#\n# Tips:\n"); + fprintf(file, "# * Plot the actual points traveled with gnuplot\n"); + fprintf(file, "# gnuplot --persist -e \"set pointsize 0.01; plot '%s' u 2:3:1 with points\"\n", filename); + fprintf(file, "#\n"); + fflush(file); on_exit(recorder_close, NULL); }