COMP=horla@192.168.2.77
DIR=test
#LIST=NI6251ext_01 NIturbo_08 PapouchSt_05
LIST= PapouchSt_01 PapouchSt_02 PapouchSt_03 PapouchSt_04 
PART=30%

analysis:
	make -iB getdata
	make -iB graph
	make -iB html
#	make -iB x11 &
	make -iB spectra &


spectra:
	ssh $(COMP) rm -f $(DIR)/* $(DIR)/*.*
	scp  makefile analyse.m $(LIST) $(COMP):$(DIR)/
	ssh $(COMP) make -C $(DIR) python
	scp $(COMP):$(DIR)/*.png .

python:
	matlab -nodesktop -nosplash -nojvm -r analyse

getdata:
	for i in $(LIST); do cp ../../../DAS/*/$$i .; done


#BASE1=set xrange [0:0.001];plot 'NIturbo_08' w lp, 'NI6251ext_01' w lp,'PapouchSt_05' w lp
#BASE2=set xrange [0:2e-5];plot 'NIturbo_08' w lp, 'NI6251ext_01' w lp,'PapouchSt_05' w lp
BASE1=set xrange [0:0.001];plot 'NIbasic_01' w lp, 'NIturbo_08' w lp,'PapouchSt_05' w lp, 'NI6251ext_01' w lp
BASE2=set xrange [0:2e-5];plot 'NIbasic_01' w lp, 'NIturbo_08' w lp,'PapouchSt_05' w lp, 'NI6251ext_01' w lp


graph:
	echo "set term png;$(BASE1)"|gnuplot > out.png 
	echo "set term png;$(BASE2)"|gnuplot > start.png 
	convert -resize 150 out.png icon.png


x11:
	echo "$(BASE2)"|gnuplot -persist

html:


	echo '<html><head><title>Plasma Position</title><img src="mirnov1.png"/><img src="mirnov2.png"/><img src="mirnov3.png"/><img src="mirnov4.png"/>' > index.html


#	echo '<html><head><title>Papouch analysis</title><h1>Papouch TEST</h1>	<h2>Nahled:</h2><img src="test.png"/>\
	<h2>Start:</h2><img src="start.png"/>' > index.html
#	echo '<table border=1>' >> index.html
#	echo '<tr>' >> index.html;for i in $(LIST); do echo '<th>'$$i'</th>'>>index.html ; done;echo '</tr>' >> index.html
#	echo '<tr>' >> index.html;for i in $(LIST); do echo '<td><a href="'$$i'_signal_full.png"><img src="'$$i'_signal_full.png" width="100%"/></a></td>'>>index.html ; done;echo '</tr>' >> index.html
#	echo '<tr>' >> index.html;for i in $(LIST); do echo '<td><a href="'$$i'_signal.png"><img src="'$$i'_signal.png" width="100%"/></a></td>'>>index.html ; done;echo '</tr>' >> index.html
#	echo '<tr>' >> index.html;for i in $(LIST); do echo '<td><a href="'$$i'_spectrogram.png"><img src="'$$i'_spectrogram.png" width="100%"/></a></td>'>>index.html ; done;echo '</tr>' >> index.html
#	echo '<tr>' >> index.html;for i in $(LIST); do echo '<td><a href="'$$i'_fft.png"><img src="'$$i'_fft.png" width="100%"/></a></td>'>>index.html ; done;echo '</tr>' >> index.html
#	echo '<table></body></html>' >> index.html

