GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4Script.cxx
Go to the documentation of this file.
1 // $Id: TGo4Script.cxx 3050 2021-03-12 10:21:12Z linev $
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 
51  fiWaitForGUIReaction(0),
52  fiWaitCounter(0),
53  fStrBuf(),
54  fMainWin(mainwin),
55  fErrorFlag(kFALSE),
56  fBlockConfigFlag(0)
57 {
58  if (mainwin!=0)
59  Initialize(mainwin->OM(), mainwin->Browser());
60 }
61 
63 {
64 }
65 
66 
67 Bool_t TGo4Script::StartScriptExecution(const char* fname)
68 {
69  if ((fname==0) || (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!=0)
91  fMainWin->StatusMessage(str);
92 }
93 
95 {
96  if ((fMainWin==0) || !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==0) return kFALSE;
112 
113  Int_t error = 0;
114  gROOT->ProcessLineSync(nextcmd, &error);
115 
116  if (error!=0) {
117  doOutput(Form("Error = %d. CMD: %s", error, nextcmd));
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==0)) 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!=0) && anal->IsAnalysisReady()) {
195  doOutput("// Disconnect old analysis first");
198  fiWaitCounter = getCounts(10.);
199  return 2;
200  }
201 
202  fMainWin->LaunchClientSlot(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!=0) && 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==0) || !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==0) 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!=0) && 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!=0) && 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==0) return 1;
261  return (fiWaitCounter<2) ? 0 : 2;
262  }
263 
264  case 15: { // connect to running server
265  fMainWin->ConnectServerSlot(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!=0)
297  fMainWin->StatusMessage(msg);
298 }
299 
300 
301 void TGo4Script::HotStart(const char* filename)
302 {
303  fMainWin->HotStart(filename);
304 }
305 
307 {
309  fiWaitCounter = getCounts(1.);
310 
312 }
313 
314 void TGo4Script::LaunchAnalysis(const char* ClientName,
315  const char* ClientDir,
316  const char* ClientExec,
317  const char* ClientNode,
318  Int_t ShellMode,
319  Int_t TermMode,
320  Int_t ExeMode,
321  const char* UserArgs)
322 {
323  go4sett->setClientName(ClientName);
324  go4sett->setClientDir(ClientDir);
325  go4sett->setClientExeMode(ExeMode);
326  go4sett->setClientExec(ClientExec);
327  go4sett->setClientArgs(UserArgs);
328  const char* separ = strrchr(ClientNode, ':');
329  if (separ==0) {
330  go4sett->setClientNode(ClientNode);
332  } else {
333  TString node;
334  node.Append(ClientNode, separ - ClientNode);
335  go4sett->setClientNode(node.Data());
337  go4sett->setClientPort(TString(separ+1).Atoi());
338  }
339 
340  go4sett->setClientShellMode(ShellMode);
341  go4sett->setClientTermMode(TermMode);
342  LaunchAnalysis();
343 }
344 
345 void TGo4Script::ConnectAnalysis(const char* ServerNode,
346  Int_t ServerPort,
347  Int_t ControllerMode,
348  const char* password)
349 {
350  go4sett->setClientNode(ServerNode);
351  go4sett->setClientPort(ServerPort);
352  go4sett->setClientControllerMode(ControllerMode);
353  go4sett->setClientDefaultPass((password==0) || (*password==0));
355  fStrBuf = password;
356  fiWaitCounter = getCounts(1.);
357 
359 }
360 
361 void TGo4Script::WaitAnalysis(Int_t delay_sec)
362 {
364  fiWaitCounter = getCounts(delay_sec);
365 
367 }
368 
370 {
372 
374  fiWaitCounter = getCounts(20.);
375 
377 }
378 
380 {
382 
384  fiWaitCounter = getCounts(20.);
385 
387 }
388 
390 {
391  if (CanConfigureAnalysis())
394  fiWaitCounter = getCounts(tmout);
395  }
396 
398 }
399 
401 {
402  if (CanConfigureAnalysis()) {
404  if (dynamic_cast<TGo4HttpProxy*>(Server())!=0)
405  Wait(0.1);
406  else
407  Wait(1.);
408  } else {
409  fBlockConfigFlag = -1; // from this command blocking is disabled
410  }
411 }
412 
414 {
415  if (CanConfigureAnalysis()) {
417  if (dynamic_cast<TGo4HttpProxy*>(Server())!=0)
418  Wait(0.1);
419  else
420  Wait(2.);
421  } else {
422  fBlockConfigFlag = -1; // from this command blocking is disabled
423  }
424 }
425 
427 {
428  TGo4ServerProxy* anal = Server();
429  if (anal!=0) {
430  anal->RefreshNamesList();
432  fiWaitCounter = getCounts(tmout > 0 ? tmout : 10);
433  }
434 
436 }
437 
439 {
440  if (fBlockConfigFlag == 0) {
441  // once a session check if analysis was not launched from the GUI, we should not try to configure it
442  TGo4HttpProxy* serv = dynamic_cast<TGo4HttpProxy*> (Server());
443  if ((serv!=0) && !serv->IsAnalysisLaunched()) fBlockConfigFlag = 1;
444  }
445 
446  return (fBlockConfigFlag<=0);
447 }
448 
449 
451 {
453  QWidget* gui = gui_ ? gui_->parentWidget() : 0;
454  if (gui==0) return;
455 
456  if (mode<0) gui->hide(); else
457  if (mode==0) gui->showMinimized(); else
458  gui->showNormal();
459 }
460 
462 {
464  QWidget* gui = gui_ ? gui_->parentWidget() : 0;
465  if (gui==0) return;
466 
467  if (mode<0) gui->hide(); else
468  if (mode==0) gui->showMinimized(); else
469  gui->showNormal();
470 }
471 
472 void TGo4Script::AnalysisAutoSave(const char* filename,
473  Int_t interval,
474  Int_t compression,
475  Bool_t enabled,
476  Bool_t overwrite)
477 {
479  if((gui!=0) && CanConfigureAnalysis())
480  gui->SetAutoSaveConfig(filename, interval, compression, enabled, overwrite);
481 }
482 
483 void TGo4Script::AnalysisConfigName(const char* filename)
484 {
486  if((gui!=0) && CanConfigureAnalysis())
487  gui->SetAnalysisConfigFile(filename);
488 }
489 
491 {
492  // in cannot configure analysis - do not return step gui pointer
493  if (!CanConfigureAnalysis()) return 0;
494 
496 
497  return gui==0 ? 0 : gui->FindStepConfig(stepname);
498 }
499 
500 void TGo4Script::ConfigStep(const char* stepname,
501  Bool_t enableprocess,
502  Bool_t enablesource,
503  Bool_t enablestore)
504 {
505  TGo4ConfigStep* step = GetStepGUI(stepname);
506  if (step)
507  step->SetStepControl(enableprocess, enablesource, enablestore);
508 }
509 
510 void TGo4Script::StepFileSource(const char* stepname,
511  const char* sourcename,
512  int timeout)
513 {
514  TGo4ConfigStep* step = GetStepGUI(stepname);
515  if (step) {
516  step->SetFileSource();
517  step->SetSourceWidgets(sourcename, timeout);
518  }
519 }
520 
521 void TGo4Script::StepMbsFileSource(const char* stepname,
522  const char* sourcename,
523  int timeout,
524  const char* TagFile,
525  int start,
526  int stop,
527  int interval)
528 {
529  TGo4ConfigStep* step = GetStepGUI(stepname);
530  if (step) {
531  step->SetMbsFileSource(TagFile);
532  step->SetSourceWidgets(sourcename, timeout);
533  step->SetMbsSourceWidgets(start, stop, interval);
534  }
535 }
536 
537 void TGo4Script::StepMbsStreamSource(const char* stepname,
538  const char* sourcename,
539  int timeout,
540  int start,
541  int stop,
542  int interval)
543 {
544  TGo4ConfigStep* step = GetStepGUI(stepname);
545  if (step) {
546  step->SetMbsStreamSource();
547  step->SetSourceWidgets(sourcename, timeout);
548  step->SetMbsSourceWidgets(start, stop, interval);
549  }
550 }
551 
552 void TGo4Script::StepMbsTransportSource(const char* stepname,
553  const char* sourcename,
554  int timeout,
555  int start,
556  int stop,
557  int interval)
558 {
559  TGo4ConfigStep* step = GetStepGUI(stepname);
560  if (step) {
561  step->SetMbsTransportSource();
562  step->SetSourceWidgets(sourcename, timeout);
563  step->SetMbsSourceWidgets(start, stop, interval);
564  }
565 }
566 
567 void TGo4Script::StepMbsEventServerSource(const char* stepname,
568  const char* sourcename,
569  int timeout,
570  int start,
571  int stop,
572  int interval)
573 {
574  TGo4ConfigStep* step = GetStepGUI(stepname);
575  if (step) {
576  step->SetMbsEventServerSource();
577  step->SetSourceWidgets(sourcename, timeout);
578  step->SetMbsSourceWidgets(start, stop, interval);
579  }
580 }
581 
582 void TGo4Script::StepMbsRevServSource(const char* stepname,
583  const char* sourcename,
584  int timeout,
585  int port,
586  int start,
587  int stop,
588  int interval)
589 {
590  TGo4ConfigStep* step = GetStepGUI(stepname);
591  if (step) {
592  step->SetMbsRevServSource(port);
593  step->SetSourceWidgets(sourcename, timeout);
594  step->SetMbsSourceWidgets(start, stop, interval, port);
595  }
596 }
597 
598 void TGo4Script::StepMbsSelection(const char* stepname,
599  int start,
600  int stop,
601  int interval)
602 {
603  TGo4ConfigStep* step = GetStepGUI(stepname);
604  if (step)
605  step->SetMbsSourceWidgets(start, stop, interval);
606 }
607 
608 void TGo4Script::StepRandomSource(const char* stepname,
609  const char* sourcename,
610  int timeout)
611 {
612  TGo4ConfigStep* step = GetStepGUI(stepname);
613  if (step) {
614  step->SetRandomSource();
615  step->SetSourceWidgets(sourcename, timeout);
616  }
617 }
618 
619 void TGo4Script::StepMbsPort(const char* stepname,
620  int port)
621 {
622  TGo4ConfigStep* step = GetStepGUI(stepname);
623  if (step) step->SetMbsPort(port);
624 }
625 
626 void TGo4Script::StepMbsRetryCnt(const char* stepname,
627  int cnt)
628 {
629  TGo4ConfigStep* step = GetStepGUI(stepname);
630  if (step) step->SetMbsRetryCnt(cnt);
631 }
632 
633 void TGo4Script::StepUserSource(const char* stepname,
634  const char* sourcename,
635  int timeout,
636  int port,
637  const char* expr)
638 {
639  TGo4ConfigStep* step = GetStepGUI(stepname);
640  if (step) {
641  step->SetUserSource(port, expr);
642  step->SetSourceWidgets(sourcename, timeout);
643  }
644 }
645 
646 
647 void TGo4Script::StepHDF5Source(const char* stepname,
648  const char* sourcename,
649  int timeout)
650 {
651  TGo4ConfigStep* step = GetStepGUI(stepname);
652  if (step) {
653  step->SetHDF5Source(sourcename);
654  step->SetSourceWidgets(sourcename, timeout);
655  }
656 }
657 
658 void TGo4Script::StepFileStore(const char* stepname,
659  const char* storename,
660  bool overwrite,
661  int bufsize,
662  int splitlevel,
663  int compression,
664  int autosaveperiod)
665 {
666  TGo4ConfigStep* step = GetStepGUI(stepname);
667  if (step)
668  step->SetFileStore(storename, overwrite, bufsize, splitlevel, compression, autosaveperiod);
669 }
670 
671 void TGo4Script::StepBackStore(const char* stepname,
672  const char* storename,
673  int bufsize,
674  int splitlevel)
675 {
676  TGo4ConfigStep* step = GetStepGUI(stepname);
677  if (step)
678  step->SetBackStore(storename, bufsize, splitlevel);
679 }
680 
681 void TGo4Script::StepUserStore(const char* stepname,
682  const char* storename)
683 {
684  TGo4ConfigStep* step = GetStepGUI(stepname);
685  if (step)
686  step->SetUserStore(storename);
687 }
688 
689 void TGo4Script::StepHDF5Store(const char* stepname,
690  const char* storename,
691  int flags)
692 {
693  TGo4ConfigStep* step = GetStepGUI(stepname);
694  if (step)
695  step->SetHDF5Store(storename, flags);
696 }
697 
698 void TGo4Script::SetMainWindowState(int qtversion, const char* val)
699 {
700  if (qtversion==4)
701  fMainWin->restoreState(QByteArray::fromHex(val));
702 }
703 
704 void TGo4Script::SetMainWindowGeometry(int qtversion, const char* val)
705 {
706  if (qtversion==4)
707  fMainWin->restoreGeometry(QByteArray::fromHex(val));
708 }
709 
711 {
712  return fMainWin->MakeNewPanel(1);
713 }
714 
715 ViewPanelHandle TGo4Script::StartViewPanel(int x, int y, int width, int height, int mode, TGo4Picture* pic)
716 {
717  TGo4ViewPanel* panel = fMainWin->MakeNewPanel(1);
718  if (panel==0) return 0;
719 
720  if (mode==0) panel->showMinimized(); else
721  if (mode==2) panel->showMaximized(); else {
722  panel->showNormal();
723  panel->parentWidget()->move(QPoint(x,y));
724  panel->parentWidget()->resize(QSize(width, height));
725  }
726 
727  if (pic!=0) {
728  panel->ProcessPictureRedraw("", panel->GetCanvas(), pic);
729  if (TString(DefaultPicTitle()) != pic->GetTitle())
730  panel->SetFreezedTitle(pic->GetTitle());
731 
732  panel->ShootRepaintTimer();
733  }
734 
735  return (ViewPanelHandle) panel;
736 }
737 
739 {
740  TGo4ViewPanel* panel = (TGo4ViewPanel*) handle;
741  if (panel==0) return TString();
742  return TString(panel->objectName().toLatin1().constData());
743 }
744 
746 {
747  return (ViewPanelHandle) fMainWin->FindViewPanel(name);
748 }
749 
750 Bool_t TGo4Script::SetViewPanelName(ViewPanelHandle handle, const char* newname)
751 {
752  TGo4ViewPanel* panel = (TGo4ViewPanel*) handle;
753  if ((handle==0) || (newname==0) || (strlen(newname)==0)) return kFALSE;
754 
755  if (fMainWin->FindViewPanel(newname)) {
756  Message(Form("Viewpanel with name %s already exists",newname));
757  return kFALSE;
758  }
759 
760  panel->SetPanelName(newname);
761 
762  panel->UpdatePanelCaption();
763 
764  return kTRUE;
765 }
766 
768 {
770 }
771 
773 {
774  TGo4ViewPanel* panel = (TGo4ViewPanel*) handle;
775  if (panel!=0) panel->RedrawPanel(panel->GetCanvas(), true);
776 }
777 
778 void TGo4Script::DivideViewPanel(ViewPanelHandle handle, Int_t numX, Int_t numY)
779 {
780  TGo4ViewPanel* panel = (TGo4ViewPanel*) handle;
781  if (panel!=0) panel->Divide(numX, numY);
782 }
783 
784 TPad* TGo4Script::SelectPad(ViewPanelHandle handle, Int_t number)
785 {
786  TGo4ViewPanel* panel = (TGo4ViewPanel*) handle;
787  if (panel!=0) {
788  TPad* pad = panel->GetSubPad(0, number, false);
789  if (pad==0) pad = panel->GetCanvas();
790  panel->SetActivePad(pad);
791  ProcessEvents();
792  return pad;
793  }
794  return 0;
795 }
796 
798 {
799  TGo4ViewPanel* panel = (TGo4ViewPanel*) handle;
800  if (panel==0) return 0;
801 
802  TPad* pad = panel->GetSubPad(0, padnumber, false);
803  if (pad==0) pad = panel->GetCanvas();
804  return panel->GetPadOptions(pad);
805 }
806 
808 {
809  TGo4ViewPanel* panel = (TGo4ViewPanel*) handle;
810  if (panel!=0) panel->SetPadSuperImpose(panel->GetActivePad(), on);
811 }
812 
814 {
815  TGo4ViewPanel* panel = (TGo4ViewPanel*) handle;
816  if (panel!=0) panel->SetApplyToAllFlag(on);
817 }
818 
819 Bool_t TGo4Script::DrawItem(const char* itemname, ViewPanelHandle handle, const char* drawopt)
820 {
821  TGo4ViewPanel* panel = (TGo4ViewPanel*) handle;
822 
823  panel = fMainWin->DisplayBrowserItem(itemname, panel, 0, true, -1, drawopt);
824 
825  if (panel!=0) ProcessEvents();
826 
827  return (panel!=0);
828 }
829 
830 const char* TGo4Script::GetDrawnItemName(ViewPanelHandle handle, int cnt)
831 {
832  TGo4ViewPanel* panel = (TGo4ViewPanel*) handle;
833 
834  return panel ? panel->GetDrawItemName(cnt) : 0;
835 }
836 
838 {
840 }
841 
842 TGo4ServerProxy* TGo4Script::ConnectHttp(const char* servername, const char* account, const char* pass)
843 {
844  if ((servername==0) || (*servername==0)) return 0;
845 
846  TGo4HttpProxy* proxy = new TGo4HttpProxy();
847  if(account) proxy->SetAccount(account, pass);
848  if (!proxy->Connect(servername)) {
849  delete proxy;
850  return 0;
851  }
852 
853  const char* slotname = servername;
854  if (strncmp(slotname,"http://",7)==0) slotname+=7; else
855  if (strncmp(slotname,"https://",8)==0) slotname+=8;
856  TString sname(slotname);
857  Int_t len = sname.Index("/");
858  if ((len>1) && (len<sname.Length())) sname.Resize(len);
859 
860  Browser()->AddServerProxy(proxy, sname.Data(), "ROOT http server");
861 
862  return proxy;
863 }
864 
865 
866 // ***************************** Generation *********************
867 
868 
869 void TGo4Script::ProduceScript(const char* filename, TGo4MainWindow* main)
870 {
872 
873  TGo4AnalysisWindow* termgui = main->FindAnalysisWindow();
874 
875  TGo4BrowserProxy* br = main->Browser();
876 
877  TGo4AnalysisProxy* anal = br->FindAnalysis();
878 
879  // this is either HTTP or normal http proxy
880  TGo4ServerProxy* serv = br->FindServer();
881 
882  // ignore server which is was not launched
883  if ((serv!=0) && (serv!=anal) && (serv->IsAnalysisLaunched()<=0)) serv = 0;
884 
885  std::ofstream fs(filename);
886  if (!fs.is_open()) return;
887 
888  fs << "// Automatically generated startup script" << std::endl;
889  fs << "// Do not change it!" << std::endl << std::endl;
890 
891  fs << "go4->SetMainWindowState(4,\"" << main->saveState().toHex().data() << "\");" << std::endl;
892 
893  fs << "go4->SetMainWindowGeometry(4,\"" << main->saveGeometry().toHex().data() << "\");" << std::endl;
894 
895  ProduceLoadLibs(fs);
896 
897  TObjArray prlist;
898  br->MakeFilesList(&prlist);
899  for(Int_t n=0;n<=prlist.GetLast();n++) {
900  TGo4DirProxy* pr = (TGo4DirProxy*) prlist.At(n);
901  fs << "go4->OpenFile(\"" << pr->GetFileName() << "\");" << std::endl;
902  }
903 
904  prlist.Clear();
905  br->MakeHServerList(&prlist);
906  for(Int_t n=0;n<=prlist.GetLast();n++) {
907  TGo4HServProxy* pr = (TGo4HServProxy*) prlist.At(n);
908  fs << "go4->ConnectHServer(\""
909  << pr->GetServerName() << "\", "
910  << pr->GetPortNumber() << ", \""
911  << pr->GetBaseName() << "\", \""
912  << pr->GetUserPass() << "\", \""
913  << pr->GetFilter() << "\");" << std::endl;
914  }
915 
916  prlist.Clear();
917  br->MakeDabcList(&prlist);
918  for(Int_t n=0;n<=prlist.GetLast();n++) {
919  TGo4DabcProxy* pr = (TGo4DabcProxy*) prlist.At(n);
920  fs << "go4->ConnectDabc(\"" << pr->GetServerName() << "\");" << std::endl;
921  }
922 
923  fs << std::endl;
924 
925  bool isanalysis = (anal!=0) && anal->IsAnalysisReady() && !anal->IsAnalysisServer();
926  if (!isanalysis && (serv!=0) && (serv!=anal)) isanalysis = true;
927 
928  if (isanalysis) {
929 // start analysis configuration
930  fs << "go4->LaunchAnalysis(\"" << go4sett->getClientName().toLatin1().constData() << "\", \""
931  << go4sett->getClientDir().toLatin1().constData() << "\", \""
932  << go4sett->getClientExec().toLatin1().constData() << "\", \""
933  << go4sett->getClientNode().toLatin1().constData();
934 
935  if (go4sett->getClientIsServer() == 2) {
936  // add port number for http server
937  fs << ":";
938  fs << go4sett->getClientPort();
939  }
940 
941  fs << "\", ";
942 
943  if (go4sett->getClientShellMode() == Go4_rsh) fs << "Go4_rsh, "; else
944  if (go4sett->getClientShellMode() == Go4_ssh) fs << "Go4_ssh, "; else fs << "Go4_sh, ";
945 
946  if (go4sett->getClientTermMode() == Go4_xterm) fs << "Go4_xtrem, "; else
947  if (go4sett->getClientTermMode() == Go4_konsole) fs << "Go4_konsole, "; else fs << "Go4_qt, ";
948 
949  if (go4sett->getClientExeMode() == Go4_lib) fs << "Go4_lib"; else fs << "Go4_exe";
950 
951 // << go4sett->getClientShellMode() << ", "
952 // << go4sett->getClientTermMode() << ", "
953 // << go4sett->getClientExeMode();
954  if (go4sett->getClientArgs().length()>0)
955  fs << ", \"" << go4sett->getClientArgs().toLatin1().constData() << "\"";
956  fs << ");" << std::endl;
957 
958  fs << "go4->WaitAnalysis(300);" << std::endl << std::endl;
959 
960  if (confgui==0) return;
961  fs << "// configuration of analysis" << std::endl;
962 
963  QString fname;
964  int interval, compression;
965  bool asenabled, asoverwrite;
966 
967  confgui->GetAutoSaveConfig(fname, interval, compression, asenabled, asoverwrite);
968  fs << "go4->AnalysisAutoSave(\"" << fname.toLatin1().constData() << "\", "
969  << interval << ", "
970  << compression << ", "
971  << (asenabled ? "kTRUE" : "kFALSE") << ", "
972  << (asoverwrite ? "kTRUE" : "kFALSE") << ");" << std::endl;
973 
974  confgui->GetAnalysisConfigFile(fname);
975  fs << "go4->AnalysisConfigName(\"" << fname.toLatin1().constData() << "\");" << std::endl << std::endl;
976 
977  for(int nstep=0;nstep<confgui->GetNumSteps();nstep++) {
978  TGo4ConfigStep* stepconf = confgui->GetStepConfig(nstep);
979  fs << "// step " << stepconf->GetStepName().toLatin1().constData() << std::endl;
980 
981  bool process, source, store;
982  stepconf->GetStepControl(process, source, store);
983  fs << "go4->ConfigStep(\"" << stepconf->GetStepName().toLatin1().constData() << "\", "
984  << (process ? "kTRUE" : "kFALSE") << ", "
985  << (source ? "kTRUE" : "kFALSE") << ", "
986  << (store ? "kTRUE" : "kFALSE") << ");" << std::endl;
987 
988  QString srcname;
989  int timeout(0), start(0), stop(0), interval(0), nport(0), nretry(0);
990  int nsrc = stepconf->GetSourceSetup(srcname, timeout, start, stop, interval, nport, nretry);
991 
992  TString srcargs;
993  srcargs.Form("(\"%s\", \"%s\", %d", stepconf->GetStepName().toLatin1().constData(), srcname.toLatin1().constData(), timeout);
994 
995  switch(nsrc) {
996  case 0:
997  fs << "go4->StepFileSource" << srcargs;
998  break;
999  case 1: {
1000  QString TagFile;
1001  stepconf->GetMbsFileSource(TagFile);
1002  fs << "go4->StepMbsFileSource" << srcargs << ", \""
1003  << TagFile.toLatin1().constData() << "\"";
1004  break;
1005  }
1006  case 2:
1007  fs << "go4->StepMbsStreamSource" << srcargs;
1008  break;
1009  case 3:
1010  fs << "go4->StepMbsTransportSource" << srcargs;
1011  break;
1012  case 4:
1013  fs << "go4->StepMbsEventServerSource" << srcargs;
1014  break;
1015  case 5:
1016  fs << "go4->StepMbsRevServSource" << srcargs;
1017  break;
1018  case 6:
1019  fs << "go4->StepRandomSource" << srcargs;
1020  break;
1021  case 7: {
1022  int port;
1023  QString expr;
1024  stepconf->GetUserSource(port, expr);
1025  fs << "go4->StepUserSource" << srcargs << ", " << port << ", \""
1026  << expr.toLatin1().constData() << "\"";
1027  break;
1028  }
1029  case 8:
1030  fs << "go4->StepHDF5Source" << srcargs;
1031  break;
1032 
1033 
1034  } // switch(nsrc)
1035  fs << ");" << std::endl;
1036 
1037  if ((start!=0) || (stop!=0) || (interval>1)) {
1038  srcargs.Form("(\"%s\", %d, %d ,%d)",stepconf->GetStepName().toLatin1().constData(), start, stop, interval);
1039  fs << "go4->StepMbsSelection" << srcargs << ";" << std::endl;
1040  }
1041 
1042  if (nport>0) {
1043  srcargs.Form("(\"%s\", %d)",stepconf->GetStepName().toLatin1().constData(), nport);
1044  fs << "go4->StepMbsPort" << srcargs << ";" << std::endl;
1045  }
1046 
1047  if (nretry>0) {
1048  srcargs.Form("(\"%s\", %d)",stepconf->GetStepName().toLatin1().constData(), nretry);
1049  fs << "go4->StepMbsRetryCnt" << srcargs << ";" << std::endl;
1050  }
1051 
1052  QString storename;
1053  int nstore = stepconf->GetStoreSetup(storename);
1054  switch(nstore) {
1055  case 0: {
1056  bool overwrite;
1057  int bufsize, splitlevel, compression, autosave;
1058  stepconf->GetFileStore(overwrite, bufsize, splitlevel, compression, autosave);
1059  fs << "go4->StepFileStore(\"" << stepconf->GetStepName().toLatin1().constData() << "\", \""
1060  << storename.toLatin1().constData() << "\", "
1061  << (overwrite ? "kTRUE" : "kFALSE") << ", "
1062  << bufsize << ", "
1063  << splitlevel << ", "
1064  << compression << ", "
1065  << autosave << ");" << std::endl;
1066  break;
1067  }
1068 
1069  case 1: {
1070  int bufsize, splitlevel;
1071  stepconf->GetBackStore(bufsize, splitlevel);
1072  fs << "go4->StepBackStore(\"" << stepconf->GetStepName().toLatin1().constData() << "\", \""
1073  << storename.toLatin1().constData() << "\", "
1074  << bufsize << ", "
1075  << splitlevel << ");" << std::endl;
1076  break;
1077  }
1078 
1079  case 2: {
1080  fs << "go4->StepUserStore(\"" << stepconf->GetStepName().toLatin1().constData() << "\", \""
1081  << storename.toLatin1().constData() << "\");" << std::endl;
1082  break;
1083  }
1084 
1085  case 3: {
1086  int flags = 0;
1087  stepconf->GetHDF5Store(flags);
1088  fs << "go4->StepHDF5Store(\"" << stepconf->GetStepName().toLatin1().constData() << "\", \""
1089  << storename.toLatin1().constData() << "\", "
1090  << flags << ");" << std::endl;
1091  break;
1092  }
1093 
1094  } // switch
1095 
1096  fs << std::endl;
1097  }
1098 
1099  if (((anal!=0) && anal->IsAnalysisSettingsReady()) || ((serv!=0) && (serv!=anal)))
1100  fs << "go4->SubmitAnalysisConfig(20);" << std::endl << std::endl;
1101 
1102  int mode = 1;
1103  QWidget* mdi = confgui ? confgui->parentWidget() : 0;
1104  if (mdi!=0) {
1105  if (mdi->isHidden()) mode = -1; else
1106  if (mdi->isMinimized()) mode = 0;
1107  }
1108  fs << "go4->SetAnalysisConfigMode(" << mode << ");" << std::endl;
1109 
1110  mode = 1;
1111  mdi = termgui ? termgui->parentWidget() : 0;
1112  if (mdi!=0) {
1113  if (mdi->isHidden()) mode = -1; else
1114  if (mdi->isMinimized()) mode = 0;
1115  }
1116  fs << "go4->SetAnalysisTerminalMode(" << mode << ");" << std::endl << std::endl;
1117 // end analysis configuration
1118  } else
1119  if ((anal!=0) && anal->IsAnalysisReady() && anal->IsAnalysisServer()) {
1120  fs << "go4->ConnectAnalysis(\""
1121  << go4sett->getClientNode().toLatin1().constData() << "\", "
1122  << go4sett->getClientPort() << ", "
1123  << go4sett->getClientControllerMode() << ", ";
1125  fs << "0);" << std::endl;
1126  else
1127  fs << "\"" << main->LastTypedPassword() << "\");" << std::endl;
1128  fs << "go4->WaitAnalysis(10);" << std::endl << std::endl;
1129  } else {
1130  fs << "go4->DisconnectAnalysis();" << std::endl;
1131  }
1132 
1133  // connect to other http server after main analysis configuration - otherwise they could replace it in control elements
1134  prlist.Clear();
1135  br->MakeHttpList(&prlist);
1136  for(Int_t n=0;n<=prlist.GetLast();n++) {
1137  TGo4HttpProxy* pr = (TGo4HttpProxy*) prlist.At(n);
1138  if (pr == serv) continue;
1139  fs << "go4->ConnectHttp(\"" << pr->GetServerName() << "\");" << std::endl;
1140  }
1141 
1142  if (((anal!=0) && anal->IsAnalysisRunning() && !anal->IsAnalysisServer()) ||
1143  ((serv!=0) && (serv!=anal) && serv->IsAnalysisRunning())) {
1144  fs << "go4->StartAnalysis();" << std::endl;
1145  fs << std::endl;
1146  fs << "// in some analysis one requires to wait several seconds before new histograms appears" << std::endl;
1147  fs << "// go4->Wait(1);" << std::endl;
1148  fs << "go4->RefreshNamesList();" << std::endl;
1149  } else
1150  if ((anal!=0) || (serv!=0)) {
1151  fs << std::endl;
1152  fs << "go4->RefreshNamesList();" << std::endl;
1153  }
1154 
1155  int npanel(0);
1156 
1157  QList<QMdiSubWindow *> windows = TGo4MdiArea::Instance()->subWindowList();
1158  for (int i=0; i<windows.count(); ++i ) {
1159  TGo4ViewPanel* panel = dynamic_cast<TGo4ViewPanel*> (windows.at(i)->widget());
1160  if (panel==0) continue;
1161 
1162  TString picname = TString::Format("pic%d", ++npanel);
1163  TGo4Picture pic(picname.Data(), DefaultPicTitle());
1164 
1165  panel->MakePictureForPad(&pic, panel->GetCanvas(), true);
1166 
1167  fs << std::endl;
1168 
1169  pic.SavePrimitive(fs,"");
1170 
1171  QWidget* mdi = panel->parentWidget();
1172 
1173  QPoint pos = mdi->pos();
1174  mdi->mapToParent(pos);
1175  QSize size = mdi->size();
1176 
1177  const char* mode = "Go4_normal";
1178  if (mdi->isHidden()) mode = "Go4_hidden"; else
1179  if (mdi->isMinimized()) mode = "Go4_minimized"; else
1180  if (mdi->isMaximized()) mode = "Go4_maximized";
1181 
1182  fs << "go4->StartViewPanel("
1183  << pos.x() << ", "
1184  << pos.y() << ", "
1185  << size.width() << ", "
1186  << size.height() << ", "
1187  << mode << ", " << picname << ");" << std::endl;
1188 
1189  fs << "delete " << picname << ";" << std::endl;
1190  }
1191 
1192  fs << std::endl;
1193 
1194  TGo4Iter iter(br->BrowserTopSlot(), kFALSE);
1195  Bool_t goinside = kTRUE;
1196 
1197  while (iter.next(goinside)) {
1198  TGo4Slot* subslot = iter.getslot();
1199  goinside = kTRUE;
1200 
1201  if (br->ItemKind(subslot)==TGo4Access::kndFolder) {
1202  // check if any subitem not monitored
1203  Int_t ncheck(0), ncount(0);
1204  TGo4Iter subiter(subslot, kTRUE);
1205  while (subiter.next()) {
1206  TGo4Slot* subsubslot = subiter.getslot();
1207  if (br->ItemKind(subsubslot)!=TGo4Access::kndObject) continue;
1208  ncount++;
1209  if (!br->IsItemMonitored(subsubslot)) ncheck++;
1210  else break;
1211  }
1212  goinside = (ncount==0) || (ncheck!=ncount);
1213  } else
1214  goinside = br->IsItemMonitored(subslot);
1215 
1216  if (!goinside) {
1217  TString sbuf;
1218  if (br->BrowserItemName(subslot, sbuf))
1219  fs << "go4->MonitorItem(\"" << sbuf << "\", kFALSE);" << std::endl;
1220  }
1221 
1222  }
1223 
1224  Int_t mperiod = br->MonitoringPeriod();
1225  if (mperiod>0)
1226  fs << "go4->StartMonitoring(" << mperiod/1000 << ");" << std::endl;
1227 }
Bool_t IsAnalysisSettingsReady() const
void setClientControllerMode(int)
Int_t fiWaitForGUIReaction
Definition: TGo4Script.h:222
virtual void ShootRepaintTimer()
QString getClientDir()
void StepUserStore(const char *stepname, const char *storename)
Definition: TGo4Script.cxx:681
Bool_t ContinueExecution()
Definition: TGo4Script.cxx:94
void HotStart(const char *fname)
Bool_t IsAnalysisReady() const
int getClientShellMode()
void SetApplyToAll(ViewPanelHandle panel, Bool_t on=kTRUE)
Definition: TGo4Script.cxx:813
void setClientExeMode(int mode)
Bool_t IsItemMonitored(TGo4Slot *slot)
void StepUserSource(const char *stepname, const char *sourcename, int timeout, int port, const char *expr)
Definition: TGo4Script.cxx:633
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)
TPad * SelectPad(ViewPanelHandle panel, Int_t number=0)
Definition: TGo4Script.cxx:784
Int_t execGUICommands()
Definition: TGo4Script.cxx:185
virtual void SetActivePad(TPad *pad)
TString fStrBuf
Definition: TGo4Script.h:224
void RedrawPanel(ViewPanelHandle handle)
Definition: TGo4Script.cxx:772
void setClientDir(const QString &)
void LaunchClientSlot(bool interactive=true)
ViewPanelHandle StartViewPanel()
Definition: TGo4Script.cxx:710
Int_t ItemKind(const char *name)
QString getClientName()
ViewPanelHandle GetActiveViewPanel()
Definition: TGo4Script.cxx:767
virtual void SetBackStore(QString name, int bufsize, int splitlevel)
void StepHDF5Store(const char *stepname, const char *storename, int flags)
Definition: TGo4Script.cxx:689
virtual void GetHDF5Store(int &flags)
virtual void SetMbsRetryCnt(int retry)
TGo4BrowserProxy * Browser() const
virtual void SetHDF5Store(QString name, int flags)
void StepRandomSource(const char *stepname, const char *sourcename, int timeout)
Definition: TGo4Script.cxx:608
virtual void SetAutoSaveConfig(QString filename, int interval, int compression, bool enbaled, bool overwrite)
static TGo4MdiArea * Instance()
Definition: TGo4MdiArea.cpp:26
void StepMbsPort(const char *stepname, int port)
Definition: TGo4Script.cxx:619
void StepMbsSelection(const char *stepname, int start, int stop, int interval)
Definition: TGo4Script.cxx:598
TGo4ConfigStep * GetStepConfig(int n)
void StepMbsFileSource(const char *stepname, const char *sourcename, int timeout, const char *TagFile, int start=0, int stop=0, int interval=0)
Definition: TGo4Script.cxx:521
void doOutput(const char *str)
Definition: TGo4Script.cxx:88
void Initialize(TGo4ObjectManager *om, TGo4BrowserProxy *br)
list of shared libraries when application is started
void SetAnalysisConfigMode(int mode)
Definition: TGo4Script.cxx:461
virtual Bool_t IsAnalysisRunning() const
void ShutdownAnalysis()
Definition: TGo4Script.cxx:379
TGo4Slot * getslot() const
Definition: TGo4Iter.cxx:166
void MakeHServerList(TObjArray *arr)
TGo4MainWindow * fMainWin
Definition: TGo4Script.h:225
virtual TGo4ServerProxy * ConnectHttp(const char *servername, const char *account=0, const char *pass=0)
Definition: TGo4Script.cxx:842
virtual void SetMbsRevServSource(int port)
void StartFitPanel()
Definition: TGo4Script.cxx:837
Int_t fBlockConfigFlag
Definition: TGo4Script.h:227
QString getClientExec(int mode=-1)
bool SubmitAnalysisSettings()
void LaunchAnalysis()
Definition: TGo4Script.cxx:306
virtual Bool_t RefreshNamesList()
void setClientName(const QString &)
virtual const char * GetDrawItemName(int itemcnt=0)
void SubmitAnalysisConfig(int tmout=20)
Definition: TGo4Script.cxx:389
void ConnectServerSlot(bool interactive=true, const char *password="")
void ConnectAnalysis(const char *ServerNode, Int_t ServerPort, Int_t ControllerMode, const char *password=0)
Definition: TGo4Script.cxx:345
virtual void RedrawPanel(TPad *pad, bool force)
TGo4ServerProxy * FindServer(const char *itemname=0, Bool_t asanalysis=kTRUE)
virtual void GetFileStore(bool &overwrite, int &bufsize, int &splitlevel, int &compression, int &autosaveinterval)
void setClientTermMode(int)
Bool_t DrawItem(const char *itemname, ViewPanelHandle panel=0, const char *drawopt=0)
Definition: TGo4Script.cxx:819
virtual Bool_t IsAnalysisServer() const
virtual void Divide(int numX, int numY)
void ShutdownAnalysisSlot(bool interactive=true)
virtual Bool_t IsAnalysisRunning() const
int main(int argc, char **argv)
void ProcessEvents(Int_t timeout=-1)
Definition: TGo4Script.cxx:180
void DisconnectAnalysis()
Definition: TGo4Script.cxx:369
Bool_t Connect(const char *nodename)
int getClientControllerMode()
void setClientShellMode(int)
void StepFileSource(const char *stepname, const char *sourcename, int timeout)
Definition: TGo4Script.cxx:510
static TGo4Script * ScriptInstance()
Definition: TGo4Script.cxx:44
void DivideViewPanel(ViewPanelHandle panel, Int_t numX, Int_t numY)
Definition: TGo4Script.cxx:778
void FinishExecution()
Definition: TGo4Script.cxx:124
TGo4FitPanel * StartFitPanel()
virtual void UpdatePanelCaption()
void SetAnalysisTerminalMode(int mode)
Definition: TGo4Script.cxx:450
TGo4BrowserProxy * Browser()
virtual void GetMbsFileSource(QString &TagFile)
virtual TPad * GetSubPad(TPad *toppad, int num, bool onlytoplevel)
TGo4Script(TGo4MainWindow *mainwin)
Definition: TGo4Script.cxx:49
ViewPanelHandle FindViewPanel(const char *name)
Definition: TGo4Script.cxx:745
virtual void SetApplyToAllFlag(bool on)
virtual void SetHDF5Source(QString name)
TString GetViewPanelName(ViewPanelHandle panel)
Definition: TGo4Script.cxx:738
void StopAnalysis()
Definition: TGo4Script.cxx:413
void StepMbsRevServSource(const char *stepname, const char *sourcename, int timeout, int port=0, int start=0, int stop=0, int interval=0)
Definition: TGo4Script.cxx:582
TGo4Picture * GetPadOptions(ViewPanelHandle panel, Int_t padnumber=0)
Definition: TGo4Script.cxx:797
virtual int GetStoreSetup(QString &name)
void setClientPort(int)
void setClientIsServer(int kind)
virtual void GetStepControl(bool &process, bool &source, bool &store)
virtual void GetAutoSaveConfig(QString &filename, int &interval, int &compression, bool &enbaled, bool &overwrite)
virtual void SetMbsFileSource(const QString &TagFile)
static const char * DefaultPicTitle()
virtual void SetRandomSource()
Int_t IsAnalysisLaunched() const
QString getClientArgs()
void SetAccount(const char *username, const char *passwd)
void MakeFilesList(TObjArray *arr)
void MakeDabcList(TObjArray *arr)
void ConfigStep(const char *stepname, Bool_t enableprocess, Bool_t enablesource, Bool_t enablestore)
Definition: TGo4Script.cxx:500
virtual void SetFileSource()
void Message(const char *msg)
Definition: TGo4Script.cxx:294
virtual QString GetStepName()
virtual void SetFileStore(QString name, bool overwrite, int bufsize, int splitlevel, int compression, int autosave=0)
virtual const char * GetServerName() const
Definition: TGo4DabcProxy.h:36
void HotStart(const char *filename)
Definition: TGo4Script.cxx:301
void SetMainWindowGeometry(int qtversion, const char *val)
Definition: TGo4Script.cxx:704
virtual Bool_t NamesListReceived()
const char * GetFileName() const
TGo4QSettings * go4sett
TGo4ViewPanel * GetActivePanel()
Definition: TGo4MdiArea.cpp:62
void WaitAnalysis(Int_t delay_sec)
Definition: TGo4Script.cxx:361
virtual void SetStepControl(bool process, bool source, bool store)
Int_t GetPortNumber() const
void StepMbsTransportSource(const char *stepname, const char *sourcename, int timeout, int start=0, int stop=0, int interval=0)
Definition: TGo4Script.cxx:552
virtual void SetSourceWidgets(const QString &name, int timeout)
virtual void GetBackStore(int &bufsize, int &splitlevel)
static void ProduceScript(const char *filename, TGo4MainWindow *main)
Definition: TGo4Script.cxx:869
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)
virtual void GetUserSource(int &port, QString &expr)
void RefreshNamesList(int tmout=10)
Definition: TGo4Script.cxx:426
void SetSuperimpose(ViewPanelHandle panel, Bool_t on=kTRUE)
Definition: TGo4Script.cxx:807
TGo4AnalysisProxy * FindAnalysis(const char *itemname=0)
void AnalysisAutoSave(const char *filename, Int_t interval, Int_t compression, Bool_t enabled, Bool_t overwrite)
Definition: TGo4Script.cxx:472
void DoPostProcessing()
Definition: TGo4Script.cxx:137
const char * GetFilter() const
TGo4ObjectManager * OM()
void setClientExec(const QString &)
static void ProduceLoadLibs(std::ostream &fs)
Bool_t StartScriptExecution(const char *fname)
Definition: TGo4Script.cxx:67
TGo4Slot * BrowserTopSlot()
virtual void SetPadSuperImpose(TPad *pad, bool on)
void DisconnectAnalysisSlot(bool interactive=true)
void AddServerProxy(TGo4ServerProxy *serv, const char *slotname, const char *info)
virtual const char * GetServerName() const
const char * GetUserPass() const
void SetMainWindowState(int qtversion, const char *val)
Definition: TGo4Script.cxx:698
const char * GetBaseName() const
TGo4ConfigStep * FindStepConfig(QString name)
bool getClientDefaultPass()
Bool_t IsWaitSomething()
Definition: TGo4Script.cxx:132
void * ViewPanelHandle
void setClientNode(const QString &)
Bool_t fErrorFlag
Definition: TGo4Script.h:226
void StartAnalysis()
Definition: TGo4Script.cxx:400
virtual int GetSourceSetup(QString &name, int &timeout, int &start, int &stop, int &interval, int &port, int &nretry)
void StepHDF5Source(const char *stepname, const char *sourcename, int timeout)
Definition: TGo4Script.cxx:647
TGo4ViewPanel * DisplayBrowserItem(const char *itemname, TGo4ViewPanel *panel, TPad *pad, bool activate, int updatelevel, const char *drawopt)
void AnalysisConfigName(const char *filename)
Definition: TGo4Script.cxx:483
static TGo4AbstractInterface * Instance()
TGo4AnalysisConfiguration * FindAnalysisConfiguration()
virtual const char * GetServerName() const
virtual void SetPanelName(const char *newname)
virtual ~TGo4Script()
Definition: TGo4Script.cxx:62
TGo4ConfigStep * GetStepGUI(const char *stepname)
Definition: TGo4Script.cxx:490
virtual void SetAnalysisConfigFile(QString filename)
TGo4ViewPanel * MakeNewPanel(int div=0)
Bool_t CanConfigureAnalysis()
Definition: TGo4Script.cxx:438
const char * LastTypedPassword() const
void StepBackStore(const char *stepname, const char *storename, int bufsize, int splitlevel)
Definition: TGo4Script.cxx:671
TGo4AnalysisWindow * FindAnalysisWindow()
virtual TPad * GetActivePad()
virtual void SetUserStore(QString name)
virtual void ProcessPictureRedraw(const char *picitemname, TPad *pad, TGo4Picture *pic)
void Wait(double tm_sec)
Definition: TGo4Script.cxx:284
Int_t MonitoringPeriod() const
const char * GetDrawnItemName(ViewPanelHandle panel, int cnt=0)
Definition: TGo4Script.cxx:830
virtual void SetMbsEventServerSource()
virtual TCanvas * GetCanvas()
void setClientDefaultPass(bool)
virtual void SetMbsPort(int port)
Bool_t BrowserItemName(TGo4Slot *itemslot, TString &res)
void StepMbsRetryCnt(const char *stepname, int cnt)
Definition: TGo4Script.cxx:626
Int_t fiWaitCounter
Definition: TGo4Script.h:223
void StepFileStore(const char *stepname, const char *storename, bool overwrite, int bufsize, int splitlevel, int compression, int autosaveperiod=10000)
Definition: TGo4Script.cxx:658
QString getClientNode()
Bool_t SetViewPanelName(ViewPanelHandle panel, const char *newname)
Definition: TGo4Script.cxx:750
virtual void SetFreezedTitle(const QString &title)
void StepMbsEventServerSource(const char *stepname, const char *sourcename, int timeout, int start=0, int stop=0, int interval=0)
Definition: TGo4Script.cxx:567
void StepMbsStreamSource(const char *stepname, const char *sourcename, int timeout, int start=0, int stop=0, int interval=0)
Definition: TGo4Script.cxx:537
Bool_t next(Bool_t goesinto=kTRUE)
Definition: TGo4Iter.cxx:44
string msg
Definition: go4init.py:11