From: hadaq Date: Mon, 29 Dec 2025 15:51:05 +0000 (+0100) Subject: update control scripts X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=2035b6372ec1400b8dc3a39bff9e753a1e1ebc0f;p=hadesdaq.git update control scripts --- diff --git a/control/gui/call_programs_wrapper_lxhadeb06.sh b/control/gui/call_programs_wrapper_lxhadeb06.sh deleted file mode 100755 index ba93d5a..0000000 --- a/control/gui/call_programs_wrapper_lxhadeb06.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/qa/Buttons2.pm b/control/qa/Buttons2.pm deleted file mode 100644 index 7773799..0000000 --- a/control/qa/Buttons2.pm +++ /dev/null @@ -1,342 +0,0 @@ -package Buttons2; - -use strict; -use warnings; - -use QtCore4 ; -use QtGui4; - -use Data::Dumper; -use QtCore4::debug qw(ambiguous); - - -#use Qt::isa qw(Qt::Widget); -#use QtCore4::isa qw(Qt::Widget); -#use QtCore4; - -use QtCore4::isa qw( Qt::Widget ); - -use QtCore4::slots - hide_expert_checked => ['int']; - - -sub groupBox_3 { - return shift->{groupBox_3}; -} - -sub hide_expert_checked { - my ( $state) = @_; - - if($state == Qt::Unchecked()) { - this->{self}->{groupBox_4}->hide(); - } - else { - this->{self}->{groupBox_4}->show(); - } -} - - -use Data::Dumper; - - - -# # make slots -my $str; -$str = "use QtCore4::slots\n slotQuitPressed => [], "; -foreach my $i (0..150) { - $str .= " slot". $i . "Pressed => [], "; -} -$str .= "slotdummyPressed => [];"; - -#print "will eval command: $str\n"; -eval $str; -#print "error: $@\n"; - - -# } - - - -sub NEW { - my ( $class, $mainWindow ) = @_; - $class->SUPER::NEW($mainWindow); - - my $self = bless {}, $class; - - this->{self} = $self; - - $self->{ra_buttons} = []; - - #print "self: "; print Dumper $self; - #print "this: "; print Dumper this; - - #my $self = $mainWindow; - if ( !defined $mainWindow->objectName() ) { - $mainWindow->setObjectName( "mainWindow" ); - } - #$mainWindow->resize( 800, 600 ); - #$mainWindow->resize( 400, 300 ); - - #$self->{hide_expert_checked} = hide_expert_checked; - - my $centralwidget = Qt::Widget( $mainWindow ); - $self->{centralwidget} = $centralwidget; - $centralwidget->setObjectName( "centralwidget" ); - - my $vl_mw = Qt::VBoxLayout( $centralwidget ); - -# my $layoutWidget = Qt::Widget( $centralwidget ); -# $self->{layoutWidget} = $layoutWidget; -# $layoutWidget->setObjectName( "layoutWidget" ); - #$layoutWidget->setGeometry( Qt::Rect(30, 110, 723, 418) ); -# my $horizontalLayout = Qt::HBoxLayout( $centralwidget ); - my $horizontalLayout = Qt::HBoxLayout( ); - $self->{horizontalLayout} = $horizontalLayout; - $horizontalLayout->setObjectName( "horizontalLayout" ); - $horizontalLayout->setContentsMargins(0, 0, 0, 0 ); - - #$horizontalLayout->addStretch(1); - - my $groupBox_1 = Qt::GroupBox( $centralwidget ); - $self->{groupBox_1} = $groupBox_1; - $groupBox_1->setObjectName( "groupBox_1" ); - my $vl_gb1 = Qt::VBoxLayout( $groupBox_1 ); - $self->{vl_gb1} = $vl_gb1; - $vl_gb1->setObjectName( "vl_gb1" ); - - - - $horizontalLayout->addWidget( $groupBox_1 ); - - - - -# my $groupBox_4 = Qt::GroupBox( $centralwidget ); -# $self->{groupBox_4} = $groupBox_4; -# $groupBox_4->setObjectName( "groupBox_4" ); -# -# #$groupBox_3->setCheckable(1); -# #$groupBox_3->setChecked(0); -# $groupBox_4->hide(); -# -# -# my $vl_gb4 = Qt::VBoxLayout( $groupBox_4 ); -# $self->{vl_gb4} = $vl_gb4; -# $vl_gb4->setObjectName( "vl_gb4" ); -# -# $horizontalLayout->addWidget( $groupBox_4 ); -# -# -# - my $vl_top = Qt::VBoxLayout( ); - $self->{vl_top} = $vl_top; - $vl_top->setObjectName( "vl_top" ); - $vl_top->setContentsMargins(0, 0, 0, 0 ); - - $vl_mw->addLayout($vl_top); - $vl_mw->addLayout($horizontalLayout); -# -# -# # my $pushButton = Qt::PushButton( $centralwidget ); -# # $self->{pushButton} = $pushButton; -# # $pushButton->setObjectName( "pushButton" ); -# -# # my $sizePolicy = Qt::SizePolicy( Qt::SizePolicy::Minimum(), Qt::SizePolicy::Fixed() ); -# # $self->{$sizePolicy} = $sizePolicy; -# # $sizePolicy->setHorizontalStretch( 0 ); -# # $sizePolicy->setVerticalStretch( 0 ); -# # $sizePolicy->setHeightForWidth( $pushButton->sizePolicy()->hasHeightForWidth() ); -# # $pushButton->setSizePolicy( $sizePolicy ); -# # $pushButton->setMinimumSize( Qt::Size(0, 0) ); -# # my $icon = Qt::Icon; -# # $icon->addPixmap(Qt::Pixmap("/usr/share/icons/oxygen/64x64/apps/preferences-desktop-icons.png"), Qt::Icon::Normal(), Qt::Icon::Off() ); -# # $icon->addPixmap(Qt::Pixmap("close_window.png"), Qt::Icon::Normal(), Qt::Icon::Off() ); -# #$icon->addPixmap(Qt::Pixmap("/usr/share/icons/oxygen/64x64/apps/preferences-system-login.png"), Qt::Icon::Normal(), Qt::Icon::On() ); -# # $pushButton->setIcon( $icon ); -# # $pushButton->setIconSize( Qt::Size(50, 50) ); -# -# # $vl_top->addWidget( $pushButton ); -# -# my $checkBox = Qt::CheckBox( $centralwidget ); -# $self->{checkBox} = $checkBox; -# $checkBox->setObjectName( "checkBox" ); -# -# $vl_top->addWidget( $checkBox ); - - $mainWindow->setCentralWidget( $centralwidget ); - my $menubar = Qt::MenuBar( $mainWindow ); - $self->{menubar} = $menubar; - $menubar->setObjectName( "menubar" ); - #$menubar->setGeometry( Qt::Rect(0, 0, 800, 25) ); - $mainWindow->setMenuBar( $menubar ); - my $statusbar = Qt::StatusBar( $mainWindow ); - $self->{statusbar} = $statusbar; - $statusbar->setObjectName( "statusbar" ); - $mainWindow->setStatusBar( $statusbar ); - - $self->retranslateUi( $mainWindow ); - - - my $cur_button_number = 0; - - my $dir; - my $buttons = []; - - - make_buttons($self, "QA", \$cur_button_number, $groupBox_1, $vl_gb1); - #print "cur_button: $cur_button_number\n"; - - #$layoutWidget->updateGeometry(); - - -# Qt::Object::connect($pushButton, SIGNAL 'clicked()' , $mainWindow, SLOT 'close()' ); - - -# Qt::Object::connect($checkBox, SIGNAL 'stateChanged(int)' , -# this, SLOT 'hide_expert_checked(int)' ); - - Qt::MetaObject::connectSlotsByName( $mainWindow ); - - return $self; - -} - - -sub retranslateUi { - my ( $self, $mainWindow ) = @_; - $mainWindow->setWindowTitle( Qt::Application::translate( 'MainWindow', "Online QA", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{groupBox_1}->setTitle( Qt::Application::translate( 'MainWindow', "QA", undef, Qt::Application::UnicodeUTF8() ) ); - - -} # retranslateUi - - - - -sub make_buttons { - (my $self, my $dir, my $r_current_button_number, my $bgrp, my $layout) = @_; - - #print $bgrp; - #print "current number_; $r_current_button_number\n"; - - my $c = qq"find $dir -maxdepth 1 -type f| sort"; - my @f = qx($c); - - my $i = $$r_current_button_number; - - my $button_list=[]; - - foreach (@f) { - next if /.png$/i; - chomp; - s/.*\///; - next if /\~$/; - push @$button_list, $_; - my $br = $self->{ra_buttons}; - push @{$br}, $_; - } - - - - - foreach my $cur_button_name (@$button_list) { - - - next if ($cur_button_name =~ /.png$/); -# my $icon->addPixmap(Qt::Pixmap("/usr/share/icons/oxygen/64x64/apps/preferences-desktop-icons.png"), Qt::Icon::Normal(), Qt::Icon::Off() ); - my $icon_path = "$dir/$cur_button_name" . ".png"; -# print "path: $icon_path_file \n"; -# my $fh_icon; -# my $res = open($fh_icon, "<", $icon_path_file); -# my @file = <$fh_icon>; -# $fh_icon->close(); - - #/usr/share/icons/hicolor/48x48/apps/ -# my ($icon_name) = grep /Icon=/, @file; -# $icon_name =~ s/Icon=//; -# my $icon_path = "/usr/share/icons/hicolor/48x48/apps/$icon_name"; -# print "got icon path: $icon_path \n"; - - - my $name = $cur_button_name; - $name =~ s/^\d+_//; - $name =~ s/_/ /g; - - - my $com = qq| -my \$pb$i = Qt::PushButton("$cur_button_name", \$bgrp); -\$self->{pb$i} = \$pb$i; -\$layout->addWidget( \$pb$i ); -\$pb$i->setText ( Qt::Application::translate( 'MainWindow', "$name", undef, - Qt::Application::UnicodeUTF8() ) ); - -my \$icon$i = Qt::Icon; -\$icon$i->addPixmap(Qt::Pixmap(\"$icon_path\"), Qt::Icon::Normal(), Qt::Icon::Off() ); - -\$pb$i->setIcon( \$icon$i ); -\$pb$i->setIconSize( Qt::Size(50, 50) ); - -|; - - -# my $pb_$i = Qt::PushButton("$_", \$bgrp); -# $self->{pb$i} = $pb_$i; -# $layout->addWidget( $pb_$i ); -# $pushButton->setIcon( $icon ); -# $pushButton->setIconSize( Qt::Size(50, 50) ); -# $pb$i->setText ( Qt::Application::translate( 'MainWindow', "$name", undef, Qt::Application::UnicodeUTF8() ) ); - - -#/usr/share/icons/hicolor/48x48/apps/yast-bootloader.png - - # print "command1: $com\n"; - - #print "command: $com\n"; - eval $com; - print "$@\n" if ($@); - - -#my $iconstr = "$icon" . "$i"; - -$com = qq | -|; - - - - #Qt::Object::connect($pushButton, SIGNAL 'clicked()' , $mainWindow, SLOT 'close()' ); - $com = qq|Qt::Object::connect(\$self->{pb$i}, SIGNAL 'clicked()', this, SLOT 'slot| . $i . qq|Pressed()');|; - #print "command2: $com\n"; - eval $com; - print "error: " , $@ , "\n" if ($@); - - make_subroutine($i, $dir); - - $i++; - #last if $i >=10; - } - - $$r_current_button_number = $i; -} - - -sub make_subroutine { - (my $i, my $dir) = @_; - # make subroutines - #sub slot0Pressed { my $c = buttons->[0]; $c = "cd ../control; ./$c"; print "will execute: $c\n"; qx($c); } - - my $str = qq|sub slot| . $i . qq|Pressed { my \$s = this->{self}->{ra_buttons}->[$i]; my \$str="\$dir/\$s"; my \$c = "cd \$dir; control_gui_logger.sh QA \$str; ./\$s &"; print "will execute: \$c\n"; system(\$c); }|; -# my $str = qq|sub slot| . $i . qq|Pressed { print "$i pressed\n"; }|; -#system(\$c); }|; - #print "sub: $str\n"; - eval $str; -} - - -# sub slotQuitPressed { -# exit; -# } - -#sub slot0Pressed { my $c = buttons->[0]; $c = "cd ../control; ./$c"; print "will execute: $c\n"; qx($c); } - - -1; diff --git a/control/qa/QA/10_Start_OnlineQA b/control/qa/QA/10_Start_OnlineQA deleted file mode 100755 index a4c888a..0000000 --- a/control/qa/QA/10_Start_OnlineQA +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -/home/hades-qa/bin/start_OLM.sh & diff --git a/control/qa/QA/10_Start_OnlineQA.png b/control/qa/QA/10_Start_OnlineQA.png deleted file mode 100644 index 7b3568d..0000000 Binary files a/control/qa/QA/10_Start_OnlineQA.png and /dev/null differ diff --git a/control/qa/QA/11_Stop_OnlineQA b/control/qa/QA/11_Stop_OnlineQA deleted file mode 100755 index d0aa708..0000000 --- a/control/qa/QA/11_Stop_OnlineQA +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -/home/hades-qa/bin/stop_OLM.sh diff --git a/control/qa/QA/11_Stop_OnlineQA.png b/control/qa/QA/11_Stop_OnlineQA.png deleted file mode 100644 index cd4fd05..0000000 Binary files a/control/qa/QA/11_Stop_OnlineQA.png and /dev/null differ diff --git a/control/qa/QA/15_Vertex_Reconstruction b/control/qa/QA/15_Vertex_Reconstruction deleted file mode 100755 index 632ae9f..0000000 --- a/control/qa/QA/15_Vertex_Reconstruction +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -/home/hades-qa/bin/VertexReconstruction.sh & diff --git a/control/qa/QA/15_Vertex_Reconstruction.png b/control/qa/QA/15_Vertex_Reconstruction.png deleted file mode 100644 index ea34349..0000000 Binary files a/control/qa/QA/15_Vertex_Reconstruction.png and /dev/null differ diff --git a/control/qa/QA/20_Arrange_Windows b/control/qa/QA/20_Arrange_Windows deleted file mode 100755 index c8d7f73..0000000 --- a/control/qa/QA/20_Arrange_Windows +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -/home/hades-qa/bin/moveQAwindows.pl & diff --git a/control/qa/QA/screenshot_QHF_1.png b/control/qa/QA/screenshot_QHF_1.png deleted file mode 100644 index 2fb3c91..0000000 Binary files a/control/qa/QA/screenshot_QHF_1.png and /dev/null differ diff --git a/control/qa/call_programs2.pl b/control/qa/call_programs2.pl deleted file mode 100755 index 360b8c8..0000000 --- a/control/qa/call_programs2.pl +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/perl -w - -package main; - -use warnings; -use strict; -use QtCore4; -use QtGui4; -use Buttons2; - -sub main { - - my $a = Qt::Application(\@ARGV); - my $w = Qt::MainWindow; - my $u = Buttons2($w); - $w->show(); - exit $a->exec(); -} - - -main(); - diff --git a/control/qa/call_programs_local.sh b/control/qa/call_programs_local.sh deleted file mode 100755 index 800f03a..0000000 --- a/control/qa/call_programs_local.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -cd /home/hadaq/trbsoft/hadesdaq/control/qa/ -./call_programs_wrapper.sh -geometry 300x300-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/qa/call_programs_wrapper.sh b/control/qa/call_programs_wrapper.sh deleted file mode 100755 index b10ce53..0000000 --- a/control/qa/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/qa/ -/home/hadaq/trbsoft/daq/control/qa/call_programs2.pl $ARGV