From 91d3a5979ae30bd66ad81c6af7b9ab88c031d61f Mon Sep 17 00:00:00 2001 From: hadaq Date: Sun, 4 Feb 2024 13:58:01 +0100 Subject: [PATCH] update control gui scripts --- control/gui/daq/10_Start_DAQ | 4 ++++ control/gui/expert/Powercycle_CTS | 6 ++++-- control/gui/expert/Stop_Speech_Output | 2 -- control/gui/power/Ecal_RPC | 5 ++++- control/gui/power/TOF_MdcHub | 3 +++ control/gui/power/Triggerbox_Beam | 6 ++++-- control/gui/reboot/10_Quite-A-Lot | 12 +++++++++--- control/gui/reboot/30_Ecal | 5 ++++- control/gui/reboot/30_Extra_Boards | 3 ++- control/gui/reboot/30_Hubs | 3 ++- control/gui/reboot/30_MDC_Hub | 2 ++ control/gui/reboot/30_MDC_OEP | 2 ++ control/gui/reboot/30_RICH | 6 ++++-- control/gui/reboot/30_RPC | 8 ++++++-- control/gui/reboot/30_Start | 3 ++- control/gui/reboot/30_TOF_Wall | 4 +++- control/gui/reboot/90_Reprogram_CTS | 5 +++++ control/mdcLVgui/S0/200x | 5 +++-- 18 files changed, 63 insertions(+), 21 deletions(-) diff --git a/control/gui/daq/10_Start_DAQ b/control/gui/daq/10_Start_DAQ index 6c51976..e62959d 100755 --- a/control/gui/daq/10_Start_DAQ +++ b/control/gui/daq/10_Start_DAQ @@ -1,5 +1,9 @@ #!/bin/bash +perl -e '$cmd = q|LANG=C zenity --question --title "Automatic Restart of DAQ?" --text "During the cosmic beam time an additional question is asked:\nDo you want to enable automatic restart of DAQ if a failure happens?"|; $r=system($cmd); print "r: $r\n"; if($r==0) {$answer="yes"} else {$answer="no"}; $c2=qq!echo $answer | ssh hadesp33 "cat >/tmp/enable_automatic_restart"!; $r=qx($c2); print $r ' + + + export myvar=$(/home/hadaq/trbsoft/hadesdaq/utils/doyoureallywant.pl "restart the DAQ") if [ $myvar == "256" ]; then exit; fi diff --git a/control/gui/expert/Powercycle_CTS b/control/gui/expert/Powercycle_CTS index 6437753..8dd6c1c 100755 --- a/control/gui/expert/Powercycle_CTS +++ b/control/gui/expert/Powercycle_CTS @@ -3,10 +3,12 @@ export myvar=$(doyoureallywant.pl "to powercycle the Triggerbox and Beam Monitoring?") if [ $myvar == "256" ]; then exit; fi - xterm -e bash --login -c ' ssh hadaq@lxhadesdaqp " - source /home/hadaq/.bash_profile + source /home/hadaq/.bash_profile + echo Switch off beam abort + ssh hadeswrp01 \"echo \"W3000000010\" >/dev/ttyUSB0\" + sleep .1 echo \"Starting a power cycle of CTS...\" cd /home/hadaq/hadesdaq/utils; bash Powercycle_CTS.sh; diff --git a/control/gui/expert/Stop_Speech_Output b/control/gui/expert/Stop_Speech_Output index 2b10204..7db2caa 100755 --- a/control/gui/expert/Stop_Speech_Output +++ b/control/gui/expert/Stop_Speech_Output @@ -1,6 +1,4 @@ #!/bin/bash ssh hadaq@hadesp33 "killall -USR1 speakdaemon.pl" -ssh hadaq@hadesp57 "killall -USR1 speakdaemon.pl; pkill -f espeak" - diff --git a/control/gui/power/Ecal_RPC b/control/gui/power/Ecal_RPC index 4e8ccf4..bfcbaee 100755 --- a/control/gui/power/Ecal_RPC +++ b/control/gui/power/Ecal_RPC @@ -5,7 +5,10 @@ if [ $myvar == "256" ]; then exit; fi xterm -e bash --login -c ' ssh hadaq@lxhadesdaqp " - source /home/hadaq/.bash_profile + source /home/hadaq/.bash_profile + echo Switch off beam abort + ssh hadeswrp01 \"echo \"W3000000010\" >/dev/ttyUSB0\" + sleep .1 echo \"Starting a RPC/ECAL power cycle...\" cd /home/hadaq/hadesdaq/utils; PERLLIB=/home/hadaq/EPICS/EPICS-3.15.6/base/lib/perl ./ECAL_Powercycle.pl; diff --git a/control/gui/power/TOF_MdcHub b/control/gui/power/TOF_MdcHub index 9d5f430..544ef6a 100755 --- a/control/gui/power/TOF_MdcHub +++ b/control/gui/power/TOF_MdcHub @@ -6,6 +6,9 @@ if [ $myvar == "256" ]; then exit; fi xterm -e bash --login -c ' ssh hadaq@lxhadesdaqp " source /home/hadaq/.bash_profile + echo Switch off beam abort + ssh hadeswrp01 \"echo \"W3000000010\" >/dev/ttyUSB0\" + sleep .1 echo \"Starting a MDC/TOF/Central power cycle...\" cd /home/hadaq/hadesdaq/utils; PERLLIB=/home/hadaq/EPICS/EPICS-3.15.6/base/lib/perl ./MdcTofCentral_Powercycle.pl; diff --git a/control/gui/power/Triggerbox_Beam b/control/gui/power/Triggerbox_Beam index d67e290..bf9779f 100755 --- a/control/gui/power/Triggerbox_Beam +++ b/control/gui/power/Triggerbox_Beam @@ -3,10 +3,12 @@ export myvar=$(doyoureallywant.pl "to powercycle the Triggerbox and Beam Monitoring?") if [ $myvar == "256" ]; then exit; fi - xterm -e bash --login -c ' ssh hadaq@lxhadesdaqp " - source /home/hadaq/.bash_profile + source /home/hadaq/.bash_profile + echo Switch off beam abort + ssh hadeswrp01 \"echo \"W3000000010\" >/dev/ttyUSB0\" + sleep .1 echo \"Starting a power cycle of Triggerbox and Beam Monitoring...\" cd /home/hadaq/hadesdaq/utils; bash Powercycle_Trigger.sh; diff --git a/control/gui/reboot/10_Quite-A-Lot b/control/gui/reboot/10_Quite-A-Lot index 30e60bd..45ee7e7 100755 --- a/control/gui/reboot/10_Quite-A-Lot +++ b/control/gui/reboot/10_Quite-A-Lot @@ -1,13 +1,16 @@ #!/bin/bash -export myvar=$(/home/hadaq/trbsoft/hadesdaq/utils/doyoureallywant.pl "reboot many boards ") +export myvar=$(/home/hadaq/trbsoft/hadesdaq/utils/doyoureallywant.pl "reboot TOF, FW, RICH, RPC, ECAL and Start boards ") if [ $myvar == "256" ]; then exit; fi -notifyall.sh "DAQ" " The boards of TOF and FW are going to be rebooted." "STARTUP" & - +notifyall.sh "DAQ" " The boards of TOF, FW, RICH, RPC, ECAL and Start are going to be rebooted." "STARTUP" & xterm -geometry 80x24 -bg orange -fg black -e bash --login -c ' ssh hadaq@lxhadesdaqp " + source /home/hadaq/.bash_profile + echo Switch off trigger + timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400 + cd ~/trbsoft/trbnettools/binlocal echo \"This does not include MDC, Extra Boards, Hubs, CTS!\" @@ -32,6 +35,9 @@ for TRB3_SERVER in trb3sc136 trb3sc158 trb3sc144 trb3sc139 trb3sc163 trb3sc153 echo RPC + echo Switch off beam abort + ssh hadeswrp01 \"echo \"W3000000010\" >/dev/ttyUSB0\" + sleep .1 for TRB3_SERVER in trb3sc317 trb3sc319 trb3sc320 trb3sc315 trb3sc318 trb3sc316; do ping \$TRB3_SERVER -c 1 -w 1 >/dev/null 2>&1 || echo \"ERROR contacting \$TRB3_SERVER\" diff --git a/control/gui/reboot/30_Ecal b/control/gui/reboot/30_Ecal index e0e6eff..2fb27fa 100755 --- a/control/gui/reboot/30_Ecal +++ b/control/gui/reboot/30_Ecal @@ -5,10 +5,13 @@ if [ $myvar == "256" ]; then exit; fi notifyall.sh "DAQ" " The ECal boards are going to be rebooted." "STARTUP" & +timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400 # Switch off trigger xterm -geometry 80x24 -bg orange -fg black -e bash --login -c ' ssh hadaq@lxhadesdaqp " source /home/hadaq/.bash_profile + echo Switch off trigger + timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400 # trbcmd reload 0xfe71 trbcmd reload 0x120 @@ -18,7 +21,7 @@ for TRB3_SERVER in trb3sc134 trb3sc009 trb3sc130 trb3sc128 trb3sc131 trb3sc129 do ping \$TRB3_SERVER -c 1 -w 1 >/dev/null 2>&1 || echo \"ERROR contacting \$TRB3_SERVER\" TRB3_SERVER=\$TRB3_SERVER ./trbcmd reload 0xffff - sleep .3 + sleep .6 done echo \"Done - Check for Error messages above, then do a DAQ restart!\" diff --git a/control/gui/reboot/30_Extra_Boards b/control/gui/reboot/30_Extra_Boards index adfa6d5..901c072 100755 --- a/control/gui/reboot/30_Extra_Boards +++ b/control/gui/reboot/30_Extra_Boards @@ -5,10 +5,11 @@ if [ $myvar == "256" ]; then exit; fi notifyall.sh "DAQ" " Auxiliary boards are going to be rebooted." "STARTUP" & - xterm -geometry 80x24 -bg orange -fg black -e bash --login -c ' ssh hadaq@lxhadesdaqp " source /home/hadaq/.bash_profile + echo Switch off trigger + timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400 # trbcmd reload 0x8d00 trbcmd reload 0x0010 diff --git a/control/gui/reboot/30_Hubs b/control/gui/reboot/30_Hubs index 847180b..002274a 100755 --- a/control/gui/reboot/30_Hubs +++ b/control/gui/reboot/30_Hubs @@ -5,10 +5,11 @@ if [ $myvar == "256" ]; then exit; fi notifyall.sh "DAQ" " The central Hubs are going to be rebooted." "STARTUP" & - xterm -geometry 80x24 -bg orange -fg black -e bash --login -c ' ssh hadaq@lxhadesdaqp " source /home/hadaq/.bash_profile + echo Switch off trigger + timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400 # trbcmd reload 0xfffe trbcmd reload 0x8011 diff --git a/control/gui/reboot/30_MDC_Hub b/control/gui/reboot/30_MDC_Hub index 88283b2..47c9bdc 100755 --- a/control/gui/reboot/30_MDC_Hub +++ b/control/gui/reboot/30_MDC_Hub @@ -11,6 +11,8 @@ notifyall.sh "DAQ" " MDC-Hubs are going to be rebooted." "STARTUP" & xterm -geometry 80x24 -bg orange -fg black -e bash --login -c ' export DAQOPSERVER=hadesp31 + echo Switch off trigger + timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400 trbcmd reset trbcmd reload 0xfe11 trbcmd reload 0xfe15 diff --git a/control/gui/reboot/30_MDC_OEP b/control/gui/reboot/30_MDC_OEP index 1ab4e9e..4cc9d6c 100755 --- a/control/gui/reboot/30_MDC_OEP +++ b/control/gui/reboot/30_MDC_OEP @@ -6,6 +6,8 @@ if [ $myvar == "256" ]; then exit; fi notifyall.sh "DAQ" " OEPs are going to be rebooted." "STARTUP" & xterm -geometry 80x24 -bg orange -fg black -e bash --login -c ' + echo Switch off trigger + timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400 ~/bin/rebootoep_x11.sh sleep 2 ' diff --git a/control/gui/reboot/30_RICH b/control/gui/reboot/30_RICH index fd0ec63..aee7be0 100755 --- a/control/gui/reboot/30_RICH +++ b/control/gui/reboot/30_RICH @@ -5,9 +5,11 @@ if [ $myvar == "256" ]; then exit; fi notifyall.sh "DAQ" " The RICH boards are going to be rebooted." "STARTUP" & - xterm -geometry 80x24 -bg orange -fg black -e bash --login -c ' ssh hadaq@lxhadesdaqp " + source /home/hadaq/.bash_profile + echo Switch off trigger + timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400 cd ~/trbsoft/trbnettools/binlocal @@ -18,7 +20,7 @@ for TRB3_SERVER in trb3sc136 trb3sc158 trb3sc144 trb3sc139 trb3sc163 trb3sc153 ping \$TRB3_SERVER -c 1 -w 1 >/dev/null 2>&1 || echo \"ERROR contacting \$TRB3_SERVER\" TRB3_SERVER=\$TRB3_SERVER ./trbcmd reload 0xfe51 #to prevent a race condition between reset issued by combiner and Dirich not rebooting afterwards TRB3_SERVER=\$TRB3_SERVER ./trbcmd reload 0xffff - sleep .3 + sleep .6 done diff --git a/control/gui/reboot/30_RPC b/control/gui/reboot/30_RPC index 79a7318..d6480ca 100755 --- a/control/gui/reboot/30_RPC +++ b/control/gui/reboot/30_RPC @@ -5,17 +5,21 @@ if [ $myvar == "256" ]; then exit; fi notifyall.sh "DAQ" " The RPC boards are going to be rebooted." "STARTUP" & - xterm -geometry 80x24 -bg orange -fg black -e bash --login -c ' ssh hadaq@lxhadesdaqp " source /home/hadaq/.bash_profile + echo Switch off trigger + timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400 + echo Switch off beam abort + ssh hadeswrp01 \"echo \"W3000000010\" >/dev/ttyUSB0\" + sleep .1 cd ~/trbsoft/trbnettools/binlocal for TRB3_SERVER in trb3sc317 trb3sc319 trb3sc320 trb3sc315 trb3sc318 trb3sc316; do ping \$TRB3_SERVER -c 1 -w 1 >/dev/null 2>&1 || echo \"ERROR contacting \$TRB3_SERVER\" TRB3_SERVER=\$TRB3_SERVER ./trbcmd reload 0xffff - sleep .3 + sleep .6 done # TRB3_SERVER=trb3sc317 ./trbcmd reload 0xffff diff --git a/control/gui/reboot/30_Start b/control/gui/reboot/30_Start index c369048..59cbacc 100755 --- a/control/gui/reboot/30_Start +++ b/control/gui/reboot/30_Start @@ -5,10 +5,11 @@ if [ $myvar == "256" ]; then exit; fi notifyall.sh "DAQ" " The Start boards are going to be rebooted." "STARTUP" & - xterm -geometry 80x24 -bg orange -fg black -e bash --login -c ' ssh hadaq@lxhadesdaqp " source /home/hadaq/.bash_profile + echo Switch off trigger + timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400 for TRB3_SERVER in trb3sc438; diff --git a/control/gui/reboot/30_TOF_Wall b/control/gui/reboot/30_TOF_Wall index e059982..9404570 100755 --- a/control/gui/reboot/30_TOF_Wall +++ b/control/gui/reboot/30_TOF_Wall @@ -5,9 +5,11 @@ if [ $myvar == "256" ]; then exit; fi notifyall.sh "DAQ" " The boards of TOF and FW are going to be rebooted." "STARTUP" & - xterm -geometry 80x24 -bg orange -fg black -e bash --login -c ' ssh hadaq@lxhadesdaqp " + source /home/hadaq/.bash_profile + echo Switch off trigger + timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400 cd ~/trbsoft/trbnettools/binlocal diff --git a/control/gui/reboot/90_Reprogram_CTS b/control/gui/reboot/90_Reprogram_CTS index fba434f..7ade4bb 100755 --- a/control/gui/reboot/90_Reprogram_CTS +++ b/control/gui/reboot/90_Reprogram_CTS @@ -8,8 +8,13 @@ killall logerrors.pl notifyall.sh "DAQ" " FPGA are being reprogrammed." "STARTUP" & +timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400 # Switch off trigger + xterm -geometry 80x24 -bg orange -fg black -e bash --login -c ' ssh -X hadaq@lxhadesdaqp " + source /home/hadaq/.bash_profile + echo Switch off trigger + timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400 cd ~/trbsoft/hadesdaq/main/ ./startup.pl -f main_hades.script -o file -m TOF -m RPC -m WALL -m RICH -m STARTCTS -m MDC -m MDCDATASET --eb off #echo \"First config run\" diff --git a/control/mdcLVgui/S0/200x b/control/mdcLVgui/S0/200x index 6e0e776..9053214 100755 --- a/control/mdcLVgui/S0/200x +++ b/control/mdcLVgui/S0/200x @@ -2,10 +2,11 @@ #set -xv xterm -e bash --login -c ' - ssh hadaq@lxhadesdaqp " + ssh hadaq@lxhadesdaq " source /home/hadaq/.bash_profile #set -xv -( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/ +#( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/ +( . ~/EPICS/bin/epics -q 7.0.2 ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-7.0.2/base/ PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 1 -S 1 -- 2.43.0