Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TGo4ConfigStep.ui.h

Go to the documentation of this file.
00001 //-------------------------------------------------------------
00002 //        Go4 Release Package v3.04-01 (build 30401)
00003 //                      28-November-2008
00004 //---------------------------------------------------------------
00005 //   The GSI Online Offline Object Oriented (Go4) Project
00006 //   Experiment Data Processing at EE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 const char* TGo4MbsFile__fgcNOTAGFILE = "GO4-NOLMDTAG";
00017 const char* TGo4MbsFile__fgcLMDSUF = ".lmd";
00018 const char* TGo4MbsFile__fgcFILELISTSUF = ".lml";
00019 
00020 void TGo4ConfigStep::init()
00021 {
00022    fxPanel = 0;
00023    fStepStatus = 0;
00024 }
00025 
00026 void TGo4ConfigStep::destroy()
00027 {
00028 }
00029 
00030 void TGo4ConfigStep::InputArguments(const QString& Arg)
00031 {
00032     TGo4EventSourceParameter* SourcePar=fStepStatus->GetSourcePar();
00033     int ParId=SourcePar->GetID();
00034     if (ParId==GO4EV_USER){                    // user defined source class
00035         TGo4UserSourceParameter* usrpar=dynamic_cast<TGo4UserSourceParameter*>(SourcePar);
00036         if (usrpar!=0)
00037            usrpar->SetExpression(Arg.stripWhiteSpace().latin1());
00038     }
00039 }
00040 
00041 void TGo4ConfigStep::InputDisable(int )
00042 {
00043     if(Disable_in_2->isChecked()) { //checked
00044         fStepStatus->SetSourceEnabled(kFALSE);
00045         SourceBox->setEnabled(false);
00046     } else {                        //unchecked
00047         fStepStatus->SetSourceEnabled(kTRUE);
00048         SourceBox->setEnabled(true);
00049     }
00050 }
00051 
00052 void TGo4ConfigStep::InputPort(const QString& fxPort)
00053 {
00054     TGo4EventSourceParameter* SourcePar=fStepStatus->GetSourcePar();
00055     int ParId=SourcePar->GetID();
00056     if (ParId==GO4EV_MBS_REVSERV){              // remote event server (input only)
00057            TGo4RevServParameter* revpar=dynamic_cast<TGo4RevServParameter*>(SourcePar);
00058         if (revpar!=0){
00059                 revpar->SetPort(fxPort.toInt());
00060         }
00061     }else if (ParId==GO4EV_USER){                    // user defined source class
00062         TGo4UserSourceParameter* usrpar=dynamic_cast<TGo4UserSourceParameter*>(SourcePar);
00063         if (usrpar!=0){
00064                 usrpar->SetPort(fxPort.toInt());
00065 
00066         }
00067     }
00068 }
00069 
00070 void TGo4ConfigStep::InputSourceText(const QString& Name)
00071 {
00072     fStepStatus->GetSourcePar()->SetName(Name.stripWhiteSpace().latin1());
00073 }
00074 
00075 void TGo4ConfigStep::OutputDisable(int )
00076 {
00077     if(Disable_out_2->isChecked()){ //checked
00078        fStepStatus->SetStoreEnabled(kFALSE);
00079        StoreBox->setEnabled(false);
00080        StoreBox->setHidden(true);
00081     }else{    //unchecked
00082        fStepStatus->SetStoreEnabled(kTRUE);
00083        StoreBox->setEnabled(true);
00084        StoreBox->setShown(true);
00085     }
00086    parentWidget()->parentWidget()->parentWidget()->adjustSize();
00087 }
00088 
00089 void TGo4ConfigStep::OutputNameText(const QString& Name)
00090 {
00091     fStepStatus->GetStorePar()->SetName(Name.stripWhiteSpace().latin1());
00092 }
00093 
00094 void TGo4ConfigStep::StepDisable(int )
00095 {
00096     if(Step_Disable_b->isChecked()){
00097        fStepStatus->SetProcessEnabled(kFALSE);
00098        SourceBox->setEnabled(false);
00099        StoreBox->setEnabled(false);
00100 //       StoreBox->setHidden(true);
00101     }else{
00102        fStepStatus->SetProcessEnabled(kTRUE);
00103        InputDisable(0);
00104        OutputDisable(0);
00105    }
00106 
00107 }
00108 
00109 void TGo4ConfigStep::OutArguments(const QString&)
00110 {
00111 
00112 }
00113 
00114 
00115 void TGo4ConfigStep::SetStepStatus(TGo4AnalysisConfiguration* panel, TGo4AnalysisStepStatus* StepStatus)
00116 {
00117     if (StepStatus==0) return;
00118 
00119     fxPanel = panel;
00120     fStepStatus = StepStatus;
00121 
00122     //----------------------------------------------------//
00123     //Source:
00124 
00125     /*
00126     Qt use following order to display the source parameter:
00127 
00128     0)  root file with one tree                 TGo4FileSourceParameter
00129     1)  branch of singleton tree                TGo4TreeSourceParameter
00130     2)  mbs listmode file (input only)          TGo4MbsFileParameter
00131     3)  mbs stream server (input only)          TGo4MbsStreamParameter
00132     4)  mbs transport server (input only)       TGo4MbsTransportParameter
00133     5)  mbs event server  (input only)          TGo4MbsEventServerParameter
00134     6)  rev serv                                TGo4RevServParameter
00135     7)  mbs random generator                    TGo4MbsRandomParameter
00136     8)  user source                             TGo4UserSourceParameter
00137 
00138     */
00139 
00140 
00141     TGo4EventSourceParameter* srcpar = StepStatus->GetSourcePar();
00142 
00143     ResetSourceWidgets(srcpar->GetName(), srcpar->GetTimeout());
00144 
00145     switch(srcpar->GetID()) {
00146        case GO4EV_FILE: {
00147           SetFileSource();
00148           break;
00149        }
00150        case GO4EV_MBS_FILE: {
00151           TGo4MbsFileParameter* filpar=dynamic_cast<TGo4MbsFileParameter*>(srcpar);
00152           SetMbsFileSource(filpar ? filpar->GetTagName() : "",
00153                            filpar ? filpar->GetStartEvent() : 0,
00154                            filpar ? filpar->GetStopEvent() : 0,
00155                            filpar ? filpar->GetEventInterval() : 0);
00156           break;
00157        }
00158        case GO4EV_MBS_STREAM: {
00159           SetMbsStreamSource();
00160           break;
00161        }
00162        case GO4EV_MBS_TRANSPORT: {
00163           SetMbsTransportSource();
00164           break;
00165        }
00166        case GO4EV_MBS_EVENTSERVER: {
00167           SetMbsEventServerSource();
00168           break;
00169        }
00170        case GO4EV_MBS_REVSERV: {
00171           TGo4RevServParameter* revpar = dynamic_cast<TGo4RevServParameter*>(srcpar);
00172           SetMbsRevServSource(revpar ? revpar->GetPort() : 0);
00173           break;
00174        }
00175        case GO4EV_MBS_RANDOM: {
00176           SetRandomSource();
00177           break;
00178        }
00179        case GO4EV_USER: {
00180           TGo4UserSourceParameter* usrpar = dynamic_cast<TGo4UserSourceParameter*>(srcpar);
00181           SetUserSource(usrpar ? usrpar->GetPort() : 0,
00182                         usrpar ? usrpar->GetExpression() : "");
00183           break;
00184        }
00185        default:
00186           break;
00187 
00188     } // SourcePar->GetID()
00189 
00190 
00191 
00192     //----------------------------------------------------//
00193     //Store
00194 
00195     TGo4EventStoreParameter* StorePar = fStepStatus->GetStorePar();
00196 
00197     if (StorePar!=0)
00198       switch(StorePar->GetID()) {
00199          case GO4EV_FILE: {
00200             TGo4FileStoreParameter* fstor = dynamic_cast<TGo4FileStoreParameter*>(StorePar);
00201             SetFileStore(fstor->GetName(),
00202                          fstor->IsOverwriteMode(),
00203                          fstor->GetBufsize(),
00204                          fstor->GetSplitlevel(),
00205                          fstor->GetCompression());
00206             break;
00207          }
00208          case GO4EV_BACK: {
00209             TGo4BackStoreParameter* bstor = dynamic_cast<TGo4BackStoreParameter*>(StorePar);
00210             SetBackStore(bstor->GetName(),
00211                          bstor->GetBufsize(),
00212                          bstor->GetSplitlevel());
00213             break;
00214          }
00215          default:
00216             break;
00217       } // switch StorePar->GetID()
00218 
00219     //----------------------------------------------------//
00220     // enable or disable processing:
00221 
00222     SetStepControl(fStepStatus->IsProcessEnabled(),
00223                    fStepStatus->IsSourceEnabled(),
00224                    fStepStatus->IsStoreEnabled());
00225 }
00226 
00227 void TGo4ConfigStep::SourceComboHighlighted(int k)
00228 {
00229     LineEditPortNumber->setEnabled(false);
00230     LineEditTagfile->setEnabled(false);
00231     SpinBoxStartEvent->setEnabled(false);
00232     SpinBoxStopEvent->setEnabled(false);
00233     SpinBoxInterEvent->setEnabled(false);
00234     SpinBoxTimeout->setEnabled(false);
00235     LineEditArgumentsIn_2->setEnabled(false);
00236     FileNameInput->setEnabled(false);
00237     MbsMonitorBtn->setEnabled(false);
00238     if(k==0) {            // root file with one tree
00239        TGo4FileSourceParameter* newpar1 = new TGo4FileSourceParameter(SourceNameEdit->text().latin1());
00240        fStepStatus->SetSourcePar(newpar1);
00241        FileNameInput->setEnabled(true);
00242        delete newpar1;
00243     } else
00244     if (k==1) {    // mbs listmode file (input only)
00245        TGo4MbsFileParameter* newpar4 = new TGo4MbsFileParameter(SourceNameEdit->text().latin1());
00246        fStepStatus->SetSourcePar(newpar4);
00247        if(SourceNameEdit->text().contains(TGo4MbsFile__fgcFILELISTSUF)) // case of *.lml
00248         {
00249            // case of *.lml file: disable start/stop event fields
00250            LineEditTagfile->setEnabled(false);
00251            SpinBoxStartEvent->setEnabled(false);
00252            SpinBoxStopEvent->setEnabled(false);
00253            SpinBoxInterEvent->setEnabled(false);
00254         }
00255        else
00256         {
00257            // case of *.lmd file
00258            LineEditTagfile->setEnabled(true);
00259            SpinBoxStartEvent->setEnabled(true);
00260            SpinBoxStopEvent->setEnabled(true);
00261            SpinBoxInterEvent->setEnabled(true);
00262         }
00263        FileNameInput->setEnabled(true);
00264        delete newpar4;
00265      } else
00266      if (k==2) {  // mbs stream server (input only)
00267        TGo4MbsStreamParameter* newpar5 = new TGo4MbsStreamParameter(SourceNameEdit->text().latin1());
00268        fStepStatus->SetSourcePar(newpar5);
00269        SpinBoxTimeout->setEnabled(true);
00270        MbsMonitorBtn->setEnabled(true);
00271        delete newpar5;
00272      } else
00273      if (k==3) {       // mbs transport server (input only)
00274        TGo4MbsTransportParameter* newpar6 = new TGo4MbsTransportParameter(SourceNameEdit->text().latin1());
00275        fStepStatus->SetSourcePar(newpar6);
00276        SpinBoxTimeout->setEnabled(true);
00277        MbsMonitorBtn->setEnabled(true);
00278        delete newpar6;
00279      }else
00280      if (k==4) {     // mbs event server  (input only)
00281        TGo4MbsEventServerParameter* newpar7 = new TGo4MbsEventServerParameter(SourceNameEdit->text().latin1());
00282        fStepStatus->SetSourcePar(newpar7);
00283        SpinBoxTimeout->setEnabled(true);
00284        MbsMonitorBtn->setEnabled(true);
00285        delete newpar7;
00286      } else
00287      if (k==5) {     //    rev serv
00288        TGo4RevServParameter* newpar8 = new TGo4RevServParameter(SourceNameEdit->text().latin1());
00289        newpar8->SetPort(LineEditPortNumber->text().toInt());
00290        fStepStatus->SetSourcePar(newpar8);
00291        LineEditPortNumber->setEnabled(true);
00292        delete newpar8;
00293      } else
00294      if (k==6) {     //    mbs random
00295        TGo4MbsRandomParameter* newpar8 = new TGo4MbsRandomParameter(SourceNameEdit->text().latin1());
00296        fStepStatus->SetSourcePar(newpar8);
00297        delete newpar8;
00298      } else
00299      if (k==7) {     // user source
00300        TGo4UserSourceParameter *newpar9 = new TGo4UserSourceParameter(SourceNameEdit->text().latin1());
00301        newpar9->SetPort(LineEditPortNumber->text().toInt());
00302        newpar9->SetExpression(LineEditArgumentsIn_2->text().stripWhiteSpace().latin1());
00303        fStepStatus->SetSourcePar(newpar9);
00304        LineEditPortNumber->setEnabled(true);
00305        LineEditArgumentsIn_2->setEnabled(true);
00306        SpinBoxTimeout->setEnabled(true);
00307        FileNameInput->setEnabled(true);
00308        delete newpar9;
00309      }
00310 }
00311 
00312 void TGo4ConfigStep::StoreComboHighlighted(int k)
00313 {
00314    if(k==0) {
00315       StoreNameEdit->setDisabled(FALSE);
00316       TGo4FileStoreParameter* newpar1 = new TGo4FileStoreParameter(StoreNameEdit->text().latin1());
00317       fStepStatus->SetStorePar(newpar1);
00318       delete newpar1;
00319       CompLevel->setDisabled(FALSE);
00320       StoreOverwriteMode->setDisabled(FALSE);
00321       FileNameOutput->setDisabled(FALSE);
00322    } else
00323    if(k==1) {
00324       StoreNameEdit->setDisabled(TRUE);
00325       TGo4BackStoreParameter *newpar3 = new TGo4BackStoreParameter(GetBackStoreName().latin1());
00326       fStepStatus->SetStorePar(newpar3);
00327       delete newpar3;
00328       CompLevel->setDisabled(TRUE);
00329       StoreOverwriteMode->setDisabled(TRUE);
00330       FileNameOutput->setDisabled(TRUE);
00331     }
00332 }
00333 
00334 
00335 void TGo4ConfigStep::OutputFileDialog()
00336 {
00337     QFileDialog fd( this, "file name", TRUE );
00338     fd.setMode( QFileDialog::AnyFile);
00339     fd.setCaption( "Select file name for step output");
00340     fd.setDir(fxPanel->GetStorePath());
00341     fd.setFilter( "Go4FileStore  (*.root)" );
00342     if ( fd.exec() != QDialog::Accepted ) return;
00343 
00344     QString fileName = fd.selectedFile();
00345     fxPanel->SetStorePath(fd.dirPath());
00346     if(!fileName.endsWith(".root")) fileName.append(".root");
00347     StoreNameEdit->setText(fileName);
00348 }
00349 
00350 void TGo4ConfigStep::StoreBufferSize( int t )
00351 {
00352    if(fStepStatus->GetStorePar()->InheritsFrom(TGo4FileStoreParameter::Class())){
00353        TGo4FileStoreParameter *StorePar=(TGo4FileStoreParameter *)fStepStatus->GetStorePar();
00354        StorePar->SetBufsize(1000*t);
00355    } else
00356    if (fStepStatus->GetStorePar()->InheritsFrom(TGo4BackStoreParameter::Class())){
00357        TGo4BackStoreParameter * StorePar = (TGo4BackStoreParameter *)fStepStatus->GetStorePar();
00358        StorePar->SetBufsize(1000*t);
00359    }
00360 }
00361 
00362 void TGo4ConfigStep::StoreSplitLevel( int t)
00363 {
00364    if(fStepStatus->GetStorePar()->InheritsFrom(TGo4FileStoreParameter::Class())) {
00365       TGo4FileStoreParameter *StorePar=(TGo4FileStoreParameter *)fStepStatus->GetStorePar();
00366       StorePar->SetSplitlevel(t);
00367    } else
00368    if (fStepStatus->GetStorePar()->InheritsFrom(TGo4BackStoreParameter::Class())) {
00369        TGo4BackStoreParameter * StorePar = (TGo4BackStoreParameter *)fStepStatus->GetStorePar();
00370        StorePar->SetSplitlevel(t);
00371    }
00372 }
00373 
00374 void TGo4ConfigStep::StoreCompLevel( int t)
00375 {
00376    if(fStepStatus->GetStorePar()->InheritsFrom(TGo4FileStoreParameter::Class())) {
00377        TGo4FileStoreParameter *StorePar=(TGo4FileStoreParameter *)fStepStatus->GetStorePar();
00378        StorePar->SetCompression(t);
00379    }
00380 }
00381 
00382 void TGo4ConfigStep::StoreOverWrite( bool overwrite)
00383 {
00384    if(fStepStatus->GetStorePar()->InheritsFrom(TGo4FileStoreParameter::Class())){
00385         TGo4FileStoreParameter *StorePar=dynamic_cast <TGo4FileStoreParameter *> (fStepStatus->GetStorePar());
00386          if(overwrite)StorePar->SetOverwriteMode(kTRUE);
00387          else StorePar->SetOverwriteMode(kFALSE);
00388     }
00389 }
00390 
00391 
00392 
00393 
00394 
00395 void TGo4ConfigStep::InputTagfile( const QString & tag )
00396 {
00397    TGo4EventSourceParameter* SourcePar=fStepStatus->GetSourcePar();
00398    int ParId=SourcePar->GetID();
00399    if (ParId==GO4EV_MBS_FILE)
00400     {              // tagfile only for mbs lmd file
00401        TGo4MbsFileParameter* filpar=dynamic_cast<TGo4MbsFileParameter*>(SourcePar);
00402     if (filpar!=0)
00403         {
00404             if(tag.isEmpty())
00405                 {
00406                     //cout <<"Input empty tagname...." << endl;
00407                     filpar->SetTagName(TGo4MbsFile__fgcNOTAGFILE);
00408                 }
00409             else
00410                 {
00411                     filpar->SetTagName(tag.stripWhiteSpace().latin1());
00412                 }
00413 
00414         }
00415     }
00416 }
00417 
00418 void TGo4ConfigStep::StoreStartEvent( int num )
00419 {
00420    TGo4EventSourceParameter* SourcePar=fStepStatus->GetSourcePar();
00421    int ParId=SourcePar->GetID();
00422    if (ParId==GO4EV_MBS_FILE)
00423     {              //only for mbs lmd file
00424        TGo4MbsFileParameter* filpar=dynamic_cast<TGo4MbsFileParameter*>(SourcePar);
00425     if (filpar!=0)
00426             filpar->SetStartEvent(num);
00427     }
00428 }
00429 
00430 void TGo4ConfigStep::StoreStopEvent( int num )
00431 {
00432 TGo4EventSourceParameter* SourcePar=fStepStatus->GetSourcePar();
00433 int ParId=SourcePar->GetID();
00434 if (ParId==GO4EV_MBS_FILE)
00435     {              //only for mbs lmd file
00436        TGo4MbsFileParameter* filpar=dynamic_cast<TGo4MbsFileParameter*>(SourcePar);
00437     if (filpar!=0)
00438             filpar->SetStopEvent(num);
00439     }
00440 
00441 }
00442 
00443 void TGo4ConfigStep::StoreEventInterval( int num )
00444 {
00445 TGo4EventSourceParameter* SourcePar=fStepStatus->GetSourcePar();
00446 int ParId=SourcePar->GetID();
00447 if (ParId==GO4EV_MBS_FILE)
00448     {              //only for mbs lmd file
00449        TGo4MbsFileParameter* filpar=dynamic_cast<TGo4MbsFileParameter*>(SourcePar);
00450     if (filpar!=0)
00451             filpar->SetEventInterval(num);
00452     }
00453 }
00454 
00455 void TGo4ConfigStep::StoreTimeout( int tim )
00456 {
00457    TGo4EventSourceParameter* sourcepar = fStepStatus->GetSourcePar();
00458    if (sourcepar!=0)
00459       sourcepar->SetTimeout(tim);
00460 }
00461 
00462 void TGo4ConfigStep::InputFileDialog()
00463 {
00464     QFileDialog fd( this, "file name", TRUE );
00465     fd.setMode( QFileDialog::ExistingFile);
00466     fd.setCaption( "Select file name for step input");
00467     fd.setDir(fxPanel->GetSourcePath());
00468     bool mbsfilemode=false;
00469     if(fStepStatus!=0) {
00470         TGo4EventSourceParameter* sourcepar = fStepStatus->GetSourcePar();
00471         if(sourcepar->InheritsFrom(TGo4FileSourceParameter::Class()))
00472            fd.setFilter( "Go4FileSource  (*.root)" );
00473         else if (sourcepar->InheritsFrom(TGo4MbsFileParameter::Class())) {
00474             mbsfilemode=true;
00475             QString filters="Go4MbsFile  (*";
00476             filters+=TGo4MbsFile__fgcLMDSUF;
00477             filters+=" *";
00478             filters+=QString(TGo4MbsFile__fgcLMDSUF).upper();
00479             filters+=");;Go4 list mode list (*";
00480             filters+=TGo4MbsFile__fgcFILELISTSUF;
00481             filters+=")";
00482             fd.setFilters(filters);
00483         }
00484         else if (sourcepar->InheritsFrom(TGo4UserSourceParameter::Class())){
00485            fd.setFilter( "all files  (*.*)" );
00486         }
00487         else
00488            cout <<"Unknown sourcepar " <<sourcepar->ClassName() << endl;
00489     }
00490 
00491     if ( fd.exec() != QDialog::Accepted ) return;
00492 
00493     QString fileName = fd.selectedFile();
00494     fxPanel->SetSourcePath(fd.dirPath());
00495     SourceNameEdit->setText(fileName);
00496     if(mbsfilemode) {
00497        if(fd.selectedFilter().contains(TGo4MbsFile__fgcFILELISTSUF)) {
00498            LineEditTagfile->setEnabled(false);
00499            SpinBoxStartEvent->setEnabled(false);
00500            SpinBoxStopEvent->setEnabled(false);
00501            SpinBoxInterEvent->setEnabled(false);
00502         } else {
00503            LineEditTagfile->setEnabled(true);
00504            SpinBoxStartEvent->setEnabled(true);
00505            SpinBoxStopEvent->setEnabled(true);
00506            SpinBoxInterEvent->setEnabled(true);
00507         }
00508     }
00509 }
00510 
00511 QString TGo4ConfigStep::GetStepName()
00512 {
00513    return fStepStatus->GetName();
00514 }
00515 
00516 void TGo4ConfigStep::SetStepControl(bool process, bool source, bool store)
00517 {
00518    Step_Disable_b->setChecked(!process);
00519    Disable_in_2->setChecked(!source);
00520    Disable_out_2->setChecked(!store);
00521 }
00522 
00523 void TGo4ConfigStep::GetStepControl(bool& process, bool& source, bool& store)
00524 {
00525    process  = !Step_Disable_b->isChecked();
00526    source = !Disable_in_2->isChecked();
00527    store = !Disable_out_2->isChecked();
00528 }
00529 
00530 void TGo4ConfigStep::ResetSourceWidgets(const QString& name, int timeout)
00531 {
00532     SourceNameEdit->setText(name);
00533     SpinBoxTimeout->setValue(timeout);
00534 
00535     LineEditPortNumber->setEnabled(false);
00536     LineEditArgumentsIn_2->setEnabled(false);
00537     LineEditTagfile->setEnabled(false);
00538     SpinBoxStartEvent->setEnabled(false);
00539     SpinBoxStopEvent->setEnabled(false);
00540     SpinBoxInterEvent->setEnabled(false);
00541     SpinBoxTimeout->setEnabled(false);
00542     FileNameInput->setEnabled(false);
00543 }
00544 
00545 void TGo4ConfigStep::SetFileSource()
00546 {
00547    Input_Combo_1_2->setCurrentItem(0);
00548    FileNameInput->setEnabled(true);
00549    SourceComboHighlighted(0);
00550 }
00551 
00552 void TGo4ConfigStep::SetMbsFileSource(QString TagFile, int start, int stop, int interval)
00553 {
00554    Input_Combo_1_2->setCurrentItem(1);
00555    LineEditTagfile->setEnabled(true);
00556    SpinBoxStartEvent->setEnabled(true);
00557    SpinBoxStopEvent->setEnabled(true);
00558    SpinBoxInterEvent->setEnabled(true);
00559    FileNameInput->setEnabled(true);
00560    if(!strstr(TagFile.latin1(),TGo4MbsFile__fgcNOTAGFILE))
00561       LineEditTagfile->setText(TagFile);
00562    else
00563       LineEditTagfile->setText("");
00564    SpinBoxStartEvent->setValue(start);
00565    SpinBoxStopEvent->setValue(stop);
00566    SpinBoxInterEvent->setValue(interval);
00567    SourceComboHighlighted(1);
00568 }
00569 
00570 void TGo4ConfigStep::SetMbsStreamSource()
00571 {
00572    Input_Combo_1_2->setCurrentItem(2);
00573    SpinBoxTimeout->setEnabled(true);
00574    SourceComboHighlighted(2);
00575 }
00576 
00577 void TGo4ConfigStep::SetMbsTransportSource()
00578 {
00579    Input_Combo_1_2->setCurrentItem(3);
00580    SpinBoxTimeout->setEnabled(true);
00581    SourceComboHighlighted(3);
00582 }
00583 
00584 void TGo4ConfigStep::SetMbsEventServerSource()
00585 {
00586    Input_Combo_1_2->setCurrentItem(4);
00587    SpinBoxTimeout->setEnabled(true);
00588    SourceComboHighlighted(4);
00589 }
00590 
00591 void TGo4ConfigStep::SetMbsRevServSource(int port)
00592 {
00593    Input_Combo_1_2->setCurrentItem(5);
00594    QString PortNo;
00595    PortNo.setNum(port);
00596    LineEditPortNumber->setText(PortNo);
00597    LineEditPortNumber->setEnabled(true);
00598    LineEditArgumentsIn_2->setEnabled(true);
00599    SourceComboHighlighted(5);
00600 }
00601 
00602 void TGo4ConfigStep::SetRandomSource()
00603 {
00604    Input_Combo_1_2->setCurrentItem(6);
00605    SourceComboHighlighted(6);
00606 }
00607 
00608 void TGo4ConfigStep::SetUserSource(int port, QString expr)
00609 {
00610    Input_Combo_1_2->setCurrentItem(7);
00611    QString PortNo;
00612    PortNo.setNum(port);
00613    LineEditPortNumber->setText(PortNo);
00614    LineEditArgumentsIn_2->setText(expr);
00615    LineEditPortNumber->setEnabled(true);
00616    LineEditArgumentsIn_2->setEnabled(true);
00617    SpinBoxTimeout->setEnabled(true);
00618    FileNameInput->setEnabled(true);
00619    SourceComboHighlighted(7);
00620 }
00621 
00622 int TGo4ConfigStep::GetSourceSetup(QString& name, int& timeout)
00623 {
00624    name = SourceNameEdit->text();
00625    timeout = SpinBoxTimeout->value();
00626    return Input_Combo_1_2->currentItem();
00627 }
00628 
00629 void TGo4ConfigStep::GetMbsFileSource(QString& TagFile, int& start, int& stop, int& interval)
00630 {
00631    TagFile = LineEditTagfile->text();
00632 //   if (TagFile.length()==0) TagFile = TGo4MbsFile__fgcNOTAGFILE;
00633    start = SpinBoxStartEvent->value();
00634    stop = SpinBoxStopEvent->value();
00635    interval = SpinBoxInterEvent->value();
00636 }
00637 
00638 void TGo4ConfigStep::GetMbsRevServSource(int& port)
00639 {
00640    port = LineEditPortNumber->text().toInt();
00641 }
00642 
00643 void TGo4ConfigStep::GetUserSource(int& port, QString& expr)
00644 {
00645    port = LineEditPortNumber->text().toInt();
00646    expr = LineEditArgumentsIn_2->text();
00647 }
00648 
00649 void TGo4ConfigStep::SetFileStore(QString name, bool overwrite, int bufsize, int splitlevel, int compression)
00650 {
00651    StoreNameEdit->setEnabled(TRUE);
00652    StoreNameEdit->setText(name);
00653    Output_Combo_1_2->setCurrentItem(0);
00654    StoreOverwriteMode->setChecked(overwrite);
00655    StoreOverwriteMode->setEnabled(TRUE);
00656    BufferSize->setValue(bufsize/1000);
00657    SplitLevel->setValue(splitlevel);
00658    CompLevel->setValue(compression);
00659    CompLevel->setEnabled(TRUE);
00660    FileNameOutput->setEnabled(TRUE);
00661    StoreComboHighlighted(0);
00662 }
00663 
00664 void TGo4ConfigStep::SetBackStore(QString name, int bufsize, int splitlevel)
00665 {
00666    StoreNameEdit->setEnabled(FALSE);
00667    StoreNameEdit->setText(GetBackStoreName());
00668    Output_Combo_1_2->setCurrentItem(1);
00669    BufferSize->setValue(bufsize/1000);
00670    SplitLevel->setValue(splitlevel);
00671    StoreOverwriteMode->setEnabled(FALSE);
00672    CompLevel->setEnabled(FALSE);
00673    FileNameOutput->setEnabled(FALSE);
00674    StoreComboHighlighted(1);
00675 }
00676 
00677 QString TGo4ConfigStep::GetBackStoreName()
00678 {
00679    QString name = "BackStoreTree_";
00680    name += GetStepName();
00681    return name;
00682 }
00683 
00684 int TGo4ConfigStep::GetStoreSetup(QString& name)
00685 {
00686    int typ = Output_Combo_1_2->currentItem();
00687    if (typ==1) name = GetBackStoreName();
00688           else name = StoreNameEdit->text();
00689    return typ;
00690 }
00691 
00692 void TGo4ConfigStep::GetFileStore(bool& overwrite, int& bufsize, int& splitlevel, int& compression)
00693 {
00694    overwrite = StoreOverwriteMode->isChecked();
00695    bufsize = BufferSize->value() * 1000;
00696    splitlevel = SplitLevel->value();
00697    compression = CompLevel->value();
00698 }
00699 
00700 void TGo4ConfigStep::GetBackStore(int& bufsize, int& splitlevel)
00701 {
00702    bufsize = BufferSize->value() * 1000;
00703    splitlevel = SplitLevel->value();
00704 }
00705 
00706 void TGo4ConfigStep::MbsMonitorBtn_clicked()
00707 {
00708    if (fxPanel!=0)
00709      fxPanel->DisplayMbsMonitor(SourceNameEdit->text());
00710 }
00711 
00712 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:20 2008 for Go4-v3.04-1 by  doxygen 1.4.2