]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
extra options for the readout script
authorCahit <c.ugur@gsi.de>
Fri, 12 Jul 2013 11:16:41 +0000 (13:16 +0200)
committerCahit <c.ugur@gsi.de>
Fri, 12 Jul 2013 11:16:41 +0000 (13:16 +0200)
users/mainz_dircBarrel/start_readout.pl

index e1fe61bf0429ac1235ae0394ecf36abd3fadeca4..ad0594e5692c6041dee7538666f72acefbb2c442 100755 (executable)
@@ -16,9 +16,9 @@ my $c;
 
 my $result = GetOptions (
     "h|help"    => \$help,
-    "t|time=i"  => \$time#,
-#    "l|label=s" => \$label,
-#    "p|path=s"  => \$dataPath
+    "t|time=i"  => \$time,
+    "l|label=s" => \$label,
+    "p|path=s"  => \$dataPath
     );
 
 if($help) {
@@ -26,23 +26,28 @@ if($help) {
     print "-h --help\tPrints the usage manual\n";
     print "-t --time\tDefine length of time in seconds for data taking (Default = -1)\n";
     print "\t\tFor unlimited data taking define <time> as -1.\n";
-#    print "-l --label\tDefine label for the daq_evtbuild and daq_netmem processes (Default = test)\n";
-#    print "-p --path\tDefine path for saving data (Default = ~/trbsoft/data\)\n";
+    print "-l --label\tDefine label for the daq_evtbuild and daq_netmem processes (Default = test)\n";
+    print "-p --path\tDefine path for saving data (Default = ~/trbsoft/data\)\n";
     print "\n";
     exit;
 }
 
 
-$c=q|pkill -f "daq_evtbuild -S test"|; qx($c); # if any, kill existing daq_evtbuild
-$c=q|pkill -f "daq_netmem -S test"|;   qx($c); # if any, kill existing daq_netmem
+$c=qq|pkill -f "daq_evtbuild -S $label"|; qx($c); # if any, kill existing daq_evtbuild
+$c=qq|pkill -f "daq_netmem -S $label"|;   qx($c); # if any, kill existing daq_netmem
 
 
-$c=q|xterm -geometry 122x14-0+0 -e bash -c 'daq_evtbuild -S test -m 4 -d file -o ~/trbsoft/data'|;
+$c=qq|xterm -geometry 122x14-0+0 -e bash -c 'daq_evtbuild -S $label -m 4 -d file -o $dataPath'|;
+print $c;
+exit;
+
 system("$c &");
+
 sleep 1;
-$c="xterm -geometry 82x17-0+210 -e bash -c 'daq_netmem -S test -m 4 -i UDP:127.0.0.1:50000 -i UDP:127.0.0.1:50002 -i UDP:127.0.0.1:50003 -i UDP:127.0.0.1:50004 '";
+$c=qq"xterm -geometry 82x17-0+210 -e bash -c 'daq_netmem -S $label -m 4 -i UDP:127.0.0.1:50000 -i UDP:127.0.0.1:50002 -i UDP:127.0.0.1:50003 -i UDP:127.0.0.1:50004 '";
 system("$c &");
 
+print "Saving data to $dataPath\n";
 
 if($time == -1) {
     print "Data taking will run until manual quit with Ctrl+C\n\n";
@@ -50,6 +55,6 @@ if($time == -1) {
 else {
     print "Data taking will run for $time seconds.\n\n";
     sleep $time;
-    $c=q|pkill -f "daq_evtbuild -S test"|; qx($c);
-    $c=q|pkill -f "daq_netmem -S test"|;   qx($c);
+    $c=qq|pkill -f "daq_evtbuild -S $label"|; qx($c);
+    $c=qq|pkill -f "daq_netmem -S $label"|;   qx($c);
 }