]> jspc29.x-matter.uni-frankfurt.de Git - hadesdaq.git/commitdiff
mdcLVgui/Sx/2yyx scripts, corrected missing './', PZ
authorHadaq Hades <jan@lxhadeb07>
Fri, 29 Mar 2019 15:36:13 +0000 (16:36 +0100)
committerHadaq Hades <jan@lxhadeb07>
Fri, 29 Mar 2019 15:36:13 +0000 (16:36 +0100)
25 files changed:
control/mdcLVgui/S0/200x
control/mdcLVgui/S0/210x
control/mdcLVgui/S0/220x
control/mdcLVgui/S0/230x
control/mdcLVgui/S1/201x
control/mdcLVgui/S1/211x
control/mdcLVgui/S1/221x
control/mdcLVgui/S1/231x
control/mdcLVgui/S2/202x
control/mdcLVgui/S2/212x
control/mdcLVgui/S2/222x
control/mdcLVgui/S2/232x
control/mdcLVgui/S3/203x
control/mdcLVgui/S3/213x
control/mdcLVgui/S3/223x
control/mdcLVgui/S3/233x
control/mdcLVgui/S4/204x
control/mdcLVgui/S4/214x
control/mdcLVgui/S4/224x
control/mdcLVgui/S4/234x
control/mdcLVgui/S5/205x
control/mdcLVgui/S5/215x
control/mdcLVgui/S5/225x
control/mdcLVgui/S5/235x
utils/MDC_Powercycle_2PSx.pl [new file with mode: 0755]

index 6fa5cb224364610313b8fb956eef0960ffa95a83..ed8ce1588f9ef324044d5374369f2784a9103b66 100755 (executable)
@@ -8,7 +8,7 @@ xterm  -e bash --login -c  '
 ( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
 PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
 
-cd ~/trbsoft/hadesdaq/utils && MDC_Powercycle_2PSx.pl -P 1 -S 1
+cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 1 -S 1
 
   sleep 1
 "
index c176bebfad056ffba88e1d71688515c955aa92d5..d05b090e6975a954fb43616e3971890030ac39de 100755 (executable)
@@ -8,7 +8,7 @@ xterm  -e bash --login -c  '
 ( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
 PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
 
-cd ~/trbsoft/hadesdaq/utils && MDC_Powercycle_2PSx.pl -P 2 -S 1
+cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 2 -S 1
 
   sleep 1
 "
index 4833f8ac0257eb4217cc94d507ebebdb56caa174..ab3451a39091bf3116b59b8068d742d91e611c41 100755 (executable)
@@ -8,7 +8,7 @@ xterm  -e bash --login -c  '
 ( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
 PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
 
-cd ~/trbsoft/hadesdaq/utils && MDC_Powercycle_2PSx.pl -P 3 -S 1
+cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 3 -S 1
 
   sleep 1
 "
index 05857d8475c7cb64f2c83baa66e28ede71403cef..03c4d70d57800245726a5fe1ffc4536084b5865e 100755 (executable)
@@ -8,7 +8,7 @@ xterm  -e bash --login -c  '
 ( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
 PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
 
-cd ~/trbsoft/hadesdaq/utils && MDC_Powercycle_2PSx.pl -P 4 -S 1
+cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 4 -S 1
 
   sleep 1
 "
index f167e3ffeb398ee29fc21ea396f4cbf246067e62..a9248f0be3730861a849c9dfca91fc8a45713d7a 100755 (executable)
@@ -8,7 +8,7 @@ xterm  -e bash --login -c  '
 ( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
 PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
 
-cd ~/trbsoft/hadesdaq/utils && MDC_Powercycle_2PSx.pl -P 1 -S 2
+cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 1 -S 2
 
   sleep 1
 "
index 51f73a763dfc25bfb443c82dfcb39e869b26bd72..b09c7af33600e7f5e828bfe72cc7c50d29de222e 100755 (executable)
@@ -8,7 +8,7 @@ xterm  -e bash --login -c  '
 ( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
 PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
 
-cd ~/trbsoft/hadesdaq/utils && MDC_Powercycle_2PSx.pl -P 2 -S 2
+cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 2 -S 2
 
   sleep 1
 "
index b4381647b364eb9b609530febfab333e746bfe81..27145cfeb55d890e38606e89dd83b85b004bfad5 100755 (executable)
@@ -8,7 +8,7 @@ xterm  -e bash --login -c  '
 ( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
 PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
 
-cd ~/trbsoft/hadesdaq/utils && MDC_Powercycle_2PSx.pl -P 3 -S 2
+cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 3 -S 2
 
   sleep 1
 "
index 982114f2aad39e2ca0890514911d02569e1f4093..397d640ac78955d307274a6d478821c6873703ad 100755 (executable)
@@ -8,7 +8,7 @@ xterm  -e bash --login -c  '
 ( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
 PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
 
-cd ~/trbsoft/hadesdaq/utils && MDC_Powercycle_2PSx.pl -P 4 -S 2
+cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 4 -S 2
 
   sleep 1
 "
index ced9b87a913d146b724b2dc3b5cd421af5e4a340..5aea16e2f616cf76f459bc9db00c0cb53b1af13f 100755 (executable)
@@ -8,7 +8,7 @@ xterm  -e bash --login -c  '
 ( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
 PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
 
-cd ~/trbsoft/hadesdaq/utils && MDC_Powercycle_2PSx.pl -P 1 -S 3
+cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 1 -S 3
 
   sleep 1
 "
index 271dc51d538ce1eb71048a7160d1ed25ec3e4fdf..1665783aa737b7b7d3b91ef0d4065938db110573 100755 (executable)
@@ -8,7 +8,7 @@ xterm  -e bash --login -c  '
 ( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
 PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
 
-cd ~/trbsoft/hadesdaq/utils && MDC_Powercycle_2PSx.pl -P 2 -S 3
+cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 2 -S 3
 
   sleep 1
 "
index 10100eb8ce26bfaa0e2b723b2159c254c05b4bb0..e652c4a279977c1ffe7734dbf04e8515374285af 100755 (executable)
@@ -8,7 +8,7 @@ xterm  -e bash --login -c  '
 ( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
 PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
 
-cd ~/trbsoft/hadesdaq/utils && MDC_Powercycle_2PSx.pl -P 3 -S 3
+cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 3 -S 3
 
   sleep 1
 "
index 5a2182d460316a5ad87f97c40cf5331d3ff4ad1e..b8b41cea1223fa9aeeee3f3418dac2f2b22bee33 100755 (executable)
@@ -8,7 +8,7 @@ xterm  -e bash --login -c  '
 ( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
 PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
 
-cd ~/trbsoft/hadesdaq/utils && MDC_Powercycle_2PSx.pl -P 4 -S 3
+cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 4 -S 3
 
   sleep 1
 "
index e9a420fe707d02ab08fed0de418b9fc050d2c8d3..1fd8532a55a9058ebddcef3b0cfccaee142d09ca 100755 (executable)
@@ -8,7 +8,7 @@ xterm  -e bash --login -c  '
 ( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
 PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
 
-cd ~/trbsoft/hadesdaq/utils && MDC_Powercycle_2PSx.pl -P 1 -S 4
+cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 1 -S 4
 
   sleep 1
 "
index b4c94702237a4b62a6817ce98ee02721d5a113d7..e717b99055f86784e331f4187b6b11f7a9253601 100755 (executable)
@@ -8,7 +8,7 @@ xterm  -e bash --login -c  '
 ( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
 PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
 
-cd ~/trbsoft/hadesdaq/utils && MDC_Powercycle_2PSx.pl -P 2 -S 4
+cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 2 -S 4
 
   sleep 1
 "
index ac7edacaff2a1950e7c6217a40b71ff1a595ff53..bc14847530c3c72deb13644fb7cf487d2e7d5e9b 100755 (executable)
@@ -8,7 +8,7 @@ xterm  -e bash --login -c  '
 ( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
 PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
 
-cd ~/trbsoft/hadesdaq/utils && MDC_Powercycle_2PSx.pl -P 3 -S 4
+cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 3 -S 4
 
   sleep 1
 "
index e457e30c314d1bb2a92cc0a32eaff99005354e74..7d7266b564d6121db9dc2f281137d82de110939c 100755 (executable)
@@ -8,7 +8,7 @@ xterm  -e bash --login -c  '
 ( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
 PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
 
-cd ~/trbsoft/hadesdaq/utils && MDC_Powercycle_2PSx.pl -P 4 -S 4
+cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 4 -S 4
 
   sleep 1
 "
index 9a99013a562fd017672c9b40020176646f387c7d..587ae0e5bda5c402c920366107fb3108091f8a01 100755 (executable)
@@ -8,7 +8,7 @@ xterm  -e bash --login -c  '
 ( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
 PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
 
-cd ~/trbsoft/hadesdaq/utils && MDC_Powercycle_2PSx.pl -P 1 -S 5
+cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 1 -S 5
 
   sleep 1
 "
index dd55771422701a068e93cace8b34a475dd4d15a5..6e9ffe35b7a2b37dda8190520bb8fdd75bc2669e 100755 (executable)
@@ -8,7 +8,7 @@ xterm  -e bash --login -c  '
 ( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
 PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
 
-cd ~/trbsoft/hadesdaq/utils && MDC_Powercycle_2PSx.pl -P 2 -S 5
+cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 2 -S 5
 
   sleep 1
 "
index 6c81e35f0e1ffea9a6019181e92e735f98727710..9af54d1327b3b12a4f3e193f764d58f67bda0cb1 100755 (executable)
@@ -8,7 +8,7 @@ xterm  -e bash --login -c  '
 ( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
 PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
 
-cd ~/trbsoft/hadesdaq/utils && MDC_Powercycle_2PSx.pl -P 3 -S 5
+cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 3 -S 5
 
   sleep 1
 "
index 4a6e56ff6167ab8af6f27b5101f1989c0d3763dd..baee0eedb47a148725cf02b8495b6006df17410e 100755 (executable)
@@ -8,7 +8,7 @@ xterm  -e bash --login -c  '
 ( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
 PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
 
-cd ~/trbsoft/hadesdaq/utils && MDC_Powercycle_2PSx.pl -P 4 -S 5
+cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 4 -S 5
 
   sleep 1
 "
index e665a6e2c77349eb01a34e56d5e8a2b1dfcf6fb8..e3690ea41a5588ce4063aadee17fb27c4df1aa14 100755 (executable)
@@ -8,7 +8,7 @@ xterm  -e bash --login -c  '
 ( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
 PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
 
-cd ~/trbsoft/hadesdaq/utils && MDC_Powercycle_2PSx.pl -P 1 -S 6
+cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 1 -S 6
 
   sleep 1
 "
index 0c209338370e5df1dd96025841bbe073e5ed2115..9ecef18b561e7bf6bcb95e5ea9cf5789fb089ed6 100755 (executable)
@@ -8,7 +8,7 @@ xterm  -e bash --login -c  '
 ( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
 PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
 
-cd ~/trbsoft/hadesdaq/utils && MDC_Powercycle_2PSx.pl -P 2 -S 6
+cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 2 -S 6
 
   sleep 1
 "
index 426e52f3fe6ea86090a3694e1c99a87a404607c3..3fe734a50f7922c66ee6e74f8f19f6f8272e5e41 100755 (executable)
@@ -8,7 +8,7 @@ xterm  -e bash --login -c  '
 ( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
 PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
 
-cd ~/trbsoft/hadesdaq/utils && MDC_Powercycle_2PSx.pl -P 3 -S 6
+cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 3 -S 6
 
   sleep 1
 "
index edc893d903188c36886d3edf649d456956ce5a74..06909a36ab4cabc63743eb52ecbe0fd01ad2f9c5 100755 (executable)
@@ -8,7 +8,7 @@ xterm  -e bash --login -c  '
 ( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
 PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
 
-cd ~/trbsoft/hadesdaq/utils && MDC_Powercycle_2PSx.pl -P 4 -S 6
+cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 4 -S 6
 
   sleep 1
 "
diff --git a/utils/MDC_Powercycle_2PSx.pl b/utils/MDC_Powercycle_2PSx.pl
new file mode 100755 (executable)
index 0000000..92a2aaf
--- /dev/null
@@ -0,0 +1,108 @@
+#!/usr/bin/perl -w 
+use strict;
+use warnings;
+use lib "../nettools/";
+use Perl2Epics;
+use Getopt::Long;
+use File::Basename;
+
+#- the command line option flags
+my $opt_help    = 0;
+my $opt_plane   = -1;
+my $opt_sector  = -1;
+my $opt_address = "";
+my $opt_dryrun  = 0;
+
+GetOptions ('h|help'      => \$opt_help,
+           'n|dryrun'  => \$opt_dryrun,
+           'P|plane=i'   => \$opt_plane,
+           'S|sector=i'  => \$opt_sector);
+
+if( $opt_help ) {
+    &help();
+    exit(0);
+}
+
+my $P=$opt_plane;
+my $S=$opt_sector;
+
+if( &checkArgs() ){
+    print "Exit.\n";
+    exit(1);
+}
+
+my $on = 0;
+my $off = 1;
+
+print "Connect..\n";
+my $s = "HAD:MDC:LV:P" . $P . ":S" . $S . ":SWITCH_set";
+
+if ($opt_dryrun) {
+       print $s . "\n";
+       exit(0);
+}
+
+Perl2Epics::Connect("MDC_LV_Switch",$s);
+
+Perl2Epics::Put("MDC_LV_Switch",$off);
+Perl2Epics::GetAll();
+
+sleep 8;
+Perl2Epics::Put("MDC_LV_Switch",$on);
+
+exit(0);
+#-----------
+
+################### END OF MAIN ####################
+
+sub help()
+{
+    my $scriptname=basename($0);
+    #"MDC_Powercycle_2PSx.pl";
+    print "\n";
+    my $text= << 'EOF';
+$scriptname    
+
+   This script executes a power cycle on MDC LV switches on 
+   PLANE P [1-4] and Sector S  [1-6]
+   using EPICS
+
+Usage:
+   
+   Command line:  $scriptname 
+   [-h|--help]             : Show this help.
+   [-P|--plane <plane>     : sector [1-6].
+   [-S|--sector <sector>]  : plane [1-4]
+
+Examples:
+  
+   $scriptname -P 1 -S 2
+
+EOF
+    $text =~ s/\$scriptname/$scriptname/g;
+    print $text;
+}
+
+sub checkArgs()
+{
+    my $retVal = 0;
+
+    #use either P/S or address
+    unless( $opt_plane != -1 && $opt_sector != -1 ){
+       print "You should use either '-P AND -S'' or '-a' options\n" . " " . __LINE__ . "\n";
+       $retVal = 1;
+    }
+
+    if(  $opt_sector < 1 || $opt_sector > 6 ){
+       print "sector out of range [1-6]\n";
+       $retVal = 1;
+    }
+
+    if(  $opt_plane < 1 || $opt_plane > 4 ){
+       print "plane out of range [1-4]\n";
+       $retVal = 1;
+    }
+
+    return $retVal;
+}
+