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

/Go4GUI/TGo4ConditionInfoSlots.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 "TGo4ConditionInfoSlots.h"
00017 
00018 #include <iostream.h>
00019 
00020 #include "TVirtualPad.h"
00021 
00022 #include "Go4GUIRegistry/TGo4GUIRegistry.h"
00023 #include "Go4LockGuard/TGo4LockGuard.h"
00024 #include "Go4CommandsAnalysis/TGo4ComGetCondition.h"
00025 #include "Go4StatusAnalysis/TGo4HistogramStatus.h"
00026 #include "Go4ConditionsBase/TGo4Condition.h"
00027 #include "Go4ConditionsBase/TGo4CondArray.h"
00028 #include "Go4ConditionsBase/TGo4WinCond.h"
00029 #include "Go4ConditionsBase/TGo4PolyCond.h"
00030 #include "TGo4WindowEditSlots.h"
00031 #include "TGo4ConditionInfo.h"
00032 #include "TGo4ConditionInfoStatus.h"
00033 
00034 
00035 TGo4ConditionInfoSlots::TGo4ConditionInfoSlots(const char * name, const char * title,  TGo4ConditionInfo * p)
00036    :TGo4SlotsBaseClass(name , title), fxTGo4ConditionInfo(p), fiCondArrayType(0)
00037    {
00038    TGo4LockGuard Global;
00039    char StatusName[256];
00040    fxTGo4GUIRegistry=TGo4GUIRegistry::Instance();
00041    sprintf(StatusName,"%s","ConditionInfoStatus" );
00042    fxTGo4ConditionInfoStatus= new TGo4ConditionInfoStatus(StatusName, "DynEntryStatus");
00043    fxTGo4GUIRegistry->RegisterSlotClass(this, fxTGo4ConditionInfoStatus, p);
00044 }
00045 
00046 void TGo4ConditionInfoSlots::AddObject(TNamed *fxData)
00047 {
00048    if(fxData==0) return;
00049 //   cout <<"TGo4ConditionInfoSlots got object "<< fxData << endl;
00050 //   cout <<"Name:"<<fxData->GetName() << endl;
00051    if  (fxData->InheritsFrom("TGo4Condition"))
00052       {
00053        // refresh the condition information displayed
00054           TGo4Condition* cs=dynamic_cast<TGo4Condition*>(fxData);
00055           fxTGo4ConditionInfo->RefreshConditionInfo(cs);
00056           fxConditionClass=cs->IsA()->GetName();
00057           if(cs->InheritsFrom("TGo4CondArray"))
00058              {
00059                  dynamic_cast<TGo4CondArray*>(cs)->GetType(fiCondArrayType);
00060              }
00061          else
00062             {
00063                 fiCondArrayType=0;
00064             }
00065          //cout <<"Received condition with arraytype "<< fiCondArrayType<< endl;
00066       }
00067    else
00068       {
00069          //cerr <<"ERROR in TGo4ConditionInfoSlots: AddObject got unknown type" << endl;
00070       }
00071 
00072 }
00073 
00074 void TGo4ConditionInfoSlots::SetGUI(TGo4ConditionInfo *GUI)
00075 {
00076    fxTGo4ConditionInfo=GUI;
00077 
00078 }
00079 void TGo4ConditionInfoSlots::StatusChanged(TGo4Status *status)
00080 {
00081    TGo4LockGuard Global;
00082 
00083 
00084 }
00085 TGo4ConditionInfoSlots::~TGo4ConditionInfoSlots()
00086 {
00087    TGo4LockGuard Global;
00088    delete fxTGo4ConditionInfoStatus;
00089 
00090 }
00091 
00092 TGo4Status * TGo4ConditionInfoSlots::GetStatus()
00093 {
00094    return fxTGo4ConditionInfoStatus;
00095 }
00096 
00097 
00098 
00099 
00100 
00101 void TGo4ConditionInfoSlots::SendConditionInfoCommand()
00102 {
00103   // request for the condition status to display it
00104   TGo4LockGuard main;
00105   const Text_t* name=fxTGo4ConditionInfo->GetConditionName();
00106   TGo4ComGetCondition *com = new TGo4ComGetCondition(name);
00107   fxTGo4GUIRegistry->SubmitCommand(com,name,this);
00108   // condition status is condition itself!
00109   // Method AddObject will handle condition when coming
00110 }
00111 
00112 
00113 
00114 
00115 
00116 void TGo4ConditionInfoSlots::SendConditionPrintCommand()
00117 {
00118   // request for the condition status to display it
00119   TGo4LockGuard main;
00120   fxTGo4GUIRegistry->SubmitCommand("ANPrcon");
00121 }
00122 
00123 
00124 
00125 
00126 void TGo4ConditionInfoSlots::SendConditionEditCommand()
00127 {
00128  TGo4LockGuard main;
00129  const Text_t* condi=fxTGo4ConditionInfo->GetConditionName();
00130  Text_t SlotName[256];
00131  snprintf(SlotName,256,"%s%s",condi,"_Slots" );
00132  TGo4SlotsBaseClass* condislot= fxTGo4GUIRegistry->GetSlotClass(SlotName);
00133  //cout <<"searching slot "<<SlotName << endl;
00134  if(condislot==0)
00135     {
00136        condislot = new TGo4WindowEditSlots(SlotName, "Condition Editor");
00137     } // if(condislot==0)
00138  TGo4ComGetCondition *com = new TGo4ComGetCondition(condi);
00139  fxTGo4GUIRegistry->SubmitCommand(com, condi, condislot);
00140 }
00141 
00142 
00143 
00144 
00145 
00146 
00147 
00148 
00149 
00150 
00151 //----------------------------END OF GO4 SOURCE FILE ---------------------

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