16 #include <QFileDialog>
19 #include "Riostream.h"
55 : QWidget( parent, fl )
57 setObjectName( name ? name :
"Go4ConfigStep");
64 SpinBoxPortNumber->setVisible(
false);
65 TextLabelPortNumber->setVisible(
false);
66 SpinBoxRetryNumber->setVisible(
false);
67 TextLabelRetryNumber->setVisible(
false);
68 SpinBoxTimeout->setVisible(
false);
69 TextLabelTimeout->setVisible(
false);
71 SpinBoxStartEvent->setVisible(
false);
72 SpinBoxStopEvent->setVisible(
false);
73 SpinBoxInterEvent->setVisible(
false);
75 LineEditArgs->setVisible(
false);
76 TextLabelArgs->setVisible(
false);
77 LineEditTagfile->setVisible(
false);
78 TextLabelTagfile->setVisible(
false);
86 ExtraBtn->setText(
fExtra ?
"-" :
"+");
101 int ParId=SourcePar->
GetID();
111 bool stepon = EnableStepBox->isChecked();
112 bool on = EnableSourceBox->isChecked();
115 SourceBox->setEnabled(stepon && on);
126 switch (SourcePar->
GetID()) {
158 switch (SourcePar->
GetID()) {
186 LineEditTagfile->setVisible(!islml);
187 TextLabelTagfile->setVisible(!islml);
189 SpinBoxStartEvent->setEnabled(!islml);
190 SpinBoxStopEvent->setEnabled(!islml);
191 SpinBoxInterEvent->setEnabled(!islml);
197 bool stepon = EnableStepBox->isChecked();
198 bool on = EnableStoreBox->isChecked();
201 StoreBox->setEnabled(stepon && on);
202 StoreBox->setVisible(on);
207 parentWidget()->adjustSize();
208 parentWidget()->parentWidget()->adjustSize();
211 fxPanel->parentWidget()->adjustSize();
221 bool on = EnableStepBox->isChecked();
224 EnableSourceBox->setEnabled(on);
225 EnableStoreBox->setEnabled(on);
235 if (StepStatus==0)
return;
262 EventSourceCombo->setCurrentIndex(srckind);
272 switch(StorePar->
GetID()) {
326 bool delsrcpar(
true);
338 if (delsrcpar)
delete srcpar;
342 TString filename, hostname;
345 switch(srcpar->
GetID()) {
348 filename = srcpar->GetName();
355 hostname = srcpar->GetName();
356 port = mbspar ? mbspar->
GetPort() : 0;
417 fPars[kind] = newpar;
424 if (delsrcpar)
delete srcpar;
429 SourceNameEdit->setText(name);
430 SpinBoxTimeout->setValue(timeout);
435 SpinBoxStartEvent->setValue(start);
436 SpinBoxStopEvent->setValue(stop);
437 SpinBoxInterEvent->setValue(interval);
438 SpinBoxPortNumber->setValue(port);
439 SpinBoxRetryNumber->setValue(0);
451 SpinBoxPortNumber->setVisible(
false);
452 TextLabelPortNumber->setVisible(
false);
453 SpinBoxRetryNumber->setVisible(
false);
454 TextLabelRetryNumber->setVisible(
false);
455 LineEditArgs->setVisible(
false);
456 TextLabelArgs->setVisible(
false);
457 LineEditTagfile->setVisible(
false);
458 TextLabelTagfile->setVisible(
false);
460 SpinBoxStartEvent->setVisible(
false);
461 SpinBoxStopEvent->setVisible(
false);
462 SpinBoxInterEvent->setVisible(
false);
463 SpinBoxTimeout->setVisible(
false);
464 TextLabelTimeout->setVisible(
false);
465 FileNameBtn->setEnabled(
false);
466 MbsMonitorBtn->setEnabled(
false);
472 SourceNameEdit->setText(srcpar->GetName());
473 SpinBoxTimeout->setValue(srcpar->
GetTimeout());
481 SpinBoxPortNumber->setValue(mbspar->
GetPort());
482 SpinBoxRetryNumber->setValue(mbspar->
GetRetryCnt());
493 FileNameBtn->setEnabled(
true);
497 FileNameBtn->setEnabled(
true);
502 LineEditTagfile->setText(tagfile);
505 LineEditTagfile->setText(
"");
508 LineEditTagfile->setVisible(
fExtra);
509 TextLabelTagfile->setVisible(
fExtra);
511 SpinBoxStartEvent->setVisible(
fExtra);
512 SpinBoxStopEvent->setVisible(
fExtra);
513 SpinBoxInterEvent->setVisible(
fExtra);
520 TextLabelTimeout->setVisible(
fExtra);
521 SpinBoxTimeout->setVisible(
fExtra);
522 TextLabelPortNumber->setVisible(
fExtra);
523 SpinBoxPortNumber->setVisible(
fExtra);
524 TextLabelRetryNumber->setVisible(
fExtra);
525 SpinBoxRetryNumber->setVisible(
fExtra);
527 SpinBoxStartEvent->setVisible(
fExtra);
528 SpinBoxStopEvent->setVisible(
fExtra);
529 SpinBoxInterEvent->setVisible(
fExtra);
536 FileNameBtn->setEnabled(
true);
537 SpinBoxPortNumber->setValue(userpar->
GetPort());
539 SpinBoxPortNumber->setVisible(
fExtra);
540 TextLabelPortNumber->setVisible(
fExtra);
541 LineEditArgs->setVisible(
fExtra);
542 TextLabelArgs->setVisible(
fExtra);
543 TextLabelTimeout->setVisible(
fExtra);
544 SpinBoxTimeout->setVisible(
fExtra);
551 parentWidget()->adjustSize();
552 parentWidget()->parentWidget()->adjustSize();
555 fxPanel->parentWidget()->adjustSize();
561 StoreNameEdit->setDisabled(
false);
565 CompLevel->setDisabled(
false);
566 StoreOverwriteMode->setDisabled(
false);
567 FileNameOutput->setDisabled(
false);
568 TreeAutosave->setDisabled(
false);
571 StoreNameEdit->setDisabled(
true);
575 CompLevel->setDisabled(
true);
576 StoreOverwriteMode->setDisabled(
true);
577 FileNameOutput->setDisabled(
true);
578 TreeAutosave->setDisabled(
true);
584 QFileDialog fd(
this,
"Select file name for step output",
586 fd.setFileMode( QFileDialog::AnyFile);
587 if ( fd.exec() != QDialog::Accepted )
return;
589 QStringList flst = fd.selectedFiles();
590 if (flst.isEmpty())
return;
592 QString fileName = flst[0];
594 if(!fileName.endsWith(
".root")) fileName.append(
".root");
595 StoreNameEdit->setText(fileName);
654 int ParId=SourcePar->
GetID();
659 if (filpar==0)
return;
664 filpar->
SetTagName(tag.trimmed().toLatin1().constData());
709 bool mbsfilemode =
false;
712 if(sourcepar->InheritsFrom(TGo4FileSourceParameter::Class()))
713 filters =
"Go4FileSource (*.root)";
715 if (sourcepar->InheritsFrom(TGo4MbsFileParameter::Class())) {
717 filters=
"Go4MbsFile (*";
721 filters+=
");;Go4 list mode list (*";
727 if (sourcepar->InheritsFrom(TGo4UserSourceParameter::Class())) {
728 filters =
"all files (*.*)";
731 std::cout <<
"Unknown sourcepar " <<sourcepar->ClassName() << std::endl;
735 QFileDialog fd(
this,
"Select file name for step input",
737 fd.setFileMode(QFileDialog::ExistingFile);
739 if ( fd.exec() != QDialog::Accepted )
return;
741 QStringList flst = fd.selectedFiles();
742 if (flst.isEmpty())
return;
744 QString fileName = flst[0];
746 SourceNameEdit->setText(fileName);
750 LineEditTagfile->setVisible(!islml);
751 TextLabelTagfile->setVisible(!islml);
752 SpinBoxStartEvent->setEnabled(!islml);
753 SpinBoxStopEvent->setEnabled(!islml);
754 SpinBoxInterEvent->setEnabled(!islml);
768 res += EnableStepBox->isChecked() ?
"x" :
"o";
769 res += EnableSourceBox->isChecked() ?
"x" :
"o";
770 res += EnableStoreBox->isChecked() ?
"x" :
"o";
777 EnableStepBox->setChecked(process);
778 EnableSourceBox->setChecked(source);
779 EnableStoreBox->setChecked(store);
786 process = EnableStepBox->isChecked();
787 source = EnableSourceBox->isChecked();
788 store = EnableStoreBox->isChecked();
801 LineEditTagfile->setText(TagFile);
803 LineEditTagfile->setText(
"");
825 SpinBoxPortNumber->setValue(port>0 ? port : 0);
830 SpinBoxPortNumber->setValue(port > 0 ? port : 0);
835 SpinBoxRetryNumber->setValue(retry > 0 ? retry : 0);
848 SpinBoxPortNumber->setValue(port);
849 LineEditArgs->setText(expr);
854 name = SourceNameEdit->text();
855 timeout = SpinBoxTimeout->value();
856 start = SpinBoxStartEvent->value();
857 stop = SpinBoxStopEvent->value();
858 interval = SpinBoxInterEvent->value();
868 nport = SpinBoxPortNumber->value();
869 nretry = SpinBoxRetryNumber->value();
874 return EventSourceCombo->currentIndex();
879 TagFile = LineEditTagfile->text();
885 port = SpinBoxPortNumber->value();
886 expr = LineEditArgs->text();
891 StoreNameEdit->setEnabled(
true);
892 StoreNameEdit->setText(name);
893 OutputCombo->setCurrentIndex(0);
894 StoreOverwriteMode->setChecked(overwrite);
895 StoreOverwriteMode->setEnabled(
true);
896 BufferSize->setValue(bufsize/1000);
897 SplitLevel->setValue(splitlevel);
898 CompLevel->setValue(compression);
899 TreeAutosave->setValue(autosave);
900 CompLevel->setEnabled(
true);
901 FileNameOutput->setEnabled(
true);
907 StoreNameEdit->setEnabled(
false);
909 OutputCombo->setCurrentIndex(1);
910 BufferSize->setValue(bufsize/1000);
911 SplitLevel->setValue(splitlevel);
912 StoreOverwriteMode->setEnabled(
false);
913 CompLevel->setEnabled(
false);
914 FileNameOutput->setEnabled(
false);
920 QString name =
"BackStoreTree_";
927 int typ = OutputCombo->currentIndex();
929 else name = StoreNameEdit->text();
935 overwrite = StoreOverwriteMode->isChecked();
936 bufsize = BufferSize->value() * 1000;
937 splitlevel = SplitLevel->value();
938 compression = CompLevel->value();
939 autosaveperiod = TreeAutosave->value();
944 bufsize = BufferSize->value() * 1000;
945 splitlevel = SplitLevel->value();
957 ExtraBtn->setText(
fExtra ?
"-" :
"+");
virtual void ChangeEventInterval(int num)
Bool_t IsProcessEnabled() const
void SetCompression(Int_t comp)
void SetStartEvent(UInt_t firstindex)
void SetProcessEnabled(Bool_t on=kTRUE)
virtual ~TGo4ConfigStep()
void SetStoreEnabled(Bool_t on=kTRUE)
void SetRetryCnt(Int_t cnt)
TGo4EventStoreParameter * GetStorePar() const
virtual void InputStateChanged(int)
void SetSplitlevel(Int_t split)
TGo4AnalysisConfiguration * fxPanel
UInt_t GetStartEvent() const
virtual void SetStepStatus(TGo4AnalysisConfiguration *panel, TGo4AnalysisStepStatus *StepStatus, int number=-1)
void SetSplitlevel(Int_t split)
virtual void SetMbsStreamSource()
virtual void SetUserSource(int port, QString expr)
virtual void OutputNameText(const QString &Name)
void SetStopEvent(UInt_t lastindex)
virtual void InputTagfile(const QString &tag)
virtual void OutputStateChanged(int)
virtual void StoreBufferSize(int t)
virtual void RetryCntChanged(int)
virtual void StoreOverWrite(bool overwrite)
virtual QString GetTabTitle()
virtual void SetBackStore(QString name, int bufsize, int splitlevel)
virtual void SetMbsRetryCnt(int retry)
virtual QString GetBackStoreName()
virtual void SetSourcePath(const QString &v)
virtual void ChangeSourceTimeout(int tim)
Int_t IsOverwriteMode() const
void SetSourceEnabled(Bool_t on=kTRUE)
virtual void SetMbsRevServSource(int port)
Bool_t IsSourceEnabled() const
virtual void ExtraBtn_clicked()
virtual void StepStateChanged(int)
const char * TGo4MbsFile__fgcLMDSUF
Int_t GetAutosaveSize() const
void SetAutosaveSize(Int_t interval)
virtual void GetFileStore(bool &overwrite, int &bufsize, int &splitlevel, int &compression, int &autosaveinterval)
TGo4EventSourceParameter * fPars[ParsSize]
UInt_t GetStopEvent() const
void SetTagName(const char *name)
virtual void InputPortChanged(int)
virtual void MbsMonitorBtn_clicked()
void SetStorePar(TGo4EventStoreParameter *kind)
void ChangeSourceParameter(int kind)
Int_t GetRetryCnt() const
void SetSourcePar(TGo4EventSourceParameter *kind)
virtual void GetMbsFileSource(QString &TagFile)
TGo4EventSourceParameter * GetSourcePar() const
void SetOverwriteMode(Bool_t over=kTRUE)
virtual int GetStoreSetup(QString &name)
virtual void GetStepControl(bool &process, bool &source, bool &store)
const char * TGo4MbsFile__fgcFILELISTSUF
Bool_t IsStoreEnabled() const
virtual void SetMbsFileSource(const QString &TagFile)
virtual void SetRandomSource()
Int_t GetCompression() const
Int_t GetSplitlevel() const
TGo4EventSourceParameter * TakeSourcePar()
virtual void SetFileSource()
virtual QString GetStepName()
virtual void StoreComboHighlighted(int k)
virtual void SetFileStore(QString name, bool overwrite, int bufsize, int splitlevel, int compression, int autosave=0)
void SetTimeout(Int_t out)
const char * TGo4MbsFile__fgcNOTAGFILE
virtual void SetStepControl(bool process, bool source, bool store)
void SetEventInterval(UInt_t skipinterval)
void SetBufsize(Int_t bufsize)
TGo4AnalysisStepStatus * fStepStatus
virtual void SetSourceWidgets(const QString &name, int timeout)
virtual void GetBackStore(int &bufsize, int &splitlevel)
virtual QString GetSourcePath()
virtual void SetMbsTransportSource()
virtual void SetMbsSourceWidgets(int start, int stop, int interval, int port=0)
virtual void OutputFileDialog()
virtual QString GetStorePath()
virtual void GetUserSource(int &port, QString &expr)
const char * GetExpression() const
Int_t GetSplitlevel() const
virtual void InputSourceText(const QString &Name)
void SetExpression(const char *name)
virtual void ChangeStartEvent(int num)
virtual void SetStorePath(const QString &v)
virtual int GetSourceSetup(QString &name, int &timeout, int &start, int &stop, int &interval, int &port, int &nretry)
void SetBufsize(Int_t bufsize)
virtual void DisplayMbsMonitor(const QString &mbsname)
virtual void StoreCompLevel(int t)
virtual void InputArguments(const QString &Arg)
UInt_t GetEventInterval() const
virtual void InputFileDialog()
virtual void StoreTreeAutoSave(int t)
virtual void SourceComboHighlighted(int kind)
void ChangeTabTitle(TGo4ConfigStep *step, int number)
virtual void SetMbsEventServerSource()
virtual void SetMbsPort(int port)
virtual void ChangeStopEvent(int num)
virtual void StoreSplitLevel(int t)
TGo4ConfigStep(QWidget *parent=0, const char *name=0, Qt::WindowFlags fl=0)
const char * GetTagName() const