00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "TGo4HistogramInfoSlots.h"
00017
00018 #include <iostream.h>
00019
00020 #include "Go4LockGuard/TGo4LockGuard.h"
00021 #include "Go4CommandsAnalysis/TGo4ComGetObject.h"
00022 #include "Go4CommandsAnalysis/TGo4ComGetObjectStatus.h"
00023 #include "Go4Analysis/TGo4AnalysisObjectManager.h"
00024 #include "Go4StatusAnalysis/TGo4HistogramStatus.h"
00025 #include "Go4GUIRegistry/TGo4GUIRegistry.h"
00026 #include "TGo4WindowEditSlots.h"
00027 #include "TGo4MainWindow.h"
00028 #include "TGo4PreviewPanel.h"
00029 #include "TGo4QRootCanvas.h"
00030 #include "TGo4HistogramInfoStatus.h"
00031 #include "TGo4HistogramInfo.h"
00032
00033 TGo4HistogramInfoSlots::TGo4HistogramInfoSlots(const char * name, const char * title, TGo4HistogramInfo * p)
00034 :TGo4SlotsBaseClass(name , title), fxTGo4HistogramInfo(p), fiCondArrayType(0)
00035 {
00036 TGo4LockGuard Global;
00037 char StatusName[64];
00038 fxTGo4GUIRegistry=TGo4GUIRegistry::Instance();
00039 snprintf(StatusName,63,"%s","HistogramInfoStatus" );
00040 fxTGo4HistogramInfoStatus= new TGo4HistogramInfoStatus(StatusName, "DynEntryStatus");
00041 fxTGo4GUIRegistry->RegisterSlotClass(this, fxTGo4HistogramInfoStatus, p);
00042
00043 }
00044 void TGo4HistogramInfoSlots::AddObject(TNamed *fxData)
00045 {
00046 if(fxData==0) return;
00047
00048
00049 if (fxData->InheritsFrom("TGo4HistogramStatus"))
00050 {
00051
00052 TGo4HistogramStatus* hs=dynamic_cast<TGo4HistogramStatus*>(fxData);
00053 fxTGo4HistogramInfo->RefreshHistogramInfo(hs);
00054 }
00055 else if (fxData->InheritsFrom("TH1"))
00056 {
00057
00058
00059 TGo4MainWindow* mw= (TGo4MainWindow*) fxTGo4GUIRegistry->GetMainWindow();
00060 TGo4PreviewPanel* viewpanel =mw->ViewPanelSlot(1);
00061 TQRootCanvas* can=viewpanel->GetQCanvas();
00062 TPad* pad=viewpanel->GetActivePad();
00063 TGo4SlotsBaseClass* membrowser= fxTGo4GUIRegistry->GetSlotClass("TGo4BrowserSlots");
00064 membrowser->AddObject(fxData,can,pad);
00065 }
00066 else
00067 {
00068
00069 }
00070
00071 }
00072
00073 void TGo4HistogramInfoSlots::SetGUI(TGo4HistogramInfo *GUI)
00074 {
00075 fxTGo4HistogramInfo=GUI;
00076
00077 }
00078 void TGo4HistogramInfoSlots::StatusChanged(TGo4Status *status)
00079 {
00080 TGo4LockGuard Global;
00081
00082
00083 }
00084 TGo4HistogramInfoSlots::~TGo4HistogramInfoSlots()
00085 {
00086 TGo4LockGuard Global;
00087 delete fxTGo4HistogramInfoStatus;
00088
00089 }
00090
00091 TGo4Status * TGo4HistogramInfoSlots::GetStatus()
00092 {
00093 return fxTGo4HistogramInfoStatus;
00094 }
00095
00096
00097
00098
00099 void TGo4HistogramInfoSlots::SendHistogramInfoCommand()
00100 {
00101
00102 TGo4LockGuard main;
00103 const Text_t* histoname=fxTGo4HistogramInfo->GetHistogramName();
00104 TGo4ComGetObjectStatus *com = new TGo4ComGetObjectStatus(histoname);
00105 com->SetFolderName(TGo4AnalysisObjectManager::fgcHISTFOLDER);
00106 TString name=histoname;
00107 name.Append("_status");
00108 fxTGo4GUIRegistry->SubmitCommand(com,name.Data(),this);
00109
00110 }
00111
00112
00113 void TGo4HistogramInfoSlots::SendHistogramPrintCommand()
00114 {
00115 TGo4LockGuard main;
00116 fxTGo4GUIRegistry->SubmitCommand("ANPrhis");
00117 }
00118
00119 void TGo4HistogramInfoSlots::SendHistogramRequestCommand()
00120 {
00121 TGo4LockGuard main;
00122 const Text_t* histoname=fxTGo4HistogramInfo->GetHistogramName();
00123 TGo4ComGetObject *hcom = new TGo4ComGetObject(histoname);
00124 fxTGo4GUIRegistry->SubmitCommand(hcom,histoname,this);
00125 }
00126
00127