elsif ($p->{$name}->{type} == TYPE_HEATMAP) {
plot_write($fh,"set view map");
plot_write($fh,"set palette rgbformulae 22,13,-31");
+ plot_write($fh,$p->{$name}{additional});
if ($p->{$name}->{showvalues} == 0) {
#plot_write($fh,"splot '-' matrix with image");
$p->{$name}->{plot_string} .= "plot '-' matrix with image \n"
our @MdcVoltageLimits = (50, 60, 100);
our @MdcLockLimits = (0, 3, 5);
our @MdcTempLimits = (75, 80, 85);
-our @RichInnerTempLimits = (29,30,31);
+our @RichInnerTempLimits = (31,32,33);
our @TrgErrLimits = (100, 1000, 10000);
our @CPULimits = (95, 100, 100);
our @TimeoutLimits = (0, 0, 1);
return sprintf("%ik", $v / 1000.) if (abs($v) < 1E6) ;
return sprintf("%.1fM", $v / 1000000.) if (abs($v) < 20E6) ;
return sprintf("%iM", $v / 1000000.) if (abs($v) < 1E9) ;
+ return sprintf("%.2fG", $v / 1E9) if (abs($v) < 20E9) ;
return sprintf("%i",$v);
}
else {
}
unless($iter % 8) {
HPlot::PlotDraw('BusyTimes');
- my $maxpercent = max($diff->{0x8000}->[0],$diff->{0x8000}->[1],$diff->{0x8000}->[2],$diff->{0x8000}->[3],$diff->{0x8000}->[5],$diff->{0x8000}->[6],$diff->{0x8000}->[7],$diff->{0x8000}->[9],);
+ my $maxpercent = max(@{$diff->{0x8000}});
my $msgstr = sprintf("%3.1f%%",$maxpercent);
my $qastate = QA::OK;
$qastate = QA::ERROR if ($maxpercent > 99);
use Perl2Epics;
use HADES::TrbNet;
-my $SLEEP_TIME = 0.5; # in seconds
-my $NUM_AVERAGES = 10;
+my $SLEEP_TIME = 1; # in seconds
+my $NUM_AVERAGES = 5;
my $offset = 2;
my $last_rate_endp = 0;
my $opt_addr = 3; #CTS
--- /dev/null
+#!/usr/bin/perl -w
+
+use warnings;
+use strict;
+use Data::Dumper;
+use Data::TreeDumper;
+use Hmon;
+use QA;
+use HADES::TrbNet;
+use HPlot;
+use Time::HiRes qw(usleep time);
+use List::Util qw[min max];
+
+for my $i (0..5) {
+ HPlot::PlotInit( {
+ name => "EcalRateFast$i",
+ file => "files/EcalRateFast$i",
+ title => "",
+ entries => 21,
+ curves => 8,
+ type => HPlot::TYPE_HEATMAP,
+ output => HPlot::OUT_PNG,
+ zlabel => "Hitrate",
+ sizex => 400,
+ sizey => 150,
+ nokey => 1,
+ buffer => 1,
+ xmin => -0.5,
+ xmax => 20.5,
+ ymin => 7.5,
+ ymax => -0.5,
+ cbmax => "100<*<100000",
+ cbmin => 0,
+ noinit => 1,
+ additional => "set logscale cb;",
+ showvalues => 0, });
+ }
+for my $i (0..5) {
+ HPlot::PlotInit( {
+ name => "EcalRateSlow$i",
+ file => "files/EcalRateSlow$i",
+ title => "",
+ entries => 21,
+ curves => 8,
+ type => HPlot::TYPE_HEATMAP,
+ output => HPlot::OUT_PNG,
+ zlabel => "Hitrate",
+ sizex => 400,
+ sizey => 150,
+ nokey => 1,
+ buffer => 1,
+ xmin => -0.5,
+ xmax => 20.5,
+ ymin => 7.5,
+ ymax => -0.5,
+ cbmax => "100<*<100000",
+ cbmin => 0,
+ noinit => 1,
+ additional => "set logscale cb;",
+ showvalues => 0, });
+ }
+for my $i (0..5) {
+ HPlot::PlotInit( {
+ name => "EcalRateDiff$i",
+ file => "files/EcalRateDiff$i",
+ title => "",
+ entries => 21,
+ curves => 8,
+ type => HPlot::TYPE_HEATMAP,
+ output => HPlot::OUT_PNG,
+ zlabel => "Hit ratio",
+ sizex => 400,
+ sizey => 150,
+ nokey => 1,
+ buffer => 1,
+ xmin => -0.5,
+ xmax => 20.5,
+ ymin => 7.5,
+ ymax => -0.5,
+ cbmax => "1.1<*<10",
+ cbmin => "0.1<*<0.9",
+ noinit => 0,
+ showvalues => 0, });
+ }
+
+my $str = Hmon::MakeTitle(16, 20, "ECal Hit Rate",0);
+for my $i (0..5) {
+ $str .= qq@<img src="%ADDPNG files/EcalRateFast$i.png%" type="image/png">\n
+ <img src="%ADDPNG files/EcalRateSlow$i.png%" type="image/png">\n
+ <img src="%ADDPNG files/EcalRateDiff$i.png%" type="image/png"><br>\n@;
+ };
+$str .="left:fast channel, middle:slow channel. right: ratio fast/slow.<br>Sectors from top to bottom. x-axis Padiwa 0..21, y-axis channel #";
+$str .= Hmon::MakeFooter();
+Hmon::WriteFile("ECalRate",$str);
+
+
+my $old;
+my $oldtime = time();
+my $time = time();
+my $diff;
+my $iter = 0;
+
+trb_init_ports() or die trb_strerror();
+
+
+while(1) {
+ my $o = trb_register_read_mem(0xfe71,0xc000,0,49) or die trb_strerror() or sleep 5 and next;
+
+ if (defined $old) {
+ my $tdiff = time() - $oldtime;
+ foreach my $b (keys %$o) {
+ my $sec = ($b>>4) & 0x7;
+ for my $v (0..23) {
+ my $xpos = ($b&0xF)*3 + int($v/8);
+
+ my $vdiff = ($o->{$b}->[$v*2+1]&0xffffff) - ($old->{$b}->[$v*2+1]&0xffffff);
+ if ($vdiff < 0) { $vdiff += 2**24;}
+ $diff->{$b}->[$v*2+1] = $vdiff/($tdiff|1);
+
+ $vdiff = ($o->{$b}->[$v*2+2]&0xffffff) - ($old->{$b}->[$v*2+2]&0xffffff);
+ if ($vdiff < 0) { $vdiff += 2**24;}
+ $diff->{$b}->[$v*2+2] = $vdiff/($tdiff|1);
+
+ my $ratio = ($diff->{$b}->[$v*2+1]||0) / ($diff->{$b}->[$v*2+2]||1);
+
+ HPlot::PlotFill('EcalRateFast'.$sec,$diff->{$b}->[$v*2+1],$xpos,$v % 8);
+ HPlot::PlotFill('EcalRateSlow'.$sec,$diff->{$b}->[$v*2+2],$xpos,$v % 8);
+ HPlot::PlotFill('EcalRateDiff'.$sec,$ratio,$xpos,$v % 8);
+ }
+ }
+ for my $i (0..5) {
+ HPlot::PlotDraw('EcalRateFast'.$i);
+ HPlot::PlotDraw('EcalRateSlow'.$i);
+ HPlot::PlotDraw('EcalRateDiff'.$i);
+ }
+ }
+ $old = $o;
+ $oldtime = time();
+ sleep 2;
+ }
Hmon::WriteFile("GbeRate",$str);
-system('./hmon_hadplot.sh -yscale 1024 -yoverflow 4096 -ytitle "Data Rate [MiB]" -ymax 52 -output "PNG.files/gberate.460.265" gberate &');
+system('./hmon_hadplot.sh -yscale 1024 -yoverflow 4096 -ytitle "Data Rate [MiB]" -ymax 102 -output "PNG.files/gberate.460.265" gberate &');
#
return 0;
}
-
+my $oldgberate;
while (1) {
my $boardlist = "";
my $rh_status = trb_register_read(0x0003, 0xa0f8) or sleep 5 and next;
my $rh_evts = trb_register_read(0x0002, 0x0001) or sleep 5 and next;
+ my $gbe_rate = trb_register_read(0xff7f, 0x83f3) or sleep 5 and next;
+# $regoffset = [10];
+# $regwidth = [22];
$rate = (($rh_evts->{2} || 0) & 0xffff) - $evtnum;
while ($rate < 0) {$rate += 2**16;}
my $status = "";
my $longmsg = "Read-out has no error";
+ my $gbesum = 0;
+ if($oldgberate) {
+ foreach my $h (keys %{$gbe_rate}) {
+ my $t = ($gbe_rate->{$h} - $oldgberate->{$h});
+ $t += 2**32 if $t < 0;
+ $gbesum += $t;
+ }
+ $status = QA::SciNotation($gbesum)."B/s";
+ }
+ $oldgberate = $gbe_rate;
+
if($rate == 0 && ($rh_status->{3} & (1 << 31)) && ($rh_status->{3} & 0x3ff00000)) {
my $rh_hubs = trb_register_read(0xfffe,0x81) or sleep 5 and next;
foreach my $h (sort keys %$rh_hubs) {
QA::WriteQALog($fqa, "daq", "readout", 30, $qastate,"Read-out", $status,$longmsg);
# print $qastate." ".$status." ".$longmsg."\n";
- sleep(5);
+ sleep(1);
}
HPlot::PlotInit($plot0);
-my $str = Hmon::MakeTitle(20, 17, "RICH Hit Rate");
+my $str = Hmon::MakeTitle(20, 17, "RICH Hit Rate",0);
$str .= qq@<img src="%ADDPNG files/RichRateQ0.png%" type="image/png"><br>\n@;
$str .= qq@<img src="%ADDPNG files/RichRateQ1.png%" type="image/png"><br>\n@;
$str .= qq@<img src="%ADDPNG files/RichRateQ2.png%" type="image/png"><br>\n@;
<li style="width:600px;"><a href="monitor.cgi?3-window-logfile">Logfile (most important messages)</a></li>
<li style="width:600px;"><a href="monitor.cgi?10-window-chat">Chat Log</a></li>
<li style="width:600px;"><a href="http://cerberus.x-matter.uni-frankfurt.de:8888/daqtools/index.pl" target="_blank">Web Tools</a></li>
+<li style="width:600px;"><a href="http://cerberus.x-matter.uni-frankfurt.de:8888/eb/" target="_blank">Eventbuilder Monitor</a></li>
</ul></div>
<div class="linkbox" style="width:730px;"><h4>Other Ressources</h4><ul>
<li style="width:600px;"><a href="files/qa.htm">QA Plots (updated every 5 minutes)</a></li>
<li style="width:500px;"><a href="files/vertex.htm">Vertex Plots (updated after each file)</a></li>
-<li style="width:500px;"><a href="https://hades-db.gsi.de/pls/hades_webdbs/hades_oper.hlogbook2.form_selection">Beamtime Logbook</a></li>
+<li style="width:500px;"><a href="http://cerberus.x-matter.uni-frankfurt.de:8888/logbook">Beamtime Logbook</a></li>
<li style="width:500px;"><a href="http://cerberus.x-matter.uni-frankfurt.de:9999/icinga">Icinga Server Monitoring</a>
<li style="width:500px;"><a href="http://cerberus.x-matter.uni-frankfurt.de:8888/munin">Munin Server Monitoring</a></li>
<li style="width:500px;"><a href="archive">Archive of Hmon Windows (updated every 10 minutes)</a></li>
# softirq: servicing softirqs
#my @srv = qw(lxhadeb01 lxhadeb02 lxhadeb03 lxhadeb04 lxhadeb05 lxhadeb06 lxhadesdaq hadesdaq01 hadesdaq02 hades30 hades31 hades33); #dcs02-07
-my @srv = qw(lxhadeb02 lxhadeb03 lxhadeb04 lxhadeb05 lxhadeb06 lxhadeb07 lxhadeb08 lxhadeb09 lxhadeb10 lxhadesdaq hadesdaqp02 hadesdaq03 hadesdaq04 hades30 hadesp31 depcp418 hades33
+my @srv = qw(lxhadeb02 lxhadeb03 lxhadeb04 lxhadeb05 lxhadeb06 lxhadeb08 lxhadeb09 lxhadeb10 lxhadeb07 lxhadesdaq hadesdaqp02 hadesdaq03 hadesdaq04 hades30 hadesp31 depcp418 hades33
lxhaddcs03p lxhaddcs04p lxhaddcs05p lxhaddcs06p);
$str .= "<td ";
$str .= sprintf("title=\"busy %.1f, sys %.1f, wait %.1f, irq %.1f\" ",$busy,$sys,$io,$irq);
$str .= sprintf("style=\"background-color:%4s;\">%2i",Hmon::findcolor($busy||.001,0,100,0),$busy);
- if($s>0 && $s<4 && $max < $busy && $c>=2 && $c<=11) {
+ if($s>=0 && $s<8 && $max < $busy) {
$max = $busy;
$maxstr = sprintf("%d%%",$max);
$busystr = sprintf("Max. Load: %.1f%% on %s CPU %d (sys %.1f, wait %.1f, irq %.1f)",$max,$srv[$s],$c,$sys,$io,$irq);
my $str = "";
my ($hub_href) = @_;
- $str = Hmon::MakeTitle(20,12,"Hub Monitor",1);
+ $str = Hmon::MakeTitle(20,14,"Hub Monitor",1);
$str .= '<table class="hubmon"><tr><td colspan=5><pre>';
chomp($msg);
$str .= "Status: ";
--- /dev/null
+#!/usr/bin/perl -w
+use strict;
+use warnings;
+use Time::HiRes qw( gettimeofday usleep time );
+use POSIX qw(strftime);
+use FileHandle;
+use Data::Dumper;
+use POSIX qw/floor ceil/;
+use List::Util qw/min max/;
+use Hmon;
+use HADES::TrbNet;
+use HPlot;
+use JSON::XS;
+
+#my $flog = QA::OpenQAFile();
+my @colors = ("#333333","#00ff00","#ff0000","#0000ff","#dddd00","#dd00dd");
+
+
+my $plot = {
+ name => "RichTempHistDiRICH",
+ file => "files/RichTempHistDiRICH",
+ entries => 6000,
+ type => HPlot::TYPE_HISTORY,
+ output => HPlot::OUT_PNG,
+ titles => ["0xe100","0xe101","0xe102","0xe103","0xe104","0xe105","0xe106","0xe107","0xe108","0xe109","0xe110","0xe111","0xe112","0xe113","0xe114","0xe115","0xe116","0xe117"],
+ #titles => ['min','max','mean'],
+ xlabel => "Minutes",
+ ylabel => "Temperature [°C]",
+ sizex => 950,
+ sizey => 360,
+ #ymin => "*<15",
+ #ymax => "40<*",
+ curves => 18,
+ xscale => 30,
+ storable=> 1,
+ colors => ["#333333","#00ff00","#ff0000","#0022ff","#9a176d","#b844b8","#555555","#22ff22","#ffaaaa","#2222ff","#2d9c94","#777777","#55ff77","#ff7755","#7575ff","#aadd47","#aa0033","#316022","#09b9df"],
+ additional => "set offsets 0,0,1.5,1.5"
+# colors => ["#333333","#00ff00","#ff0000"]
+ };
+HPlot::PlotInit($plot);
+
+
+my $timer = 0;
+my $str = "";
+
+
+#OVERCURRENT variables
+my $overcurrent_flag = 0;
+my $OVERCURRENT_YELLOW = 200;
+my $OVERCURRENT_RED = 300;
+
+my $OVERCURRENT_period = 3;
+my $overcurrent_alarm_flag = 0;
+my $current_average = 0;
+my $current_sum = 0;
+
+my $errortimer = 0;
+
+# Only if the current is larger than OVERCURRENT_PERIOD, the alarm will set off.
+
+
+my $test2 = 1;
+while(1) {
+ $timer++;
+
+ my $min = 1E5;
+ my $max = 0;
+
+ my $jsonfile;
+ my $filename = 'files/richTemperatureBackplane.json';
+ open(my $fh, '<:encoding(UTF-8)', $filename) or die "Could not open file '$filename' $!";
+
+ while (my $row = <$fh>) {
+ chomp $row;
+ $jsonfile .= $row;
+ }
+
+ my $data = decode_json($jsonfile);
+ close $fh;
+
+
+ foreach my $b (keys %{$data}) {
+ my $t = $data->{$b};
+ my $subs = substr($b,0,2);
+ if (substr($b,0,2) eq '0x') {
+ my $reg = (eval $b) - 0xe100;
+
+ if ($reg > 9) {$reg = $reg - 6 ;}
+ if ($reg < 18) {HPlot::PlotAdd("RichTempHistDiRICH",$t,$reg);}
+
+ }
+ }
+
+ #my $data = Perl2Epics::GetAll();
+ $str = "<!DOCTYPE html>\n\n<html>\n<head>\n";
+ $str .= Hmon::MakeTitle(12, 8, "RICH Temp DiRICH", 1, "");
+ $str .= qq@<img src="%ADDPNG files/RichTempHistDiRICH.png%" type="image/png">\n@;
+
+ $str .= Hmon::MakeFooter();
+ $str .= "</body>";
+ $str .= "</html>";
+ Hmon::WriteFile("RichTempHistoDiRICH", $str);
+
+
+
+ #for (my $i = 0; $i <= 5;$i++){
+ # HPlot::PlotAdd("RichTempHistDiRICH",$max,0); #$data->{"I$cnt"}->{val}||-1
+ # HPlot::PlotAdd("RichTempHistDiRICH",$min,1);
+ #}
+ #print Dumper $data;
+ if($timer%5 == 0) { #10 seconds
+ HPlot::PlotDraw("RichTempHistDiRICH");
+ }
+
+ usleep(2000000); #2 seconds
+ }
#$str = "<!DOCTYPE html>\n\n<html>\n<head>\n";
#$str .= "<style>\n.dot {\n height: 25px;\n width:25px;\n border-radius: 50%;\n display: inline-block;\n}\n \n ";
#$str .= "</style>\n</head>\n<body>\n";
- $str .= Hmon::MakeTitle(13, 17, "RICH HV", 1, "");
+ $str = Hmon::MakeTitle(13, 17, "RICH HV", 1, "");
$str .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"files/styles.css\">";
$str .= "<div style=\"text-align:left; margin-top: 10px;\">";
for (my $i = 0; $i <= 5;$i++){
for (my $j = 0; $j<=15; $j++) {
my $cnt = ($i*16)+$j;
- HPlot::PlotAdd("RichCurr",$data->{"I$cnt"}->{val}||-1,);
- HPlot::PlotAdd("RichVolt",$data->{"U$cnt"}->{val}||-1,);
+ HPlot::PlotAdd("RichCurr",-($data->{"I$cnt"}->{val}||-1),);
+ HPlot::PlotAdd("RichVolt",-($data->{"U$cnt"}->{val}||-1),);
HPlot::PlotAdd("RichResist",$data->{"R$cnt"}->{val}||-1,);
}
}
div.width12 {width:950px;}
div.width13 {width:1030px;}
div.width14 {width:1110px;}
+div.width15 {width:1190px;}
+div.width16 {width:1270px;}
+div.width17 {width:1350px;}
+div.width18 {width:1430px;}
+div.width19 {width:1510px;}
+div.width20 {width:1590px;}
div.height1 {height:40px;}
div.height2 {height:90px;}