00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef TGO4ABSTRACTINTERFACE_H
00015 #define TGO4ABSTRACTINTERFACE_H
00016
00017 #include "TObject.h"
00018
00019 #include "TString.h"
00020 #include "TList.h"
00021 #include <ostream>
00022
00023 class TGo4ObjectManager;
00024 class TGo4BrowserProxy;
00025 class TGo4AnalysisProxy;
00026 class TPad;
00027 class TGo4Picture;
00028
00029 typedef void* ViewPanelHandle;
00030
00031
00075 enum EGo4ViewPanelMode { Go4_hidden = -1, Go4_minimized = 0, Go4_normal = 1, Go4_maximized = 2 };
00076
00077
00078 class TGo4AbstractInterface : public TObject {
00079 private:
00080 TGo4ObjectManager* fOM;
00081 TGo4BrowserProxy* fBrowser;
00082 TList fxCommands;
00083
00084 protected:
00086 TGo4AbstractInterface();
00087
00088 static TGo4AbstractInterface* fgInstance;
00089 static TString fInitSharedLibs;
00090
00091 void Initialize(TGo4ObjectManager* om, TGo4BrowserProxy* br);
00092
00093 virtual void ProcessEvents(Int_t timeout = -1) = 0;
00094
00095 Bool_t LoadHotStart(const char* filename);
00096 Bool_t IsHotStart();
00097 const char* NextHotStartCmd();
00098 void FreeHotStartCmds();
00099 static void ProduceLoadLibs(std::ostream& fs);
00100
00102 static const char* DefaultPicTitle();
00103
00104
00105 public:
00106
00109 static void SetInitSharedLibs(const char* libs = 0);
00110
00112 virtual ~TGo4AbstractInterface();
00113
00117 static TGo4AbstractInterface* Instance();
00118
00120 static void DeleteInstance();
00121
00123 static const char* FileExtension();
00124
00126 static Int_t DelayMillisec();
00127
00131 TGo4ObjectManager* OM() const { return fOM; }
00132
00137 TGo4BrowserProxy* Browser() const { return fBrowser; }
00138
00142 TGo4AnalysisProxy* Analysis();
00143
00148 virtual void HotStart(const char* filename) = 0;
00149
00150
00151
00153 virtual void LoadLibrary(const char* fname);
00154
00157 virtual void OpenFile(const char* fname);
00158
00163 virtual TString FindItem(const char* objname);
00164
00167 virtual Bool_t CopyItem(const char* itemname);
00168
00171 virtual Bool_t DeleteItem(const char* itemname);
00172
00180 virtual void FetchItem(const char* itemname, Int_t wait_time = 2000);
00181
00191 virtual TObject* GetObject(const char* itemname, Int_t updatelevel = 1);
00192
00202 virtual TString SaveToMemory(const char* path, TObject* obj, Bool_t ownership = kFALSE);
00203
00210 virtual Bool_t SaveToFile(const char* itemname,
00211 const char* filename,
00212 const char* filetitle = 0);
00213
00226 virtual Bool_t ExportToFile(const char* itemname,
00227 const char* dirpath,
00228 const char* format,
00229 const char* filetitle = 0);
00230
00240 virtual void ConnectHServer(const char* servername,
00241 Int_t portnumber,
00242 const char* basename,
00243 const char* userpass,
00244 const char* filter);
00245
00247 virtual void ConnectDabc(const char* servername);
00248
00252 virtual void Wait(double tm_sec) {}
00253
00255 virtual void Message(const char* msg) {}
00256
00257
00258
00261 virtual void LaunchAnalysis() {}
00262
00271 virtual void LaunchAnalysis(const char* ClientName,
00272 const char* ClientDir,
00273 const char* ClientExec,
00274 const char* ClientNode,
00275 Int_t ShellMode = 2,
00276 Int_t TermMode = 1,
00277 Int_t ExeMode = 0,
00278 const char* UserArgs = 0) {}
00279
00286 virtual void ConnectAnalysis(const char* ServerNode,
00287 Int_t ServerPort,
00288 Int_t UserMode,
00289 const char* password = 0) {}
00290
00296 virtual void WaitAnalysis(Int_t delay_sec) {}
00297
00299 virtual Bool_t IsAnalysisConnected();
00300
00303 virtual void DisconnectAnalysis() {}
00304
00308 virtual void ShutdownAnalysis() {}
00309
00314 virtual void ExecuteLine(const char* remotecmd);
00315
00317 virtual void RequestAnalysisConfig();
00318
00341 virtual void SubmitAnalysisConfig(int tmout = 20) {}
00342
00344 virtual void StartAnalysis() {}
00345
00347 virtual void StopAnalysis() {}
00348
00350 virtual void RefreshNamesList(int tmout = 10) {}
00351
00355 virtual void SetAnalysisTerminalMode(int mode) {}
00356
00360 virtual void SetAnalysisConfigMode(int mode) {}
00361
00365 virtual void MonitorItem(const char* itemname, Bool_t on = kTRUE);
00366
00370 virtual void StartMonitoring(Int_t period = 10);
00371
00373 virtual void StopMonitoring();
00374
00376 virtual void AnalysisAutoSave(const char* filename,
00377 Int_t interval,
00378 Int_t compression,
00379 Bool_t enabled,
00380 Bool_t overwrite) {}
00381
00383 virtual void AnalysisConfigName(const char* filename) {}
00384
00385
00386
00388 virtual void ConfigStep(const char* stepname,
00389 Bool_t enableprocess,
00390 Bool_t enablesource,
00391 Bool_t enablestore) {}
00392
00394 virtual void StepFileSource(const char* stepname,
00395 const char* sourcename,
00396 int timeout) {}
00397
00399 virtual void StepMbsFileSource(const char* stepname,
00400 const char* sourcename,
00401 int timeout,
00402 const char* TagFile,
00403 int start = 0,
00404 int stop = 0,
00405 int interval = 0) {}
00406
00408 virtual void StepMbsStreamSource(const char* stepname,
00409 const char* sourcename,
00410 int timeout,
00411 int start = 0,
00412 int stop = 0,
00413 int interval = 0) {}
00414
00416 virtual void StepMbsTransportSource(const char* stepname,
00417 const char* sourcename,
00418 int timeout,
00419 int start = 0,
00420 int stop = 0,
00421 int interval = 0) {}
00422
00424 virtual void StepMbsEventServerSource(const char* stepname,
00425 const char* sourcename,
00426 int timeout,
00427 int start = 0,
00428 int stop = 0,
00429 int interval = 0) {}
00430
00432 virtual void StepMbsRevServSource(const char* stepname,
00433 const char* sourcename,
00434 int timeout,
00435 int port = 0,
00436 int start = 0,
00437 int stop = 0,
00438 int interval = 0) {}
00439
00441 virtual void StepMbsSelection(const char* stepname,
00442 int start,
00443 int stop,
00444 int interval) {}
00445
00447 virtual void StepRandomSource(const char* stepname,
00448 const char* sourcename,
00449 int timeout) {}
00450
00452 virtual void StepMbsPort(const char* stepname,
00453 int port) {}
00454
00456 virtual void StepMbsRetryCnt(const char* stepname,
00457 int cnt) {}
00458
00460 virtual void StepUserSource(const char* stepname,
00461 const char* sourcename,
00462 int timeout,
00463 int port,
00464 const char* expr) {}
00465
00467 virtual void StepFileStore(const char* stepname,
00468 const char* storename,
00469 bool overwrite,
00470 int bufsize,
00471 int splitlevel,
00472 int compression) {}
00473
00475 virtual void StepBackStore(const char* stepname,
00476 const char* storename,
00477 int bufsize,
00478 int splitlevel) {}
00479
00480
00481
00483 virtual void SetMainWindowState(int qtversion, const char* val) {}
00484
00486 virtual void SetMainWindowGeometry(int qtversion, const char* val) {}
00487
00491 virtual ViewPanelHandle StartViewPanel() { return 0; }
00492
00503 virtual ViewPanelHandle StartViewPanel(int x, int y, int width, int height, int mode = 1, TGo4Picture* pic = 0) { return 0; }
00504
00506 virtual TString GetViewPanelName(ViewPanelHandle panel) { return TString(); }
00507
00509 virtual ViewPanelHandle FindViewPanel(const char* name) { return 0; }
00510
00512 virtual Bool_t SetViewPanelName(ViewPanelHandle panel, const char* newname) { return kFALSE; }
00513
00515 virtual ViewPanelHandle GetActiveViewPanel() { return 0; }
00516
00518 virtual void RedrawPanel(ViewPanelHandle panel) {}
00519
00521 virtual void DivideViewPanel(ViewPanelHandle panel, Int_t numX, Int_t numY) {}
00522
00527 virtual TPad* SelectPad(ViewPanelHandle panel, Int_t number = 0) { return 0; }
00528
00530 virtual TGo4Picture* GetPadOptions(ViewPanelHandle panel, Int_t padnumber = 0) { return 0; }
00531
00533 virtual void SetSuperimpose(ViewPanelHandle panel, Bool_t on = kTRUE) {}
00534
00540 virtual Bool_t DrawItem(const char* itemname, ViewPanelHandle panel = 0, const char* drawopt = 0) { return kFALSE; }
00541
00545 virtual void RedrawItem(const char* itemname);
00546
00549 virtual const char* GetDrawnItemName(ViewPanelHandle panel, int cnt = 0) { return 0; }
00550
00551 ClassDef(TGo4AbstractInterface, 1);
00552 };
00553
00554
00555 #endif