#!/bin/bash
#
# automate TestDAQ, and other scripts...
# Mark Krasberg, May, 2004
#
# your classpath must be previously defined!
#
#
# stuff to do at init:
#
echo STARTING AUTOMATE at `date`

rm -f stf.log
rm testdaq.log
rm domhubapp.log

#rm $1/output/*

#echo automate: REMEMBER WE HAVE DISABLED TURNING THE PULSER OFF !! ERROR ERROR!!
#/usr/local/bin/turnpulseroff.py &
killall dtsx
killall rmiregistry
killall java
killall python
/usr/local/bin/off all

#
#
#

#
#
# Running stf
# the first parameter is the path to the workspace, and the
# second is the temperature of the doms
#
# uncomment this line to make it work
# stf.sh $1/work-stf -273


#
#
# now loop through the tests we want...
#
#
while [ 1 -gt 0 ]
do

# $1/bin/temp_pressure 0

  /usr/local/bin/increment_run_number.pl
#  python /home/kael/dom-testing/autogen-steering.py -p > $1/data/xml/PedestalPattern.xml
  $1/bin/testdaq $1/xml/PedestalPattern.xml $1/output `head /usr/local/etc/.domhub_name`_run`head /usr/local/etc/.run_number`_PedestalPatternNonSpecific -d localhost

  /usr/local/bin/increment_run_number.pl
#  python /home/kael/dom-testing/autogen-steering.py -g > $1/data/xml/GainVsHV.xml
  $1/bin/testdaq $1/xml/GainVsHV.xml $1/output `head /usr/local/etc/.domhub_name`_run`head /usr/local/etc/.run_number`_GainVsHVNonSpecific -d localhost

  /usr/local/bin/increment_run_number.pl
#  python /home/kael/dom-testing/autogen-steering.py -d > $1/data/xml/DarkNoise.xml
  $1/bin/testdaq $1/xml/DarkNoise.xml $1/output `head /usr/local/etc/.domhub_name`_run`head /usr/local/etc/.run_number`_DarkNoiseNonSpecific -d localhost

#  /usr/local/bin/increment_run_number.pl
#  /usr/local/bin/on all
#  /usr/local/bin/iceboot
#  python /home/kael/dom-testing/autogen-steering.py -d > $1/data/xml/DarkNoise.xml
#  $1/bin/testdaq $1/xml/DarkNoise.xml $1/output `head /usr/local/etc/.domhub_name`_run`head /usr/local/etc/.run_number`_DarkNoise -d localhost

#  /usr/local/bin/increment_run_number.pl
#  /usr/local/bin/on all
#  /usr/local/bin/iceboot
#  python /home/kael/dom-testing/autogen-steering.py -g > $1/data/xml/GainVsHV.xml
#  $1/bin/testdaq $1/xml/GainVsHV.xml $1/output `head /usr/local/etc/.domhub_name`_run`head /usr/local/etc/.run_number`_GainVsHV -d localhost

#  /usr/local/bin/increment_run_number.pl
#  /usr/local/bin/on all
#  /usr/local/bin/iceboot
#  python /home/kael/dom-testing/autogen-steering.py -p > $1/data/xml/PedestalPatternLong.xml
#  /usr/local/bin/find_and_replace.pl "executionTime value='500'" "executionTime value='7200'" $1/data/xml/PedestalPatternLong.xml quiet
#  $1/bin/testdaq $1/xml/PedestalPatternLong.xml $1/output `head /usr/local/etc/.domhub_name`_run`head /usr/local/etc/.run_number`_PedestalPatternLong -d localhost

sleep 10
done



