Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4GUI/TGo4EditDynEntry.ui.h

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE 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 /****************************************************************************
00017 ** ui.h extension file, included from the uic-generated form implementation.
00018 **
00019 ** If you wish to add, delete or rename slots use Qt Designer which will
00020 ** update this file, preserving your code. Create an init() slot in place of
00021 ** a constructor, and a destroy() slot in place of a destructor.
00022 *****************************************************************************/
00023 #include <iostream.h>
00024 
00025 void TGo4EditDynEntry::init()
00026 {
00027 
00028     fbTypingMode=true;
00029    fxTGo4GUIRegistry = TGo4GUIRegistry::Instance();
00030    char SlotName[256];
00031    char Caption[256];
00032    snprintf(SlotName,255,"%s%s",name(),"_Slots" );
00033    snprintf(Caption,255,"%s%s","Dynamic List Editor  : " , name());
00034    setCaption( trUtf8( Caption ) );
00035     PleaseUpdateLabel->setShown(false);
00036     fxTGo4EditDynEntrySlots = (TGo4EditDynEntrySlots *) fxTGo4GUIRegistry->GetSlotClass(SlotName);
00037    if(fxTGo4EditDynEntrySlots  !=0) {
00038       fxTGo4EditDynEntrySlots->SetGUI(this);
00039    }else{
00040       fxTGo4EditDynEntrySlots = new TGo4EditDynEntrySlots (SlotName, "Slots Class for Qt GUI", this);
00041    }
00042    fxTGo4EditDynEntryStatus= dynamic_cast <TGo4EditDynEntryStatus *> (fxTGo4EditDynEntrySlots->GetStatus());
00043 
00044 }
00045 
00046 void TGo4EditDynEntry::destroy()
00047 {
00048 
00049    fxTGo4GUIRegistry->UnRegisterClass(fxTGo4EditDynEntrySlots,fxTGo4EditDynEntryStatus);
00050    delete  fxTGo4EditDynEntrySlots;
00051 }
00052 
00053 void TGo4EditDynEntry::closeEvent( QCloseEvent *ce )
00054 {
00055 
00056    ce->accept();
00057    fxTGo4EditDynEntrySlots->SetGUI(0);
00058    delete this;
00059 }
00060 
00061 void TGo4EditDynEntry::SetEntryType( const QString & s )
00062 {
00063    if(s=="TreeDrawEntry")
00064    {
00065       //cout <<"############### tree draw selected" << endl;
00066       tabWidget2->setTabEnabled(treedrawoptions,true);
00067       tabWidget2->setTabEnabled(conditionsettings,false);
00068         tabWidget2->setCurrentPage(tabWidget2->indexOf(histogramsettings));
00069         HisXframe->setEnabled(false);
00070       HisYframe->setEnabled(false);
00071       YEnabledButton->setEnabled(false);
00072         HisZsuperframe->setEnabled(false);
00073         HisnameEdit->setEnabled(true);
00074         if(!fbTypingMode)
00075             {
00076                 TypeComboBox->setCurrentItem(0);
00077                 // this method was invoked by changed status object
00078             }
00079         else
00080             {
00081                 fxTGo4EditDynEntryStatus->SetEntryType(TGo4EditDynEntryStatus::kTreeDraw);
00082                 // this method was invoked from TypeComboBox signal
00083             }
00084     }
00085    else if (s=="DataPointerEntry")
00086    {
00087       //cout <<"############### data pointer entry selected" << endl;
00088       tabWidget2->setTabEnabled(treedrawoptions,false);
00089       tabWidget2->setTabEnabled(conditionsettings,true);
00090         tabWidget2->setCurrentPage(tabWidget2->indexOf(histogramsettings));
00091       HisXframe->setEnabled(true);
00092       HisYframe->setEnabled(false);
00093       YEnabledButton->setEnabled(true);
00094         HisZsuperframe->setEnabled(true);
00095         HisnameEdit->setEnabled(true);
00096         if(!fbTypingMode)
00097             {
00098                 TypeComboBox->setCurrentItem(1);
00099                 // this method was invoked by changed status object
00100             }
00101         else
00102             {
00103                 fxTGo4EditDynEntryStatus->SetEntryType(TGo4EditDynEntryStatus::kDataPointer);
00104                 HisYEnabled(false);
00105                 HisZEnabled(false);
00106                 ConYEnabled(false);
00107                 // this method was invoked from TypeComboBox signal
00108             }
00109     }
00110 }
00111 
00112 void TGo4EditDynEntry::clearTextFields()
00113 {
00114 fbTypingMode=false;
00115     if(EntrynameBox->isEnabled()) EntryNameLineEdit->clear();
00116     if(ConditionFrame->isEnabled()) CondnameEdit->clear();
00117    CEvXnameEdit->clear();
00118    CDataXnameEdit->clear();
00119     if(ConYframe->isEnabled())
00120     {
00121         // only clear if it was enabled before
00122         CEvYnameEdit->clear();
00123         CDataYnameEdit->clear();
00124     }
00125     else
00126     {
00127         CEvYnameEdit->setText(TGo4DynamicEntry::fgcNOEVENT);
00128         CDataYnameEdit->setText(TGo4DynamicEntry::fgcNODATA);
00129     }
00130     HisnameEdit->clear();
00131    HisEvXnameEdit->clear();
00132    HisDatXnameEdit->clear();
00133    if(HisYframe->isEnabled())
00134     {
00135         HisEvYnameEdit->clear();
00136         HisDatYnameEdit->clear();
00137     }
00138     else
00139     {
00140         HisEvYnameEdit->setText(TGo4DynamicEntry::fgcNOEVENT);
00141         HisDatYnameEdit->setText(TGo4DynamicEntry::fgcNODATA);
00142     }
00143     if(HisZframe->isEnabled())
00144     {
00145         HisEvZnameEdit->clear();
00146         HisDatZnameEdit->clear();
00147     }
00148     else
00149     {
00150         HisEvZnameEdit->setText(TGo4DynamicEntry::fgcNOEVENT);
00151         HisDatZnameEdit->setText(TGo4DynamicEntry::fgcNODATA);
00152     }
00153     TreenameEdit->clear();
00154    TreeExpressionEdit->clear();
00155    CutExpressionEdit->clear();
00156     //ClearConditionInfo();
00157     //ClearHistogramInfo();
00158 fbTypingMode=true;
00159 }
00160 
00161 void TGo4EditDynEntry::UpdateStatusFromGUI()
00162 {
00163 // this method is useful when all visible information shall
00164 // be put to the current status at once. Usually, any change
00165 // is handled by textChanged signals of lineedit widgets. however,
00166 // in case of switching between different entry modes, some
00167 // information may be lost since old status is deleted here.
00168 ChangeEntryName(EntryNameLineEdit->text());
00169 ChangeConditionName(CondnameEdit->text());
00170 ChangeCEvX(CEvXnameEdit->text());
00171 ChangeCDataX(CDataXnameEdit->text());
00172 ChangeCEvY(CEvYnameEdit->text());
00173 ChangeCDataY(CDataYnameEdit->text());
00174 ChangeHistogramName(HisnameEdit->text());
00175 ChangeHisEvX(HisEvXnameEdit->text());
00176 ChangeHisDatX(HisDatXnameEdit->text());
00177 ChangeHisEvY(HisEvYnameEdit->text());
00178 ChangeHisDatY(HisDatYnameEdit->text());
00179 ChangeHisEvZ(HisEvZnameEdit->text());
00180 ChangeHisDatZ(HisDatZnameEdit->text());
00181 ChangeTreeName(TreenameEdit->text());
00182 ChangeTreeExpression(TreeExpressionEdit->text());
00183 ChangeTreeCut(CutExpressionEdit->text());
00184 }
00185 
00186 
00187 void TGo4EditDynEntry::SetEntryEdit( bool on )
00188 {
00189    // this decides if editor can change the entry properties ("new entry" mode, on=true),
00190    // or if editor may change the values inside existing entry type only (on=false)
00191 fbTypingMode=false;
00192     if(on)
00193    {
00194       EntrynameBox->setEnabled(true);
00195       TypeComboBox->setEnabled(true);
00196         NewEntryButton->setEnabled(false); // do not launch editor twice
00197         RefreshButton->setEnabled(false); // do not update editor from analysis
00198         ApplyButton->setText("Create");
00199 //        const QColor editorcolor(192,227,255); // rgb values
00200 //        setPaletteBackgroundColor(editorcolor);
00201     }
00202    else
00203    {
00204       EntrynameBox->setEnabled(false);
00205       TypeComboBox->setEnabled(false);
00206         NewEntryButton->setEnabled(true);
00207         RefreshButton->setEnabled(true); // do not update editor from analysis
00208         ApplyButton->setText("Apply");
00209 //        unsetPalette();
00210     }
00211 fbTypingMode=true;
00212 }
00213 
00214 
00215 
00216 
00217 void TGo4EditDynEntry::RefreshDisplay( TGo4EditDynEntryStatus * state )
00218 {
00219 // show the current settings in the status object state on display
00220 if(state==0)  return;
00221 fbTypingMode=false;
00222 
00223 Text_t buffer[256];
00224 if(state->GetEntryType()==TGo4EditDynEntryStatus::kDataPointer)
00225 {
00226    SetEntryType("DataPointerEntry");
00227    TGo4HistogramEntryStatus* entrystate=
00228         dynamic_cast<TGo4HistogramEntryStatus*> (state->GetEntryStatus());
00229    if(entrystate)
00230         {
00231         EntryEnabledButton->setChecked(entrystate->AutoProcessIsEnabled());
00232         EntryNameLineEdit->setText(entrystate->GetName());
00233         ListNameLineEdit->setText("<default>");
00234         const char* coname=entrystate->GetConditionName();
00235         CondnameEdit->setText(coname);
00236         // enable/disable condition frame depending on enabled button!
00237         if(!strcmp(coname,TGo4DynamicEntry::fgcNOCONDITION))
00238             {
00239                 ConditionEnabledButton->setChecked(false);
00240                 ConditionFrame->setEnabled(false);
00241             }
00242         else
00243             {
00244                 ConditionEnabledButton->setChecked(true);
00245                 ConditionFrame->setEnabled(true);
00246             }
00247 
00248 
00249         snprintf(buffer,256,"Class: %s", entrystate->GetConditionClass());
00250         //ConClass->setText(buffer);
00251         CEvXnameEdit->setText(entrystate->GetConEventName(0));
00252         CDataXnameEdit->setText(entrystate->GetConVarName(0));
00253         bool wasConYchecked=YConEnabledButton->isChecked();
00254         const Text_t* cevyname=entrystate->GetConEventName(1);
00255         if(strcmp(cevyname,TGo4DynamicEntry::fgcNOEVENT))
00256             {
00257                 CEvYnameEdit->setText(cevyname);
00258                 CDataYnameEdit->setText(entrystate->GetConVarName(1));
00259                 YConEnabledButton->setChecked(true);
00260                 if(wasConYchecked)
00261                     ConYframe->setEnabled(true); // no toggle case
00262             }
00263       else
00264             {                
00265                 YConEnabledButton->setChecked(false);
00266                  if(!wasConYchecked)
00267                     ConYframe->setEnabled(false); // no toggle case
00268                 ConYEnabled(false); // reset strings
00269             }
00270       HisnameEdit->setText(entrystate->GetHistogramName());
00271       snprintf(buffer,256,"Class: %s", entrystate->GetHistogramClass());
00272       //HisClass->setText(buffer);
00273       HisEvXnameEdit->setText(entrystate->GetHisEventName(0));
00274       HisDatXnameEdit->setText(entrystate->GetHisVarName(0));
00275       const Text_t* hevyname=entrystate->GetHisEventName(1);
00276       bool wasYchecked=YEnabledButton->isChecked(); // record previous state of toggle buttons
00277       bool wasZchecked=ZEnabledButton->isChecked();  
00278         if(strcmp(hevyname,TGo4DynamicEntry::fgcNOEVENT))
00279             {
00280                 HisEvYnameEdit->setText(hevyname);
00281                 HisDatYnameEdit->setText(entrystate->GetHisVarName(1));
00282                 YEnabledButton->setChecked(true);
00283                 if(wasYchecked)
00284                     {
00285                         // button is not toggled, so no toggle signal send
00286                         // we have to call the methods manually:
00287                         HisYframe->setEnabled(true);
00288                         HisZsuperframe->setEnabled(true);   
00289                     }
00290                 
00291                 const Text_t* hevzname=entrystate->GetHisEventName(2);
00292                 if(strcmp(hevzname,TGo4DynamicEntry::fgcNOEVENT))
00293                     {
00294                         HisEvZnameEdit->setText(hevzname);
00295                         HisDatZnameEdit->setText(entrystate->GetHisVarName(2));
00296                         ZEnabledButton->setChecked(true);
00297                         if(wasZchecked)
00298                                 HisZframe->setEnabled(true); // no toggle case
00299                         
00300                     }
00301                 else
00302                     {
00303                         ZEnabledButton->setChecked(false);
00304                         if(!wasZchecked)
00305                                 HisZframe->setEnabled(false);// no toggle case
00306                     }
00307             }
00308         else
00309             {
00310                 YEnabledButton->setChecked(false);
00311                  if(!wasYchecked)
00312                     {
00313                         // button is not toggled, so no toggle signal send
00314                         // we have to call the methods manually:
00315                         HisYframe->setEnabled(false);
00316                         HisZsuperframe->setEnabled(false);   
00317                     }
00318                 
00319                 ZEnabledButton->setChecked(false);
00320             }
00321       // clear all other fields:
00322         TreenameEdit->clear();
00323         TreeExpressionEdit->clear();
00324         CutExpressionEdit->clear();
00325    }
00326    else {}
00327 }
00328 else if (state->GetEntryType()==TGo4EditDynEntryStatus::kTreeDraw)
00329 {
00330     //cout <<"Refresh tree draw display" << endl;
00331     SetEntryType("TreeDrawEntry");
00332     TGo4TreeHistogramEntryStatus* entrystate=
00333         dynamic_cast<TGo4TreeHistogramEntryStatus*> (state->GetEntryStatus());
00334     if(entrystate)
00335         {
00336         // update widgets from status here:
00337         EntryEnabledButton->setChecked(entrystate->AutoProcessIsEnabled());
00338         EntryNameLineEdit->setText(entrystate->GetName());
00339         ListNameLineEdit->setText("<default>");
00340         HisnameEdit->setText(entrystate->GetHistogramName());
00341         TreenameEdit->setText(entrystate->GetTreeName());
00342         TreeExpressionEdit->setText(entrystate->GetVarexp());
00343         CutExpressionEdit->setText(entrystate->GetSelection().GetTitle());
00344         DynIntervalSpin->setValue(entrystate->GetDynListInterval());
00345         // clear all other fields:
00346         HisEvXnameEdit->clear();
00347         HisDatXnameEdit->clear();
00348         HisEvYnameEdit->clear();
00349         HisDatYnameEdit->clear();
00350         HisEvZnameEdit->clear();
00351         HisDatZnameEdit->clear();
00352         CondnameEdit->clear();
00353         CEvXnameEdit->clear();
00354         CDataXnameEdit->clear();
00355         CEvYnameEdit->clear();
00356         CDataYnameEdit->clear();
00357     }
00358    else {}
00359 }
00360 else
00361 {
00362       cerr <<"Refresh display error: inconsistent entry type!!!! " << endl;
00363 }
00364 polish();
00365 update();
00366 show();
00367 //showNormal();
00368 adjustSize();
00369 raise();
00370 fbTypingMode=true;
00371 }
00372 
00373 
00374 
00375 
00376 void TGo4EditDynEntry::ChangeEntryName(const QString & s )
00377 {
00378 if(!fbTypingMode) return;
00379     fxTGo4EditDynEntryStatus->SetEntryName(s);
00380     ConfirmEntry();
00381     // note that we use implicit conversion of QString to const char*
00382 }
00383 
00384 
00385 void TGo4EditDynEntry::ChangeListName(const QString & s )
00386 {
00387 if(!fbTypingMode) return;
00388     fxTGo4EditDynEntryStatus->SetListName(s);
00389     ConfirmEntry();
00390 }
00391 
00392 void TGo4EditDynEntry::ChangeConditionEnabled( bool on )
00393 {
00394 if(!fbTypingMode) return;
00395     //TGo4DynamicEntryStatus* entrystate=fxTGo4EditDynEntryStatus->GetEntryStatus();
00396     //CondnameEdit->setText(entrystate->GetConditionName());
00397     ConditionFrame->setEnabled(on);
00398     fxTGo4EditDynEntryStatus->SetConditionEnabled(on);
00399     if(on) fxTGo4EditDynEntryStatus->SetConditionName(CondnameEdit->text().stripWhiteSpace());
00400     ConfirmEntry();
00401 }
00402 
00403 void TGo4EditDynEntry::ChangeConditionName(const QString & s )
00404 {
00405 if(!fbTypingMode) return;
00406    fxTGo4EditDynEntryStatus->SetConditionName(s.stripWhiteSpace().section('/',-1));
00407    // we strip optional path name from condition name here
00408    fxTGo4EditDynEntrySlots->SetConditionClass("no"); // reset previous class
00409    //ClearConditionInfo(); // reset information whenever name changes
00410    ConfirmEntry();
00411 }
00412 
00413 void TGo4EditDynEntry::ChangeCEvX(const QString &s )
00414 {
00415 if(!fbTypingMode) return;
00416    fxTGo4EditDynEntryStatus->SetCEvX(s);
00417    ConfirmEntry();
00418 }
00419 
00420 void TGo4EditDynEntry::ChangeCDataX(const QString & s )
00421 {
00422 if(!fbTypingMode) return;
00423    fxTGo4EditDynEntryStatus->SetCDataX(s);
00424    ConfirmEntry();
00425 }
00426 
00427 void TGo4EditDynEntry::ChangeCEvY(const QString &s )
00428 {
00429 if(!fbTypingMode) return;
00430    fxTGo4EditDynEntryStatus->SetCEvY(s);
00431    ConfirmEntry();
00432 }
00433 
00434 
00435 void TGo4EditDynEntry::ChangeCDataY(const QString & s )
00436 {
00437 if(!fbTypingMode) return;
00438    fxTGo4EditDynEntryStatus->SetCDataY(s);
00439    ConfirmEntry(); 
00440 }
00441 
00442 void TGo4EditDynEntry::ChangeHistogramName(const QString & s )
00443 {
00444 if(!fbTypingMode) return;
00445    fxTGo4EditDynEntryStatus->SetHistogramName(s.stripWhiteSpace());
00446     ConfirmEntry();
00447 }
00448 
00449 void TGo4EditDynEntry::ChangeHisEvX(const QString & s )
00450 {
00451 if(!fbTypingMode) return;
00452    fxTGo4EditDynEntryStatus->SetHisEvX(s);
00453    ConfirmEntry();
00454 }
00455 
00456 
00457 void TGo4EditDynEntry::ChangeHisEvY(const QString &s )
00458 {
00459 if(!fbTypingMode) return;
00460    fxTGo4EditDynEntryStatus->SetHisEvY(s);
00461    ConfirmEntry();
00462 }
00463 
00464 void TGo4EditDynEntry::ChangeHisEvZ(const QString & s )
00465 {
00466 if(!fbTypingMode) return;
00467    fxTGo4EditDynEntryStatus->SetHisEvZ(s);
00468    ConfirmEntry();
00469 }
00470 
00471 void TGo4EditDynEntry::ChangeHisDatX(const QString &s )
00472 {
00473 if(!fbTypingMode) return;
00474    fxTGo4EditDynEntryStatus->SetHisDatX(s);
00475    ConfirmEntry();
00476 }
00477 
00478 void TGo4EditDynEntry::ChangeHisDatY(const QString &s )
00479 {
00480 if(!fbTypingMode) return;
00481     fxTGo4EditDynEntryStatus->SetHisDatY(s);
00482     ConfirmEntry();
00483 }
00484 
00485 void TGo4EditDynEntry::ChangeHisDatZ(const QString &s )
00486 {
00487 if(!fbTypingMode) return;
00488     fxTGo4EditDynEntryStatus->SetHisDatZ(s);
00489     ConfirmEntry();
00490 }
00491 
00492 void TGo4EditDynEntry::ChangeTreeName(const QString & s )
00493 {
00494 if(!fbTypingMode) return;
00495     fxTGo4EditDynEntryStatus->SetTreeName(s);
00496     ConfirmEntry();
00497 }
00498 
00499 void TGo4EditDynEntry::ChangeTreeExpression(const QString & s )
00500 {
00501 if(!fbTypingMode) return;
00502    fxTGo4EditDynEntryStatus->SetTreeExpression(s);
00503    ConfirmEntry();
00504 }
00505 
00506 void TGo4EditDynEntry::ChangeTreeCut(const QString & s )
00507 {
00508 if(!fbTypingMode) return;
00509    fxTGo4EditDynEntryStatus->SetTreeCut(s);
00510    ConfirmEntry();
00511 }
00512 
00513 void TGo4EditDynEntry::SetEntryEnabled( bool on)
00514 {
00515 if(!fbTypingMode) return;
00516    fxTGo4EditDynEntryStatus->SetEntryEnabled(on);
00517    ConfirmEntry();
00518 }
00519 
00520 
00521 void TGo4EditDynEntry::RefreshClicked()
00522 {
00523     fxTGo4EditDynEntrySlots->SendRefreshCommand();
00524     StatusMessage("Refreshed entry from analysis.");
00525 }
00526 
00527 void TGo4EditDynEntry::ApplyClicked()
00528 {
00529     fxTGo4EditDynEntrySlots->SendApplyCommand();
00530     int interval=DynIntervalSpin->value();
00531     fxTGo4EditDynEntrySlots->SendSetDynListIntervalCommand(interval);
00532     SetPleaseUpdate(false);
00533     StatusMessage("Applied entry to analysis.");
00534 }
00535 
00536 
00537 void TGo4EditDynEntry::HistogramInfo()
00538 {
00539     //fxTGo4EditDynEntrySlots->SendHistogramInfoCommand();
00540     const char* name=fxTGo4EditDynEntryStatus->GetHistogramName();
00541     TGo4MainWindow *fxMainWindow=(TGo4MainWindow *)fxTGo4GUIRegistry->GetMainWindow();
00542    fxMainWindow->HistogramInfoSlot(name);
00543 }
00544 
00545 void TGo4EditDynEntry::NewHistogram()
00546 {
00547     TGo4LockGuard Global;
00548    TGo4MainWindow *fxMainWindow=(TGo4MainWindow *)fxTGo4GUIRegistry->GetMainWindow();
00549    fxMainWindow->CreateNewHist();
00550 }
00551 
00552 void TGo4EditDynEntry::ConditionInfo()
00553 {
00554     //fxTGo4EditDynEntrySlots->SendConditionInfoCommand();
00555     const char* name=fxTGo4EditDynEntryStatus->GetConditionName();
00556     TGo4MainWindow *fxMainWindow=(TGo4MainWindow *)fxTGo4GUIRegistry->GetMainWindow();
00557    fxMainWindow->ConditionInfoSlot(name);
00558 
00559 }
00560 
00561 void TGo4EditDynEntry::NewEntry()
00562 {
00563    TGo4LockGuard Global;
00564    const Text_t* name="NewEntry";
00565     Text_t slotname[256];
00566     snprintf(slotname,256,"%s_Slots",name);
00567    TGo4EditDynEntry* neditor=0;
00568     TGo4EditDynEntrySlots* nslots=0;
00569    nslots = dynamic_cast <TGo4EditDynEntrySlots *> (fxTGo4GUIRegistry->GetSlotClass(slotname));
00570    if (nslots ==0)
00571         {
00572       //cout <<"########## slot not found, creating new" << endl;
00573         neditor=new TGo4EditDynEntry(fxTGo4GUIRegistry->GetCentralWindow(),
00574                                            name);
00575         }
00576     else
00577         {
00578         //cout <<"########## slot"<<slotname<<" found: "<< (int*) nslots << endl;
00579         neditor  = dynamic_cast <TGo4EditDynEntry *> (fxTGo4GUIRegistry->GetGUIClass(nslots));
00580         if (neditor==0)
00581             {
00582                 //cout <<"########## gui not found, new "<< endl;
00583                 neditor=new TGo4EditDynEntry(fxTGo4GUIRegistry->GetCentralWindow(),
00584                                            name);
00585             }
00586         else {} //if (neditor ==0)
00587          } //if (nslots ==0)
00588     neditor->SetEntryEdit(true);
00589     neditor->SetEntryType("DataPointerEntry");
00590     neditor->polish();
00591     neditor->update();
00592     neditor->showNormal();
00593     neditor->adjustSize();
00594     neditor->raise();
00595 }
00596 
00597 
00598 
00599 
00600 
00601 
00602 
00603 void TGo4EditDynEntry::ConYEnabled( bool on )
00604 {
00605 fbTypingMode=false;
00606 fxTGo4EditDynEntryStatus->SetConditionYEnabled(on);
00607 TGo4DynamicEntryStatus* entrystate=fxTGo4EditDynEntryStatus->GetEntryStatus();
00608 CEvYnameEdit->setText(entrystate->GetConEventName(1));
00609 CDataYnameEdit->setText(entrystate->GetConVarName(1));
00610 fbTypingMode=true;
00611 }
00612 
00613 
00614 void TGo4EditDynEntry::HisYEnabled( bool on )
00615 {
00616 fbTypingMode=false;
00617 fxTGo4EditDynEntryStatus->SetHisYEnabled(on);
00618 TGo4HistogramEntryStatus* entrystate=
00619     dynamic_cast<TGo4HistogramEntryStatus*>(fxTGo4EditDynEntryStatus->GetEntryStatus());
00620 if(entrystate)
00621     {
00622     HisEvYnameEdit->setText(entrystate->GetHisEventName(1));
00623     HisDatYnameEdit->setText(entrystate->GetHisVarName(1));
00624     HisEvZnameEdit->setText(entrystate->GetHisEventName(2));
00625     HisDatZnameEdit->setText(entrystate->GetHisVarName(2));
00626     }
00627 fbTypingMode=true;
00628 }
00629 
00630 void TGo4EditDynEntry::HisZEnabled( bool on )
00631 {
00632 fbTypingMode=false;
00633 fxTGo4EditDynEntryStatus->SetHisZEnabled(on);
00634 TGo4HistogramEntryStatus* entrystate=
00635     dynamic_cast<TGo4HistogramEntryStatus*>(fxTGo4EditDynEntryStatus->GetEntryStatus());
00636 if(entrystate)
00637 {
00638     HisEvZnameEdit->setText(entrystate->GetHisEventName(2));
00639     HisDatZnameEdit->setText(entrystate->GetHisVarName(2));
00640 }
00641 fbTypingMode=true;
00642 }
00643 
00644 
00645 
00646 void TGo4EditDynEntry::StartConditionEditor()
00647 {
00648 TGo4MainWindow *fxMainWindow=(TGo4MainWindow *)fxTGo4GUIRegistry->GetMainWindow();
00649 fxMainWindow->ConditionEditSlot();
00650 }
00651 
00652 
00653 
00654 
00655 void TGo4EditDynEntry::PrintDynList()
00656 {
00657     fxTGo4EditDynEntrySlots->SendDynListPrintCommand();
00658 }
00659 
00660 
00661 void TGo4EditDynEntry::ResetBackStoreClicked()
00662 {
00663 fxTGo4EditDynEntrySlots->SendResetBackStoreCommand();
00664 }
00665 
00666 void TGo4EditDynEntry::SetDynListInterval( int )
00667 {
00668 // we do not use this slot, the interval value is buffered in the spinbox
00669 // will be set with ApplyClicked()
00670 SetPleaseUpdate(true); // change warn sign whenever spinbox was touched
00671 }
00672 
00673 void TGo4EditDynEntry::ClearHistogramClicked()
00674 {
00675 fxTGo4EditDynEntrySlots->SendHistogramClearCommand();
00676 if (fxTGo4EditDynEntryStatus->GetEntryType()==TGo4EditDynEntryStatus::kTreeDraw)
00677             fxTGo4EditDynEntrySlots->SendResetBackStoreCommand();
00678 }
00679 
00680 
00681 void TGo4EditDynEntry::SetPleaseUpdate( bool on )
00682 {
00683 PleaseUpdateLabel->setShown(on);
00684 polish();
00685 update();
00686 show();
00687 }
00688 
00689 void TGo4EditDynEntry::ConfirmEntry()
00690 {
00691    if(!PleaseUpdateLabel->isShown())
00692         SetPleaseUpdate(true);
00693 }
00694 
00695 
00696 
00697 
00698 
00699 
00700 
00701 
00702 
00703 void TGo4EditDynEntry::LoadEntrySlot()
00704 {
00705 
00706 TGo4DiskFileBrowserSlots *filebrowserslots = dynamic_cast <TGo4DiskFileBrowserSlots *> (fxTGo4GUIRegistry->GetSlotClass("TGo4DiskFileBrowserSlots"));
00707 TObject* ob=0;
00708 const Text_t* filename;
00709 const Text_t* obname=EntryNameLineEdit->text().stripWhiteSpace();
00710 if(filebrowserslots)
00711     filename=filebrowserslots->LoadObject(&ob,obname);
00712 else
00713     filename=0;
00714 fxTGo4EditDynEntrySlots->AddObject(dynamic_cast<TNamed*>(ob));
00715 char buf[256];
00716 if(filename)
00717     snprintf(buf,256,"Loaded %s to %s",obname, filename);
00718 else
00719     snprintf(buf,256,"Failed to load %s",obname);
00720 StatusMessage(buf);
00721 
00722 }
00723 
00724 void TGo4EditDynEntry::SaveEntrySlot()
00725 {
00726 
00727 TGo4DiskFileBrowserSlots *filebrowserslots = dynamic_cast <TGo4DiskFileBrowserSlots *> (fxTGo4GUIRegistry->GetSlotClass("TGo4DiskFileBrowserSlots"));
00728 const Text_t* filename;
00729 const Text_t* obname=EntryNameLineEdit->text().stripWhiteSpace();
00730 if(filebrowserslots)
00731     {
00732     TGo4DynamicEntry* tosave=0;
00733     TGo4DynamicEntryStatus* state=fxTGo4EditDynEntryStatus->GetEntryStatus();
00734     if(state)
00735        {
00736         tosave=state->CreateDynamicEntry();
00737         filename=filebrowserslots->SaveObject(tosave, obname);
00738         delete tosave;
00739        }
00740     }
00741 else
00742     {
00743         filename=0;
00744     }
00745 char buf[256];
00746 if(filename)
00747     snprintf(buf,256,"Saved %s to %s",obname, filename);
00748 else
00749     snprintf(buf,256,"Failed to save %s",obname);
00750 StatusMessage(buf);
00751 }
00752 
00753 
00754 void TGo4EditDynEntry::StatusMessage( const QString &mess )
00755 {
00756 QString text="Dynamic Entry Editor ";
00757 text.append(name());
00758 text.append(" :");
00759 text.append(mess);
00760 TGo4MainWindow *MW= dynamic_cast<TGo4MainWindow *>(fxTGo4GUIRegistry->GetMainWindow());
00761 if(MW) MW->StatusMessage(text);
00762 }
00763 
00764 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:56:00 2005 for Go4-v2.10-5 by doxygen1.2.15