my $p;
my $storefile;
+my $plotstring = '';
use constant {TYPE_HISTORY => 1, TYPE_BARGRAPH => 2, TYPE_HEATMAP => 3};
'#2222dd','#dd2222','#22dd22','#dd8822','#dd22dd','#22dddd','#dddd22','#8888dd','#8822bb','#444444');
sub plot_write {
- my ($file,$str,$no) = @_;
+ my ($file,$str,$no,$save) = @_;
return unless $str;
if($no || 0) {
print $file $str;
print $file $str."\n";
# print $str."\n";
}
+ if($save && $save eq 'save') {$plotstring .= $str;}
}
plot_write($fh,"set xtics autofreq"); #$p->{$name}->{entries}
plot_write($fh,"set grid");
# plot_write($fh,"set style fill solid 1.0");
- plot_write($fh,"plot ",1);
+ plot_write($fh,"plot ",1,'save');
for(my $j=0; $j<$p->{$name}->{curves};$j++) {
if($p->{$name}->{fill}) {
- plot_write($fh,"'-' using 1:2 with filledcurves x1 lt rgb \"".$p->{$name}->{colors}->[$j]."\" title \"".($p->{$name}->{titles}->[$j] || "$j")."\" ",1);
+ plot_write($fh,"'-' using 1:2 with filledcurves x1 lt rgb \"".$p->{$name}->{colors}->[$j]."\" title \"".($p->{$name}->{titles}->[$j] || "$j")."\" ",1,'save');
}
elsif($p->{$name}->{dots}) {
- plot_write($fh,"'-' using 1:2 with points pointsize 0.6 pointtype 2 lt rgb \"".$p->{$name}->{colors}->[$j]."\" title \"".($p->{$name}->{titles}->[$j] || "$j")."\" ",1);
+ plot_write($fh,"'-' using 1:2 with points pointsize 0.6 pointtype 2 lt rgb \"".$p->{$name}->{colors}->[$j]."\" title \"".($p->{$name}->{titles}->[$j] || "$j")."\" ",1,'save');
}
else {
- plot_write($fh,"'-' using 1:2 with lines lt rgb \"".$p->{$name}->{colors}->[$j]."\" title \"".($p->{$name}->{titles}->[$j] || "$j")."\" ",1);
+ plot_write($fh,"'-' using 1:2 with lines lt rgb \"".$p->{$name}->{colors}->[$j]."\" title \"".($p->{$name}->{titles}->[$j] || "$j")."\" ",1,'save');
}
- plot_write($fh,', ',1) unless ($j+1==$p->{$name}->{curves});
+ plot_write($fh,', ',1,'save') unless ($j+1==$p->{$name}->{curves});
}
- plot_write($fh," ");
+ plot_write($fh," ",0,'save');
}
elsif($p->{$name}->{type} == TYPE_BARGRAPH) {
plot_write($fh,"set style fill solid 1.00 border -1");
}
plot_write($fh,"set style histogram title offset character 0, 0, 0");
plot_write($fh,"set style data histograms");
- plot_write($fh,"plot ",1);
+ plot_write($fh,"plot ",1,'save');
for(my $j=0; $j<$p->{$name}->{curves};$j++) {
- plot_write($fh,', ',1) if $j;
- plot_write($fh,"'-' lt rgb \"".$p->{$name}->{colors}->[$j]."\" title \"".($p->{$name}->{titles}->[$j] || "$j")."\" ",1);
+ plot_write($fh,', ',1,'save') if $j;
+ plot_write($fh,"'-' lt rgb \"".$p->{$name}->{colors}->[$j]."\" title \"".($p->{$name}->{titles}->[$j] || "$j")."\" ",1,'save');
}
- plot_write($fh," ");
+ plot_write($fh," ",0,'save');
}
elsif($p->{$name}->{type} == TYPE_HEATMAP) {
plot_write($fh,"set view map");
plot_write($fh,"set palette rgbformulae 22,13,-31");
}
if ($p->{$name}->{showvalues} == 0) {
- plot_write($fh,"splot '-' matrix with image");
+ plot_write($fh,"splot '-' matrix with image",0,'save');
}
else {
- plot_write($fh,"plot '-' matrix with image, '-' matrix using 1:2:(sprintf('%i', \$3)) with labels tc rgb \"#ffffff\" font ',10'");
+ plot_write($fh,"plot '-' matrix with image, '-' matrix using 1:2:(sprintf('%i', \$3)) with labels tc rgb \"#ffffff\" font ',10'",0,'save');
# plot_write($fh,"plot '-' matrix with image, '-' matrix using 1:2:(sprintf('%i', \$3)):3 with labels tc palette font ',10'");
}
}
if($p->{$name}->{run}>=1) {
plot_write($p->{$name}->{fh},"set out \"".$p->{$name}->{file}.($p->{$name}->{buffer}?"tmp":"").".png\"");
plot_write($p->{$name}->{fh},makeTimeString());
- plot_write($p->{$name}->{fh},"replot");
+ plot_write($p->{$name}->{fh},$plotstring);
}
if($p->{$name}->{type} == TYPE_HISTORY) {
--- /dev/null
+#This a an example configuration file. Copy this file to your user directory and give
+#start.pl a link to this file as first argument.
+
+#Scripts to start & order of icons in the Overview
+activeScripts => [['time','ping','-','-','daqop'],
+ ['numfee','temperature','reftime','billboard','mbs'],
+ ['beamintensity','beammonitors','-','richhvres','richenvironment'],
+ ['trgrate','datarate','deadtime','-','-'],
+ ['heatmaprich','padiwatemp','padiwaonline','currents','pscurrents'],
+ ['cbmnetlink','cbmnetdata','cbmnetsync','-','-']],
+
+#Names to be shown in left column of Overview (max 4 letters!)
+qaNames => ['sys','main','beam','rate','Pdwa','CNet','-'],
+
+#Expected number of FPGAs in system
+NumberOfFpga => 90,
+
+#The address of the individual boards
+CtsAddress => 0x7005,
+PadiwaBroadcastAddress => 0xfe4c,
+
+PadiwaTrbAdresses => [0x0010,0x0011,0x0012,0x0013,
+ 0x0020,0x0021,0x0022,0x0023,
+ 0x0030,0x0031,0x0032,0x0033,
+ 0x0040,0x0041,0x0042,0x0043,
+ 0x0050,0x0051,0x0052,0x0053,
+ 0x0060,0x0061,0x0062,0x0063,
+ 0x0070,0x0071,0x0072,0x0073,
+ 0x0080,0x0081,0x0082,0x0083,
+ 0x0090,0x0091,0x0092,0x0093,
+ 0x00a0,0x00a1,0x00a2,0x00a3,
+ 0x00b0,0x00b1,0x00b2,0x00b3,
+ 0x00c0,0x00c1,0x00c2,0x00c3,
+ 0x00d0,0x00d1,0x00d2,0x00d3,
+ 0x00e0,0x00e1,0x00e2,0x00e3,
+ 0x00f0,0x00f1,0x00f2,0x00f3,
+ 0x0100,0x0101,0x0102,0x0103,
+ 0x0111,0x0113],
+
+HubTrbAdresses => [0x7005,0x7000,0x7001,0x7002,0x7003,
+ 0x0015,
+ 0x0025,
+ 0x0035,
+ 0x0045,
+ 0x0055,
+ 0x0065,
+ 0x0075,
+ 0x0085,
+ 0x0095,
+ 0x00a5,
+ 0x00b5,
+ 0x00c5,
+ 0x00d5,
+ 0x00e5,
+ 0x00f5,
+ 0x0105,
+ 0x0115],
+
+BillboardAddress => 0x0112,
+MBSAddress => 0x0112,
+
+#Addresses of all TDCs. Either single or broadcast addresses
+TdcAddress => [0xfe4c,0xfe4e,0x7005],
+
+#IPs of all devices which should react on a ping
+TrbIP => [
+"192.168.0.29",
+ "192.168.0.47",
+ "192.168.0.56",
+# "192.168.0.57",#extra TRB3
+ "192.168.0.59",
+ "192.168.0.72",
+ "192.168.0.73",
+ "192.168.0.74",
+ "192.168.0.78",
+ "192.168.0.83",
+ "192.168.0.84",
+ "192.168.0.89",
+ "192.168.0.97",
+ "192.168.0.99",
+ "192.168.0.101",
+ "192.168.0.102",
+ "192.168.0.104",
+ "192.168.0.105"
+],
+
+#Channel to read spill intensity from. Give limit for off-spill detection
+BeamTRB => 0x0110,
+BeamChan => 0xc005,
+SpillThreshold => 30,
+
+#Name detectors
+BeamDetectorsTrb => [0x0110, 0x0110, 0x0111,0x0110,0x0111,0x0110,0x0113,0x0111,0x0110],
+BeamDetectorsChan => [0xc001, 0xc003, 0xc001,0xc009,0xc005,0xc00b,0xc009,0xc009,0xc005],
+BeamDetectorsName => ['Fngr_d', 'Lead_d', 'C1', 'C1_d', 'C2', 'C2_d', 'Lead1', 'Lead2', 'Hodo'],
+
+#User directory
+UserDirectory => '/home/hadaq/trbsoft/daqtools/users/cern_cbmrich/',
+PowerSupScript => 'measure_powers.sh' # relative to user dir
+