16 #include <QFileDialog>
60 : QWidget( parent, fl )
62 setObjectName( name ? name :
"Go4ConfigStep");
66 QObject::connect(EnableStepBox, SIGNAL(stateChanged(
int)),
this, SLOT(
StepStateChanged(
int)));
67 QObject::connect(EnableSourceBox, SIGNAL(stateChanged(
int)),
this, SLOT(
InputStateChanged(
int)));
68 QObject::connect(EnableStoreBox, SIGNAL(stateChanged(
int)),
this, SLOT(
OutputStateChanged(
int)));
69 QObject::connect(SourceNameEdit, SIGNAL(textChanged(QString)),
this, SLOT(
InputSourceText(QString)));
70 QObject::connect(EventSourceCombo, SIGNAL(currentIndexChanged(
int)),
this, SLOT(
SourceComboHighlighted(
int)));
72 QObject::connect(StoreNameEdit, SIGNAL(textChanged(QString)),
this, SLOT(
OutputNameText(QString)));
73 QObject::connect(FileNameOutput, SIGNAL(clicked()),
this, SLOT(
OutputFileDialog()));
74 QObject::connect(CompLevel, SIGNAL(valueChanged(
int)),
this, SLOT(
StoreCompLevel(
int)));
75 QObject::connect(BufferSize, SIGNAL(valueChanged(
int)),
this, SLOT(
StoreBufferSize(
int)));
76 QObject::connect(SplitLevel, SIGNAL(valueChanged(
int)),
this, SLOT(
StoreSplitLevel(
int)));
77 QObject::connect(StoreOverwriteMode, SIGNAL(toggled(
bool)),
this, SLOT(
StoreOverWrite(
bool)));
78 QObject::connect(LineEditArgs, SIGNAL(textChanged(QString)),
this, SLOT(
InputArguments(QString)));
79 QObject::connect(LineEditTagfile, SIGNAL(textChanged(QString)),
this, SLOT(
InputTagfile(QString)));
80 QObject::connect(SpinBoxStartEvent, SIGNAL(valueChanged(
int)),
this, SLOT(
ChangeStartEvent(
int)));
81 QObject::connect(SpinBoxStopEvent, SIGNAL(valueChanged(
int)),
this, SLOT(
ChangeStopEvent(
int)));
82 QObject::connect(FileNameBtn, SIGNAL(clicked()),
this, SLOT(
InputFileDialog()));
83 QObject::connect(SpinBoxInterEvent, SIGNAL(valueChanged(
int)),
this, SLOT(
ChangeEventInterval(
int)));
84 QObject::connect(SpinBoxTimeout, SIGNAL(valueChanged(
int)),
this, SLOT(
ChangeSourceTimeout(
int)));
85 QObject::connect(ExtraBtn, SIGNAL(clicked()),
this, SLOT(
ExtraBtn_clicked()));
87 QObject::connect(SpinBoxPortNumber, SIGNAL(valueChanged(
int)),
this, SLOT(
InputPortChanged(
int)));
88 QObject::connect(SpinBoxRetryNumber, SIGNAL(valueChanged(
int)),
this, SLOT(
RetryCntChanged(
int)));
89 QObject::connect(TreeAutosave, SIGNAL(valueChanged(
int)),
this, SLOT(
StoreTreeAutoSave(
int)));
95 SpinBoxPortNumber->setVisible(
false);
96 TextLabelPortNumber->setVisible(
false);
97 SpinBoxRetryNumber->setVisible(
false);
98 TextLabelRetryNumber->setVisible(
false);
99 SpinBoxTimeout->setVisible(
false);
100 TextLabelTimeout->setVisible(
false);
102 SpinBoxStartEvent->setVisible(
false);
103 SpinBoxStopEvent->setVisible(
false);
104 SpinBoxInterEvent->setVisible(
false);
106 LineEditArgs->setVisible(
false);
107 TextLabelArgs->setVisible(
false);
108 LineEditTagfile->setVisible(
false);
109 TextLabelTagfile->setVisible(
false);
117 ExtraBtn->setText(
fExtra ?
"-" :
"+");
120 OutputCombo->removeItem(3);
121 EventSourceCombo->removeItem(8);
138 int ParId=SourcePar->
GetID();
148 bool stepon = EnableStepBox->isChecked();
149 bool on = EnableSourceBox->isChecked();
152 SourceBox->setEnabled(stepon && on);
163 switch (SourcePar->
GetID()) {
195 switch (SourcePar->
GetID()) {
223 LineEditTagfile->setVisible(!islml);
224 TextLabelTagfile->setVisible(!islml);
226 SpinBoxStartEvent->setEnabled(!islml);
227 SpinBoxStopEvent->setEnabled(!islml);
228 SpinBoxInterEvent->setEnabled(!islml);
234 bool stepon = EnableStepBox->isChecked();
235 bool on = EnableStoreBox->isChecked();
238 StoreBox->setEnabled(stepon && on);
239 StoreBox->setVisible(on);
244 parentWidget()->adjustSize();
245 parentWidget()->parentWidget()->adjustSize();
248 fxPanel->parentWidget()->adjustSize();
258 bool on = EnableStepBox->isChecked();
261 EnableSourceBox->setEnabled(on);
262 EnableStoreBox->setEnabled(on);
272 if (StepStatus==0)
return;
299 EventSourceCombo->setCurrentIndex(srckind);
309 switch(StorePar->
GetID()) {
379 bool delsrcpar(
true);
391 if (delsrcpar)
delete srcpar;
395 TString filename, hostname;
398 switch(srcpar->
GetID()) {
402 filename = srcpar->GetName();
409 hostname = srcpar->GetName();
410 port = mbspar ? mbspar->
GetPort() : 0;
477 fPars[kind] = newpar;
484 if (delsrcpar)
delete srcpar;
489 SourceNameEdit->setText(name);
490 SpinBoxTimeout->setValue(timeout);
495 SpinBoxStartEvent->setValue(start);
496 SpinBoxStopEvent->setValue(stop);
497 SpinBoxInterEvent->setValue(interval);
498 SpinBoxPortNumber->setValue(port);
499 SpinBoxRetryNumber->setValue(0);
511 SpinBoxPortNumber->setVisible(
false);
512 TextLabelPortNumber->setVisible(
false);
513 SpinBoxRetryNumber->setVisible(
false);
514 TextLabelRetryNumber->setVisible(
false);
515 LineEditArgs->setVisible(
false);
516 TextLabelArgs->setVisible(
false);
517 LineEditTagfile->setVisible(
false);
518 TextLabelTagfile->setVisible(
false);
520 SpinBoxStartEvent->setVisible(
false);
521 SpinBoxStopEvent->setVisible(
false);
522 SpinBoxInterEvent->setVisible(
false);
523 SpinBoxTimeout->setVisible(
false);
524 TextLabelTimeout->setVisible(
false);
525 FileNameBtn->setEnabled(
false);
526 MbsMonitorBtn->setEnabled(
false);
532 SourceNameEdit->setText(srcpar->GetName());
533 SpinBoxTimeout->setValue(srcpar->
GetTimeout());
541 SpinBoxPortNumber->setValue(mbspar->
GetPort());
542 SpinBoxRetryNumber->setValue(mbspar->
GetRetryCnt());
553 FileNameBtn->setEnabled(
true);
557 FileNameBtn->setEnabled(
true);
562 LineEditTagfile->setText(tagfile);
565 LineEditTagfile->setText(
"");
568 LineEditTagfile->setVisible(
fExtra);
569 TextLabelTagfile->setVisible(
fExtra);
571 SpinBoxStartEvent->setVisible(
fExtra);
572 SpinBoxStopEvent->setVisible(
fExtra);
573 SpinBoxInterEvent->setVisible(
fExtra);
580 TextLabelTimeout->setVisible(
fExtra);
581 SpinBoxTimeout->setVisible(
fExtra);
582 TextLabelPortNumber->setVisible(
fExtra);
583 SpinBoxPortNumber->setVisible(
fExtra);
584 TextLabelRetryNumber->setVisible(
fExtra);
585 SpinBoxRetryNumber->setVisible(
fExtra);
587 SpinBoxStartEvent->setVisible(
fExtra);
588 SpinBoxStopEvent->setVisible(
fExtra);
589 SpinBoxInterEvent->setVisible(
fExtra);
596 FileNameBtn->setEnabled(
true);
597 SpinBoxPortNumber->setValue(userpar->
GetPort());
599 SpinBoxPortNumber->setVisible(
fExtra);
600 TextLabelPortNumber->setVisible(
fExtra);
601 LineEditArgs->setVisible(
fExtra);
602 TextLabelArgs->setVisible(
fExtra);
603 TextLabelTimeout->setVisible(
fExtra);
604 SpinBoxTimeout->setVisible(
fExtra);
608 FileNameBtn->setEnabled(
true);
615 parentWidget()->adjustSize();
616 parentWidget()->parentWidget()->adjustSize();
619 fxPanel->parentWidget()->adjustSize();
625 StoreNameEdit->setDisabled(
false);
628 SplitLevel->setDisabled(
false);
629 BufferSize->setDisabled(
false);
630 CompLevel->setDisabled(
false);
631 StoreOverwriteMode->setDisabled(
false);
632 FileNameOutput->setDisabled(
false);
633 TreeAutosave->setDisabled(
false);
635 StoreNameEdit->setDisabled(
true);
638 SplitLevel->setDisabled(
false);
639 BufferSize->setDisabled(
false);
640 CompLevel->setDisabled(
true);
641 StoreOverwriteMode->setDisabled(
true);
642 FileNameOutput->setDisabled(
true);
643 TreeAutosave->setDisabled(
true);
645 StoreNameEdit->setDisabled(
false);
648 SplitLevel->setDisabled(
true);
649 BufferSize->setDisabled(
true);
650 CompLevel->setDisabled(
true);
651 StoreOverwriteMode->setDisabled(
true);
652 FileNameOutput->setDisabled(
false);
653 TreeAutosave->setDisabled(
true);
656 StoreNameEdit->setDisabled(
false);
659 StoreOverwriteMode->setDisabled(
false);
660 FileNameOutput->setDisabled(
false);
661 CompLevel->setDisabled(
true);
662 TreeAutosave->setDisabled(
true);
663 SplitLevel->setDisabled(
true);
664 BufferSize->setDisabled(
true);
674 if(storepar->InheritsFrom(TGo4FileStoreParameter::Class()))
675 filters =
"Go4FileSource (*.root)";
676 else if (storepar->InheritsFrom(TGo4UserStoreParameter::Class()))
677 filters =
"Go4UserStore (*.root)";
679 else if (storepar->InheritsFrom(TGo4HDF5StoreParameter::Class())) {
680 filters=
"Go4HDF5 (*.h5)";
684 std::cout <<
"Unknown storepar " <<storepar->ClassName() << std::endl;
689 QFileDialog fd(
this,
"Select file name for step output",
691 fd.setFileMode( QFileDialog::AnyFile);
692 if ( fd.exec() != QDialog::Accepted )
return;
694 QStringList flst = fd.selectedFiles();
695 if (flst.isEmpty())
return;
697 QString fileName = flst[0];
698 std::cout <<
"output file is "<<fileName.toLatin1().constData() << std::endl;
700 if(!fileName.endsWith(
".h5")) fileName.append(
".h5");
701 std::cout <<
"output file is now "<<fileName.toLatin1().constData() << std::endl;
702 StoreNameEdit->setText(fileName);
767 int ParId=SourcePar->
GetID();
772 if (filpar==0)
return;
777 filpar->
SetTagName(tag.trimmed().toLatin1().constData());
822 bool mbsfilemode =
false;
825 if(sourcepar->InheritsFrom(TGo4FileSourceParameter::Class()))
826 filters =
"Go4FileSource (*.root)";
828 if (sourcepar->InheritsFrom(TGo4MbsFileParameter::Class())) {
830 filters=
"Go4MbsFile (*";
834 filters+=
");;Go4 list mode list (*";
840 if (sourcepar->InheritsFrom(TGo4UserSourceParameter::Class())) {
841 filters =
"all files (*.*)";
844 else if (sourcepar->InheritsFrom(TGo4HDF5SourceParameter::Class())) {
845 filters=
"Go4HDF5 (*.h5)";
849 std::cout <<
"Unknown sourcepar " <<sourcepar->ClassName() << std::endl;
853 QFileDialog fd(
this,
"Select file name for step input",
855 fd.setFileMode(QFileDialog::ExistingFile);
857 if ( fd.exec() != QDialog::Accepted )
return;
859 QStringList flst = fd.selectedFiles();
860 if (flst.isEmpty())
return;
862 QString fileName = flst[0];
864 SourceNameEdit->setText(fileName);
868 LineEditTagfile->setVisible(!islml);
869 TextLabelTagfile->setVisible(!islml);
870 SpinBoxStartEvent->setEnabled(!islml);
871 SpinBoxStopEvent->setEnabled(!islml);
872 SpinBoxInterEvent->setEnabled(!islml);
886 res += EnableStepBox->isChecked() ?
"x" :
"o";
887 res += EnableSourceBox->isChecked() ?
"x" :
"o";
888 res += EnableStoreBox->isChecked() ?
"x" :
"o";
895 EnableStepBox->setChecked(process);
896 EnableSourceBox->setChecked(source);
897 EnableStoreBox->setChecked(store);
904 process = EnableStepBox->isChecked();
905 source = EnableSourceBox->isChecked();
906 store = EnableStoreBox->isChecked();
919 LineEditTagfile->setText(TagFile);
921 LineEditTagfile->setText(
"");
943 SpinBoxPortNumber->setValue(port>0 ? port : 0);
948 SpinBoxPortNumber->setValue(port > 0 ? port : 0);
953 SpinBoxRetryNumber->setValue(retry > 0 ? retry : 0);
966 SpinBoxPortNumber->setValue(port);
967 LineEditArgs->setText(expr);
973 EventSourceCombo->setCurrentIndex(
kind_HDF5);
974 LineEditArgs->setText(name);
981 name = SourceNameEdit->text();
982 timeout = SpinBoxTimeout->value();
983 start = SpinBoxStartEvent->value();
984 stop = SpinBoxStopEvent->value();
985 interval = SpinBoxInterEvent->value();
995 nport = SpinBoxPortNumber->value();
996 nretry = SpinBoxRetryNumber->value();
1001 return EventSourceCombo->currentIndex();
1006 TagFile = LineEditTagfile->text();
1012 port = SpinBoxPortNumber->value();
1013 expr = LineEditArgs->text();
1018 StoreNameEdit->setEnabled(
true);
1019 StoreNameEdit->setText(name);
1020 OutputCombo->setCurrentIndex(0);
1021 StoreOverwriteMode->setChecked(overwrite);
1022 StoreOverwriteMode->setEnabled(
true);
1023 BufferSize->setEnabled(
true);
1024 SplitLevel->setEnabled(
true);
1025 BufferSize->setValue(bufsize/1000);
1026 SplitLevel->setValue(splitlevel);
1027 CompLevel->setValue(compression);
1028 TreeAutosave->setValue(autosave);
1029 CompLevel->setEnabled(
true);
1030 FileNameOutput->setEnabled(
true);
1036 StoreNameEdit->setEnabled(
false);
1038 OutputCombo->setCurrentIndex(1);
1039 BufferSize->setEnabled(
true);
1040 SplitLevel->setEnabled(
true);
1041 BufferSize->setValue(bufsize/1000);
1042 SplitLevel->setValue(splitlevel);
1043 StoreOverwriteMode->setEnabled(
false);
1044 CompLevel->setEnabled(
false);
1045 FileNameOutput->setEnabled(
false);
1051 StoreNameEdit->setEnabled(
true);
1052 StoreNameEdit->setText(name);
1053 OutputCombo->setCurrentIndex(2);
1055 BufferSize->setEnabled(
false);
1056 SplitLevel->setEnabled(
false);
1057 StoreOverwriteMode->setEnabled(
false);
1058 CompLevel->setEnabled(
false);
1059 FileNameOutput->setEnabled(
true);
1067 StoreNameEdit->setEnabled(
false);
1068 StoreNameEdit->setText(name);
1069 OutputCombo->setCurrentIndex(3);
1070 StoreOverwriteMode->setEnabled(
true);
1078 FileNameOutput->setEnabled(
true);
1086 QString name =
"BackStoreTree_";
1093 int typ = OutputCombo->currentIndex();
1095 else name = StoreNameEdit->text();
1101 overwrite = StoreOverwriteMode->isChecked();
1102 bufsize = BufferSize->value() * 1000;
1103 splitlevel = SplitLevel->value();
1104 compression = CompLevel->value();
1105 autosaveperiod = TreeAutosave->value();
1110 bufsize = BufferSize->value() * 1000;
1111 splitlevel = SplitLevel->value();
1130 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 GetHDF5Store(int &flags)
virtual void SetMbsRetryCnt(int retry)
virtual void SetHDF5Store(QString name, int flags)
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
virtual void SetHDF5Source(QString name)
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)
Go4_H5_File_Flags GetHDF5Flags() const
virtual void OutputFileDialog()
void SetHDF5Flags(Go4_H5_File_Flags flags)
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)
TGo4ConfigStep(QWidget *parent=0, const char *name=0, Qt::WindowFlags fl=Qt::Widget)
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 SetUserStore(QString name)
virtual void SetMbsEventServerSource()
virtual void SetMbsPort(int port)
virtual void ChangeStopEvent(int num)
virtual void StoreSplitLevel(int t)
const char * GetTagName() const