use QA;
use HADES::TrbNet;
use HPlot;
-#use Perl2Epics;
+use Perl2Epics;
use LWP::Simple;
my $opt_debug = 0;
my $masterurl = 'http://lxhadeb07:8099/';
my $url_prefix = $masterurl . 'Master/BNET/RunPrefix/get.json?field="value"';
+Perl2Epics::Connect("Rate", "HAD:DAQ:EventRate");
+
my $spillcount = 0;
while (1) {
QA::SciNotation($spillavgshort),
QA::SciNotation($spillavglong),
$spilllength);
- QA::WriteQALog($fqa,"trg", "spill", 50, $qastate, "Spill Sum",
+ QA::WriteQALog($fqa,"trg", "spill", 30, $qastate, "Spill Sum",
$qashort, $qalong) unless $opt_debug>0;
HPlot::PlotAdd("EvtsPerSpill",$events/1E3) unless $opt_debug>0;
HPlot::PlotDraw("EvtsPerSpill") unless $opt_debug>0;
$events = 0;
$spilllength = 0;
- } elsif ($spilllength > 30) {
- QA::WriteQALog($fqa, "trg", "spill", 50, QA::NOTE, "Spill Sum",
+ } elsif ($spilllength > 20) {
+ QA::WriteQALog($fqa, "trg", "spill", 30, QA::NOTE, "Spill Sum",
"No Spills", "No Spills detected at the moment") unless $opt_debug>0;;
#print $spilllength."\n" unless $spilllength%10;
- if($spilllength >= 30 && ($spilllength%30 == 0)) {
+ if($spilllength >= 25 && ($spilllength%25 == 0)) {
# my $data = Perl2Epics::GetAll();
# print STDERR $data->{'prefix'}->{val}."\n";
# if(($data->{'prefix'}->{val} eq '-1') || ($data->{'prefix'}->{val} eq 'be')) {
$qastate = QA::WARN if $evtrate == 1;
$qastate = QA::WARN_2 if $stopped;
+ Hmon::Speak('rate', "Data Acquisition does not work") if $qastate == QA::FATAL;
$qalong = sprintf("current: %i Events/second", $evtrate);
QA::WriteQALog($fqa, "main", "rate", 5, $qastate, "Current Rate",
$qashort, $qalong) unless $opt_debug>0;
$lastspillcount = $spillcount;
$lastres = $res;
print "debug: short:$qashort long:$qalong, spillcount:$spillcount\n" unless $opt_debug==0;
+
+ Perl2Epics::Put("Rate",$evtrate);
+ my $dataRate = Perl2Epics::GetAll();
+
usleep(500000);
} else {