#!/bin/bash
-echo "Using Daqopserver $DAQOPSERVER."
+echo "================================"
+echo "++ Using Daqopserver $DAQOPSERVER."
-echo "Run Reset"
+echo "++ Run Reset"
trbcmd reset
-
#Network configuration
+echo "++ DHCP"
./dhcp.sh
+echo "++ HUB"
./hubconfig.sh
#Front-end configuration
+echo "++ TRB"
./trbstart.sh
+echo "++ nXYTER"
./nxyter.sh
-./cts.sh
\ No newline at end of file
+echo "++ CTS"
+./cts.sh
+echo "================================"
+echo "done, hit Enter to exit"
TRBNUM=129
-../../../tools/command_client.pl -e etraxp$TRBNUM -c 'spi_trbv2_rl /home/hadaq/start_and_veto/thresholds_test'
+#../../../tools/command_client.pl -e etraxp$TRBNUM -c 'spi_trbv2_rl /home/hadaq/start_and_veto/thresholds_test'
+../../../tools/command_client.pl -e etraxp$TRBNUM -c 'spi_trbv2_rl /home/hadaq/start/run.cfg'
+
../../../tools/command_client.pl -e etraxp$TRBNUM -c "cd /home/hadaq/scripts/; ./trbv2_TDCs_configure.sh ${TRBNUM}"
-../../../tools/command_client.pl -e etraxp$TRBNUM -c 'rw_trbv2 --trb w 0 c2 007E0100; rw_trbv2 --trb w 0 c0 0a000000; rw_trbv2 --trb w 0 c3 00000100'
+
+# hi res for Start
+#../../../tools/command_client.pl -e etraxp$TRBNUM -c 'rw_trbv2 --trb w 0 c2 007E0100; rw_trbv2 --trb w 0 c0 0a000000; rw_trbv2 --trb w 0 c3 00000100'
+
+# low res for TOF | here is the change
+../../../tools/command_client.pl -e etraxp$TRBNUM -c 'rw_trbv2 --trb w 0 c2 007E0000; rw_trbv2 --trb w 0 c0 0a000000; rw_trbv2 --trb w 0 c3 00000100'
extraopts="--online"
[ ${sden} -eq 1 ] && extraopts="$sdopts"
-./evtbuilder_stop.sh
+$(dirname ${BASH_SOURCE})/evtbuilder_stop.sh
[ ! -e $tmpdir ] && mkdir -p $tmpdir
cd $tmpdir
# source ${HOME}/bin/trbnet_env.sh
-exec uxterm -bg khaki -geometry 120x20+900+45 -e "/home/hadaq/bin/daq_evtbuild -m 2 -o ${dest} -x ${pref} -I 1 --ebnum 1 -q 32 -S test -d file ${extraopts}; read; bash" &
+exec uxterm -bg khaki -geometry 120x19+945+35 -e "/home/hadaq/bin/daq_evtbuild -m 2 -o ${dest} -x ${pref} -I 1 --ebnum 1 -q 32 -S test -d file ${extraopts}; read; bash" &
# exec uxterm -bg khaki -geometry 120x20+900+45 -e "/home/hadaq/bin/daq_evtbuild -m 3 -o ${dest} -x ${pref} -I 1 --ebnum 1 -q 32 -S test -d file ${extraopts}; read ; bash" &
pid=$!
echo $pid > $tmpdir/.daq_evtbuild.pid
sleep 1
-exec uxterm -bg tan -geometry 120x20+900+345 -e "/home/hadaq/bin/daq_netmem -m 2 -i UDP:0.0.0.0:50008 -i UDP:0.0.0.0:50009 -q 32 -d 1 -S test ; " &
+exec uxterm -bg tan -geometry 120x19+945+320 -e "/home/hadaq/bin/daq_netmem -m 2 -i UDP:0.0.0.0:50008 -i UDP:0.0.0.0:50009 -q 32 -d 1 -S test ; " &
# exec uxterm -bg tan -geometry 120x20+900+345 -e "/home/hadaq/bin/daq_netmem -m 3 -i UDP:0.0.0.0:50000 -i UDP:0.0.0.0:50008 -i UDP:0.0.0.0:50009 -q 32 -d 1 -S test ; read ; bash " &
pid=$!
echo $pid > $tmpdir/.daq_netmem.pid