GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4ConfigStep.cpp
Go to the documentation of this file.
1 // $Id: TGo4ConfigStep.cpp 1639 2015-06-24 13:40:12Z adamczew $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #include "TGo4ConfigStep.h"
15 
16 #include <QFileDialog>
17 
18 #include "TClass.h"
19 #include "Riostream.h"
20 
21 #include "TGo4AnalysisStepStatus.h"
25 #include "TGo4RevServParameter.h"
26 #include "TGo4FileStoreParameter.h"
27 #include "TGo4BackStoreParameter.h"
29 #include "TGo4MbsFileParameter.h"
30 #include "TGo4MbsStreamParameter.h"
33 #include "TGo4MbsRandomParameter.h"
34 #include "Go4EventServerTypes.h"
36 
37 
38 const char* TGo4MbsFile__fgcNOTAGFILE = "GO4-NOLMDTAG";
39 const char* TGo4MbsFile__fgcLMDSUF = ".lmd";
40 const char* TGo4MbsFile__fgcFILELISTSUF = ".lml";
41 
51 };
52 
53 
54 TGo4ConfigStep::TGo4ConfigStep( QWidget* parent, const char* name, Qt::WindowFlags fl )
55  : QWidget( parent, fl )
56 {
57  setObjectName( name ? name : "Go4ConfigStep");
58 
59  setupUi(this);
60 
61  fxPanel = 0;
62  fStepStatus = 0;
63 
64  SpinBoxPortNumber->setVisible(false);
65  TextLabelPortNumber->setVisible(false);
66  SpinBoxRetryNumber->setVisible(false);
67  TextLabelRetryNumber->setVisible(false);
68  SpinBoxTimeout->setVisible(false);
69  TextLabelTimeout->setVisible(false);
70 
71  SpinBoxStartEvent->setVisible(false);
72  SpinBoxStopEvent->setVisible(false);
73  SpinBoxInterEvent->setVisible(false);
74 
75  LineEditArgs->setVisible(false);
76  TextLabelArgs->setVisible(false);
77  LineEditTagfile->setVisible(false);
78  TextLabelTagfile->setVisible(false);
79 
80  for (int n=0;n<ParsSize;n++)
81  fPars[n]=0;
82 
83  fLastSrcKind = -1;
84  fBlocked = 0;
85  fExtra = false;
86  ExtraBtn->setText(fExtra ? "-" : "+");
87 }
88 
90 {
91  for (int n=0;n<ParsSize;n++) {
92  delete fPars[n];
93  fPars[n] = 0;
94  }
95 }
96 
97 
98 void TGo4ConfigStep::InputArguments(const QString& Arg)
99 {
101  int ParId=SourcePar->GetID();
102  if (ParId==GO4EV_USER){ // user defined source class
103  TGo4UserSourceParameter* usrpar=dynamic_cast<TGo4UserSourceParameter*>(SourcePar);
104  if (usrpar!=0)
105  usrpar->SetExpression(Arg.trimmed().toLatin1().constData());
106  }
107 }
108 
110 {
111  bool stepon = EnableStepBox->isChecked();
112  bool on = EnableSourceBox->isChecked();
113 
115  SourceBox->setEnabled(stepon && on);
116 
118 }
119 
121 {
122  if (fBlocked) return;
123 
125 
126  switch (SourcePar->GetID()) {
127 
128  case GO4EV_MBS_TRANSPORT:
129  case GO4EV_MBS_STREAM:
131  case GO4EV_MBS_REVSERV: {
132  TGo4MbsSourceParameter* par = dynamic_cast<TGo4MbsSourceParameter*>(SourcePar);
133  if (par!=0)
134  par->SetPort(port);
135  break;
136  }
137 
138  case GO4EV_USER: { // user defined source class
139  TGo4UserSourceParameter* usrpar=dynamic_cast<TGo4UserSourceParameter*>(SourcePar);
140  if (usrpar!=0)
141  usrpar->SetPort(port);
142  break;
143  }
144 
145  default: {
146  // do nothing
147  break;
148  }
149  }
150 }
151 
153 {
154  if (fBlocked) return;
155 
157 
158  switch (SourcePar->GetID()) {
159 
160  case GO4EV_MBS_TRANSPORT:
161  case GO4EV_MBS_STREAM:
163  case GO4EV_MBS_REVSERV: {
164  TGo4MbsSourceParameter* par = dynamic_cast<TGo4MbsSourceParameter*>(SourcePar);
165  if (par!=0)
166  par->SetRetryCnt(cnt);
167  break;
168  }
169 
170  default: {
171  // do nothing
172  break;
173  }
174  }
175 }
176 
177 void TGo4ConfigStep::InputSourceText(const QString& name)
178 {
179  if (fBlocked) return;
180 
182  fStepStatus->GetSourcePar()->SetName(name.trimmed().toLatin1().constData());
183 
184  if (EventSourceCombo->currentIndex() == kind_MbsFile) {
185  bool islml = name.contains(TGo4MbsFile__fgcFILELISTSUF);
186  LineEditTagfile->setVisible(!islml);
187  TextLabelTagfile->setVisible(!islml);
188 
189  SpinBoxStartEvent->setEnabled(!islml);
190  SpinBoxStopEvent->setEnabled(!islml);
191  SpinBoxInterEvent->setEnabled(!islml);
192  }
193 }
194 
196 {
197  bool stepon = EnableStepBox->isChecked();
198  bool on = EnableStoreBox->isChecked();
199 
201  StoreBox->setEnabled(stepon && on);
202  StoreBox->setVisible(on);
203 
205 
206  adjustSize();
207  parentWidget()->adjustSize();
208  parentWidget()->parentWidget()->adjustSize();
209 
210  fxPanel->adjustSize();
211  fxPanel->parentWidget()->adjustSize();
212 }
213 
214 void TGo4ConfigStep::OutputNameText(const QString& Name)
215 {
216  fStepStatus->GetStorePar()->SetName(Name.trimmed().toLatin1().constData());
217 }
218 
220 {
221  bool on = EnableStepBox->isChecked();
222 
224  EnableSourceBox->setEnabled(on);
225  EnableStoreBox->setEnabled(on);
226 
228 
231 }
232 
234 {
235  if (StepStatus==0) return;
236  //std::cout <<"TGo4ConfigStep::SetStepStatus for "<< StepStatus->GetName()<< std::endl;
237 
238  fxPanel = panel;
239  fStepStatus = StepStatus;
240  fStepNumber = number;
241  fLastSrcKind = -1; // indicate that status (and its parameter) is changed
242 
243  //----------------------------------------------------//
244  //Source:
245 
246  /*
247  Qt use following order to display the source parameter:
248 
249  0) root file with one tree TGo4FileSourceParameter
250  1) mbs listmode file (input only) TGo4MbsFileParameter
251  2) mbs stream server (input only) TGo4MbsStreamParameter
252  3) mbs transport server (input only) TGo4MbsTransportParameter
253  4) mbs event server (input only) TGo4MbsEventServerParameter
254  5) rev serv TGo4RevServParameter
255  6) mbs random generator TGo4MbsRandomParameter
256  7) user source TGo4UserSourceParameter
257 
258  */
259 
260  int srckind = CurrentSourceKind();
261  fBlocked++;
262  EventSourceCombo->setCurrentIndex(srckind);
263  fBlocked--;
264 
265 
266  //----------------------------------------------------//
267  //Store
268 
270 
271  if (StorePar!=0)
272  switch(StorePar->GetID()) {
273  case GO4EV_FILE: {
274  TGo4FileStoreParameter* fstor = dynamic_cast<TGo4FileStoreParameter*>(StorePar);
275  SetFileStore(fstor->GetName(),
276  fstor->IsOverwriteMode(),
277  fstor->GetBufsize(),
278  fstor->GetSplitlevel(),
279  fstor->GetCompression(),
280  fstor->GetAutosaveSize());
281  break;
282  }
283  case GO4EV_BACK: {
284  TGo4BackStoreParameter* bstor = dynamic_cast<TGo4BackStoreParameter*>(StorePar);
285  SetBackStore(bstor->GetName(),
286  bstor->GetBufsize(),
287  bstor->GetSplitlevel());
288  break;
289  }
290  default:
291  break;
292  } // switch StorePar->GetID()
293 
294  //----------------------------------------------------//
295  // enable or disable processing:
296 
300 }
301 
302 
304 {
305  if ((fStepStatus==0) || (fStepStatus->GetSourcePar()==0)) return kind_MbsFile;
306 
307  switch(fStepStatus->GetSourcePar()->GetID()) {
308  case GO4EV_FILE: return kind_RootFile;
309  case GO4EV_MBS_FILE: return kind_MbsFile;
310  case GO4EV_MBS_STREAM: return kind_MbsStream;
313  case GO4EV_MBS_REVSERV: return kind_MbsREvent;
314  case GO4EV_MBS_RANDOM: return kind_MbsRandom;
315  case GO4EV_USER: return kind_UserSource;
316  } // SourcePar->GetID()
317 
318  return kind_MbsFile;
319 }
320 
322 {
323  if (fStepStatus==0) return;
324 
326  bool delsrcpar(true);
327  TGo4MbsSourceParameter* mbspar = dynamic_cast<TGo4MbsSourceParameter*> (srcpar);
328 
329  if (fLastSrcKind >= 0) {
330  if (fPars[fLastSrcKind]!=0) delete fPars[fLastSrcKind];
331  fPars[fLastSrcKind] = srcpar;
332  delsrcpar = false;
333  }
334 
335  if (fPars[kind]) {
337  fLastSrcKind = kind;
338  if (delsrcpar) delete srcpar;
339  return;
340  }
341 
342  TString filename, hostname;
343  Int_t port(0);
344 
345  switch(srcpar->GetID()) {
346  case GO4EV_FILE:
347  case GO4EV_MBS_FILE:
348  filename = srcpar->GetName();
349  break;
350 
351  case GO4EV_MBS_STREAM:
352  case GO4EV_MBS_TRANSPORT:
354  case GO4EV_MBS_REVSERV:
355  hostname = srcpar->GetName();
356  port = mbspar ? mbspar->GetPort() : 0;
357  break;
358 
359  case GO4EV_MBS_RANDOM:
360  break;
361  case GO4EV_USER:
362  break;
363  default:
364  break;
365  }
366 
367  TGo4EventSourceParameter* newpar = 0;
368 
369  switch (kind) {
370  case kind_RootFile:
371  newpar = new TGo4FileSourceParameter(filename);
372  break;
373 
374  case kind_MbsFile:
375  newpar = new TGo4MbsFileParameter(filename);
376  break;
377 
378  case kind_MbsStream:
379  newpar = new TGo4MbsStreamParameter(hostname);
380  break;
381 
382  case kind_MbsTransport:
383  newpar = new TGo4MbsTransportParameter(hostname);
384  break;
385 
386  case kind_MbsEvent:
387  newpar = new TGo4MbsEventServerParameter(hostname);
388  break;
389 
390  case kind_MbsREvent:
391  newpar = new TGo4RevServParameter(hostname);
392  break;
393 
394  case kind_MbsRandom:
395  newpar = new TGo4MbsRandomParameter("random");
396  break;
397 
398  case kind_UserSource:
399  newpar = new TGo4UserSourceParameter(filename,"",port);
400  break;
401  }
402 
403  TGo4MbsSourceParameter* newmbspar = dynamic_cast<TGo4MbsSourceParameter*> (newpar);
404 
405  if (newmbspar) {
406  newmbspar->SetPort(port);
407 
408  if (mbspar) {
409  newmbspar->SetStartEvent(mbspar->GetStartEvent());
410  newmbspar->SetStopEvent(mbspar->GetStopEvent());
411  newmbspar->SetEventInterval(mbspar->GetEventInterval());
412  }
413  }
414 
415  newpar->SetTimeout(srcpar->GetTimeout());
416 
417  fPars[kind] = newpar;
418 
419  // here parameter will be cloned
421 
422  fLastSrcKind = kind;
423 
424  if (delsrcpar) delete srcpar;
425 }
426 
427 void TGo4ConfigStep::SetSourceWidgets( const QString & name, int timeout)
428 {
429  SourceNameEdit->setText(name);
430  SpinBoxTimeout->setValue(timeout);
431 }
432 
433 void TGo4ConfigStep::SetMbsSourceWidgets(int start, int stop, int interval, int port)
434 {
435  SpinBoxStartEvent->setValue(start);
436  SpinBoxStopEvent->setValue(stop);
437  SpinBoxInterEvent->setValue(interval);
438  SpinBoxPortNumber->setValue(port);
439  SpinBoxRetryNumber->setValue(0);
440 }
441 
443 {
444  // FIXME: do it only interactively
445  if (fBlocked == 0) ChangeSourceParameter(kind);
446 
447  fBlocked++;
448 
449  // first disable everything which can be disabled
450 
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);
459 
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);
467 
468  // evaluate previous source if existing
469 
471 
472  SourceNameEdit->setText(srcpar->GetName());
473  SpinBoxTimeout->setValue(srcpar->GetTimeout());
474 
475  TGo4MbsSourceParameter* mbspar = dynamic_cast<TGo4MbsSourceParameter*> (srcpar);
476 
477  if (mbspar) {
478  SpinBoxStartEvent->setValue(mbspar->GetStartEvent());
479  SpinBoxStopEvent->setValue(mbspar->GetStopEvent());
480  SpinBoxInterEvent->setValue(mbspar->GetEventInterval());
481  SpinBoxPortNumber->setValue(mbspar->GetPort());
482  SpinBoxRetryNumber->setValue(mbspar->GetRetryCnt());
483 
484 // if ((mbspar->GetPort()!=0) || (mbspar->GetRetryCnt()>0) ||
485 // (mbspar->GetStartEvent()!=0) || (mbspar->GetStopEvent()!=0) || (mbspar->GetEventInterval()>1)) fExtra = true;
486  }
487 
488  TGo4MbsFileParameter* mbsfilpar = dynamic_cast<TGo4MbsFileParameter*>(srcpar);
489  TGo4UserSourceParameter* userpar = dynamic_cast<TGo4UserSourceParameter*>(srcpar);
490 
491  switch (kind) {
492  case kind_RootFile: // root file with one tree
493  FileNameBtn->setEnabled(true);
494  break;
495  case kind_MbsFile: { // mbs listmode file (input only)
496  // in this special case spin boxes will be enabled/disabled when file name is changed
497  FileNameBtn->setEnabled(true);
498 
499  QString tagfile = mbsfilpar->GetTagName();
500 
501  if(!tagfile.contains(TGo4MbsFile__fgcNOTAGFILE)) {
502  LineEditTagfile->setText(tagfile);
503 // fExtra = true;
504  } else {
505  LineEditTagfile->setText("");
506  }
507 
508  LineEditTagfile->setVisible(fExtra);
509  TextLabelTagfile->setVisible(fExtra);
510 
511  SpinBoxStartEvent->setVisible(fExtra);
512  SpinBoxStopEvent->setVisible(fExtra);
513  SpinBoxInterEvent->setVisible(fExtra);
514  break;
515  }
516  case kind_MbsStream: // mbs stream server (input only)
517  case kind_MbsTransport: // mbs transport server (input only)
518  case kind_MbsEvent: // mbs event server (input only)
519  case kind_MbsREvent: // rev serv
520  TextLabelTimeout->setVisible(fExtra);
521  SpinBoxTimeout->setVisible(fExtra);
522  TextLabelPortNumber->setVisible(fExtra);
523  SpinBoxPortNumber->setVisible(fExtra);
524  TextLabelRetryNumber->setVisible(fExtra);
525  SpinBoxRetryNumber->setVisible(fExtra);
526  MbsMonitorBtn->setEnabled(kind != kind_MbsREvent);
527  SpinBoxStartEvent->setVisible(fExtra);
528  SpinBoxStopEvent->setVisible(fExtra);
529  SpinBoxInterEvent->setVisible(fExtra);
530  break;
531 
532  case kind_MbsRandom: // mbs random
533  break;
534 
535  case kind_UserSource: // user source
536  FileNameBtn->setEnabled(true);
537  SpinBoxPortNumber->setValue(userpar->GetPort());
538  LineEditArgs->setText(userpar->GetExpression());
539  SpinBoxPortNumber->setVisible(fExtra);
540  TextLabelPortNumber->setVisible(fExtra);
541  LineEditArgs->setVisible(fExtra);
542  TextLabelArgs->setVisible(fExtra);
543  TextLabelTimeout->setVisible(fExtra);
544  SpinBoxTimeout->setVisible(fExtra);
545  break;
546  }
547 
548  fBlocked--;
549 
550  adjustSize();
551  parentWidget()->adjustSize();
552  parentWidget()->parentWidget()->adjustSize();
553 
554  fxPanel->adjustSize();
555  fxPanel->parentWidget()->adjustSize();
556 }
557 
559 {
560  if(k==0) {
561  StoreNameEdit->setDisabled(false);
562  TGo4FileStoreParameter* newpar1 = new TGo4FileStoreParameter(StoreNameEdit->text().toLatin1().constData());
563  fStepStatus->SetStorePar(newpar1);
564  delete newpar1;
565  CompLevel->setDisabled(false);
566  StoreOverwriteMode->setDisabled(false);
567  FileNameOutput->setDisabled(false);
568  TreeAutosave->setDisabled(false);
569  } else
570  if(k==1) {
571  StoreNameEdit->setDisabled(true);
572  TGo4BackStoreParameter *newpar3 = new TGo4BackStoreParameter(GetBackStoreName().toLatin1().constData());
573  fStepStatus->SetStorePar(newpar3);
574  delete newpar3;
575  CompLevel->setDisabled(true);
576  StoreOverwriteMode->setDisabled(true);
577  FileNameOutput->setDisabled(true);
578  TreeAutosave->setDisabled(true);
579  }
580 }
581 
583 {
584  QFileDialog fd( this, "Select file name for step output",
585  fxPanel->GetStorePath(), "Go4FileStore (*.root)");
586  fd.setFileMode( QFileDialog::AnyFile);
587  if ( fd.exec() != QDialog::Accepted ) return;
588 
589  QStringList flst = fd.selectedFiles();
590  if (flst.isEmpty()) return;
591 
592  QString fileName = flst[0];
593  fxPanel->SetStorePath(fd.directory().path());
594  if(!fileName.endsWith(".root")) fileName.append(".root");
595  StoreNameEdit->setText(fileName);
596 }
597 
599 {
600  if(fStepStatus->GetStorePar()->InheritsFrom(TGo4FileStoreParameter::Class())){
602  StorePar->SetBufsize(1000*t);
603  } else
604  if (fStepStatus->GetStorePar()->InheritsFrom(TGo4BackStoreParameter::Class())){
606  StorePar->SetBufsize(1000*t);
607  }
608 }
609 
611 {
612  if(fStepStatus->GetStorePar()->InheritsFrom(TGo4FileStoreParameter::Class())) {
614  StorePar->SetSplitlevel(t);
615  } else
616  if (fStepStatus->GetStorePar()->InheritsFrom(TGo4BackStoreParameter::Class())) {
618  StorePar->SetSplitlevel(t);
619  }
620 }
621 
623 {
624  if(fStepStatus->GetStorePar()->InheritsFrom(TGo4FileStoreParameter::Class())) {
626  StorePar->SetCompression(t);
627  }
628 }
629 
630 void TGo4ConfigStep::StoreOverWrite( bool overwrite)
631 {
632  if(fStepStatus->GetStorePar()->InheritsFrom(TGo4FileStoreParameter::Class())){
634  if(overwrite)StorePar->SetOverwriteMode(kTRUE);
635  else StorePar->SetOverwriteMode(kFALSE);
636  }
637 }
638 
639 
641 {
642  if(fStepStatus->GetStorePar()->InheritsFrom(TGo4FileStoreParameter::Class())) {
644  StorePar->SetAutosaveSize(t);
645  }
646 
647 }
648 
649 
650 void TGo4ConfigStep::InputTagfile( const QString & tag )
651 {
652  if (fBlocked) return;
654  int ParId=SourcePar->GetID();
655  if (ParId!=GO4EV_MBS_FILE) return;
656  // tagfile only for mbs lmd file
657  TGo4MbsFileParameter* filpar = dynamic_cast<TGo4MbsFileParameter*>(SourcePar);
658 
659  if (filpar==0) return;
660 
661  if(tag.isEmpty())
663  else
664  filpar->SetTagName(tag.trimmed().toLatin1().constData());
665 }
666 
668 {
669  if (fBlocked) return;
670 
671  // only for mbs sources
674  if (par!=0) par->SetStartEvent(num);
675 }
676 
678 {
679  if (fBlocked) return;
680 
681  // only for mbs sources
684  if (par!=0) par->SetStopEvent(num);
685 }
686 
688 {
689  if (fBlocked) return;
690 
691  // only for mbs sources
694  if (par!=0) par->SetEventInterval(num);
695 }
696 
698 {
699  if (fBlocked) return;
700 
702  if (sourcepar!=0)
703  sourcepar->SetTimeout(tim);
704 }
705 
707 {
708  QString filters;
709  bool mbsfilemode = false;
710  if(fStepStatus!=0) {
712  if(sourcepar->InheritsFrom(TGo4FileSourceParameter::Class()))
713  filters = "Go4FileSource (*.root)";
714  else
715  if (sourcepar->InheritsFrom(TGo4MbsFileParameter::Class())) {
716  mbsfilemode=true;
717  filters="Go4MbsFile (*";
718  filters+=TGo4MbsFile__fgcLMDSUF;
719  filters+=" *";
720  filters+=QString(TGo4MbsFile__fgcLMDSUF).toUpper();
721  filters+=");;Go4 list mode list (*";
723  filters+=")";
724 
725  }
726  else
727  if (sourcepar->InheritsFrom(TGo4UserSourceParameter::Class())) {
728  filters = "all files (*.*)";
729  }
730  else
731  std::cout <<"Unknown sourcepar " <<sourcepar->ClassName() << std::endl;
732  }
733 
734  //std::cout <<"FFFFFFFF chose filter-"<< filters.toLatin1().constData() <<"-" << std::endl;
735  QFileDialog fd( this, "Select file name for step input",
736  fxPanel->GetSourcePath(), filters);
737  fd.setFileMode(QFileDialog::ExistingFile);
738 
739  if ( fd.exec() != QDialog::Accepted ) return;
740 
741  QStringList flst = fd.selectedFiles();
742  if (flst.isEmpty()) return;
743 
744  QString fileName = flst[0];
745  fxPanel->SetSourcePath(fd.directory().path());
746  SourceNameEdit->setText(fileName);
747  if(mbsfilemode) {
748  bool islml = fd.selectedNameFilter().contains(TGo4MbsFile__fgcFILELISTSUF);
749 
750  LineEditTagfile->setVisible(!islml);
751  TextLabelTagfile->setVisible(!islml);
752  SpinBoxStartEvent->setEnabled(!islml);
753  SpinBoxStopEvent->setEnabled(!islml);
754  SpinBoxInterEvent->setEnabled(!islml);
755  }
756 }
757 
759 {
760  return fStepStatus->GetName();
761 }
762 
764 {
765  QString res = fStepStatus->GetName();
766  if (fStepNumber>=0) {
767  res += " ";
768  res += EnableStepBox->isChecked() ? "x" : "o";
769  res += EnableSourceBox->isChecked() ? "x" : "o";
770  res += EnableStoreBox->isChecked() ? "x" : "o";
771  }
772  return res;
773 }
774 
775 void TGo4ConfigStep::SetStepControl(bool process, bool source, bool store)
776 {
777  EnableStepBox->setChecked(process);
778  EnableSourceBox->setChecked(source);
779  EnableStoreBox->setChecked(store);
780 
781  StepStateChanged(0);
782 }
783 
784 void TGo4ConfigStep::GetStepControl(bool& process, bool& source, bool& store)
785 {
786  process = EnableStepBox->isChecked();
787  source = EnableSourceBox->isChecked();
788  store = EnableStoreBox->isChecked();
789 }
790 
792 {
793  EventSourceCombo->setCurrentIndex(kind_RootFile);
794 }
795 
796 void TGo4ConfigStep::SetMbsFileSource(const QString& TagFile)
797 {
798  EventSourceCombo->setCurrentIndex(kind_MbsFile);
799 
800  if(!TagFile.contains(TGo4MbsFile__fgcNOTAGFILE))
801  LineEditTagfile->setText(TagFile);
802  else
803  LineEditTagfile->setText("");
804 }
805 
807 {
808  EventSourceCombo->setCurrentIndex(kind_MbsStream);
809 }
810 
812 {
813  EventSourceCombo->setCurrentIndex(kind_MbsTransport);
814 }
815 
817 {
818  EventSourceCombo->setCurrentIndex(kind_MbsEvent);
819 }
820 
822 {
823  EventSourceCombo->setCurrentIndex(kind_MbsREvent);
824 
825  SpinBoxPortNumber->setValue(port>0 ? port : 0);
826 }
827 
829 {
830  SpinBoxPortNumber->setValue(port > 0 ? port : 0);
831 }
832 
834 {
835  SpinBoxRetryNumber->setValue(retry > 0 ? retry : 0);
836 }
837 
838 
840 {
841  EventSourceCombo->setCurrentIndex(kind_MbsRandom);
842 }
843 
844 void TGo4ConfigStep::SetUserSource(int port, QString expr)
845 {
846  EventSourceCombo->setCurrentIndex(kind_UserSource);
847 
848  SpinBoxPortNumber->setValue(port);
849  LineEditArgs->setText(expr);
850 }
851 
852 int TGo4ConfigStep::GetSourceSetup(QString& name, int& timeout, int& start, int& stop, int& interval, int& nport, int & nretry)
853 {
854  name = SourceNameEdit->text();
855  timeout = SpinBoxTimeout->value();
856  start = SpinBoxStartEvent->value();
857  stop = SpinBoxStopEvent->value();
858  interval = SpinBoxInterEvent->value();
859  nport = -1;
860  nretry = 0;
861  switch (fStepStatus->GetSourcePar()->GetID()) {
862  case GO4EV_MBS_TRANSPORT:
863  case GO4EV_MBS_STREAM:
865  case GO4EV_MBS_REVSERV: {
867  if (par!=0) {
868  nport = SpinBoxPortNumber->value();
869  nretry = SpinBoxRetryNumber->value();
870  }
871  break;
872  }
873  }
874  return EventSourceCombo->currentIndex();
875 }
876 
877 void TGo4ConfigStep::GetMbsFileSource(QString& TagFile)
878 {
879  TagFile = LineEditTagfile->text();
880 // if (TagFile.length()==0) TagFile = TGo4MbsFile__fgcNOTAGFILE;
881 }
882 
883 void TGo4ConfigStep::GetUserSource(int& port, QString& expr)
884 {
885  port = SpinBoxPortNumber->value();
886  expr = LineEditArgs->text();
887 }
888 
889 void TGo4ConfigStep::SetFileStore(QString name, bool overwrite, int bufsize, int splitlevel, int compression, int autosave)
890 {
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);
903 }
904 
905 void TGo4ConfigStep::SetBackStore(QString name, int bufsize, int splitlevel)
906 {
907  StoreNameEdit->setEnabled(false);
908  StoreNameEdit->setText(GetBackStoreName());
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);
916 }
917 
919 {
920  QString name = "BackStoreTree_";
921  name += GetStepName();
922  return name;
923 }
924 
926 {
927  int typ = OutputCombo->currentIndex();
928  if (typ==1) name = GetBackStoreName();
929  else name = StoreNameEdit->text();
930  return typ;
931 }
932 
933 void TGo4ConfigStep::GetFileStore(bool& overwrite, int& bufsize, int& splitlevel, int& compression, int& autosaveperiod)
934 {
935  overwrite = StoreOverwriteMode->isChecked();
936  bufsize = BufferSize->value() * 1000;
937  splitlevel = SplitLevel->value();
938  compression = CompLevel->value();
939  autosaveperiod = TreeAutosave->value();
940 }
941 
942 void TGo4ConfigStep::GetBackStore(int& bufsize, int& splitlevel)
943 {
944  bufsize = BufferSize->value() * 1000;
945  splitlevel = SplitLevel->value();
946 }
947 
949 {
950  if (fxPanel!=0)
951  fxPanel->DisplayMbsMonitor(SourceNameEdit->text());
952 }
953 
955 {
956  fExtra = !fExtra;
957  ExtraBtn->setText(fExtra ? "-" : "+");
958 
959  fBlocked++;
960 
961  SourceComboHighlighted(EventSourceCombo->currentIndex());
962 
963  fBlocked--;
964 }
SourceComboKinds
virtual void ChangeEventInterval(int num)
void SetStartEvent(UInt_t firstindex)
void SetProcessEnabled(Bool_t on=kTRUE)
virtual ~TGo4ConfigStep()
void SetStoreEnabled(Bool_t on=kTRUE)
TGo4EventStoreParameter * GetStorePar() const
virtual void InputStateChanged(int)
void SetSplitlevel(Int_t split)
TGo4AnalysisConfiguration * fxPanel
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)
void SetSourceEnabled(Bool_t on=kTRUE)
virtual void SetMbsRevServSource(int port)
virtual void ExtraBtn_clicked()
virtual void StepStateChanged(int)
const char * TGo4MbsFile__fgcLMDSUF
void SetAutosaveSize(Int_t interval)
virtual void GetFileStore(bool &overwrite, int &bufsize, int &splitlevel, int &compression, int &autosaveinterval)
TGo4EventSourceParameter * fPars[ParsSize]
void SetTagName(const char *name)
virtual void InputPortChanged(int)
virtual void MbsMonitorBtn_clicked()
void SetStorePar(TGo4EventStoreParameter *kind)
void ChangeSourceParameter(int kind)
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
virtual void SetMbsFileSource(const QString &TagFile)
virtual void SetRandomSource()
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)
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 void SetMbsTransportSource()
virtual void SetMbsSourceWidgets(int start, int stop, int interval, int port=0)
virtual void OutputFileDialog()
virtual void GetUserSource(int &port, QString &expr)
const char * GetExpression() 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)
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