00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
00050
00051 if (fxData->InheritsFrom("TGo4Condition"))
00052 {
00053
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
00066 }
00067 else
00068 {
00069
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
00104 TGo4LockGuard main;
00105 const Text_t* name=fxTGo4ConditionInfo->GetConditionName();
00106 TGo4ComGetCondition *com = new TGo4ComGetCondition(name);
00107 fxTGo4GUIRegistry->SubmitCommand(com,name,this);
00108
00109
00110 }
00111
00112
00113
00114
00115
00116 void TGo4ConditionInfoSlots::SendConditionPrintCommand()
00117 {
00118
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
00134 if(condislot==0)
00135 {
00136 condislot = new TGo4WindowEditSlots(SlotName, "Condition Editor");
00137 }
00138 TGo4ComGetCondition *com = new TGo4ComGetCondition(condi);
00139 fxTGo4GUIRegistry->SubmitCommand(com, condi, condislot);
00140 }
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151