GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4Script.cxx
Go to the documentation of this file.
1 // $Id$
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #include "TGo4Script.h"
15 
16 #include <fstream>
17 
18 #include "TString.h"
19 #include "TROOT.h"
20 #include "TSystem.h"
21 #include "TCanvas.h"
22 #include "TStopwatch.h"
23 
24 #include "TGo4QSettings.h"
25 #include "TGo4BrowserProxy.h"
26 #include "TGo4AnalysisProxy.h"
27 #include "TGo4DirProxy.h"
28 #include "TGo4HServProxy.h"
29 #include "TGo4DabcProxy.h"
30 #include "TGo4HttpProxy.h"
31 #include "TGo4Iter.h"
32 
34 #include "TGo4ConfigStep.h"
35 #include "TGo4AnalysisWindow.h"
36 #include "TGo4MdiArea.h"
37 #include "TGo4Picture.h"
38 #include "TGo4ViewPanel.h"
39 #include "TGo4MainWindow.h"
40 
41 #include <QMdiSubWindow>
42 
43 
45 {
46  return dynamic_cast<TGo4Script*> (Instance());
47 }
48 
52  fiWaitCounter(0),
53  fStrBuf(),
54  fMainWin(mainwin),
55  fErrorFlag(kFALSE),
57 {
58  if (mainwin)
59  Initialize(mainwin->OM(), mainwin->Browser());
60 }
61 
63 {
64 }
65 
66 
67 Bool_t TGo4Script::StartScriptExecution(const char *fname)
68 {
69  if (!fname || (strlen(fname) == 0)) return kFALSE;
70 
72 
73  if (!LoadHotStart(fname)) return kFALSE;
74 
76  fiWaitCounter = getCounts(0.1);
77 
78  doOutput("Start hotstart script execution");
79 
80  return kTRUE;
81 }
82 
83 Int_t TGo4Script::getCounts(Double_t tm)
84 {
85  return int(tm*1000./DelayMillisec());
86 }
87 
88 void TGo4Script::doOutput(const char *str)
89 {
90  if (fMainWin)
91  fMainWin->StatusMessage(str);
92 }
93 
95 {
96  if (!fMainWin || !IsHotStart()) return kFALSE;
97 
98  switch (execGUICommands()) {
99  case 0:
100  return kFALSE;
101  case 1:
103  fiWaitCounter = 0;
104  break;
105  case 2:
106  fiWaitCounter--;
107  return kTRUE;
108  }
109 
110  const char *nextcmd = NextHotStartCmd();
111  if (!nextcmd) return kFALSE;
112 
113  Int_t error = 0;
114  gROOT->ProcessLineSync(nextcmd, &error);
115 
116  if (error != 0) {
117  doOutput(TString::Format("Error = %d. CMD: %s", error, nextcmd).Data());
118  return kFALSE;
119  }
120 
121  return kTRUE;
122 }
123 
125 {
127  fErrorFlag = kFALSE;
129  fiWaitCounter = 0;
130 }
131 
133 {
134  return fiWaitCounter > 0;
135 }
136 
138 {
139  // do postprocessing of command only if normal script is executed
140  if (IsHotStart()) return;
141 
142  // if error was before, nothing todo
143  if (fErrorFlag || !fMainWin) return;
144 
145  TStopwatch watch;
146 
147  Int_t loopnumbers = 0;
148  Double_t spenttime = 0;
149 
150  do {
151 
152  loopnumbers++;
153  Bool_t first = kTRUE;
154 
155  do {
156  watch.Start();
157  if (first) first = kFALSE;
158  else gSystem->Sleep(DelayMillisec());
160  watch.Stop();
161  spenttime += watch.RealTime();
162  } while (spenttime < loopnumbers*0.001*DelayMillisec());
163 
164  switch (execGUICommands()) {
165  case 0: // error
167  fiWaitCounter = 0;
168  fErrorFlag = kTRUE;
169  return;
170  case 1: // finish command
172  fiWaitCounter = 0;
173  return;
174  case 2: // next turn
175  fiWaitCounter--;
176  }
177  } while (loopnumbers < 1000000);
178 }
179 
180 void TGo4Script::ProcessEvents(Int_t timeout)
181 {
182  Wait(timeout <= 0 ? 0 : timeout*0.001);
183 }
184 
186 {
187  switch (fiWaitForGUIReaction) {
188  case 0:
189  return 1;
190 
191  case 1: { // execute launch client method
192  TGo4ServerProxy *anal = Server();
193 
194  if(anal && anal->IsAnalysisReady()) {
195  doOutput("// Disconnect old analysis first");
198  fiWaitCounter = getCounts(10.);
199  return 2;
200  }
201 
202  fMainWin->LaunchClient(false);
203 
204  doOutput("// Start analysis client");
205 
206  // wait 5 sec for analysis ready
208  fiWaitCounter = getCounts(5.);
209 
210  return 2;
211  }
212 
213  case 2: { // check if analysis is ready, can continue if not ok
214  TGo4ServerProxy *anal = Server();
215  if (anal && anal->IsAnalysisReady()) return 1;
216  return (fiWaitCounter<2) ? 1 : 2;
217  }
218 
219  case 3: { // wait while analysis is disconnected
220  TGo4ServerProxy *anal = Server();
221  if(!anal || !anal->IsAnalysisReady()) {
223  fiWaitCounter = getCounts(5.);
224  return 2;
225  }
226  return (fiWaitCounter<2) ? 0 : 2;
227  }
228 
229  case 4: { // wait time and lunch analysis again
230  if (fiWaitCounter<5)
232  return 2;
233  }
234 
235  case 5: { // check if analysis is ready, abort if not ok
236  TGo4ServerProxy *anal = Server();
237  if (!anal) return 0;
238  if (anal->IsAnalysisReady()) return 1;
239  return (fiWaitCounter<2) ? 0 : 2;
240  }
241 
242  case 10: { // wait until submitted settings are set
243  TGo4ServerProxy *anal = Server();
244  if (anal && anal->IsAnalysisSettingsReady()) {
246  // fiWaitCounter = getCounts(20.); // counter is for complete operation
247  return 2;
248  }
249  return (fiWaitCounter<2) ? 0 : 2;
250  }
251 
252  case 11: { // wait until remote browser refresh it's data
253  TGo4ServerProxy *anal = Server();
254  if (anal && anal->NamesListReceived()) return 1;
255  return (fiWaitCounter<2) ? 0 : 2;
256  }
257 
258  case 12: { // wait until analysis will be disconnected
259  TGo4ServerProxy *anal = Server();
260  if (!anal) return 1;
261  return (fiWaitCounter<2) ? 0 : 2;
262  }
263 
264  case 15: { // connect to running server
265  fMainWin->ConnectServer(false, fStrBuf.Data());
266 
267  // wait 5 sec for analysis ready,
269  fiWaitCounter = getCounts(5.);
270 
271  return 2;
272  }
273 
274  case 111: { // just wait time and take next command
275  return fiWaitCounter < 2 ? 1 : 2;
276  }
277  } //switch
278 
279  return 2;
280 }
281 
282 // ******************* Functions to be used in GUI script *************
283 
284 void TGo4Script::Wait(double tm_sec)
285 {
286  fiWaitForGUIReaction = 111;
287  fiWaitCounter = getCounts(tm_sec);
288  if (fiWaitCounter<0) fiWaitCounter = 1;
289 
291 }
292 
293 
294 void TGo4Script::Message(const char *msg)
295 {
296  if (fMainWin)
297  fMainWin->StatusMessage(msg);
298 }
299 
300 void TGo4Script::HotStart(const char *filename)
301 {
302  fMainWin->HotStart(filename);
303 }
304 
306 {
308  fiWaitCounter = getCounts(1.);
309 
311 }
312 
313 void TGo4Script::LaunchAnalysis(const char *ClientName,
314  const char *ClientDir,
315  const char *ClientExec,
316  const char *ClientNode,
317  Int_t ShellMode,
318  Int_t TermMode,
319  Int_t ExeMode,
320  const char *UserArgs)
321 {
322  go4sett->setClientName(ClientName);
323  go4sett->setClientDir(ClientDir);
324  go4sett->setClientExeMode(ExeMode);
325  go4sett->setClientExec(ClientExec);
326  go4sett->setClientArgs(UserArgs);
327  const char *separ = strrchr(ClientNode, ':');
328  if (!separ) {
329  go4sett->setClientNode(ClientNode);
331  } else {
332  TString node;
333  node.Append(ClientNode, separ - ClientNode);
334  go4sett->setClientNode(node.Data());
336  go4sett->setClientPort(TString(separ+1).Atoi());
337  }
338 
339  go4sett->setClientShellMode(ShellMode);
340  go4sett->setClientTermMode(TermMode);
341  LaunchAnalysis();
342 }
343 
344 void TGo4Script::ConnectAnalysis(const char *ServerNode,
345  Int_t ServerPort,
346  Int_t ControllerMode,
347  const char *password)
348 {
349  go4sett->setClientNode(ServerNode);
350  go4sett->setClientPort(ServerPort);
351  go4sett->setClientControllerMode(ControllerMode);
352  go4sett->setClientDefaultPass(!password || (*password == 0));
354  fStrBuf = password;
355  fiWaitCounter = getCounts(1.);
356 
358 }
359 
360 void TGo4Script::WaitAnalysis(Int_t delay_sec)
361 {
363  fiWaitCounter = getCounts(delay_sec);
364 
366 }
367 
369 {
371 
373  fiWaitCounter = getCounts(20.);
374 
376 }
377 
379 {
380  fMainWin->ShutdownAnalysis(false);
381 
383  fiWaitCounter = getCounts(20.);
384 
386 }
387 
389 {
390  if (CanConfigureAnalysis())
393  fiWaitCounter = getCounts(tmout);
394  }
395 
397 }
398 
400 {
401  if (CanConfigureAnalysis()) {
403  if (dynamic_cast<TGo4HttpProxy *>(Server()))
404  Wait(0.1);
405  else
406  Wait(1.);
407  } else {
408  fBlockConfigFlag = -1; // from this command blocking is disabled
409  }
410 }
411 
413 {
414  if (CanConfigureAnalysis()) {
416  if (dynamic_cast<TGo4HttpProxy *>(Server()))
417  Wait(0.1);
418  else
419  Wait(2.);
420  } else {
421  fBlockConfigFlag = -1; // from this command blocking is disabled
422  }
423 }
424 
426 {
427  TGo4ServerProxy *anal = Server();
428  if (anal) {
429  anal->RefreshNamesList();
431  fiWaitCounter = getCounts(tmout > 0 ? tmout : 10);
432  }
433 
435 }
436 
438 {
439  if (fBlockConfigFlag == 0) {
440  // once a session check if analysis was not launched from the GUI, we should not try to configure it
441  TGo4HttpProxy* serv = dynamic_cast<TGo4HttpProxy *>(Server());
442  if (serv && !serv->IsAnalysisLaunched()) fBlockConfigFlag = 1;
443  }
444 
445  return fBlockConfigFlag <= 0;
446 }
447 
448 
450 {
452  QWidget *gui = gui_ ? gui_->parentWidget() : nullptr;
453  if (!gui) return;
454 
455  if (mode < 0)
456  gui->hide();
457  else if (mode == 0)
458  gui->showMinimized();
459  else
460  gui->showNormal();
461 }
462 
464 {
466  QWidget *gui = gui_ ? gui_->parentWidget() : nullptr;
467  if (!gui) return;
468 
469  if (mode < 0)
470  gui->hide();
471  else if (mode == 0)
472  gui->showMinimized();
473  else
474  gui->showNormal();
475 }
476 
477 void TGo4Script::AnalysisAutoSave(const char *filename,
478  Int_t interval,
479  Int_t compression,
480  Bool_t enabled,
481  Bool_t overwrite)
482 {
484  if(gui && CanConfigureAnalysis())
485  gui->SetAutoSaveConfig(filename, interval, compression, enabled, overwrite);
486 }
487 
488 void TGo4Script::AnalysisConfigName(const char *filename)
489 {
491  if(gui && CanConfigureAnalysis())
492  gui->SetAnalysisConfigFile(filename);
493 }
494 
496 {
497  // in cannot configure analysis - do not return step gui pointer
498  if (!CanConfigureAnalysis()) return nullptr;
499 
501 
502  return !gui ? nullptr : gui->FindStepConfig(stepname);
503 }
504 
505 void TGo4Script::ConfigStep(const char *stepname,
506  Bool_t enableprocess,
507  Bool_t enablesource,
508  Bool_t enablestore)
509 {
510  TGo4ConfigStep* step = GetStepGUI(stepname);
511  if (step)
512  step->SetStepControl(enableprocess, enablesource, enablestore);
513 }
514 
515 void TGo4Script::StepFileSource(const char *stepname,
516  const char *sourcename,
517  int timeout)
518 {
519  TGo4ConfigStep* step = GetStepGUI(stepname);
520  if (step) {
521  step->SetFileSource();
522  step->SetSourceWidgets(sourcename, timeout);
523  }
524 }
525 
526 void TGo4Script::StepMbsFileSource(const char *stepname,
527  const char *sourcename,
528  int timeout,
529  const char *TagFile,
530  int start,
531  int stop,
532  int interval)
533 {
534  TGo4ConfigStep* step = GetStepGUI(stepname);
535  if (step) {
536  step->SetMbsFileSource(TagFile);
537  step->SetSourceWidgets(sourcename, timeout);
538  step->SetMbsSourceWidgets(start, stop, interval);
539  }
540 }
541 
542 void TGo4Script::StepMbsStreamSource(const char *stepname,
543  const char *sourcename,
544  int timeout,
545  int start,
546  int stop,
547  int interval)
548 {
549  TGo4ConfigStep* step = GetStepGUI(stepname);
550  if (step) {
551  step->SetMbsStreamSource();
552  step->SetSourceWidgets(sourcename, timeout);
553  step->SetMbsSourceWidgets(start, stop, interval);
554  }
555 }
556 
557 void TGo4Script::StepMbsTransportSource(const char *stepname,
558  const char *sourcename,
559  int timeout,
560  int start,
561  int stop,
562  int interval)
563 {
564  TGo4ConfigStep* step = GetStepGUI(stepname);
565  if (step) {
566  step->SetMbsTransportSource();
567  step->SetSourceWidgets(sourcename, timeout);
568  step->SetMbsSourceWidgets(start, stop, interval);
569  }
570 }
571 
572 void TGo4Script::StepMbsEventServerSource(const char *stepname,
573  const char *sourcename,
574  int timeout,
575  int start,
576  int stop,
577  int interval)
578 {
579  TGo4ConfigStep* step = GetStepGUI(stepname);
580  if (step) {
581  step->SetMbsEventServerSource();
582  step->SetSourceWidgets(sourcename, timeout);
583  step->SetMbsSourceWidgets(start, stop, interval);
584  }
585 }
586 
587 void TGo4Script::StepMbsRevServSource(const char *stepname,
588  const char *sourcename,
589  int timeout,
590  int port,
591  int start,
592  int stop,
593  int interval)
594 {
595  TGo4ConfigStep* step = GetStepGUI(stepname);
596  if (step) {
597  step->SetMbsRevServSource(port);
598  step->SetSourceWidgets(sourcename, timeout);
599  step->SetMbsSourceWidgets(start, stop, interval, port);
600  }
601 }
602 
603 void TGo4Script::StepMbsSelection(const char *stepname,
604  int start,
605  int stop,
606  int interval)
607 {
608  TGo4ConfigStep* step = GetStepGUI(stepname);
609  if (step)
610  step->SetMbsSourceWidgets(start, stop, interval);
611 }
612 
613 void TGo4Script::StepRandomSource(const char *stepname,
614  const char *sourcename,
615  int timeout)
616 {
617  TGo4ConfigStep* step = GetStepGUI(stepname);
618  if (step) {
619  step->SetRandomSource();
620  step->SetSourceWidgets(sourcename, timeout);
621  }
622 }
623 
624 void TGo4Script::StepMbsPort(const char *stepname,
625  int port)
626 {
627  TGo4ConfigStep* step = GetStepGUI(stepname);
628  if (step) step->SetMbsPort(port);
629 }
630 
631 void TGo4Script::StepMbsRetryCnt(const char *stepname,
632  int cnt)
633 {
634  TGo4ConfigStep* step = GetStepGUI(stepname);
635  if (step) step->SetMbsRetryCnt(cnt);
636 }
637 
638 void TGo4Script::StepUserSource(const char *stepname,
639  const char *sourcename,
640  int timeout,
641  int port,
642  const char *expr)
643 {
644  TGo4ConfigStep* step = GetStepGUI(stepname);
645  if (step) {
646  step->SetUserSource(port, expr);
647  step->SetSourceWidgets(sourcename, timeout);
648  }
649 }
650 
651 
652 void TGo4Script::StepHDF5Source(const char *stepname,
653  const char *sourcename,
654  int timeout)
655 {
656  TGo4ConfigStep* step = GetStepGUI(stepname);
657  if (step) {
658  step->SetHDF5Source(sourcename);
659  step->SetSourceWidgets(sourcename, timeout);
660  }
661 }
662 
663 void TGo4Script::StepFileStore(const char *stepname,
664  const char *storename,
665  bool overwrite,
666  int bufsize,
667  int splitlevel,
668  int compression,
669  int autosaveperiod)
670 {
671  TGo4ConfigStep* step = GetStepGUI(stepname);
672  if (step)
673  step->SetFileStore(storename, overwrite, bufsize, splitlevel, compression, autosaveperiod);
674 }
675 
676 void TGo4Script::StepBackStore(const char *stepname,
677  const char *storename,
678  int bufsize,
679  int splitlevel)
680 {
681  TGo4ConfigStep* step = GetStepGUI(stepname);
682  if (step)
683  step->SetBackStore(storename, bufsize, splitlevel);
684 }
685 
686 void TGo4Script::StepUserStore(const char *stepname,
687  const char *storename)
688 {
689  TGo4ConfigStep* step = GetStepGUI(stepname);
690  if (step)
691  step->SetUserStore(storename);
692 }
693 
694 void TGo4Script::StepHDF5Store(const char *stepname,
695  const char *storename,
696  int flags)
697 {
698  TGo4ConfigStep* step = GetStepGUI(stepname);
699  if (step)
700  step->SetHDF5Store(storename, flags);
701 }
702 
703 void TGo4Script::SetMainWindowState(int qtversion, const char *val)
704 {
705  if (qtversion==4)
706  fMainWin->restoreState(QByteArray::fromHex(val));
707 }
708 
709 void TGo4Script::SetMainWindowGeometry(int qtversion, const char *val)
710 {
711  if (qtversion==4)
712  fMainWin->restoreGeometry(QByteArray::fromHex(val));
713 }
714 
716 {
717  return fMainWin->MakeNewPanel(1);
718 }
719 
720 ViewPanelHandle TGo4Script::StartViewPanel(int x, int y, int width, int height, int mode, TGo4Picture *pic)
721 {
722  TGo4ViewPanel *panel = fMainWin->MakeNewPanel(1);
723  if (!panel) return (ViewPanelHandle) nullptr;
724 
725  if (mode == 0)
726  panel->showMinimized();
727  else if (mode == 2)
728  panel->showMaximized();
729  else {
730  panel->showNormal();
731  panel->parentWidget()->move(QPoint(x, y));
732  panel->parentWidget()->resize(QSize(width, height));
733  }
734 
735  if (pic) {
736  panel->ProcessPictureRedraw("", panel->GetCanvas(), pic);
737  if (TString(DefaultPicTitle()) != pic->GetTitle())
738  panel->SetFreezedTitle(pic->GetTitle());
739 
740  panel->ShootRepaintTimer();
741  }
742 
743  return (ViewPanelHandle) panel;
744 }
745 
747 {
748  TGo4ViewPanel *panel = (TGo4ViewPanel *) handle;
749  if (!panel) return TString();
750  return TString(panel->objectName().toLatin1().constData());
751 }
752 
754 {
755  return (ViewPanelHandle) fMainWin->FindViewPanel(name);
756 }
757 
758 Bool_t TGo4Script::SetViewPanelName(ViewPanelHandle handle, const char *newname)
759 {
760  TGo4ViewPanel *panel = (TGo4ViewPanel *) handle;
761  if (!handle || !newname || (strlen(newname) == 0)) return kFALSE;
762 
763  if (fMainWin->FindViewPanel(newname)) {
764  Message(TString::Format("Viewpanel with name %s already exists",newname).Data());
765  return kFALSE;
766  }
767 
768  panel->SetPanelName(newname);
769 
770  panel->UpdatePanelCaption();
771 
772  return kTRUE;
773 }
774 
776 {
778 }
779 
781 {
782  TGo4ViewPanel *panel = (TGo4ViewPanel *) handle;
783  if (panel) panel->RedrawPanel(panel->GetCanvas(), true);
784 }
785 
786 void TGo4Script::DivideViewPanel(ViewPanelHandle handle, Int_t numX, Int_t numY)
787 {
788  TGo4ViewPanel *panel = (TGo4ViewPanel *) handle;
789  if (panel) panel->Divide(numX, numY);
790 }
791 
792 TPad *TGo4Script::SelectPad(ViewPanelHandle handle, Int_t number)
793 {
794  TGo4ViewPanel *panel = (TGo4ViewPanel *) handle;
795  if (panel) {
796  TPad *pad = panel->GetSubPad(nullptr, number, false);
797  if (!pad) pad = panel->GetCanvas();
798  panel->SetActivePad(pad);
799  ProcessEvents();
800  return pad;
801  }
802  return nullptr;
803 }
804 
806 {
807  TGo4ViewPanel *panel = (TGo4ViewPanel *) handle;
808  if (!panel) return nullptr;
809 
810  TPad *pad = panel->GetSubPad(nullptr, padnumber, false);
811  if (!pad) pad = panel->GetCanvas();
812  return panel->GetPadOptions(pad);
813 }
814 
816 {
817  TGo4ViewPanel *panel = (TGo4ViewPanel *) handle;
818  if (panel) panel->SetPadSuperImpose(panel->GetActivePad(), on);
819 }
820 
822 {
823  TGo4ViewPanel *panel = (TGo4ViewPanel *) handle;
824  if (panel) panel->SetApplyToAllFlag(on);
825 }
826 
827 Bool_t TGo4Script::DrawItem(const char *itemname, ViewPanelHandle handle, const char *drawopt)
828 {
829  TGo4ViewPanel *panel = (TGo4ViewPanel *)handle;
830 
831  panel = fMainWin->DisplayBrowserItem(itemname, panel, nullptr, true, -1, drawopt);
832 
833  if (panel) ProcessEvents();
834 
835  return panel != nullptr;
836 }
837 
838 const char *TGo4Script::GetDrawnItemName(ViewPanelHandle handle, int cnt)
839 {
840  TGo4ViewPanel *panel = (TGo4ViewPanel *) handle;
841 
842  return panel ? panel->GetDrawItemName(cnt) : nullptr;
843 }
844 
846 {
848 }
849 
850 TGo4ServerProxy *TGo4Script::ConnectHttp(const char *servername, const char *account, const char *pass)
851 {
852  if (!servername || (*servername == 0)) return nullptr;
853 
854  TGo4HttpProxy *proxy = new TGo4HttpProxy();
855  if(account) proxy->SetAccount(account, pass);
856  if (!proxy->Connect(servername)) {
857  delete proxy;
858  return nullptr;
859  }
860 
861  const char *slotname = servername;
862  if (strncmp(slotname,"http://",7) == 0) slotname+=7; else
863  if (strncmp(slotname,"https://",8) == 0) slotname+=8;
864  TString sname(slotname);
865  Int_t len = sname.Index("/");
866  if ((len>1) && (len<sname.Length())) sname.Resize(len);
867 
868  Browser()->AddServerProxy(proxy, sname.Data(), "ROOT http server");
869 
870  return proxy;
871 }
872 
873 
874 // ***************************** Generation *********************
875 
876 
877 void TGo4Script::ProduceScript(const char *filename, TGo4MainWindow* main)
878 {
880 
881  TGo4AnalysisWindow *termgui = main->FindAnalysisWindow();
882 
883  TGo4BrowserProxy *br = main->Browser();
884 
885  TGo4AnalysisProxy *anal = br->FindAnalysis();
886 
887  // this is either HTTP or normal http proxy
888  TGo4ServerProxy *serv = br->FindServer();
889 
890  // ignore server which is was not launched
891  if (serv && (serv != anal) && (serv->IsAnalysisLaunched() <= 0))
892  serv = nullptr;
893 
894  std::ofstream fs(filename);
895  if (!fs.is_open()) return;
896 
897  fs << "// Automatically generated startup script" << std::endl;
898  fs << "// Do not change it!" << std::endl << std::endl;
899 
900  fs << "go4->SetMainWindowState(4, \"" << main->saveState().toHex().data() << "\");" << std::endl;
901 
902  fs << "go4->SetMainWindowGeometry(4, \"" << main->saveGeometry().toHex().data() << "\");" << std::endl;
903 
904  ProduceLoadLibs(fs);
905 
906  TObjArray prlist;
907  br->MakeFilesList(&prlist);
908  for (Int_t n = 0; n <= prlist.GetLast(); n++) {
909  TGo4DirProxy *pr = (TGo4DirProxy *)prlist.At(n);
910  fs << "go4->OpenFile(\"" << pr->GetFileName() << "\");" << std::endl;
911  }
912 
913  prlist.Clear();
914  br->MakeHServerList(&prlist);
915  for (Int_t n = 0; n <= prlist.GetLast(); n++) {
916  TGo4HServProxy *pr = (TGo4HServProxy *)prlist.At(n);
917  fs << "go4->ConnectHServer(\""
918  << pr->GetServerName() << "\", "
919  << pr->GetPortNumber() << ", \""
920  << pr->GetBaseName() << "\", \""
921  << pr->GetUserPass() << "\", \""
922  << pr->GetFilter() << "\");" << std::endl;
923  }
924 
925  prlist.Clear();
926  br->MakeDabcList(&prlist);
927  for (Int_t n = 0; n <= prlist.GetLast(); n++) {
928  TGo4DabcProxy *pr = (TGo4DabcProxy *)prlist.At(n);
929  fs << "go4->ConnectDabc(\"" << pr->GetServerName() << "\");" << std::endl;
930  }
931 
932  fs << std::endl;
933 
934  bool isanalysis = anal && anal->IsAnalysisReady() && !anal->IsAnalysisServer();
935  if (!isanalysis && serv && (serv != anal)) isanalysis = true;
936 
937  // start analysis configuration
938  if (isanalysis) {
939  fs << "go4->LaunchAnalysis(\"" << go4sett->getClientName().toLatin1().constData() << "\", \""
940  << go4sett->getClientDir().toLatin1().constData() << "\", \""
941  << go4sett->getClientExec().toLatin1().constData() << "\", \""
942  << go4sett->getClientNode().toLatin1().constData();
943 
944  if (go4sett->getClientIsServer() == 2) {
945  // add port number for http server
946  fs << ":";
947  fs << go4sett->getClientPort();
948  }
949 
950  fs << "\", ";
951 
952  if (go4sett->getClientShellMode() == Go4_rsh) fs << "Go4_rsh, "; else
953  if (go4sett->getClientShellMode() == Go4_ssh) fs << "Go4_ssh, "; else fs << "Go4_sh, ";
954 
955  if (go4sett->getClientTermMode() == Go4_xterm) fs << "Go4_xtrem, "; else
956  if (go4sett->getClientTermMode() == Go4_konsole) fs << "Go4_konsole, "; else fs << "Go4_qt, ";
957 
958  if (go4sett->getClientExeMode() == Go4_lib) fs << "Go4_lib"; else fs << "Go4_exe";
959 
960 // << go4sett->getClientShellMode() << ", "
961 // << go4sett->getClientTermMode() << ", "
962 // << go4sett->getClientExeMode();
963  if (go4sett->getClientArgs().length()>0)
964  fs << ", \"" << go4sett->getClientArgs().toLatin1().constData() << "\"";
965  fs << ");" << std::endl;
966 
967  fs << "go4->WaitAnalysis(300);" << std::endl << std::endl;
968 
969  if (!confgui) return;
970  fs << "// configuration of analysis" << std::endl;
971 
972  QString fname;
973  int interval, compression;
974  bool asenabled, asoverwrite;
975 
976  confgui->GetAutoSaveConfig(fname, interval, compression, asenabled, asoverwrite);
977  fs << "go4->AnalysisAutoSave(\"" << fname.toLatin1().constData() << "\", "
978  << interval << ", "
979  << compression << ", "
980  << (asenabled ? "kTRUE" : "kFALSE") << ", "
981  << (asoverwrite ? "kTRUE" : "kFALSE") << ");" << std::endl;
982 
983  confgui->GetAnalysisConfigFile(fname);
984  fs << "go4->AnalysisConfigName(\"" << fname.toLatin1().constData() << "\");" << std::endl << std::endl;
985 
986  for (int nstep = 0; nstep < confgui->GetNumSteps(); nstep++) {
987  TGo4ConfigStep *stepconf = confgui->GetStepConfig(nstep);
988  fs << "// step " << stepconf->GetStepName().toLatin1().constData() << std::endl;
989 
990  bool process, source, store;
991  stepconf->GetStepControl(process, source, store);
992  fs << "go4->ConfigStep(\"" << stepconf->GetStepName().toLatin1().constData() << "\", "
993  << (process ? "kTRUE" : "kFALSE") << ", "
994  << (source ? "kTRUE" : "kFALSE") << ", "
995  << (store ? "kTRUE" : "kFALSE") << ");" << std::endl;
996 
997  QString srcname;
998  int timeout = 0, start = 0, stop = 0, interval = 0, nport = 0, nretry = 0;
999  int nsrc = stepconf->GetSourceSetup(srcname, timeout, start, stop, interval, nport, nretry);
1000 
1001  TString srcargs;
1002  srcargs.Form("(\"%s\", \"%s\", %d", stepconf->GetStepName().toLatin1().constData(), srcname.toLatin1().constData(), timeout);
1003 
1004  switch(nsrc) {
1005  case 0:
1006  fs << "go4->StepFileSource" << srcargs;
1007  break;
1008  case 1: {
1009  QString TagFile;
1010  stepconf->GetMbsFileSource(TagFile);
1011  fs << "go4->StepMbsFileSource" << srcargs << ", \""
1012  << TagFile.toLatin1().constData() << "\"";
1013  break;
1014  }
1015  case 2:
1016  fs << "go4->StepMbsStreamSource" << srcargs;
1017  break;
1018  case 3:
1019  fs << "go4->StepMbsTransportSource" << srcargs;
1020  break;
1021  case 4:
1022  fs << "go4->StepMbsEventServerSource" << srcargs;
1023  break;
1024  case 5:
1025  fs << "go4->StepMbsRevServSource" << srcargs;
1026  break;
1027  case 6:
1028  fs << "go4->StepRandomSource" << srcargs;
1029  break;
1030  case 7: {
1031  int port;
1032  QString expr;
1033  stepconf->GetUserSource(port, expr);
1034  fs << "go4->StepUserSource" << srcargs << ", " << port << ", \""
1035  << expr.toLatin1().constData() << "\"";
1036  break;
1037  }
1038  case 8:
1039  fs << "go4->StepHDF5Source" << srcargs;
1040  break;
1041 
1042 
1043  } // switch(nsrc)
1044  fs << ");" << std::endl;
1045 
1046  if ((start != 0) || (stop != 0) || (interval > 1)) {
1047  srcargs.Form("(\"%s\", %d, %d ,%d)",stepconf->GetStepName().toLatin1().constData(), start, stop, interval);
1048  fs << "go4->StepMbsSelection" << srcargs << ";" << std::endl;
1049  }
1050 
1051  if (nport>0) {
1052  srcargs.Form("(\"%s\", %d)",stepconf->GetStepName().toLatin1().constData(), nport);
1053  fs << "go4->StepMbsPort" << srcargs << ";" << std::endl;
1054  }
1055 
1056  if (nretry>0) {
1057  srcargs.Form("(\"%s\", %d)",stepconf->GetStepName().toLatin1().constData(), nretry);
1058  fs << "go4->StepMbsRetryCnt" << srcargs << ";" << std::endl;
1059  }
1060 
1061  QString storename;
1062  int nstore = stepconf->GetStoreSetup(storename);
1063  switch(nstore) {
1064  case 0: {
1065  bool overwrite;
1066  int bufsize, splitlevel, compression, autosave;
1067  stepconf->GetFileStore(overwrite, bufsize, splitlevel, compression, autosave);
1068  fs << "go4->StepFileStore(\"" << stepconf->GetStepName().toLatin1().constData() << "\", \""
1069  << storename.toLatin1().constData() << "\", "
1070  << (overwrite ? "kTRUE" : "kFALSE") << ", "
1071  << bufsize << ", "
1072  << splitlevel << ", "
1073  << compression << ", "
1074  << autosave << ");" << std::endl;
1075  break;
1076  }
1077 
1078  case 1: {
1079  int bufsize, splitlevel;
1080  stepconf->GetBackStore(bufsize, splitlevel);
1081  fs << "go4->StepBackStore(\"" << stepconf->GetStepName().toLatin1().constData() << "\", \""
1082  << storename.toLatin1().constData() << "\", "
1083  << bufsize << ", "
1084  << splitlevel << ");" << std::endl;
1085  break;
1086  }
1087 
1088  case 2: {
1089  fs << "go4->StepUserStore(\"" << stepconf->GetStepName().toLatin1().constData() << "\", \""
1090  << storename.toLatin1().constData() << "\");" << std::endl;
1091  break;
1092  }
1093 
1094  case 3: {
1095  int flags = 0;
1096  stepconf->GetHDF5Store(flags);
1097  fs << "go4->StepHDF5Store(\"" << stepconf->GetStepName().toLatin1().constData() << "\", \""
1098  << storename.toLatin1().constData() << "\", "
1099  << flags << ");" << std::endl;
1100  break;
1101  }
1102 
1103  } // switch
1104 
1105  fs << std::endl;
1106  }
1107 
1108  if ((anal && anal->IsAnalysisSettingsReady()) || (serv && (serv != anal)))
1109  fs << "go4->SubmitAnalysisConfig(20);" << std::endl << std::endl;
1110 
1111  int mode = 1;
1112  QWidget *mdi = confgui ? confgui->parentWidget() : nullptr;
1113  if (mdi) {
1114  if (mdi->isHidden()) mode = -1; else
1115  if (mdi->isMinimized()) mode = 0;
1116  }
1117  fs << "go4->SetAnalysisConfigMode(" << mode << ");" << std::endl;
1118 
1119  mode = 1;
1120  mdi = termgui ? termgui->parentWidget() : nullptr;
1121  if (mdi) {
1122  if (mdi->isHidden()) mode = -1; else
1123  if (mdi->isMinimized()) mode = 0;
1124  }
1125  fs << "go4->SetAnalysisTerminalMode(" << mode << ");" << std::endl << std::endl;
1126 // end analysis configuration
1127  } else
1128  if (anal && anal->IsAnalysisReady() && anal->IsAnalysisServer()) {
1129  fs << "go4->ConnectAnalysis(\""
1130  << go4sett->getClientNode().toLatin1().constData() << "\", "
1131  << go4sett->getClientPort() << ", "
1132  << go4sett->getClientControllerMode() << ", ";
1134  fs << "0);" << std::endl;
1135  else
1136  fs << "\"" << main->LastTypedPassword() << "\");" << std::endl;
1137  fs << "go4->WaitAnalysis(10);" << std::endl << std::endl;
1138  } else {
1139  fs << "go4->DisconnectAnalysis();" << std::endl;
1140  }
1141 
1142  // connect to other http server after main analysis configuration - otherwise they could replace it in control elements
1143  prlist.Clear();
1144  br->MakeHttpList(&prlist);
1145  for (Int_t n = 0; n <= prlist.GetLast(); n++) {
1146  TGo4HttpProxy *pr = (TGo4HttpProxy *)prlist.At(n);
1147  if (pr == serv) continue;
1148  fs << "go4->ConnectHttp(\"" << pr->GetServerName() << "\");" << std::endl;
1149  }
1150 
1151  if ((anal && anal->IsAnalysisRunning() && !anal->IsAnalysisServer()) ||
1152  (serv && (serv!=anal) && serv->IsAnalysisRunning())) {
1153  fs << "go4->StartAnalysis();" << std::endl;
1154  fs << std::endl;
1155  fs << "// in some analysis one requires to wait several seconds before new histograms appears" << std::endl;
1156  fs << "// go4->Wait(1);" << std::endl;
1157  fs << "go4->RefreshNamesList();" << std::endl;
1158  } else
1159  if (anal || serv) {
1160  fs << std::endl;
1161  fs << "go4->RefreshNamesList();" << std::endl;
1162  }
1163 
1164  int npanel = 0;
1165 
1166  QList<QMdiSubWindow *> windows = TGo4MdiArea::Instance()->subWindowList();
1167  for (int i = 0; i < windows.count(); ++i) {
1168  TGo4ViewPanel *panel = dynamic_cast<TGo4ViewPanel *>(windows.at(i)->widget());
1169  if (!panel) continue;
1170 
1171  TString picname = TString::Format("pic%d", ++npanel);
1172  TGo4Picture pic(picname.Data(), DefaultPicTitle());
1173 
1174  panel->MakePictureForPad(&pic, panel->GetCanvas(), true);
1175 
1176  fs << std::endl;
1177 
1178  pic.SavePrimitive(fs,"");
1179 
1180  QWidget *mdi = panel->parentWidget();
1181 
1182  QPoint pos = mdi->pos();
1183  mdi->mapToParent(pos);
1184  QSize size = mdi->size();
1185 
1186  const char *mode = "Go4_normal";
1187  if (mdi->isHidden()) mode = "Go4_hidden"; else
1188  if (mdi->isMinimized()) mode = "Go4_minimized"; else
1189  if (mdi->isMaximized()) mode = "Go4_maximized";
1190 
1191  fs << "go4->StartViewPanel("
1192  << pos.x() << ", "
1193  << pos.y() << ", "
1194  << size.width() << ", "
1195  << size.height() << ", "
1196  << mode << ", " << picname << ");" << std::endl;
1197 
1198  fs << "delete " << picname << ";" << std::endl;
1199  }
1200 
1201  fs << std::endl;
1202 
1203  TGo4Iter iter(br->BrowserTopSlot(), kFALSE);
1204  Bool_t goinside = kTRUE;
1205 
1206  while (iter.next(goinside)) {
1207  TGo4Slot *subslot = iter.getslot();
1208  goinside = kTRUE;
1209 
1210  if (br->ItemKind(subslot)==TGo4Access::kndFolder) {
1211  // check if any subitem not monitored
1212  Int_t ncheck = 0, ncount = 0;
1213  TGo4Iter subiter(subslot, kTRUE);
1214  while (subiter.next()) {
1215  TGo4Slot *subsubslot = subiter.getslot();
1216  if (br->ItemKind(subsubslot)!=TGo4Access::kndObject) continue;
1217  ncount++;
1218  if (!br->IsItemMonitored(subsubslot)) ncheck++;
1219  else break;
1220  }
1221  goinside = (ncount == 0) || (ncheck != ncount);
1222  } else
1223  goinside = br->IsItemMonitored(subslot);
1224 
1225  if (!goinside) {
1226  TString sbuf;
1227  if (br->BrowserItemName(subslot, sbuf))
1228  fs << "go4->MonitorItem(\"" << sbuf << "\", kFALSE);" << std::endl;
1229  }
1230 
1231  }
1232 
1233  Int_t mperiod = br->MonitoringPeriod();
1234  if (mperiod > 0)
1235  fs << "go4->StartMonitoring(" << mperiod/1000 << ");" << std::endl;
1236 }
const char * GetUserPass() const
void setClientControllerMode(int)
Int_t fiWaitForGUIReaction
Definition: TGo4Script.h:221
virtual void ShootRepaintTimer()
void Wait(double tm_sec) override
Definition: TGo4Script.cxx:284
QString getClientDir()
void ConfigStep(const char *stepname, Bool_t enableprocess, Bool_t enablesource, Bool_t enablestore) override
Definition: TGo4Script.cxx:505
void StepMbsFileSource(const char *stepname, const char *sourcename, int timeout, const char *TagFile, int start=0, int stop=0, int interval=0) override
Definition: TGo4Script.cxx:526
void SetMainWindowGeometry(int qtversion, const char *val) override
Definition: TGo4Script.cxx:709
Bool_t ContinueExecution()
Definition: TGo4Script.cxx:94
void HotStart(const char *fname)
void StepRandomSource(const char *stepname, const char *sourcename, int timeout) override
Definition: TGo4Script.cxx:613
int getClientShellMode()
void setClientExeMode(int mode)
void DisconnectAnalysis() override
Definition: TGo4Script.cxx:368
Int_t getCounts(Double_t time)
Definition: TGo4Script.cxx:83
void StatusMessage(const QString &mess)
Bool_t LoadHotStart(const char *filename)
void MakeHttpList(TObjArray *arr)
virtual void SetMbsStreamSource()
virtual void SetUserSource(int port, QString expr)
void setClientArgs(const QString &)
virtual void GetAnalysisConfigFile(QString &filename)
virtual void MakePictureForPad(TGo4Picture *pic, TPad *pad, bool useitemname)
Int_t execGUICommands()
Definition: TGo4Script.cxx:185
virtual void SetActivePad(TPad *pad)
TString fStrBuf
Definition: TGo4Script.h:223
Int_t MonitoringPeriod() const
void setClientDir(const QString &)
void ConnectServer(bool interactive=true, const char *password="")
Int_t GetPortNumber() const
Bool_t IsItemMonitored(TGo4Slot *slot) const
Int_t ItemKind(const char *name)
void StartFitPanel() override
Definition: TGo4Script.cxx:845
QString getClientName()
virtual void SetBackStore(QString name, int bufsize, int splitlevel)
virtual void GetHDF5Store(int &flags)
virtual void SetMbsRetryCnt(int retry)
virtual void SetHDF5Store(QString name, int flags)
virtual void SetAutoSaveConfig(QString filename, int interval, int compression, bool enbaled, bool overwrite)
static TGo4MdiArea * Instance()
Definition: TGo4MdiArea.cpp:26
TGo4ConfigStep * GetStepConfig(int n)
void doOutput(const char *str)
Definition: TGo4Script.cxx:88
void Initialize(TGo4ObjectManager *om, TGo4BrowserProxy *br)
list of shared libraries when application is started
void ConnectAnalysis(const char *ServerNode, Int_t ServerPort, Int_t ControllerMode, const char *password=nullptr) override
Definition: TGo4Script.cxx:344
void LaunchClient(bool interactive=true)
void ProcessEvents(Int_t timeout=-1) override
Definition: TGo4Script.cxx:180
void MakeHServerList(TObjArray *arr)
TGo4MainWindow * fMainWin
Definition: TGo4Script.h:224
TGo4AnalysisProxy * FindAnalysis(const char *itemname=nullptr)
void SetMainWindowState(int qtversion, const char *val) override
Definition: TGo4Script.cxx:703
virtual void SetMbsRevServSource(int port)
void StepBackStore(const char *stepname, const char *storename, int bufsize, int splitlevel) override
Definition: TGo4Script.cxx:676
Int_t fBlockConfigFlag
Definition: TGo4Script.h:226
QString getClientExec(int mode=-1)
bool SubmitAnalysisSettings()
virtual Bool_t RefreshNamesList()
void setClientName(const QString &)
virtual const char * GetDrawItemName(int itemcnt=0)
virtual void RedrawPanel(TPad *pad, bool force)
const char * GetFileName() const
void StepMbsRetryCnt(const char *stepname, int cnt) override
Definition: TGo4Script.cxx:631
virtual void GetFileStore(bool &overwrite, int &bufsize, int &splitlevel, int &compression, int &autosaveinterval)
void setClientTermMode(int)
TString GetViewPanelName(ViewPanelHandle panel) override
Definition: TGo4Script.cxx:746
virtual void Divide(int numX, int numY)
void SubmitAnalysisConfig(int tmout=20) override
Definition: TGo4Script.cxx:388
TGo4Slot * getslot() const
Definition: TGo4Iter.cxx:166
int main(int argc, char **argv)
Bool_t Connect(const char *nodename)
const char * GetServerName() const override
Definition: TGo4DabcProxy.h:36
int getClientControllerMode()
void setClientShellMode(int)
static TGo4Script * ScriptInstance()
Definition: TGo4Script.cxx:44
void FinishExecution()
Definition: TGo4Script.cxx:124
TGo4FitPanel * StartFitPanel()
virtual const char * GetServerName() const
virtual void UpdatePanelCaption()
void StepHDF5Store(const char *stepname, const char *storename, int flags) override
Definition: TGo4Script.cxx:694
void SetAnalysisTerminalMode(int mode) override
Definition: TGo4Script.cxx:449
TGo4BrowserProxy * Browser()
void StepFileStore(const char *stepname, const char *storename, bool overwrite, int bufsize, int splitlevel, int compression, int autosaveperiod=10000) override
Definition: TGo4Script.cxx:663
virtual void GetMbsFileSource(QString &TagFile)
virtual TPad * GetSubPad(TPad *toppad, int num, bool onlytoplevel)
TGo4Script(TGo4MainWindow *mainwin)
Definition: TGo4Script.cxx:49
void WaitAnalysis(Int_t delay_sec) override
Definition: TGo4Script.cxx:360
virtual void SetApplyToAllFlag(bool on)
virtual void SetHDF5Source(QString name)
void StepMbsTransportSource(const char *stepname, const char *sourcename, int timeout, int start=0, int stop=0, int interval=0) override
Definition: TGo4Script.cxx:557
TPad * SelectPad(ViewPanelHandle panel, Int_t number=0) override
Definition: TGo4Script.cxx:792
Bool_t SetViewPanelName(ViewPanelHandle panel, const char *newname) override
Definition: TGo4Script.cxx:758
virtual int GetStoreSetup(QString &name)
void setClientPort(int)
void setClientIsServer(int kind)
TGo4BrowserProxy * Browser() const
Bool_t DrawItem(const char *itemname, ViewPanelHandle panel=nullptr, const char *drawopt=nullptr) override
Definition: TGo4Script.cxx:827
virtual void GetStepControl(bool &process, bool &source, bool &store)
virtual void GetAutoSaveConfig(QString &filename, int &interval, int &compression, bool &enbaled, bool &overwrite)
void HotStart(const char *filename) override
Definition: TGo4Script.cxx:300
virtual void SetMbsFileSource(const QString &TagFile)
static const char * DefaultPicTitle()
virtual void SetRandomSource()
void AnalysisAutoSave(const char *filename, Int_t interval, Int_t compression, Bool_t enabled, Bool_t overwrite) override
Definition: TGo4Script.cxx:477
QString getClientArgs()
void SetAnalysisConfigMode(int mode) override
Definition: TGo4Script.cxx:463
void SetAccount(const char *username, const char *passwd)
void MakeFilesList(TObjArray *arr)
void MakeDabcList(TObjArray *arr)
virtual void SetFileSource()
virtual QString GetStepName()
Bool_t IsAnalysisReady() const
void StepMbsRevServSource(const char *stepname, const char *sourcename, int timeout, int port=0, int start=0, int stop=0, int interval=0) override
Definition: TGo4Script.cxx:587
ViewPanelHandle GetActiveViewPanel() override
Definition: TGo4Script.cxx:775
virtual void SetFileStore(QString name, bool overwrite, int bufsize, int splitlevel, int compression, int autosave=0)
Bool_t IsAnalysisSettingsReady() const
TGo4QSettings * go4sett
TGo4ViewPanel * GetActivePanel()
Definition: TGo4MdiArea.cpp:60
virtual void SetStepControl(bool process, bool source, bool store)
const char * GetFilter() const
void SetSuperimpose(ViewPanelHandle panel, Bool_t on=kTRUE) override
Definition: TGo4Script.cxx:815
virtual void SetSourceWidgets(const QString &name, int timeout)
virtual void GetBackStore(int &bufsize, int &splitlevel)
void StepFileSource(const char *stepname, const char *sourcename, int timeout) override
Definition: TGo4Script.cxx:515
void LaunchAnalysis() override
Definition: TGo4Script.cxx:305
void RedrawPanel(ViewPanelHandle handle) override
Definition: TGo4Script.cxx:780
static void ProduceScript(const char *filename, TGo4MainWindow *main)
Definition: TGo4Script.cxx:877
virtual TGo4Picture * GetPadOptions(TPad *pad)
virtual void SetMbsTransportSource()
virtual void SetMbsSourceWidgets(int start, int stop, int interval, int port=0)
TGo4ViewPanel * FindViewPanel(const char *name)
void StepUserStore(const char *stepname, const char *storename) override
Definition: TGo4Script.cxx:686
const char * GetBaseName() const
const char * GetDrawnItemName(ViewPanelHandle panel, int cnt=0) override
Definition: TGo4Script.cxx:838
virtual void GetUserSource(int &port, QString &expr)
void StartAnalysis() override
Definition: TGo4Script.cxx:399
void StepUserSource(const char *stepname, const char *sourcename, int timeout, int port, const char *expr) override
Definition: TGo4Script.cxx:638
void ShutdownAnalysis() override
Definition: TGo4Script.cxx:378
void AnalysisConfigName(const char *filename) override
Definition: TGo4Script.cxx:488
void DoPostProcessing()
Definition: TGo4Script.cxx:137
const char * LastTypedPassword() const
Bool_t IsAnalysisServer() const override
TGo4ObjectManager * OM()
void setClientExec(const QString &)
void StepMbsSelection(const char *stepname, int start, int stop, int interval) override
Definition: TGo4Script.cxx:603
static void ProduceLoadLibs(std::ostream &fs)
Bool_t StartScriptExecution(const char *fname)
Definition: TGo4Script.cxx:67
const char * GetServerName() const override
TGo4Slot * BrowserTopSlot()
virtual void SetPadSuperImpose(TPad *pad, bool on)
void AddServerProxy(TGo4ServerProxy *serv, const char *slotname, const char *info)
void SetApplyToAll(ViewPanelHandle panel, Bool_t on=kTRUE) override
Definition: TGo4Script.cxx:821
void StepMbsEventServerSource(const char *stepname, const char *sourcename, int timeout, int start=0, int stop=0, int interval=0) override
Definition: TGo4Script.cxx:572
TGo4Picture * GetPadOptions(ViewPanelHandle panel, Int_t padnumber=0) override
Definition: TGo4Script.cxx:805
TGo4ConfigStep * FindStepConfig(QString name)
bool getClientDefaultPass()
void * ViewPanelHandle
void setClientNode(const QString &)
void ShutdownAnalysis(bool interactive=true)
void StepHDF5Source(const char *stepname, const char *sourcename, int timeout) override
Definition: TGo4Script.cxx:652
Bool_t fErrorFlag
Definition: TGo4Script.h:225
void StepMbsPort(const char *stepname, int port) override
Definition: TGo4Script.cxx:624
virtual int GetSourceSetup(QString &name, int &timeout, int &start, int &stop, int &interval, int &port, int &nretry)
virtual Bool_t IsAnalysisRunning() const
void StopAnalysis() override
Definition: TGo4Script.cxx:412
TGo4ViewPanel * DisplayBrowserItem(const char *itemname, TGo4ViewPanel *panel, TPad *pad, bool activate, int updatelevel, const char *drawopt)
Bool_t IsAnalysisRunning() const override
static TGo4AbstractInterface * Instance()
TGo4AnalysisConfiguration * FindAnalysisConfiguration()
virtual void SetPanelName(const char *newname)
virtual ~TGo4Script()
Definition: TGo4Script.cxx:62
Int_t IsAnalysisLaunched() const
TGo4ConfigStep * GetStepGUI(const char *stepname)
Definition: TGo4Script.cxx:495
virtual void SetAnalysisConfigFile(QString filename)
TGo4ViewPanel * MakeNewPanel(int div=0)
Bool_t CanConfigureAnalysis()
Definition: TGo4Script.cxx:437
void Message(const char *msg) override
Definition: TGo4Script.cxx:294
void DisconnectAnalysis(bool interactive=true)
TGo4AnalysisWindow * FindAnalysisWindow()
virtual TPad * GetActivePad()
ViewPanelHandle StartViewPanel() override
Definition: TGo4Script.cxx:715
void StepMbsStreamSource(const char *stepname, const char *sourcename, int timeout, int start=0, int stop=0, int interval=0) override
Definition: TGo4Script.cxx:542
virtual void SetUserStore(QString name)
virtual void ProcessPictureRedraw(const char *picitemname, TPad *pad, TGo4Picture *pic)
ViewPanelHandle FindViewPanel(const char *name) override
Definition: TGo4Script.cxx:753
virtual void SetMbsEventServerSource()
virtual TCanvas * GetCanvas()
TGo4ServerProxy * FindServer(const char *itemname=nullptr, Bool_t asanalysis=kTRUE)
void setClientDefaultPass(bool)
virtual void SetMbsPort(int port)
TGo4ServerProxy * ConnectHttp(const char *servername, const char *account=nullptr, const char *pass=nullptr) override
Definition: TGo4Script.cxx:850
Bool_t BrowserItemName(TGo4Slot *itemslot, TString &res)
void RefreshNamesList(int tmout=10) override
Definition: TGo4Script.cxx:425
Int_t fiWaitCounter
Definition: TGo4Script.h:222
QString getClientNode()
virtual void SetFreezedTitle(const QString &title)
virtual Bool_t NamesListReceived() const
Bool_t IsWaitSomething() const
Definition: TGo4Script.cxx:132
Bool_t next(Bool_t goesinto=kTRUE)
Definition: TGo4Iter.cxx:44
void DivideViewPanel(ViewPanelHandle panel, Int_t numX, Int_t numY) override
Definition: TGo4Script.cxx:786
string msg
Definition: go4init.py:11