]> ToastFreeware Gitweb - toast/airingbutler.git/blobdiff - Makefile
Makefile: remove errors from log.csv before trying to plot
[toast/airingbutler.git] / Makefile
index c98fda18d5c8d2961b99bfc91c544dd1724de369..c92250a70a109f48997bbf3c2453c55f4e6ed692 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ BOARD_TAG=uno
 
 HOSTNAME=$(shell hostname)
 ifeq ($(HOSTNAME),jadzia)
 
 HOSTNAME=$(shell hostname)
 ifeq ($(HOSTNAME),jadzia)
-MONITOR_PORT=/dev/ttyACM3
+MONITOR_PORT=/dev/ttyACM1
 else
 MONITOR_PORT=/dev/ttyACM0
 endif
 else
 MONITOR_PORT=/dev/ttyACM0
 endif
@@ -18,7 +18,11 @@ all: $(CURDIR)
 log.csv: log
        cp $< $@
        fromdos $@
 log.csv: log
        cp $< $@
        fromdos $@
-       sed -i -e '/Started/ d' -e '/Finished/ d ' -e 's/ O: /,/g' $@
+       sed -i -e '/Started/ d' -e '/Finished/ d' -e '/error: / d' -e '/-[0-9]/ d' -e 's/ O: /,/g' $@
        perl -ni -e 'BEGIN{$$i=0}; print if ($$_ !~ /CO2/ || $$i == 0); $$i++;' $@
 
        perl -ni -e 'BEGIN{$$i=0}; print if ($$_ !~ /CO2/ || $$i == 0); $$i++;' $@
 
-.PHONY: log.csv
+STARTDATE=$(shell date "+%F" --date @$$(stat --format "%Y" $$(find -name "log-*.gz" | sort | tail -n 1)))
+plot: log.csv
+       ./plot_mhz19.py --startdate $(STARTDATE) $<
+
+.PHONY: log.csv plot