26#include <QButtonGroup>
60 RateEvents->setDigitCount(7);
61 SumEvents->setDigitCount(12);
62 RateBytes->setDigitCount(7);
63 SumBytes->setDigitCount(8);
64 ServerPercent->setDigitCount(3);
65 SumBytesFile->setDigitCount(9);
88 FrequencyBox->setValue(
go4sett->getMbsMonitorFreq());
97 QString moviepath =
":/icons/mbslogorun.gif";
126 go4sett->setMbsMonitorFreq(FrequencyBox->value());
140 fxTimer->start(1000 * FrequencyBox->value());
157 setWindowTitle(
"MBS Status - "+NodeEdit->text());
168 SumEvents->display((
double)
fxDaqStat.bl_n_events);
171 SumBytes->display((
double) ((
unsigned int)
fxDaqStat.bl_n_kbyte/1024));
175 SumBytesFile->display((
double) ((
unsigned int)
fxDaqStat.bl_n_kbyte_file/1024));
178 OutfileLabel->setText(
fxDaqStat.c_file_name);
180 OutfileLabel->setText(
"- file closed -");
190 RunPix->setWindowIcon(QIcon(
":/icons/mbsbutton.png" ));
196 SetupRadio->setEnabled(
fxDaqStat.bh_setup_loaded);
197 SetupMLRadio->setEnabled(
fxDaqStat.bh_set_ml_loaded);
198 SetupMORadio->setEnabled(
fxDaqStat.bh_set_mo_loaded);
200 std::cerr <<
fxMessage.toLatin1().constData() << std::endl;
211 if(
fxNode.isEmpty())
return;
214 fxMessage = QString(
"MBS Status refresh node %1 returned error %2 at ").arg(
fxNode).arg(state);
215 fxMessage += QDateTime::currentDateTime().toString();
222 int deltat=FrequencyBox->value();
224 int deltamilsecs=deltat*1000.0;
231 int deltasecs=deltamilsecs/1000;
235 std::cout <<
"Warning: MBS monitor found measuring interval:"<<deltasecs<<
" s ("<<deltamilsecs <<
" ms) exceeding timer period "<<deltat<<
" s" << std::endl;
236 std::cout <<
" Maybe timer was skipped?" << std::endl;
238 numperiods=(deltat/ (int) FrequencyBox->value());
239 std::cout <<
" Correcting number of measuring periods to:"<<numperiods << std::endl;
306 .arg(
fxDaqStat.bh_event_serv_ready ?
"R" :
"S")
307 .arg((
int)(
fxDaqStat.bl_evtsrv_scale != 0 ? 100/
fxDaqStat.bl_evtsrv_scale : 0)).arg(
"%");
341 while((numperiods--) > 0)
366 std::cout <<
fxMessage.toLatin1().constData() << std::endl;
370 std::cout <<
"\n------------------------------------------------" << std::endl;
396 if(
fxNode.isEmpty())
return;
404 fxMessage = QString(
"MBS Setup refresh returned error %1 at %2").arg(state).arg(QDateTime::currentDateTime().toString());
417 fxMessage = QString(
"MBS Setup ML refresh returned error %1 at %2").arg(state).arg(QDateTime::currentDateTime().toString());
429 fxMessage = QString(
"MBS Setup MO refresh returned error %1 at %2").arg(state).arg(QDateTime::currentDateTime().toString());
463 int bins=histo->GetNbinsX();
470 for (
int i = 0; i < bins; i++) {
475 int oldval = histo->GetBinContent(j + dj);
476 histo->SetBinContent(j, oldval);
478 histo->SetBinContent(j + dj, value);
502 his =
new TH1F(name.toLatin1(), title.toLatin1(),
fiTrendBins, lo, up);
503 TAxis *xax = his->GetXaxis();
562 NodeEdit->setText(txt);
TGo4Slot * BrowserSlot(const char *item=nullptr)
TString SaveToMemory(const char *pathname, TObject *obj, Bool_t ownership, Bool_t overwrite=kFALSE)
TGo4Slot * DataSlot(const char *item)
static void SetItemTimeDate(TGo4Slot *slot, const char *stime=nullptr, const char *sdate=nullptr)
virtual void UpdateTrending()
QElapsedTimer fxDeltaClock
QString fxHistokBAccessName
virtual void MoreBox_toggled(bool on)
QString fxHistoAccessName
TGo4MBSViewer(QWidget *parent=nullptr, const char *name=nullptr)
virtual void RefreshButtonClick()
virtual void ResetRunIcon()
virtual void TrendSwitched(bool on)
virtual void FrequencyBox_valueChanged(int)
virtual void TrendBinsBox_valueChanged(int i)
virtual void NodeEditEnter()
virtual void NodeChanged(const QString &txt)
virtual void StoreSettings()
virtual void TimerStart()
virtual void PrintState()
virtual void ShowStatus()
TH1 * TrendHisto(QString &refname, const QString &name, const QString &title, int value)
virtual void StartMovieReset()
virtual void SetNode(const QString &txt)
QTimer * fxMovieResetTimer
QString fxHistoEvRatioAccessName
virtual void IncTrending(TH1 *histo, int value, bool forwards)
virtual void StateGroup_clicked(int id)
void ForwardEvent(TGo4Slot *source, Int_t id, void *param=nullptr)
Bool_t AssignObject(TObject *obj, Bool_t owner)
TObject * GetAssignedObject()
INTS4 f_mbs_status(CHARS *c_node, s_daqst *ps_daqst)
INTS4 f_mbs_ml_setup(CHARS *c_node, s_set_ml *ps_set_ml)
INTS4 f_mbs_setup(CHARS *c_node, s_setup *ps_setup)
INTS4 f_mbs_mo_setup(CHARS *c_node, s_set_mo *ps_set_mo)
INTS4 f_ut_seg_show(s_daqst *ps_daqst, s_setup *ps_setup, s_set_ml *ps_set_ml, s_set_mo *ps_set_mo)