Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TSessionViewer.cxx
Go to the documentation of this file.
1// @(#)root/sessionviewer:$Id$
2// Author: Marek Biskup, Jakub Madejczyk, Bertrand Bellenot 10/08/2005
3
4/*************************************************************************
5 * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12
13/** \class TSessionViewer
14 \ingroup sessionviewer
15
16Widget used to manage PROOF or local sessions, PROOF connections,
17queries construction and results handling.
18
19*/
20
21
22#include "TApplication.h"
23#include "TROOT.h"
24#include "THashList.h"
25#include "TClass.h"
26#include "TSystem.h"
27#include "TGFileDialog.h"
28#include "TBrowser.h"
29#include "TGButton.h"
30#include "TGLayout.h"
31#include "TGListTree.h"
32#include "TGCanvas.h"
33#include "TGLabel.h"
34#include "TGTextEntry.h"
35#include "TGNumberEntry.h"
36#include "TGTableLayout.h"
37#include "TGListBox.h"
38#include "TGSplitter.h"
39#include "TGProgressBar.h"
40#include "TGListView.h"
41#include "TGMsgBox.h"
42#include "TGMenu.h"
43#include "TGStatusBar.h"
44#include "TGIcon.h"
45#include "TChain.h"
46#include "TDSet.h"
47#include "TFileInfo.h"
48#include "TObjString.h"
49#include "TProof.h"
50#include "TRandom.h"
51#include "TSessionViewer.h"
52#include "TSessionLogView.h"
53#include "TQueryResult.h"
54#include "TGTextView.h"
55#include "TGToolBar.h"
56#include "TGTab.h"
57#include "TRootEmbeddedCanvas.h"
58#include "TCanvas.h"
59#include "TGMimeTypes.h"
60#include "TInterpreter.h"
61#include "TContextMenu.h"
62#include "TG3DLine.h"
63#include "TSessionDialogs.h"
64#include "TEnv.h"
65#include "TH2.h"
66#include "TVirtualTreePlayer.h"
67#include "TSelector.h"
68#include "TFileCollection.h"
69#include "TVirtualX.h"
70#include "snprintf.h"
71#ifdef WIN32
72#include "TWin32SplashThread.h"
73#endif
74
75#include <cstdlib>
76
78
79const char *kConfigFile = ".proofgui.conf";
80
89
90const char *xpm_names[] = {
91 "monitor01.xpm",
92 "monitor02.xpm",
93 "monitor03.xpm",
94 "monitor04.xpm",
95 0
96};
97
98const char *conftypes[] = {
99 "Config files", "*.conf",
100 "All files", "*.*",
101 0, 0
102};
103
104const char *pkgtypes[] = {
105 "Package files", "*.par",
106 "All files", "*.*",
107 0, 0
108};
109
110const char *macrotypes[] = {
111 "C files", "*.[C|c]*",
112 "All files", "*",
113 0, 0
114};
115
116
117const char *kFeedbackHistos[] = {
118 "PROOF_PacketsHist",
119 "PROOF_EventsHist",
120 "PROOF_NodeHist",
121 "PROOF_LatencyHist",
122 "PROOF_ProcTimeHist",
123 "PROOF_CpuTimeHist",
124 0
125};
126
127const char* const kSession_RedirectFile = ".templog";
128const char* const kSession_RedirectCmd = ".tempcmd";
129
130// Menu command id's
136
141
149
155
161
164
165const char *xpm_toolbar[] = {
166 "fileopen.xpm",
167 "filesaveas.xpm",
168 "",
169 "connect.xpm",
170 "disconnect.xpm",
171 "",
172 "query_new.xpm",
173 "query_submit.xpm",
174 "",
175 "about.xpm",
176 "",
177 "quit.xpm",
178 0
179};
180
182 { "", "Open Config File", kFALSE, kFileLoadConfig, 0 },
183 { "", "Save Config File", kFALSE, kFileSaveConfig, 0 },
184 { "", 0, 0, -1, 0 },
185 { "", "Connect", kFALSE, kSessionConnect, 0 },
186 { "", "Disconnect", kFALSE, kSessionDisconnect, 0 },
187 { "", 0, 0, -1, 0 },
188 { "", "New Query", kFALSE, kQueryNew, 0 },
189 { "", "Submit Query", kFALSE, kQuerySubmit, 0 },
190 { "", 0, 0, -1, 0 },
191 { "", "About Root", kFALSE, kHelpAbout, 0 },
192 { "", 0, 0, -1, 0 },
193 { "", "Exit Root", kFALSE, kFileQuit, 0 },
194 { 0, 0, 0, 0, 0 }
195};
196
197
198////////////////////////////////////////////////////////////////////////////////
199// Server Frame
200
201////////////////////////////////////////////////////////////////////////////////
202/// Constructor.
203
205 TGCompositeFrame(p, w, h), fFrmNewServer(0), fTxtName(0), fTxtAddress(0),
206 fNumPort(0), fLogLevel(0), fTxtConfig(0), fTxtUsrName(0), fSync(0),
207 fViewer(0), fBtnAdd(0), fBtnConnect(0)
208{
209}
210
211////////////////////////////////////////////////////////////////////////////////
212/// Destructor.
213
215{
216 Cleanup();
217}
218
219////////////////////////////////////////////////////////////////////////////////
220/// Build server configuration frame.
221
223{
225
227
228 fViewer = gui;
229 fFrmNewServer = new TGGroupFrame(this, "New Session");
231
233
235
236 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Session Name:"),
237 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
239 (const char *)0, 1), new TGLayoutHints());
241 fTxtName->Associate(this);
242 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Server name:"),
243 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
245 (const char *)0, 2), new TGLayoutHints());
247 fTxtAddress->Associate(this);
248 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Port (default: 1093):"),
249 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
253 fNumPort->Associate(this);
254 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Configuration File:"),
255 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
257 (const char *)0, 4), new TGLayoutHints());
259 fTxtConfig->Associate(this);
260 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Log Level:"),
261 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
262
267 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
268 fLogLevel->Associate(this);
269
270 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "User Name:"),
271 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
273 (const char *)0, 6), new TGLayoutHints());
275 fTxtUsrName->Associate(this);
276
277 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Process mode :"),
279 3, 3, 3, 3));
281 "&Synchronous"), new TGLayoutHints(kLHintsLeft | kLHintsBottom |
282 kLHintsExpandX, 3, 3, 3, 3));
283 fSync->SetToolTipText("Default Process Mode");
285
286 AddFrame(fBtnAdd = new TGTextButton(this, " Save "),
287 new TGLayoutHints(kLHintsTop | kLHintsCenterX, 5, 5, 15, 5));
288 fBtnAdd->SetToolTipText("Add server to the list");
289 fBtnAdd->Connect("Clicked()", "TSessionServerFrame", this,
290 "OnBtnAddClicked()");
291 AddFrame(fBtnConnect = new TGTextButton(this, " Connect "),
292 new TGLayoutHints(kLHintsTop | kLHintsCenterX, 5, 5, 15, 5));
293 fBtnConnect->Connect("Clicked()", "TSessionServerFrame", this,
294 "OnBtnConnectClicked()");
295 fBtnConnect->SetToolTipText("Connect to the selected server");
296
297 fTxtConfig->Connect("DoubleClicked()", "TSessionServerFrame", this,
298 "OnConfigFileClicked()");
299
300 fTxtName->Connect("TextChanged(char*)", "TSessionServerFrame", this,
301 "SettingsChanged()");
302 fTxtAddress->Connect("TextChanged(char*)", "TSessionServerFrame", this,
303 "SettingsChanged()");
304 fTxtConfig->Connect("TextChanged(char*)", "TSessionServerFrame", this,
305 "SettingsChanged()");
306 fTxtUsrName->Connect("TextChanged(char*)", "TSessionServerFrame", this,
307 "SettingsChanged()");
308 fSync->Connect("Clicked()", "TSessionServerFrame", this,
309 "SettingsChanged()");
310 fLogLevel->Connect("ValueChanged(Long_t)", "TSessionServerFrame", this,
311 "SettingsChanged()");
312 fLogLevel->Connect("ValueSet(Long_t)", "TSessionServerFrame", this,
313 "SettingsChanged()");
314 fNumPort->Connect("ValueChanged(Long_t)", "TSessionServerFrame", this,
315 "SettingsChanged()");
316 fNumPort->Connect("ValueSet(Long_t)", "TSessionServerFrame", this,
317 "SettingsChanged()");
318
319}
320
321////////////////////////////////////////////////////////////////////////////////
322/// Settings have changed, update GUI accordingly.
323
325{
326 TGTextEntry *sender = dynamic_cast<TGTextEntry*>((TQObject*)gTQSender);
327 Bool_t issync = (fSync->GetState() == kButtonDown);
328 if ((fViewer->GetActDesc()->fLocal) ||
329 (strcmp(fViewer->GetActDesc()->GetName(), fTxtName->GetText())) ||
330 (strcmp(fViewer->GetActDesc()->fAddress.Data(), fTxtAddress->GetText())) ||
331 (strcmp(fViewer->GetActDesc()->fConfigFile.Data(), fTxtConfig->GetText())) ||
332 (strcmp(fViewer->GetActDesc()->fUserName.Data(), fTxtUsrName->GetText())) ||
335 (fViewer->GetActDesc()->fSync != issync)) {
338 }
339 else {
342 }
343 if (sender) {
344 sender->SetFocus();
345 }
346}
347
348
349////////////////////////////////////////////////////////////////////////////////
350/// Handle expose event in server frame.
351
353{
354 //fTxtName->SelectAll();
355 //fTxtName->SetFocus();
356 return kTRUE;
357}
358
359////////////////////////////////////////////////////////////////////////////////
360/// Browse configuration files.
361
363{
364 // do nothing if connection in progress
365 if (fViewer->IsBusy())
366 return;
367 TGFileInfo fi;
370 if (!fi.fFilename) return;
372}
373
374////////////////////////////////////////////////////////////////////////////////
375/// Delete selected session configuration (remove it from the list).
376
378{
379 // do nothing if connection in progress
380 if (fViewer->IsBusy())
381 return;
383 TIter next(fViewer->GetSessions());
385
386 if (desc->fLocal) {
387 Int_t retval;
388 new TGMsgBox(fClient->GetRoot(), this, "Error Deleting Session",
389 "Deleting Local Sessions is not allowed !",
390 kMBIconExclamation,kMBOk,&retval);
391 return;
392 }
393 // ask for confirmation
394 TString m;
395 m.Form("Are you sure to delete the server \"%s\"",
396 desc->fName.Data());
398 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), 0,
400 // if confirmed, delete it
401 if (result == kMBOk) {
402 // remove the Proof session from gROOT list of Proofs
403 if (desc->fConnected && desc->fAttached && desc->fProof) {
404 desc->fProof->Detach("S");
405 }
406 // remove it from our sessions list
407 fViewer->GetSessions()->Remove((TObject *)desc);
408 // update configuration file
411
412 TObject *obj = fViewer->GetSessions()->Last();
414 fViewer->GetSessionItem(), (void *)obj);
415 if (item) {
422 fViewer->OnListTreeClicked(item, 1, 0, 0);
423 }
424 }
425 if (fViewer->IsAutoSave())
427}
428
429////////////////////////////////////////////////////////////////////////////////
430/// Connect to selected server.
431
433{
434 // do nothing if connection in progress
435 if (fViewer->IsBusy())
436 return;
437
440 }
441 else {
444 if (strlen(fTxtConfig->GetText()) > 1)
446 else
451 if (fViewer->IsAutoSave())
453 }
454 // set flag busy
455 fViewer->SetBusy();
456 // avoid input events in list tree while connecting
461 // set watch cursor to indicate connection in progress
463 gVirtualX->CreateCursor(kWatch));
464 gVirtualX->SetCursor(GetId(),gVirtualX->CreateCursor(kWatch));
465 // display connection progress bar in first part of status bar
467 // connect to proof startup message (to update progress bar)
468 TQObject::Connect("TProof", "StartupMessage(char *,Bool_t,Int_t,Int_t)",
469 "TSessionViewer", fViewer, "StartupMessage(char *,Bool_t,Int_t,Int_t)");
470 // collect and set-up configuration
471 TString address = fTxtAddress->GetText();
472 TString url;
473 if (address == "lite://") {
474 url = address;
475 }
476 else {
477 // collect and set-up configuration
478 url = fTxtUsrName->GetText();
479 url += "@"; url += address.Data();
480 if (fNumPort->GetIntNumber() > 0) {
481 url += ":";
482 url += fNumPort->GetIntNumber();
483 }
484 }
485
486 TProofDesc *desc;
488 if (!fViewer->GetActDesc()->fProofMgr ||
490 // hide connection progress bar from status bar
492 // release busy flag
494 // restore cursors and input
495 gVirtualX->SetCursor(GetId(), 0);
500 gVirtualX->SetCursor(fViewer->GetSessionHierarchy()->GetId(), 0);
501 return;
502 }
504 // check if the session already exist before to recreate it
505 TList *sessions = fViewer->GetActDesc()->fProofMgr->QuerySessions("");
506 if (sessions) {
507 TIter nextp(sessions);
508 // loop over existing Proof sessions
509 while ((desc = (TProofDesc *)nextp())) {
510 if ((desc->GetName() == fViewer->GetActDesc()->fTag) ||
511 (desc->GetTitle() == fViewer->GetActDesc()->fName)) {
514 fViewer->GetActDesc()->fTag = desc->GetName();
518
520 Int_t i = 0;
521 // browse list of feedback histos and check user's selected ones
522 while (kFeedbackHistos[i]) {
523 if (fViewer->GetCascadeMenu()->IsEntryChecked(41+i)) {
526 }
527 i++;
528 }
529 // connect feedback signal
530 fViewer->GetActDesc()->fProof->Connect("Feedback(TList *objs)",
531 "TSessionQueryFrame", fViewer->GetQueryFrame(),
532 "Feedback(TList *objs)");
533 gROOT->Time();
534 }
535 else {
536 // if feedback option not selected, clear Proof's feedback option
538 }
539
540 break;
541 }
542 }
543 }
544 if (fViewer->GetActDesc()->fProof == 0) {
545 if (fViewer->GetActDesc()->fProofMgr->IsValid()) {
548 desc = 0;
549 sessions = fViewer->GetActDesc()->fProofMgr->QuerySessions("");
550 if (sessions)
551 desc = (TProofDesc *)sessions->Last();
552 if (desc) {
554 fViewer->GetActDesc()->fTag = desc->GetName();
557 }
558 }
559 }
560 if (fViewer->GetActDesc()->fProof) {
565 if (fViewer->GetActDesc()->fLogLevel < 0)
567 if (fViewer->GetActDesc()->fProof->IsLite())
568 fViewer->GetActDesc()->fAddress = "lite://";
569 else
573 }
575
576 // check if connected and valid
577 if (fViewer->GetActDesc()->fProof &&
579 // set log level
581 // set query type (synch / asynch)
584 // set connected flag
586 // change list tree item picture to connected pixmap
589 if (item) {
591 // update viewer
592 fViewer->OnListTreeClicked(item, 1, 0, 0);
595 }
596 // connect to progress related signals
597 fViewer->GetActDesc()->fProof->Connect("Progress(Long64_t,Long64_t)",
598 "TSessionQueryFrame", fViewer->GetQueryFrame(),
599 "Progress(Long64_t,Long64_t)");
600 fViewer->GetActDesc()->fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
601 "TSessionQueryFrame", fViewer->GetQueryFrame(),
602 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
603 fViewer->GetActDesc()->fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)",
604 "TSessionQueryFrame", fViewer->GetQueryFrame(),
605 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
606 fViewer->GetActDesc()->fProof->Connect("StopProcess(Bool_t)",
607 "TSessionQueryFrame", fViewer->GetQueryFrame(),
608 "IndicateStop(Bool_t)");
610 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)",
611 "TSessionQueryFrame", fViewer->GetQueryFrame(),
612 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)");
613 // enable timer used for status bar icon's animation
615 // change status bar right icon to connected pixmap
616 fViewer->ChangeRightLogo("monitor01.xpm");
617 // do not animate yet
619 // connect to signal "query result ready"
620 fViewer->GetActDesc()->fProof->Connect("QueryResultReady(char *)",
621 "TSessionViewer", fViewer, "QueryResultReady(char *)");
622 // display connection information on status bar
623 TString msg;
624 msg.Form("PROOF Cluster %s ready", fViewer->GetActDesc()->fName.Data());
625 fViewer->GetStatusBar()->SetText(msg.Data(), 1);
629 // Enable previously uploaded packages if in auto-enable mode
631 TPackageDescription *package;
633 while ((package = (TPackageDescription *)next())) {
634 if (!package->fEnabled) {
635 if (fViewer->GetActDesc()->fProof->EnablePackage(package->fName) != 0)
636 Error("Submit", "Enable package failed");
637 else {
638 package->fEnabled = kTRUE;
640 }
641 }
642 }
643 }
644 }
645 // hide connection progress bar from status bar
647 // release busy flag
649 // restore cursors and input
650 gVirtualX->SetCursor(GetId(), 0);
655 gVirtualX->SetCursor(fViewer->GetSessionHierarchy()->GetId(), 0);
656}
657
658////////////////////////////////////////////////////////////////////////////////
659/// Reset server configuration fields.
660
662{
663 // do nothing if connection in progress
664 if (fViewer->IsBusy())
665 return;
673 fTxtName->SetText("");
674 fTxtAddress->SetText("");
675 fTxtConfig->SetText("");
676 fNumPort->SetIntNumber(1093);
678 fTxtUsrName->SetText("");
679}
680
681////////////////////////////////////////////////////////////////////////////////
682/// Add newly created session configuration in the list of sessions.
683
685{
686 Int_t retval;
687 Bool_t newSession = kTRUE;
688 TSessionDescription* desc = 0;
689 // do nothing if connection in progress
690 if (fViewer->IsBusy())
691 return;
692
693 if ((!fTxtName->GetBuffer()->GetTextLength()) ||
696 new TGMsgBox(fClient->GetRoot(), fViewer, "Error Adding Session",
697 "At least one required field is empty !",
698 kMBIconExclamation, kMBOk, &retval);
699 return;
700 }
702 if (obj)
703 desc = dynamic_cast<TSessionDescription*>(obj);
704 if (desc) {
705 new TGMsgBox(fClient->GetRoot(), fViewer, "Adding Session",
706 TString::Format("The session \"%s\" already exists ! Overwrite ?",
708 kMBCancel, &retval);
709 if (retval != kMBYes)
710 return;
711 newSession = kFALSE;
712 }
713 if (newSession) {
714 desc = new TSessionDescription();
715 desc->fName = fTxtName->GetText();
716 desc->fTag = "";
717 desc->fQueries = new TList();
718 desc->fPackages = new TList();
719 desc->fActQuery = 0;
720 desc->fProof = 0;
721 desc->fProofMgr = 0;
722 desc->fAutoEnable = kFALSE;
723 desc->fAddress = fTxtAddress->GetText();
724 desc->fPort = fNumPort->GetIntNumber();
725 desc->fConnected = kFALSE;
726 desc->fAttached = kFALSE;
727 desc->fLocal = kFALSE;
728 if (strlen(fTxtConfig->GetText()) > 1)
730 else
731 desc->fConfigFile = "";
733 desc->fUserName = fTxtUsrName->GetText();
734 desc->fSync = (fSync->GetState() == kButtonDown);
735 // add newly created session config to our session list
736 fViewer->GetSessions()->Add((TObject *)desc);
737 // save into configuration file
739 fViewer->GetSessionItem(), desc->fName.Data(),
741 fViewer->GetSessionHierarchy()->SetToolTipItem(item, "Proof Session");
742 item->SetUserData(desc);
750 fViewer->OnListTreeClicked(item, 1, 0, 0);
751 }
752 else {
756 if (strlen(fTxtConfig->GetText()) > 1)
762 item2->SetUserData(fViewer->GetActDesc());
764 1, 0, 0);
765 }
768 if (fViewer->IsAutoSave())
770}
771
772////////////////////////////////////////////////////////////////////////////////
773/// Update fields with values from session description desc.
774
776{
777 if (desc->fLocal) {
778 fTxtName->SetText("");
779 fTxtAddress->SetText("");
780 fNumPort->SetIntNumber(1093);
781 fTxtConfig->SetText("");
782 fTxtUsrName->SetText("");
784 return;
785 }
786
787 fTxtName->SetText(desc->fName);
791
792 if (desc->fConfigFile.Length() > 1) {
794 }
795 else {
796 fTxtConfig->SetText("");
797 }
799}
800
801////////////////////////////////////////////////////////////////////////////////
802/// Process messages for session server frame.
803/// Used to navigate between text entry fields.
804
806{
807 switch (GET_MSG(msg)) {
808 case kC_TEXTENTRY:
809 switch (GET_SUBMSG(msg)) {
810 case kTE_ENTER:
811 case kTE_TAB:
812 switch (parm1) {
813 case 1: // session name
816 break;
817 case 2: // server address
820 break;
821 case 3: // port number
824 break;
825 case 4: // configuration file
828 break;
829 case 5: // log level
832 break;
833 case 6: // user name
836 break;
837 }
838 break;
839
840 default:
841 break;
842 }
843 break;
844
845 default:
846 break;
847 }
848 return kTRUE;
849}
850
851////////////////////////////////////////////////////////////////////////////////
852// Session Frame
853
854////////////////////////////////////////////////////////////////////////////////
855/// Constructor.
856
858 TGCompositeFrame(p, w, h), fTab(0), fFA(0), fFB(0), fFC(0), fFD(0), fFE(0),
859 fCommandTxt(0), fCommandBuf(0), fInfoTextView(0), fClearCheck(0),
860 fBtnShowLog(0), fBtnNewQuery(0), fBtnGetQueries(0), fLBPackages(0),
861 fBtnAdd(0), fBtnRemove(0), fBtnUp(0), fBtnDown(0), fBtnShow(0),
862 fBtnShowEnabled(0), fChkMulti(0), fChkEnable(0), fBtnUpload(0),
863 fBtnEnable(0), fBtnClear(0), fBtnDisable(0), fDSetView(0), fDataSetTree(0),
864 fBtnUploadDSet(0), fBtnRemoveDSet(0), fBtnVerifyDSet(0), fBtnRefresh(0),
865 fTxtParallel(0), fLogLevel(0), fApplyLogLevel(0), fApplyParallel(0),
866 fViewer(0)
867{
868 for (int i=0;i<19;++i) fInfoLine[i] = 0;
869}
870
871////////////////////////////////////////////////////////////////////////////////
872/// Destructor.
873
875{
876 Cleanup();
877}
878
879////////////////////////////////////////////////////////////////////////////////
880/// Build session frame.
881
883{
886 fViewer = gui;
887 Int_t i,j;
888
889 // main session tab
890 fTab = new TGTab(this, 200, 200);
892 kLHintsExpandY, 2, 2, 2, 2));
893
894 // add "Status" tab element
895 TGCompositeFrame *tf = fTab->AddTab("Status");
896 fFA = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
899
900 // add first session information line
901 fInfoLine[0] = new TGLabel(fFA, " ");
903 kLHintsExpandX, 5, 5, 15, 5));
904
905 TGCompositeFrame* frmInfos = new TGHorizontalFrame(fFA, 350, 100);
906 frmInfos->SetLayoutManager(new TGTableLayout(frmInfos, 9, 2));
907
908 // add session information lines
909 j = 0;
910 for (i=0;i<17;i+=2) {
911 fInfoLine[i+1] = new TGLabel(frmInfos, " ");
912 frmInfos->AddFrame(fInfoLine[i+1], new TGTableLayoutHints(0, 1, j, j+1,
913 kLHintsLeft | kLHintsCenterY, 5, 5, 2, 2));
914 fInfoLine[i+2] = new TGLabel(frmInfos, " ");
915 frmInfos->AddFrame(fInfoLine[i+2], new TGTableLayoutHints(1, 2, j, j+1,
916 kLHintsLeft | kLHintsCenterY, 5, 5, 2, 2));
917 j++;
918 }
920 kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5));
921
922 // add "new query" and "get queries" buttons
923 TGCompositeFrame* frmBut1 = new TGHorizontalFrame(fFA, 350, 100);
924 frmBut1->SetCleanup(kDeepCleanup);
925 frmBut1->AddFrame(fBtnNewQuery = new TGTextButton(frmBut1, "New Query..."),
926 new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5));
927 fBtnNewQuery->SetToolTipText("Open New Query Dialog");
928 frmBut1->AddFrame(fBtnGetQueries = new TGTextButton(frmBut1, " Get Queries "),
929 new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5));
930 fBtnGetQueries->SetToolTipText("Get List of Queries from the server");
931 fBtnShowLog = new TGTextButton(frmBut1, "Show log...");
932 fBtnShowLog->SetToolTipText("Show Session log (opens log window)");
934 kLHintsExpandX, 5, 5, 5, 5));
937
938 // add "Commands" tab element
939 tf = fTab->AddTab("Commands");
940 fFC = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
943
944 // add command line label and text entry
945 TGCompositeFrame* frmCmd = new TGHorizontalFrame(fFC, 350, 100);
946 frmCmd->SetCleanup(kDeepCleanup);
947 frmCmd->AddFrame(new TGLabel(frmCmd, "Command Line :"),
948 new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 5, 5, 15, 5));
949 fCommandBuf = new TGTextBuffer(120);
950 frmCmd->AddFrame(fCommandTxt = new TGTextEntry(frmCmd,
952 kLHintsExpandX, 5, 5, 15, 5));
953 fFC->AddFrame(frmCmd, new TGLayoutHints(kLHintsExpandX, 5, 5, 10, 5));
954 // connect command line text entry to "return pressed" signal
955 fCommandTxt->Connect("ReturnPressed()", "TSessionFrame", this,
956 "OnCommandLine()");
957
958 // check box for option "clear view"
959 fClearCheck = new TGCheckButton(fFC, "Clear view after each command");
961 10, 5, 5, 5));
963 // add text view for redirected output
964 fFC->AddFrame(new TGLabel(fFC, "Output :"),
965 new TGLayoutHints(kLHintsLeft | kLHintsTop, 10, 5, 5, 5));
966 fInfoTextView = new TGTextView(fFC, 330, 150, "", kSunkenFrame |
969 kLHintsTop | kLHintsExpandX | kLHintsExpandY, 10, 10, 5, 5));
970
971 // add "Packages" tab element
972 tf = fTab->AddTab("Packages");
973 fFB = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
976
977 // new frame containing packages listbox and control buttons
978 TGCompositeFrame* frmcanvas = new TGHorizontalFrame(fFB, 350, 100);
979
980 // packages listbox
981 fLBPackages = new TGListBox(frmcanvas);
982 fLBPackages->Resize(80,150);
985 kLHintsExpandY, 5, 5, 5, 5));
986 // control buttons frame
987 TGCompositeFrame* frmBut2 = new TGVerticalFrame(frmcanvas, 150, 100);
988
989 fChkMulti = new TGCheckButton(frmBut2, "Multiple Selection");
990 fChkMulti->SetToolTipText("Enable multiple selection in the package list");
991 frmBut2->AddFrame(fChkMulti, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
992
993 fBtnAdd = new TGTextButton(frmBut2, " Add... ");
994 fBtnAdd->SetToolTipText("Add a package to the list");
996 kLHintsExpandX, 5, 5, 5, 5));
997 fBtnRemove = new TGTextButton(frmBut2, "Remove");
998 fBtnRemove->SetToolTipText("Remove package from the list");
1000 kLHintsExpandX, 5, 5, 5, 5));
1001 fBtnUp = new TGTextButton(frmBut2, "Move Up");
1002 fBtnUp->SetToolTipText("Move package one step upward in the list");
1004 kLHintsExpandX, 5, 5, 5, 5));
1005 fBtnDown = new TGTextButton(frmBut2, "Move Down");
1006 fBtnDown->SetToolTipText("Move package one step downward in the list");
1008 kLHintsExpandX, 5, 5, 5, 5));
1009 frmcanvas->AddFrame(frmBut2, new TGLayoutHints(kLHintsLeft | kLHintsCenterY |
1011 fFB->AddFrame(frmcanvas, new TGLayoutHints(kLHintsLeft | kLHintsTop |
1013
1014 TGCompositeFrame* frmLeg = new TGHorizontalFrame(fFB, 300, 100);
1015 frmLeg->SetCleanup(kDeepCleanup);
1016 TGPicture *pic1 = (TGPicture *)fClient->GetPicture("package.xpm");
1017 TGIcon *icn1 = new TGIcon(frmLeg, pic1, pic1->GetWidth(), pic1->GetHeight());
1018 frmLeg->AddFrame(icn1, new TGLayoutHints(kLHintsLeft | kLHintsTop,
1019 5, 5, 0, 5));
1020 frmLeg->AddFrame(new TGLabel(frmLeg, ": Local"),
1021 new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 10, 0, 5));
1022
1023 TGPicture *pic2 = (TGPicture *)fClient->GetPicture("package_delete.xpm");
1024 TGIcon *icn2 = new TGIcon(frmLeg, pic2, pic2->GetWidth(), pic2->GetHeight());
1025 frmLeg->AddFrame(icn2, new TGLayoutHints(kLHintsLeft | kLHintsTop,
1026 5, 5, 0, 5));
1027 frmLeg->AddFrame(new TGLabel(frmLeg, ": Uploaded"),
1028 new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 10, 0, 5));
1029
1030 TGPicture *pic3 = (TGPicture *)fClient->GetPicture("package_add.xpm");
1031 TGIcon *icn3 = new TGIcon(frmLeg, pic3, pic3->GetWidth(), pic3->GetHeight());
1032 frmLeg->AddFrame(icn3, new TGLayoutHints(kLHintsLeft | kLHintsTop,
1033 5, 5, 0, 5));
1034 frmLeg->AddFrame(new TGLabel(frmLeg, ": Enabled"),
1035 new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 10, 0, 5));
1037 kLHintsExpandX, 0, 0, 0, 0));
1038
1039 TGCompositeFrame* frmBtn = new TGHorizontalFrame(fFB, 300, 100);
1040 frmBtn->SetCleanup(kDeepCleanup);
1041 frmBtn->AddFrame(fBtnUpload = new TGTextButton(frmBtn,
1042 " Upload "), new TGLayoutHints(kLHintsLeft | kLHintsExpandX |
1043 kLHintsCenterY, 5, 5, 5, 5));
1044 fBtnUpload->SetToolTipText("Upload selected package(s) to the server");
1045 frmBtn->AddFrame(fBtnEnable = new TGTextButton(frmBtn,
1046 " Enable "), new TGLayoutHints(kLHintsLeft | kLHintsExpandX |
1047 kLHintsCenterY, 5, 5, 5, 5));
1048 fBtnEnable->SetToolTipText("Enable selected package(s) on the server");
1049 frmBtn->AddFrame(fBtnDisable = new TGTextButton(frmBtn,
1050 " Disable "), new TGLayoutHints(kLHintsLeft | kLHintsExpandX |
1051 kLHintsCenterY, 5, 5, 5, 5));
1052 fBtnDisable->SetToolTipText("Disable selected package(s) on the server");
1053 frmBtn->AddFrame(fBtnClear = new TGTextButton(frmBtn,
1054 " Clear "), new TGLayoutHints(kLHintsLeft | kLHintsExpandX |
1055 kLHintsCenterY, 5, 5, 5, 5));
1056 fBtnClear->SetToolTipText("Clear all packages on the server");
1057 fFB->AddFrame(frmBtn, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
1058
1060
1061 TGCompositeFrame* frmBtn3 = new TGHorizontalFrame(fFB, 300, 100);
1062 frmBtn3->SetCleanup(kDeepCleanup);
1063 fBtnShow = new TGTextButton(frmBtn3, "Show packages");
1064 fBtnShow->SetToolTipText("Show (list) available packages on the server");
1066 kLHintsExpandX, 5, 5, 5, 5));
1067 fBtnShowEnabled = new TGTextButton(frmBtn3, "Show Enabled");
1068 fBtnShowEnabled->SetToolTipText("Show (list) enabled packages on the server");
1070 kLHintsExpandX, 5, 5, 5, 5));
1071 fFB->AddFrame(frmBtn3, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
1072
1073 fChkEnable = new TGCheckButton(fFB, "Enable at session startup");
1074 fChkEnable->SetToolTipText("Enable packages on the server at startup time");
1075 fFB->AddFrame(fChkEnable, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
1076
1077 // add "DataSets" tab element
1078 tf = fTab->AddTab("DataSets");
1079 fFE = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
1082
1083 // new frame containing datasets treeview and control buttons
1084 TGCompositeFrame* frmdataset = new TGHorizontalFrame(fFE, 350, 100);
1085
1086 // datasets list tree
1087 fDSetView = new TGCanvas(frmdataset, 200, 200, kSunkenFrame | kDoubleBorder);
1089 5, 5, 5, 5));
1091 fDataSetTree->AddItem(0, "DataSets");
1092
1093 // control buttons frame
1094 TGCompositeFrame* frmBut3 = new TGVerticalFrame(frmdataset, 150, 100);
1095
1096 fBtnUploadDSet = new TGTextButton(frmBut3, " Upload... ");
1097 fBtnUploadDSet->SetToolTipText("Upload a dataset to the cluster");
1099 kLHintsExpandX, 5, 5, 5, 5));
1100 fBtnRemoveDSet = new TGTextButton(frmBut3, "Remove");
1101 fBtnRemoveDSet->SetToolTipText("Remove dataset from the cluster");
1103 kLHintsExpandX, 5, 5, 5, 5));
1104 fBtnVerifyDSet = new TGTextButton(frmBut3, "Verify");
1105 fBtnVerifyDSet->SetToolTipText("Verify dataset on the cluster");
1107 kLHintsExpandX, 5, 5, 5, 5));
1108 fBtnRefresh = new TGTextButton(frmBut3, "Refresh List");
1109 fBtnRefresh->SetToolTipText("Refresh List of DataSet/Files present on the cluster");
1111 kLHintsExpandX, 5, 5, 15, 5));
1112
1113 frmdataset->AddFrame(frmBut3, new TGLayoutHints(kLHintsLeft | kLHintsCenterY |
1114 kLHintsExpandY, 5, 5, 5, 0));
1115
1116 fFE->AddFrame(frmdataset, new TGLayoutHints(kLHintsLeft | kLHintsTop |
1118
1119 // add "Options" tab element
1120 tf = fTab->AddTab("Options");
1121 fFD = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
1124
1125 // add Log Level label and text entry
1126 TGCompositeFrame* frmLog = new TGHorizontalFrame(fFD, 310, 100, kFixedWidth);
1127 frmLog->SetCleanup(kDeepCleanup);
1128 frmLog->AddFrame(fApplyLogLevel = new TGTextButton(frmLog,
1129 " Apply "), new TGLayoutHints(kLHintsRight |
1130 kLHintsCenterY, 10, 5, 5, 5));
1131 fApplyLogLevel->SetToolTipText("Apply currently selected log level");
1135 kLHintsCenterY, 5, 5, 5, 5));
1136 frmLog->AddFrame(new TGLabel(frmLog, "Log Level :"),
1137 new TGLayoutHints(kLHintsRight | kLHintsCenterY, 5, 5, 5, 5));
1138 fFD->AddFrame(frmLog, new TGLayoutHints(kLHintsLeft, 5, 5, 15, 5));
1139
1140 // add Parallel Nodes label and text entry
1141 TGCompositeFrame* frmPar = new TGHorizontalFrame(fFD, 310, 100, kFixedWidth);
1142 frmPar->SetCleanup(kDeepCleanup);
1143 frmPar->AddFrame(fApplyParallel = new TGTextButton(frmPar,
1144 " Apply "), new TGLayoutHints(kLHintsRight |
1145 kLHintsCenterY, 10, 5, 5, 5));
1146 fApplyParallel->SetToolTipText("Apply currently selected parallel nodes");
1147 fTxtParallel = new TGTextEntry(frmPar);
1149 fTxtParallel->SetText("99999");
1152 kLHintsCenterY, 5, 5, 5, 5));
1153 frmPar->AddFrame(new TGLabel(frmPar, "Set Parallel Nodes :"),
1154 new TGLayoutHints(kLHintsRight | kLHintsCenterY, 5, 5, 5, 5));
1155 fFD->AddFrame(frmPar, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
1156
1157 // connect button actions to functions
1158 fBtnShowLog->Connect("Clicked()", "TSessionFrame", this,
1159 "OnBtnShowLogClicked()");
1160 fBtnNewQuery->Connect("Clicked()", "TSessionFrame", this,
1161 "OnBtnNewQueryClicked()");
1162 fBtnGetQueries->Connect("Clicked()", "TSessionFrame", this,
1163 "OnBtnGetQueriesClicked()");
1164
1165 fChkEnable->Connect("Toggled(Bool_t)", "TSessionFrame", this,
1166 "OnStartupEnable(Bool_t)");
1167 fChkMulti->Connect("Toggled(Bool_t)", "TSessionFrame", this,
1168 "OnMultipleSelection(Bool_t)");
1169 fBtnAdd->Connect("Clicked()", "TSessionFrame", this,
1170 "OnBtnAddClicked()");
1171 fBtnRemove->Connect("Clicked()", "TSessionFrame", this,
1172 "OnBtnRemoveClicked()");
1173 fBtnUp->Connect("Clicked()", "TSessionFrame", this,
1174 "OnBtnUpClicked()");
1175 fBtnDown->Connect("Clicked()", "TSessionFrame", this,
1176 "OnBtnDownClicked()");
1177 fApplyLogLevel->Connect("Clicked()", "TSessionFrame", this,
1178 "OnApplyLogLevel()");
1179 fApplyParallel->Connect("Clicked()", "TSessionFrame", this,
1180 "OnApplyParallel()");
1181 fBtnUpload->Connect("Clicked()", "TSessionFrame", this,
1182 "OnUploadPackages()");
1183 fBtnEnable->Connect("Clicked()", "TSessionFrame", this,
1184 "OnEnablePackages()");
1185 fBtnDisable->Connect("Clicked()", "TSessionFrame", this,
1186 "OnDisablePackages()");
1187 fBtnClear->Connect("Clicked()", "TSessionFrame", this,
1188 "OnClearPackages()");
1189 fBtnShowEnabled->Connect("Clicked()", "TSessionViewer", fViewer,
1190 "ShowEnabledPackages()");
1191 fBtnShow->Connect("Clicked()", "TSessionViewer", fViewer,
1192 "ShowPackages()");
1193
1194 fBtnUploadDSet->Connect("Clicked()", "TSessionFrame", this,
1195 "OnBtnUploadDSet()");
1196 fBtnRemoveDSet->Connect("Clicked()", "TSessionFrame", this,
1197 "OnBtnRemoveDSet()");
1198 fBtnVerifyDSet->Connect("Clicked()", "TSessionFrame", this,
1199 "OnBtnVerifyDSet()");
1200 fBtnRefresh->Connect("Clicked()", "TSessionFrame", this,
1201 "UpdateListOfDataSets()");
1202}
1203
1204////////////////////////////////////////////////////////////////////////////////
1205/// Display information on current session.
1206
1208{
1209 TString buf;
1210
1211 // if local session
1212 if (fViewer->GetActDesc()->fLocal) {
1213 buf.Form("*** Local Session on %s ***", gSystem->HostName());
1214 fInfoLine[0]->SetText(buf.Data());
1215 UserGroup_t *userGroup = gSystem->GetUserInfo();
1216 fInfoLine[1]->SetText("User :");
1217 if (userGroup) buf.Form("%s", userGroup->fRealName.Data());
1218 fInfoLine[2]->SetText(buf.Data());
1219 fInfoLine[3]->SetText("Working directory :");
1220 buf.Form("%s", gSystem->WorkingDirectory());
1221 fInfoLine[4]->SetText(buf.Data());
1222 fInfoLine[5]->SetText(" ");
1223 fInfoLine[6]->SetText(" ");
1224 fInfoLine[7]->SetText(" ");
1225 fInfoLine[8]->SetText(" ");
1226 fInfoLine[9]->SetText(" ");
1227 fInfoLine[10]->SetText(" ");
1228 fInfoLine[11]->SetText(" ");
1229 fInfoLine[12]->SetText(" ");
1230 fInfoLine[13]->SetText(" ");
1231 fInfoLine[14]->SetText(" ");
1232 fInfoLine[15]->SetText(" ");
1233 fInfoLine[16]->SetText(" ");
1234 fInfoLine[17]->SetText(" ");
1235 fInfoLine[18]->SetText(" ");
1236 if (userGroup) delete userGroup;
1237 Layout();
1239 return;
1240 }
1241 // return if not a valid Proof session
1242 if (!fViewer->GetActDesc()->fConnected ||
1244 !fViewer->GetActDesc()->fProof ||
1246 return;
1247
1248 if (!fViewer->GetActDesc()->fProof->IsMaster()) {
1250 buf.Form("*** Connected to %s (parallel mode, %d workers) ***",
1253 else
1254 buf.Form("*** Connected to %s (sequential mode) ***",
1256 fInfoLine[0]->SetText(buf.Data());
1257 fInfoLine[1]->SetText("Port number : ");
1258 buf.Form("%d", fViewer->GetActDesc()->fProof->GetPort());
1259 fInfoLine[2]->SetText(buf.Data());
1260 fInfoLine[3]->SetText("User : ");
1261 buf.Form("%s", fViewer->GetActDesc()->fProof->GetUser());
1262 fInfoLine[4]->SetText(buf.Data());
1263 fInfoLine[5]->SetText("Client protocol version : ");
1265 fInfoLine[6]->SetText(buf.Data());
1266 fInfoLine[7]->SetText("Remote protocol version : ");
1268 fInfoLine[8]->SetText(buf.Data());
1269 fInfoLine[9]->SetText("Log level : ");
1270 buf.Form("%d", fViewer->GetActDesc()->fProof->GetLogLevel());
1271 fInfoLine[10]->SetText(buf.Data());
1272 fInfoLine[11]->SetText("Session unique tag : ");
1273 buf.Form("%s", fViewer->GetActDesc()->fProof->IsValid() ?
1274 fViewer->GetActDesc()->fProof->GetSessionTag() : " ");
1275 fInfoLine[12]->SetText(buf.Data());
1276 fInfoLine[13]->SetText("Total MB's processed :");
1277 buf.Form("%.2f", float(fViewer->GetActDesc()->fProof->GetBytesRead())/(1024*1024));
1278 fInfoLine[14]->SetText(buf.Data());
1279 fInfoLine[15]->SetText("Total real time used (s) :");
1280 buf.Form("%.3f", fViewer->GetActDesc()->fProof->GetRealTime());
1281 fInfoLine[16]->SetText(buf.Data());
1282 fInfoLine[17]->SetText("Total CPU time used (s) :");
1283 buf.Form("%.3f", fViewer->GetActDesc()->fProof->GetCpuTime());
1284 fInfoLine[18]->SetText(buf.Data());
1285 }
1286 else {
1288 buf.Form("*** Master server %s (parallel mode, %d workers) ***",
1291 else
1292 buf.Form("*** Master server %s (sequential mode) ***",
1294 fInfoLine[0]->SetText(buf.Data());
1295 fInfoLine[1]->SetText("Port number : ");
1296 buf.Form("%d", fViewer->GetActDesc()->fProof->GetPort());
1297 fInfoLine[2]->SetText(buf.Data());
1298 fInfoLine[3]->SetText("User : ");
1299 buf.Form("%s", fViewer->GetActDesc()->fProof->GetUser());
1300 fInfoLine[4]->SetText(buf.Data());
1301 fInfoLine[5]->SetText("Protocol version : ");
1303 fInfoLine[6]->SetText(buf.Data());
1304 fInfoLine[7]->SetText("Image name : ");
1305 buf.Form("%s",fViewer->GetActDesc()->fProof->GetImage());
1306 fInfoLine[8]->SetText(buf.Data());
1307 fInfoLine[9]->SetText("Config directory : ");
1308 buf.Form("%s", fViewer->GetActDesc()->fProof->GetConfDir());
1309 fInfoLine[10]->SetText(buf.Data());
1310 fInfoLine[11]->SetText("Config file : ");
1311 buf.Form("%s", fViewer->GetActDesc()->fProof->GetConfFile());
1312 fInfoLine[12]->SetText(buf.Data());
1313 fInfoLine[13]->SetText("Total MB's processed :");
1314 buf.Form("%.2f", float(fViewer->GetActDesc()->fProof->GetBytesRead())/(1024*1024));
1315 fInfoLine[14]->SetText(buf.Data());
1316 fInfoLine[15]->SetText("Total real time used (s) :");
1317 buf.Form("%.3f", fViewer->GetActDesc()->fProof->GetRealTime());
1318 fInfoLine[16]->SetText(buf.Data());
1319 fInfoLine[17]->SetText("Total CPU time used (s) :");
1320 buf.Form("%.3f", fViewer->GetActDesc()->fProof->GetCpuTime());
1321 fInfoLine[18]->SetText(buf.Data());
1322 }
1323 Layout();
1325}
1326
1327////////////////////////////////////////////////////////////////////////////////
1328/// Open Upload Dataset dialog.
1329
1331{
1332 if (fViewer->IsBusy())
1333 return;
1334 if (fViewer->GetActDesc()->fLocal) return;
1335 new TUploadDataSetDlg(fViewer, 450, 360);
1336}
1337
1338////////////////////////////////////////////////////////////////////////////////
1339/// Update list of dataset present on the cluster.
1340
1342{
1343 TObjString *dsetname;
1344 TFileInfo *dsetfilename;
1345 // cleanup the list
1350
1351 const TGPicture *dseticon = fClient->GetPicture("rootdb_t.xpm");
1352 // ask for the list of datasets
1353
1354 // TODO: is now returning a TMap; viewer has to be adapted
1355 TList *dsetlist = 0; //fViewer->GetActDesc()->fProof->GetDataSets();
1356 // coverity[dead_error_condition]: to be changed for TMap usage
1357 if (dsetlist) {
1358 TGListTreeItem *dsetitem;
1360 TIter nextdset(dsetlist);
1361 while ((dsetname = (TObjString *)nextdset())) {
1363 // add the dataset in the tree
1365 dsetname->GetName(), dsetname);
1366 // ask for the list of files in the dataset
1367 TList *dsetfilelist = fViewer->GetActDesc()->fProof->GetDataSet(
1368 dsetname->GetName())->GetList();
1369 if(dsetfilelist) {
1370 TIter nextdsetfile(dsetfilelist);
1371 while ((dsetfilename = (TFileInfo *)nextdsetfile())) {
1372 if (! fDataSetTree->FindItemByObj(dsetitem, dsetfilename)) {
1373 // if not already in, add the file name in the tree
1374 fDataSetTree->AddItem(dsetitem,
1375 dsetfilename->GetFirstUrl()->GetUrl(),
1376 dsetfilename, dseticon, dseticon);
1377 }
1378 }
1379 // open the dataset item in order to show the files
1380 fDataSetTree->OpenItem(dsetitem);
1381 }
1382 }
1383 }
1384 }
1385 }
1386 // refresh list tree
1388}
1389
1390////////////////////////////////////////////////////////////////////////////////
1391/// Remove dataset from the list and from the cluster.
1392
1394{
1395 TGListTreeItem *item;
1396 TObjString *obj = 0;
1397 if (fViewer->GetActDesc()->fLocal) return;
1398
1399 item = fDataSetTree->GetSelected();
1400 if (!item) return;
1401 if (item->GetParent() == 0) return;
1402 if (item->GetParent() == fDataSetTree->GetFirstItem()) {
1403 // Dataset itself
1404 obj = (TObjString *)item->GetUserData();
1405 }
1406 else if (item->GetParent()->GetParent() == fDataSetTree->GetFirstItem()) {
1407 // One file of the dataset
1408 obj = (TObjString *)item->GetParent()->GetUserData();
1409 }
1410
1411 // if valid Proof session, set parallel slaves
1412 if (obj && fViewer->GetActDesc()->fProof &&
1416 }
1417}
1418
1419////////////////////////////////////////////////////////////////////////////////
1420/// Verify that the files in the selected dataset are present on the cluster.
1421
1423{
1424 TGListTreeItem *item;
1425 TObjString *obj = 0;
1426 if (fViewer->GetActDesc()->fLocal) return;
1427
1428 item = fDataSetTree->GetSelected();
1429 if (!item) return;
1430 if (item->GetParent() == 0) return;
1431 if (item->GetParent() == fDataSetTree->GetFirstItem()) {
1432 // Dataset itself
1433 obj = (TObjString *)item->GetUserData();
1434 }
1435 else if (item->GetParent()->GetParent() == fDataSetTree->GetFirstItem()) {
1436 // One file of the dataset
1437 obj = (TObjString *)item->GetParent()->GetUserData();
1438 }
1439
1440 // if valid Proof session, set parallel slaves
1441 if (obj && fViewer->GetActDesc()->fProof &&
1444 }
1445}
1446
1447////////////////////////////////////////////////////////////////////////////////
1448/// Apply selected log level on current session.
1449
1451{
1452 // if local session, do nothing
1453 if (fViewer->GetActDesc()->fLocal) return;
1454 // if valid Proof session, set log level
1455 if (fViewer->GetActDesc()->fProof &&
1459 }
1461}
1462
1463////////////////////////////////////////////////////////////////////////////////
1464/// Apply selected number of workers on current Proof session.
1465
1467{
1468 // if local session, do nothing
1469 if (fViewer->GetActDesc()->fLocal) return;
1470 // if valid Proof session, set parallel slaves
1471 if (fViewer->GetActDesc()->fProof &&
1473 Int_t nodes = atoi(fTxtParallel->GetText());
1475 }
1477}
1478
1479////////////////////////////////////////////////////////////////////////////////
1480/// Handle multiple selection check button.
1481
1483{
1485}
1486
1487////////////////////////////////////////////////////////////////////////////////
1488/// Handle multiple selection check button.
1489
1491{
1492 if (fViewer->GetActDesc())
1494}
1495
1496////////////////////////////////////////////////////////////////////////////////
1497/// Update list of packages.
1498
1500{
1501 TPackageDescription *package;
1502 const TGPicture *pict;
1505 while ((package = (TPackageDescription *)next())) {
1506 if (package->fEnabled)
1507 pict = fClient->GetPicture("package_add.xpm");
1508 else if (package->fUploaded)
1509 pict = fClient->GetPicture("package_delete.xpm");
1510 else
1511 pict = fClient->GetPicture("package.xpm");
1513 package->fId, package->fPathName, pict);
1515 }
1518}
1519
1520////////////////////////////////////////////////////////////////////////////////
1521/// Upload selected package(s) to the current session.
1522
1524{
1525 // if local session, do nothing
1526 if (fViewer->GetActDesc()->fLocal) return;
1527 // if valid Proof session, upload packages
1528 if (fViewer->GetActDesc()->fProof &&
1530 TObject *obj;
1531 TList selected;
1532 fLBPackages->GetSelectedEntries(&selected);
1533 TIter next(&selected);
1534 while ((obj = next())) {
1535 TString name = obj->GetTitle();
1536 if (fViewer->GetActDesc()->fProof->UploadPackage(name.Data()) != 0)
1537 Error("Submit", "Upload package failed");
1538 else {
1540 if (!o) continue;
1541 TPackageDescription *package =
1542 dynamic_cast<TPackageDescription *>(o);
1543 if (package) {
1544 package->fUploaded = kTRUE;
1545 ((TGIconLBEntry *)obj)->SetPicture(
1546 fClient->GetPicture("package_delete.xpm"));
1547 }
1548 }
1549 }
1551 }
1554}
1555
1556////////////////////////////////////////////////////////////////////////////////
1557/// Enable selected package(s) in the current session.
1558
1560{
1561 // if local session, do nothing
1562 if (fViewer->GetActDesc()->fLocal) return;
1563 // if valid Proof session, enable packages
1564 if (fViewer->GetActDesc()->fProof &&
1566 TObject *obj;
1567 TList selected;
1569 fLBPackages->GetSelectedEntries(&selected);
1570 TIter next(&selected);
1571 while ((obj = next())) {
1572 TString name = obj->GetTitle();
1574 if (!o) continue;
1575 TPackageDescription *package =
1576 dynamic_cast<TPackageDescription *>(o);
1577 if (package) {
1578 if (!package->fUploaded) {
1579 if (fViewer->GetActDesc()->fProof->UploadPackage(name.Data()) != 0)
1580 Error("Submit", "Upload package failed");
1581 else {
1582 package->fUploaded = kTRUE;
1583 ((TGIconLBEntry *)obj)->SetPicture(
1584 fClient->GetPicture("package_delete.xpm"));
1585 }
1586 }
1587 }
1588 if (fViewer->GetActDesc()->fProof->EnablePackage(name) != 0)
1589 Error("Submit", "Enable package failed");
1590 else {
1591 package->fEnabled = kTRUE;
1592 ((TGIconLBEntry *)obj)->SetPicture(fClient->GetPicture("package_add.xpm"));
1593 }
1594 }
1597 }
1600}
1601
1602////////////////////////////////////////////////////////////////////////////////
1603/// Disable selected package(s) in the current session.
1604
1606{
1607 // if local session, do nothing
1608 if (fViewer->GetActDesc()->fLocal) return;
1609 // if valid Proof session, disable (clear) packages
1610 if (fViewer->GetActDesc()->fProof &&
1612 TObject *obj;
1613 TList selected;
1614 fLBPackages->GetSelectedEntries(&selected);
1615 TIter next(&selected);
1616 while ((obj = next())) {
1617 TString name = obj->GetTitle();
1618 if (fViewer->GetActDesc()->fProof->ClearPackage(name) != 0)
1619 Error("Submit", "Clear package failed");
1620 else {
1622 if (!o) continue;
1623 TPackageDescription *package =
1624 dynamic_cast<TPackageDescription *>(o);
1625 if (package) {
1626 package->fEnabled = kFALSE;
1627 package->fUploaded = kFALSE;
1628 ((TGIconLBEntry *)obj)->SetPicture(fClient->GetPicture("package.xpm"));
1629 }
1630 }
1631 }
1633 }
1636}
1637
1638////////////////////////////////////////////////////////////////////////////////
1639/// Clear (disable) all packages in the current session.
1640
1642{
1643 TPackageDescription *package;
1644 // if local session, do nothing
1645 if (fViewer->GetActDesc()->fLocal) return;
1646 // if valid Proof session, clear packages
1647 if (fViewer->GetActDesc()->fProof &&
1649 if (fViewer->GetActDesc()->fProof->ClearPackages() != 0)
1650 Error("Submit", "Clear packages failed");
1651 else {
1653 while ((package = (TPackageDescription *)next())) {
1654 package->fEnabled = kFALSE;
1655 }
1656 }
1657 }
1660}
1661
1662////////////////////////////////////////////////////////////////////////////////
1663/// Open file dialog and add selected package file to the list.
1664
1666{
1667 if (fViewer->IsBusy())
1668 return;
1669 TGFileInfo fi;
1670 TPackageDescription *package;
1671 TGIconLBEntry *entry;
1672 fi.fFileTypes = pkgtypes;
1674 if (fi.fMultipleSelection && fi.fFileNamesList) {
1675 TObjString *el;
1676 TIter next(fi.fFileNamesList);
1677 while ((el = (TObjString *) next())) {
1678 package = new TPackageDescription;
1679 package->fName = gSystem->BaseName(gSystem->UnixPathName(el->GetString()));
1680 package->fPathName = gSystem->UnixPathName(el->GetString());
1681 package->fId = fViewer->GetActDesc()->fPackages->GetEntries();
1682 package->fUploaded = kFALSE;
1683 package->fEnabled = kFALSE;
1684 fViewer->GetActDesc()->fPackages->Add((TObject *)package);
1685 entry = new TGIconLBEntry(fLBPackages->GetContainer(),
1686 package->fId, package->fPathName,
1687 fClient->GetPicture("package.xpm"));
1688 fLBPackages->AddEntry(entry, new TGLayoutHints(kLHintsExpandX | kLHintsTop));
1689 }
1690 }
1691 else if (fi.fFilename) {
1692 package = new TPackageDescription;
1694 package->fPathName = gSystem->UnixPathName(fi.fFilename);
1695 package->fId = fViewer->GetActDesc()->fPackages->GetEntries();
1696 package->fUploaded = kFALSE;
1697 package->fEnabled = kFALSE;
1698 fViewer->GetActDesc()->fPackages->Add((TObject *)package);
1699 entry = new TGIconLBEntry(fLBPackages->GetContainer(),
1700 package->fId, package->fPathName,
1701 fClient->GetPicture("package.xpm"));
1702 fLBPackages->AddEntry(entry, new TGLayoutHints(kLHintsExpandX | kLHintsTop));
1703 }
1706}
1707
1708////////////////////////////////////////////////////////////////////////////////
1709/// Remove selected package from the list.
1710
1712{
1713 TPackageDescription *package;
1714 const TGPicture *pict;
1715 Int_t pos = fLBPackages->GetSelected();
1718 fViewer->GetActDesc()->fPackages->At(pos));
1719 Int_t id = 0;
1721 while ((package = (TPackageDescription *)next())) {
1722 package->fId = id;
1723 id++;
1724 if (package->fEnabled)
1725 pict = fClient->GetPicture("package_add.xpm");
1726 else if (package->fUploaded)
1727 pict = fClient->GetPicture("package_delete.xpm");
1728 else
1729 pict = fClient->GetPicture("package.xpm");
1731 package->fId, package->fPathName, pict);
1733 }
1736}
1737
1738////////////////////////////////////////////////////////////////////////////////
1739/// Move selected package entry one position up in the list.
1740
1742{
1743 TPackageDescription *package;
1744 const TGPicture *pict;
1745 Int_t pos = fLBPackages->GetSelected();
1746 if (pos <= 0) return;
1748 package = (TPackageDescription *)fViewer->GetActDesc()->fPackages->At(pos);
1749 fViewer->GetActDesc()->fPackages->Remove(
1750 fViewer->GetActDesc()->fPackages->At(pos));
1751 package->fId -= 1;
1752 fViewer->GetActDesc()->fPackages->AddAt(package, package->fId);
1753 Int_t id = 0;
1754 TIter next(fViewer->GetActDesc()->fPackages);
1755 while ((package = (TPackageDescription *)next())) {
1756 package->fId = id;
1757 id++;
1758 if (package->fEnabled)
1759 pict = fClient->GetPicture("package_add.xpm");
1760 else if (package->fUploaded)
1761 pict = fClient->GetPicture("package_delete.xpm");
1762 else
1763 pict = fClient->GetPicture("package.xpm");
1764 TGIconLBEntry *entry = new TGIconLBEntry(fLBPackages->GetContainer(),
1765 package->fId, package->fPathName, pict);
1766 fLBPackages->AddEntry(entry, new TGLayoutHints(kLHintsExpandX | kLHintsTop));
1767 }
1768 fLBPackages->Select(pos-1);
1769 fLBPackages->Layout();
1770 fClient->NeedRedraw(fLBPackages->GetContainer());
1771}
1772
1773////////////////////////////////////////////////////////////////////////////////
1774/// Move selected package entry one position down in the list.
1775
1777{
1778 TPackageDescription *package;
1779 const TGPicture *pict;
1780 Int_t pos = fLBPackages->GetSelected();
1781 if (pos == -1 || pos == fViewer->GetActDesc()->fPackages->GetEntries()-1)
1782 return;
1784 package = (TPackageDescription *)fViewer->GetActDesc()->fPackages->At(pos);
1785 fViewer->GetActDesc()->fPackages->Remove(
1786 fViewer->GetActDesc()->fPackages->At(pos));
1787 package->fId += 1;
1788 fViewer->GetActDesc()->fPackages->AddAt(package, package->fId);
1789 Int_t id = 0;
1790 TIter next(fViewer->GetActDesc()->fPackages);
1791 while ((package = (TPackageDescription *)next())) {
1792 package->fId = id;
1793 id++;
1794 if (package->fEnabled)
1795 pict = fClient->GetPicture("package_add.xpm");
1796 else if (package->fUploaded)
1797 pict = fClient->GetPicture("package_delete.xpm");
1798 else
1799 pict = fClient->GetPicture("package.xpm");
1800 TGIconLBEntry *entry = new TGIconLBEntry(fLBPackages->GetContainer(),
1801 package->fId, package->fPathName, pict);
1802 fLBPackages->AddEntry(entry, new TGLayoutHints(kLHintsExpandX | kLHintsTop));
1803 }
1804 fLBPackages->Select(pos+1);
1805 fLBPackages->Layout();
1806 fClient->NeedRedraw(fLBPackages->GetContainer());
1807}
1808
1809////////////////////////////////////////////////////////////////////////////////
1810/// Disconnect from current Proof session.
1811
1813{
1814 // if local session, do nothing
1815 if (fViewer->GetActDesc()->fLocal) return;
1816 // if valid Proof session, disconnect (close)
1817 if (fViewer->GetActDesc()->fAttached &&
1821 }
1822 // reset connected flag
1824 fViewer->GetActDesc()->fProof = 0;
1825 // disable animation timer
1827 // change list tree item picture to disconnected pixmap
1830 if (item) {
1833 }
1834 // update viewer
1836 1, 0, 0);
1839 fViewer->GetStatusBar()->SetText("", 1);
1840}
1841
1842////////////////////////////////////////////////////////////////////////////////
1843/// Show session log.
1844
1846{
1847 fViewer->ShowLog(0);
1848}
1849
1850////////////////////////////////////////////////////////////////////////////////
1851/// Call "New Query" Dialog.
1852
1854{
1855 TNewQueryDlg *dlg = new TNewQueryDlg(fViewer, 350, 310);
1856 dlg->Popup();
1857}
1858
1859////////////////////////////////////////////////////////////////////////////////
1860/// Get list of queries from current Proof server and populate the list tree.
1861
1863{
1864 TList *lqueries = 0;
1865 TQueryResult *query = 0;
1866 TQueryDescription *newquery = 0, *lquery = 0;
1867 if (fViewer->GetActDesc()->fProof &&
1869 lqueries = fViewer->GetActDesc()->fProof->GetListOfQueries();
1870 }
1871 if (lqueries) {
1872 TIter nextp(lqueries);
1873 // loop over list of queries received from Proof server
1874 while ((query = (TQueryResult *)nextp())) {
1875 // create new query description
1876 newquery = new TQueryDescription();
1877 newquery->fReference = TString::Format("%s:%s", query->GetTitle(),
1878 query->GetName());
1879 // check in our tree if it is already there
1880 TGListTreeItem *item =
1883 // if already there, skip
1885 newquery->fReference.Data()))
1886 continue;
1887 // check also in our query description list
1888 Bool_t found = kFALSE;
1889 TIter nextp2(fViewer->GetActDesc()->fQueries);
1890 while ((lquery = (TQueryDescription *)nextp2())) {
1891 if (lquery->fReference.CompareTo(newquery->fReference) == 0) {
1892 found = kTRUE;
1893 break;
1894 }
1895 }
1896 if (found) continue;
1897 // build new query description with infos from Proof
1898 newquery->fStatus = query->IsFinalized() ?
1901 newquery->fSelectorString = query->GetSelecImp()->GetName();
1902 newquery->fQueryName = TString::Format("%s:%s", query->GetTitle(),
1903 query->GetName());
1904 newquery->fOptions = query->GetOptions();
1905 newquery->fEventList = "";
1906 newquery->fNbFiles = 0;
1907 newquery->fNoEntries = query->GetEntries();
1908 newquery->fFirstEntry = query->GetFirst();
1909 newquery->fResult = query;
1910 newquery->fChain = 0;
1911 fViewer->GetActDesc()->fQueries->Add((TObject *)newquery);
1913 newquery->fQueryName, fViewer->GetQueryConPict(),
1915 item2->SetUserData(newquery);
1916 if (query->GetInputList())
1917 fViewer->GetSessionHierarchy()->AddItem(item2, "InputList");
1918 if (query->GetOutputList())
1919 fViewer->GetSessionHierarchy()->AddItem(item2, "OutputList");
1920 }
1921 }
1922 // at the end, update list tree
1925}
1926
1927////////////////////////////////////////////////////////////////////////////////
1928/// Command line handling.
1929
1931{
1932 // get command string
1933 const char *cmd = fCommandTxt->GetText();
1934 char opt[2];
1935 // form temporary file path
1936 TString pathtmp = TString::Format("%s/%s", gSystem->TempDirectory(),
1938 // if check box "clear view" is checked, open temp file in write mode
1939 // (overwrite), in append mode otherwise.
1940 if (fClearCheck->IsOn())
1941 snprintf(opt, 2, "w");
1942 else
1943 snprintf(opt, 2, "a");
1944
1945 // if valid Proof session, pass the command to Proof
1946 if (fViewer->GetActDesc()->fProof &&
1948 // redirect stdout/stderr to temp file
1949 if (gSystem->RedirectOutput(pathtmp.Data(), opt) != 0) {
1950 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
1951 return;
1952 }
1953 // execute command line
1954 fViewer->GetActDesc()->fProof->Exec(cmd);
1955 // restore back stdout/stderr
1956 if (gSystem->RedirectOutput(0) != 0) {
1957 Error("ShowStatus", "stdout/stderr retore failed; skipping");
1958 return;
1959 }
1960 // if check box "clear view" is checked, clear text view
1961 if (fClearCheck->IsOn())
1963 // load (display) temp file in text view
1964 fInfoTextView->LoadFile(pathtmp.Data());
1965 // set focus to "command line" text entry
1967 }
1968 else {
1969 // if no Proof session, or Proof session not valid,
1970 // lets execute command line by TApplication
1971
1972 // redirect stdout/stderr to temp file
1973 if (gSystem->RedirectOutput(pathtmp.Data(), opt) != 0) {
1974 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
1975 }
1976 // execute command line
1978 // restore back stdout/stderr
1979 if (gSystem->RedirectOutput(0) != 0) {
1980 Error("ShowStatus", "stdout/stderr retore failed; skipping");
1981 }
1982 // if check box "clear view" is checked, clear text view
1983 if (fClearCheck->IsOn())
1985 // load (display) temp file in text view
1986 fInfoTextView->LoadFile(pathtmp.Data());
1987 // set focus to "command line" text entry
1989 }
1990 // display bottom of text view
1992}
1993
1994////////////////////////////////////////////////////////////////////////////////
1995/// Switch widgets status/visibility for local/remote sessions.
1996
1998{
1999 if (local) {
2002 fTab->HideFrame(fTab->GetTabTab("Options"));
2003 fTab->HideFrame(fTab->GetTabTab("Packages"));
2004 fTab->HideFrame(fTab->GetTabTab("DataSets"));
2005 }
2006 else {
2009 fTab->ShowFrame(fTab->GetTabTab("Options"));
2010 fTab->ShowFrame(fTab->GetTabTab("Packages"));
2011 fTab->ShowFrame(fTab->GetTabTab("DataSets"));
2012 }
2013}
2014
2015////////////////////////////////////////////////////////////////////////////////
2016/// Shutdown current session.
2017
2019{
2020 // do nothing if connection in progress
2021 if (fViewer->IsBusy())
2022 return;
2023
2024 if (fViewer->GetActDesc()->fLocal) {
2025 Int_t retval;
2026 new TGMsgBox(fClient->GetRoot(), this, "Error Shutting down Session",
2027 "Shutting down Local Sessions is not allowed !",
2028 kMBIconExclamation,kMBOk,&retval);
2029 return;
2030 }
2031 if (!fViewer->GetActDesc()->fAttached ||
2032 !fViewer->GetActDesc()->fProof ||
2034 return;
2035 // ask for confirmation
2036 TString m;
2037 m.Form("Are you sure to shutdown the session \"%s\"",
2039 Int_t result;
2040 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), 0,
2041 kMBOk | kMBCancel, &result);
2042 // if confirmed, delete it
2043 if (result != kMBOk)
2044 return;
2045 // remove the Proof session from gROOT list of Proofs
2046 fViewer->GetActDesc()->fProof->Detach("S");
2047 // reset connected flag
2049 fViewer->GetActDesc()->fProof = 0;
2050 // disable animation timer
2052 // change list tree item picture to disconnected pixmap
2055 if (item) {
2058 }
2059 // update viewer
2061 1, 0, 0);
2064 fViewer->GetStatusBar()->SetText("", 1);
2065}
2066
2067//////////////////////////////////////////////////////////////////////////
2068// Edit Query Frame
2069//////////////////////////////////////////////////////////////////////////
2070
2071////////////////////////////////////////////////////////////////////////////////
2072/// Create a new Query dialog, used by the Session Viewer, to Edit a Query if
2073/// the editmode flag is set, or to create a new one if not set.
2074
2076 TGCompositeFrame(p, w, h, kVerticalFrame), fFrmMore(0), fBtnMore(0),
2077 fTxtQueryName(0), fTxtChain(0), fTxtSelector(0), fTxtOptions(0),
2078 fNumEntries(0), fNumFirstEntry(0), fTxtParFile(0), fTxtEventList(0),
2079 fViewer(0), fQuery(0), fChain(0)
2080{
2081}
2082
2083////////////////////////////////////////////////////////////////////////////////
2084/// Delete query dialog.
2085
2087{
2088 Cleanup();
2089}
2090
2091////////////////////////////////////////////////////////////////////////////////
2092/// Build the "new query" dialog.
2093
2095{
2096 TGButton *btnTmp;
2097 fViewer = gui;
2099 SetLayoutManager(new TGTableLayout(this, 6, 5));
2100
2101 // add "Query Name" label and text entry
2102 AddFrame(new TGLabel(this, "Query Name :"),
2103 new TGTableLayoutHints(0, 1, 0, 1, kLHintsCenterY, 5, 5, 4, 0));
2105 (const char *)0, 1), new TGTableLayoutHints(1, 2, 0, 1,
2106 kLHintsCenterY, 5, 5, 4, 0));
2107
2108 // add "TChain" label and text entry
2109 AddFrame(new TGLabel(this, "TChain :"),
2110 new TGTableLayoutHints(0, 1, 1, 2, kLHintsCenterY, 5, 5, 4, 0));
2111 AddFrame(fTxtChain = new TGTextEntry(this,
2112 (const char *)0, 2), new TGTableLayoutHints(1, 2, 1, 2,
2113 kLHintsCenterY, 5, 5, 4, 0));
2114 fTxtChain->SetToolTipText("Specify TChain or TDSet from memory or file");
2116 // add "Browse" button
2117 AddFrame(btnTmp = new TGTextButton(this, "Browse..."),
2118 new TGTableLayoutHints(2, 3, 1, 2, kLHintsCenterY, 5, 0, 4, 8));
2119 btnTmp->Connect("Clicked()", "TEditQueryFrame", this, "OnBrowseChain()");
2120
2121 // add "Selector" label and text entry
2122 AddFrame(new TGLabel(this, "Selector :"),
2123 new TGTableLayoutHints(0, 1, 2, 3, kLHintsCenterY, 5, 5, 0, 0));
2125 (const char *)0, 3), new TGTableLayoutHints(1, 2, 2, 3,
2126 kLHintsCenterY, 5, 5, 0, 0));
2127 // add "Browse" button
2128 AddFrame(btnTmp = new TGTextButton(this, "Browse..."),
2129 new TGTableLayoutHints(2, 3, 2, 3, kLHintsCenterY, 5, 0, 0, 8));
2130 btnTmp->Connect("Clicked()", "TEditQueryFrame", this, "OnBrowseSelector()");
2131
2132 // add "Less <<" ("More >>") button
2133 AddFrame(fBtnMore = new TGTextButton(this, " Less << "),
2134 new TGTableLayoutHints(2, 3, 4, 5, kLHintsCenterY, 5, 5, 4, 0));
2135 fBtnMore->Connect("Clicked()", "TEditQueryFrame", this, "OnNewQueryMore()");
2136
2137 // add (initially hidden) options frame
2138 fFrmMore = new TGCompositeFrame(this, 200, 200);
2140
2141 AddFrame(fFrmMore, new TGTableLayoutHints(0, 3, 5, 6,
2144
2145 // add "Options" label and text entry
2146 fFrmMore->AddFrame(new TGLabel(fFrmMore, "Options :"),
2147 new TGTableLayoutHints(0, 1, 0, 1, kLHintsCenterY, 5, 5, 0, 0));
2149 (const char *)0, 4), new TGTableLayoutHints(1, 2, 0, 1, 0, 17,
2150 0, 0, 8));
2151 //fTxtOptions->SetText("ASYN");
2152 fTxtOptions->SetText("");
2153
2154 // add "Nb Entries" label and number entry
2155 fFrmMore->AddFrame(new TGLabel(fFrmMore, "Nb Entries :"),
2156 new TGTableLayoutHints(0, 1, 1, 2, kLHintsCenterY, 5, 5, 0, 0));
2160 0, 17, 0, 0, 8));
2161 // coverity[negative_returns]: no problem with -1, the format is kNESInteger
2163 // add "First Entry" label and number entry
2164 fFrmMore->AddFrame(new TGLabel(fFrmMore, "First entry :"),
2165 new TGTableLayoutHints(0, 1, 2, 3, kLHintsCenterY, 5, 5, 0, 0));
2169 17, 0, 0, 8));
2170
2171 // add "Event list" label and text entry
2172 fFrmMore->AddFrame(new TGLabel(fFrmMore, "Event list :"),
2173 new TGTableLayoutHints(0, 1, 3, 4, kLHintsCenterY, 5, 5, 0, 0));
2175 (const char *)0, 6), new TGTableLayoutHints(1, 2, 3, 4, 0, 17,
2176 5, 0, 0));
2177 // add "Browse" button
2178 fFrmMore->AddFrame(btnTmp = new TGTextButton(fFrmMore, "Browse..."),
2179 new TGTableLayoutHints(2, 3, 3, 4, 0, 6, 0, 0, 8));
2180 btnTmp->Connect("Clicked()", "TEditQueryFrame", this, "OnBrowseEventList()");
2181
2182 fTxtQueryName->Associate(this);
2183 fTxtChain->Associate(this);
2184 fTxtSelector->Associate(this);
2185 fTxtOptions->Associate(this);
2186 fNumEntries->Associate(this);
2188 fTxtEventList->Associate(this);
2189
2190 fTxtQueryName->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2191 "SettingsChanged()");
2192 fTxtChain->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2193 "SettingsChanged()");
2194 fTxtSelector->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2195 "SettingsChanged()");
2196 fTxtOptions->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2197 "SettingsChanged()");
2198 fNumEntries->Connect("ValueChanged(Long_t)", "TEditQueryFrame", this,
2199 "SettingsChanged()");
2200 fNumFirstEntry->Connect("ValueChanged(Long_t)", "TEditQueryFrame", this,
2201 "SettingsChanged()");
2202 fTxtEventList->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2203 "SettingsChanged()");
2204}
2205
2206////////////////////////////////////////////////////////////////////////////////
2207/// Show/hide options frame and update button text accordingly.
2208
2210{
2211 if (IsVisible(fFrmMore)) {
2213 fBtnMore->SetText(" More >> ");
2214 }
2215 else {
2217 fBtnMore->SetText(" Less << ");
2218 }
2219}
2220
2221////////////////////////////////////////////////////////////////////////////////
2222/// Call new chain dialog.
2223
2225{
2226 TNewChainDlg *dlg = new TNewChainDlg(fClient->GetRoot(), this);
2227 dlg->Connect("OnElementSelected(TObject *)", "TEditQueryFrame",
2228 this, "OnElementSelected(TObject *)");
2229}
2230
2231////////////////////////////////////////////////////////////////////////////////
2232/// Handle OnElementSelected signal coming from new chain dialog.
2233
2235{
2236 if (obj) {
2237 fChain = obj;
2238 if (obj->IsA() == TChain::Class())
2240 else if (obj->IsA() == TDSet::Class())
2241 fTxtChain->SetText(((TDSet *)fChain)->GetObjName());
2242 }
2243}
2244
2245////////////////////////////////////////////////////////////////////////////////
2246/// Open file browser to choose selector macro.
2247
2249{
2250 TGFileInfo fi;
2252 new TGFileDialog(fClient->GetRoot(), this, kFDOpen, &fi);
2253 if (!fi.fFilename) return;
2255}
2256
2257////////////////////////////////////////////////////////////////////////////////
2258///Browse event list
2259
2261{
2262}
2263
2264////////////////////////////////////////////////////////////////////////////////
2265/// Save current settings in main session viewer.
2266
2268{
2269 // if we are in edition mode and query description is valid,
2270 // use it, otherwise create a new one
2271 TQueryDescription *newquery;
2272 if (fQuery)
2273 newquery = fQuery;
2274 else
2275 newquery = new TQueryDescription();
2276
2277 // update query description fields
2278 newquery->fSelectorString = fTxtSelector->GetText();
2279 if (fChain) {
2280 newquery->fTDSetString = fChain->GetName();
2281 newquery->fChain = fChain;
2282 }
2283 else {
2284 newquery->fTDSetString = "";
2285 newquery->fChain = 0;
2286 }
2287 newquery->fQueryName = fTxtQueryName->GetText();
2288 newquery->fOptions = fTxtOptions->GetText();
2289 newquery->fNoEntries = fNumEntries->GetIntNumber();
2291 newquery->fNbFiles = 0;
2292 newquery->fResult = 0;
2293
2294 if (newquery->fChain) {
2295 if (newquery->fChain->IsA() == TChain::Class())
2296 newquery->fNbFiles = ((TChain *)newquery->fChain)->GetListOfFiles()->GetEntriesFast();
2297 else if (newquery->fChain->IsA() == TDSet::Class())
2298 newquery->fNbFiles = ((TDSet *)newquery->fChain)->GetListOfElements()->GetSize();
2299 }
2300 // update user data with modified query description
2302 fViewer->GetSessionHierarchy()->RenameItem(item, newquery->fQueryName);
2303 item->SetUserData(newquery);
2304 // update list tree
2311 if (fViewer->GetActDesc()->fLocal ||
2315 fViewer->GetActDesc()->fProof->IsValid())) {
2316 fViewer->GetQueryFrame()->GetTab()->SetTab("Status");
2318 }
2319}
2320
2321////////////////////////////////////////////////////////////////////////////////
2322/// Settings have changed, update GUI accordingly.
2323
2325{
2326 if (fQuery) {
2327 if ((strcmp(fQuery->fSelectorString.Data(), fTxtSelector->GetText())) ||
2328 (strcmp(fQuery->fQueryName.Data(), fTxtQueryName->GetText())) ||
2329 (strcmp(fQuery->fOptions.Data(), fTxtOptions->GetText())) ||
2332 (fQuery->fChain != fChain)) {
2334 }
2335 else {
2337 }
2338 }
2339 else {
2340 if ((fTxtQueryName->GetText()) &&
2341 ((fTxtQueryName->GetText()) ||
2342 (fTxtChain->GetText())))
2344 else
2346 }
2347}
2348
2349////////////////////////////////////////////////////////////////////////////////
2350/// Update entry fields with query description values.
2351
2353{
2354 fChain = 0;
2355 fQuery = desc;
2356 fTxtChain->SetText("");
2357 if (desc->fChain) {
2358 fChain = desc->fChain;
2360 }
2367}
2368
2369////////////////////////////////////////////////////////////////////////////////
2370// Query Frame
2371
2372////////////////////////////////////////////////////////////////////////////////
2373/// Constructor
2374
2376 TGCompositeFrame(p, w, h), fBtnSubmit(0), fBtnFinalize(0), fBtnStop(0),
2377 fBtnAbort(0), fBtnShowLog(0), fBtnRetrieve(0), fBtnSave(0), fInfoTextView(0),
2378 fModified(0), fFiles(0), fFirst(0), fEntries(0), fPrevTotal(0),
2379 fPrevProcessed(0), fLabInfos(0), fLabStatus(0), fTotal(0), fRate(0),
2380 fStatus(kStopped), fTab(0), fFA(0), fFB(0), fFC(0), fFD(0), frmProg(0),
2381 fECanvas(0), fStatsCanvas(0), fViewer(0), fDesc(0)
2382{
2383}
2384
2385////////////////////////////////////////////////////////////////////////////////
2386/// Destructor.
2387
2389{
2390 Cleanup();
2391}
2392
2393////////////////////////////////////////////////////////////////////////////////
2394/// Build query information frame.
2395
2397{
2400 fFirst = fEntries = fPrevTotal = 0;
2401 fPrevProcessed = 0;
2402 fViewer = gui;
2403 fModified = kFALSE;
2404
2405 // main query tab
2406 fTab = new TGTab(this, 200, 200);
2408 kLHintsExpandY, 2, 2, 2, 2));
2409
2410 // add "Status" tab element
2411 TGCompositeFrame *tf = fTab->AddTab("Status");
2412 fFB = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
2415
2416 // new frame containing control buttons and feedback histos canvas
2417 TGCompositeFrame* frmcanvas = new TGHorizontalFrame(fFB, 350, 100);
2418 // control buttons frame
2419 TGCompositeFrame* frmBut2 = new TGVerticalFrame(frmcanvas, 150, 100);
2420 fBtnSubmit = new TGTextButton(frmBut2, " Submit ");
2421 fBtnSubmit->SetToolTipText("Submit (process) selected query");
2423 kLHintsExpandX, 5, 5, 5, 5));
2424 fBtnStop = new TGTextButton(frmBut2, "Stop");
2425 fBtnStop->SetToolTipText("Stop processing query");
2427 kLHintsExpandX, 5, 5, 5, 5));
2428 fBtnAbort = new TGTextButton(frmBut2, "Abort");
2429 fBtnAbort->SetToolTipText("Abort processing query");
2431 kLHintsExpandX, 5, 5, 5, 5));
2432 frmcanvas->AddFrame(frmBut2, new TGLayoutHints(kLHintsLeft | kLHintsCenterY |
2434 // feedback histos embedded canvas
2435 fECanvas = new TRootEmbeddedCanvas("fECanvas", frmcanvas, 400, 150);
2440 4, 4, 4, 4));
2441 fFB->AddFrame(frmcanvas, new TGLayoutHints(kLHintsLeft | kLHintsTop |
2443
2444 // progress infos label
2445 fLabInfos = new TGLabel(fFB, " ");
2446 fFB->AddFrame(fLabInfos, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
2447 // progress status label
2448 fLabStatus = new TGLabel(fFB, " ");
2449 fFB->AddFrame(fLabStatus, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
2450
2451 //progress bar
2454 frmProg->SetBarColor("green");
2455 fFB->AddFrame(frmProg, new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5));
2456 // total progress infos
2457 fFB->AddFrame(fTotal = new TGLabel(fFB,
2458 " Estimated time left : 0 sec (--- events of --- processed) "),
2459 new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
2460 // progress rate infos
2461 fFB->AddFrame(fRate = new TGLabel(fFB,
2462 " Processing Rate : -- events/sec "),
2463 new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
2464
2465 // add "Results" tab element
2466 tf = fTab->AddTab("Results");
2467 fFC = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
2470 // query result (header) information text view
2471 fInfoTextView = new TGTextView(fFC, 330, 185, "", kSunkenFrame |
2474 kLHintsExpandY | kLHintsExpandX, 5, 5, 10, 10));
2475
2476 // add "Retrieve", "Finalize" and "Show Log" buttons
2477 TGCompositeFrame* frmBut3 = new TGHorizontalFrame(fFC, 350, 100);
2478 fBtnRetrieve = new TGTextButton(frmBut3, "Retrieve");
2479 fBtnRetrieve->SetToolTipText("Retrieve query results");
2481 kLHintsExpandX, 5, 5, 10, 10));
2482 fBtnFinalize = new TGTextButton(frmBut3, "Finalize");
2483 fBtnFinalize->SetToolTipText("Finalize query");
2485 kLHintsExpandX, 5, 5, 10, 10));
2486 fBtnShowLog = new TGTextButton(frmBut3, "Show Log");
2487 fBtnShowLog->SetToolTipText("Show query log (open log window)");
2489 kLHintsExpandX, 5, 5, 10, 10));
2491
2492 // add "Results" tab element
2493 tf = fTab->AddTab("Edit Query");
2494 fFD = new TEditQueryFrame(tf, 100, 100);
2495 fFD->Build(fViewer);
2496 tf->AddFrame(fFD, new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 10, 0));
2497 TString btntxt;
2498 if (fViewer->GetActDesc()->fLocal ||
2499 (fViewer->GetActDesc()->fProof &&
2500 fViewer->GetActDesc()->fProof->IsValid())) {
2501 btntxt = " Submit ";
2502 }
2503 else {
2504 btntxt = " Apply changes ";
2505 }
2506 tf->AddFrame(fBtnSave = new TGTextButton(tf, btntxt),
2507 new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 5, 25, 5));
2508
2509 // connect button actions to functions
2510 fBtnSave->Connect("Clicked()", "TEditQueryFrame", fFD,
2511 "OnBtnSave()");
2512 fBtnSubmit->Connect("Clicked()", "TSessionQueryFrame", this,
2513 "OnBtnSubmit()");
2514 fBtnFinalize->Connect("Clicked()", "TSessionQueryFrame", this,
2515 "OnBtnFinalize()");
2516 fBtnStop->Connect("Clicked()", "TSessionQueryFrame", this,
2517 "OnBtnStop()");
2518 fBtnAbort->Connect("Clicked()", "TSessionQueryFrame", this,
2519 "OnBtnAbort()");
2520 fBtnShowLog->Connect("Clicked()", "TSessionQueryFrame", this,
2521 "OnBtnShowLog()");
2522 fBtnRetrieve->Connect("Clicked()", "TSessionQueryFrame", this,
2523 "OnBtnRetrieve()");
2524// fBtnSave->SetState(kButtonDisabled);
2525 Resize(350, 310);
2526}
2527
2528////////////////////////////////////////////////////////////////////////////////
2529/// Notify changes in query editor settings.
2530
2532{
2533 fModified = mod;
2534 if (fModified) {
2536 }
2537 else {
2539 }
2540 if (fViewer->GetActDesc()->fLocal ||
2541 (fViewer->GetActDesc()->fProof &&
2544}
2545
2546////////////////////////////////////////////////////////////////////////////////
2547/// Feedback function connected to Feedback signal.
2548/// Used to update feedback histograms.
2549
2551{
2552 // if no actual session, just return
2553 if (!fViewer->GetActDesc()->fAttached)
2554 return;
2555 if (!fViewer->GetActDesc()->fProof)
2556 return;
2557 if ((fViewer->GetActDesc()->fActQuery) &&
2562 return;
2563 TProof *sender = dynamic_cast<TProof*>((TQObject*)gTQSender);
2564 // if Proof sender match actual session one, update feedback histos
2565 if (sender && (sender == fViewer->GetActDesc()->fProof))
2566 UpdateHistos(objs);
2567}
2568
2569////////////////////////////////////////////////////////////////////////////////
2570/// Update feedback histograms.
2571
2573{
2575 TObject *o;
2576 Int_t pos = 1;
2577 Int_t i = 0;
2578 while (kFeedbackHistos[i]) {
2579 // check if user has selected this histogram in the option menu
2580 if (fViewer->GetCascadeMenu()->IsEntryChecked(41+i)) {
2581 if ( (o = objs->FindObject(kFeedbackHistos[i]))) {
2582 fStatsCanvas->cd(pos);
2584 if (TH1 *h = dynamic_cast<TH1*>(o)) {
2585 h->SetStats(0);
2586 h->SetBarWidth(0.75);
2587 h->SetBarOffset(0.125);
2588 h->SetFillColor(9);
2589 h->Draw("bar");
2590 pos++;
2591 }
2592 else if (TH2 *h2 = dynamic_cast<TH2*>(o)) {
2593 h2->Draw();
2594 pos++;
2595 }
2596 gPad->Modified();
2597 }
2598 }
2599 i++;
2600 }
2601 // update canvas
2602 fStatsCanvas->cd();
2605 if (save != 0) {
2606 save->cd();
2607 } else {
2608 gPad = 0;
2609 }
2610}
2611
2612////////////////////////////////////////////////////////////////////////////////
2613/// Update progress bar and status labels.
2614
2616{
2617 Long_t tt;
2618 UInt_t hh=0, mm=0, ss=0;
2619 TString stm;
2620 // if no actual session, just return
2621 if (!fViewer->GetActDesc()->fProof)
2622 return;
2623 // if Proof sender does't match actual session one, return
2624 TProof *sender = dynamic_cast<TProof*>((TQObject*)gTQSender);
2625 if (!sender || (sender != fViewer->GetActDesc()->fProof))
2626 return;
2627
2628 if ((fViewer->GetActDesc()->fActQuery) &&
2633 fTotal->SetText(" Estimated time left : 0 sec (0 events of 0 processed) ");
2634 fRate->SetText(" Processing Rate : 0.0f events/sec ");
2635 frmProg->Reset();
2636 fFB->Layout();
2637 return;
2638 }
2639
2640 if (total < 0)
2641 total = fPrevTotal;
2642 else
2643 fPrevTotal = total;
2644
2645 // if no change since last call, just return
2646 if (fPrevProcessed == processed)
2647 return;
2648 TString buf;
2649
2650 // Update information at first call
2651 if (fEntries != total) {
2652 buf.Form("PROOF cluster : \"%s\" - %d worker nodes",
2655 fLabInfos->SetText(buf);
2656
2657 fEntries = total;
2658 buf.Form(" %d files, %lld events, starting event %lld",
2660 fLabStatus->SetText(buf);
2661 }
2662
2663 // compute progress bar position and update
2664 Float_t pos = (Float_t)((Double_t)(processed * 100)/(Double_t)total);
2665 frmProg->SetPosition(pos);
2666 // if 100%, stop animation and set icon to "connected"
2667 if (pos >= 100.0) {
2669 fViewer->ChangeRightLogo("monitor01.xpm");
2670 }
2671
2672 // get current time
2673 if ((fViewer->GetActDesc()->fActQuery->fStatus ==
2680 Float_t eta = 0;
2681 if (processed)
2682 eta = ((Float_t)((Long64_t)tdiff)*total/Float_t(processed) -
2683 Long64_t(tdiff))/1000.;
2684
2685 tt = (Long_t)eta;
2686 if (tt > 0) {
2687 hh = (UInt_t)(tt / 3600);
2688 mm = (UInt_t)((tt % 3600) / 60);
2689 ss = (UInt_t)((tt % 3600) % 60);
2690 }
2691 if (hh)
2692 stm.Form("%d h %d min %d sec", hh, mm, ss);
2693 else if (mm)
2694 stm.Form("%d min %d sec", mm, ss);
2695 else
2696 stm.Form("%d sec", ss);
2697 if (processed == total) {
2698 // finished
2699 tt = (Long_t) Long64_t(tdiff)/1000;
2700 if (tt > 0) {
2701 hh = (UInt_t)(tt / 3600);
2702 mm = (UInt_t)((tt % 3600) / 60);
2703 ss = (UInt_t)((tt % 3600) % 60);
2704 }
2705 if (hh)
2706 stm.Form("%d h %d min %d sec", hh, mm, ss);
2707 else if (mm)
2708 stm.Form("%d min %d sec", mm, ss);
2709 else
2710 stm.Form("%d sec", ss);
2711 buf.Form(" Processed : %lld events in %s", total, stm.Data());
2712 fTotal->SetText(buf.Data());
2713 } else {
2714 // update status infos
2715 buf.Form(" Estimated time left : %s (%lld events of %lld processed) ",
2716 stm.Data(), processed, total);
2717 fTotal->SetText(buf.Data());
2718 }
2719 if (processed > 0 && (Long64_t)tdiff > 0) {
2720 buf.Form(" Processing Rate : %.1f events/sec ",
2721 (Float_t)processed/(Long64_t)tdiff*1000.);
2722 fRate->SetText(buf);
2723 }
2724 fPrevProcessed = processed;
2725
2726 fFB->Layout();
2727}
2728
2729////////////////////////////////////////////////////////////////////////////////
2730/// New version of Progress (just forward to the old version
2731/// for the time being).
2732
2734 Long64_t /*bytesread*/, Float_t /*initTime*/,
2735 Float_t /*procTime*/, Float_t /*evtrti*/,
2736 Float_t /*mbrti*/, Int_t /*actw*/,
2737 Int_t /*tses*/, Float_t /*eses*/)
2738{
2739 Progress(total, processed);
2740}
2741
2742////////////////////////////////////////////////////////////////////////////////
2743/// Update progress bar and status labels.
2744
2746{
2747 Long_t tt;
2748 UInt_t hh=0, mm=0, ss=0;
2749 TString stm;
2750 TString cproc;
2751 Int_t status;
2752
2753 switch (fViewer->GetActDesc()->fActQuery->fStatus) {
2754
2756 cproc = " - ABORTED";
2757 status = kAborted;
2758 break;
2760 cproc = " - STOPPED";
2761 status = kStopped;
2762 break;
2764 cproc = " ";
2765 status = kRunning;
2766 break;
2769 cproc = " ";
2770 status = kDone;
2771 break;
2772 default:
2773 status = -1;
2774 break;
2775 }
2776 if (processed < 0) processed = 0;
2777
2778 frmProg->SetBarColor("green");
2779 if (status == kAborted)
2780 frmProg->SetBarColor("red");
2781 else if (status == kStopped)
2782 frmProg->SetBarColor("yellow");
2783 else if (status == -1 ) {
2784 fTotal->SetText(" Estimated time left : 0 sec (0 events of 0 processed) ");
2785 fRate->SetText(" Processing Rate : 0.0f events/sec ");
2786 frmProg->Reset();
2787 fFB->Layout();
2788 return;
2789 }
2790
2791 if (total < 0)
2792 total = fPrevTotal;
2793 else
2794 fPrevTotal = total;
2795
2796 // if no change since last call, just return
2797 TString buf;
2798
2799 // Update information at first call
2800 if (fEntries != total) {
2801 fLabInfos->SetText("Local Session");
2802
2803 fEntries = total;
2804 buf.Form(" %d files, %lld events, starting event %lld",
2806 fLabStatus->SetText(buf.Data());
2807 }
2808
2809 // compute progress bar position and update
2810 Float_t pos = 0.0;
2811 if (processed > 0 && total > 0)
2812 pos = (Float_t)((Double_t)(processed * 100)/(Double_t)total);
2813 frmProg->SetPosition(pos);
2814 // if 100%, stop animation and set icon to "connected"
2815 if (pos >= 100.0) {
2817 fViewer->ChangeRightLogo("monitor01.xpm");
2818 }
2819
2820 // get current time
2821 if (status == kRunning)
2825 Float_t eta = 0;
2826 if (processed)
2827 eta = ((Float_t)((Long64_t)tdiff)*total/(Float_t)(processed) -
2828 (Long64_t)(tdiff))/1000.;
2829
2830 tt = (Long_t)eta;
2831 if (tt > 0) {
2832 hh = (UInt_t)(tt / 3600);
2833 mm = (UInt_t)((tt % 3600) / 60);
2834 ss = (UInt_t)((tt % 3600) % 60);
2835 }
2836 if (hh)
2837 stm = TString::Format("%d h %d min %d sec", hh, mm, ss);
2838 else if (mm)
2839 stm = TString::Format("%d min %d sec", mm, ss);
2840 else
2841 stm = TString::Format("%d sec", ss);
2842 if ((processed != total) && (status == kRunning)) {
2843 // update status infos
2844 buf.Form(" Estimated time left : %s (%lld events of %lld processed) ",
2845 stm.Data(), processed, total);
2846 fTotal->SetText(buf);
2847 } else {
2848 tt = (Long_t) Long64_t(tdiff)/1000;
2849 if (tt > 0) {
2850 hh = (UInt_t)(tt / 3600);
2851 mm = (UInt_t)((tt % 3600) / 60);
2852 ss = (UInt_t)((tt % 3600) % 60);
2853 }
2854 if (hh)
2855 stm = TString::Format("%d h %d min %d sec", hh, mm, ss);
2856 else if (mm)
2857 stm = TString::Format("%d min %d sec", mm, ss);
2858 else
2859 stm = TString::Format("%d sec", ss);
2860 buf.Form(" Processed : %ld events in %s",
2861 (Long_t)processed, stm.Data());
2862 buf += cproc;
2863 fTotal->SetText(buf.Data());
2864 }
2865 if (processed > 0 && (Long64_t)tdiff > 0) {
2866 buf.Form(" Processing Rate : %.1f events/sec ",
2867 (Float_t)processed/(Long64_t)tdiff*1000.);
2868 fRate->SetText(buf.Data());
2869 }
2870 fPrevProcessed = processed;
2871
2872 fFB->Layout();
2873}
2874
2875////////////////////////////////////////////////////////////////////////////////
2876/// Indicate that Cancel or Stop was clicked.
2877
2879{
2880 if (aborted == kTRUE) {
2881 // Aborted
2882 frmProg->SetBarColor("red");
2883 }
2884 else {
2885 // Stopped
2886 frmProg->SetBarColor("yellow");
2887 }
2888 // disconnect progress related signals
2889 if (fViewer->GetActDesc()->fProof &&
2891 fViewer->GetActDesc()->fProof->Disconnect("Progress(Long64_t,Long64_t)",
2892 this, "Progress(Long64_t,Long64_t)");
2893 fViewer->GetActDesc()->fProof->Disconnect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
2894 this, "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
2895 fViewer->GetActDesc()->fProof->Disconnect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)",
2896 this, "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
2897 fViewer->GetActDesc()->fProof->Disconnect("StopProcess(Bool_t)", this,
2898 "IndicateStop(Bool_t)");
2899 }
2900}
2901
2902////////////////////////////////////////////////////////////////////////////////
2903/// Reset progress frame information fields.
2904
2905void TSessionQueryFrame::ResetProgressDialog(const char * /*selector*/, Int_t files,
2906 Long64_t first, Long64_t entries)
2907{
2908 TString buf;
2909 fFiles = files > 0 ? files : 0;
2910 fFirst = first;
2911 fEntries = entries;
2912 fPrevProcessed = 0;
2913 fPrevTotal = 0;
2914
2915 if (!fViewer->GetActDesc()->fLocal) {
2916 frmProg->SetBarColor("green");
2917 frmProg->Reset();
2918 }
2919
2920 buf.Form("%0d files, %0lld events, starting event %0lld",
2921 fFiles > 0 ? fFiles : 0, fEntries > 0 ? fEntries : 0,
2922 fFirst >= 0 ? fFirst : 0);
2923 fLabStatus->SetText(buf.Data());
2924 // Reconnect the slots
2925 if (fViewer->GetActDesc()->fProof &&
2927 fViewer->GetActDesc()->fProof->Connect("Progress(Long64_t,Long64_t)",
2928 "TSessionQueryFrame", this, "Progress(Long64_t,Long64_t)");
2929 fViewer->GetActDesc()->fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
2930 "TSessionQueryFrame", this,
2931 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
2932 fViewer->GetActDesc()->fProof->Connect("StopProcess(Bool_t)",
2933 "TSessionQueryFrame", this, "IndicateStop(Bool_t)");
2934 buf.Form("PROOF cluster : \"%s\" - %d worker nodes",
2937 fLabInfos->SetText(buf.Data());
2938 }
2939 else if (fViewer->GetActDesc()->fLocal) {
2941 fLabInfos->SetText("Local Session");
2942 fLabStatus->SetText(" ");
2943 }
2944 else {
2945 fLabInfos->SetText(" ");
2946 fLabStatus->SetText(" ");
2947 }
2948 fFB->Layout();
2949}
2950
2951////////////////////////////////////////////////////////////////////////////////
2952/// Finalize query.
2953
2955{
2956 // check if Proof is valid
2957 if (fViewer->GetActDesc()->fProof &&
2959 gPad->SetEditable(kFALSE);
2961 if (!item) return;
2962 TObject *obj = (TObject *)item->GetUserData();
2963 if ((obj) && (obj->IsA() == TQueryDescription::Class())) {
2964 // as it can take time, set watch cursor
2965 gVirtualX->SetCursor(GetId(),gVirtualX->CreateCursor(kWatch));
2966 TQueryDescription *query = (TQueryDescription *)obj;
2968 UpdateButtons(query);
2969 // restore cursor
2970 gVirtualX->SetCursor(GetId(), 0);
2971 }
2972 }
2973 if (fViewer->GetActDesc()->fLocal) {
2974 gPad->SetEditable(kFALSE);
2976 if (chain && chain->GetPlayer())
2978 }
2979}
2980
2981////////////////////////////////////////////////////////////////////////////////
2982/// Stop processing query.
2983
2985{
2986 // check for proof validity
2987 if (fViewer->GetActDesc()->fProof &&
2990 }
2991 if (fViewer->GetActDesc()->fLocal) {
2992 gROOT->SetInterrupt();
2995 }
2996 // stop icon animation and set connected icon
2997 fViewer->ChangeRightLogo("monitor01.xpm");
2999}
3000
3001////////////////////////////////////////////////////////////////////////////////
3002/// Show query log.
3003
3005{
3007 if (!item) return;
3008 TObject *obj = (TObject *)item->GetUserData();
3009 if ((!obj) || (obj->IsA() != TQueryDescription::Class()))
3010 return;
3011 TQueryDescription *query = (TQueryDescription *)obj;
3012 fViewer->ShowLog(query->fReference.Data());
3013}
3014
3015////////////////////////////////////////////////////////////////////////////////
3016/// Retrieve query.
3017
3019{
3020 // check for proof validity
3021 if (fViewer->GetActDesc()->fAttached &&
3025 if (!item) return;
3026 TObject *obj = (TObject *)item->GetUserData();
3027 if (obj && obj->IsA() == TQueryDescription::Class()) {
3028 // as it can take time, set watch cursor
3029 gVirtualX->SetCursor(GetId(), gVirtualX->CreateCursor(kWatch));
3030 TQueryDescription *query = (TQueryDescription *)obj;
3032 if (rc == 0)
3034 // restore cursor
3035 gVirtualX->SetCursor(GetId(), 0);
3036 }
3037 }
3038 if (fViewer->GetActDesc()->fLocal) {
3039 TGListTreeItem *item=0, *item2=0;
3041 fViewer->GetActDesc());
3042 if (item) {
3043 item2 = fViewer->GetSessionHierarchy()->FindItemByObj(item,
3045 }
3046 if (item2) {
3047 // add input and output list entries
3049 if (chain && chain->GetPlayer()) {
3050 TSelector *selector = chain->GetPlayer()->GetSelectorFromFile();
3051 if (selector) {
3052 TList *objlist = selector->GetOutputList();
3053 if (objlist)
3054 if (!fViewer->GetSessionHierarchy()->FindChildByName(item2, "OutputList"))
3055 fViewer->GetSessionHierarchy()->AddItem(item2, "OutputList");
3056 }
3057 }
3058 }
3059 // update list tree, query frame information, and buttons state
3062 UpdateInfos();
3064 }
3065}
3066
3067////////////////////////////////////////////////////////////////////////////////
3068/// Abort processing query.
3069
3071{
3072 // check for proof validity
3073 if (fViewer->GetActDesc()->fProof &&
3076 }
3077 if (fViewer->GetActDesc()->fLocal) {
3078 gROOT->SetInterrupt();
3081 }
3082 // stop icon animation and set connected icon
3083 fViewer->ChangeRightLogo("monitor01.xpm");
3085}
3086
3087////////////////////////////////////////////////////////////////////////////////
3088/// Submit query.
3089
3091{
3092 Int_t retval;
3093 Long64_t id = 0;
3095 if (!item) return;
3096 // retrieve query description attached to list tree item
3097 TObject *obj = (TObject *)item->GetUserData();
3098 if (!obj || obj->IsA() != TQueryDescription::Class())
3099 return;
3100 TQueryDescription *newquery = (TQueryDescription *)obj;
3101 // reset progress information
3103 newquery->fNbFiles, newquery->fFirstEntry, newquery->fNoEntries);
3104 // set query start time
3105 newquery->fStartTime = gSystem->Now();
3107 // check for proof validity
3108 if (fViewer->GetActDesc()->fProof &&
3111 // set query description status to submitted
3113 // if feedback option selected
3115 Int_t i = 0;
3116 // browse list of feedback histos and check user's selected ones
3117 while (kFeedbackHistos[i]) {
3118 if (fViewer->GetCascadeMenu()->IsEntryChecked(41+i)) {
3121 }
3122 i++;
3123 }
3124 // connect feedback signal
3125 fViewer->GetActDesc()->fProof->Connect("Feedback(TList *objs)",
3126 "TSessionQueryFrame", fViewer->GetQueryFrame(),
3127 "Feedback(TList *objs)");
3128 gROOT->Time();
3129 }
3130 else {
3131 // if feedback option not selected, clear Proof's feedback option
3133 }
3134 // set current proof session
3135 fViewer->GetActDesc()->fProof->cd();
3136 // check if parameter file has been specified
3137 if (newquery->fChain) {
3138 if (fViewer->GetActDesc()->fProof->IsLite()) {
3139 newquery->fOptions = "";
3140 }
3141 // set query reference id
3142 newquery->fReference= TString::Format("session-%s:q%d",
3145 if (newquery->fChain->IsA() == TChain::Class()) {
3146 // TChain case
3148 ((TChain *)newquery->fChain)->SetProof(fViewer->GetActDesc()->fProof);
3149 id = ((TChain *)newquery->fChain)->Process(newquery->fSelectorString,
3150 newquery->fOptions,
3151 newquery->fNoEntries > 0 ? newquery->fNoEntries : 1234567890,
3152 newquery->fFirstEntry);
3153 }
3154 else if (newquery->fChain->IsA() == TDSet::Class()) {
3155 // TDSet case
3157 id = ((TDSet *)newquery->fChain)->Process(newquery->fSelectorString,
3158 newquery->fOptions,
3159 newquery->fNoEntries,
3160 newquery->fFirstEntry);
3161 }
3162 }
3163 else {
3164 Error("Submit", "No TChain defined; skipping");
3166 return;
3167 }
3168 // set query reference id to unique identifier
3169 newquery->fReference= TString::Format("session-%s:q%lld",
3171 // start icon animation
3173 }
3174 else if (fViewer->GetActDesc()->fLocal) { // local session case
3175 // if feedback option selected
3177 Int_t i = 0;
3178 // browse list of feedback histos and check user's selected ones
3179 while (kFeedbackHistos[i]) {
3180 if (fViewer->GetCascadeMenu()->IsEntryChecked(41+i)) {
3182 }
3183 i++;
3184 }
3185 }
3186 if (newquery->fChain) {
3187 if (newquery->fChain->IsA() == TChain::Class()) {
3188 // TChain case
3191 UpdateButtons(newquery);
3192 gPad->SetEditable(kFALSE);
3193 ((TChain *)newquery->fChain)->SetTimerInterval(100);
3194 id = ((TChain *)newquery->fChain)->Process(newquery->fSelectorString,
3195 newquery->fOptions,
3196 newquery->fNoEntries > 0 ? newquery->fNoEntries : 1234567890,
3197 newquery->fFirstEntry);
3198 ((TChain *)newquery->fChain)->SetTimerInterval(0);
3199 OnBtnRetrieve();
3200 TChain *chain = (TChain *)newquery->fChain;
3201 ProgressLocal(chain->GetEntries(),
3202 chain->GetReadEntry()+1);
3206 UpdateButtons(newquery);
3207 }
3208 else {
3209 new TGMsgBox(fClient->GetRoot(), this, "Error Submitting Query",
3210 "Only TChains are allowed in Local Session (no TDSet) !",
3211 kMBIconExclamation,kMBOk,&retval);
3212 }
3213 }
3214 else {
3215 Error("Submit", "No TChain defined; skipping");
3217 return;
3218 }
3219 // set query reference id to unique identifier
3220 newquery->fReference = TString::Format("local-session-%s:q%lld", newquery->fQueryName.Data(), id);
3221 }
3222 // update buttons state
3223 UpdateButtons(newquery);
3224}
3225
3226////////////////////////////////////////////////////////////////////////////////
3227/// Update buttons state for the current query status.
3228
3230{
3232 if (!item) return;
3233 // retrieve query description attached to list tree item
3234 TObject *obj = (TObject *)item->GetUserData();
3235 if (!obj || obj->IsA() != TQueryDescription::Class())
3236 return;
3237 TQueryDescription *query = (TQueryDescription *)obj;
3238 if (desc != query) return;
3239
3240 Bool_t submit_en = kFALSE;
3241 if ((fViewer->GetActDesc()->fProof &&
3242 fViewer->GetActDesc()->fProof->IsValid()) ||
3244 submit_en = kTRUE;
3245
3246 switch (desc->fStatus) {
3248 fBtnSubmit->SetEnabled(submit_en);
3254 break;
3255
3257 fBtnSubmit->SetEnabled(submit_en);
3259 if (((desc->fResult == 0) || (desc->fResult &&
3260 (desc->fResult->IsFinalized() ||
3261 (desc->fResult->GetInputObject("TDSet") == 0)))) &&
3262 !(fViewer->GetActDesc()->fLocal))
3268 break;
3269
3271 fBtnSubmit->SetEnabled(submit_en);
3277 break;
3278
3286 break;
3287
3295 break;
3296
3298 fBtnSubmit->SetEnabled(submit_en);
3304 break;
3305
3307 fBtnSubmit->SetEnabled(submit_en);
3313 break;
3314
3316 fBtnSubmit->SetEnabled(submit_en);
3322 break;
3323
3324 default:
3325 break;
3326 }
3327 if (fViewer->GetActDesc()->fLocal &&
3331 }
3332}
3333
3334////////////////////////////////////////////////////////////////////////////////
3335/// Update query information (header) text view.
3336
3338{
3339 TString buffer;
3340 const char *qst[] = {"aborted ", "submitted", "running ",
3341 "stopped ", "completed"};
3342
3345
3346 if (fViewer->GetActDesc()->fLocal ||
3350 fViewer->GetActDesc()->fProof->IsValid())) {
3351 fBtnSave->SetText(" Submit ");
3352 }
3353 else {
3354 fBtnSave->SetText(" Apply changes ");
3355 }
3358 if (!fViewer->GetActDesc()->fActQuery ||
3360 ResetProgressDialog("", 0, 0, 0);
3361 if (fViewer->GetActDesc()->fLocal) {
3362 if (fViewer->GetActDesc()->fActQuery) {
3364 if (chain) {
3365 ProgressLocal(chain->GetEntries(),
3366 chain->GetReadEntry()+1);
3367 }
3368 else {
3369 ProgressLocal(0, 0);
3370 }
3372 }
3373 }
3374 else {
3375 fTotal->SetText(" Estimated time left : 0 sec (0 events of 0 processed) ");
3376 fRate->SetText(" Processing Rate : 0.0f events/sec ");
3377 frmProg->Reset();
3378 fFB->Layout();
3379 }
3380 return;
3381 }
3383
3384 // Status label
3385 Int_t st = (result->GetStatus() > 0 && result->GetStatus() <=
3386 TQueryResult::kCompleted) ? result->GetStatus() : 0;
3387
3388 Int_t qry = result->GetSeqNum();
3389
3390 buffer = TString::Format("------------------------------------------------------\n");
3391 // Print header
3392 if (!result->IsDraw()) {
3393 const char *fin = result->IsFinalized() ? "finalized" : qst[st];
3394 const char *arc = result->IsArchived() ? "(A)" : "";
3395 buffer = TString::Format(" Query No : %d\n", qry);
3396 buffer += TString::Format(" Ref : \"%s:%s\"\n", result->GetTitle(),
3397 result->GetName());
3398 buffer += TString::Format(" Selector : %s\n",
3399 result->GetSelecImp()->GetTitle());
3400 buffer += TString::Format("Status : %9s%s\n", fin, arc);
3401 buffer += TString::Format("------------------------------------------------------\n");
3402 } else {
3403 buffer += TString::Format(" Query No : %d\n", qry);
3404 buffer += TString::Format(" Ref : \"%s:%s\"\n", result->GetTitle(),
3405 result->GetName());
3406 buffer += TString::Format(" Selector : %s\n",
3407 result->GetSelecImp()->GetTitle());
3408 buffer += TString::Format("------------------------------------------------------\n");
3409 }
3410
3411 // Time information
3412 Int_t elapsed = (Int_t)(result->GetEndTime().Convert() -
3413 result->GetStartTime().Convert());
3414 buffer += TString::Format(" Started : %s\n",
3415 result->GetStartTime().AsString());
3416 buffer += TString::Format(" Real time : %d sec (CPU time: %.1f sec)\n",
3417 elapsed, result->GetUsedCPU());
3418
3419 // Number of events processed, rate, size
3420 Double_t rate = 0.0;
3421 if (result->GetEntries() > -1 && elapsed > 0)
3422 rate = result->GetEntries() / (Double_t)elapsed ;
3423 Float_t size = ((Float_t)result->GetBytes())/(1024*1024);
3424 buffer += TString::Format(" Processed : %lld events (size: %.3f MBs)\n",
3425 result->GetEntries(), size);
3426 buffer += TString::Format(" Rate : %.1f evts/sec\n", rate);
3427
3428 // Package information
3429 if (strlen(result->GetParList()) > 1) {
3430 buffer += TString::Format(" Packages : %s\n", result->GetParList());
3431 }
3432
3433 // Result information
3434 TString res = result->GetResultFile();
3435 if (!result->IsArchived()) {
3436 Int_t dq = res.Index("queries");
3437 if (dq > -1) {
3438 res.Remove(0,res.Index("queries"));
3439 res.Insert(0,"<PROOF_SandBox>/");
3440 }
3441 if (res.BeginsWith("-")) {
3442 res = (result->GetStatus() == TQueryResult::kAborted) ?
3443 "not available" : "sent to client";
3444 }
3445 }
3446 if (res.Length() > 1) {
3447 buffer += TString::Format("------------------------------------------------------\n");
3448 buffer += TString::Format(" Results : %s\n", res.Data());
3449 }
3450
3451 if (result->GetOutputList() && result->GetOutputList()->GetSize() > 0) {
3452 buffer += TString::Format(" Outlist : %d objects\n",
3453 result->GetOutputList()->GetSize());
3454 buffer += TString::Format("------------------------------------------------------\n");
3455 }
3456 fInfoTextView->LoadBuffer(buffer.Data());
3457
3458 //Float_t pos = Float_t((Double_t)(result->GetEntries() * 100)/(Double_t)total);
3459 if (result->GetStatus() == TQueryResult::kAborted)
3460 frmProg->SetBarColor("red");
3461 else if (result->GetStatus() == TQueryResult::kStopped)
3462 frmProg->SetBarColor("yellow");
3463 else
3464 frmProg->SetBarColor("green");
3465
3466 frmProg->SetPosition(100.0);
3467
3468 buffer = TString::Format(" Processed : %lld events in %.1f sec", result->GetEntries(),
3469 (Float_t)elapsed);
3470 fTotal->SetText(buffer.Data());
3471 buffer = TString::Format(" Processing Rate : %.1f events/sec ", rate);
3472 fRate->SetText(buffer.Data());
3473 fFB->Layout();
3474}
3475
3476//////////////////////////////////////////////////////////////////////////////////////////
3477// Output frame
3478
3479////////////////////////////////////////////////////////////////////////////////
3480/// Constructor.
3481
3483 TGCompositeFrame(p, w, h), fEntryTmp(0), fLVContainer(0), fViewer(0)
3484{
3485}
3486
3487////////////////////////////////////////////////////////////////////////////////
3488/// Destructor.
3489
3491{
3492 delete fLVContainer; // this container is inside the TGListView and is not
3493 // deleted automatically
3494 Cleanup();
3495}
3496
3497////////////////////////////////////////////////////////////////////////////////
3498/// Build query output information frame.
3499
3501{
3502 fViewer = gui;
3505
3506 // Container of object TGListView
3507 TGListView *frmListView = new TGListView(this, 340, 190);
3509 fLVContainer->Associate(frmListView);
3512 4, 4, 4, 4));
3513
3514 frmListView->Connect("Clicked(TGLVEntry*, Int_t, Int_t, Int_t)",
3515 "TSessionOutputFrame", this,
3516 "OnElementClicked(TGLVEntry* ,Int_t, Int_t, Int_t)");
3517 frmListView->Connect("DoubleClicked(TGLVEntry*, Int_t, Int_t, Int_t)",
3518 "TSessionOutputFrame", this,
3519 "OnElementDblClicked(TGLVEntry* ,Int_t, Int_t, Int_t)");
3520}
3521
3522////////////////////////////////////////////////////////////////////////////////
3523/// Handle mouse clicks on list view items.
3524
3526 Int_t y)
3527{
3528 TObject *obj = (TObject *)entry->GetUserData();
3529 if ((obj) && (btn ==3)) {
3530 // if right button, popup context menu
3531 fViewer->GetContextMenu()->Popup(x, y, obj, (TBrowser *)0);
3532 }
3533}
3534
3535////////////////////////////////////////////////////////////////////////////////
3536/// Handle double-clicks on list view items.
3537
3539{
3540 char action[512];
3541 TString act;
3542 TObject *obj = (TObject *)entry->GetUserData();
3543 if (!obj) return;
3544 TString ext = obj->GetName();
3545 gPad->SetEditable(kFALSE);
3546 // check default action from root.mimes
3547 if (fClient->GetMimeTypeList()->GetAction(obj->IsA()->GetName(), action)) {
3548 act = TString::Format("((%s*)0x%zx)%s", obj->IsA()->GetName(), (size_t)obj, action);
3549 if (act[0] == '!') {
3550 act.Remove(0, 1);
3551 gSystem->Exec(act.Data());
3552 } else {
3553 // do not allow browse
3554 if (!act.Contains("Browse"))
3555 gROOT->ProcessLine(act.Data());
3556 }
3557 }
3558}
3559
3560////////////////////////////////////////////////////////////////////////////////
3561/// Add object to output list view.
3562
3564{
3565 TGLVEntry *item;
3566 if (obj) {
3567 item = new TGLVEntry(fLVContainer, obj->GetName(), obj->IsA()->GetName());
3568 item->SetUserData(obj);
3569 fLVContainer->AddItem(item);
3570 }
3571}
3572
3573//////////////////////////////////////////////////////////////////////////////////////////
3574// Input Frame
3575
3576////////////////////////////////////////////////////////////////////////////////
3577/// Constructor.
3578
3580 TGCompositeFrame(p, w, h), fViewer(0), fLVContainer(0)
3581{
3582}
3583
3584////////////////////////////////////////////////////////////////////////////////
3585/// Destructor.
3586
3588{
3589 delete fLVContainer; // this container is inside the TGListView and is not
3590 // deleted automatically
3591 Cleanup();
3592}
3593
3594////////////////////////////////////////////////////////////////////////////////
3595/// Build query input information frame.
3596
3598{
3599 fViewer = gui;
3602
3603 // Container of object TGListView
3604 TGListView *frmListView = new TGListView(this, 340, 190);
3606 fLVContainer->Associate(frmListView);
3609 4, 4, 4, 4));
3610}
3611
3612////////////////////////////////////////////////////////////////////////////////
3613/// Add object to input list view.
3614
3616{
3617 TGLVEntry *item;
3618 if (obj) {
3619 item = new TGLVEntry(fLVContainer, obj->GetName(), obj->IsA()->GetName());
3620 item->SetUserData(obj);
3621 fLVContainer->AddItem(item);
3622 }
3623}
3624
3625//////////////////////////////////////////////////////////////////////////////////////////
3626// Session Viewer Main Frame
3627
3628////////////////////////////////////////////////////////////////////////////////
3629/// Main Session viewer constructor.
3630
3632 TGMainFrame(gClient->GetRoot(), w, h), fSessionHierarchy(0), fSessionItem(0)
3633{
3634 // only one session viewer allowed
3635 if (gSessionViewer)
3636 // coverity[uninit_member]: already done
3637 return;
3638 Build();
3640 Resize(w, h);
3641 gSessionViewer = this;
3642}
3643
3644////////////////////////////////////////////////////////////////////////////////
3645/// Main Session viewer constructor.
3646
3648 UInt_t h) : TGMainFrame(gClient->GetRoot(), w, h),
3649 fSessionHierarchy(0), fSessionItem(0)
3650{
3651 // only one session viewer allowed
3652 if (gSessionViewer)
3653 // coverity[uninit_member]: already done
3654 return;
3655 Build();
3657 Move(x, y);
3658 Resize(w, h);
3659 gSessionViewer = this;
3660}
3661
3662////////////////////////////////////////////////////////////////////////////////
3663/// Read configuration file and populate list of sessions
3664/// list of queries and list of packages.
3665/// Read and set also global options as feedback histos.
3666
3668{
3669 if (fViewerEnv)
3670 delete fViewerEnv;
3671 fViewerEnv = new TEnv();
3672
3673 const char *fn = (filename && strlen(filename)) ? filename : fConfigFile.Data();
3674
3676
3677 Bool_t bval = (Bool_t)fViewerEnv->GetValue("Option.Feedback", 1);
3678 if (bval)
3680 else
3682
3683 bval = (Bool_t)fViewerEnv->GetValue("Option.MasterHistos", 1);
3684 if (bval) {
3686 gEnv->SetValue("Proof.StatsHist", 1);
3687 }
3688 else {
3690 gEnv->SetValue("Proof.StatsHist", 0);
3691 }
3692 bval = (Bool_t)fViewerEnv->GetValue("Option.MasterEvents", 0);
3693 if (bval)
3695 else
3697 bval = (Bool_t)fViewerEnv->GetValue("Option.WorkerEvents", 0);
3698 if (bval)
3700 else
3702
3703 Int_t i = 0;
3704 while (kFeedbackHistos[i]) {
3705 bval = (Bool_t)fViewerEnv->GetValue(Form("Option.%s",kFeedbackHistos[i]),
3706 i == 1 ? 1 : 0);
3707 if (bval)
3708 fCascadeMenu->CheckEntry(41+i);
3709 else
3711 i++;
3712 }
3713 TSessionDescription *proofDesc;
3714 fSessions->Delete();
3715 if (fSessionItem)
3717 else
3719 fBaseIcon);
3720 // add local session description
3722 fLocal, fLocal);
3723 fSessionHierarchy->SetToolTipItem(item, "Local Session");
3724 TSessionDescription *localdesc = new TSessionDescription();
3725 localdesc->fTag = "";
3726 localdesc->fName = "Local";
3727 localdesc->fAddress = "Local";
3728 localdesc->fPort = 0;
3729 localdesc->fConfigFile = "";
3730 localdesc->fLogLevel = 0;
3731 localdesc->fUserName = "";
3732 localdesc->fQueries = new TList();
3733 localdesc->fPackages = new TList();
3734 localdesc->fActQuery = 0;
3735 localdesc->fProof = 0;
3736 localdesc->fProofMgr = 0;
3737 localdesc->fAttached = kFALSE;
3738 localdesc->fConnected = kFALSE;
3739 localdesc->fLocal = kTRUE;
3740 localdesc->fSync = kTRUE;
3741 localdesc->fAutoEnable = kFALSE;
3742 localdesc->fNbHistos = 0;
3743 item->SetUserData(localdesc);
3744 fSessions->Add((TObject *)localdesc);
3745 fActDesc = localdesc;
3746
3747 SysInfo_t info;
3748 gSystem->GetSysInfo(&info);
3749 // if the machine has more than one CPU, add one PROOF lite session
3750 // (not supported on Windows yet)
3751 if (!info.fOS.Contains("Microsoft") && info.fCpus > 1) {
3752 // add proof lite session description
3753 item = fSessionHierarchy->AddItem(fSessionItem, "Lite",
3755 fSessionHierarchy->SetToolTipItem(item, "PROOF Lite");
3756 TSessionDescription *litedesc = new TSessionDescription();
3757 litedesc->fTag = "";
3758 litedesc->fName = "PROOF Lite";
3759 litedesc->fAddress = "lite://";
3760 litedesc->fPort = 0;
3761 litedesc->fConfigFile = "";
3762 litedesc->fLogLevel = 0;
3763 litedesc->fUserName = "";
3764 litedesc->fQueries = new TList();
3765 litedesc->fPackages = new TList();
3766 litedesc->fActQuery = 0;
3767 litedesc->fProof = 0;
3768 litedesc->fProofMgr = 0;
3769 litedesc->fAttached = kFALSE;
3770 litedesc->fConnected = kFALSE;
3771 litedesc->fLocal = kFALSE;
3772 litedesc->fSync = kTRUE;
3773 litedesc->fAutoEnable = kFALSE;
3774 litedesc->fNbHistos = 0;
3775 item->SetUserData(litedesc);
3776 fSessions->Add((TObject *)litedesc);
3777 fActDesc = litedesc;
3778 }
3779 TIter next(fViewerEnv->GetTable());
3780 TEnvRec *er;
3781 while ((er = (TEnvRec*) next())) {
3782 const char *s;
3783 if ((s = strstr(er->GetName(), "SessionDescription."))) {
3784 const char *val = fViewerEnv->GetValue(s, (const char*)0);
3785 if (val) {
3786 Int_t cnt = 0;
3787 char *v = StrDup(val);
3788 s += 7;
3789 while (1) {
3790 TString name = strtok(!cnt ? v : 0, ";");
3791 if (name.IsNull()) break;
3792 TString sessiontag = strtok(0, ";");
3793 TString address = strtok(0, ";");
3794 if (address.IsNull()) break;
3795 TString port = strtok(0, ";");
3796 if (port.IsNull()) break;
3797 TString loglevel = strtok(0, ";");
3798 if (loglevel.IsNull()) break;
3799 TString configfile = strtok(0, ";");
3800 TString user = strtok(0, ";");
3801 if (user.IsNull()) break;
3802 TString sync = strtok(0, ";");
3803 TString autoen = strtok(0, ";");
3804
3805 // build session description
3806 proofDesc = new TSessionDescription();
3807 proofDesc->fTag = sessiontag.Length() > 2 ? sessiontag.Data() : "";
3808 proofDesc->fName = name;
3809 proofDesc->fAddress = address;
3810 proofDesc->fPort = atoi(port);
3811 proofDesc->fConfigFile = configfile.Length() > 2 ? configfile.Data() : "";
3812 proofDesc->fLogLevel = atoi(loglevel);
3813 proofDesc->fConnected = kFALSE;
3814 proofDesc->fAttached = kFALSE;
3815 proofDesc->fLocal = kFALSE;
3816 proofDesc->fQueries = new TList();
3817 proofDesc->fPackages = new TList();
3818 proofDesc->fActQuery = 0;
3819 proofDesc->fProof = 0;
3820 proofDesc->fProofMgr = 0;
3821 proofDesc->fSync = (Bool_t)(atoi(sync));
3822 proofDesc->fAutoEnable = (Bool_t)(atoi(autoen));
3823 proofDesc->fUserName = user;
3824 fSessions->Add((TObject *)proofDesc);
3825 item = fSessionHierarchy->AddItem(
3826 fSessionItem, proofDesc->fName.Data(),
3828 fSessionHierarchy->SetToolTipItem(item, "Proof Session");
3829 item->SetUserData(proofDesc);
3830 fActDesc = proofDesc;
3831 cnt++;
3832 }
3833 delete [] v;
3834 }
3835 }
3836 if ((s = strstr(er->GetName(), "QueryDescription."))) {
3837 const char *val = fViewerEnv->GetValue(s, (const char*)0);
3838 if (val) {
3839 Int_t cnt = 0;
3840 char *v = StrDup(val);
3841 s += 7;
3842 while (1) {
3843
3844 TString status = strtok(!cnt ? v : 0, ";");
3845 if (status.IsNull()) break;
3846
3847 TString reference = strtok(0, ";");
3848 if (reference.IsNull()) break;
3849 TString queryname = strtok(0, ";");
3850 if (queryname.IsNull()) break;
3851 TString selector = strtok(0, ";");
3852 if (selector.IsNull()) break;
3853 TString dset = strtok(0, ";");
3854 TString options = strtok(0, ";");
3855 TString eventlist = strtok(0, ";");
3856 TString nbfiles = strtok(0, ";");
3857 TString nbentries = strtok(0, ";");
3858 TString firstentry = strtok(0, ";");
3859
3860 TQueryDescription *newquery = new TQueryDescription();
3861 newquery->fStatus =
3863 newquery->fSelectorString = selector.Length() > 2 ? selector.Data() : "";
3864 newquery->fReference = reference.Length() > 2 ? reference.Data() : "";
3865 newquery->fTDSetString = dset.Length() > 2 ? dset.Data() : "";
3866 newquery->fQueryName = queryname.Length() > 2 ? queryname.Data() : "";
3867 newquery->fOptions = options.Length() > 2 ? options.Data() : "";
3868 newquery->fEventList = eventlist.Length() > 2 ? eventlist.Data() : "";
3869 newquery->fNbFiles = atoi(nbfiles);
3870 newquery->fNoEntries = atoi(nbentries);
3871 newquery->fFirstEntry = atoi(firstentry);
3872 newquery->fResult = 0;
3873 newquery->fChain = 0;
3874 fActDesc->fQueries->Add((TObject *)newquery);
3875 cnt++;
3879 item1, newquery->fQueryName, fQueryCon, fQueryCon);
3880 item2->SetUserData(newquery);
3881 }
3882 delete [] v;
3883 }
3884 }
3885 }
3888 if (fActDesc == localdesc) {
3891 }
3892 else {
3896 }
3899}
3900
3901////////////////////////////////////////////////////////////////////////////////
3902/// Update list of existing Proof sessions.
3903
3905{
3906 // get list of proof sessions
3907 Bool_t found = kFALSE;
3908 Bool_t exists = kFALSE;
3909 TGListTreeItem *item = 0;
3910 TSeqCollection *proofs = gROOT->GetListOfProofs();
3911 TSessionDescription *desc = 0;
3912 TSessionDescription *newdesc;
3913 if (proofs) {
3914 TObject *o = proofs->First();
3915 if (o && dynamic_cast<TProofMgr *>(o)) {
3916 TProofMgr *mgr = dynamic_cast<TProofMgr *>(o);
3917 if (mgr && mgr->QuerySessions("L")) {
3918 TIter nxd(mgr->QuerySessions("L"));
3919 TProofDesc *d = 0;
3920 TProof *p = 0;
3921 while ((d = (TProofDesc *)nxd())) {
3922 TIter nextfs(fSessions);
3923 // check if session exists in the list
3924 exists = kFALSE;
3925 while ((desc = (TSessionDescription *)nextfs())) {
3926 if ((desc->fTag == d->GetName()) ||
3927 (desc->fName == d->GetTitle())) {
3928 exists = kTRUE;
3929 break;
3930 }
3931 }
3932 TIter nexts(fSessions);
3933 found = kFALSE;
3934 p = d->GetProof();
3935 while ((desc = (TSessionDescription *)nexts())) {
3936 if (desc->fConnected && desc->fAttached)
3937 continue;
3938 if (p && ((exists && ((desc->fTag == d->GetName()) ||
3939 (desc->fName == d->GetTitle()))) ||
3940 (!exists && (desc->fAddress == p->GetMaster())))) {
3941 desc->fConnected = kTRUE;
3942 desc->fAttached = kTRUE;
3943 desc->fProof = p;
3944 desc->fProofMgr = mgr;
3945 desc->fTag = d->GetName();
3947 desc);
3948 if (item) {
3950 if (item == fSessionHierarchy->GetSelected()) {
3951 fActDesc->fProof->Connect("Progress(Long64_t,Long64_t)",
3952 "TSessionQueryFrame", fQueryFrame,
3953 "Progress(Long64_t,Long64_t)");
3954 fActDesc->fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
3955 "TSessionQueryFrame", fQueryFrame,
3956 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
3957 fActDesc->fProof->Connect("StopProcess(Bool_t)",
3958 "TSessionQueryFrame", fQueryFrame,
3959 "IndicateStop(Bool_t)");
3961 "ResetProgressDialog(const char*, Int_t,Long64_t,Long64_t)",
3962 "TSessionQueryFrame", fQueryFrame,
3963 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)");
3964 // enable timer used for status bar icon's animation
3965 EnableTimer();
3966 // change status bar right icon to connected pixmap
3967 ChangeRightLogo("monitor01.xpm");
3968 // do not animate yet
3970 // connect to signal "query result ready"
3971 fActDesc->fProof->Connect("QueryResultReady(char *)",
3972 "TSessionViewer", this, "QueryResultReady(char *)");
3973 // display connection information on status bar
3974 TString msg;
3975 msg.Form("PROOF Cluster %s ready", fActDesc->fName.Data());
3976 fStatusBar->SetText(msg.Data(), 1);
3989 // update session information frame
3992 if (fActFrame != fSessionFrame) {
3996 }
3997 }
3998 }
3999 if (desc->fLogLevel < 0)
4000 desc->fLogLevel = 0;
4001 found = kTRUE;
4002 break;
4003 }
4004 }
4005 if (found) continue;
4006 newdesc = new TSessionDescription();
4007 // and fill information from Proof session
4008 newdesc->fTag = d->GetName();
4009 newdesc->fName = d->GetTitle();
4010 newdesc->fAddress = d->GetTitle();
4011 newdesc->fConnected = kFALSE;
4012 newdesc->fAttached = kFALSE;
4013 newdesc->fProofMgr = mgr;
4014 p = d->GetProof();
4015 if (p) {
4016 newdesc->fConnected = kTRUE;
4017 newdesc->fAttached = kTRUE;
4018 if (p->IsLite())
4019 newdesc->fAddress = "lite://";
4020 else
4021 newdesc->fAddress = p->GetMaster();
4022 newdesc->fConfigFile = p->GetConfFile();
4023 newdesc->fUserName = p->GetUser();
4024 newdesc->fPort = p->GetPort();
4025 newdesc->fLogLevel = p->GetLogLevel();
4026 newdesc->fProof = p;
4027 newdesc->fProof->Connect("Progress(Long64_t,Long64_t)",
4028 "TSessionQueryFrame", fQueryFrame,
4029 "Progress(Long64_t,Long64_t)");
4030 newdesc->fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
4031 "TSessionQueryFrame", fQueryFrame,
4032 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
4033 newdesc->fProof->Connect("StopProcess(Bool_t)",
4034 "TSessionQueryFrame", fQueryFrame,
4035 "IndicateStop(Bool_t)");
4036 newdesc->fProof->Connect(
4037 "ResetProgressDialog(const char*, Int_t,Long64_t,Long64_t)",
4038 "TSessionQueryFrame", fQueryFrame,
4039 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)");
4040 // enable timer used for status bar icon's animation
4041 EnableTimer();
4042 // change status bar right icon to connected pixmap
4043 ChangeRightLogo("monitor01.xpm");
4044 // do not animate yet
4046 // connect to signal "query result ready"
4047 newdesc->fProof->Connect("QueryResultReady(char *)",
4048 "TSessionViewer", this, "QueryResultReady(char *)");
4049 }
4050 newdesc->fQueries = new TList();
4051 newdesc->fPackages = new TList();
4052 if (newdesc->fLogLevel < 0)
4053 newdesc->fLogLevel = 0;
4054 newdesc->fActQuery = 0;
4055 newdesc->fLocal = kFALSE;
4056 newdesc->fSync = kFALSE;
4057 newdesc->fAutoEnable = kFALSE;
4058 newdesc->fNbHistos = 0;
4059 // add new session description in list tree
4060 if (p)
4061 item = fSessionHierarchy->AddItem(fSessionItem, newdesc->fName.Data(),
4063 else
4064 item = fSessionHierarchy->AddItem(fSessionItem, newdesc->fName.Data(),
4066 fSessionHierarchy->SetToolTipItem(item, "Proof Session");
4067 item ->SetUserData(newdesc);
4068 // and in our session description list
4069 fSessions->Add(newdesc);
4070 }
4071 }
4072 return;
4073 }
4074 TIter nextp(proofs);
4075 TProof *proof;
4076 // loop over existing Proof sessions
4077 while ((proof = (TProof *)nextp())) {
4078 TIter nexts(fSessions);
4079 found = kFALSE;
4080 // check if session is already in the list
4081 while ((desc = (TSessionDescription *)nexts())) {
4082 if (desc->fProof == proof) {
4083 desc->fConnected = kTRUE;
4084 desc->fAttached = kTRUE;
4085 found = kTRUE;
4086 break;
4087 }
4088 }
4089 if (found) continue;
4090 // create new session description
4091 newdesc = new TSessionDescription();
4092 // and fill information from Proof session
4093 newdesc->fName = proof->GetMaster();
4094 newdesc->fConfigFile = proof->GetConfFile();
4095 newdesc->fUserName = proof->GetUser();
4096 newdesc->fPort = proof->GetPort();
4097 newdesc->fLogLevel = proof->GetLogLevel();
4098 if (newdesc->fLogLevel < 0)
4099 newdesc->fLogLevel = 0;
4100 if (proof->IsLite())
4101 newdesc->fAddress = "lite://";
4102 else
4103 newdesc->fAddress = proof->GetMaster();
4104 newdesc->fQueries = new TList();
4105 newdesc->fPackages = new TList();
4106 newdesc->fProof = proof;
4107 newdesc->fActQuery = 0;
4108 newdesc->fConnected = kTRUE;
4109 newdesc->fAttached = kTRUE;
4110 newdesc->fLocal = kFALSE;
4111 newdesc->fSync = kFALSE;
4112 newdesc->fAutoEnable = kFALSE;
4113 newdesc->fNbHistos = 0;
4114 // add new session description in list tree
4115 item = fSessionHierarchy->AddItem(fSessionItem, newdesc->fName.Data(),
4117 fSessionHierarchy->SetToolTipItem(item, "Proof Session");
4118 item ->SetUserData(newdesc);
4119 // and in our session description list
4120 fSessions->Add(newdesc);
4121 }
4122 }
4123}
4124
4125////////////////////////////////////////////////////////////////////////////////
4126/// Update list of existing Proof sessions.
4127
4129{
4130 // get list of proof sessions
4131 TGListTreeItem *item;
4132 TList *sessions = fActDesc->fProofMgr->QuerySessions("");
4133 if (sessions) {
4134 TIter nextp(sessions);
4135 TProofDesc *pdesc;
4136 TProof *proof;
4137 TSessionDescription *newdesc;
4138 // loop over existing Proof sessions
4139 while ((pdesc = (TProofDesc *)nextp())) {
4140 TIter nexts(fSessions);
4141 TSessionDescription *desc = 0;
4142 Bool_t found = kFALSE;
4143 // check if session is already in the list
4144 while ((desc = (TSessionDescription *)nexts())) {
4145 if ((desc->fTag == pdesc->GetName()) ||
4146 (desc->fName == pdesc->GetTitle())) {
4147 desc->fConnected = kTRUE;
4148 found = kTRUE;
4149 break;
4150 }
4151 }
4152 if (found) continue;
4153 // create new session description
4154 newdesc = new TSessionDescription();
4155 // and fill information from Proof session
4156 newdesc->fTag = pdesc->GetName();
4157 newdesc->fName = pdesc->GetTitle();
4158 proof = pdesc->GetProof();
4159 if (proof) {
4160 newdesc->fConfigFile = proof->GetConfFile();
4161 newdesc->fUserName = proof->GetUser();
4162 newdesc->fPort = proof->GetPort();
4163 newdesc->fLogLevel = proof->GetLogLevel();
4164 if (newdesc->fLogLevel < 0)
4165 newdesc->fLogLevel = 0;
4166 if (proof->IsLite())
4167 newdesc->fAddress = "lite://";
4168 else
4169 newdesc->fAddress = proof->GetMaster();
4170 newdesc->fProof = proof;
4171 }
4172 else {
4173 newdesc->fProof = 0;
4174 newdesc->fConfigFile = "";
4175 newdesc->fUserName = fActDesc->fUserName;
4176 newdesc->fPort = fActDesc->fPort;
4177 newdesc->fLogLevel = 0;
4178 newdesc->fAddress = fActDesc->fAddress;
4179 }
4180 newdesc->fQueries = new TList();
4181 newdesc->fPackages = new TList();
4182 newdesc->fProofMgr = fActDesc->fProofMgr;
4183 newdesc->fActQuery = 0;
4184 newdesc->fConnected = kTRUE;
4185 newdesc->fAttached = kFALSE;
4186 newdesc->fLocal = kFALSE;
4187 newdesc->fSync = kFALSE;
4188 newdesc->fAutoEnable = kFALSE;
4189 newdesc->fNbHistos = 0;
4190 // add new session description in list tree
4191 item = fSessionHierarchy->AddItem(fSessionItem, newdesc->fName.Data(),
4193 fSessionHierarchy->SetToolTipItem(item, "Proof Session");
4194 item ->SetUserData(newdesc);
4195 // and in our session description list
4196 fSessions->Add(newdesc);
4197 // set actual description to the last one
4198 }
4199 }
4200}
4201
4202////////////////////////////////////////////////////////////////////////////////
4203/// Save actual configuration in config file "filename".
4204
4206{
4207 TSessionDescription *session;
4208 TQueryDescription *query;
4209 Int_t scnt = 0, qcnt = 1;
4210 const char *fname = filename ? filename : fConfigFile.Data();
4211
4212 delete fViewerEnv;
4213 gSystem->Unlink(fname);
4214 fViewerEnv = new TEnv();
4215
4216 fViewerEnv->SetValue("Option.Feedback",
4218 fViewerEnv->SetValue("Option.MasterHistos",
4220 fViewerEnv->SetValue("Option.MasterEvents",
4222 fViewerEnv->SetValue("Option.WorkerEvents",
4224
4225 Int_t i = 0;
4226 // browse list of feedback histos and check user's selected ones
4227 while (kFeedbackHistos[i]) {
4228 fViewerEnv->SetValue(Form("Option.%s",kFeedbackHistos[i]),
4230 i++;
4231 }
4232
4234 while ((session = (TSessionDescription *) snext())) {
4235 if ((scnt > 0) && ((session->fAddress.Length() < 3) ||
4236 session->fUserName.Length() < 2)) {
4237 // skip gROOT's list of sessions
4238 continue;
4239 }
4240 if ((scnt > 0) && (session->fName == session->fAddress)) {
4241 // skip gROOT's list of proofs
4242 continue;
4243 }
4244 TString sessionstring;
4245 sessionstring += session->fName;
4246 sessionstring += ";";
4247 sessionstring += session->fTag.Length() > 1 ? session->fTag.Data() : " ";
4248 sessionstring += ";";
4249 sessionstring += session->fAddress;
4250 sessionstring += ";";
4251 sessionstring += TString::Format("%d", session->fPort);
4252 sessionstring += ";";
4253 sessionstring += TString::Format("%d", session->fLogLevel);
4254 sessionstring += ";";
4255 sessionstring += session->fConfigFile.Length() > 1 ? session->fConfigFile.Data() : " ";
4256 sessionstring += ";";
4257 sessionstring += session->fUserName;
4258 sessionstring += ";";
4259 sessionstring += TString::Format("%d", session->fSync);
4260 sessionstring += ";";
4261 sessionstring += TString::Format("%d", session->fAutoEnable);
4262 if (scnt > 0) // skip local session
4263 fViewerEnv->SetValue(Form("SessionDescription.%d",scnt), sessionstring);
4264 scnt++;
4265
4266 TIter qnext(session->fQueries);
4267 while ((query = (TQueryDescription *) qnext())) {
4268 TString querystring;
4269 querystring += TString::Format("%d", query->fStatus);
4270 querystring += ";";
4271 querystring += query->fReference.Length() > 1 ? query->fReference.Data() : " ";
4272 querystring += ";";
4273 querystring += query->fQueryName;
4274 querystring += ";";
4275 querystring += query->fSelectorString.Length() > 1 ? query->fSelectorString.Data() : " ";
4276 querystring += ";";
4277 querystring += query->fTDSetString.Length() > 1 ? query->fTDSetString.Data() : " ";
4278 querystring += ";";
4279 querystring += query->fOptions.Length() > 1 ? query->fOptions.Data() : " ";
4280 querystring += ";";
4281 querystring += query->fEventList.Length() > 1 ? query->fEventList.Data() : " ";
4282 querystring += ";";
4283 querystring += TString::Format("%d",query->fNbFiles);
4284 querystring += ";";
4285 querystring += TString::Format("%lld",query->fNoEntries);
4286 querystring += ";";
4287 querystring += TString::Format("%lld",query->fFirstEntry);
4288 fViewerEnv->SetValue(Form("QueryDescription.%d",qcnt), querystring);
4289 qcnt++;
4290 }
4291 }
4292
4293 fViewerEnv->WriteFile(fname);
4294}
4295
4296////////////////////////////////////////////////////////////////////////////////
4297/// Build main session viewer frame and subframes.
4298
4300{
4301 TString buf;
4302 fActDesc = 0;
4303 fActFrame = 0;
4304 fLogWindow = 0;
4305 fBusy = kFALSE;
4306 fAutoSave = kTRUE;
4308 fStart = fElapsed = 0;
4309
4311 // set minimun size
4312 SetWMSizeHints(400 + 200, 370+50, 2000, 1000, 1, 1);
4313
4314 // collect icons
4315 fLocal = fClient->GetPicture("local_session.xpm");
4316 fProofCon = fClient->GetPicture("proof_connected.xpm");
4317 fProofDiscon = fClient->GetPicture("proof_disconnected.xpm");
4318 fQueryCon = fClient->GetPicture("query_connected.xpm");
4319 fQueryDiscon = fClient->GetPicture("query_disconnected.xpm");
4320 fBaseIcon = fClient->GetPicture("proof_base.xpm");
4321
4322 //--- File menu
4324 fFileMenu->AddEntry("&Load Config...", kFileLoadConfig);
4325 fFileMenu->AddEntry("&Save Config...", kFileSaveConfig);
4327 fFileMenu->AddEntry("&Close Viewer", kFileCloseViewer);
4329 fFileMenu->AddEntry("&Quit ROOT", kFileQuit);
4330
4331 //--- Session menu
4332 fSessionMenu = new TGPopupMenu(gClient->GetDefaultRoot());
4333 fSessionMenu->AddLabel("Session Management");
4335 fSessionMenu->AddEntry("&New Session", kSessionNew);
4336 fSessionMenu->AddEntry("&Add to the list", kSessionAdd);
4339 fSessionMenu->AddEntry("&Connect...", kSessionConnect);
4340 fSessionMenu->AddEntry("&Disconnect", kSessionDisconnect);
4341 fSessionMenu->AddEntry("Shutdo&wn", kSessionShutdown);
4342 fSessionMenu->AddEntry("&Show status",kSessionShowStatus);
4343 fSessionMenu->AddEntry("&Get Queries",kSessionGetQueries);
4348
4349 //--- Query menu
4350 fQueryMenu = new TGPopupMenu(gClient->GetDefaultRoot());
4351 fQueryMenu->AddLabel("Query Management");
4353 fQueryMenu->AddEntry("&New...", kQueryNew);
4354 fQueryMenu->AddEntry("&Edit", kQueryEdit);
4355 fQueryMenu->AddEntry("&Submit", kQuerySubmit);
4357 fQueryMenu->AddEntry("Start &Viewer", kQueryStartViewer);
4359 fQueryMenu->AddEntry("&Delete", kQueryDelete);
4360
4361 fViewerEnv = 0;
4362#ifdef WIN32
4364#else
4366#endif
4367
4369 Int_t i = 0;
4370 while (kFeedbackHistos[i]) {
4372 i++;
4373 }
4374 fCascadeMenu->AddEntry("User defined...", 50);
4375 // disable it for now (until implemented)
4377
4378 //--- Options menu
4380 fOptionsMenu->AddLabel("Global Options");
4382 fOptionsMenu->AddEntry("&Autosave Config", kOptionsAutoSave);
4384 fOptionsMenu->AddEntry("Master &Histos", kOptionsStatsHist);
4385 fOptionsMenu->AddEntry("&Master Events", kOptionsStatsTrace);
4386 fOptionsMenu->AddEntry("&Worker Events", kOptionsSlaveStatsTrace);
4388 fOptionsMenu->AddEntry("Feedback &Active", kOptionsFeedback);
4390 fOptionsMenu->AddPopup("&Feedback Histos", fCascadeMenu);
4392
4393 //--- Help menu
4394 fHelpMenu = new TGPopupMenu(gClient->GetDefaultRoot());
4395 fHelpMenu->AddEntry("&About ROOT...", kHelpAbout);
4396
4397 fFileMenu->Associate(this);
4398 fSessionMenu->Associate(this);
4399 fQueryMenu->Associate(this);
4400 fOptionsMenu->Associate(this);
4401 fCascadeMenu->Associate(this);
4402 fHelpMenu->Associate(this);
4403
4404 //--- create menubar and add popup menus
4405 fMenuBar = new TGMenuBar(this, 1, 1, kHorizontalFrame);
4406
4408 kLHintsLeft, 0, 4, 0, 0));
4410 kLHintsLeft, 0, 4, 0, 0));
4412 kLHintsLeft, 0, 4, 0, 0));
4414 kLHintsLeft, 0, 4, 0, 0));
4416 kLHintsRight));
4417
4418 TGHorizontal3DLine *toolBarSep = new TGHorizontal3DLine(this);
4419 AddFrame(toolBarSep, new TGLayoutHints(kLHintsTop | kLHintsExpandX));
4420
4422 kLHintsExpandX, 0, 0, 1, 1));
4423
4424 toolBarSep = new TGHorizontal3DLine(this);
4425 AddFrame(toolBarSep, new TGLayoutHints(kLHintsTop | kLHintsExpandX));
4426
4427 //---- toolbar
4428
4429 int spacing = 8;
4430 fToolBar = new TGToolBar(this, 60, 20, kHorizontalFrame);
4431 for (int ii = 0; xpm_toolbar[ii]; ii++) {
4432 tb_data[ii].fPixmap = xpm_toolbar[ii];
4433 if (strlen(xpm_toolbar[ii]) == 0) {
4434 spacing = 8;
4435 continue;
4436 }
4437 fToolBar->AddButton(this, &tb_data[ii], spacing);
4438 spacing = 0;
4439 }
4441 toolBarSep = new TGHorizontal3DLine(this);
4442 AddFrame(toolBarSep, new TGLayoutHints(kLHintsTop | kLHintsExpandX));
4445
4448 fPopupSrv->AddEntry("Disconnect",kSessionDisconnect);
4449 fPopupSrv->AddEntry("Shutdown",kSessionShutdown);
4451 fPopupSrv->AddEntry("Show status",kSessionShowStatus);
4452 fPopupSrv->AddEntry("Delete", kSessionDelete);
4453 fPopupSrv->AddEntry("Get Queries",kSessionGetQueries);
4455 fPopupSrv->AddEntry("Cleanup", kSessionCleanup);
4457 fPopupSrv->Connect("Activated(Int_t)","TSessionViewer", this,
4458 "MyHandleMenu(Int_t)");
4459
4461 fPopupQry->AddEntry("Edit",kQueryEdit);
4462 fPopupQry->AddEntry("Submit",kQuerySubmit);
4464 fPopupQry->AddEntry("Start &Viewer", kQueryStartViewer);
4466 fPopupQry->AddEntry("Delete",kQueryDelete);
4467 fPopupQry->Connect("Activated(Int_t)","TSessionViewer", this,
4468 "MyHandleMenu(Int_t)");
4469
4470
4485
4486 //--- Horizontal mother frame -----------------------------------------------
4487 fHf = new TGHorizontalFrame(this, 10, 10);
4489
4490 //--- fV1 -------------------------------------------------------------------
4491 fV1 = new TGVerticalFrame(fHf, 100, 100, kFixedWidth);
4493
4494 fTreeView = new TGCanvas(fV1, 100, 200, kSunkenFrame | kDoubleBorder);
4496 2, 0, 0, 0));
4499 fSessionHierarchy->Connect("Clicked(TGListTreeItem*,Int_t,Int_t,Int_t)",
4500 "TSessionViewer", this,
4501 "OnListTreeClicked(TGListTreeItem*, Int_t, Int_t, Int_t)");
4502 fSessionHierarchy->Connect("DoubleClicked(TGListTreeItem*,Int_t)",
4503 "TSessionViewer", this,
4504 "OnListTreeDoubleClicked(TGListTreeItem*, Int_t)");
4506
4507 //--- fV2 -------------------------------------------------------------------
4508 fV2 = new TGVerticalFrame(fHf, 350, 310);
4510
4511 //--- Server Frame ----------------------------------------------------------
4512 fServerFrame = new TSessionServerFrame(fV2, 350, 310);
4513 fSessions = new TList;
4515 fServerFrame->Build(this);
4517 kLHintsExpandY, 2, 0, 1, 2));
4518
4519 //--- Session Frame ---------------------------------------------------------
4520 fSessionFrame = new TSessionFrame(fV2, 350, 310);
4521 fSessionFrame->Build(this);
4523 kLHintsExpandY, 2, 0, 1, 2));
4524
4525 //--- Query Frame -----------------------------------------------------------
4526 fQueryFrame = new TSessionQueryFrame(fV2, 350, 310);
4527 fQueryFrame->Build(this);
4529 kLHintsExpandY, 2, 0, 1, 2));
4530
4531 //--- Output Frame ----------------------------------------------------------
4532 fOutputFrame = new TSessionOutputFrame(fV2, 350, 310);
4533 fOutputFrame->Build(this);
4535 kLHintsExpandY, 2, 0, 1, 2));
4536
4537 //--- Input Frame -----------------------------------------------------------
4538 fInputFrame = new TSessionInputFrame(fV2, 350, 310);
4539 fInputFrame->Build(this);
4541 kLHintsExpandY, 2, 0, 1, 2));
4542
4544
4545 // add vertical splitter between list tree and frames
4547 splitter->SetFrame(fV1, kTRUE);
4551
4554
4557
4558 // if description available, update server infos frame
4559 if (fActDesc) {
4560 if (!fActDesc->fLocal) {
4562 }
4563 else {
4566 }
4567 }
4568
4569 //--- Status Bar ------------------------------------------------------------
4570 int parts[] = { 36, 49, 15 };
4571 fStatusBar = new TGStatusBar(this, 10, 10);
4573 fStatusBar->SetParts(parts, 3);
4574 for (int p = 0; p < 3; ++p)
4577 kLHintsExpandX, 0, 0, 1, 1));
4578
4579 // connection icon (animation) and time info
4580 fStatusBar->SetText(" 00:00:00", 2);
4581 TGCompositeFrame *leftpart = fStatusBar->GetBarPart(2);
4582 fRightIconPicture = (TGPicture *)fClient->GetPicture("proof_disconnected.xpm");
4583 fRightIcon = new TGIcon(leftpart, fRightIconPicture,
4585 leftpart->AddFrame(fRightIcon, new TGLayoutHints(kLHintsLeft, 2, 0, 0, 0));
4586
4587 // connection progress bar
4588 TGCompositeFrame *rightpart = fStatusBar->GetBarPart(0);
4591 fConnectProg->SetBarColor("green");
4592 rightpart->AddFrame(fConnectProg, new TGLayoutHints(kLHintsExpandX, 1, 1, 1, 1));
4593
4594 // add user info
4596 buf.Form("User : %s - %s", fUserGroup->fRealName.Data(),
4598 fStatusBar->SetText(buf.Data(), 1);
4599
4600 fTimer = 0;
4601
4602 // create context menu
4603 fContextMenu = new TContextMenu("SessionViewerContextMenu") ;
4604
4605 SetWindowName("ROOT Session Viewer");
4606 MapSubwindows();
4607 MapWindow();
4608
4609 // hide frames
4619 Resize(610, 420);
4620}
4621
4622////////////////////////////////////////////////////////////////////////////////
4623/// Destructor.
4624
4626{
4627 delete fUserGroup;
4628 if (gSessionViewer == this)
4629 gSessionViewer = 0;
4630}
4631
4632////////////////////////////////////////////////////////////////////////////////
4633/// Handle mouse clicks in list tree.
4634
4636 Int_t x, Int_t y)
4637{
4638 TList *objlist;
4639 TObject *obj;
4640 TString msg;
4641
4645 if (entry->GetParent() == 0) { // PROOF
4646 // switch frames only if actual one doesn't match
4647 if (fActFrame != fServerFrame) {
4651 }
4660 }
4661 else if (entry->GetParent()->GetParent() == 0) { // Server
4662 if (entry->GetUserData()) {
4663 obj = (TObject *)entry->GetUserData();
4664 if (!obj || obj->IsA() != TSessionDescription::Class())
4665 return;
4666 // update server frame information
4669 // if Proof valid, update connection infos
4672 fActDesc->fProof->cd();
4673 msg.Form("PROOF Cluster %s ready", fActDesc->fName.Data());
4674 }
4675 else {
4676 msg.Form("PROOF Cluster %s not connected", fActDesc->fName.Data());
4677 }
4678 fStatusBar->SetText(msg.Data(), 1);
4679 }
4680 if ((fActDesc->fConnected) && (fActDesc->fAttached)) {
4687 }
4688 else {
4693 }
4694 // local session
4695 if (fActDesc->fLocal) {
4696 if (fActFrame != fSessionFrame) {
4702 }
4706 }
4707 // proof session not connected
4708 if ((!fActDesc->fLocal) && (!fActDesc->fAttached) &&
4709 (fActFrame != fServerFrame)) {
4713 }
4714 // proof session connected
4715 if ((!fActDesc->fLocal) && (fActDesc->fConnected) &&
4716 (fActDesc->fAttached)) {
4717 if (fActFrame != fSessionFrame) {
4721 }
4723 }
4726 if (fActDesc->fAutoEnable)
4728 else
4730 // update session information frame
4735 }
4736 else if (entry->GetParent()->GetParent()->GetParent() == 0) { // query
4737 obj = (TObject *)entry->GetParent()->GetUserData();
4738 if (obj && obj->IsA() == TSessionDescription::Class()) {
4740 }
4741 obj = (TObject *)entry->GetUserData();
4742 if (obj && obj->IsA() == TQueryDescription::Class()) {
4744 }
4745 // update query information and buttons state
4748 if (fActFrame != fQueryFrame) {
4752 }
4753 if ((fActDesc->fConnected) && (fActDesc->fAttached) &&
4758 // trick to update feedback histos
4759 OnCascadeMenu();
4760 }
4761 else { // a list (input, output)
4762 obj = (TObject *)entry->GetParent()->GetParent()->GetUserData();
4763 if (obj && obj->IsA() == TSessionDescription::Class()) {
4765 }
4766 obj = (TObject *)entry->GetParent()->GetUserData();
4767 if (obj && obj->IsA() == TQueryDescription::Class()) {
4769 }
4770 if (fActDesc->fActQuery) {
4771 // update input/output list views
4774 if (fActDesc->fActQuery->fResult) {
4775 objlist = fActDesc->fActQuery->fResult->GetOutputList();
4776 if (objlist) {
4777 TIter nexto(objlist);
4778 while ((obj = (TObject *) nexto())) {
4779 fOutputFrame->AddObject(obj);
4780 }
4781 }
4782 objlist = fActDesc->fActQuery->fResult->GetInputList();
4783 if (objlist) {
4784 TIter nexti(objlist);
4785 while ((obj = (TObject *) nexti())) {
4786 fInputFrame->AddObject(obj);
4787 }
4788 }
4789 }
4790 else {
4791 TChain *chain = (TChain *)fActDesc->fActQuery->fChain;
4792 if (chain && chain->GetPlayer()) {
4793 objlist = chain->GetPlayer()->GetSelectorFromFile()->GetOutputList();
4794 if (objlist) {
4795 TIter nexto(objlist);
4796 while ((obj = (TObject *) nexto())) {
4797 fOutputFrame->AddObject(obj);
4798 }
4799 }
4800 }
4801 }
4806 }
4807 // switch frames
4808 if (strstr(entry->GetText(),"Output")) {
4809 if (fActFrame != fOutputFrame) {
4813 }
4814 }
4815 else if (strstr(entry->GetText(),"Input")) {
4816 if (fActFrame != fInputFrame) {
4820 }
4821 }
4822 }
4823 if (btn == 3) { // right button
4824 // place popup menus
4826 if (!item) return;
4827 obj = (TObject *)item->GetUserData();
4828 if (obj && obj->IsA() == TQueryDescription::Class()) {
4829 fPopupQry->PlaceMenu(x, y, 1, 1);
4830 }
4831 else if (obj && obj->IsA() == TSessionDescription::Class()) {
4832 if (!fActDesc->fLocal)
4833 fPopupSrv->PlaceMenu(x, y, 1, 1);
4834 }
4835 }
4836 // enable / disable menu entries
4854 }
4855 else {
4860 if (entry->GetParent() != 0)
4875 }
4876 if (fActDesc->fLocal) {
4889 }
4890}
4891
4892////////////////////////////////////////////////////////////////////////////////
4893/// Handle mouse double clicks in list tree (connect to server).
4894
4896{
4897 if (entry == fSessionItem)
4898 return;
4899 if (entry->GetParent()->GetParent() == 0) { // Server
4900 if (entry->GetUserData()) {
4901 TObject *obj = (TObject *)entry->GetUserData();
4902 if ((!obj) || (obj->IsA() != TSessionDescription::Class()))
4903 return;
4905 // if Proof valid, update connection infos
4906 }
4907 if ((!fActDesc->fLocal) && ((!fActDesc->fConnected) ||
4908 (!fActDesc->fAttached))) {
4910 }
4911 }
4912}
4913
4914////////////////////////////////////////////////////////////////////////////////
4915/// Terminate Session : save configuration, clean temporary files and close
4916/// Proof connections.
4917
4919{
4920 // clean-up temporary files
4921 TString pathtmp;
4923 if (!gSystem->AccessPathName(pathtmp)) {
4924 gSystem->Unlink(pathtmp);
4925 }
4927 if (!gSystem->AccessPathName(pathtmp)) {
4928 gSystem->Unlink(pathtmp);
4929 }
4930 // close opened Proof sessions (if any)
4931 TIter next(fSessions);
4932 TSessionDescription *desc = 0;
4933 while ((desc = (TSessionDescription *)next())) {
4934 if (desc->fAttached && desc->fProof &&
4935 desc->fProof->IsValid())
4936 desc->fProof->Detach();
4937 }
4938 // Save configuration
4939 if (fAutoSave)
4941}
4942
4943////////////////////////////////////////////////////////////////////////////////
4944/// Close main Session Viewer window.
4945
4947{
4948 // clean-up temporary files
4949 TString pathtmp;
4951 if (!gSystem->AccessPathName(pathtmp)) {
4952 gSystem->Unlink(pathtmp);
4953 }
4955 if (!gSystem->AccessPathName(pathtmp)) {
4956 gSystem->Unlink(pathtmp);
4957 }
4958 // Save configuration
4959 if (fAutoSave)
4961 Cleanup();
4962 fSessions->Delete();
4963 if (fSessionItem)
4965 delete fSessionHierarchy; // this has been put int TGCanvas which isn't a
4966 // TGComposite frame and doesn't do cleanups.
4973 delete fTimer;
4974 DeleteWindow();
4975}
4976
4977////////////////////////////////////////////////////////////////////////////////
4978/// Change the right logo (used for animation).
4979
4981{
4985}
4986
4987////////////////////////////////////////////////////////////////////////////////
4988/// Enable animation timer.
4989
4991{
4992 if (!fTimer) fTimer = new TTimer(this, 500);
4993 fTimer->Reset();
4994 fTimer->TurnOn();
4995 time( &fStart );
4996}
4997
4998////////////////////////////////////////////////////////////////////////////////
4999/// Disable animation timer.
5000
5002{
5003 if (fTimer)
5004 fTimer->TurnOff();
5005 ChangeRightLogo("proof_disconnected.xpm");
5006}
5007
5008////////////////////////////////////////////////////////////////////////////////
5009/// Handle animation timer.
5010
5012{
5013 TString buf;
5014 struct tm *connected;
5015 Int_t count = gRandom->Integer(4);
5016 if (count > 3) {
5017 count = 0;
5018 }
5019 if (fChangePic)
5020 ChangeRightLogo(xpm_names[count]);
5021 time( &fElapsed );
5022 time_t elapsed_time = (time_t)difftime( fElapsed, fStart );
5023 connected = gmtime( &elapsed_time );
5024 if (connected) {
5025 buf.Form(" %02d:%02d:%02d", connected->tm_hour,
5026 connected->tm_min, connected->tm_sec);
5027 fStatusBar->SetText(buf.Data(), 2);
5028 }
5029 else {
5030 fStatusBar->SetText(" 00:00:00", 2);
5031 }
5032
5033 if (fActDesc->fLocal) {
5034 if ((fActDesc->fActQuery) &&
5037 TChain *chain = (TChain *)fActDesc->fActQuery->fChain;
5038 if (chain)
5040 chain->GetReadEntry()+1);
5041 }
5042 }
5043
5044 fTimer->Reset();
5045 return kTRUE;
5046}
5047
5048////////////////////////////////////////////////////////////////////////////////
5049/// Load/append a log msg in the log frame.
5050
5051void TSessionViewer::LogMessage(const char *msg, Bool_t all)
5052{
5053 if (fLogWindow) {
5054 if (all) {
5055 // load buffer
5056 fLogWindow->LoadBuffer(msg);
5057 } else {
5058 // append
5059 fLogWindow->AddBuffer(msg);
5060 }
5061 }
5062}
5063
5064////////////////////////////////////////////////////////////////////////////////
5065/// Handle signal "query result ready" coming from Proof session.
5066
5068{
5069 TString strtmp;
5070 strtmp.Form("Query Result Ready for %s", query);
5071 // show information on status bar
5072 ShowInfo(strtmp.Data());
5073 TGListTreeItem *item=0, *item2=0;
5074 TQueryDescription *lquery = 0;
5075 // loop over actual queries to find which one is ready
5076
5077 TIter nexts(fSessions);
5078 TSessionDescription *desc = 0;
5079 // check if session is already in the list
5080 while ((desc = (TSessionDescription *)nexts())) {
5081 if (desc && !desc->fAttached)
5082 continue;
5083 TIter nextp(desc->fQueries);
5084 while ((lquery = (TQueryDescription *)nextp())) {
5085 if (lquery->fReference.Contains(query)) {
5086 // results are ready for this query
5087 lquery->fResult = desc->fProof->GetQueryResult(query);
5089 if (!lquery->fResult)
5090 break;
5091 // get query status
5092 lquery->fStatus = lquery->fResult->IsFinalized() ?
5095 // get data set
5096 TObject *o = lquery->fResult->GetInputObject("TDSet");
5097 if (o)
5098 lquery->fChain = (TDSet *) o;
5100 if (item) {
5101 item2 = fSessionHierarchy->FindItemByObj(item, lquery);
5102 }
5103 if (item2) {
5104 // add input and output list entries
5105 if (lquery->fResult->GetInputList())
5106 if (!fSessionHierarchy->FindChildByName(item2, "InputList"))
5107 fSessionHierarchy->AddItem(item2, "InputList");
5108 if (lquery->fResult->GetOutputList())
5109 if (!fSessionHierarchy->FindChildByName(item2, "OutputList"))
5110 fSessionHierarchy->AddItem(item2, "OutputList");
5111 }
5112 // update list tree, query frame information, and buttons state
5116 fQueryFrame->UpdateButtons(lquery);
5117 break;
5118 }
5119 }
5120 }
5121}
5122
5123////////////////////////////////////////////////////////////////////////////////
5124/// Clean-up Proof session.
5125
5127{
5129 if (!item) return;
5130 TObject *obj = (TObject *)item->GetUserData();
5131 if (!obj || obj->IsA() != TSessionDescription::Class()) return;
5132 if (!fActDesc->fProof || !fActDesc->fProof->IsValid()) return;
5133 TString m;
5134 m.Form("Are you sure to cleanup the session \"%s::%s\"",
5136 Int_t result;
5137 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), 0,
5139 if (result == kMBYes) {
5140 // send cleanup request for the session specified by the tag reference
5141 TString sessiontag;
5142 sessiontag.Form("session-%s",fActDesc->fTag.Data());
5143 fActDesc->fProof->CleanupSession(sessiontag.Data());
5144 // clear the list of queries
5148 if (fAutoSave)
5150 }
5151 // update list tree
5154}
5155
5156////////////////////////////////////////////////////////////////////////////////
5157/// Reset Proof session.
5158
5160{
5162 if (!item) return;
5163 TObject *obj = (TObject *)item->GetUserData();
5164 if (!obj || obj->IsA() != TSessionDescription::Class()) return;
5165 if (!fActDesc->fProof || !fActDesc->fProof->IsValid()) return;
5166 TString m;
5167 m.Form("Do you really want to reset the session \"%s::%s\"",
5169 Int_t result;
5170 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), 0,
5172 if (result == kMBYes) {
5173 // reset the session
5175 if (mgr && mgr->IsValid()) {
5176 mgr->Reset(fActDesc->fUserName);
5177 }
5178 // reset connected flag
5180 fActDesc->fProof = 0;
5181 // disable animation timer
5182 DisableTimer();
5183 // change list tree item picture to disconnected pixmap
5186 if (item2) item2->SetPictures(fProofDiscon, fProofDiscon);
5187
5191 fStatusBar->SetText("", 1);
5192 }
5193 // update list tree
5196}
5197
5198////////////////////////////////////////////////////////////////////////////////
5199/// Delete query from list tree and ask user if they want to delete it also
5200/// from server.
5201
5203{
5205 if (!item) return;
5206 TObject *obj = (TObject *)item->GetUserData();
5207 if (!obj || obj->IsA() != TQueryDescription::Class()) return;
5208 TQueryDescription *query = (TQueryDescription *)obj;
5209 TString m;
5210 Int_t result = 0;
5211
5215 new TGMsgBox(fClient->GetRoot(), this, "Delete Query",
5216 "Deleting running queries is not allowed", kMBIconExclamation,
5217 kMBOk, &result);
5218 return;
5219 }
5220 m.Form("Do you want to delete query \"%s\" from server too ?",
5221 query->fQueryName.Data());
5222 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), kMBIconQuestion,
5224 }
5225 else {
5226 m.Form("Dou you really want to delete query \"%s\" ?",
5227 query->fQueryName.Data());
5228 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), kMBIconQuestion,
5229 kMBOk | kMBCancel, &result);
5230 }
5231 if (result == kMBYes) {
5232 fActDesc->fProof->Remove(query->fReference.Data());
5233 fActDesc->fQueries->Remove((TObject *)query);
5235 delete query;
5236 }
5237 else if (result == kMBNo || result == kMBOk) {
5238 fActDesc->fQueries->Remove((TObject *)query);
5240 delete query;
5241 }
5244 if (fAutoSave)
5246}
5247
5248////////////////////////////////////////////////////////////////////////////////
5249/// Edit currently selected query.
5250
5252{
5254 if (!item) return;
5255 TObject *obj = (TObject *)item->GetUserData();
5256 if (!obj || obj->IsA() != TQueryDescription::Class()) return;
5257 TQueryDescription *query = (TQueryDescription *)obj;
5258 TNewQueryDlg *dlg = new TNewQueryDlg(this, 350, 310, query, kTRUE);
5259 dlg->Popup();
5260}
5261
5262////////////////////////////////////////////////////////////////////////////////
5263/// Start TreeViewer from selected TChain.
5264
5266{
5268 if (!item) return;
5269 TObject *obj = (TObject *)item->GetUserData();
5270 if (!obj || obj->IsA() != TQueryDescription::Class()) return;
5271 TQueryDescription *query = (TQueryDescription *)obj;
5272 if (!query->fChain && query->fResult &&
5273 (obj = query->fResult->GetInputObject("TDSet"))) {
5274 query->fChain = (TDSet *) obj;
5275 }
5276 if (!query->fChain) return;
5277 if (query->fChain->IsA() == TChain::Class())
5278 ((TChain *)query->fChain)->StartViewer();
5279 else if (query->fChain->IsA() == TDSet::Class())
5280 ((TDSet *)query->fChain)->StartViewer();
5281}
5282
5283////////////////////////////////////////////////////////////////////////////////
5284/// Query the list of uploaded packages from proof and display it
5285/// into a new text window.
5286
5288{
5289 Window_t wdummy;
5290 Int_t ax, ay;
5291
5292 if (fActDesc->fLocal) return;
5293 if (!fActDesc->fProof || !fActDesc->fProof->IsValid())
5294 return;
5295 TString pathtmp = TString::Format("%s/%s", gSystem->TempDirectory(),
5297 // redirect stdout/stderr to temp file
5298 if (gSystem->RedirectOutput(pathtmp.Data(), "w") != 0) {
5299 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
5300 return;
5301 }
5303 // restore stdout/stderr
5304 if (gSystem->RedirectOutput(0) != 0) {
5305 Error("ShowStatus", "stdout/stderr retore failed; skipping");
5306 return;
5307 }
5308 if (!fLogWindow) {
5309 fLogWindow = new TSessionLogView(this, 700, 100);
5310 } else {
5311 // Clear window
5312 fLogWindow->Clear();
5313 }
5314 fLogWindow->LoadFile(pathtmp.Data());
5315 gVirtualX->TranslateCoordinates(GetId(), fClient->GetDefaultRoot()->GetId(),
5316 0, 0, ax, ay, wdummy);
5317 fLogWindow->Move(ax, ay + GetHeight() + 35);
5318 fLogWindow->Popup();
5319}
5320
5321////////////////////////////////////////////////////////////////////////////////
5322/// Update the list of packages.
5323
5325{
5326 TObjString *packname;
5327 TPackageDescription *package;
5331 //fActDesc->fPackages->Clear();
5333 if(packlist) {
5334 TIter nextenabled(packlist);
5335 while ((packname = (TObjString *)nextenabled())) {
5336 package = new TPackageDescription;
5337 package->fName = packname->GetName();
5338 package->fName += ".par";
5339 package->fPathName = package->fName;
5340 package->fId = fActDesc->fPackages->GetEntries();
5341 package->fUploaded = kTRUE;
5342 package->fEnabled = kTRUE;
5343 if (!fActDesc->fPackages->FindObject(package->fName)) {
5344 fActDesc->fPackages->Add((TObject *)package);
5345 }
5346 }
5347 }
5348 packlist = fActDesc->fProof->GetListOfPackages();
5349 if(packlist) {
5350 TIter nextpack(packlist);
5351 while ((packname = (TObjString *)nextpack())) {
5352 package = new TPackageDescription;
5353 package->fName = packname->GetName();
5354 package->fName += ".par";
5355 package->fPathName = package->fName;
5356 package->fId = fActDesc->fPackages->GetEntries();
5357 package->fUploaded = kTRUE;
5358 package->fEnabled = kFALSE;
5359 if (!fActDesc->fPackages->FindObject(package->fName)) {
5360 fActDesc->fPackages->Add((TObject *)package);
5361 }
5362 }
5363 }
5364 }
5365// fSessionFrame->UpdatePackages();
5366}
5367
5368////////////////////////////////////////////////////////////////////////////////
5369/// Query list of enabled packages from proof and display it
5370/// into a new text window.
5371
5373{
5374 Window_t wdummy;
5375 Int_t ax, ay;
5376
5377 if (fActDesc->fLocal) return;
5378 if (!fActDesc->fProof || !fActDesc->fProof->IsValid())
5379 return;
5380 TString pathtmp = TString::Format("%s/%s", gSystem->TempDirectory(),
5382 // redirect stdout/stderr to temp file
5383 if (gSystem->RedirectOutput(pathtmp.Data(), "w") != 0) {
5384 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
5385 return;
5386 }
5388 // restore stdout/stderr
5389 if (gSystem->RedirectOutput(0) != 0) {
5390 Error("ShowStatus", "stdout/stderr retore failed; skipping");
5391 return;
5392 }
5393 if (!fLogWindow) {
5394 fLogWindow = new TSessionLogView(this, 700, 100);
5395 } else {
5396 // Clear window
5397 fLogWindow->Clear();
5398 }
5399 fLogWindow->LoadFile(pathtmp.Data());
5400 gVirtualX->TranslateCoordinates(GetId(), fClient->GetDefaultRoot()->GetId(),
5401 0, 0, ax, ay, wdummy);
5402 fLogWindow->Move(ax, ay + GetHeight() + 35);
5403 fLogWindow->Popup();
5404}
5405
5406////////////////////////////////////////////////////////////////////////////////
5407/// Display the content of the temporary log file for queryref
5408/// into a new text window.
5409
5410void TSessionViewer::ShowLog(const char *queryref)
5411{
5412 Window_t wdummy;
5413 Int_t ax, ay;
5414
5415 if (fActDesc->fProof) {
5416 gVirtualX->SetCursor(GetId(),gVirtualX->CreateCursor(kWatch));
5417 if (!fLogWindow) {
5418 fLogWindow = new TSessionLogView(this, 700, 100);
5419 } else {
5420 // Clear window
5421 fLogWindow->Clear();
5422 }
5423 fActDesc->fProof->Connect("LogMessage(const char*,Bool_t)",
5424 "TSessionViewer", this, "LogMessage(const char*,Bool_t)");
5427 if (queryref)
5428 fActDesc->fProof->ShowLog(queryref);
5429 else
5430 fActDesc->fProof->ShowLog(0);
5431 fActDesc->fProof->SendLogToWindow(logonly);
5432 // set log window position at the bottom of Session Viewer
5433 gVirtualX->TranslateCoordinates(GetId(),
5434 fClient->GetDefaultRoot()->GetId(), 0, 0, ax, ay, wdummy);
5435 fLogWindow->Move(ax, ay + GetHeight() + 35);
5436 fLogWindow->Popup();
5437 gVirtualX->SetCursor(GetId(), 0);
5438 }
5439}
5440
5441////////////////////////////////////////////////////////////////////////////////
5442/// Display text in status bar.
5443
5444void TSessionViewer::ShowInfo(const char *txt)
5445{
5446 fStatusBar->SetText(txt,0);
5449}
5450
5451////////////////////////////////////////////////////////////////////////////////
5452/// Retrieve and display Proof status.
5453
5455{
5456 Window_t wdummy;
5457 Int_t ax, ay;
5458
5459 if (!fActDesc->fProof || !fActDesc->fProof->IsValid())
5460 return;
5461 TString pathtmp = TString::Format("%s/%s", gSystem->TempDirectory(),
5463 // redirect stdout/stderr to temp file
5464 if (gSystem->RedirectOutput(pathtmp.Data(), "w") != 0) {
5465 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
5466 return;
5467 }
5469 // restore stdout/stderr
5470 if (gSystem->RedirectOutput(0) != 0) {
5471 Error("ShowStatus", "stdout/stderr retore failed; skipping");
5472 return;
5473 }
5474 if (!fLogWindow) {
5475 fLogWindow = new TSessionLogView(this, 700, 100);
5476 } else {
5477 // Clear window
5478 fLogWindow->Clear();
5479 }
5480 fLogWindow->LoadFile(pathtmp.Data());
5481 gVirtualX->TranslateCoordinates(GetId(), fClient->GetDefaultRoot()->GetId(),
5482 0, 0, ax, ay, wdummy);
5483 fLogWindow->Move(ax, ay + GetHeight() + 35);
5484 fLogWindow->Popup();
5485}
5486
5487////////////////////////////////////////////////////////////////////////////////
5488/// Handle startup message (connection progress) coming from Proof session.
5489
5491{
5492 Float_t pos = Float_t(Double_t(done * 100)/Double_t(total));
5494 fStatusBar->SetText(msg, 1);
5495}
5496
5497////////////////////////////////////////////////////////////////////////////////
5498/// Handle session viewer custom popup menus.
5499
5501{
5502 switch (id) {
5503
5504 case kSessionDelete:
5506 break;
5507
5508 case kSessionConnect:
5510 break;
5511
5512 case kSessionDisconnect:
5514 break;
5515
5516 case kSessionShutdown:
5518 break;
5519
5520 case kSessionCleanup:
5522 break;
5523
5524 case kSessionReset:
5525 ResetSession();
5526 break;
5527
5528 case kSessionBrowse:
5529 if (fActDesc->fProof && fActDesc->fProof->IsValid()) {
5530 TBrowser *b = new TBrowser();
5532 }
5533 break;
5534
5535 case kSessionShowStatus:
5536 ShowStatus();
5537 break;
5538
5539 case kSessionGetQueries:
5541 break;
5542
5543 case kQueryEdit:
5544 EditQuery();
5545 break;
5546
5547 case kQueryDelete:
5548 DeleteQuery();
5549 break;
5550
5551 case kQueryStartViewer:
5552 StartViewer();
5553 break;
5554
5555 case kQuerySubmit:
5557 break;
5558 }
5559}
5560
5561////////////////////////////////////////////////////////////////////////////////
5562/// Handle feedback histograms configuration menu.
5563
5565{
5566 // divide stats canvas by number of selected feedback histos
5571 if (!fActDesc || !fActDesc->fActQuery) return;
5572 fActDesc->fNbHistos = 0;
5573 Int_t i = 0;
5574
5575 if (fActDesc->fAttached && fActDesc->fProof &&
5576 fActDesc->fProof->IsValid()) {
5578 // browse list of feedback histos and check user's selected ones
5579 while (kFeedbackHistos[i]) {
5580 if (fCascadeMenu->IsEntryChecked(41+i)) {
5582 }
5583 i++;
5584 }
5585 }
5586 else {
5587 // if feedback option not selected, clear Proof's feedback option
5589 }
5590 }
5591
5592 i = 0;
5593 // loop over feedback histo list
5594 while (kFeedbackHistos[i]) {
5595 // check if user has selected this histogram in the option menu
5596 if (fCascadeMenu->IsEntryChecked(41+i))
5598 i++;
5599 }
5602 if (fActDesc->fNbHistos == 4)
5604 else if (fActDesc->fNbHistos > 4)
5606 else
5608
5609 // if actual query has results, update feedback histos
5613 fQueryFrame->ResetProgressDialog("", 0, 0, 0);
5614 }
5615 else if (fActDesc->fActQuery) {
5620 }
5622}
5623////////////////////////////////////////////////////////////////////////////////
5624/// Handle messages send to the TSessionViewer object. E.g. all menu entries
5625/// messages.
5626
5628{
5629 TNewQueryDlg *dlg;
5630
5631 switch (GET_MSG(msg)) {
5632 case kC_COMMAND:
5633 switch (GET_SUBMSG(msg)) {
5634 case kCM_BUTTON:
5635 case kCM_MENU:
5636 switch (parm1) {
5637
5638 case kFileCloseViewer:
5639 CloseWindow();
5640 break;
5641
5642 case kFileLoadConfig:
5643 {
5644 TGFileInfo fi;
5647 fi.fFileTypes = conftypes;
5648 new TGFileDialog(fClient->GetRoot(), this, kFDOpen, &fi);
5649 if (fi.fFilename) {
5653 }
5654 }
5655 break;
5656
5657 case kFileSaveConfig:
5658 {
5659 TGFileInfo fi;
5662 fi.fFileTypes = conftypes;
5663 new TGFileDialog(fClient->GetRoot(), this, kFDSave, &fi);
5664 if (fi.fFilename) {
5667 }
5668 }
5669 break;
5670
5671 case kFileQuit:
5672 Terminate();
5674 delete this;
5676 break;
5677
5678 case kSessionNew:
5680 break;
5681
5682 case kSessionAdd:
5684 break;
5685
5686 case kSessionDelete:
5688 break;
5689
5690 case kSessionCleanup:
5692 break;
5693
5694 case kSessionReset:
5695 ResetSession();
5696 break;
5697
5698 case kSessionConnect:
5700 break;
5701
5702 case kSessionDisconnect:
5704 break;
5705
5706 case kSessionShutdown:
5708 break;
5709
5710 case kSessionShowStatus:
5711 ShowStatus();
5712 break;
5713
5714 case kSessionGetQueries:
5716 break;
5717
5718 case kQueryNew:
5719 dlg = new TNewQueryDlg(this, 350, 310);
5720 dlg->Popup();
5721 break;
5722
5723 case kQueryEdit:
5724 EditQuery();
5725 break;
5726
5727 case kQueryDelete:
5728 DeleteQuery();
5729 break;
5730
5731 case kQueryStartViewer:
5732 StartViewer();
5733 break;
5734
5735 case kQuerySubmit:
5737 break;
5738
5739 case kOptionsAutoSave:
5742 fAutoSave = kFALSE;
5743 }
5744 else {
5746 fAutoSave = kTRUE;
5747 }
5748 break;
5749
5750 case kOptionsStatsHist:
5753 gEnv->SetValue("Proof.StatsHist", 0);
5754 }
5755 else {
5757 gEnv->SetValue("Proof.StatsHist", 1);
5758 }
5759 break;
5760
5761 case kOptionsStatsTrace:
5764 gEnv->SetValue("Proof.StatsTrace", 0);
5765 }
5766 else {
5768 gEnv->SetValue("Proof.StatsTrace", 1);
5769 }
5770 break;
5771
5775 gEnv->SetValue("Proof.SlaveStatsTrace", 0);
5776 }
5777 else {
5779 gEnv->SetValue("Proof.SlaveStatsTrace", 1);
5780 }
5781 break;
5782
5783 case kOptionsFeedback:
5786 }
5787 else {
5789 }
5790 break;
5791
5792 case 41:
5793 case 42:
5794 case 43:
5795 case 44:
5796 case 45:
5797 case 46:
5798 if (fCascadeMenu->IsEntryChecked(parm1)) {
5799 fCascadeMenu->UnCheckEntry(parm1);
5800 }
5801 else {
5802 fCascadeMenu->CheckEntry(parm1);
5803 }
5804 OnCascadeMenu();
5805 break;
5806
5807 case 50:
5808 if (fCascadeMenu->IsEntryChecked(parm1)) {
5809 fCascadeMenu->UnCheckEntry(parm1);
5810 }
5811 else {
5812 fCascadeMenu->CheckEntry(parm1);
5813 }
5814 OnCascadeMenu();
5815 break;
5816
5817 case kHelpAbout:
5818 {
5819#ifdef R__UNIX
5820 TString rootx = TROOT::GetBinDir() + "/root -a &";
5821 gSystem->Exec(rootx);
5822#else
5823#ifdef WIN32
5825#else
5826 char str[32];
5827 sprintf(str, "About ROOT %s...", gROOT->GetVersion());
5828 TRootHelpDialog *hd = new TRootHelpDialog(this, str, 600, 400);
5829 hd->SetText(gHelpAbout);
5830 hd->Popup();
5831#endif
5832#endif
5833 }
5834 break;
5835
5836 default:
5837 break;
5838 }
5839 default:
5840 break;
5841 }
5842 default:
5843 break;
5844 }
5845
5846 return kTRUE;
5847}
@ kWatch
Definition GuiTypes.h:375
const Mask_t kButtonPressMask
Definition GuiTypes.h:161
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
const Mask_t kAnyModifier
Definition GuiTypes.h:210
const Mask_t kKeyPressMask
Definition GuiTypes.h:159
const Mask_t kPointerMotionMask
Definition GuiTypes.h:163
@ kSunkenFrame
Definition GuiTypes.h:383
@ kVerticalFrame
Definition GuiTypes.h:381
@ kDoubleBorder
Definition GuiTypes.h:385
@ kFixedWidth
Definition GuiTypes.h:387
@ kHorizontalFrame
Definition GuiTypes.h:382
const Handle_t kNone
Definition GuiTypes.h:88
const Mask_t kLeaveWindowMask
Definition GuiTypes.h:168
const Mask_t kButtonReleaseMask
Definition GuiTypes.h:162
const Mask_t kEnterWindowMask
Definition GuiTypes.h:167
@ kAnyButton
Definition GuiTypes.h:214
R__EXTERN const char gHelpAbout[]
Definition HelpText.h:17
#define d(i)
Definition RSha256.hxx:102
#define b(i)
Definition RSha256.hxx:100
#define h(i)
Definition RSha256.hxx:106
RooFitResult * save(const char *name=nullptr, const char *title=nullptr)
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
long Longptr_t
Definition RtypesCore.h:82
long Long_t
Definition RtypesCore.h:54
unsigned int UInt_t
Definition RtypesCore.h:46
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
double Double_t
Definition RtypesCore.h:59
long long Long64_t
Definition RtypesCore.h:80
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
#define ClassImp(name)
Definition Rtypes.h:377
R__EXTERN TApplication * gApplication
R__EXTERN TEnv * gEnv
Definition TEnv.h:170
@ kEnvUser
Definition TEnv.h:71
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:197
@ kButtonDown
Definition TGButton.h:54
@ kButtonDisabled
Definition TGButton.h:56
@ kButtonUp
Definition TGButton.h:53
#define gClient
Definition TGClient.h:157
@ kFDOpen
@ kFDSave
@ kDeepCleanup
Definition TGFrame.h:42
@ kLHintsRight
Definition TGLayout.h:26
@ kLHintsExpandY
Definition TGLayout.h:31
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsCenterY
Definition TGLayout.h:28
@ kLHintsCenterX
Definition TGLayout.h:25
@ kLHintsBottom
Definition TGLayout.h:29
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
@ kMBNo
Definition TGMsgBox.h:32
@ kMBYes
Definition TGMsgBox.h:31
@ kMBCancel
Definition TGMsgBox.h:37
@ kMBOk
Definition TGMsgBox.h:33
@ kMBIconExclamation
Definition TGMsgBox.h:24
@ kMBIconQuestion
Definition TGMsgBox.h:23
@ kTextRight
Definition TGWidget.h:24
static unsigned int total
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t pict
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t SetWMSizeHints
char name[80]
Definition TGX11.cxx:110
R__EXTERN void * gTQSender
Definition TQObject.h:46
#define gROOT
Definition TROOT.h:405
R__EXTERN TRandom * gRandom
Definition TRandom.h:62
@ kFileQuit
@ kHelpAbout
const char * xpm_toolbar[]
const char *const kSession_RedirectFile
TSessionViewer * gSessionViewer
const char * pkgtypes[]
ESessionViewerCommands
@ kOptionsSlaveStatsTrace
@ kSessionBrowse
@ kQueryDelete
@ kFileLoadConfig
@ kSessionNew
@ kOptionsFeedback
@ kQueryStartViewer
@ kFileSaveConfig
@ kSessionConnect
@ kSessionDelete
@ kFileQuit
@ kSessionShowStatus
@ kSessionShutdown
@ kOptionsStatsHist
@ kSessionGetQueries
@ kQueryEdit
@ kSessionCleanup
@ kOptionsStatsTrace
@ kSessionAdd
@ kQuerySubmit
@ kFileCloseViewer
@ kSessionReset
@ kQueryNew
@ kOptionsAutoSave
@ kSessionDisconnect
@ kHelpAbout
const char * xpm_names[]
const char * kConfigFile
const char * conftypes[]
const char *const kSession_RedirectCmd
const char * kFeedbackHistos[]
const char * macrotypes[]
ToolBarData_t tb_data[]
R__EXTERN TSessionViewer * gSessionViewer
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2467
char * StrDup(const char *str)
Duplicate the string str.
Definition TString.cxx:2535
R__EXTERN TSystem * gSystem
Definition TSystem.h:560
#define gPad
#define gVirtualX
Definition TVirtualX.h:338
Int_t GET_MSG(Long_t val)
@ kCM_MENU
@ kTE_ENTER
@ kC_COMMAND
@ kCM_BUTTON
@ kTE_TAB
@ kC_TEXTENTRY
Int_t GET_SUBMSG(Long_t val)
T1 fFirst
Definition X11Events.mm:86
#define snprintf
Definition civetweb.c:1540
virtual Longptr_t ProcessLine(const char *line, Bool_t sync=kFALSE, Int_t *error=nullptr)
Process a single command line, either a C++ statement or an interpreter command starting with a "....
Bool_t ReturnFromRun() const
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition TAttFill.h:37
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
void Clear(Option_t *option="") override
Remove all primitives from the canvas.
Definition TCanvas.cxx:733
TVirtualPad * cd(Int_t subpadnumber=0) override
Set current canvas & pad.
Definition TCanvas.cxx:714
void Update() override
Update canvas pad buffers.
Definition TCanvas.cxx:2468
A chain is a collection of files containing TTree objects.
Definition TChain.h:33
static TClass * Class()
virtual Long64_t GetEntries() const
Return the total number of entries in the chain.
Definition TChain.cxx:971
virtual Long64_t GetReadEntry() const
See TTree::GetReadEntry().
Definition TChain.cxx:1213
virtual Int_t GetEntries() const
This class provides an interface to context sensitive popup menus.
virtual void Popup(Int_t x, Int_t y, TObject *obj, TVirtualPad *c=nullptr, TVirtualPad *p=nullptr)
Popup context menu at given location in canvas c and pad p for selected object.
This class implements a data set to be used for PROOF processing.
Definition TDSet.h:153
static TClass * Class()
void UpdateFields(TQueryDescription *desc)
Update entry fields with query description values.
TGNumberEntry * fNumEntries
TGTextEntry * fTxtQueryName
void OnNewQueryMore()
Show/hide options frame and update button text accordingly.
TGNumberEntry * fNumFirstEntry
void SettingsChanged()
Settings have changed, update GUI accordingly.
TQueryDescription * fQuery
virtual ~TEditQueryFrame()
Delete query dialog.
void OnBrowseEventList()
Browse event list.
TGTextEntry * fTxtEventList
void Build(TSessionViewer *gui)
Build the "new query" dialog.
TEditQueryFrame(TGWindow *p, Int_t w, Int_t h)
Create a new Query dialog, used by the Session Viewer, to Edit a Query if the editmode flag is set,...
TSessionViewer * fViewer
TGTextButton * fBtnMore
void OnElementSelected(TObject *obj)
Handle OnElementSelected signal coming from new chain dialog.
TGCompositeFrame * fFrmMore
TGTextEntry * fTxtSelector
void OnBrowseSelector()
Open file browser to choose selector macro.
TGTextEntry * fTxtChain
void OnBtnSave()
Save current settings in main session viewer.
void OnBrowseChain()
Call new chain dialog.
TGTextEntry * fTxtOptions
Definition TEnv.h:86
const char * GetName() const override
Returns name of object.
Definition TEnv.h:109
The TEnv class reads config files, by default named .rootrc.
Definition TEnv.h:124
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition TEnv.cxx:491
THashList * GetTable() const
Definition TEnv.h:140
virtual Int_t WriteFile(const char *fname, EEnvLevel level=kEnvAll)
Write resource records to file fname for a certain level.
Definition TEnv.cxx:617
virtual Int_t ReadFile(const char *fname, EEnvLevel level)
Read and parse the resource file for a certain level.
Definition TEnv.cxx:592
virtual void SetValue(const char *name, const char *value, EEnvLevel level=kEnvChange, const char *type=nullptr)
Set the value of a resource or create a new resource.
Definition TEnv.cxx:736
THashList * GetList()
Class describing a generic file including meta information.
Definition TFileInfo.h:39
TUrl * GetFirstUrl() const
Definition TFileInfo.h:72
A button abstract base class.
Definition TGButton.h:68
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition TGButton.cxx:445
virtual EButtonState GetState() const
Definition TGButton.h:112
virtual void SetEnabled(Bool_t e=kTRUE)
Set enabled or disabled state of button.
Definition TGButton.cxx:459
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition TGButton.cxx:235
A frame containing two scrollbars (a horizontal and a vertical) and a viewport.
Definition TGCanvas.h:192
Selects different options.
Definition TGButton.h:264
Bool_t IsOn() const override
Definition TGButton.h:310
void SetState(EButtonState state, Bool_t emit=kFALSE) override
Set check button state.
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition TGClient.cxx:234
const TGWindow * GetRoot() const
Returns current root (i.e.
Definition TGClient.cxx:224
TGMimeTypes * GetMimeTypeList() const
Definition TGClient.h:146
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition TGClient.cxx:289
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition TGClient.cxx:372
void FreePicture(const TGPicture *pic)
Free picture resource.
Definition TGClient.cxx:308
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:287
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
Definition TGFrame.h:316
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
Definition TGFrame.cxx:1000
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
UInt_t GetDefaultWidth() const override
Definition TGFrame.h:312
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:967
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1164
UInt_t GetDefaultHeight() const override
Definition TGFrame.h:314
void Layout() override
Layout the elements of the composite frame.
Definition TGFrame.cxx:1257
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition TGFrame.cxx:1204
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
Definition TGFrame.cxx:1072
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition TGFrame.cxx:1190
Bool_t IsVisible(TGFrame *f) const
Get state of sub frame.
Definition TGFrame.cxx:1231
virtual void Associate(const TGWindow *w)
Definition TGCanvas.h:89
virtual void ClearViewPort()
Clear view port and redraw full content.
Definition TGCanvas.cxx:891
This class creates a file selection dialog.
TList * fFileNamesList
list of selected file names
char * fFilename
selected file name
const char ** fFileTypes
file types used to filter selectable files
void SetFilename(const char *fname)
Set file name.
Bool_t fMultipleSelection
if true, allow multiple file selection
void SetIniDir(const char *inidir)
Set directory name.
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition TGFrame.cxx:339
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:605
void RemoveInput(UInt_t emask)
Remove events specified in emask from the events the frame should handle.
Definition TGFrame.cxx:348
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition TGFrame.cxx:709
virtual UInt_t GetDefaultWidth() const
Definition TGFrame.h:190
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:191
void MapWindow() override
map window
Definition TGFrame.h:204
void Move(Int_t x, Int_t y) override
Move frame.
Definition TGFrame.cxx:593
virtual void DeleteWindow()
Delete window.
Definition TGFrame.cxx:276
UInt_t GetHeight() const
Definition TGFrame.h:225
A composite frame with a border and a title.
Definition TGFrame.h:522
void ShowPosition(Bool_t set=kTRUE, Bool_t percent=kTRUE, const char *format="%.2f")
Show postion text, either in percent or formatted according format.
A horizontal 3D line is a line that typically separates a toolbar from the menubar.
Definition TG3DLine.h:18
A composite frame that layout their children in horizontal way.
Definition TGFrame.h:385
Icon + text listbox entry.
Definition TGListBox.h:132
This class handles GUI icons.
Definition TGIcon.h:22
virtual void SetPicture(const TGPicture *pic)
Set icon picture.
Definition TGIcon.cxx:79
virtual void AddItem(TGLVEntry *item)
Definition TGListView.h:207
void * GetUserData() const
Definition TGListView.h:95
void SetUserData(void *userData)
Definition TGListView.h:94
This class handles GUI labels.
Definition TGLabel.h:24
virtual void SetText(TGString *newText)
Set new text in label.
Definition TGLabel.cxx:180
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
A listbox is a box, possibly with scrollbar, containing entries.
Definition TGListBox.h:221
virtual Int_t GetNumberOfEntries() const
Definition TGListBox.h:263
void Resize(UInt_t w, UInt_t h) override
Resize the listbox widget.
virtual Int_t GetSelected() const
Return id of selected listbox item.
virtual void AddEntry(TGString *s, Int_t id)
Add entry with specified string and id to listbox.
void Layout() override
Layout the listbox components.
virtual void SetMultipleSelections(Bool_t multi=kTRUE)
Definition TGListBox.h:259
virtual TGFrame * GetContainer() const
Definition TGListBox.h:267
virtual void GetSelectedEntries(TList *selected)
Adds all selected entries (TGLBEntry) of the list box into the list selected.
virtual void RemoveEntries(Int_t from_ID, Int_t to_ID)
Remove a range of entries defined by from_ID and to_ID.
virtual const char * GetText() const =0
TGListTreeItem * GetParent() const
Definition TGListTree.h:58
virtual void SetPictures(const TGPicture *, const TGPicture *)
Definition TGListTree.h:83
virtual void * GetUserData() const =0
virtual void SetUserData(void *, Bool_t=kFALSE)
Definition TGListTree.h:79
A list tree is a widget that can contain a number of items arranged in a tree structure.
Definition TGListTree.h:195
void DisableOpen(Bool_t disable=kTRUE)
Definition TGListTree.h:376
TGListTreeItem * FindItemByObj(TGListTreeItem *item, void *ptr)
Find item with fUserData == ptr.
void ClearHighlighted()
Un highlight items.
void RenameItem(TGListTreeItem *item, const char *string)
Rename item in list tree.
void AddItem(TGListTreeItem *parent, TGListTreeItem *item)
Add given item to list tree.
Int_t DeleteChildren(TGListTreeItem *item)
Delete children of item from list.
void OpenItem(TGListTreeItem *item)
Open item in list tree (i.e. show child items).
TGListTreeItem * GetSelected() const
Definition TGListTree.h:382
Int_t DeleteItem(TGListTreeItem *item)
Delete item from list tree.
void SetSelected(TGListTreeItem *item)
Definition TGListTree.h:353
TGListTreeItem * GetFirstItem() const
Definition TGListTree.h:381
TGListTreeItem * FindChildByName(TGListTreeItem *item, const char *name)
Find child of item by name.
void HighlightItem(TGListTreeItem *item)
Highlight item.
TGListTreeItem * FindChildByData(TGListTreeItem *item, void *userData)
Find child of item by userData.
void SetToolTipItem(TGListTreeItem *item, const char *string)
Set tooltip text for this item.
A list view is a widget that can contain a number of items arranged in a grid or list.
Definition TGListView.h:115
Defines top level windows that interact with the system Window Manager.
Definition TGFrame.h:397
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
Definition TGFrame.cxx:1788
This layout managers does not make use of TGLayoutHints.
Definition TGLayout.h:269
The TGMenu.h header contains all different menu classes.
Definition TGMenu.h:282
virtual void AddPopup(TGHotString *s, TGPopupMenu *menu, TGLayoutHints *l, TGPopupMenu *before=nullptr)
Add popup menu to menu bar.
Definition TGMenu.cxx:418
Bool_t GetAction(const char *filename, char *action)
Return in action the mime action string belonging to filename.
TGNumberEntry is a number entry input widget with up/down buttons.
TGNumberEntryField * GetNumberEntry() const
Get the number entry field.
virtual void SetIntNumber(Long_t val, Bool_t emit=kTRUE)
void Associate(const TGWindow *w) override
Make w the window that will receive the generated messages.
virtual Long_t GetIntNumber() const
@ kNEANonNegative
Non-negative number.
@ kNEAAnyNumber
Attributes of number entry field.
@ kNESInteger
Style of number entry field.
@ kNELNoLimits
Limit selection of number entry field.
@ kNELLimitMinMax
Both lower and upper limits.
TGClient * fClient
Connection to display server.
Definition TGObject.h:25
Handle_t GetId() const
Definition TGObject.h:41
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition TGPicture.h:25
UInt_t GetHeight() const
Definition TGPicture.h:53
UInt_t GetWidth() const
Definition TGPicture.h:52
This class creates a popup menu object.
Definition TGMenu.h:110
virtual void AddLabel(TGHotString *s, const TGPicture *p=nullptr, TGMenuEntry *before=nullptr)
Add a menu label to the menu.
Definition TGMenu.cxx:1095
virtual Bool_t IsEntryChecked(Int_t id)
Return true if menu item is checked.
Definition TGMenu.cxx:1845
virtual void AddPopup(TGHotString *s, TGPopupMenu *popup, TGMenuEntry *before=nullptr, const TGPicture *p=nullptr)
Add a (cascading) popup menu to a popup menu.
Definition TGMenu.cxx:1152
virtual void CheckEntry(Int_t id)
Check a menu entry (i.e. add a check mark in front of it).
Definition TGMenu.cxx:1782
virtual void DisableEntry(Int_t id)
Disable entry (disabled entries appear in a sunken relieve).
Definition TGMenu.cxx:1724
virtual void EnableEntry(Int_t id)
Enable entry. By default entries are enabled.
Definition TGMenu.cxx:1705
virtual void UnCheckEntry(Int_t id)
Uncheck menu entry (i.e. remove check mark).
Definition TGMenu.cxx:1807
virtual void Associate(const TGWindow *w)
Definition TGMenu.h:206
virtual void AddSeparator(TGMenuEntry *before=nullptr)
Add a menu separator to the menu.
Definition TGMenu.cxx:1060
virtual void AddEntry(TGHotString *s, Int_t id, void *ud=nullptr, const TGPicture *p=nullptr, TGMenuEntry *before=nullptr)
Add a menu entry.
Definition TGMenu.cxx:990
virtual void PlaceMenu(Int_t x, Int_t y, Bool_t stick_mode, Bool_t grab_pointer)
Popup a popup menu.
Definition TGMenu.cxx:1241
void SetPosition(Float_t pos)
Set progress position between [min,max].
virtual void SetBarColor(Pixel_t color)
Set progress bar color.
virtual void Reset()
Reset progress bar (i.e. set pos to 0).
Provides a StatusBar widget.
Definition TGStatusBar.h:21
TGCompositeFrame * GetBarPart(Int_t npart) const
Returns bar part.
virtual void SetText(TGString *text, Int_t partidx=0)
Set text in partition partidx in status bar.
virtual void SetParts(Int_t npart)
Divide the status bar in npart equal sized parts.
A tab widget contains a set of composite frames each with a little tab with a name (like a set of fol...
Definition TGTab.h:46
TGTabElement * GetTabTab(Int_t tabIndex) const
Return the tab element of tab with index tabIndex.
Definition TGTab.cxx:663
virtual Bool_t SetTab(Int_t tabIndex, Bool_t emit=kTRUE)
Brings the composite frame with the index tabIndex to the front and generate the following event if t...
Definition TGTab.cxx:558
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
Definition TGTab.cxx:376
This class describes layout hints used by the TGTableLayout class.
A layout manager, which places child frames in a table arranged in rows and columns,...
A text buffer is used in several widgets, like TGTextEntry, TGFileDialog, etc.
UInt_t GetTextLength() const
Yield an action as soon as it is clicked.
Definition TGButton.h:142
virtual void SetText(TGHotString *new_label)
Set new button text.
Definition TGButton.cxx:644
A TGTextEntry is a one line text input widget.
Definition TGTextEntry.h:24
virtual void SetFocus()
Set focus to this text entry.
TGTextBuffer * GetBuffer() const
const char * GetText() const
void SetEnabled(Bool_t flag=kTRUE)
virtual void SelectAll()
Selects all text (i.e.
virtual void SetAlignment(ETextJustification mode=kTextLeft)
Sets the alignment of the text entry.
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
virtual void SetText(const char *text, Bool_t emit=kTRUE)
Sets text entry to text, clears the selection and moves the cursor to the end of the line.
A TGTextView is a text viewer widget.
Definition TGTextView.h:22
virtual Bool_t LoadFile(const char *fname, long startpos=0, long length=-1)
Load a file in the text view widget.
virtual Bool_t LoadBuffer(const char *txtbuf)
Load text from a text buffer. Return false in case of failure.
virtual void ShowBottom()
Show bottom of the page.
void Clear(Option_t *="") override
Clear text view widget.
A toolbar is a composite frame that contains TGPictureButtons.
Definition TGToolBar.h:33
virtual TGButton * AddButton(const TGWindow *w, ToolBarData_t *button, Int_t spacing=0)
Add button to toolbar.
Definition TGToolBar.cxx:92
virtual TGButton * GetButton(Int_t id) const
Finds and returns a pointer to the button with the specified identifier id.
A vertical 3D line is a line that can be used to separate groups of widgets.
Definition TG3DLine.h:33
A composite frame that layout their children in vertical way.
Definition TGFrame.h:374
virtual void Associate(const TGWindow *w)
Definition TGWidget.h:72
ROOT GUI Window base class.
Definition TGWindow.h:23
const char * GetName() const override
Return unique name, used in SavePrimitive methods.
Definition TGWindow.cxx:336
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:58
Service class for 2-D histogram classes.
Definition TH2.h:30
A doubly linked list.
Definition TList.h:38
void Clear(Option_t *option="") override
Remove all objects from the list.
Definition TList.cxx:402
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
Definition TList.cxx:578
void Add(TObject *obj) override
Definition TList.h:81
TObject * Remove(TObject *obj) override
Remove object from the list.
Definition TList.cxx:822
TObject * Last() const override
Return the last object in the list. Returns 0 when list is empty.
Definition TList.cxx:693
void Delete(Option_t *option="") override
Remove all objects from the list AND delete all heap based objects.
Definition TList.cxx:470
TObject * At(Int_t idx) const override
Returns the object at position idx. Returns 0 if idx is out of range.
Definition TList.cxx:357
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:48
void Popup()
Display dialog and set focus to query name text entry.
Collectable string class.
Definition TObjString.h:28
const TString & GetString() const
Definition TObjString.h:46
const char * GetName() const override
Returns name of object.
Definition TObjString.h:38
Mother of all ROOT objects.
Definition TObject.h:41
virtual void Clear(Option_t *="")
Definition TObject.h:119
virtual const char * GetName() const
Returns name of object.
Definition TObject.cxx:439
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition TObject.cxx:774
virtual const char * GetTitle() const
Returns title of object.
Definition TObject.cxx:483
virtual TClass * IsA() const
Definition TObject.h:245
void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0) override
Automatic pad generation by division.
Definition TPad.cxx:1153
void SetEditable(Bool_t mode=kTRUE) override
Set pad editable yes/no If a pad is not editable:
Definition TPad.cxx:5889
void Modified(Bool_t flag=1) override
Definition TPad.h:417
void SetBorderMode(Short_t bordermode) override
Definition TPad.h:320
TProof * GetProof() const
Definition TProofMgr.h:164
Int_t GetLocalId() const
Definition TProofMgr.h:163
The PROOF manager interacts with the PROOF server coordinator to create or destroy a PROOF session,...
Definition TProofMgr.h:43
virtual Int_t Reset(Bool_t hard=kFALSE, const char *usr=0)
Send a cleanup request for the sessions associated with the current user.
virtual TList * QuerySessions(Option_t *opt="S")
Get list of sessions accessible to this manager.
static TProofMgr * Create(const char *url, Int_t loglevel=-1, const char *alias=0, Bool_t xpd=kTRUE)
Static method returning the appropriate TProofMgr object using the plugin manager.
virtual TProof * CreateSession(const char *=0, const char *=0, Int_t=-1)
Create a new remote session (master and associated workers).
virtual Bool_t IsValid() const
Definition TProofMgr.h:77
virtual TProof * AttachSession(Int_t, Bool_t=kFALSE)
Dummy version provided for completeness.
This class controls a Parallel ROOT Facility, PROOF, cluster.
Definition TProof.h:316
const char * GetSessionTag() const
Definition TProof.h:909
Int_t Exec(const char *cmd, ESlaves list, Bool_t plusMaster)
Send command to be executed on the PROOF master and/or slaves.
Definition TProof.cxx:6533
void ShowPackages(Bool_t all=kFALSE, Bool_t redirlog=kFALSE)
List contents of package directory.
Definition TProof.cxx:7770
static TProofMgr * Mgr(const char *url)
Get instance of the effective manager for 'url' Return 0 on failure.
Definition TProof.cxx:11724
Int_t UploadPackage(const char *par, EUploadPackageOpt opt=kUntar, TList *workers=0)
Upload a PROOF archive (PAR file).
Definition TProof.cxx:8441
void SendLogToWindow(Bool_t mode)
Definition TProof.h:1017
Int_t GetClientProtocol() const
Definition TProof.h:914
void AddFeedback(const char *name)
Add object to feedback list.
Definition TProof.cxx:9989
Bool_t IsParallel() const
Definition TProof.h:939
Int_t CleanupSession(const char *sessiontag)
Send cleanup request for the session specified by tag.
Definition TProof.cxx:6092
TList * GetListOfPackages()
Get from the master the list of names of the packages available.
Definition TProof.cxx:9108
TQueryResult * GetQueryResult(const char *ref=0)
Return pointer to the full TQueryResult instance owned by the player and referenced by 'ref'.
Definition TProof.cxx:2148
void ClearFeedback()
Clear feedback list.
Definition TProof.cxx:10012
void Browse(TBrowser *b)
Build the PROOF's structure in the browser.
Definition TProof.cxx:10179
Int_t GetPort() const
Definition TProof.h:912
Bool_t IsValid() const
Definition TProof.h:937
const char * GetConfFile() const
Definition TProof.h:905
Int_t GetRemoteProtocol() const
Definition TProof.h:913
Int_t SetParallel(Int_t nodes=-1, Bool_t random=kFALSE)
Tell PROOF how many slaves to use in parallel.
Definition TProof.cxx:7140
const char * GetImage() const
Definition TProof.h:910
Float_t GetCpuTime() const
Definition TProof.h:931
Int_t ClearPackage(const char *package)
Remove a specific package.
Definition TProof.cxx:7857
Int_t ClearPackages()
Remove all packages.
Definition TProof.cxx:7840
Int_t GetParallel() const
Returns number of slaves active in parallel mode.
Definition TProof.cxx:2304
Int_t Remove(Int_t query, Bool_t all=kFALSE)
Send remove request for the qry-th query in fQueries.
Definition TProof.cxx:6013
Bool_t SendingLogToWindow() const
Definition TProof.h:1016
Long64_t GetBytesRead() const
Definition TProof.h:929
virtual void SetAlias(const char *alias="")
Set an alias for this session.
Definition TProof.cxx:10583
void Detach(Option_t *opt="")
Detach this instance to its proofserv.
Definition TProof.cxx:10518
Int_t GetSeqNum() const
Definition TProof.h:918
const char * GetConfDir() const
Definition TProof.h:904
void cd(Int_t id=-1)
Set session with 'id' the default one.
Definition TProof.cxx:10496
Int_t Retrieve(Int_t query, const char *path=0)
Send retrieve request for the qry-th query in fQueries.
Definition TProof.cxx:5948
Int_t GetStatus() const
Definition TProof.h:915
virtual Int_t RemoveDataSet(const char *dataset, const char *optStr="")
Remove the specified dataset from the PROOF cluster.
Definition TProof.cxx:10991
void SetQueryMode(EQueryMode mode)
Change query running mode to the one specified by 'mode'.
Definition TProof.cxx:6107
@ kUsingSessionGui
Definition TProof.h:342
Long64_t Finalize(Int_t query=-1, Bool_t force=kFALSE)
Finalize the qry-th query in fQueries.
Definition TProof.cxx:5883
Bool_t IsLite() const
Definition TProof.h:933
void StopProcess(Bool_t abort, Int_t timeout=-1)
Send STOPPROCESS message to master and workers.
Definition TProof.cxx:6224
Float_t GetRealTime() const
Definition TProof.h:930
void ShowLog(Int_t qry=-1)
Display on screen the content of the temporary log file.
Definition TProof.cxx:10371
Int_t GetLogLevel() const
Definition TProof.h:916
const char * GetUser() const
Definition TProof.h:906
virtual TFileCollection * GetDataSet(const char *dataset, const char *optStr="")
Get a list of TFileInfo objects describing the files of the specified dataset.
Definition TProof.cxx:10937
TList * GetListOfEnabledPackages()
Get from the master the list of names of the packages enabled.
Definition TProof.cxx:9124
virtual TList * GetListOfQueries(Option_t *opt="")
Ask the master for the list of queries.
Definition TProof.cxx:2088
void SetLogLevel(Int_t level, UInt_t mask=TProofDebug::kAll)
Set server logging level.
Definition TProof.cxx:7079
Bool_t IsMaster() const
Definition TProof.h:936
void ShowEnabledPackages(Bool_t all=kFALSE)
List which packages are enabled.
Definition TProof.cxx:7818
@ kAsync
Definition TProof.h:351
@ kSync
Definition TProof.h:350
const char * GetMaster() const
Definition TProof.h:903
Int_t EnablePackage(const char *package, Bool_t notOnClient=kFALSE, TList *workers=0)
Enable specified package.
Definition TProof.cxx:8175
virtual Int_t VerifyDataSet(const char *dataset, const char *optStr="")
Verify if all files in the specified dataset are available.
Definition TProof.cxx:11130
This is the ROOT implementation of the Qt object communication mechanism (see also http://www....
Definition TQObject.h:48
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition TQObject.cxx:869
Bool_t Disconnect(const char *signal=nullptr, void *receiver=nullptr, const char *slot=nullptr)
Disconnects signal of this object from slot of receiver.
ESessionQueryStatus fStatus
static TClass * Class()
TQueryResult * fResult
A container class for query results.
Long64_t GetEntries() const
TMacro * GetSelecImp() const
TList * GetOutputList()
TObject * GetInputObject(const char *classname) const
Return first instance of class 'classname' in the input list.
EQueryStatus GetStatus() const
const char * GetOptions() const
Long64_t GetFirst() const
TList * GetInputList()
Bool_t IsFinalized() const
static const TString & GetBinDir()
Get the binary directory in the installation. Static utility function.
Definition TROOT.cxx:2932
virtual UInt_t Integer(UInt_t imax)
Returns a random integer uniformly distributed on the interval [ 0, imax-1 ].
Definition TRandom.cxx:360
This class creates a TGCanvas in which a TCanvas is created.
TCanvas * GetCanvas() const
A TRootHelpDialog is used to display help text (or any text in a dialog window).
void SetText(const char *helpText)
Set help text from helpText buffer in TGTextView.
void Popup()
Show help dialog.
A TSelector object is used by the TTree::Draw, TTree::Scan, TTree::Process to navigate in a TTree and...
Definition TSelector.h:31
virtual TList * GetOutputList() const
Definition TSelector.h:69
virtual void Terminate()
Definition TSelector.h:71
Sequenceable collection abstract base class.
virtual TObject * First() const =0
const char * GetName() const
Returns name of object.
static TClass * Class()
TQueryDescription * fActQuery
TGTextButton * fBtnShowLog
TGTextButton * fBtnUploadDSet
TGCheckButton * fChkEnable
TGTextButton * fBtnEnable
TGNumberEntry * fLogLevel
TGCompositeFrame * fFE
void OnBtnShowLogClicked()
Show session log.
TGCompositeFrame * fFC
void OnBtnDisconnectClicked()
Disconnect from current Proof session.
TGTextButton * fBtnUp
void OnBtnRemoveClicked()
Remove selected package from the list.
void UpdatePackages()
Update list of packages.
TGTextButton * fBtnDisable
TGTextButton * fBtnShowEnabled
void OnUploadPackages()
Upload selected package(s) to the current session.
TGLabel * fInfoLine[19]
TGTextButton * fBtnClear
TGTextButton * fBtnUpload
TGTextButton * fBtnRefresh
void OnBtnAddClicked()
Open file dialog and add selected package file to the list.
TGTextButton * fBtnShow
TGTextEntry * fCommandTxt
TGTextButton * fBtnRemoveDSet
virtual ~TSessionFrame()
Destructor.
void OnBtnRemoveDSet()
Remove dataset from the list and from the cluster.
void OnCommandLine()
Command line handling.
void OnDisablePackages()
Disable selected package(s) in the current session.
void OnBtnNewQueryClicked()
Call "New Query" Dialog.
void OnApplyLogLevel()
Apply selected log level on current session.
TGCheckButton * fClearCheck
void Build(TSessionViewer *gui)
Build session frame.
TGTextButton * fBtnNewQuery
TGTextButton * fApplyLogLevel
void OnBtnVerifyDSet()
Verify that the files in the selected dataset are present on the cluster.
TGCanvas * fDSetView
TGCompositeFrame * fFB
void OnBtnUploadDSet()
Open Upload Dataset dialog.
TGTextBuffer * fCommandBuf
void OnBtnDownClicked()
Move selected package entry one position down in the list.
void OnBtnUpClicked()
Move selected package entry one position up in the list.
TSessionFrame(TGWindow *parent, Int_t w, Int_t h)
Constructor.
void OnStartupEnable(Bool_t on)
Handle multiple selection check button.
void OnBtnGetQueriesClicked()
Get list of queries from current Proof server and populate the list tree.
TGTextView * fInfoTextView
TGCheckButton * fChkMulti
void OnMultipleSelection(Bool_t on)
Handle multiple selection check button.
void UpdateListOfDataSets()
Update list of dataset present on the cluster.
TGTextEntry * fTxtParallel
TGTextButton * fBtnRemove
void OnClearPackages()
Clear (disable) all packages in the current session.
TSessionViewer * fViewer
void ShutdownSession()
Shutdown current session.
TGTextButton * fBtnAdd
TGTextButton * fBtnVerifyDSet
TGListTree * fDataSetTree
void ProofInfos()
Display information on current session.
TGCompositeFrame * fFA
TGTextButton * fBtnGetQueries
void SetLocal(Bool_t local=kTRUE)
Switch widgets status/visibility for local/remote sessions.
TGTextButton * fBtnDown
void OnApplyParallel()
Apply selected number of workers on current Proof session.
TGTextButton * fApplyParallel
TGCompositeFrame * fFD
TGListBox * fLBPackages
void CheckAutoEnPack(Bool_t checked=kTRUE)
void SetLogLevel(Int_t log)
void OnEnablePackages()
Enable selected package(s) in the current session.
TSessionViewer * fViewer
TGLVContainer * fLVContainer
void Build(TSessionViewer *gui)
Build query input information frame.
TGLVContainer * GetLVContainer()
virtual ~TSessionInputFrame()
Destructor.
void RemoveAll()
Remove all frames from composite frame.
TSessionInputFrame(TGWindow *parent, Int_t w, Int_t h)
Constructor.
void AddObject(TObject *obj)
Add object to input list view.
Dialog used to display session logs from the session viewer.
void LoadFile(const char *file)
Load a file in the editor.
void LoadBuffer(const char *buffer)
Load a text buffer in the editor.
void AddBuffer(const char *buffer)
Load a text buffer in the editor.
void Popup()
Show editor.
void RemoveAll()
Remove all frames from composite frame.
TGLVContainer * fLVContainer
void Build(TSessionViewer *gui)
Build query output information frame.
void OnElementDblClicked(TGLVEntry *entry, Int_t btn, Int_t x, Int_t y)
Handle double-clicks on list view items.
virtual ~TSessionOutputFrame()
Destructor.
TGLVContainer * GetLVContainer()
TSessionViewer * fViewer
void OnElementClicked(TGLVEntry *entry, Int_t btn, Int_t x, Int_t y)
Handle mouse clicks on list view items.
void AddObject(TObject *obj)
Add object to output list view.
TSessionOutputFrame(TGWindow *parent, Int_t w, Int_t h)
Constructor.
void UpdateInfos()
Update query information (header) text view.
TGTextButton * fBtnShowLog
void Build(TSessionViewer *gui)
Build query information frame.
TGCompositeFrame * fFC
TRootEmbeddedCanvas * fECanvas
void UpdateHistos(TList *objs)
Update feedback histograms.
void Progress(Long64_t total, Long64_t processed)
Update progress bar and status labels.
void Feedback(TList *objs)
Feedback function connected to Feedback signal.
void OnBtnSubmit()
Submit query.
void ProgressLocal(Long64_t total, Long64_t processed)
Update progress bar and status labels.
TEditQueryFrame * GetQueryEditFrame() const
TSessionViewer * fViewer
TGTextButton * fBtnSave
TGTextButton * fBtnSubmit
void OnBtnFinalize()
Finalize query.
void OnBtnStop()
Stop processing query.
void Modified(Bool_t mod=kTRUE)
Notify changes in query editor settings.
void IndicateStop(Bool_t aborted)
Indicate that Cancel or Stop was clicked.
TGTextButton * fBtnRetrieve
void ResetProgressDialog(const char *selec, Int_t files, Long64_t first, Long64_t entries)
Reset progress frame information fields.
TGTab * GetTab() const
TGTextButton * fBtnAbort
TGTextButton * fBtnStop
TGTextView * fInfoTextView
TEditQueryFrame * fFD
void UpdateButtons(TQueryDescription *desc)
Update buttons state for the current query status.
void OnBtnShowLog()
Show query log.
TCanvas * GetStatsCanvas() const
TGHProgressBar * frmProg
void OnBtnAbort()
Abort processing query.
TGCompositeFrame * fFB
TSessionQueryFrame(TGWindow *parent, Int_t w, Int_t h)
Constructor.
TGTextButton * fBtnFinalize
void OnBtnRetrieve()
Retrieve query.
virtual ~TSessionQueryFrame()
Destructor.
TGTextButton * fBtnAdd
TSessionServerFrame(TGWindow *parent, Int_t w, Int_t h)
Constructor.
TGTextButton * fBtnConnect
void OnBtnAddClicked()
Add newly created session configuration in the list of sessions.
void OnBtnDeleteClicked()
Delete selected session configuration (remove it from the list).
TSessionViewer * fViewer
TGCheckButton * fSync
void SetAddEnabled(Bool_t on=kTRUE)
TGTextEntry * fTxtConfig
void SetLogLevel(Int_t log)
TGNumberEntry * fNumPort
TGNumberEntry * fLogLevel
void SetConnectEnabled(Bool_t on=kTRUE)
virtual ~TSessionServerFrame()
Destructor.
virtual Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Process messages for session server frame.
virtual Bool_t HandleExpose(Event_t *event)
Handle expose event in server frame.
void OnBtnNewServerClicked()
Reset server configuration fields.
TGTextEntry * fTxtAddress
void OnConfigFileClicked()
Browse configuration files.
TGCompositeFrame * fFrmNewServer
TGTextEntry * fTxtName
void Build(TSessionViewer *gui)
Build server configuration frame.
void SettingsChanged()
Settings have changed, update GUI accordingly.
void OnBtnConnectClicked()
Connect to selected server.
TGTextEntry * fTxtUsrName
void Update(TSessionDescription *desc)
Update fields with values from session description desc.
Widget used to manage PROOF or local sessions, PROOF connections, queries construction and results ha...
void EditQuery()
Edit currently selected query.
TGMenuBar * fMenuBar
TSessionQueryFrame * GetQueryFrame() const
TGHorizontalFrame * fHf
void ShowPackages()
Query the list of uploaded packages from proof and display it into a new text window.
TSessionOutputFrame * fOutputFrame
TGListTree * GetSessionHierarchy() const
TGVerticalFrame * fV2
const TGPicture * fQueryDiscon
void SetBusy(Bool_t busy=kTRUE)
const TGPicture * GetProofConPict() const
TGPopupMenu * fCascadeMenu
TGPopupMenu * GetOptionsMenu() const
void StartViewer()
Start TreeViewer from selected TChain.
TGHProgressBar * fConnectProg
TGToolBar * fToolBar
void LogMessage(const char *msg, Bool_t all)
Load/append a log msg in the log frame.
void UpdateListOfProofs()
Update list of existing Proof sessions.
const TGPicture * fQueryCon
TGPopupMenu * fFileMenu
TGListTreeItem * fSessionItem
void UpdateListOfPackages()
Update the list of packages.
TGStatusBar * fStatusBar
TGPopupMenu * fPopupSrv
void OnListTreeClicked(TGListTreeItem *entry, Int_t btn, Int_t x, Int_t y)
Handle mouse clicks in list tree.
TSessionFrame * GetSessionFrame() const
virtual void Build()
Build main session viewer frame and subframes.
TContextMenu * GetContextMenu() const
virtual Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t)
Handle messages send to the TSessionViewer object.
void MyHandleMenu(Int_t)
Handle session viewer custom popup menus.
TSessionDescription * fActDesc
void ReadConfiguration(const char *filename=nullptr)
Read configuration file and populate list of sessions list of queries and list of packages.
void ShowInfo(const char *txt)
Display text in status bar.
TGPopupMenu * fHelpMenu
TGPopupMenu * GetCascadeMenu() const
TGPopupMenu * fPopupQry
const TGPicture * fBaseIcon
void ShowEnabledPackages()
Query list of enabled packages from proof and display it into a new text window.
TSessionViewer(const char *title="ROOT Session Viewer", UInt_t w=550, UInt_t h=320)
Main Session viewer constructor.
void QueryResultReady(char *query)
Handle signal "query result ready" coming from Proof session.
TGListTreeItem * GetSessionItem() const
TGFrame * fActFrame
void OnListTreeDoubleClicked(TGListTreeItem *entry, Int_t btn)
Handle mouse double clicks in list tree (connect to server).
Bool_t IsAutoSave() const
const TGPicture * GetQueryConPict() const
const TGPicture * fProofCon
UserGroup_t * fUserGroup
TSessionFrame * fSessionFrame
Bool_t HandleTimer(TTimer *)
Handle animation timer.
TGPopupMenu * fSessionMenu
TSessionInputFrame * fInputFrame
Bool_t IsBusy() const
TGPopupMenu * fQueryMenu
TGStatusBar * GetStatusBar() const
void CleanupSession()
Clean-up Proof session.
TGVerticalFrame * fV1
TSessionDescription * GetActDesc() const
void EnableTimer()
Enable animation timer.
void WriteConfiguration(const char *filename=nullptr)
Save actual configuration in config file "filename".
TGListTree * fSessionHierarchy
void UpdateListOfSessions()
Update list of existing Proof sessions.
TSessionLogView * fLogWindow
TContextMenu * fContextMenu
virtual ~TSessionViewer()
Destructor.
void SetChangePic(Bool_t change)
const TGPicture * GetProofDisconPict() const
TGPopupMenu * fOptionsMenu
TGHProgressBar * GetConnectProg() const
void ShowLog(const char *queryref)
Display the content of the temporary log file for queryref into a new text window.
TSessionServerFrame * fServerFrame
void OnCascadeMenu()
Handle feedback histograms configuration menu.
const TGPicture * fLocal
void CloseWindow()
Close main Session Viewer window.
const TGPicture * fProofDiscon
void DisableTimer()
Disable animation timer.
void DeleteQuery()
Delete query from list tree and ask user if they want to delete it also from server.
void Terminate()
Terminate Session : save configuration, clean temporary files and close Proof connections.
TSessionQueryFrame * fQueryFrame
TList * GetSessions() const
void ShowStatus()
Retrieve and display Proof status.
void ChangeRightLogo(const char *name)
Change the right logo (used for animation).
TGCanvas * fTreeView
void StartupMessage(char *msg, Bool_t stat, Int_t curr, Int_t total)
Handle startup message (connection progress) coming from Proof session.
void ResetSession()
Reset Proof session.
TGPicture * fRightIconPicture
Basic string class.
Definition TString.h:139
Ssiz_t Length() const
Definition TString.h:421
TString & Insert(Ssiz_t pos, const char *s)
Definition TString.h:661
const char * Data() const
Definition TString.h:380
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Definition TString.h:627
Bool_t IsNull() const
Definition TString.h:418
TString & Remove(Ssiz_t pos)
Definition TString.h:685
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2356
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition TString.cxx:2334
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:636
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition TString.h:651
virtual Int_t RedirectOutput(const char *name, const char *mode="a", RedirectHandle_t *h=nullptr)
Redirect standard output (stdout, stderr) to the specified file.
Definition TSystem.cxx:1716
virtual TTime Now()
Get current time in milliseconds since 0:00 Jan 1 1995.
Definition TSystem.cxx:466
virtual Int_t Exec(const char *shellcmd)
Execute a command.
Definition TSystem.cxx:656
virtual int GetSysInfo(SysInfo_t *info) const
Returns static system info, like OS type, CPU type, number of CPUs RAM size, etc into the SysInfo_t s...
Definition TSystem.cxx:2459
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
Definition TSystem.cxx:1299
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
Definition TSystem.cxx:1066
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition TSystem.cxx:937
virtual const char * HostName()
Return the system's host name.
Definition TSystem.cxx:306
virtual const char * WorkingDirectory()
Return working directory.
Definition TSystem.cxx:874
virtual const char * HomeDirectory(const char *userName=nullptr)
Return the user's home directory.
Definition TSystem.cxx:890
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Definition TSystem.cxx:419
virtual int Unlink(const char *name)
Unlink, i.e.
Definition TSystem.cxx:1384
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
Definition TSystem.cxx:1602
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
Definition TSystem.cxx:1485
Basic time type with millisecond precision.
Definition TTime.h:27
Handles synchronous and a-synchronous timer events.
Definition TTimer.h:51
virtual void TurnOff()
Remove timer from system timer list.
Definition TTimer.cxx:231
virtual void TurnOn()
Add the timer to the system timer list.
Definition TTimer.cxx:243
void Reset()
Reset the timer.
Definition TTimer.cxx:159
TVirtualTreePlayer * GetPlayer()
Load the TTreePlayer (if not already done).
Definition TTree.cxx:6296
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
Definition TUrl.cxx:390
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51
virtual void SetEditable(Bool_t mode=kTRUE)=0
virtual TSelector * GetSelectorFromFile() const =0
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Definition first.py:1
Event structure.
Definition GuiTypes.h:174
Int_t fCpus
Definition TSystem.h:154
TString fOS
Definition TSystem.h:151
const char * fPixmap
Definition TGToolBar.h:24
TString fRealName
Definition TSystem.h:144
TString fGroup
Definition TSystem.h:142
TMarker m
Definition textangle.C:8
auto * tt
Definition textangle.C:16
double splitter
Definition triangle.c:617
#define snext(osub1, osub2)
Definition triangle.c:1168