From: Jan Michel Date: Fri, 15 Feb 2019 13:32:00 +0000 (+0100) Subject: update control GUI scripts X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=dada4ffb049cfbb96598542a0e5bfb2cff657934;p=hadesdaq.git update control GUI scripts --- diff --git a/control/gui/Buttons2.pm b/control/gui/Buttons2.pm index de2d459..187a52f 100644 --- a/control/gui/Buttons2.pm +++ b/control/gui/Buttons2.pm @@ -145,6 +145,16 @@ sub NEW { $horizontalLayout->addWidget( $groupBox_4 ); + my $groupBox_5 = Qt::GroupBox( $centralwidget ); + $self->{groupBox_5} = $groupBox_5; + $groupBox_5->setObjectName( "groupBox_5" ); + my $vl_gb5 = Qt::VBoxLayout( $groupBox_5 ); + $self->{vl_gb5} = $vl_gb5; + $vl_gb5->setObjectName( "vl_gb5" ); + + $horizontalLayout->addWidget( $groupBox_5 ); + + my $vl_top = Qt::VBoxLayout( ); $self->{vl_top} = $vl_top; @@ -212,9 +222,11 @@ sub NEW { $dir = "eb"; make_buttons($self, $dir, \$cur_button_number, $groupBox_3, $vl_gb3); - $dir = "expert"; make_buttons($self, $dir, \$cur_button_number, $groupBox_4, $vl_gb4); + + $dir = "power"; + make_buttons($self, $dir, \$cur_button_number, $groupBox_5, $vl_gb5); #print "cur_button: $cur_button_number\n"; #$layoutWidget->updateGeometry(); @@ -240,6 +252,7 @@ sub retranslateUi { $self->{groupBox_2}->setTitle( Qt::Application::translate( 'MainWindow', "Monitor Tools", undef, Qt::Application::UnicodeUTF8() ) ); $self->{groupBox_3}->setTitle( Qt::Application::translate( 'MainWindow', "Eventbuilder Tools", undef, Qt::Application::UnicodeUTF8() ) ); $self->{groupBox_4}->setTitle( Qt::Application::translate( 'MainWindow', "Expert Tools", undef, Qt::Application::UnicodeUTF8() ) ); + $self->{groupBox_5}->setTitle( Qt::Application::translate( 'MainWindow', "Power Tools", undef, Qt::Application::UnicodeUTF8() ) ); # $self->{pushButton}->setText( Qt::Application::translate( 'MainWindow', "Quit DAQ-Control", undef, Qt::Application::UnicodeUTF8() ) ); $self->{checkBox}->setText( Qt::Application::translate( 'MainWindow', "Show Expert Tools", undef, Qt::Application::UnicodeUTF8() ) ); diff --git a/control/gui/call_programs_local.sh b/control/gui/call_programs_local.sh index 7ec7537..1960347 100755 --- a/control/gui/call_programs_local.sh +++ b/control/gui/call_programs_local.sh @@ -1,9 +1,9 @@ #!/bin/bash cd /home/hadaq/trbsoft/hadesdaq/control/gui/ -./call_programs_wrapper.sh -geometry -0-0 & -#/home/hadaq/trbsoft/hadesdaq/control/gui/call_programs_wrapper.sh -geometry -0-0 & +/home/hadaq/trbsoft/daq/control/gui/call_programs2.pl -geometry -0-0 & +#/home/hadaq/trbsoft/hadesdaq/control/gui/call_programs_wrapper.sh -geometry -0-0 & #cd /home/hadaq/trbsoft/daq/control/gui/ #./call_programs2.pl -geometry -0-0 diff --git a/control/gui/call_programs_wrapper.sh b/control/gui/call_programs_wrapper.sh deleted file mode 100755 index ba93d5a..0000000 --- a/control/gui/call_programs_wrapper.sh +++ /dev/null @@ -1,5 +0,0 @@ -ssh -X lxhadeb06 "export PATH=\$PATH:\$HOME/bin; echo $PATH; cd /home/hadaq/trbsoft/hadesdaq/control/gui/; ./call_programs2.pl -geometry -0-0" -#ssh -X lxhadeb06 ". .bashrc; export PATH=\$PATH:\$HOME/bin; echo $PATH; cd /home/hadaq/trbsoft/hadesdaq/control/gui/; ./call_programs2.pl -geometry -0-0" - -#cd /home/hadaq/trbsoft/daq/control/gui/ -#/home/hadaq/trbsoft/daq/control/gui/call_programs2.pl -geometry -0-0 diff --git a/control/gui/call_programs_wrapper.sh b/control/gui/call_programs_wrapper.sh new file mode 120000 index 0000000..f135b22 --- /dev/null +++ b/control/gui/call_programs_wrapper.sh @@ -0,0 +1 @@ +call_programs_local.sh \ No newline at end of file diff --git a/control/gui/call_programs_wrapper_lxhadeb06.sh b/control/gui/call_programs_wrapper_lxhadeb06.sh new file mode 100755 index 0000000..ba93d5a --- /dev/null +++ b/control/gui/call_programs_wrapper_lxhadeb06.sh @@ -0,0 +1,5 @@ +ssh -X lxhadeb06 "export PATH=\$PATH:\$HOME/bin; echo $PATH; cd /home/hadaq/trbsoft/hadesdaq/control/gui/; ./call_programs2.pl -geometry -0-0" +#ssh -X lxhadeb06 ". .bashrc; export PATH=\$PATH:\$HOME/bin; echo $PATH; cd /home/hadaq/trbsoft/hadesdaq/control/gui/; ./call_programs2.pl -geometry -0-0" + +#cd /home/hadaq/trbsoft/daq/control/gui/ +#/home/hadaq/trbsoft/daq/control/gui/call_programs2.pl -geometry -0-0 diff --git a/control/gui/call_programs_wrapper_lxhadesdaq.sh b/control/gui/call_programs_wrapper_lxhadesdaq.sh new file mode 100755 index 0000000..db334ba --- /dev/null +++ b/control/gui/call_programs_wrapper_lxhadesdaq.sh @@ -0,0 +1,5 @@ +ssh -X lxhadesdaq "export PATH=\$PATH:\$HOME/bin; echo $PATH; cd /home/hadaq/trbsoft/hadesdaq/control/gui/; ./call_programs2.pl -geometry -0-0" +#ssh -X lxhadeb06 ". .bashrc; export PATH=\$PATH:\$HOME/bin; echo $PATH; cd /home/hadaq/trbsoft/hadesdaq/control/gui/; ./call_programs2.pl -geometry -0-0" + +#cd /home/hadaq/trbsoft/daq/control/gui/ +#/home/hadaq/trbsoft/daq/control/gui/call_programs2.pl -geometry -0-0 diff --git a/control/gui/daq/10_Start_DAQ b/control/gui/daq/10_Start_DAQ index fed9db9..9f07f5e 100755 --- a/control/gui/daq/10_Start_DAQ +++ b/control/gui/daq/10_Start_DAQ @@ -3,11 +3,11 @@ export myvar=$(/home/hadaq/trbsoft/hadesdaq/utils/doyoureallywant.pl "restart the DAQ") if [ $myvar == "256" ]; then exit; fi -#notifyall.sh "DAQ" " DAQ is going to be restarted." "STARTUP" & +notifyall.sh "DAQ" " DAQ is going to be restarted." "STARTUP" & xterm -geometry 80x24 -bg orange -fg black -e bash --login -c ' - ssh hadaq@lxhadesdaq " + ssh hadaq@lxhadesdaqp " source /home/hadaq/.bash_profile echo \" Connected to lxhadesdaq...\" echo \" Starting DAQ with default settings...\" @@ -17,5 +17,5 @@ xterm -geometry 80x24 -bg orange -fg black -e bash --login -c ' " ' -#notifyall.sh "DAQ" " DAQ has been started." "STARTUP" & +notifyall.sh "DAQ" " DAQ has been started." "STARTUP" & diff --git a/control/gui/daq/20_Reprogram_FPGA b/control/gui/daq/20_Reprogram_FPGA index ff94836..0fb05bc 100755 --- a/control/gui/daq/20_Reprogram_FPGA +++ b/control/gui/daq/20_Reprogram_FPGA @@ -9,7 +9,7 @@ killall logerrors.pl notifyall.sh "DAQ" " FPGA are being reprogrammed." "STARTUP" & xterm -geometry 80x24 -bg orange -fg black -e bash --login -c ' - ssh -X hadaq@lxhadesdaq " + ssh -X hadaq@lxhadesdaqp " 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/gui/daq/30_Reboot_OEP b/control/gui/daq/30_Reboot_OEP index ce73397..6a1ec2c 100755 --- a/control/gui/daq/30_Reboot_OEP +++ b/control/gui/daq/30_Reboot_OEP @@ -3,12 +3,12 @@ export myvar=$(/home/hadaq/trbsoft/hadesdaq/utils/doyoureallywant.pl " reboot the MDC-OEPs") if [ $myvar == "256" ]; then exit; fi - -ssh -X hadaq@lxhadesdaq " xterm -geometry 80x24 -bg orange -fg black -e bash --login -c ' +ssh hadaq@lxhadesdaqp " ~/bin/rebootoep_x11.sh -' +sleep 2 " +' notifyall.sh "DAQ" " OEPs rebooted" "MDC"& diff --git a/control/gui/daq/35_Reboot_MDCHub b/control/gui/daq/35_Reboot_MDCHub index 0bd30b1..cb5b1f9 100755 --- a/control/gui/daq/35_Reboot_MDCHub +++ b/control/gui/daq/35_Reboot_MDCHub @@ -7,11 +7,11 @@ export myvar=$(/home/hadaq/trbsoft/hadesdaq/utils/doyoureallywant.pl " reboot the MDC-Hubs") if [ $myvar == "256" ]; then exit; fi -ssh -X hadaq@lxhadesdaq " xterm -geometry 80x24 -bg orange -fg black -e bash --login -c ' -trbcmd reset; -trbcmd reload 0xfe11 -'"; + trbcmd reset + trbcmd reload 0xfe11 +' + sleep 8; notifyall.sh "DAQ" " MDC-Hubs rebooted" "MDC"& diff --git a/control/gui/daq/40_ReSync_Missing_OEP b/control/gui/daq/40_ReSync_Missing_OEP index e264cbb..cc2c59a 100755 --- a/control/gui/daq/40_ReSync_Missing_OEP +++ b/control/gui/daq/40_ReSync_Missing_OEP @@ -1,7 +1,8 @@ #!/bin/bash -ssh -X hadaq@lxhadesdaq " xterm -geometry 80x24 -bg orange -fg black -e bash --login -c ' +ssh hadaq@lxhadesdaqp " +echo "reviveoep.pl" reviveoep.pl - ' - " - +sleep 10 +" +' diff --git a/control/gui/eb/10_Restart_EB b/control/gui/eb/10_Restart_EB deleted file mode 100755 index 0a77f47..0000000 --- a/control/gui/eb/10_Restart_EB +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -#/home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders are being restarted." "EB" & - -ssh -X hadaq@lxhadesdaq " - xterm -geometry 80x24 -bg orange -fg black -e bash -c ' - echo "Restarting Eventbuilder 1 - 16" - stoptrigger.sh - cd ~/trbsoft/hadesdaq/evtbuild/ - sleep 10 && starttrigger.sh & - ./start_eb_gbe.sh - ' - " -/home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders have been restarted with last prefix" "EB" & - diff --git a/control/gui/eb/22_Restart_BNET_2_Builders b/control/gui/eb/22_Restart_BNET_2_Builders deleted file mode 100755 index 96257af..0000000 --- a/control/gui/eb/22_Restart_BNET_2_Builders +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# notifyall.sh "DAQ" " Eventbuilders are being restarted." "EB" & - -ssh -X hadaq@lxhadesdaq " - xterm -geometry 80x24 -bg orange -fg black -e bash -c ' - echo "Starting Eventbuilders with 2 BNET builder nodes" - cd ~/trbsoft/hadesdaq/evtbuild/ - ./start_eb_gbe.pl -e restart -n 1-16 -d on -p te -b 2 - sleep 2 - ' - " - -/home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders have been restarted using 2 BNET builder nodes" "EB" & - diff --git a/control/gui/eb/23_Restart_BNET_3_Builders b/control/gui/eb/23_Restart_BNET_3_Builders deleted file mode 100755 index 77a6044..0000000 --- a/control/gui/eb/23_Restart_BNET_3_Builders +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# notifyall.sh "DAQ" " Eventbuilders are being restarted." "EB" & - -ssh -X hadaq@lxhadesdaq " - xterm -geometry 80x24 -bg orange -fg black -e bash -c ' - echo "Starting Eventbuilders with 3 BNET builder nodes" - cd ~/trbsoft/hadesdaq/evtbuild/ - ./start_eb_gbe.pl -e restart -n 1-16 -d on -p te -b 3 - sleep 2 - ' - " - -/home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders have been restarted using 3 BNET builder nodes" "EB" & - diff --git a/control/gui/eb/27_Start_TDC_CAL b/control/gui/eb/27_Start_TDC_CAL index 8531db2..ec01cce 100755 --- a/control/gui/eb/27_Start_TDC_CAL +++ b/control/gui/eb/27_Start_TDC_CAL @@ -1,11 +1,15 @@ #!/bin/bash # 100Hz -> 2e6 pulservalue = 0x1E8480 -ssh -X hadaq@lxhadesdaq " - xterm -geometry 80x24 -bg orange -fg black -e bash -c ' +export myvar=$(/home/hadaq/trbsoft/hadesdaq/utils/doyoureallywant.pl "start the TDC calibration") +if [ $myvar == "256" ]; then exit; fi + +/home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " TDC calibration is starting." "EB" & + +xterm -geometry 80x24 -bg orange -fg black -e bash -c ' /home/hadaq/trbsoft/hadesdaq/evtbuild/tdc_calib_start.sh sleep 20 - ' - " -/home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders have started TDC-Calibration procedure." "EB" & +' + +/home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders have started the calibration procedure." "EB" & diff --git a/control/gui/eb/28_Stop_TDC_CAL b/control/gui/eb/28_Stop_TDC_CAL index b88e198..2d5bd9f 100755 --- a/control/gui/eb/28_Stop_TDC_CAL +++ b/control/gui/eb/28_Stop_TDC_CAL @@ -1,13 +1,14 @@ #!/bin/bash +export myvar=$(/home/hadaq/trbsoft/hadesdaq/utils/doyoureallywant.pl "stop the TDC calibration") +if [ $myvar == "256" ]; then exit; fi +/home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " TDC calibration is stopping." "EB" & -ssh -X hadaq@lxhadesdaq " xterm -geometry 80x24 -bg orange -fg black -e bash -c ' /home/hadaq/trbsoft/hadesdaq/evtbuild/tdc_calib_stop.sh sleep 30; - - ' - " -/home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders have stopped TDC-Calibration procedure." "EB" & + ' + +/home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders have stopped the TDC-Calibration procedure." "EB" & diff --git a/control/gui/eb/29_Prefix_Be b/control/gui/eb/29_BEAM_Files similarity index 69% rename from control/gui/eb/29_Prefix_Be rename to control/gui/eb/29_BEAM_Files index a8c9dae..22a3f40 100755 --- a/control/gui/eb/29_Prefix_Be +++ b/control/gui/eb/29_BEAM_Files @@ -14,14 +14,19 @@ # ' # " -ssh -X hadaq@lxhadesdaq " +export myvar=$(/home/hadaq/trbsoft/hadesdaq/utils/doyoureallywant.pl "start the TDC calibration") +if [ $myvar == "256" ]; then exit; fi + +$HOME/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " TDC calibration is starting." "EB" & + + xterm -geometry 80x24 -bg orange -fg black -e bash -c ' echo "Setting file prefix be" /usr/bin/wget -a /tmp/EB_filestart.log -O /tmp/EB_fileres.txt \"http://lxhadeb07:8099/Master/BNET/StartRun/execute?prefix=be&oninit=10\" echo set prefix te on BNET master controller sleep 2 ' - " -/home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders are writing beam files." "EB" & + +$HOME/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders are writing beam files." "EB" & diff --git a/control/gui/eb/10_Restart_EB.png b/control/gui/eb/29_BEAM_Files.png similarity index 100% rename from control/gui/eb/10_Restart_EB.png rename to control/gui/eb/29_BEAM_Files.png diff --git a/control/gui/eb/50_Prefix_Co b/control/gui/eb/50_COSMICS_Files similarity index 100% rename from control/gui/eb/50_Prefix_Co rename to control/gui/eb/50_COSMICS_Files diff --git a/control/gui/eb/40_Prefix_Te b/control/gui/eb/52_TEST_File similarity index 96% rename from control/gui/eb/40_Prefix_Te rename to control/gui/eb/52_TEST_File index 914b3f6..c8fbd43 100755 --- a/control/gui/eb/40_Prefix_Te +++ b/control/gui/eb/52_TEST_File @@ -17,7 +17,7 @@ ssh -X hadaq@lxhadesdaq " xterm -geometry 80x24 -bg orange -fg black -e bash -c ' - echo "Setting file prefix be" + echo "Setting file prefix te" /usr/bin/wget -a /tmp/EB_filestart.log -O /tmp/EB_fileres.txt \"http://lxhadeb07:8099/Master/BNET/StartRun/execute?prefix=te&oninit=10\" echo set prefix te on BNET master controller sleep 2 diff --git a/control/gui/eb/30_Prefix_NoFile b/control/gui/eb/55_NO_FILE similarity index 100% rename from control/gui/eb/30_Prefix_NoFile rename to control/gui/eb/55_NO_FILE diff --git a/control/gui/eb/20_____Stop_EB.png b/control/gui/eb/55_NO_FILE.png similarity index 100% rename from control/gui/eb/20_____Stop_EB.png rename to control/gui/eb/55_NO_FILE.png diff --git a/control/gui/eb/60_Prefix_TC b/control/gui/eb/60_Prefix_TC deleted file mode 100755 index fad39e1..0000000 --- a/control/gui/eb/60_Prefix_TC +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# notifyall.sh "DAQ" " Eventbuilders are being restarted." "EB" & - -# ssh -X hadaq@lxhadesdaq " -# xterm -geometry 80x24 -bg orange -fg black -e bash -c ' -# echo "Starting Eventbuilders with prefix tc" -# cd ~/trbsoft/hadesdaq/evtbuild/ -# ./start_eb_gbe.pl -e restart -n 1-16 -d on -p tc -# /usr/bin/wget -a /tmp/EB_filestart.log -O /tmp/EB_fileres.txt \"http://lxhadeb03:8090/Master/BNET/StartRun/execute?prefix=tc&oninit=10\" -# echo set prefix TC on BNET master controller -# sleep 2 -# ' -# " -# /home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders have been started. Writing TDC-Calibration Files" "EB" & - -ssh -X hadaq@lxhadesdaq " - xterm -geometry 80x24 -bg orange -fg black -e bash -c ' - echo Setting file prefix tc - /usr/bin/wget -a /tmp/EB_filestart.log -O /tmp/EB_fileres.txt \"http://lxhadeb07:8099/Master/BNET/StartRun/execute?prefix=tc&oninit=10\" - echo set prefix tc on BNET master controller - sleep 2 - ' - " -/home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders are writing TDC-Calibration Files." "EB" & - diff --git a/control/gui/eb/60_Restart_EB b/control/gui/eb/60_Restart_EB new file mode 100755 index 0000000..30de264 --- /dev/null +++ b/control/gui/eb/60_Restart_EB @@ -0,0 +1,19 @@ +#!/bin/bash + +export myvar=$(/home/hadaq/trbsoft/hadesdaq/utils/doyoureallywant.pl "restart the Eventbuilders") +if [ $myvar == "256" ]; then exit; fi + +/home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders are being restarted." "EB" & + +xterm -geometry 80x24 -bg orange -fg black -e bash -c ' +ssh -X hadaq@lxhadesdaq " + echo \"Restarting Eventbuilder 1 - 16\" + stoptrigger.sh + cd ~/trbsoft/hadesdaq/evtbuild/ + sleep 12 && starttrigger.sh & + ./start_eb_gbe.sh + " +' + +/home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders have been restarted with last prefix" "EB" & + diff --git a/control/gui/eb/20_____Stop_EB b/control/gui/eb/65_____Stop_EB similarity index 100% rename from control/gui/eb/20_____Stop_EB rename to control/gui/eb/65_____Stop_EB diff --git a/control/gui/eb/70_Prefix_Ri b/control/gui/eb/70_Prefix_Ri deleted file mode 100755 index 0fb8d11..0000000 --- a/control/gui/eb/70_Prefix_Ri +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# notifyall.sh "DAQ" " Eventbuilders are being restarted." "EB" & - -# ssh -X hadaq@lxhadesdaq " -# xterm -geometry 80x24 -bg orange -fg black -e bash -c ' -# echo "Starting Eventbuilders with prefix ri" -# cd ~/trbsoft/hadesdaq/evtbuild/ -# ./start_eb_gbe.pl -e restart -n 1-16 -d on -p ri -# /usr/bin/wget -a /tmp/EB_filestart.log -O /tmp/EB_fileres.txt \"http://lxhadeb03:8090/Master/BNET/StartRun/execute?prefix=ri&oninit=10\" -# echo set prefix RI on BNET master controller -# sleep 2 -# ' -# " -# /home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders have been started. Writing RICH Files" "EB" & - -ssh -X hadaq@lxhadesdaq " - xterm -geometry 80x24 -bg orange -fg black -e bash -c ' - echo "Setting file prefix ri" - /usr/bin/wget -a /tmp/EB_filestart.log -O /tmp/EB_fileres.txt \"http://lxhadeb07:8099/Master/BNET/StartRun/execute?prefix=ri&oninit=10\" - echo set prefix ri on BNET master controller - sleep 2 - ' - " -/home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders are writing RICH files." "EB" & - diff --git a/control/gui/eb/21_Restart_BNET_1_Builder b/control/gui/eb/70_Set_1_EB similarity index 100% rename from control/gui/eb/21_Restart_BNET_1_Builder rename to control/gui/eb/70_Set_1_EB diff --git a/control/gui/eb/23_Restart_BNET_4_Builders b/control/gui/eb/73_Set_4_EB similarity index 100% rename from control/gui/eb/23_Restart_BNET_4_Builders rename to control/gui/eb/73_Set_4_EB diff --git a/control/gui/eb/75_Prefix_Ec b/control/gui/eb/75_Prefix_Ec deleted file mode 100755 index b313f07..0000000 --- a/control/gui/eb/75_Prefix_Ec +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -# notifyall.sh "DAQ" " Eventbuilders are being restarted." "EB" & - -# ssh -X hadaq@lxhadesdaq " -# xterm -geometry 80x24 -bg orange -fg black -e bash -c ' -# echo "Starting Eventbuilders with prefix ec" -# cd ~/trbsoft/hadesdaq/evtbuild/ -# ./start_eb_gbe.pl -e restart -n 1-16 -d on -p ec -# /usr/bin/wget -a /tmp/EB_filestart.log -O /tmp/EB_fileres.txt \"http://lxhadeb03:8090/Master/BNET/StartRun/execute?prefix=ec&oninit=10\" -# echo set prefix EC on BNET master controller -# sleep 2 -# ' -# " -# /home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders have been started. Writing ECAL Files" "EB" & - - -ssh -X hadaq@lxhadesdaq " - xterm -geometry 80x24 -bg orange -fg black -e bash -c ' - echo "Setting file prefix ec" - /usr/bin/wget -a /tmp/EB_filestart.log -O /tmp/EB_fileres.txt \"http://lxhadeb07:8099/Master/BNET/StartRun/execute?prefix=ec&oninit=10\" - echo set prefix ec on BNET master controller - sleep 2 - ' - " -/home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders are writing ECAL files." "EB" & - diff --git a/control/gui/eb/25_Restart_BNET_8_Builders b/control/gui/eb/75_Set_8_EB similarity index 100% rename from control/gui/eb/25_Restart_BNET_8_Builders rename to control/gui/eb/75_Set_8_EB diff --git a/control/gui/eb/26_Restart_BNET_12_Builders b/control/gui/eb/76_Set_12_EB similarity index 100% rename from control/gui/eb/26_Restart_BNET_12_Builders rename to control/gui/eb/76_Set_12_EB diff --git a/control/gui/eb/80_Prefix_St b/control/gui/eb/80_Prefix_St deleted file mode 100755 index f0e8255..0000000 --- a/control/gui/eb/80_Prefix_St +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# ssh -X hadaq@lxhadesdaq " -# xterm -geometry 80x24 -bg orange -fg black -e bash -c ' -# echo "Starting Eventbuilders with prefix st" -# cd ~/trbsoft/hadesdaq/evtbuild/ -# ./start_eb_gbe.pl -e restart -n 1-16 -d on -p st -# /usr/bin/wget -a /tmp/EB_filestart.log -O /tmp/EB_fileres.txt \"http://lxhadeb03:8090/Master/BNET/StartRun/execute?prefix=st&oninit=10\" -# echo set prefix ST on BNET master controller -# sleep 2 -# ' -# " -# /home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders have been started. Writing START Files" "EB"& - - -ssh -X hadaq@lxhadesdaq " - xterm -geometry 80x24 -bg orange -fg black -e bash -c ' - echo "Setting file prefix st" - /usr/bin/wget -a /tmp/EB_filestart.log -O /tmp/EB_fileres.txt \"http://lxhadeb07:8099/Master/BNET/StartRun/execute?prefix=st&oninit=10\" - echo set prefix st on BNET master controller - sleep 2 - ' - " -/home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders are writing START files." "EB" & - diff --git a/control/gui/eb/90_Prefix_Md b/control/gui/eb/90_Prefix_Md deleted file mode 100755 index 5b18dc9..0000000 --- a/control/gui/eb/90_Prefix_Md +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -# ssh -X hadaq@lxhadesdaq " -# xterm -geometry 80x24 -bg orange -fg black -e bash -c ' -# echo "Starting Eventbuilders with prefix md" -# cd ~/trbsoft/hadesdaq/evtbuild/ -# ./start_eb_gbe.pl -e restart -n 1-16 -d on -p md -# /usr/bin/wget -a /tmp/EB_filestart.log -O /tmp/EB_fileres.txt \"http://lxhadeb03:8090/Master/BNET/StartRun/execute?prefix=md&oninit=10\" -# echo set prefix MD on BNET master controller -# sleep 2 -# ' -# " -# /home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders have been started. Writing MDC Files" "EB"& - -ssh -X hadaq@lxhadesdaq " - xterm -geometry 80x24 -bg orange -fg black -e bash -c ' - echo "Setting file prefix md" - /usr/bin/wget -a /tmp/EB_filestart.log -O /tmp/EB_fileres.txt \"http://lxhadeb07:8099/Master/BNET/StartRun/execute?prefix=md&oninit=10\" - echo set prefix te on BNET master controller - sleep 2 - ' - " -/home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders are writing MDC files." "EB" & - diff --git a/control/gui/eb/98_Prefix_Sh b/control/gui/eb/98_Prefix_Sh deleted file mode 100755 index 7d5457a..0000000 --- a/control/gui/eb/98_Prefix_Sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# notifyall.sh "DAQ" " Eventbuilders are being restarted." "EB" & - -# ssh -X hadaq@lxhadesdaq " -# xterm -geometry 80x24 -bg orange -fg black -e bash -c ' -# echo "Starting Eventbuilders with prefix sh" -# cd ~/trbsoft/hadesdaq/evtbuild/ -# ./start_eb_gbe.pl -e restart -n 1-16 -d on -p sh -# /usr/bin/wget -a /tmp/EB_filestart.log -O /tmp/EB_fileres.txt \"http://lxhadeb03:8090/Master/BNET/StartRun/execute?prefix=sh&oninit=10\" -# echo set prefix SH on BNET master controller -# sleep 2 -# ' -# " -# /home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders have been started. Writing Shower sh files" "EB" & - -ssh -X hadaq@lxhadesdaq " - xterm -geometry 80x24 -bg orange -fg black -e bash -c ' - echo "Setting file prefix sh" - /usr/bin/wget -a /tmp/EB_filestart.log -O /tmp/EB_fileres.txt \"http://lxhadeb07:8099/Master/BNET/StartRun/execute?prefix=sh&oninit=10\" - echo set prefix sh on BNET master controller - sleep 2 - ' - " -/home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders are writing shower files." "EB" & - diff --git a/control/gui/eb/99_Prefix_Pt b/control/gui/eb/99_Prefix_Pt deleted file mode 100755 index 055fb36..0000000 --- a/control/gui/eb/99_Prefix_Pt +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -# notifyall.sh "DAQ" " Eventbuilders are being restarted." "EB" & - -# ssh -X hadaq@lxhadesdaq " -# xterm -geometry 80x24 -bg orange -fg black -e bash -c ' -# echo "Starting Eventbuilders with prefix pt" -# cd ~/trbsoft/hadesdaq/evtbuild/ -# ./start_eb_gbe.pl -e restart -n 1-16 -d on -p pt -# /usr/bin/wget -a /tmp/EB_filestart.log -O /tmp/EB_fileres.txt \"http://lxhadeb03:8090/Master/BNET/StartRun/execute?prefix=pt&oninit=10\" -# echo set prefix PT on BNET master controller -# sleep 2 -# -# ' -# " -# /home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders have been started. Writing PionTracker pt files" "EB" & - -ssh -X hadaq@lxhadesdaq " - xterm -geometry 80x24 -bg orange -fg black -e bash -c ' - echo "Setting file prefix pt" - /usr/bin/wget -a /tmp/EB_filestart.log -O /tmp/EB_fileres.txt \"http://lxhadeb07:8099/Master/BNET/StartRun/execute?prefix=pt&oninit=10\" - echo set prefix pt on BNET master controller - sleep 2 - ' - " -/home/hadaq/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders are writing PionTracker pt files." "EB" & - diff --git a/control/gui/expert/BLR_Reinit_FPGA b/control/gui/expert/BLR_Reinit_FPGA new file mode 100755 index 0000000..9ea919b --- /dev/null +++ b/control/gui/expert/BLR_Reinit_FPGA @@ -0,0 +1,14 @@ +#!/bin/bash + +export myvar=$(doyoureallywant.pl "to reprogram the BLR-FPGA \(should not have an effect on other systems\) and reload the settings for the BLR") +if [ $myvar == "256" ]; then exit; fi + +xterm -geometry 80x24 -bg orange -fg black -e bash -c ' +echo "reinit FPGA" +command_client.pl -e etraxp107 -c "jam_trbv2 --trb -aRUN_XILINX_PROC /home/hadaq/rpc/fpga/20110301_rpc_a.stapl" +sleep 1 +echo "reload the BLR settings" +command_client.pl -e etraxp107 -c "spi_trbv2_7 /home/hadaq/cts/mult_thresholds/ctsblr_thresholds" +sleep 4 +' + diff --git a/control/gui/expert/BLR_Reload_Settings b/control/gui/expert/BLR_Reload_Settings new file mode 100755 index 0000000..98b989b --- /dev/null +++ b/control/gui/expert/BLR_Reload_Settings @@ -0,0 +1,11 @@ +#!/bin/bash + +export myvar=$(doyoureallywant.pl "to reload the settings for the BLR") +if [ $myvar == "256" ]; then exit; fi + +xterm -geometry 80x24 -bg orange -fg black -e bash -c ' +command_client.pl -e etraxp107 -c "spi_trbv2_7 /home/hadaq/cts/mult_thresholds/ctsblr_thresholds" +sleep 4 +' + +#ssh hadaq@lxhadesdaq "command_client.pl -e etraxp107 -c \"spi_trbv2_7 /home/hadaq/cts/mult_thresholds/ctsblr_thresholds\" " diff --git a/control/gui/expert/Pexor_Repair b/control/gui/expert/Pexor_Repair deleted file mode 100755 index d59f727..0000000 --- a/control/gui/expert/Pexor_Repair +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# JAM took from startup_briccolage.sh without starting everything -xterm -geometry 80x24 -bg orange -fg black -e bash --login -c ' - ssh hadaq@hadesp31 " - export DAQOPSERVER=hadesp31; - echo \" Pexor clean-up on hades31...\"; - pkill -USR1 trbnetd 2>/dev/null; - killall trbcmd 2>/dev/null; - trbcmdlocal W 0x703 0x20; - trbcmdlocal f 3; - trbcmdlocal W 0x702 2; - echo \" Doing Reset...\"; - tryreset.pl; - pkill -USR2 trbnetd; - pgrep trbnetd 1>/dev/null || trbnetd; - #trbcmdlocal reset; - echo \"Set default CTS setup\" - # following from cts/startup.script: - trbcmdlocal clearbit 0x0003 0xa0c0 0x20000000 #set profile B to start - trbcmdlocal w 0x0003 0xA0E0 0xcccccccc - trbcmdlocal w 0x0003 0xA0E1 0xcc - trbcmdlocal loadbit 0x003 0xA0C1 0x0000000F 0x00000004 - trbcmdlocal setbit 0x0003 0xA0C2 0x01000000 - trbcmdlocal -f /home/hadaq/trbsoft/hadesdaq/cts/cts_settings_mon.trbcmd - trbcmdlocal loadbit 0x0003 0xa0f0 0xffff0000 0xfff0000 - #All calib to EB1 - trbcmdlocal w 0x0003 0xa0f3 0xff1 -# turn off multi event queue, as these garble the data from the TRB2s - stoptrigger.sh; trbcmdlocal w 0xff7f 0x8307 0 ; starttrigger.sh - echo \"Repairing trbnetd and pexor done\" - sleep 130; - " - ' diff --git a/control/gui/expert/RICH_Powercycle b/control/gui/expert/RICH_Powercycle deleted file mode 100755 index 4441860..0000000 --- a/control/gui/expert/RICH_Powercycle +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -export myvar=$(doyoureallywant.pl "to make a RICH powercycle?") -if [ $myvar == "256" ]; then exit; fi - -export DAQOPSERVER=hadesp31 -trbcmd w 0xfffb 0x20 0x8000 - diff --git a/control/gui/expert/Reboot RICH b/control/gui/expert/Reboot RICH deleted file mode 100755 index 4441860..0000000 --- a/control/gui/expert/Reboot RICH +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -export myvar=$(doyoureallywant.pl "to make a RICH powercycle?") -if [ $myvar == "256" ]; then exit; fi - -export DAQOPSERVER=hadesp31 -trbcmd w 0xfffb 0x20 0x8000 - diff --git a/control/gui/expert/Reload_RICH b/control/gui/expert/Reload_RICH new file mode 100755 index 0000000..df1f52f --- /dev/null +++ b/control/gui/expert/Reload_RICH @@ -0,0 +1,8 @@ +#!/bin/bash +export myvar=$(doyoureallywant.pl "to Reload the RICH?") +if [ $myvar == "256" ]; then exit; fi + +export DAQOPSERVER=hadesp31 +trbcmd reload 0xfe51 +trbcmd reload 0xfe52 + diff --git a/control/gui/expert/Set_RICH_HV b/control/gui/expert/Set_RICH_HV index 6f26ba6..3da2638 100755 --- a/control/gui/expert/Set_RICH_HV +++ b/control/gui/expert/Set_RICH_HV @@ -10,11 +10,11 @@ xterm -geometry 80x24 -bg orange -fg black -e bash --login -c ' cd /home/hadaq/JoF/HV_RICH/ . epics ./setCrate.sh 1 - ./setHV.sh gain_alignement_HV_1.5E+06_fifth.dat -# ./setHV.sh gain_alignement_HV_1.5E+06.dat +# ./setHV.sh gain_alignement_HV_1.5E+06_fifth.dat + ./setHV.sh gain_alignement_HV_1.5E+06.dat # ./setHV.sh gain_alignement_HV_2.0E+06.dat - ./setHVon_off.sh gain_alignement_HV_1.5E+06_fifth.dat 2 -# ./setHVon_off.sh gain_alignement_HV_1.5E+06.dat 2 +# ./setHVon_off.sh gain_alignement_HV_1.5E+06_fifth.dat 2 + ./setHVon_off.sh gain_alignement_HV_1.5E+06.dat 2 # ./setHVon_off.sh gain_alignement_HV_2.0E+06.dat 2 echo \"Done\" sleep 10 diff --git a/control/gui/monitor/10_CTS_Mon b/control/gui/monitor/10_CTS_Mon index 9a92ec7..7c377ad 100755 --- a/control/gui/monitor/10_CTS_Mon +++ b/control/gui/monitor/10_CTS_Mon @@ -4,6 +4,13 @@ #if [ $myvar == "256" ]; then exit; fi #notifyall.sh "DAQ" " DAQ is going to be restarted." "STARTUP" & +export DAQOPSERVER=hadesp31 +cd /home/hadaq/trbsoft/hadesdaq/control/ctsmon +perl ./mon_cts.pl +sleep 1 +exit + + #xterm -geometry 80x24 -bg orange -fg black -e bash --login -c ' ssh -X hadaq@lxhadeb06 " source /home/hadaq/.bashrc diff --git a/control/gui/monitor/28_Epics b/control/gui/monitor/28_Epics_old similarity index 100% rename from control/gui/monitor/28_Epics rename to control/gui/monitor/28_Epics_old diff --git a/control/gui/monitor/30_EPICS_Power b/control/gui/monitor/30_EPICS_Power new file mode 100755 index 0000000..7da4203 --- /dev/null +++ b/control/gui/monitor/30_EPICS_Power @@ -0,0 +1,2 @@ +#!/bin/bash +vncviewer-tigervnc -passwd /home/hadaq/.vnc/passwd_scs lxhaddcs03:44 diff --git a/control/gui/monitor/28_Epics.png b/control/gui/monitor/30_EPICS_Power.png similarity index 100% rename from control/gui/monitor/28_Epics.png rename to control/gui/monitor/30_EPICS_Power.png diff --git a/control/gui/monitor/80_Daq_VNC b/control/gui/monitor/80_Daq_VNC index 36e882e..99f2329 100755 --- a/control/gui/monitor/80_Daq_VNC +++ b/control/gui/monitor/80_Daq_VNC @@ -1,3 +1,3 @@ #!/bin/bash -vncviewer -passwd ~/.vnc/daqvncpasswd hadesdaq01:1 & +vncviewer -passwd ~/.vnc/passwd hades30:1 & diff --git a/control/gui/monitor/mumble b/control/gui/monitor/mumble new file mode 100755 index 0000000..57173e1 --- /dev/null +++ b/control/gui/monitor/mumble @@ -0,0 +1 @@ +mumble diff --git a/control/gui/power/00_Powercycle_all b/control/gui/power/00_Powercycle_all new file mode 100755 index 0000000..5ba8ab5 --- /dev/null +++ b/control/gui/power/00_Powercycle_all @@ -0,0 +1,19 @@ +#!/bin/bash + +export myvar=$(doyoureallywant.pl "to powercycle RICH,ECAL LV?") +if [ $myvar == "256" ]; then exit; fi + +xterm -e bash --login -c ' + ssh hadaq@lxhadesdaq " + source /home/hadaq/.bash_profile + echo \'Starting power cycle...\' + + cd /home/hadaq/hadesdaq/utils; + export PERLLIB=/home/hadaq/EPICS/EPICS-3.15.6/base/lib/perl + ./RICH_Powercycle.pl; + #./ECAL_5V_Entrance_Powercycle.sh; + #./ECAL_LV5_Powercycle; + #./HUB_Powercycle.pl; + +sleep 5 +" diff --git a/control/gui/power/10_RICH_Powercycle b/control/gui/power/10_RICH_Powercycle new file mode 100755 index 0000000..7d4fd19 --- /dev/null +++ b/control/gui/power/10_RICH_Powercycle @@ -0,0 +1,14 @@ +#!/bin/bash + +export myvar=$(doyoureallywant.pl "to powercycle the RICH LV?") +if [ $myvar == "256" ]; then exit; fi + +xterm -e bash --login -c ' + ssh hadaq@lxhadesdaq " + source /home/hadaq/.bash_profile + echo \"Starting a RICH power cycle...\" + cd /home/hadaq/hadesdaq/utils; + PERLLIB=/home/hadaq/EPICS/EPICS-3.15.6/base/lib/perl ./RICH_Powercycle.pl; + sleep 5 + " +' diff --git a/control/gui/power/11_Rich_Fan_Powercycle b/control/gui/power/11_Rich_Fan_Powercycle new file mode 100755 index 0000000..f60ff91 --- /dev/null +++ b/control/gui/power/11_Rich_Fan_Powercycle @@ -0,0 +1,10 @@ +#!/bin/bash + +export myvar=$(doyoureallywant.pl "to powercycle the RICH Fans?") +if [ $myvar == "256" ]; then exit; fi + +xterm -e " +cd ../../../../hadesdaq/utils; +./odroid_HMP_Powercycle.sh odroid1 /dev/HAMEG_HAMEG_HO720_100030280929; +sleep 5 +" diff --git a/control/gui/power/20_ECAL_5V_Entrance_Powercycle b/control/gui/power/20_ECAL_5V_Entrance_Powercycle new file mode 100755 index 0000000..09a4dcf --- /dev/null +++ b/control/gui/power/20_ECAL_5V_Entrance_Powercycle @@ -0,0 +1,9 @@ +#!/bin/bash + +export myvar=$(doyoureallywant.pl "to make a ECAL 5V Entrance Rack powercycle? There will be no further warnings!") +if [ $myvar == "256" ]; then exit; fi + +xterm -e " +cd ../../../../hadesdaq/utils; +./ECAL_5V_Entrance_Powercycle.sh +" diff --git a/control/gui/power/21_ECAL_LV5_Powercycle b/control/gui/power/21_ECAL_LV5_Powercycle new file mode 100755 index 0000000..f696d16 --- /dev/null +++ b/control/gui/power/21_ECAL_LV5_Powercycle @@ -0,0 +1,9 @@ +#!/bin/bash + +export myvar=$(doyoureallywant.pl "to make a ECAL Padiwa 5V powercycle? There will be no further warnings!") +if [ $myvar == "256" ]; then exit; fi + +xterm -e " +cd ../../../../hadesdaq/utils; +./ECAL_LV5_Powercycle.sh; +" diff --git a/control/gui/expert/Wall_Powercycle b/control/gui/power/30_Wall_Powercycle similarity index 73% rename from control/gui/expert/Wall_Powercycle rename to control/gui/power/30_Wall_Powercycle index eb194ed..2a16d81 100755 --- a/control/gui/expert/Wall_Powercycle +++ b/control/gui/power/30_Wall_Powercycle @@ -1,6 +1,6 @@ #!/bin/bash -export myvar=$(doyoureallywant.pl "to make a MDC powercycle? There will be no further warnings!") +export myvar=$(doyoureallywant.pl "to make a Forward Wall powercycle? There will be no further warnings!") if [ $myvar == "256" ]; then exit; fi xterm -e " diff --git a/control/gui/power/40_Start_Powercycle b/control/gui/power/40_Start_Powercycle new file mode 100755 index 0000000..e49b61d --- /dev/null +++ b/control/gui/power/40_Start_Powercycle @@ -0,0 +1,10 @@ +#!/bin/bash + +export myvar=$(doyoureallywant.pl "to powercycle the RICH Fans?") +if [ $myvar == "256" ]; then exit; fi + +xterm -e " +cd ../../../../hadesdaq/utils; +./odroid_HMP_Powercycle.sh odroid1 /dev/HAMEG_HAMEG_HO720_020546031; +sleep 5 +" diff --git a/control/gui/power/90_HUBS_Powercycle b/control/gui/power/90_HUBS_Powercycle new file mode 100755 index 0000000..59b40e5 --- /dev/null +++ b/control/gui/power/90_HUBS_Powercycle @@ -0,0 +1,11 @@ +#!/bin/bash + +export myvar=$(doyoureallywant.pl "to powercycle the Hubs and Rich Sensor Board?") +if [ $myvar == "256" ]; then exit; fi + +xterm -e " +echo 'Starting power cycle...' +cd ../../../../hadesdaq/utils; +./HUB_Powercycle.pl; +sleep 5 +" diff --git a/control/gui/expert/MDC_LV_Powercycle b/control/gui/power/MDC_LV_Powercycle similarity index 100% rename from control/gui/expert/MDC_LV_Powercycle rename to control/gui/power/MDC_LV_Powercycle diff --git a/control/gui/expert/RPC_special_PwrCyc b/control/gui/power/RPC_special_PwrCyc similarity index 81% rename from control/gui/expert/RPC_special_PwrCyc rename to control/gui/power/RPC_special_PwrCyc index 99c76ef..a2a4c91 100755 --- a/control/gui/expert/RPC_special_PwrCyc +++ b/control/gui/power/RPC_special_PwrCyc @@ -1,6 +1,6 @@ #!/bin/bash xterm -e " -export myvar=$(doyoureallywant.pl 'to do a power cycle on Wall') +export myvar=$(doyoureallywant.pl 'to do a power cycle on RPC') if [ $myvar == '256' ]; then exit; fi echo 'Sending power cycle request' diff --git a/dcs_archive b/dcs_archive new file mode 120000 index 0000000..b923b7b --- /dev/null +++ b/dcs_archive @@ -0,0 +1 @@ +/home/hadaq/trbsoft/dcs/archive/ \ No newline at end of file diff --git a/hmon/hmon_ebsummary.pl b/hmon/hmon_ebsummary.pl new file mode 100755 index 0000000..40b4584 --- /dev/null +++ b/hmon/hmon_ebsummary.pl @@ -0,0 +1,150 @@ +#!/usr/bin/perl -w + +use warnings; +use strict; +use Time::HiRes qw( gettimeofday usleep time ); +use Data::Dumper; +use Hmon; +use QA; +use LWP::Simple; +use JSON qw( decode_json ); +use POSIX qw/floor ceil strftime/; +use lib '.'; +use getebjson; + +use DateTime; +use DateTime::Format::ISO8601; + +#my $dt = DateTime::Format::ISO8601->parse_datetime('2019-02-12T13:02:03.795Z'); +#print "\n".($dt->epoch() - time()); +#print strftime("%H:%M:%S",gmtime()); +my $class; + +while(1){ + my $data = getjsonhash('eb', 'Master/BNET/get.json'); + unless($data->{Inputs}{value}) {sleep 5; next;} + + my @datainp; + for my $i (1.. scalar @{$data->{Inputs}{value}}) { + $datainp[$i] = getjsonhash('eb',"BNET-IN-$i/FirstLevel/get.json"); + } + my @databui; + for my $i (1.. scalar @{$data->{Builders}{value}}) { + $databui[$i] = getjsonhash('eb',"BNET-EB-$i/HadaqCombiner/get.json"); + } + + $data->{RunIdStr}{value} =~ /(\d\d)(\d\d)(\d\d)$/; + my $runstart = "--"; + $runstart = "$1:$2:$3" if $3; + + my $builders = scalar @{$data->{Builders}{value}}; + my ($filesize,$totaldata,$totalevents) = (0,0,0); + for my $i (1 .. $builders){ + $filesize += $databui[$i]->{RunFileSize}{value}//0; + $totaldata += $databui[$i]->{HadaqData}{value}//0; + $totalevents += $databui[$i]->{HadaqEvents}{value}//0; + } + $filesize *= 1E6; + $totaldata *= 1E6; + my $str = Hmon::MakeTitle(11, 8, "EB Summary",1); + $str .= "
"; + $str .= "
"; + $str .= ""; + + $class = "bgn"; + $class = "bor" if $data->{LostRate}{value} > 20; + $class = "brd" if $data->{LostRate}{value} > $data->{EventsRate}{value}/10 && $data->{LostRate}{value} > 20; + $class = "bye" if $data->{EventsRate}{value} < 2; + + $str .= "
Events/s".QA::SciNotation(ceil($data->{EventsRate}{value})); + $str .= "
Data B/s".QA::SciNotation($data->{DataRate}{value}*1E6)."B"; + + $class = "bgn"; + $class = "bor" if $data->{LostRate}{value} > 20; + $class = "brd" if $data->{LostRate}{value} > $data->{EventsRate}{value}/10 && $data->{LostRate}{value} > 20; + + $str .= "
Lost Ev/s".QA::SciNotation(ceil($data->{LostRate}{value}//0)); + $str .= "
"; + + $str .= "
"; + $str .= ""; + + $class = "bgn"; + $class = "bye" if $data->{RunPrefix}{value} eq 'te'; + $class = "bor" if $filesize == 0; + + $str .= "
Run Start ".$runstart; + $str .= "
Run Name ".$data->{RunPrefix}{value}.$data->{RunIdStr}{value}; + $str .= "
File Size".QA::SciNotation($filesize)."B ($builders files)"; + $str .= "
"; + + $str .= "
"; + $str .= ""; + $str .= "
Calib Time".strftime("%d.%m. %H:%M",localtime($data->{LastCalibr}{'time'})); + $str .= "
Calib Success ".($data->{LastCalibr}{quality}*100)."%"; + $str .= "
  "; + $str .= "
"; + + $str .= "
"; + + $str .= "
"; + $str .= ""; + $str .= "
Input Nodes"; + $str .= "
Data B/sEvents/sDropped /s"; + for my $i (1.. scalar @{$data->{Inputs}{value}}){ + + + my $class = "bgn"; + $class = "bye" if ($datainp[$i]->{HadaqEvents}{value}//0) < 2; + $class = "bor" if ($datainp[$i]->{HadaqLostEvents}{value}//0) > 10; + $class = "brd" if ($datainp[$i]->{HadaqLostEvents}{value}//0) > 100; + + my $nodename = $data->{Inputs}{nodes}[$i-1]; + $nodename =~ s%dabc://%%; + $nodename =~ s%:\d+$%%; + + $str .= "
$nodename". + "".QA::SciNotation(($datainp[$i]->{HadaqData}{value}//0)*1E6). + "".QA::SciNotation(ceil($datainp[$i]->{HadaqEvents}{value}//0)). + "".QA::SciNotation(ceil($datainp[$i]->{HadaqLostEvents}{value}//0))."Ev ". + "".QA::SciNotation(($datainp[$i]->{HadaqDroppedData}{value}//0)*1E6)."B " + + + ; + +# $str .= ""; +# for my $j (0 .. (scalar @{$datainp[$i]->{hubs}}) - 1) { +# my $inptext = sprintf("%04x",$datainp[$i]->{hubs}[$j]); +# $str .= "
$inptext
"; +# } + } + $str .= "
"; + + + $str .= "
"; + $str .= ""; + $str .= "
Building Nodes"; + $str .= "
Data RateEvent RateFile SizeLustre"; + for my $i (1 .. $builders){ + my $nodename = $data->{Builders}{nodes}[$i-1]; + $nodename =~ s%dabc://%%; + $nodename =~ s%:\d+$%%; + + $str .= "
$nodename". + "".QA::SciNotation(($databui[$i]->{HadaqData}{value}//0)*1E6). + "".QA::SciNotation(ceil($databui[$i]->{HadaqEvents}{value}//0)). + "".QA::SciNotation(($databui[$i]->{RunFileSize}{value}//0)*1E6). + " "; + } +# $str .= "
Sum".QA::SciNotation($totaldata)."".QA::SciNotation($totalevents)."".QA::SciNotation($filesize).""; + $str .= "
"; + + + $str .= Hmon::MakeFooter(); + Hmon::WriteFile("EBSummary",$str); + + sleep(1); + } + + + #HadaqData HadaqEvents HadaqLostEvents HadaqDroppedData