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

/Go4GUI/TGo4EditDynEntryStatus.cxx

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 #include "TGo4EditDynEntryStatus.h"
00017 
00018 #include <iostream.h>
00019 
00020 #include "TClass.h"
00021 
00022 #include "Go4LockGuard/TGo4LockGuard.h"
00023 #include "Go4DynamicList/TGo4DynamicEntryStatus.h"
00024 #include "Go4DynamicList/TGo4TreeHistogramEntryStatus.h"
00025 #include "Go4DynamicList/TGo4HistogramEntryStatus.h"
00026 
00027 TGo4EditDynEntryStatus::TGo4EditDynEntryStatus(const char* name, const char* title)
00028     :TGo4Status(name, title), fiEntryType(kNone),fxPointerEntryStatus(0), fxTreeEntryStatus(0)
00029 {
00030    TGo4LockGuard Global;
00031    fxEntryStatus= new TGo4HistogramEntryStatus(); // initial dummy
00032    fxEntryStatus->ResetNames();
00033    fxPointerEntryStatus=dynamic_cast<TGo4HistogramEntryStatus*>(fxEntryStatus);
00034    fxTreeEntryStatus=0;
00035    fiEntryType=kDataPointer;
00036    //SetEntryType(kDataPointer);
00037 }
00038 
00039 TGo4EditDynEntryStatus::~TGo4EditDynEntryStatus()
00040 {
00041    TGo4LockGuard Global;
00042    delete fxEntryStatus;
00043 }
00044 
00045 void TGo4EditDynEntryStatus::UpdateEntry(TGo4DynamicEntryStatus* source)
00046 {
00047    if(source==0) return;
00048      {
00049           //cout <<"cloning data pointer entry "<< source->GetName() << endl;
00050           TGo4LockGuard Global;
00051           delete fxEntryStatus;
00052           fxEntryStatus=dynamic_cast<TGo4DynamicEntryStatus*> (source->Clone());
00053      } // TGo4LockGuard
00054 
00055    if(source->InheritsFrom("TGo4HistogramEntryStatus"))
00056       {
00057          fxPointerEntryStatus=dynamic_cast<TGo4HistogramEntryStatus*>(fxEntryStatus);
00058          fxTreeEntryStatus=0;
00059          SetEntryType(kDataPointer);
00060       }
00061    else if (source->InheritsFrom("TGo4TreeHistogramEntryStatus"))
00062       {
00063          fxTreeEntryStatus=dynamic_cast<TGo4TreeHistogramEntryStatus*>(fxEntryStatus);
00064          fxPointerEntryStatus=0;
00065          SetEntryType(kTreeDraw);
00066       }
00067    else
00068       {
00069          cerr <<"!!! Error in updating entry !!!" << endl;
00070          cerr <<"!!! Unknown source of class "<<source->IsA()->GetName() << endl;
00071          return;
00072       } //if(source->InheritsFrom("TGo4HistogramEntryStatus"))
00073 
00074 // alternative to cloning: use operator= (not working yet!)
00075 //   cout <<"assigning data pointer entry to internal entry"<< source->GetName() << endl;
00076 //   *fxEntryStatus=*source;
00077 
00078 }
00079 
00080 
00081 void TGo4EditDynEntryStatus::SetEntryType(EDynEntryTypes id)
00082 {
00083 TGo4LockGuard Global;
00084 fiEntryType=id;
00085 switch(id)
00086    {
00087        case kDataPointer:
00088           if(fxTreeEntryStatus)
00089              {
00090                 delete fxEntryStatus; // remove previous type if different
00091                 fxEntryStatus=new TGo4HistogramEntryStatus(); // dummy for editor
00092                 fxEntryStatus->ResetNames();
00093                 //cout <<"TGo4EditDynEntryStatus::SetEntryType to pointer, "<< GetName()  << endl;
00094              }
00095           fxPointerEntryStatus=dynamic_cast<TGo4HistogramEntryStatus*>(fxEntryStatus);
00096           fxTreeEntryStatus=0;
00097           break;
00098 
00099        case kTreeDraw:
00100           if(fxPointerEntryStatus)
00101              {
00102                 delete fxEntryStatus; // remove previous type if different
00103                 fxEntryStatus=new TGo4TreeHistogramEntryStatus(); // dummy for editor
00104                 fxEntryStatus->ResetNames();
00105                 //cout <<"TGo4EditDynEntryStatus::SetEntryType to tree, "<< GetName()  << endl;
00106              }
00107           fxTreeEntryStatus=dynamic_cast<TGo4TreeHistogramEntryStatus*>(fxEntryStatus);
00108           fxPointerEntryStatus=0;
00109           break;
00110 
00111        default:
00112           fxTreeEntryStatus=0;
00113           fxPointerEntryStatus=0;
00114           break;
00115    }// switch
00116 
00117 }
00118 
00119 
00120 
00121 TGo4DynamicEntryStatus* TGo4EditDynEntryStatus::GetEntryStatus()
00122 {
00123    return fxEntryStatus;
00124 }
00125 
00126 
00127 void TGo4EditDynEntryStatus::SetEntryName(const Text_t* txt )
00128 {
00129    fxEntryStatus->SetName(txt);
00130 }
00131 
00132 
00133 void TGo4EditDynEntryStatus::SetListName(const Text_t* txt )
00134 {
00135    //fxEntryStatus->SetListName(txt); // not yet working!
00136 }
00137 
00138 
00139 void TGo4EditDynEntryStatus::SetConditionName(const Text_t* txt )
00140 {
00141    fxEntryStatus->SetConditionName(txt);
00142 }
00143 
00144 const Text_t* TGo4EditDynEntryStatus::GetConditionName()
00145 {
00146     return fxEntryStatus->GetConditionName();
00147 }
00148 
00149 void TGo4EditDynEntryStatus::SetCEvX(const Text_t* txt )
00150 {
00151    fxEntryStatus->SetConEventName(0,txt);
00152 }
00153 
00154 void TGo4EditDynEntryStatus::SetCDataX(const Text_t* txt )
00155 {
00156    fxEntryStatus->SetConVarName(0,txt);
00157 }
00158 
00159 void TGo4EditDynEntryStatus::SetCEvY(const Text_t* txt )
00160 {
00161    fxEntryStatus->SetConEventName(1,txt);
00162 }
00163 
00164 
00165 void TGo4EditDynEntryStatus::SetCDataY(const Text_t* txt )
00166 {
00167    fxEntryStatus->SetConVarName(1,txt);
00168 }
00169 
00170 void TGo4EditDynEntryStatus::SetHistogramName(const Text_t* txt )
00171 {
00172    fxEntryStatus->SetHistogramName(txt);
00173 }
00174 
00175 const Text_t* TGo4EditDynEntryStatus::GetHistogramName()
00176 {
00177     return fxEntryStatus->GetHistogramName();
00178 }
00179 
00180 
00181 void TGo4EditDynEntryStatus::SetHisEvX(const Text_t* txt )
00182 {
00183   if(fxPointerEntryStatus)
00184       {
00185          fxPointerEntryStatus->SetHisEventName(0,txt);
00186       }
00187 }
00188 
00189 
00190 void TGo4EditDynEntryStatus::SetHisEvY(const Text_t* txt )
00191 {
00192   if(fxPointerEntryStatus)
00193       {
00194          fxPointerEntryStatus->SetHisEventName(1,txt);
00195       }
00196 }
00197 
00198 void TGo4EditDynEntryStatus::SetHisEvZ(const Text_t* txt )
00199 {
00200   if(fxPointerEntryStatus)
00201       {
00202          fxPointerEntryStatus->SetHisEventName(2,txt);
00203       }
00204 }
00205 
00206 void TGo4EditDynEntryStatus::SetHisDatX(const Text_t* txt )
00207 {
00208   if(fxPointerEntryStatus)
00209       {
00210          fxPointerEntryStatus->SetHisVarName(0,txt);
00211       }
00212 }
00213 
00214 void TGo4EditDynEntryStatus::SetHisDatY(const Text_t* txt )
00215 {
00216   if(fxPointerEntryStatus)
00217       {
00218          fxPointerEntryStatus->SetHisVarName(1,txt);
00219       }
00220 }
00221 
00222 void TGo4EditDynEntryStatus::SetHisDatZ(const Text_t* txt )
00223 {
00224   if(fxPointerEntryStatus)
00225       {
00226          fxPointerEntryStatus->SetHisVarName(2,txt);
00227       }
00228 }
00229 
00230 void TGo4EditDynEntryStatus::SetTreeName(const Text_t* txt )
00231 {
00232 if(fxTreeEntryStatus)
00233    {
00234       fxTreeEntryStatus->SetTreeName(txt);
00235    }
00236 }
00237 
00238 void TGo4EditDynEntryStatus::SetTreeExpression(const Text_t* txt )
00239 {
00240 if(fxTreeEntryStatus)
00241    {
00242       fxTreeEntryStatus->SetVarexp(txt);
00243    }
00244 }
00245 
00246 
00247 void TGo4EditDynEntryStatus::SetTreeCut(const Text_t* txt )
00248 {
00249 if(fxTreeEntryStatus)
00250    {
00251       TCut selection(txt);
00252       fxTreeEntryStatus->SetSelection(selection);
00253    }
00254 
00255 }
00256 
00257 
00258 void TGo4EditDynEntryStatus::SetEntryEnabled(Bool_t on)
00259 {
00260    fxEntryStatus->EnableProcessing(on);
00261 }
00262 
00263 void TGo4EditDynEntryStatus::SetConditionEnabled(Bool_t on)
00264 {
00265    if(!on)
00266       {
00267          fxEntryStatus->SetConditionName(TGo4DynamicEntry::fgcNOCONDITION);
00268       }
00269    else
00270       {
00271         // fxEntryStatus->SetConditionName(""); // we keep old name
00272 
00273       }
00274 }
00275 
00276 void TGo4EditDynEntryStatus::SetConditionYEnabled(Bool_t on)
00277 {
00278    if(!on)
00279       {
00280          SetCEvY(TGo4DynamicEntry::fgcNOEVENT);
00281          SetCDataY(TGo4DynamicEntry::fgcNODATA);
00282       }
00283    else
00284       {
00285       }
00286 }
00287 
00288 void TGo4EditDynEntryStatus::SetHisYEnabled(Bool_t on)
00289 {
00290    if(!on)
00291       {
00292          SetHisEvY(TGo4DynamicEntry::fgcNOEVENT);
00293          SetHisDatY(TGo4DynamicEntry::fgcNODATA);
00294          SetHisEvZ(TGo4DynamicEntry::fgcNOEVENT);
00295          SetHisDatZ(TGo4DynamicEntry::fgcNODATA);
00296       }
00297    else
00298       {
00299       }
00300 }
00301 
00302 void TGo4EditDynEntryStatus::SetHisZEnabled(Bool_t on)
00303 {
00304    if(!on)
00305       {
00306          SetHisEvZ(TGo4DynamicEntry::fgcNOEVENT);
00307          SetHisDatZ(TGo4DynamicEntry::fgcNODATA);
00308       }
00309    else
00310       {
00311       }
00312 }
00313 
00314 void TGo4EditDynEntryStatus::ResetNames()
00315 {
00316    fxEntryStatus->ResetNames();
00317 }
00318 
00319 
00320 
00321 
00322 
00323 
00324 
00325 
00326 //----------------------------END OF GO4 SOURCE FILE ---------------------

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