From: Dobrica Pavlinusic Date: Fri, 9 Oct 2020 11:29:47 +0000 (+0200) Subject: added rijeka, fixed y axes, offset to 0 X-Git-Url: http://git.rot13.org/?p=zc;a=commitdiff_plain;h=814aad7e7fe8a801afb8eb5507dd53b237129dae;hp=92a481dfdc6cc42749724df901b38d79389d711c added rijeka, fixed y axes, offset to 0 --- diff --git a/gnuplot/offset.txt b/gnuplot/offset.txt new file mode 100644 index 0000000..14011f4 --- /dev/null +++ b/gnuplot/offset.txt @@ -0,0 +1,9 @@ +2008050077 0.14648342520240845 0.4419172473160959 +2008050078 -0.26737614827496664 0.6446930067879814 +2008050079 0.24542222714170497 -0.24910957521580634 +2008050080 -0.47140570481618244 -0.5059835244331682 +2008050082 -0.17280303359031676 0.3452259429693222 +2008050083 -0.5107064163389284 -0.5597924875818994 +2008050084 0.4263695485737859 -0.44388545593436884 +2008050086 -0.024463149181877572 0.47625536262989043 +2008050087 0.1922562310937565 0.09658566782050464 diff --git a/gnuplot/template.gnuplot b/gnuplot/template.gnuplot new file mode 100644 index 0000000..8768927 --- /dev/null +++ b/gnuplot/template.gnuplot @@ -0,0 +1,46 @@ +set terminal pngcairo color size 800,600 +#set output 'axes.png' +set output + +set xdata time +set timefmt "%Y-%m-%d %H:%M:%S" + +set datafile separator "," + +#unset border +#set key outside +#set key top left horizontal + +set grid +set key outside tmargin center + +#set ylabel "°" +#set ylabel "deg." +set ylabel "degrees" + +set format x "%H:%M" +#set format y "%.2f" +set yrange [ -0.1 : 0.1 ] + +#set arrow 1 from first,3 to last,3 nohead linestyle rgb "#ff0000" + +set multiplot +set size 1,0.5 +set origin 0, 0.5 + +#set linetype 1 lc 'green' +set linetype 99 lc 'red' + +#plot "axes.txt" using 1:2 with lines title "X angle", "" using 1:(3) with dots notitle, "" using 1:(-3) with dots notitle + +plot "axes.txt" using 1:2:(abs($2) < 3 ? 1: 99) with lines lc variable title "X angle" +# http://gnuplot-surprising.blogspot.com/2011/09/gnuplot-background-image.html +#'/home/dpavlin/zc/www/logo-color.png' binary filetype=png origin=(0,0) dx=0.5 dy=0.5 with rgbimage notitle + +set origin 0, 0 + +set xlabel "time" +#plot "axes.txt" using 1:3 with lines title "Y angle", "" using 1:(3) with dots notitle, "" using 1:(-3) with dots notitle + +plot "axes.txt" using 1:3:(abs($3) < 3 ? 2: 99) with lines lc variable title "Y angle" +#, "" using 1:(3) with dots notitle, "" using 1:(-3) with dots notitle diff --git a/gnuplot/template.sql b/gnuplot/template.sql new file mode 100644 index 0000000..87596cb --- /dev/null +++ b/gnuplot/template.sql @@ -0,0 +1,5 @@ +select to_char(time, 'YYYY-MM-DD HH24:MI:SS'), x_axis_angle, y_axis_angle +from zc +where pn = 2008050087 -- and time > now() - interval '24 hours' +order by time asc + diff --git a/www/cgi-bin/template.cgi b/www/cgi-bin/template.cgi new file mode 100755 index 0000000..d2d22d3 --- /dev/null +++ b/www/cgi-bin/template.cgi @@ -0,0 +1,17 @@ +#!/bin/sh + +dir=/home/dpavlin/zc/gnuplot/ + +echo "Content-type: image/svg+xml" +echo + +pn=$( basename $0 | sed 's/.cgi//' ) +offset=$( grep "^$pn" $dir/offset.txt ) +offset_x=$( echo $offset | cut -d' ' -f2 ) +offset_y=$( echo $offset | cut -d' ' -f3 ) + +cat $dir/template.sql | sed -e "s/2008050087/$pn/" -e "s/x_axis_angle/x_axis_angle + $offset_x/" -e "s/y_axis_angle/y_axis_angle + $offset_y/" | psql --username=dpavlin -A -F "," -t zc > /dev/shm/$pn.txt +cat $dir/template.gnuplot | sed -e "s,axes.txt,/dev/shm/$pn.txt," -e "s,^set terminal.*$,set terminal svg," -e "s,^set output.*$,set output," > /dev/shm/$pn.gnuplot +gnuplot /dev/shm/$pn.gnuplot + +#rm /dev/shm/axes.txt.$$ /dev/shm/axes.gnuplot.$$ diff --git a/www/index.html b/www/index.html index e6ab246..b59c7a3 100644 --- a/www/index.html +++ b/www/index.html @@ -11,6 +11,7 @@
  • Demo 1
  • Demo 2
  • Demo 3
  • +
  • Rijeka

  • diff --git a/www/rijeka.html b/www/rijeka.html new file mode 100644 index 0000000..247d3d8 --- /dev/null +++ b/www/rijeka.html @@ -0,0 +1,34 @@ + + + + Rijeka - senzori nagiba + + + +

    + + +

    201-000115

    + + +

    201-000116

    + + +

    201-000117

    + + +

    201-000118

    + + +

    201-000119

    + + +

    201-000120

    + + + + + +

    + +