From e35c54571a3e5088c1547808cc85dcafa9cc921b Mon Sep 17 00:00:00 2001 From: "hadaq@countinghouse" Date: Thu, 3 Jul 2014 17:32:00 +0200 Subject: [PATCH] updates to hmon scripts --- hmon/hmon_trgsource.pl | 2 +- hmon/permanent/hmon_eb_run.pl | 5 +++- hmon/permanent/hmon_magnet.pl | 12 ++++++--- hmon/permanent/hmon_mdchv.pl | 9 ++----- hmon/permanent/hmon_mdcpressure.pl | 4 +-- hmon/permanent/hmon_qaplots.pl | 43 +++++++++++++++++++++--------- hmon/permanent/hmon_vertexplots.pl | 6 ++--- hmon/start.sh | 8 +++--- 8 files changed, 55 insertions(+), 34 deletions(-) mode change 100644 => 100755 hmon/permanent/hmon_magnet.pl diff --git a/hmon/hmon_trgsource.pl b/hmon/hmon_trgsource.pl index 5023855..dfc297c 100755 --- a/hmon/hmon_trgsource.pl +++ b/hmon/hmon_trgsource.pl @@ -169,7 +169,7 @@ while (1) { my $longmsgcheck = $longmsg; #Input polarity wrong? - if($QA::TrgCheckPolarity && (($polarity->{3}->[1] & 0x7fffffff) || $polarity->{3}->[0] & 0x1e0)) { + if($QA::TrgCheckPolarity && (($polarity->{3}->[1] & 0x7fff0000) || $polarity->{3}->[0] & 0x1e0)) { $qastate = QA::WARN; $longmsg .= " - Signal polarity wrong on inputs "; foreach my $i(0..30) { diff --git a/hmon/permanent/hmon_eb_run.pl b/hmon/permanent/hmon_eb_run.pl index 5c55c42..493859c 100755 --- a/hmon/permanent/hmon_eb_run.pl +++ b/hmon/permanent/hmon_eb_run.pl @@ -187,7 +187,10 @@ while(1) { QA::WriteQALog($fqa, "eb", "run", 10, $qastate, $qatitle, "act: $recv/$sent (".$data->{"prefix"}->{val}.")", $qamsg); # if ($totalrate) { - $qastatedisc = QA::GetQAState('below',$totaldiscarded/($totalrate || $totaldiscarded || 1),(0.001,0.01,0.1)); + $qastatedisc = QA::GetQAState('below',$totaldiscarded/($totalrate || $totaldiscarded || 1),(0.01,0.05,0.1)); + if($totalrate < 500) { + $qastatedisc = QA::GetQAState('below',$totaldiscarded || 1,(20,50,100)); + } # } # else { # $qastatedisc = QA::NA; diff --git a/hmon/permanent/hmon_magnet.pl b/hmon/permanent/hmon_magnet.pl old mode 100644 new mode 100755 index a7d4fcb..e8b72ff --- a/hmon/permanent/hmon_magnet.pl +++ b/hmon/permanent/hmon_magnet.pl @@ -9,6 +9,7 @@ use QA; use Getopt::Long; use Data::Dumper; +my $magnet_on = 0; my %range_list = ( 'Time' => {}, @@ -203,17 +204,20 @@ while(1) { } } + if(!$magnet_on) {$fatal_error_string .= "-- MAGNET IS DEFINED TO BE OFF --"; $value = "OFF";} #print $fatal_error_string . "\n"; - if ($fatal_error_counter>3) { $fatal_error_string .= " (last good check at $last_good_time)"; - QA::WriteQALog($flog,"other","magnet",$interval+20,QA::FATAL,$title,$value,$fatal_error_string); + my $state = $magnet_on?(QA::FATAL):(QA::NOTE); + QA::WriteQALog($flog,"other","magnet",$interval+20,$state,$title,$value,$fatal_error_string); } elsif ($red_error_counter > 0) { $fatal_error_string .= " (last good check at $last_good_time)"; - QA::WriteQALog($flog,"other","magnet",$interval+20,QA::ERROR,$title,$value,$fatal_error_string); + my $state = $magnet_on?(QA::ERROR):(QA::NOTE); + QA::WriteQALog($flog,"other","magnet",$interval+20,$state,$title,$value,$fatal_error_string); } elsif ($yellow_error_counter > 0) { $fatal_error_string .= " (last good check at $last_good_time)"; - QA::WriteQALog($flog,"other","magnet",$interval+20,QA::WARN,$title,$value,$fatal_error_string); + my $state = $magnet_on?(QA::WARN):(QA::NOTE); + QA::WriteQALog($flog,"other","magnet",$interval+20,$state,$title,$value,$fatal_error_string); } else { $longtext = "Checked at $time"; QA::WriteQALog($flog,"other","magnet",$interval+20,QA::OK,$title,$value,$longtext); diff --git a/hmon/permanent/hmon_mdchv.pl b/hmon/permanent/hmon_mdchv.pl index b2a5f4d..7285575 100755 --- a/hmon/permanent/hmon_mdchv.pl +++ b/hmon/permanent/hmon_mdchv.pl @@ -13,7 +13,7 @@ use HADES::TrbNet; use HPlot; my $timer = 0; -my @colors = ("#000000", "#ff0000","#00ff00","#0000ff","#cccc00","#cc00cc"); +my @colors = ("#000000", "#ff0000","#00ff00","#0000ff","#cccc00","#009955"); my @names = qw( S1 S2 S3 S4 S5 S6); my @layerlabel = qw(F C); my $connect_status = &trb_init_ports(); @@ -111,12 +111,7 @@ while(1) { #$str .= " \n"; } - $str .= "\n";# - $str .= "
currents trend
\n"; - $str .= "
\n"; - $str .= qq@\n@; - $str .= "
\n"; - $str .= qq@\n@; + $str .= "\n";#{reflowPressureAthm:average}->{val}); + HPlot::PlotAdd("AtmosPress",$data->{reflowPressureAthmaverage}->{val}); HPlot::PlotDraw("AtmosPress"); } diff --git a/hmon/permanent/hmon_qaplots.pl b/hmon/permanent/hmon_qaplots.pl index 3b4c517..44b27a5 100755 --- a/hmon/permanent/hmon_qaplots.pl +++ b/hmon/permanent/hmon_qaplots.pl @@ -33,6 +33,7 @@ my $out = $title;