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 "HelpText.h"
71#include "TRootHelpDialog.h"
72#include "snprintf.h"
73#ifdef WIN32
74#include "TWin32SplashThread.h"
75#endif
76
77#include <cstdlib>
78
80
81const char *kConfigFile = ".proofgui.conf";
82
91
92const char *xpm_names[] = {
93 "monitor01.xpm",
94 "monitor02.xpm",
95 "monitor03.xpm",
96 "monitor04.xpm",
97 0
98};
99
100const char *conftypes[] = {
101 "Config files", "*.conf",
102 "All files", "*.*",
103 0, 0
104};
105
106const char *pkgtypes[] = {
107 "Package files", "*.par",
108 "All files", "*.*",
109 0, 0
110};
111
112const char *macrotypes[] = {
113 "C files", "*.[C|c]*",
114 "All files", "*",
115 0, 0
116};
117
118
119const char *kFeedbackHistos[] = {
120 "PROOF_PacketsHist",
121 "PROOF_EventsHist",
122 "PROOF_NodeHist",
123 "PROOF_LatencyHist",
124 "PROOF_ProcTimeHist",
125 "PROOF_CpuTimeHist",
126 0
127};
128
129const char* const kSession_RedirectFile = ".templog";
130const char* const kSession_RedirectCmd = ".tempcmd";
131
132// Menu command id's
138
143
151
157
163
166
167const char *xpm_toolbar[] = {
168 "fileopen.xpm",
169 "filesaveas.xpm",
170 "",
171 "connect.xpm",
172 "disconnect.xpm",
173 "",
174 "query_new.xpm",
175 "query_submit.xpm",
176 "",
177 "about.xpm",
178 "",
179 "quit.xpm",
180 0
181};
182
184 { "", "Open Config File", kFALSE, kFileLoadConfig, 0 },
185 { "", "Save Config File", kFALSE, kFileSaveConfig, 0 },
186 { "", 0, 0, -1, 0 },
187 { "", "Connect", kFALSE, kSessionConnect, 0 },
188 { "", "Disconnect", kFALSE, kSessionDisconnect, 0 },
189 { "", 0, 0, -1, 0 },
190 { "", "New Query", kFALSE, kQueryNew, 0 },
191 { "", "Submit Query", kFALSE, kQuerySubmit, 0 },
192 { "", 0, 0, -1, 0 },
193 { "", "About Root", kFALSE, kHelpAbout, 0 },
194 { "", 0, 0, -1, 0 },
195 { "", "Exit Root", kFALSE, kFileQuit, 0 },
196 { 0, 0, 0, 0, 0 }
197};
198
199
200////////////////////////////////////////////////////////////////////////////////
201// Server Frame
202
203////////////////////////////////////////////////////////////////////////////////
204/// Constructor.
205
207 TGCompositeFrame(p, w, h), fFrmNewServer(0), fTxtName(0), fTxtAddress(0),
208 fNumPort(0), fLogLevel(0), fTxtConfig(0), fTxtUsrName(0), fSync(0),
209 fViewer(0), fBtnAdd(0), fBtnConnect(0)
210{
211}
212
213////////////////////////////////////////////////////////////////////////////////
214/// Destructor.
215
217{
218 Cleanup();
219}
220
221////////////////////////////////////////////////////////////////////////////////
222/// Build server configuration frame.
223
225{
227
229
230 fViewer = gui;
231 fFrmNewServer = new TGGroupFrame(this, "New Session");
233
235
237
238 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Session Name:"),
239 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
241 (const char *)0, 1), new TGLayoutHints());
243 fTxtName->Associate(this);
244 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Server name:"),
245 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
247 (const char *)0, 2), new TGLayoutHints());
249 fTxtAddress->Associate(this);
250 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Port (default: 1093):"),
251 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
255 fNumPort->Associate(this);
256 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Configuration File:"),
257 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
259 (const char *)0, 4), new TGLayoutHints());
261 fTxtConfig->Associate(this);
262 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Log Level:"),
263 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
264
269 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
270 fLogLevel->Associate(this);
271
272 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "User Name:"),
273 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
275 (const char *)0, 6), new TGLayoutHints());
277 fTxtUsrName->Associate(this);
278
279 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Process mode :"),
281 3, 3, 3, 3));
283 "&Synchronous"), new TGLayoutHints(kLHintsLeft | kLHintsBottom |
284 kLHintsExpandX, 3, 3, 3, 3));
285 fSync->SetToolTipText("Default Process Mode");
287
288 AddFrame(fBtnAdd = new TGTextButton(this, " Save "),
289 new TGLayoutHints(kLHintsTop | kLHintsCenterX, 5, 5, 15, 5));
290 fBtnAdd->SetToolTipText("Add server to the list");
291 fBtnAdd->Connect("Clicked()", "TSessionServerFrame", this,
292 "OnBtnAddClicked()");
293 AddFrame(fBtnConnect = new TGTextButton(this, " Connect "),
294 new TGLayoutHints(kLHintsTop | kLHintsCenterX, 5, 5, 15, 5));
295 fBtnConnect->Connect("Clicked()", "TSessionServerFrame", this,
296 "OnBtnConnectClicked()");
297 fBtnConnect->SetToolTipText("Connect to the selected server");
298
299 fTxtConfig->Connect("DoubleClicked()", "TSessionServerFrame", this,
300 "OnConfigFileClicked()");
301
302 fTxtName->Connect("TextChanged(char*)", "TSessionServerFrame", this,
303 "SettingsChanged()");
304 fTxtAddress->Connect("TextChanged(char*)", "TSessionServerFrame", this,
305 "SettingsChanged()");
306 fTxtConfig->Connect("TextChanged(char*)", "TSessionServerFrame", this,
307 "SettingsChanged()");
308 fTxtUsrName->Connect("TextChanged(char*)", "TSessionServerFrame", this,
309 "SettingsChanged()");
310 fSync->Connect("Clicked()", "TSessionServerFrame", this,
311 "SettingsChanged()");
312 fLogLevel->Connect("ValueChanged(Long_t)", "TSessionServerFrame", this,
313 "SettingsChanged()");
314 fLogLevel->Connect("ValueSet(Long_t)", "TSessionServerFrame", this,
315 "SettingsChanged()");
316 fNumPort->Connect("ValueChanged(Long_t)", "TSessionServerFrame", this,
317 "SettingsChanged()");
318 fNumPort->Connect("ValueSet(Long_t)", "TSessionServerFrame", this,
319 "SettingsChanged()");
320
321}
322
323////////////////////////////////////////////////////////////////////////////////
324/// Settings have changed, update GUI accordingly.
325
327{
328 TGTextEntry *sender = dynamic_cast<TGTextEntry*>((TQObject*)gTQSender);
329 Bool_t issync = (fSync->GetState() == kButtonDown);
330 if ((fViewer->GetActDesc()->fLocal) ||
331 (strcmp(fViewer->GetActDesc()->GetName(), fTxtName->GetText())) ||
332 (strcmp(fViewer->GetActDesc()->fAddress.Data(), fTxtAddress->GetText())) ||
333 (strcmp(fViewer->GetActDesc()->fConfigFile.Data(), fTxtConfig->GetText())) ||
334 (strcmp(fViewer->GetActDesc()->fUserName.Data(), fTxtUsrName->GetText())) ||
337 (fViewer->GetActDesc()->fSync != issync)) {
340 }
341 else {
344 }
345 if (sender) {
346 sender->SetFocus();
347 }
348}
349
350
351////////////////////////////////////////////////////////////////////////////////
352/// Handle expose event in server frame.
353
355{
356 //fTxtName->SelectAll();
357 //fTxtName->SetFocus();
358 return kTRUE;
359}
360
361////////////////////////////////////////////////////////////////////////////////
362/// Browse configuration files.
363
365{
366 // do nothing if connection in progress
367 if (fViewer->IsBusy())
368 return;
369 TGFileInfo fi;
372 if (!fi.fFilename) return;
374}
375
376////////////////////////////////////////////////////////////////////////////////
377/// Delete selected session configuration (remove it from the list).
378
380{
381 // do nothing if connection in progress
382 if (fViewer->IsBusy())
383 return;
385 TIter next(fViewer->GetSessions());
387
388 if (desc->fLocal) {
389 Int_t retval;
390 new TGMsgBox(fClient->GetRoot(), this, "Error Deleting Session",
391 "Deleting Local Sessions is not allowed !",
392 kMBIconExclamation,kMBOk,&retval);
393 return;
394 }
395 // ask for confirmation
396 TString m;
397 m.Form("Are you sure to delete the server \"%s\"",
398 desc->fName.Data());
400 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), 0,
402 // if confirmed, delete it
403 if (result == kMBOk) {
404 // remove the Proof session from gROOT list of Proofs
405 if (desc->fConnected && desc->fAttached && desc->fProof) {
406 desc->fProof->Detach("S");
407 }
408 // remove it from our sessions list
409 fViewer->GetSessions()->Remove((TObject *)desc);
410 // update configuration file
413
414 TObject *obj = fViewer->GetSessions()->Last();
416 fViewer->GetSessionItem(), (void *)obj);
417 if (item) {
424 fViewer->OnListTreeClicked(item, 1, 0, 0);
425 }
426 }
427 if (fViewer->IsAutoSave())
429}
430
431////////////////////////////////////////////////////////////////////////////////
432/// Connect to selected server.
433
435{
436 // do nothing if connection in progress
437 if (fViewer->IsBusy())
438 return;
439
442 }
443 else {
446 if (strlen(fTxtConfig->GetText()) > 1)
448 else
453 if (fViewer->IsAutoSave())
455 }
456 // set flag busy
457 fViewer->SetBusy();
458 // avoid input events in list tree while connecting
463 // set watch cursor to indicate connection in progress
465 gVirtualX->CreateCursor(kWatch));
466 gVirtualX->SetCursor(GetId(),gVirtualX->CreateCursor(kWatch));
467 // display connection progress bar in first part of status bar
469 // connect to proof startup message (to update progress bar)
470 TQObject::Connect("TProof", "StartupMessage(char *,Bool_t,Int_t,Int_t)",
471 "TSessionViewer", fViewer, "StartupMessage(char *,Bool_t,Int_t,Int_t)");
472 // collect and set-up configuration
473 TString address = fTxtAddress->GetText();
474 TString url;
475 if (address == "lite://") {
476 url = address;
477 }
478 else {
479 // collect and set-up configuration
480 url = fTxtUsrName->GetText();
481 url += "@"; url += address.Data();
482 if (fNumPort->GetIntNumber() > 0) {
483 url += ":";
484 url += fNumPort->GetIntNumber();
485 }
486 }
487
488 TProofDesc *desc;
490 if (!fViewer->GetActDesc()->fProofMgr ||
492 // hide connection progress bar from status bar
494 // release busy flag
496 // restore cursors and input
497 gVirtualX->SetCursor(GetId(), 0);
502 gVirtualX->SetCursor(fViewer->GetSessionHierarchy()->GetId(), 0);
503 return;
504 }
506 // check if the session already exist before to recreate it
507 TList *sessions = fViewer->GetActDesc()->fProofMgr->QuerySessions("");
508 if (sessions) {
509 TIter nextp(sessions);
510 // loop over existing Proof sessions
511 while ((desc = (TProofDesc *)nextp())) {
512 if ((desc->GetName() == fViewer->GetActDesc()->fTag) ||
513 (desc->GetTitle() == fViewer->GetActDesc()->fName)) {
516 fViewer->GetActDesc()->fTag = desc->GetName();
520
522 Int_t i = 0;
523 // browse list of feedback histos and check user's selected ones
524 while (kFeedbackHistos[i]) {
525 if (fViewer->GetCascadeMenu()->IsEntryChecked(41+i)) {
528 }
529 i++;
530 }
531 // connect feedback signal
532 fViewer->GetActDesc()->fProof->Connect("Feedback(TList *objs)",
533 "TSessionQueryFrame", fViewer->GetQueryFrame(),
534 "Feedback(TList *objs)");
535 gROOT->Time();
536 }
537 else {
538 // if feedback option not selected, clear Proof's feedback option
540 }
541
542 break;
543 }
544 }
545 }
546 if (fViewer->GetActDesc()->fProof == 0) {
547 if (fViewer->GetActDesc()->fProofMgr->IsValid()) {
550 desc = 0;
551 sessions = fViewer->GetActDesc()->fProofMgr->QuerySessions("");
552 if (sessions)
553 desc = (TProofDesc *)sessions->Last();
554 if (desc) {
556 fViewer->GetActDesc()->fTag = desc->GetName();
559 }
560 }
561 }
562 if (fViewer->GetActDesc()->fProof) {
567 if (fViewer->GetActDesc()->fLogLevel < 0)
569 if (fViewer->GetActDesc()->fProof->IsLite())
570 fViewer->GetActDesc()->fAddress = "lite://";
571 else
575 }
577
578 // check if connected and valid
579 if (fViewer->GetActDesc()->fProof &&
581 // set log level
583 // set query type (synch / asynch)
586 // set connected flag
588 // change list tree item picture to connected pixmap
591 if (item) {
593 // update viewer
594 fViewer->OnListTreeClicked(item, 1, 0, 0);
597 }
598 // connect to progress related signals
599 fViewer->GetActDesc()->fProof->Connect("Progress(Long64_t,Long64_t)",
600 "TSessionQueryFrame", fViewer->GetQueryFrame(),
601 "Progress(Long64_t,Long64_t)");
602 fViewer->GetActDesc()->fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
603 "TSessionQueryFrame", fViewer->GetQueryFrame(),
604 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
605 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)",
606 "TSessionQueryFrame", fViewer->GetQueryFrame(),
607 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
608 fViewer->GetActDesc()->fProof->Connect("StopProcess(Bool_t)",
609 "TSessionQueryFrame", fViewer->GetQueryFrame(),
610 "IndicateStop(Bool_t)");
612 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)",
613 "TSessionQueryFrame", fViewer->GetQueryFrame(),
614 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)");
615 // enable timer used for status bar icon's animation
617 // change status bar right icon to connected pixmap
618 fViewer->ChangeRightLogo("monitor01.xpm");
619 // do not animate yet
621 // connect to signal "query result ready"
622 fViewer->GetActDesc()->fProof->Connect("QueryResultReady(char *)",
623 "TSessionViewer", fViewer, "QueryResultReady(char *)");
624 // display connection information on status bar
625 TString msg;
626 msg.Form("PROOF Cluster %s ready", fViewer->GetActDesc()->fName.Data());
627 fViewer->GetStatusBar()->SetText(msg.Data(), 1);
631 // Enable previously uploaded packages if in auto-enable mode
633 TPackageDescription *package;
635 while ((package = (TPackageDescription *)next())) {
636 if (!package->fEnabled) {
637 if (fViewer->GetActDesc()->fProof->EnablePackage(package->fName) != 0)
638 Error("Submit", "Enable package failed");
639 else {
640 package->fEnabled = kTRUE;
642 }
643 }
644 }
645 }
646 }
647 // hide connection progress bar from status bar
649 // release busy flag
651 // restore cursors and input
652 gVirtualX->SetCursor(GetId(), 0);
657 gVirtualX->SetCursor(fViewer->GetSessionHierarchy()->GetId(), 0);
658}
659
660////////////////////////////////////////////////////////////////////////////////
661/// Reset server configuration fields.
662
664{
665 // do nothing if connection in progress
666 if (fViewer->IsBusy())
667 return;
675 fTxtName->SetText("");
676 fTxtAddress->SetText("");
677 fTxtConfig->SetText("");
678 fNumPort->SetIntNumber(1093);
680 fTxtUsrName->SetText("");
681}
682
683////////////////////////////////////////////////////////////////////////////////
684/// Add newly created session configuration in the list of sessions.
685
687{
688 Int_t retval;
689 Bool_t newSession = kTRUE;
690 TSessionDescription* desc = 0;
691 // do nothing if connection in progress
692 if (fViewer->IsBusy())
693 return;
694
695 if ((!fTxtName->GetBuffer()->GetTextLength()) ||
698 new TGMsgBox(fClient->GetRoot(), fViewer, "Error Adding Session",
699 "At least one required field is empty !",
700 kMBIconExclamation, kMBOk, &retval);
701 return;
702 }
704 if (obj)
705 desc = dynamic_cast<TSessionDescription*>(obj);
706 if (desc) {
707 new TGMsgBox(fClient->GetRoot(), fViewer, "Adding Session",
708 TString::Format("The session \"%s\" already exists ! Overwrite ?",
710 kMBCancel, &retval);
711 if (retval != kMBYes)
712 return;
713 newSession = kFALSE;
714 }
715 if (newSession) {
716 desc = new TSessionDescription();
717 desc->fName = fTxtName->GetText();
718 desc->fTag = "";
719 desc->fQueries = new TList();
720 desc->fPackages = new TList();
721 desc->fActQuery = 0;
722 desc->fProof = 0;
723 desc->fProofMgr = 0;
724 desc->fAutoEnable = kFALSE;
725 desc->fAddress = fTxtAddress->GetText();
726 desc->fPort = fNumPort->GetIntNumber();
727 desc->fConnected = kFALSE;
728 desc->fAttached = kFALSE;
729 desc->fLocal = kFALSE;
730 if (strlen(fTxtConfig->GetText()) > 1)
732 else
733 desc->fConfigFile = "";
735 desc->fUserName = fTxtUsrName->GetText();
736 desc->fSync = (fSync->GetState() == kButtonDown);
737 // add newly created session config to our session list
738 fViewer->GetSessions()->Add((TObject *)desc);
739 // save into configuration file
741 fViewer->GetSessionItem(), desc->fName.Data(),
743 fViewer->GetSessionHierarchy()->SetToolTipItem(item, "Proof Session");
744 item->SetUserData(desc);
752 fViewer->OnListTreeClicked(item, 1, 0, 0);
753 }
754 else {
758 if (strlen(fTxtConfig->GetText()) > 1)
764 item2->SetUserData(fViewer->GetActDesc());
766 1, 0, 0);
767 }
770 if (fViewer->IsAutoSave())
772}
773
774////////////////////////////////////////////////////////////////////////////////
775/// Update fields with values from session description desc.
776
778{
779 if (desc->fLocal) {
780 fTxtName->SetText("");
781 fTxtAddress->SetText("");
782 fNumPort->SetIntNumber(1093);
783 fTxtConfig->SetText("");
784 fTxtUsrName->SetText("");
786 return;
787 }
788
789 fTxtName->SetText(desc->fName);
793
794 if (desc->fConfigFile.Length() > 1) {
796 }
797 else {
798 fTxtConfig->SetText("");
799 }
801}
802
803////////////////////////////////////////////////////////////////////////////////
804/// Process messages for session server frame.
805/// Used to navigate between text entry fields.
806
808{
809 switch (GET_MSG(msg)) {
810 case kC_TEXTENTRY:
811 switch (GET_SUBMSG(msg)) {
812 case kTE_ENTER:
813 case kTE_TAB:
814 switch (parm1) {
815 case 1: // session name
818 break;
819 case 2: // server address
822 break;
823 case 3: // port number
826 break;
827 case 4: // configuration file
830 break;
831 case 5: // log level
834 break;
835 case 6: // user name
838 break;
839 }
840 break;
841
842 default:
843 break;
844 }
845 break;
846
847 default:
848 break;
849 }
850 return kTRUE;
851}
852
853////////////////////////////////////////////////////////////////////////////////
854// Session Frame
855
856////////////////////////////////////////////////////////////////////////////////
857/// Constructor.
858
860 TGCompositeFrame(p, w, h), fTab(0), fFA(0), fFB(0), fFC(0), fFD(0), fFE(0),
861 fCommandTxt(0), fCommandBuf(0), fInfoTextView(0), fClearCheck(0),
862 fBtnShowLog(0), fBtnNewQuery(0), fBtnGetQueries(0), fLBPackages(0),
863 fBtnAdd(0), fBtnRemove(0), fBtnUp(0), fBtnDown(0), fBtnShow(0),
864 fBtnShowEnabled(0), fChkMulti(0), fChkEnable(0), fBtnUpload(0),
865 fBtnEnable(0), fBtnClear(0), fBtnDisable(0), fDSetView(0), fDataSetTree(0),
866 fBtnUploadDSet(0), fBtnRemoveDSet(0), fBtnVerifyDSet(0), fBtnRefresh(0),
867 fTxtParallel(0), fLogLevel(0), fApplyLogLevel(0), fApplyParallel(0),
868 fViewer(0)
869{
870 for (int i=0;i<19;++i) fInfoLine[i] = 0;
871}
872
873////////////////////////////////////////////////////////////////////////////////
874/// Destructor.
875
877{
878 Cleanup();
879}
880
881////////////////////////////////////////////////////////////////////////////////
882/// Build session frame.
883
885{
888 fViewer = gui;
889 Int_t i,j;
890
891 // main session tab
892 fTab = new TGTab(this, 200, 200);
894 kLHintsExpandY, 2, 2, 2, 2));
895
896 // add "Status" tab element
897 TGCompositeFrame *tf = fTab->AddTab("Status");
898 fFA = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
901
902 // add first session information line
903 fInfoLine[0] = new TGLabel(fFA, " ");
905 kLHintsExpandX, 5, 5, 15, 5));
906
907 TGCompositeFrame* frmInfos = new TGHorizontalFrame(fFA, 350, 100);
908 frmInfos->SetLayoutManager(new TGTableLayout(frmInfos, 9, 2));
909
910 // add session information lines
911 j = 0;
912 for (i=0;i<17;i+=2) {
913 fInfoLine[i+1] = new TGLabel(frmInfos, " ");
914 frmInfos->AddFrame(fInfoLine[i+1], new TGTableLayoutHints(0, 1, j, j+1,
915 kLHintsLeft | kLHintsCenterY, 5, 5, 2, 2));
916 fInfoLine[i+2] = new TGLabel(frmInfos, " ");
917 frmInfos->AddFrame(fInfoLine[i+2], new TGTableLayoutHints(1, 2, j, j+1,
918 kLHintsLeft | kLHintsCenterY, 5, 5, 2, 2));
919 j++;
920 }
922 kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5));
923
924 // add "new query" and "get queries" buttons
925 TGCompositeFrame* frmBut1 = new TGHorizontalFrame(fFA, 350, 100);
926 frmBut1->SetCleanup(kDeepCleanup);
927 frmBut1->AddFrame(fBtnNewQuery = new TGTextButton(frmBut1, "New Query..."),
928 new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5));
929 fBtnNewQuery->SetToolTipText("Open New Query Dialog");
930 frmBut1->AddFrame(fBtnGetQueries = new TGTextButton(frmBut1, " Get Queries "),
931 new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5));
932 fBtnGetQueries->SetToolTipText("Get List of Queries from the server");
933 fBtnShowLog = new TGTextButton(frmBut1, "Show log...");
934 fBtnShowLog->SetToolTipText("Show Session log (opens log window)");
936 kLHintsExpandX, 5, 5, 5, 5));
939
940 // add "Commands" tab element
941 tf = fTab->AddTab("Commands");
942 fFC = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
945
946 // add command line label and text entry
947 TGCompositeFrame* frmCmd = new TGHorizontalFrame(fFC, 350, 100);
948 frmCmd->SetCleanup(kDeepCleanup);
949 frmCmd->AddFrame(new TGLabel(frmCmd, "Command Line :"),
950 new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 5, 5, 15, 5));
951 fCommandBuf = new TGTextBuffer(120);
952 frmCmd->AddFrame(fCommandTxt = new TGTextEntry(frmCmd,
954 kLHintsExpandX, 5, 5, 15, 5));
955 fFC->AddFrame(frmCmd, new TGLayoutHints(kLHintsExpandX, 5, 5, 10, 5));
956 // connect command line text entry to "return pressed" signal
957 fCommandTxt->Connect("ReturnPressed()", "TSessionFrame", this,
958 "OnCommandLine()");
959
960 // check box for option "clear view"
961 fClearCheck = new TGCheckButton(fFC, "Clear view after each command");
963 10, 5, 5, 5));
965 // add text view for redirected output
966 fFC->AddFrame(new TGLabel(fFC, "Output :"),
967 new TGLayoutHints(kLHintsLeft | kLHintsTop, 10, 5, 5, 5));
968 fInfoTextView = new TGTextView(fFC, 330, 150, "", kSunkenFrame |
971 kLHintsTop | kLHintsExpandX | kLHintsExpandY, 10, 10, 5, 5));
972
973 // add "Packages" tab element
974 tf = fTab->AddTab("Packages");
975 fFB = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
978
979 // new frame containing packages listbox and control buttons
980 TGCompositeFrame* frmcanvas = new TGHorizontalFrame(fFB, 350, 100);
981
982 // packages listbox
983 fLBPackages = new TGListBox(frmcanvas);
984 fLBPackages->Resize(80,150);
987 kLHintsExpandY, 5, 5, 5, 5));
988 // control buttons frame
989 TGCompositeFrame* frmBut2 = new TGVerticalFrame(frmcanvas, 150, 100);
990
991 fChkMulti = new TGCheckButton(frmBut2, "Multiple Selection");
992 fChkMulti->SetToolTipText("Enable multiple selection in the package list");
993 frmBut2->AddFrame(fChkMulti, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
994
995 fBtnAdd = new TGTextButton(frmBut2, " Add... ");
996 fBtnAdd->SetToolTipText("Add a package to the list");
998 kLHintsExpandX, 5, 5, 5, 5));
999 fBtnRemove = new TGTextButton(frmBut2, "Remove");
1000 fBtnRemove->SetToolTipText("Remove package from the list");
1002 kLHintsExpandX, 5, 5, 5, 5));
1003 fBtnUp = new TGTextButton(frmBut2, "Move Up");
1004 fBtnUp->SetToolTipText("Move package one step upward in the list");
1006 kLHintsExpandX, 5, 5, 5, 5));
1007 fBtnDown = new TGTextButton(frmBut2, "Move Down");
1008 fBtnDown->SetToolTipText("Move package one step downward in the list");
1010 kLHintsExpandX, 5, 5, 5, 5));
1011 frmcanvas->AddFrame(frmBut2, new TGLayoutHints(kLHintsLeft | kLHintsCenterY |
1013 fFB->AddFrame(frmcanvas, new TGLayoutHints(kLHintsLeft | kLHintsTop |
1015
1016 TGCompositeFrame* frmLeg = new TGHorizontalFrame(fFB, 300, 100);
1017 frmLeg->SetCleanup(kDeepCleanup);
1018 TGPicture *pic1 = (TGPicture *)fClient->GetPicture("package.xpm");
1019 TGIcon *icn1 = new TGIcon(frmLeg, pic1, pic1->GetWidth(), pic1->GetHeight());
1020 frmLeg->AddFrame(icn1, new TGLayoutHints(kLHintsLeft | kLHintsTop,
1021 5, 5, 0, 5));
1022 frmLeg->AddFrame(new TGLabel(frmLeg, ": Local"),
1023 new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 10, 0, 5));
1024
1025 TGPicture *pic2 = (TGPicture *)fClient->GetPicture("package_delete.xpm");
1026 TGIcon *icn2 = new TGIcon(frmLeg, pic2, pic2->GetWidth(), pic2->GetHeight());
1027 frmLeg->AddFrame(icn2, new TGLayoutHints(kLHintsLeft | kLHintsTop,
1028 5, 5, 0, 5));
1029 frmLeg->AddFrame(new TGLabel(frmLeg, ": Uploaded"),
1030 new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 10, 0, 5));
1031
1032 TGPicture *pic3 = (TGPicture *)fClient->GetPicture("package_add.xpm");
1033 TGIcon *icn3 = new TGIcon(frmLeg, pic3, pic3->GetWidth(), pic3->GetHeight());
1034 frmLeg->AddFrame(icn3, new TGLayoutHints(kLHintsLeft | kLHintsTop,
1035 5, 5, 0, 5));
1036 frmLeg->AddFrame(new TGLabel(frmLeg, ": Enabled"),
1037 new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 10, 0, 5));
1039 kLHintsExpandX, 0, 0, 0, 0));
1040
1041 TGCompositeFrame* frmBtn = new TGHorizontalFrame(fFB, 300, 100);
1042 frmBtn->SetCleanup(kDeepCleanup);
1043 frmBtn->AddFrame(fBtnUpload = new TGTextButton(frmBtn,
1044 " Upload "), new TGLayoutHints(kLHintsLeft | kLHintsExpandX |
1045 kLHintsCenterY, 5, 5, 5, 5));
1046 fBtnUpload->SetToolTipText("Upload selected package(s) to the server");
1047 frmBtn->AddFrame(fBtnEnable = new TGTextButton(frmBtn,
1048 " Enable "), new TGLayoutHints(kLHintsLeft | kLHintsExpandX |
1049 kLHintsCenterY, 5, 5, 5, 5));
1050 fBtnEnable->SetToolTipText("Enable selected package(s) on the server");
1051 frmBtn->AddFrame(fBtnDisable = new TGTextButton(frmBtn,
1052 " Disable "), new TGLayoutHints(kLHintsLeft | kLHintsExpandX |
1053 kLHintsCenterY, 5, 5, 5, 5));
1054 fBtnDisable->SetToolTipText("Disable selected package(s) on the server");
1055 frmBtn->AddFrame(fBtnClear = new TGTextButton(frmBtn,
1056 " Clear "), new TGLayoutHints(kLHintsLeft | kLHintsExpandX |
1057 kLHintsCenterY, 5, 5, 5, 5));
1058 fBtnClear->SetToolTipText("Clear all packages on the server");
1059 fFB->AddFrame(frmBtn, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
1060
1062
1063 TGCompositeFrame* frmBtn3 = new TGHorizontalFrame(fFB, 300, 100);
1064 frmBtn3->SetCleanup(kDeepCleanup);
1065 fBtnShow = new TGTextButton(frmBtn3, "Show packages");
1066 fBtnShow->SetToolTipText("Show (list) available packages on the server");
1068 kLHintsExpandX, 5, 5, 5, 5));
1069 fBtnShowEnabled = new TGTextButton(frmBtn3, "Show Enabled");
1070 fBtnShowEnabled->SetToolTipText("Show (list) enabled packages on the server");
1072 kLHintsExpandX, 5, 5, 5, 5));
1073 fFB->AddFrame(frmBtn3, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
1074
1075 fChkEnable = new TGCheckButton(fFB, "Enable at session startup");
1076 fChkEnable->SetToolTipText("Enable packages on the server at startup time");
1077 fFB->AddFrame(fChkEnable, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
1078
1079 // add "DataSets" tab element
1080 tf = fTab->AddTab("DataSets");
1081 fFE = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
1084
1085 // new frame containing datasets treeview and control buttons
1086 TGCompositeFrame* frmdataset = new TGHorizontalFrame(fFE, 350, 100);
1087
1088 // datasets list tree
1089 fDSetView = new TGCanvas(frmdataset, 200, 200, kSunkenFrame | kDoubleBorder);
1091 5, 5, 5, 5));
1093 fDataSetTree->AddItem(0, "DataSets");
1094
1095 // control buttons frame
1096 TGCompositeFrame* frmBut3 = new TGVerticalFrame(frmdataset, 150, 100);
1097
1098 fBtnUploadDSet = new TGTextButton(frmBut3, " Upload... ");
1099 fBtnUploadDSet->SetToolTipText("Upload a dataset to the cluster");
1101 kLHintsExpandX, 5, 5, 5, 5));
1102 fBtnRemoveDSet = new TGTextButton(frmBut3, "Remove");
1103 fBtnRemoveDSet->SetToolTipText("Remove dataset from the cluster");
1105 kLHintsExpandX, 5, 5, 5, 5));
1106 fBtnVerifyDSet = new TGTextButton(frmBut3, "Verify");
1107 fBtnVerifyDSet->SetToolTipText("Verify dataset on the cluster");
1109 kLHintsExpandX, 5, 5, 5, 5));
1110 fBtnRefresh = new TGTextButton(frmBut3, "Refresh List");
1111 fBtnRefresh->SetToolTipText("Refresh List of DataSet/Files present on the cluster");
1113 kLHintsExpandX, 5, 5, 15, 5));
1114
1115 frmdataset->AddFrame(frmBut3, new TGLayoutHints(kLHintsLeft | kLHintsCenterY |
1116 kLHintsExpandY, 5, 5, 5, 0));
1117
1118 fFE->AddFrame(frmdataset, new TGLayoutHints(kLHintsLeft | kLHintsTop |
1120
1121 // add "Options" tab element
1122 tf = fTab->AddTab("Options");
1123 fFD = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
1126
1127 // add Log Level label and text entry
1128 TGCompositeFrame* frmLog = new TGHorizontalFrame(fFD, 310, 100, kFixedWidth);
1129 frmLog->SetCleanup(kDeepCleanup);
1130 frmLog->AddFrame(fApplyLogLevel = new TGTextButton(frmLog,
1131 " Apply "), new TGLayoutHints(kLHintsRight |
1132 kLHintsCenterY, 10, 5, 5, 5));
1133 fApplyLogLevel->SetToolTipText("Apply currently selected log level");
1137 kLHintsCenterY, 5, 5, 5, 5));
1138 frmLog->AddFrame(new TGLabel(frmLog, "Log Level :"),
1139 new TGLayoutHints(kLHintsRight | kLHintsCenterY, 5, 5, 5, 5));
1140 fFD->AddFrame(frmLog, new TGLayoutHints(kLHintsLeft, 5, 5, 15, 5));
1141
1142 // add Parallel Nodes label and text entry
1143 TGCompositeFrame* frmPar = new TGHorizontalFrame(fFD, 310, 100, kFixedWidth);
1144 frmPar->SetCleanup(kDeepCleanup);
1145 frmPar->AddFrame(fApplyParallel = new TGTextButton(frmPar,
1146 " Apply "), new TGLayoutHints(kLHintsRight |
1147 kLHintsCenterY, 10, 5, 5, 5));
1148 fApplyParallel->SetToolTipText("Apply currently selected parallel nodes");
1149 fTxtParallel = new TGTextEntry(frmPar);
1151 fTxtParallel->SetText("99999");
1154 kLHintsCenterY, 5, 5, 5, 5));
1155 frmPar->AddFrame(new TGLabel(frmPar, "Set Parallel Nodes :"),
1156 new TGLayoutHints(kLHintsRight | kLHintsCenterY, 5, 5, 5, 5));
1157 fFD->AddFrame(frmPar, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
1158
1159 // connect button actions to functions
1160 fBtnShowLog->Connect("Clicked()", "TSessionFrame", this,
1161 "OnBtnShowLogClicked()");
1162 fBtnNewQuery->Connect("Clicked()", "TSessionFrame", this,
1163 "OnBtnNewQueryClicked()");
1164 fBtnGetQueries->Connect("Clicked()", "TSessionFrame", this,
1165 "OnBtnGetQueriesClicked()");
1166
1167 fChkEnable->Connect("Toggled(Bool_t)", "TSessionFrame", this,
1168 "OnStartupEnable(Bool_t)");
1169 fChkMulti->Connect("Toggled(Bool_t)", "TSessionFrame", this,
1170 "OnMultipleSelection(Bool_t)");
1171 fBtnAdd->Connect("Clicked()", "TSessionFrame", this,
1172 "OnBtnAddClicked()");
1173 fBtnRemove->Connect("Clicked()", "TSessionFrame", this,
1174 "OnBtnRemoveClicked()");
1175 fBtnUp->Connect("Clicked()", "TSessionFrame", this,
1176 "OnBtnUpClicked()");
1177 fBtnDown->Connect("Clicked()", "TSessionFrame", this,
1178 "OnBtnDownClicked()");
1179 fApplyLogLevel->Connect("Clicked()", "TSessionFrame", this,
1180 "OnApplyLogLevel()");
1181 fApplyParallel->Connect("Clicked()", "TSessionFrame", this,
1182 "OnApplyParallel()");
1183 fBtnUpload->Connect("Clicked()", "TSessionFrame", this,
1184 "OnUploadPackages()");
1185 fBtnEnable->Connect("Clicked()", "TSessionFrame", this,
1186 "OnEnablePackages()");
1187 fBtnDisable->Connect("Clicked()", "TSessionFrame", this,
1188 "OnDisablePackages()");
1189 fBtnClear->Connect("Clicked()", "TSessionFrame", this,
1190 "OnClearPackages()");
1191 fBtnShowEnabled->Connect("Clicked()", "TSessionViewer", fViewer,
1192 "ShowEnabledPackages()");
1193 fBtnShow->Connect("Clicked()", "TSessionViewer", fViewer,
1194 "ShowPackages()");
1195
1196 fBtnUploadDSet->Connect("Clicked()", "TSessionFrame", this,
1197 "OnBtnUploadDSet()");
1198 fBtnRemoveDSet->Connect("Clicked()", "TSessionFrame", this,
1199 "OnBtnRemoveDSet()");
1200 fBtnVerifyDSet->Connect("Clicked()", "TSessionFrame", this,
1201 "OnBtnVerifyDSet()");
1202 fBtnRefresh->Connect("Clicked()", "TSessionFrame", this,
1203 "UpdateListOfDataSets()");
1204}
1205
1206////////////////////////////////////////////////////////////////////////////////
1207/// Display information on current session.
1208
1210{
1211 TString buf;
1212
1213 // if local session
1214 if (fViewer->GetActDesc()->fLocal) {
1215 buf.Form("*** Local Session on %s ***", gSystem->HostName());
1216 fInfoLine[0]->SetText(buf.Data());
1217 UserGroup_t *userGroup = gSystem->GetUserInfo();
1218 fInfoLine[1]->SetText("User :");
1219 if (userGroup) buf.Form("%s", userGroup->fRealName.Data());
1220 fInfoLine[2]->SetText(buf.Data());
1221 fInfoLine[3]->SetText("Working directory :");
1222 buf.Form("%s", gSystem->WorkingDirectory());
1223 fInfoLine[4]->SetText(buf.Data());
1224 fInfoLine[5]->SetText(" ");
1225 fInfoLine[6]->SetText(" ");
1226 fInfoLine[7]->SetText(" ");
1227 fInfoLine[8]->SetText(" ");
1228 fInfoLine[9]->SetText(" ");
1229 fInfoLine[10]->SetText(" ");
1230 fInfoLine[11]->SetText(" ");
1231 fInfoLine[12]->SetText(" ");
1232 fInfoLine[13]->SetText(" ");
1233 fInfoLine[14]->SetText(" ");
1234 fInfoLine[15]->SetText(" ");
1235 fInfoLine[16]->SetText(" ");
1236 fInfoLine[17]->SetText(" ");
1237 fInfoLine[18]->SetText(" ");
1238 if (userGroup) delete userGroup;
1239 Layout();
1241 return;
1242 }
1243 // return if not a valid Proof session
1244 if (!fViewer->GetActDesc()->fConnected ||
1246 !fViewer->GetActDesc()->fProof ||
1248 return;
1249
1250 if (!fViewer->GetActDesc()->fProof->IsMaster()) {
1252 buf.Form("*** Connected to %s (parallel mode, %d workers) ***",
1255 else
1256 buf.Form("*** Connected to %s (sequential mode) ***",
1258 fInfoLine[0]->SetText(buf.Data());
1259 fInfoLine[1]->SetText("Port number : ");
1260 buf.Form("%d", fViewer->GetActDesc()->fProof->GetPort());
1261 fInfoLine[2]->SetText(buf.Data());
1262 fInfoLine[3]->SetText("User : ");
1263 buf.Form("%s", fViewer->GetActDesc()->fProof->GetUser());
1264 fInfoLine[4]->SetText(buf.Data());
1265 fInfoLine[5]->SetText("Client protocol version : ");
1267 fInfoLine[6]->SetText(buf.Data());
1268 fInfoLine[7]->SetText("Remote protocol version : ");
1270 fInfoLine[8]->SetText(buf.Data());
1271 fInfoLine[9]->SetText("Log level : ");
1272 buf.Form("%d", fViewer->GetActDesc()->fProof->GetLogLevel());
1273 fInfoLine[10]->SetText(buf.Data());
1274 fInfoLine[11]->SetText("Session unique tag : ");
1275 buf.Form("%s", fViewer->GetActDesc()->fProof->IsValid() ?
1276 fViewer->GetActDesc()->fProof->GetSessionTag() : " ");
1277 fInfoLine[12]->SetText(buf.Data());
1278 fInfoLine[13]->SetText("Total MB's processed :");
1279 buf.Form("%.2f", float(fViewer->GetActDesc()->fProof->GetBytesRead())/(1024*1024));
1280 fInfoLine[14]->SetText(buf.Data());
1281 fInfoLine[15]->SetText("Total real time used (s) :");
1282 buf.Form("%.3f", fViewer->GetActDesc()->fProof->GetRealTime());
1283 fInfoLine[16]->SetText(buf.Data());
1284 fInfoLine[17]->SetText("Total CPU time used (s) :");
1285 buf.Form("%.3f", fViewer->GetActDesc()->fProof->GetCpuTime());
1286 fInfoLine[18]->SetText(buf.Data());
1287 }
1288 else {
1290 buf.Form("*** Master server %s (parallel mode, %d workers) ***",
1293 else
1294 buf.Form("*** Master server %s (sequential mode) ***",
1296 fInfoLine[0]->SetText(buf.Data());
1297 fInfoLine[1]->SetText("Port number : ");
1298 buf.Form("%d", fViewer->GetActDesc()->fProof->GetPort());
1299 fInfoLine[2]->SetText(buf.Data());
1300 fInfoLine[3]->SetText("User : ");
1301 buf.Form("%s", fViewer->GetActDesc()->fProof->GetUser());
1302 fInfoLine[4]->SetText(buf.Data());
1303 fInfoLine[5]->SetText("Protocol version : ");
1305 fInfoLine[6]->SetText(buf.Data());
1306 fInfoLine[7]->SetText("Image name : ");
1307 buf.Form("%s",fViewer->GetActDesc()->fProof->GetImage());
1308 fInfoLine[8]->SetText(buf.Data());
1309 fInfoLine[9]->SetText("Config directory : ");
1310 buf.Form("%s", fViewer->GetActDesc()->fProof->GetConfDir());
1311 fInfoLine[10]->SetText(buf.Data());
1312 fInfoLine[11]->SetText("Config file : ");
1313 buf.Form("%s", fViewer->GetActDesc()->fProof->GetConfFile());
1314 fInfoLine[12]->SetText(buf.Data());
1315 fInfoLine[13]->SetText("Total MB's processed :");
1316 buf.Form("%.2f", float(fViewer->GetActDesc()->fProof->GetBytesRead())/(1024*1024));
1317 fInfoLine[14]->SetText(buf.Data());
1318 fInfoLine[15]->SetText("Total real time used (s) :");
1319 buf.Form("%.3f", fViewer->GetActDesc()->fProof->GetRealTime());
1320 fInfoLine[16]->SetText(buf.Data());
1321 fInfoLine[17]->SetText("Total CPU time used (s) :");
1322 buf.Form("%.3f", fViewer->GetActDesc()->fProof->GetCpuTime());
1323 fInfoLine[18]->SetText(buf.Data());
1324 }
1325 Layout();
1327}
1328
1329////////////////////////////////////////////////////////////////////////////////
1330/// Open Upload Dataset dialog.
1331
1333{
1334 if (fViewer->IsBusy())
1335 return;
1336 if (fViewer->GetActDesc()->fLocal) return;
1337 new TUploadDataSetDlg(fViewer, 450, 360);
1338}
1339
1340////////////////////////////////////////////////////////////////////////////////
1341/// Update list of dataset present on the cluster.
1342
1344{
1345 TObjString *dsetname;
1346 TFileInfo *dsetfilename;
1347 // cleanup the list
1352
1353 const TGPicture *dseticon = fClient->GetPicture("rootdb_t.xpm");
1354 // ask for the list of datasets
1355
1356 // TODO: is now returning a TMap; viewer has to be adapted
1357 TList *dsetlist = 0; //fViewer->GetActDesc()->fProof->GetDataSets();
1358 // coverity[dead_error_condition]: to be changed for TMap usage
1359 if (dsetlist) {
1360 TGListTreeItem *dsetitem;
1362 TIter nextdset(dsetlist);
1363 while ((dsetname = (TObjString *)nextdset())) {
1365 // add the dataset in the tree
1367 dsetname->GetName(), dsetname);
1368 // ask for the list of files in the dataset
1369 TList *dsetfilelist = fViewer->GetActDesc()->fProof->GetDataSet(
1370 dsetname->GetName())->GetList();
1371 if(dsetfilelist) {
1372 TIter nextdsetfile(dsetfilelist);
1373 while ((dsetfilename = (TFileInfo *)nextdsetfile())) {
1374 if (! fDataSetTree->FindItemByObj(dsetitem, dsetfilename)) {
1375 // if not already in, add the file name in the tree
1376 fDataSetTree->AddItem(dsetitem,
1377 dsetfilename->GetFirstUrl()->GetUrl(),
1378 dsetfilename, dseticon, dseticon);
1379 }
1380 }
1381 // open the dataset item in order to show the files
1382 fDataSetTree->OpenItem(dsetitem);
1383 }
1384 }
1385 }
1386 }
1387 }
1388 // refresh list tree
1390}
1391
1392////////////////////////////////////////////////////////////////////////////////
1393/// Remove dataset from the list and from the cluster.
1394
1396{
1397 TGListTreeItem *item;
1398 TObjString *obj = 0;
1399 if (fViewer->GetActDesc()->fLocal) return;
1400
1401 item = fDataSetTree->GetSelected();
1402 if (!item) return;
1403 if (item->GetParent() == 0) return;
1404 if (item->GetParent() == fDataSetTree->GetFirstItem()) {
1405 // Dataset itself
1406 obj = (TObjString *)item->GetUserData();
1407 }
1408 else if (item->GetParent()->GetParent() == fDataSetTree->GetFirstItem()) {
1409 // One file of the dataset
1410 obj = (TObjString *)item->GetParent()->GetUserData();
1411 }
1412
1413 // if valid Proof session, set parallel slaves
1414 if (obj && fViewer->GetActDesc()->fProof &&
1418 }
1419}
1420
1421////////////////////////////////////////////////////////////////////////////////
1422/// Verify that the files in the selected dataset are present on the cluster.
1423
1425{
1426 TGListTreeItem *item;
1427 TObjString *obj = 0;
1428 if (fViewer->GetActDesc()->fLocal) return;
1429
1430 item = fDataSetTree->GetSelected();
1431 if (!item) return;
1432 if (item->GetParent() == 0) return;
1433 if (item->GetParent() == fDataSetTree->GetFirstItem()) {
1434 // Dataset itself
1435 obj = (TObjString *)item->GetUserData();
1436 }
1437 else if (item->GetParent()->GetParent() == fDataSetTree->GetFirstItem()) {
1438 // One file of the dataset
1439 obj = (TObjString *)item->GetParent()->GetUserData();
1440 }
1441
1442 // if valid Proof session, set parallel slaves
1443 if (obj && fViewer->GetActDesc()->fProof &&
1446 }
1447}
1448
1449////////////////////////////////////////////////////////////////////////////////
1450/// Apply selected log level on current session.
1451
1453{
1454 // if local session, do nothing
1455 if (fViewer->GetActDesc()->fLocal) return;
1456 // if valid Proof session, set log level
1457 if (fViewer->GetActDesc()->fProof &&
1461 }
1463}
1464
1465////////////////////////////////////////////////////////////////////////////////
1466/// Apply selected number of workers on current Proof session.
1467
1469{
1470 // if local session, do nothing
1471 if (fViewer->GetActDesc()->fLocal) return;
1472 // if valid Proof session, set parallel slaves
1473 if (fViewer->GetActDesc()->fProof &&
1475 Int_t nodes = atoi(fTxtParallel->GetText());
1477 }
1479}
1480
1481////////////////////////////////////////////////////////////////////////////////
1482/// Handle multiple selection check button.
1483
1485{
1487}
1488
1489////////////////////////////////////////////////////////////////////////////////
1490/// Handle multiple selection check button.
1491
1493{
1494 if (fViewer->GetActDesc())
1496}
1497
1498////////////////////////////////////////////////////////////////////////////////
1499/// Update list of packages.
1500
1502{
1503 TPackageDescription *package;
1504 const TGPicture *pict;
1507 while ((package = (TPackageDescription *)next())) {
1508 if (package->fEnabled)
1509 pict = fClient->GetPicture("package_add.xpm");
1510 else if (package->fUploaded)
1511 pict = fClient->GetPicture("package_delete.xpm");
1512 else
1513 pict = fClient->GetPicture("package.xpm");
1515 package->fId, package->fPathName, pict);
1517 }
1520}
1521
1522////////////////////////////////////////////////////////////////////////////////
1523/// Upload selected package(s) to the current session.
1524
1526{
1527 // if local session, do nothing
1528 if (fViewer->GetActDesc()->fLocal) return;
1529 // if valid Proof session, upload packages
1530 if (fViewer->GetActDesc()->fProof &&
1532 TObject *obj;
1533 TList selected;
1534 fLBPackages->GetSelectedEntries(&selected);
1535 TIter next(&selected);
1536 while ((obj = next())) {
1537 TString name = obj->GetTitle();
1538 if (fViewer->GetActDesc()->fProof->UploadPackage(name.Data()) != 0)
1539 Error("Submit", "Upload package failed");
1540 else {
1542 if (!o) continue;
1543 TPackageDescription *package =
1544 dynamic_cast<TPackageDescription *>(o);
1545 if (package) {
1546 package->fUploaded = kTRUE;
1547 ((TGIconLBEntry *)obj)->SetPicture(
1548 fClient->GetPicture("package_delete.xpm"));
1549 }
1550 }
1551 }
1553 }
1556}
1557
1558////////////////////////////////////////////////////////////////////////////////
1559/// Enable selected package(s) in the current session.
1560
1562{
1563 // if local session, do nothing
1564 if (fViewer->GetActDesc()->fLocal) return;
1565 // if valid Proof session, enable packages
1566 if (fViewer->GetActDesc()->fProof &&
1568 TObject *obj;
1569 TList selected;
1571 fLBPackages->GetSelectedEntries(&selected);
1572 TIter next(&selected);
1573 while ((obj = next())) {
1574 TString name = obj->GetTitle();
1576 if (!o) continue;
1577 TPackageDescription *package =
1578 dynamic_cast<TPackageDescription *>(o);
1579 if (package) {
1580 if (!package->fUploaded) {
1581 if (fViewer->GetActDesc()->fProof->UploadPackage(name.Data()) != 0)
1582 Error("Submit", "Upload package failed");
1583 else {
1584 package->fUploaded = kTRUE;
1585 ((TGIconLBEntry *)obj)->SetPicture(
1586 fClient->GetPicture("package_delete.xpm"));
1587 }
1588 }
1589 }
1590 if (fViewer->GetActDesc()->fProof->EnablePackage(name) != 0)
1591 Error("Submit", "Enable package failed");
1592 else {
1593 package->fEnabled = kTRUE;
1594 ((TGIconLBEntry *)obj)->SetPicture(fClient->GetPicture("package_add.xpm"));
1595 }
1596 }
1599 }
1602}
1603
1604////////////////////////////////////////////////////////////////////////////////
1605/// Disable selected package(s) in the current session.
1606
1608{
1609 // if local session, do nothing
1610 if (fViewer->GetActDesc()->fLocal) return;
1611 // if valid Proof session, disable (clear) packages
1612 if (fViewer->GetActDesc()->fProof &&
1614 TObject *obj;
1615 TList selected;
1616 fLBPackages->GetSelectedEntries(&selected);
1617 TIter next(&selected);
1618 while ((obj = next())) {
1619 TString name = obj->GetTitle();
1620 if (fViewer->GetActDesc()->fProof->ClearPackage(name) != 0)
1621 Error("Submit", "Clear package failed");
1622 else {
1624 if (!o) continue;
1625 TPackageDescription *package =
1626 dynamic_cast<TPackageDescription *>(o);
1627 if (package) {
1628 package->fEnabled = kFALSE;
1629 package->fUploaded = kFALSE;
1630 ((TGIconLBEntry *)obj)->SetPicture(fClient->GetPicture("package.xpm"));
1631 }
1632 }
1633 }
1635 }
1638}
1639
1640////////////////////////////////////////////////////////////////////////////////
1641/// Clear (disable) all packages in the current session.
1642
1644{
1645 TPackageDescription *package;
1646 // if local session, do nothing
1647 if (fViewer->GetActDesc()->fLocal) return;
1648 // if valid Proof session, clear packages
1649 if (fViewer->GetActDesc()->fProof &&
1651 if (fViewer->GetActDesc()->fProof->ClearPackages() != 0)
1652 Error("Submit", "Clear packages failed");
1653 else {
1655 while ((package = (TPackageDescription *)next())) {
1656 package->fEnabled = kFALSE;
1657 }
1658 }
1659 }
1662}
1663
1664////////////////////////////////////////////////////////////////////////////////
1665/// Open file dialog and add selected package file to the list.
1666
1668{
1669 if (fViewer->IsBusy())
1670 return;
1671 TGFileInfo fi;
1672 TPackageDescription *package;
1673 TGIconLBEntry *entry;
1674 fi.fFileTypes = pkgtypes;
1676 if (fi.fMultipleSelection && fi.fFileNamesList) {
1677 TObjString *el;
1678 TIter next(fi.fFileNamesList);
1679 while ((el = (TObjString *) next())) {
1680 package = new TPackageDescription;
1681 package->fName = gSystem->BaseName(gSystem->UnixPathName(el->GetString()));
1682 package->fPathName = gSystem->UnixPathName(el->GetString());
1683 package->fId = fViewer->GetActDesc()->fPackages->GetEntries();
1684 package->fUploaded = kFALSE;
1685 package->fEnabled = kFALSE;
1686 fViewer->GetActDesc()->fPackages->Add((TObject *)package);
1687 entry = new TGIconLBEntry(fLBPackages->GetContainer(),
1688 package->fId, package->fPathName,
1689 fClient->GetPicture("package.xpm"));
1690 fLBPackages->AddEntry(entry, new TGLayoutHints(kLHintsExpandX | kLHintsTop));
1691 }
1692 }
1693 else if (fi.fFilename) {
1694 package = new TPackageDescription;
1696 package->fPathName = gSystem->UnixPathName(fi.fFilename);
1697 package->fId = fViewer->GetActDesc()->fPackages->GetEntries();
1698 package->fUploaded = kFALSE;
1699 package->fEnabled = kFALSE;
1700 fViewer->GetActDesc()->fPackages->Add((TObject *)package);
1701 entry = new TGIconLBEntry(fLBPackages->GetContainer(),
1702 package->fId, package->fPathName,
1703 fClient->GetPicture("package.xpm"));
1704 fLBPackages->AddEntry(entry, new TGLayoutHints(kLHintsExpandX | kLHintsTop));
1705 }
1708}
1709
1710////////////////////////////////////////////////////////////////////////////////
1711/// Remove selected package from the list.
1712
1714{
1715 TPackageDescription *package;
1716 const TGPicture *pict;
1717 Int_t pos = fLBPackages->GetSelected();
1720 fViewer->GetActDesc()->fPackages->At(pos));
1721 Int_t id = 0;
1723 while ((package = (TPackageDescription *)next())) {
1724 package->fId = id;
1725 id++;
1726 if (package->fEnabled)
1727 pict = fClient->GetPicture("package_add.xpm");
1728 else if (package->fUploaded)
1729 pict = fClient->GetPicture("package_delete.xpm");
1730 else
1731 pict = fClient->GetPicture("package.xpm");
1733 package->fId, package->fPathName, pict);
1735 }
1738}
1739
1740////////////////////////////////////////////////////////////////////////////////
1741/// Move selected package entry one position up in the list.
1742
1744{
1745 TPackageDescription *package;
1746 const TGPicture *pict;
1747 Int_t pos = fLBPackages->GetSelected();
1748 if (pos <= 0) return;
1750 package = (TPackageDescription *)fViewer->GetActDesc()->fPackages->At(pos);
1751 fViewer->GetActDesc()->fPackages->Remove(
1752 fViewer->GetActDesc()->fPackages->At(pos));
1753 package->fId -= 1;
1754 fViewer->GetActDesc()->fPackages->AddAt(package, package->fId);
1755 Int_t id = 0;
1756 TIter next(fViewer->GetActDesc()->fPackages);
1757 while ((package = (TPackageDescription *)next())) {
1758 package->fId = id;
1759 id++;
1760 if (package->fEnabled)
1761 pict = fClient->GetPicture("package_add.xpm");
1762 else if (package->fUploaded)
1763 pict = fClient->GetPicture("package_delete.xpm");
1764 else
1765 pict = fClient->GetPicture("package.xpm");
1766 TGIconLBEntry *entry = new TGIconLBEntry(fLBPackages->GetContainer(),
1767 package->fId, package->fPathName, pict);
1768 fLBPackages->AddEntry(entry, new TGLayoutHints(kLHintsExpandX | kLHintsTop));
1769 }
1770 fLBPackages->Select(pos-1);
1771 fLBPackages->Layout();
1772 fClient->NeedRedraw(fLBPackages->GetContainer());
1773}
1774
1775////////////////////////////////////////////////////////////////////////////////
1776/// Move selected package entry one position down in the list.
1777
1779{
1780 TPackageDescription *package;
1781 const TGPicture *pict;
1782 Int_t pos = fLBPackages->GetSelected();
1783 if (pos == -1 || pos == fViewer->GetActDesc()->fPackages->GetEntries()-1)
1784 return;
1786 package = (TPackageDescription *)fViewer->GetActDesc()->fPackages->At(pos);
1787 fViewer->GetActDesc()->fPackages->Remove(
1788 fViewer->GetActDesc()->fPackages->At(pos));
1789 package->fId += 1;
1790 fViewer->GetActDesc()->fPackages->AddAt(package, package->fId);
1791 Int_t id = 0;
1792 TIter next(fViewer->GetActDesc()->fPackages);
1793 while ((package = (TPackageDescription *)next())) {
1794 package->fId = id;
1795 id++;
1796 if (package->fEnabled)
1797 pict = fClient->GetPicture("package_add.xpm");
1798 else if (package->fUploaded)
1799 pict = fClient->GetPicture("package_delete.xpm");
1800 else
1801 pict = fClient->GetPicture("package.xpm");
1802 TGIconLBEntry *entry = new TGIconLBEntry(fLBPackages->GetContainer(),
1803 package->fId, package->fPathName, pict);
1804 fLBPackages->AddEntry(entry, new TGLayoutHints(kLHintsExpandX | kLHintsTop));
1805 }
1806 fLBPackages->Select(pos+1);
1807 fLBPackages->Layout();
1808 fClient->NeedRedraw(fLBPackages->GetContainer());
1809}
1810
1811////////////////////////////////////////////////////////////////////////////////
1812/// Disconnect from current Proof session.
1813
1815{
1816 // if local session, do nothing
1817 if (fViewer->GetActDesc()->fLocal) return;
1818 // if valid Proof session, disconnect (close)
1819 if (fViewer->GetActDesc()->fAttached &&
1823 }
1824 // reset connected flag
1826 fViewer->GetActDesc()->fProof = 0;
1827 // disable animation timer
1829 // change list tree item picture to disconnected pixmap
1832 if (item) {
1835 }
1836 // update viewer
1838 1, 0, 0);
1841 fViewer->GetStatusBar()->SetText("", 1);
1842}
1843
1844////////////////////////////////////////////////////////////////////////////////
1845/// Show session log.
1846
1848{
1849 fViewer->ShowLog(0);
1850}
1851
1852////////////////////////////////////////////////////////////////////////////////
1853/// Call "New Query" Dialog.
1854
1856{
1857 TNewQueryDlg *dlg = new TNewQueryDlg(fViewer, 350, 310);
1858 dlg->Popup();
1859}
1860
1861////////////////////////////////////////////////////////////////////////////////
1862/// Get list of queries from current Proof server and populate the list tree.
1863
1865{
1866 TList *lqueries = 0;
1867 TQueryResult *query = 0;
1868 TQueryDescription *newquery = 0, *lquery = 0;
1869 if (fViewer->GetActDesc()->fProof &&
1871 lqueries = fViewer->GetActDesc()->fProof->GetListOfQueries();
1872 }
1873 if (lqueries) {
1874 TIter nextp(lqueries);
1875 // loop over list of queries received from Proof server
1876 while ((query = (TQueryResult *)nextp())) {
1877 // create new query description
1878 newquery = new TQueryDescription();
1879 newquery->fReference = TString::Format("%s:%s", query->GetTitle(),
1880 query->GetName());
1881 // check in our tree if it is already there
1882 TGListTreeItem *item =
1885 // if already there, skip
1887 newquery->fReference.Data()))
1888 continue;
1889 // check also in our query description list
1890 Bool_t found = kFALSE;
1891 TIter nextp2(fViewer->GetActDesc()->fQueries);
1892 while ((lquery = (TQueryDescription *)nextp2())) {
1893 if (lquery->fReference.CompareTo(newquery->fReference) == 0) {
1894 found = kTRUE;
1895 break;
1896 }
1897 }
1898 if (found) continue;
1899 // build new query description with infos from Proof
1900 newquery->fStatus = query->IsFinalized() ?
1903 newquery->fSelectorString = query->GetSelecImp()->GetName();
1904 newquery->fQueryName = TString::Format("%s:%s", query->GetTitle(),
1905 query->GetName());
1906 newquery->fOptions = query->GetOptions();
1907 newquery->fEventList = "";
1908 newquery->fNbFiles = 0;
1909 newquery->fNoEntries = query->GetEntries();
1910 newquery->fFirstEntry = query->GetFirst();
1911 newquery->fResult = query;
1912 newquery->fChain = 0;
1913 fViewer->GetActDesc()->fQueries->Add((TObject *)newquery);
1915 newquery->fQueryName, fViewer->GetQueryConPict(),
1917 item2->SetUserData(newquery);
1918 if (query->GetInputList())
1919 fViewer->GetSessionHierarchy()->AddItem(item2, "InputList");
1920 if (query->GetOutputList())
1921 fViewer->GetSessionHierarchy()->AddItem(item2, "OutputList");
1922 }
1923 }
1924 // at the end, update list tree
1927}
1928
1929////////////////////////////////////////////////////////////////////////////////
1930/// Command line handling.
1931
1933{
1934 // get command string
1935 const char *cmd = fCommandTxt->GetText();
1936 char opt[2];
1937 // form temporary file path
1938 TString pathtmp = TString::Format("%s/%s", gSystem->TempDirectory(),
1940 // if check box "clear view" is checked, open temp file in write mode
1941 // (overwrite), in append mode otherwise.
1942 if (fClearCheck->IsOn())
1943 snprintf(opt, 2, "w");
1944 else
1945 snprintf(opt, 2, "a");
1946
1947 // if valid Proof session, pass the command to Proof
1948 if (fViewer->GetActDesc()->fProof &&
1950 // redirect stdout/stderr to temp file
1951 if (gSystem->RedirectOutput(pathtmp.Data(), opt) != 0) {
1952 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
1953 return;
1954 }
1955 // execute command line
1956 fViewer->GetActDesc()->fProof->Exec(cmd);
1957 // restore back stdout/stderr
1958 if (gSystem->RedirectOutput(0) != 0) {
1959 Error("ShowStatus", "stdout/stderr retore failed; skipping");
1960 return;
1961 }
1962 // if check box "clear view" is checked, clear text view
1963 if (fClearCheck->IsOn())
1965 // load (display) temp file in text view
1966 fInfoTextView->LoadFile(pathtmp.Data());
1967 // set focus to "command line" text entry
1969 }
1970 else {
1971 // if no Proof session, or Proof session not valid,
1972 // lets execute command line by TApplication
1973
1974 // redirect stdout/stderr to temp file
1975 if (gSystem->RedirectOutput(pathtmp.Data(), opt) != 0) {
1976 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
1977 }
1978 // execute command line
1980 // restore back stdout/stderr
1981 if (gSystem->RedirectOutput(0) != 0) {
1982 Error("ShowStatus", "stdout/stderr retore failed; skipping");
1983 }
1984 // if check box "clear view" is checked, clear text view
1985 if (fClearCheck->IsOn())
1987 // load (display) temp file in text view
1988 fInfoTextView->LoadFile(pathtmp.Data());
1989 // set focus to "command line" text entry
1991 }
1992 // display bottom of text view
1994}
1995
1996////////////////////////////////////////////////////////////////////////////////
1997/// Switch widgets status/visibility for local/remote sessions.
1998
2000{
2001 if (local) {
2004 fTab->HideFrame(fTab->GetTabTab("Options"));
2005 fTab->HideFrame(fTab->GetTabTab("Packages"));
2006 fTab->HideFrame(fTab->GetTabTab("DataSets"));
2007 }
2008 else {
2011 fTab->ShowFrame(fTab->GetTabTab("Options"));
2012 fTab->ShowFrame(fTab->GetTabTab("Packages"));
2013 fTab->ShowFrame(fTab->GetTabTab("DataSets"));
2014 }
2015}
2016
2017////////////////////////////////////////////////////////////////////////////////
2018/// Shutdown current session.
2019
2021{
2022 // do nothing if connection in progress
2023 if (fViewer->IsBusy())
2024 return;
2025
2026 if (fViewer->GetActDesc()->fLocal) {
2027 Int_t retval;
2028 new TGMsgBox(fClient->GetRoot(), this, "Error Shutting down Session",
2029 "Shutting down Local Sessions is not allowed !",
2030 kMBIconExclamation,kMBOk,&retval);
2031 return;
2032 }
2033 if (!fViewer->GetActDesc()->fAttached ||
2034 !fViewer->GetActDesc()->fProof ||
2036 return;
2037 // ask for confirmation
2038 TString m;
2039 m.Form("Are you sure to shutdown the session \"%s\"",
2041 Int_t result;
2042 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), 0,
2043 kMBOk | kMBCancel, &result);
2044 // if confirmed, delete it
2045 if (result != kMBOk)
2046 return;
2047 // remove the Proof session from gROOT list of Proofs
2048 fViewer->GetActDesc()->fProof->Detach("S");
2049 // reset connected flag
2051 fViewer->GetActDesc()->fProof = 0;
2052 // disable animation timer
2054 // change list tree item picture to disconnected pixmap
2057 if (item) {
2060 }
2061 // update viewer
2063 1, 0, 0);
2066 fViewer->GetStatusBar()->SetText("", 1);
2067}
2068
2069//////////////////////////////////////////////////////////////////////////
2070// Edit Query Frame
2071//////////////////////////////////////////////////////////////////////////
2072
2073////////////////////////////////////////////////////////////////////////////////
2074/// Create a new Query dialog, used by the Session Viewer, to Edit a Query if
2075/// the editmode flag is set, or to create a new one if not set.
2076
2078 TGCompositeFrame(p, w, h, kVerticalFrame), fFrmMore(0), fBtnMore(0),
2079 fTxtQueryName(0), fTxtChain(0), fTxtSelector(0), fTxtOptions(0),
2080 fNumEntries(0), fNumFirstEntry(0), fTxtParFile(0), fTxtEventList(0),
2081 fViewer(0), fQuery(0), fChain(0)
2082{
2083}
2084
2085////////////////////////////////////////////////////////////////////////////////
2086/// Delete query dialog.
2087
2089{
2090 Cleanup();
2091}
2092
2093////////////////////////////////////////////////////////////////////////////////
2094/// Build the "new query" dialog.
2095
2097{
2098 TGButton *btnTmp;
2099 fViewer = gui;
2101 SetLayoutManager(new TGTableLayout(this, 6, 5));
2102
2103 // add "Query Name" label and text entry
2104 AddFrame(new TGLabel(this, "Query Name :"),
2105 new TGTableLayoutHints(0, 1, 0, 1, kLHintsCenterY, 5, 5, 4, 0));
2107 (const char *)0, 1), new TGTableLayoutHints(1, 2, 0, 1,
2108 kLHintsCenterY, 5, 5, 4, 0));
2109
2110 // add "TChain" label and text entry
2111 AddFrame(new TGLabel(this, "TChain :"),
2112 new TGTableLayoutHints(0, 1, 1, 2, kLHintsCenterY, 5, 5, 4, 0));
2113 AddFrame(fTxtChain = new TGTextEntry(this,
2114 (const char *)0, 2), new TGTableLayoutHints(1, 2, 1, 2,
2115 kLHintsCenterY, 5, 5, 4, 0));
2116 fTxtChain->SetToolTipText("Specify TChain or TDSet from memory or file");
2118 // add "Browse" button
2119 AddFrame(btnTmp = new TGTextButton(this, "Browse..."),
2120 new TGTableLayoutHints(2, 3, 1, 2, kLHintsCenterY, 5, 0, 4, 8));
2121 btnTmp->Connect("Clicked()", "TEditQueryFrame", this, "OnBrowseChain()");
2122
2123 // add "Selector" label and text entry
2124 AddFrame(new TGLabel(this, "Selector :"),
2125 new TGTableLayoutHints(0, 1, 2, 3, kLHintsCenterY, 5, 5, 0, 0));
2127 (const char *)0, 3), new TGTableLayoutHints(1, 2, 2, 3,
2128 kLHintsCenterY, 5, 5, 0, 0));
2129 // add "Browse" button
2130 AddFrame(btnTmp = new TGTextButton(this, "Browse..."),
2131 new TGTableLayoutHints(2, 3, 2, 3, kLHintsCenterY, 5, 0, 0, 8));
2132 btnTmp->Connect("Clicked()", "TEditQueryFrame", this, "OnBrowseSelector()");
2133
2134 // add "Less <<" ("More >>") button
2135 AddFrame(fBtnMore = new TGTextButton(this, " Less << "),
2136 new TGTableLayoutHints(2, 3, 4, 5, kLHintsCenterY, 5, 5, 4, 0));
2137 fBtnMore->Connect("Clicked()", "TEditQueryFrame", this, "OnNewQueryMore()");
2138
2139 // add (initially hidden) options frame
2140 fFrmMore = new TGCompositeFrame(this, 200, 200);
2142
2143 AddFrame(fFrmMore, new TGTableLayoutHints(0, 3, 5, 6,
2146
2147 // add "Options" label and text entry
2148 fFrmMore->AddFrame(new TGLabel(fFrmMore, "Options :"),
2149 new TGTableLayoutHints(0, 1, 0, 1, kLHintsCenterY, 5, 5, 0, 0));
2151 (const char *)0, 4), new TGTableLayoutHints(1, 2, 0, 1, 0, 17,
2152 0, 0, 8));
2153 //fTxtOptions->SetText("ASYN");
2154 fTxtOptions->SetText("");
2155
2156 // add "Nb Entries" label and number entry
2157 fFrmMore->AddFrame(new TGLabel(fFrmMore, "Nb Entries :"),
2158 new TGTableLayoutHints(0, 1, 1, 2, kLHintsCenterY, 5, 5, 0, 0));
2162 0, 17, 0, 0, 8));
2163 // coverity[negative_returns]: no problem with -1, the format is kNESInteger
2165 // add "First Entry" label and number entry
2166 fFrmMore->AddFrame(new TGLabel(fFrmMore, "First entry :"),
2167 new TGTableLayoutHints(0, 1, 2, 3, kLHintsCenterY, 5, 5, 0, 0));
2171 17, 0, 0, 8));
2172
2173 // add "Event list" label and text entry
2174 fFrmMore->AddFrame(new TGLabel(fFrmMore, "Event list :"),
2175 new TGTableLayoutHints(0, 1, 3, 4, kLHintsCenterY, 5, 5, 0, 0));
2177 (const char *)0, 6), new TGTableLayoutHints(1, 2, 3, 4, 0, 17,
2178 5, 0, 0));
2179 // add "Browse" button
2180 fFrmMore->AddFrame(btnTmp = new TGTextButton(fFrmMore, "Browse..."),
2181 new TGTableLayoutHints(2, 3, 3, 4, 0, 6, 0, 0, 8));
2182 btnTmp->Connect("Clicked()", "TEditQueryFrame", this, "OnBrowseEventList()");
2183
2184 fTxtQueryName->Associate(this);
2185 fTxtChain->Associate(this);
2186 fTxtSelector->Associate(this);
2187 fTxtOptions->Associate(this);
2188 fNumEntries->Associate(this);
2190 fTxtEventList->Associate(this);
2191
2192 fTxtQueryName->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2193 "SettingsChanged()");
2194 fTxtChain->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2195 "SettingsChanged()");
2196 fTxtSelector->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2197 "SettingsChanged()");
2198 fTxtOptions->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2199 "SettingsChanged()");
2200 fNumEntries->Connect("ValueChanged(Long_t)", "TEditQueryFrame", this,
2201 "SettingsChanged()");
2202 fNumFirstEntry->Connect("ValueChanged(Long_t)", "TEditQueryFrame", this,
2203 "SettingsChanged()");
2204 fTxtEventList->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2205 "SettingsChanged()");
2206}
2207
2208////////////////////////////////////////////////////////////////////////////////
2209/// Show/hide options frame and update button text accordingly.
2210
2212{
2213 if (IsVisible(fFrmMore)) {
2215 fBtnMore->SetText(" More >> ");
2216 }
2217 else {
2219 fBtnMore->SetText(" Less << ");
2220 }
2221}
2222
2223////////////////////////////////////////////////////////////////////////////////
2224/// Call new chain dialog.
2225
2227{
2228 TNewChainDlg *dlg = new TNewChainDlg(fClient->GetRoot(), this);
2229 dlg->Connect("OnElementSelected(TObject *)", "TEditQueryFrame",
2230 this, "OnElementSelected(TObject *)");
2231}
2232
2233////////////////////////////////////////////////////////////////////////////////
2234/// Handle OnElementSelected signal coming from new chain dialog.
2235
2237{
2238 if (obj) {
2239 fChain = obj;
2240 if (obj->IsA() == TChain::Class())
2242 else if (obj->IsA() == TDSet::Class())
2243 fTxtChain->SetText(((TDSet *)fChain)->GetObjName());
2244 }
2245}
2246
2247////////////////////////////////////////////////////////////////////////////////
2248/// Open file browser to choose selector macro.
2249
2251{
2252 TGFileInfo fi;
2254 new TGFileDialog(fClient->GetRoot(), this, kFDOpen, &fi);
2255 if (!fi.fFilename) return;
2257}
2258
2259////////////////////////////////////////////////////////////////////////////////
2260///Browse event list
2261
2263{
2264}
2265
2266////////////////////////////////////////////////////////////////////////////////
2267/// Save current settings in main session viewer.
2268
2270{
2271 // if we are in edition mode and query description is valid,
2272 // use it, otherwise create a new one
2273 TQueryDescription *newquery;
2274 if (fQuery)
2275 newquery = fQuery;
2276 else
2277 newquery = new TQueryDescription();
2278
2279 // update query description fields
2280 newquery->fSelectorString = fTxtSelector->GetText();
2281 if (fChain) {
2282 newquery->fTDSetString = fChain->GetName();
2283 newquery->fChain = fChain;
2284 }
2285 else {
2286 newquery->fTDSetString = "";
2287 newquery->fChain = 0;
2288 }
2289 newquery->fQueryName = fTxtQueryName->GetText();
2290 newquery->fOptions = fTxtOptions->GetText();
2291 newquery->fNoEntries = fNumEntries->GetIntNumber();
2293 newquery->fNbFiles = 0;
2294 newquery->fResult = 0;
2295
2296 if (newquery->fChain) {
2297 if (newquery->fChain->IsA() == TChain::Class())
2298 newquery->fNbFiles = ((TChain *)newquery->fChain)->GetListOfFiles()->GetEntriesFast();
2299 else if (newquery->fChain->IsA() == TDSet::Class())
2300 newquery->fNbFiles = ((TDSet *)newquery->fChain)->GetListOfElements()->GetSize();
2301 }
2302 // update user data with modified query description
2304 fViewer->GetSessionHierarchy()->RenameItem(item, newquery->fQueryName);
2305 item->SetUserData(newquery);
2306 // update list tree
2313 if (fViewer->GetActDesc()->fLocal ||
2317 fViewer->GetActDesc()->fProof->IsValid())) {
2318 fViewer->GetQueryFrame()->GetTab()->SetTab("Status");
2320 }
2321}
2322
2323////////////////////////////////////////////////////////////////////////////////
2324/// Settings have changed, update GUI accordingly.
2325
2327{
2328 if (fQuery) {
2329 if ((strcmp(fQuery->fSelectorString.Data(), fTxtSelector->GetText())) ||
2330 (strcmp(fQuery->fQueryName.Data(), fTxtQueryName->GetText())) ||
2331 (strcmp(fQuery->fOptions.Data(), fTxtOptions->GetText())) ||
2334 (fQuery->fChain != fChain)) {
2336 }
2337 else {
2339 }
2340 }
2341 else {
2342 if ((fTxtQueryName->GetText()) &&
2343 ((fTxtQueryName->GetText()) ||
2344 (fTxtChain->GetText())))
2346 else
2348 }
2349}
2350
2351////////////////////////////////////////////////////////////////////////////////
2352/// Update entry fields with query description values.
2353
2355{
2356 fChain = 0;
2357 fQuery = desc;
2358 fTxtChain->SetText("");
2359 if (desc->fChain) {
2360 fChain = desc->fChain;
2362 }
2369}
2370
2371////////////////////////////////////////////////////////////////////////////////
2372// Query Frame
2373
2374////////////////////////////////////////////////////////////////////////////////
2375/// Constructor
2376
2378 TGCompositeFrame(p, w, h), fBtnSubmit(0), fBtnFinalize(0), fBtnStop(0),
2379 fBtnAbort(0), fBtnShowLog(0), fBtnRetrieve(0), fBtnSave(0), fInfoTextView(0),
2380 fModified(0), fFiles(0), fFirst(0), fEntries(0), fPrevTotal(0),
2381 fPrevProcessed(0), fLabInfos(0), fLabStatus(0), fTotal(0), fRate(0),
2382 fStatus(kStopped), fTab(0), fFA(0), fFB(0), fFC(0), fFD(0), frmProg(0),
2383 fECanvas(0), fStatsCanvas(0), fViewer(0), fDesc(0)
2384{
2385}
2386
2387////////////////////////////////////////////////////////////////////////////////
2388/// Destructor.
2389
2391{
2392 Cleanup();
2393}
2394
2395////////////////////////////////////////////////////////////////////////////////
2396/// Build query information frame.
2397
2399{
2402 fFirst = fEntries = fPrevTotal = 0;
2403 fPrevProcessed = 0;
2404 fViewer = gui;
2405 fModified = kFALSE;
2406
2407 // main query tab
2408 fTab = new TGTab(this, 200, 200);
2410 kLHintsExpandY, 2, 2, 2, 2));
2411
2412 // add "Status" tab element
2413 TGCompositeFrame *tf = fTab->AddTab("Status");
2414 fFB = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
2417
2418 // new frame containing control buttons and feedback histos canvas
2419 TGCompositeFrame* frmcanvas = new TGHorizontalFrame(fFB, 350, 100);
2420 // control buttons frame
2421 TGCompositeFrame* frmBut2 = new TGVerticalFrame(frmcanvas, 150, 100);
2422 fBtnSubmit = new TGTextButton(frmBut2, " Submit ");
2423 fBtnSubmit->SetToolTipText("Submit (process) selected query");
2425 kLHintsExpandX, 5, 5, 5, 5));
2426 fBtnStop = new TGTextButton(frmBut2, "Stop");
2427 fBtnStop->SetToolTipText("Stop processing query");
2429 kLHintsExpandX, 5, 5, 5, 5));
2430 fBtnAbort = new TGTextButton(frmBut2, "Abort");
2431 fBtnAbort->SetToolTipText("Abort processing query");
2433 kLHintsExpandX, 5, 5, 5, 5));
2434 frmcanvas->AddFrame(frmBut2, new TGLayoutHints(kLHintsLeft | kLHintsCenterY |
2436 // feedback histos embedded canvas
2437 fECanvas = new TRootEmbeddedCanvas("fECanvas", frmcanvas, 400, 150);
2442 4, 4, 4, 4));
2443 fFB->AddFrame(frmcanvas, new TGLayoutHints(kLHintsLeft | kLHintsTop |
2445
2446 // progress infos label
2447 fLabInfos = new TGLabel(fFB, " ");
2448 fFB->AddFrame(fLabInfos, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
2449 // progress status label
2450 fLabStatus = new TGLabel(fFB, " ");
2451 fFB->AddFrame(fLabStatus, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
2452
2453 //progress bar
2456 frmProg->SetBarColor("green");
2457 fFB->AddFrame(frmProg, new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5));
2458 // total progress infos
2459 fFB->AddFrame(fTotal = new TGLabel(fFB,
2460 " Estimated time left : 0 sec (--- events of --- processed) "),
2461 new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
2462 // progress rate infos
2463 fFB->AddFrame(fRate = new TGLabel(fFB,
2464 " Processing Rate : -- events/sec "),
2465 new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
2466
2467 // add "Results" tab element
2468 tf = fTab->AddTab("Results");
2469 fFC = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
2472 // query result (header) information text view
2473 fInfoTextView = new TGTextView(fFC, 330, 185, "", kSunkenFrame |
2476 kLHintsExpandY | kLHintsExpandX, 5, 5, 10, 10));
2477
2478 // add "Retrieve", "Finalize" and "Show Log" buttons
2479 TGCompositeFrame* frmBut3 = new TGHorizontalFrame(fFC, 350, 100);
2480 fBtnRetrieve = new TGTextButton(frmBut3, "Retrieve");
2481 fBtnRetrieve->SetToolTipText("Retrieve query results");
2483 kLHintsExpandX, 5, 5, 10, 10));
2484 fBtnFinalize = new TGTextButton(frmBut3, "Finalize");
2485 fBtnFinalize->SetToolTipText("Finalize query");
2487 kLHintsExpandX, 5, 5, 10, 10));
2488 fBtnShowLog = new TGTextButton(frmBut3, "Show Log");
2489 fBtnShowLog->SetToolTipText("Show query log (open log window)");
2491 kLHintsExpandX, 5, 5, 10, 10));
2493
2494 // add "Results" tab element
2495 tf = fTab->AddTab("Edit Query");
2496 fFD = new TEditQueryFrame(tf, 100, 100);
2497 fFD->Build(fViewer);
2498 tf->AddFrame(fFD, new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 10, 0));
2499 TString btntxt;
2500 if (fViewer->GetActDesc()->fLocal ||
2501 (fViewer->GetActDesc()->fProof &&
2502 fViewer->GetActDesc()->fProof->IsValid())) {
2503 btntxt = " Submit ";
2504 }
2505 else {
2506 btntxt = " Apply changes ";
2507 }
2508 tf->AddFrame(fBtnSave = new TGTextButton(tf, btntxt),
2509 new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 5, 25, 5));
2510
2511 // connect button actions to functions
2512 fBtnSave->Connect("Clicked()", "TEditQueryFrame", fFD,
2513 "OnBtnSave()");
2514 fBtnSubmit->Connect("Clicked()", "TSessionQueryFrame", this,
2515 "OnBtnSubmit()");
2516 fBtnFinalize->Connect("Clicked()", "TSessionQueryFrame", this,
2517 "OnBtnFinalize()");
2518 fBtnStop->Connect("Clicked()", "TSessionQueryFrame", this,
2519 "OnBtnStop()");
2520 fBtnAbort->Connect("Clicked()", "TSessionQueryFrame", this,
2521 "OnBtnAbort()");
2522 fBtnShowLog->Connect("Clicked()", "TSessionQueryFrame", this,
2523 "OnBtnShowLog()");
2524 fBtnRetrieve->Connect("Clicked()", "TSessionQueryFrame", this,
2525 "OnBtnRetrieve()");
2526// fBtnSave->SetState(kButtonDisabled);
2527 Resize(350, 310);
2528}
2529
2530////////////////////////////////////////////////////////////////////////////////
2531/// Notify changes in query editor settings.
2532
2534{
2535 fModified = mod;
2536 if (fModified) {
2538 }
2539 else {
2541 }
2542 if (fViewer->GetActDesc()->fLocal ||
2543 (fViewer->GetActDesc()->fProof &&
2546}
2547
2548////////////////////////////////////////////////////////////////////////////////
2549/// Feedback function connected to Feedback signal.
2550/// Used to update feedback histograms.
2551
2553{
2554 // if no actual session, just return
2555 if (!fViewer->GetActDesc()->fAttached)
2556 return;
2557 if (!fViewer->GetActDesc()->fProof)
2558 return;
2559 if ((fViewer->GetActDesc()->fActQuery) &&
2564 return;
2565 TProof *sender = dynamic_cast<TProof*>((TQObject*)gTQSender);
2566 // if Proof sender match actual session one, update feedback histos
2567 if (sender && (sender == fViewer->GetActDesc()->fProof))
2568 UpdateHistos(objs);
2569}
2570
2571////////////////////////////////////////////////////////////////////////////////
2572/// Update feedback histograms.
2573
2575{
2576 TVirtualPad *save = gPad;
2577 TObject *o;
2578 Int_t pos = 1;
2579 Int_t i = 0;
2580 while (kFeedbackHistos[i]) {
2581 // check if user has selected this histogram in the option menu
2582 if (fViewer->GetCascadeMenu()->IsEntryChecked(41+i)) {
2583 if ( (o = objs->FindObject(kFeedbackHistos[i]))) {
2584 fStatsCanvas->cd(pos);
2586 if (TH1 *h = dynamic_cast<TH1*>(o)) {
2587 h->SetStats(0);
2588 h->SetBarWidth(0.75);
2589 h->SetBarOffset(0.125);
2590 h->SetFillColor(9);
2591 h->Draw("bar");
2592 pos++;
2593 }
2594 else if (TH2 *h2 = dynamic_cast<TH2*>(o)) {
2595 h2->Draw();
2596 pos++;
2597 }
2598 gPad->Modified();
2599 }
2600 }
2601 i++;
2602 }
2603 // update canvas
2604 fStatsCanvas->cd();
2607 if (save != 0) {
2608 save->cd();
2609 } else {
2610 gPad = 0;
2611 }
2612}
2613
2614////////////////////////////////////////////////////////////////////////////////
2615/// Update progress bar and status labels.
2616
2618{
2619 Long_t tt;
2620 UInt_t hh=0, mm=0, ss=0;
2621 TString stm;
2622 // if no actual session, just return
2623 if (!fViewer->GetActDesc()->fProof)
2624 return;
2625 // if Proof sender does't match actual session one, return
2626 TProof *sender = dynamic_cast<TProof*>((TQObject*)gTQSender);
2627 if (!sender || (sender != fViewer->GetActDesc()->fProof))
2628 return;
2629
2630 if ((fViewer->GetActDesc()->fActQuery) &&
2635 fTotal->SetText(" Estimated time left : 0 sec (0 events of 0 processed) ");
2636 fRate->SetText(" Processing Rate : 0.0f events/sec ");
2637 frmProg->Reset();
2638 fFB->Layout();
2639 return;
2640 }
2641
2642 if (total < 0)
2643 total = fPrevTotal;
2644 else
2645 fPrevTotal = total;
2646
2647 // if no change since last call, just return
2648 if (fPrevProcessed == processed)
2649 return;
2650 TString buf;
2651
2652 // Update information at first call
2653 if (fEntries != total) {
2654 buf.Form("PROOF cluster : \"%s\" - %d worker nodes",
2657 fLabInfos->SetText(buf);
2658
2659 fEntries = total;
2660 buf.Form(" %d files, %lld events, starting event %lld",
2662 fLabStatus->SetText(buf);
2663 }
2664
2665 // compute progress bar position and update
2666 Float_t pos = (Float_t)((Double_t)(processed * 100)/(Double_t)total);
2667 frmProg->SetPosition(pos);
2668 // if 100%, stop animation and set icon to "connected"
2669 if (pos >= 100.0) {
2671 fViewer->ChangeRightLogo("monitor01.xpm");
2672 }
2673
2674 // get current time
2675 if ((fViewer->GetActDesc()->fActQuery->fStatus ==
2682 Float_t eta = 0;
2683 if (processed)
2684 eta = ((Float_t)((Long64_t)tdiff)*total/Float_t(processed) -
2685 Long64_t(tdiff))/1000.;
2686
2687 tt = (Long_t)eta;
2688 if (tt > 0) {
2689 hh = (UInt_t)(tt / 3600);
2690 mm = (UInt_t)((tt % 3600) / 60);
2691 ss = (UInt_t)((tt % 3600) % 60);
2692 }
2693 if (hh)
2694 stm.Form("%d h %d min %d sec", hh, mm, ss);
2695 else if (mm)
2696 stm.Form("%d min %d sec", mm, ss);
2697 else
2698 stm.Form("%d sec", ss);
2699 if (processed == total) {
2700 // finished
2701 tt = (Long_t) Long64_t(tdiff)/1000;
2702 if (tt > 0) {
2703 hh = (UInt_t)(tt / 3600);
2704 mm = (UInt_t)((tt % 3600) / 60);
2705 ss = (UInt_t)((tt % 3600) % 60);
2706 }
2707 if (hh)
2708 stm.Form("%d h %d min %d sec", hh, mm, ss);
2709 else if (mm)
2710 stm.Form("%d min %d sec", mm, ss);
2711 else
2712 stm.Form("%d sec", ss);
2713 buf.Form(" Processed : %lld events in %s", total, stm.Data());
2714 fTotal->SetText(buf.Data());
2715 } else {
2716 // update status infos
2717 buf.Form(" Estimated time left : %s (%lld events of %lld processed) ",
2718 stm.Data(), processed, total);
2719 fTotal->SetText(buf.Data());
2720 }
2721 if (processed > 0 && (Long64_t)tdiff > 0) {
2722 buf.Form(" Processing Rate : %.1f events/sec ",
2723 (Float_t)processed/(Long64_t)tdiff*1000.);
2724 fRate->SetText(buf);
2725 }
2726 fPrevProcessed = processed;
2727
2728 fFB->Layout();
2729}
2730
2731////////////////////////////////////////////////////////////////////////////////
2732/// New version of Progress (just forward to the old version
2733/// for the time being).
2734
2736 Long64_t /*bytesread*/, Float_t /*initTime*/,
2737 Float_t /*procTime*/, Float_t /*evtrti*/,
2738 Float_t /*mbrti*/, Int_t /*actw*/,
2739 Int_t /*tses*/, Float_t /*eses*/)
2740{
2741 Progress(total, processed);
2742}
2743
2744////////////////////////////////////////////////////////////////////////////////
2745/// Update progress bar and status labels.
2746
2748{
2749 Long_t tt;
2750 UInt_t hh=0, mm=0, ss=0;
2751 TString stm;
2752 TString cproc;
2753 Int_t status;
2754
2755 switch (fViewer->GetActDesc()->fActQuery->fStatus) {
2756
2758 cproc = " - ABORTED";
2759 status = kAborted;
2760 break;
2762 cproc = " - STOPPED";
2763 status = kStopped;
2764 break;
2766 cproc = " ";
2767 status = kRunning;
2768 break;
2771 cproc = " ";
2772 status = kDone;
2773 break;
2774 default:
2775 status = -1;
2776 break;
2777 }
2778 if (processed < 0) processed = 0;
2779
2780 frmProg->SetBarColor("green");
2781 if (status == kAborted)
2782 frmProg->SetBarColor("red");
2783 else if (status == kStopped)
2784 frmProg->SetBarColor("yellow");
2785 else if (status == -1 ) {
2786 fTotal->SetText(" Estimated time left : 0 sec (0 events of 0 processed) ");
2787 fRate->SetText(" Processing Rate : 0.0f events/sec ");
2788 frmProg->Reset();
2789 fFB->Layout();
2790 return;
2791 }
2792
2793 if (total < 0)
2794 total = fPrevTotal;
2795 else
2796 fPrevTotal = total;
2797
2798 // if no change since last call, just return
2799 TString buf;
2800
2801 // Update information at first call
2802 if (fEntries != total) {
2803 fLabInfos->SetText("Local Session");
2804
2805 fEntries = total;
2806 buf.Form(" %d files, %lld events, starting event %lld",
2808 fLabStatus->SetText(buf.Data());
2809 }
2810
2811 // compute progress bar position and update
2812 Float_t pos = 0.0;
2813 if (processed > 0 && total > 0)
2814 pos = (Float_t)((Double_t)(processed * 100)/(Double_t)total);
2815 frmProg->SetPosition(pos);
2816 // if 100%, stop animation and set icon to "connected"
2817 if (pos >= 100.0) {
2819 fViewer->ChangeRightLogo("monitor01.xpm");
2820 }
2821
2822 // get current time
2823 if (status == kRunning)
2827 Float_t eta = 0;
2828 if (processed)
2829 eta = ((Float_t)((Long64_t)tdiff)*total/(Float_t)(processed) -
2830 (Long64_t)(tdiff))/1000.;
2831
2832 tt = (Long_t)eta;
2833 if (tt > 0) {
2834 hh = (UInt_t)(tt / 3600);
2835 mm = (UInt_t)((tt % 3600) / 60);
2836 ss = (UInt_t)((tt % 3600) % 60);
2837 }
2838 if (hh)
2839 stm = TString::Format("%d h %d min %d sec", hh, mm, ss);
2840 else if (mm)
2841 stm = TString::Format("%d min %d sec", mm, ss);
2842 else
2843 stm = TString::Format("%d sec", ss);
2844 if ((processed != total) && (status == kRunning)) {
2845 // update status infos
2846 buf.Form(" Estimated time left : %s (%lld events of %lld processed) ",
2847 stm.Data(), processed, total);
2848 fTotal->SetText(buf);
2849 } else {
2850 tt = (Long_t) Long64_t(tdiff)/1000;
2851 if (tt > 0) {
2852 hh = (UInt_t)(tt / 3600);
2853 mm = (UInt_t)((tt % 3600) / 60);
2854 ss = (UInt_t)((tt % 3600) % 60);
2855 }
2856 if (hh)
2857 stm = TString::Format("%d h %d min %d sec", hh, mm, ss);
2858 else if (mm)
2859 stm = TString::Format("%d min %d sec", mm, ss);
2860 else
2861 stm = TString::Format("%d sec", ss);
2862 buf.Form(" Processed : %ld events in %s",
2863 (Long_t)processed, stm.Data());
2864 buf += cproc;
2865 fTotal->SetText(buf.Data());
2866 }
2867 if (processed > 0 && (Long64_t)tdiff > 0) {
2868 buf.Form(" Processing Rate : %.1f events/sec ",
2869 (Float_t)processed/(Long64_t)tdiff*1000.);
2870 fRate->SetText(buf.Data());
2871 }
2872 fPrevProcessed = processed;
2873
2874 fFB->Layout();
2875}
2876
2877////////////////////////////////////////////////////////////////////////////////
2878/// Indicate that Cancel or Stop was clicked.
2879
2881{
2882 if (aborted == kTRUE) {
2883 // Aborted
2884 frmProg->SetBarColor("red");
2885 }
2886 else {
2887 // Stopped
2888 frmProg->SetBarColor("yellow");
2889 }
2890 // disconnect progress related signals
2891 if (fViewer->GetActDesc()->fProof &&
2893 fViewer->GetActDesc()->fProof->Disconnect("Progress(Long64_t,Long64_t)",
2894 this, "Progress(Long64_t,Long64_t)");
2895 fViewer->GetActDesc()->fProof->Disconnect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
2896 this, "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
2897 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)",
2898 this, "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
2899 fViewer->GetActDesc()->fProof->Disconnect("StopProcess(Bool_t)", this,
2900 "IndicateStop(Bool_t)");
2901 }
2902}
2903
2904////////////////////////////////////////////////////////////////////////////////
2905/// Reset progress frame information fields.
2906
2907void TSessionQueryFrame::ResetProgressDialog(const char * /*selector*/, Int_t files,
2908 Long64_t first, Long64_t entries)
2909{
2910 TString buf;
2911 fFiles = files > 0 ? files : 0;
2912 fFirst = first;
2913 fEntries = entries;
2914 fPrevProcessed = 0;
2915 fPrevTotal = 0;
2916
2917 if (!fViewer->GetActDesc()->fLocal) {
2918 frmProg->SetBarColor("green");
2919 frmProg->Reset();
2920 }
2921
2922 buf.Form("%0d files, %0lld events, starting event %0lld",
2923 fFiles > 0 ? fFiles : 0, fEntries > 0 ? fEntries : 0,
2924 fFirst >= 0 ? fFirst : 0);
2925 fLabStatus->SetText(buf.Data());
2926 // Reconnect the slots
2927 if (fViewer->GetActDesc()->fProof &&
2929 fViewer->GetActDesc()->fProof->Connect("Progress(Long64_t,Long64_t)",
2930 "TSessionQueryFrame", this, "Progress(Long64_t,Long64_t)");
2931 fViewer->GetActDesc()->fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
2932 "TSessionQueryFrame", this,
2933 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
2934 fViewer->GetActDesc()->fProof->Connect("StopProcess(Bool_t)",
2935 "TSessionQueryFrame", this, "IndicateStop(Bool_t)");
2936 buf.Form("PROOF cluster : \"%s\" - %d worker nodes",
2939 fLabInfos->SetText(buf.Data());
2940 }
2941 else if (fViewer->GetActDesc()->fLocal) {
2943 fLabInfos->SetText("Local Session");
2944 fLabStatus->SetText(" ");
2945 }
2946 else {
2947 fLabInfos->SetText(" ");
2948 fLabStatus->SetText(" ");
2949 }
2950 fFB->Layout();
2951}
2952
2953////////////////////////////////////////////////////////////////////////////////
2954/// Finalize query.
2955
2957{
2958 // check if Proof is valid
2959 if (fViewer->GetActDesc()->fProof &&
2961 gPad->SetEditable(kFALSE);
2963 if (!item) return;
2964 TObject *obj = (TObject *)item->GetUserData();
2965 if ((obj) && (obj->IsA() == TQueryDescription::Class())) {
2966 // as it can take time, set watch cursor
2967 gVirtualX->SetCursor(GetId(),gVirtualX->CreateCursor(kWatch));
2968 TQueryDescription *query = (TQueryDescription *)obj;
2970 UpdateButtons(query);
2971 // restore cursor
2972 gVirtualX->SetCursor(GetId(), 0);
2973 }
2974 }
2975 if (fViewer->GetActDesc()->fLocal) {
2976 gPad->SetEditable(kFALSE);
2978 if (chain && chain->GetPlayer())
2980 }
2981}
2982
2983////////////////////////////////////////////////////////////////////////////////
2984/// Stop processing query.
2985
2987{
2988 // check for proof validity
2989 if (fViewer->GetActDesc()->fProof &&
2992 }
2993 if (fViewer->GetActDesc()->fLocal) {
2994 gROOT->SetInterrupt();
2997 }
2998 // stop icon animation and set connected icon
2999 fViewer->ChangeRightLogo("monitor01.xpm");
3001}
3002
3003////////////////////////////////////////////////////////////////////////////////
3004/// Show query log.
3005
3007{
3009 if (!item) return;
3010 TObject *obj = (TObject *)item->GetUserData();
3011 if ((!obj) || (obj->IsA() != TQueryDescription::Class()))
3012 return;
3013 TQueryDescription *query = (TQueryDescription *)obj;
3014 fViewer->ShowLog(query->fReference.Data());
3015}
3016
3017////////////////////////////////////////////////////////////////////////////////
3018/// Retrieve query.
3019
3021{
3022 // check for proof validity
3023 if (fViewer->GetActDesc()->fAttached &&
3027 if (!item) return;
3028 TObject *obj = (TObject *)item->GetUserData();
3029 if (obj && obj->IsA() == TQueryDescription::Class()) {
3030 // as it can take time, set watch cursor
3031 gVirtualX->SetCursor(GetId(), gVirtualX->CreateCursor(kWatch));
3032 TQueryDescription *query = (TQueryDescription *)obj;
3034 if (rc == 0)
3036 // restore cursor
3037 gVirtualX->SetCursor(GetId(), 0);
3038 }
3039 }
3040 if (fViewer->GetActDesc()->fLocal) {
3041 TGListTreeItem *item=0, *item2=0;
3043 fViewer->GetActDesc());
3044 if (item) {
3045 item2 = fViewer->GetSessionHierarchy()->FindItemByObj(item,
3047 }
3048 if (item2) {
3049 // add input and output list entries
3051 if (chain && chain->GetPlayer()) {
3052 TSelector *selector = chain->GetPlayer()->GetSelectorFromFile();
3053 if (selector) {
3054 TList *objlist = selector->GetOutputList();
3055 if (objlist)
3056 if (!fViewer->GetSessionHierarchy()->FindChildByName(item2, "OutputList"))
3057 fViewer->GetSessionHierarchy()->AddItem(item2, "OutputList");
3058 }
3059 }
3060 }
3061 // update list tree, query frame information, and buttons state
3064 UpdateInfos();
3066 }
3067}
3068
3069////////////////////////////////////////////////////////////////////////////////
3070/// Abort processing query.
3071
3073{
3074 // check for proof validity
3075 if (fViewer->GetActDesc()->fProof &&
3078 }
3079 if (fViewer->GetActDesc()->fLocal) {
3080 gROOT->SetInterrupt();
3083 }
3084 // stop icon animation and set connected icon
3085 fViewer->ChangeRightLogo("monitor01.xpm");
3087}
3088
3089////////////////////////////////////////////////////////////////////////////////
3090/// Submit query.
3091
3093{
3094 Int_t retval;
3095 Long64_t id = 0;
3097 if (!item) return;
3098 // retrieve query description attached to list tree item
3099 TObject *obj = (TObject *)item->GetUserData();
3100 if (!obj || obj->IsA() != TQueryDescription::Class())
3101 return;
3102 TQueryDescription *newquery = (TQueryDescription *)obj;
3103 // reset progress information
3105 newquery->fNbFiles, newquery->fFirstEntry, newquery->fNoEntries);
3106 // set query start time
3107 newquery->fStartTime = gSystem->Now();
3109 // check for proof validity
3110 if (fViewer->GetActDesc()->fProof &&
3113 // set query description status to submitted
3115 // if feedback option selected
3117 Int_t i = 0;
3118 // browse list of feedback histos and check user's selected ones
3119 while (kFeedbackHistos[i]) {
3120 if (fViewer->GetCascadeMenu()->IsEntryChecked(41+i)) {
3123 }
3124 i++;
3125 }
3126 // connect feedback signal
3127 fViewer->GetActDesc()->fProof->Connect("Feedback(TList *objs)",
3128 "TSessionQueryFrame", fViewer->GetQueryFrame(),
3129 "Feedback(TList *objs)");
3130 gROOT->Time();
3131 }
3132 else {
3133 // if feedback option not selected, clear Proof's feedback option
3135 }
3136 // set current proof session
3137 fViewer->GetActDesc()->fProof->cd();
3138 // check if parameter file has been specified
3139 if (newquery->fChain) {
3140 if (fViewer->GetActDesc()->fProof->IsLite()) {
3141 newquery->fOptions = "";
3142 }
3143 // set query reference id
3144 newquery->fReference= TString::Format("session-%s:q%d",
3147 if (newquery->fChain->IsA() == TChain::Class()) {
3148 // TChain case
3150 ((TChain *)newquery->fChain)->SetProof(fViewer->GetActDesc()->fProof);
3151 id = ((TChain *)newquery->fChain)->Process(newquery->fSelectorString,
3152 newquery->fOptions,
3153 newquery->fNoEntries > 0 ? newquery->fNoEntries : 1234567890,
3154 newquery->fFirstEntry);
3155 }
3156 else if (newquery->fChain->IsA() == TDSet::Class()) {
3157 // TDSet case
3159 id = ((TDSet *)newquery->fChain)->Process(newquery->fSelectorString,
3160 newquery->fOptions,
3161 newquery->fNoEntries,
3162 newquery->fFirstEntry);
3163 }
3164 }
3165 else {
3166 Error("Submit", "No TChain defined; skipping");
3168 return;
3169 }
3170 // set query reference id to unique identifier
3171 newquery->fReference= TString::Format("session-%s:q%lld",
3173 // start icon animation
3175 }
3176 else if (fViewer->GetActDesc()->fLocal) { // local session case
3177 // if feedback option selected
3179 Int_t i = 0;
3180 // browse list of feedback histos and check user's selected ones
3181 while (kFeedbackHistos[i]) {
3182 if (fViewer->GetCascadeMenu()->IsEntryChecked(41+i)) {
3184 }
3185 i++;
3186 }
3187 }
3188 if (newquery->fChain) {
3189 if (newquery->fChain->IsA() == TChain::Class()) {
3190 // TChain case
3193 UpdateButtons(newquery);
3194 gPad->SetEditable(kFALSE);
3195 ((TChain *)newquery->fChain)->SetTimerInterval(100);
3196 id = ((TChain *)newquery->fChain)->Process(newquery->fSelectorString,
3197 newquery->fOptions,
3198 newquery->fNoEntries > 0 ? newquery->fNoEntries : 1234567890,
3199 newquery->fFirstEntry);
3200 ((TChain *)newquery->fChain)->SetTimerInterval(0);
3201 OnBtnRetrieve();
3202 TChain *chain = (TChain *)newquery->fChain;
3203 ProgressLocal(chain->GetEntries(),
3204 chain->GetReadEntry()+1);
3208 UpdateButtons(newquery);
3209 }
3210 else {
3211 new TGMsgBox(fClient->GetRoot(), this, "Error Submitting Query",
3212 "Only TChains are allowed in Local Session (no TDSet) !",
3213 kMBIconExclamation,kMBOk,&retval);
3214 }
3215 }
3216 else {
3217 Error("Submit", "No TChain defined; skipping");
3219 return;
3220 }
3221 // set query reference id to unique identifier
3222 newquery->fReference = TString::Format("local-session-%s:q%lld", newquery->fQueryName.Data(), id);
3223 }
3224 // update buttons state
3225 UpdateButtons(newquery);
3226}
3227
3228////////////////////////////////////////////////////////////////////////////////
3229/// Update buttons state for the current query status.
3230
3232{
3234 if (!item) return;
3235 // retrieve query description attached to list tree item
3236 TObject *obj = (TObject *)item->GetUserData();
3237 if (!obj || obj->IsA() != TQueryDescription::Class())
3238 return;
3239 TQueryDescription *query = (TQueryDescription *)obj;
3240 if (desc != query) return;
3241
3242 Bool_t submit_en = kFALSE;
3243 if ((fViewer->GetActDesc()->fProof &&
3244 fViewer->GetActDesc()->fProof->IsValid()) ||
3246 submit_en = kTRUE;
3247
3248 switch (desc->fStatus) {
3250 fBtnSubmit->SetEnabled(submit_en);
3256 break;
3257
3259 fBtnSubmit->SetEnabled(submit_en);
3261 if (((desc->fResult == 0) || (desc->fResult &&
3262 (desc->fResult->IsFinalized() ||
3263 (desc->fResult->GetInputObject("TDSet") == 0)))) &&
3264 !(fViewer->GetActDesc()->fLocal))
3270 break;
3271
3273 fBtnSubmit->SetEnabled(submit_en);
3279 break;
3280
3288 break;
3289
3297 break;
3298
3300 fBtnSubmit->SetEnabled(submit_en);
3306 break;
3307
3309 fBtnSubmit->SetEnabled(submit_en);
3315 break;
3316
3318 fBtnSubmit->SetEnabled(submit_en);
3324 break;
3325
3326 default:
3327 break;
3328 }
3329 if (fViewer->GetActDesc()->fLocal &&
3333 }
3334}
3335
3336////////////////////////////////////////////////////////////////////////////////
3337/// Update query information (header) text view.
3338
3340{
3341 TString buffer;
3342 const char *qst[] = {"aborted ", "submitted", "running ",
3343 "stopped ", "completed"};
3344
3347
3348 if (fViewer->GetActDesc()->fLocal ||
3352 fViewer->GetActDesc()->fProof->IsValid())) {
3353 fBtnSave->SetText(" Submit ");
3354 }
3355 else {
3356 fBtnSave->SetText(" Apply changes ");
3357 }
3360 if (!fViewer->GetActDesc()->fActQuery ||
3362 ResetProgressDialog("", 0, 0, 0);
3363 if (fViewer->GetActDesc()->fLocal) {
3364 if (fViewer->GetActDesc()->fActQuery) {
3366 if (chain) {
3367 ProgressLocal(chain->GetEntries(),
3368 chain->GetReadEntry()+1);
3369 }
3370 else {
3371 ProgressLocal(0, 0);
3372 }
3374 }
3375 }
3376 else {
3377 fTotal->SetText(" Estimated time left : 0 sec (0 events of 0 processed) ");
3378 fRate->SetText(" Processing Rate : 0.0f events/sec ");
3379 frmProg->Reset();
3380 fFB->Layout();
3381 }
3382 return;
3383 }
3385
3386 // Status label
3387 Int_t st = (result->GetStatus() > 0 && result->GetStatus() <=
3388 TQueryResult::kCompleted) ? result->GetStatus() : 0;
3389
3390 Int_t qry = result->GetSeqNum();
3391
3392 buffer = TString::Format("------------------------------------------------------\n");
3393 // Print header
3394 if (!result->IsDraw()) {
3395 const char *fin = result->IsFinalized() ? "finalized" : qst[st];
3396 const char *arc = result->IsArchived() ? "(A)" : "";
3397 buffer = TString::Format(" Query No : %d\n", qry);
3398 buffer += TString::Format(" Ref : \"%s:%s\"\n", result->GetTitle(),
3399 result->GetName());
3400 buffer += TString::Format(" Selector : %s\n",
3401 result->GetSelecImp()->GetTitle());
3402 buffer += TString::Format("Status : %9s%s\n", fin, arc);
3403 buffer += TString::Format("------------------------------------------------------\n");
3404 } else {
3405 buffer += TString::Format(" Query No : %d\n", qry);
3406 buffer += TString::Format(" Ref : \"%s:%s\"\n", result->GetTitle(),
3407 result->GetName());
3408 buffer += TString::Format(" Selector : %s\n",
3409 result->GetSelecImp()->GetTitle());
3410 buffer += TString::Format("------------------------------------------------------\n");
3411 }
3412
3413 // Time information
3414 Int_t elapsed = (Int_t)(result->GetEndTime().Convert() -
3415 result->GetStartTime().Convert());
3416 buffer += TString::Format(" Started : %s\n",
3417 result->GetStartTime().AsString());
3418 buffer += TString::Format(" Real time : %d sec (CPU time: %.1f sec)\n",
3419 elapsed, result->GetUsedCPU());
3420
3421 // Number of events processed, rate, size
3422 Double_t rate = 0.0;
3423 if (result->GetEntries() > -1 && elapsed > 0)
3424 rate = result->GetEntries() / (Double_t)elapsed ;
3425 Float_t size = ((Float_t)result->GetBytes())/(1024*1024);
3426 buffer += TString::Format(" Processed : %lld events (size: %.3f MBs)\n",
3427 result->GetEntries(), size);
3428 buffer += TString::Format(" Rate : %.1f evts/sec\n", rate);
3429
3430 // Package information
3431 if (strlen(result->GetParList()) > 1) {
3432 buffer += TString::Format(" Packages : %s\n", result->GetParList());
3433 }
3434
3435 // Result information
3436 TString res = result->GetResultFile();
3437 if (!result->IsArchived()) {
3438 Int_t dq = res.Index("queries");
3439 if (dq > -1) {
3440 res.Remove(0,res.Index("queries"));
3441 res.Insert(0,"<PROOF_SandBox>/");
3442 }
3443 if (res.BeginsWith("-")) {
3444 res = (result->GetStatus() == TQueryResult::kAborted) ?
3445 "not available" : "sent to client";
3446 }
3447 }
3448 if (res.Length() > 1) {
3449 buffer += TString::Format("------------------------------------------------------\n");
3450 buffer += TString::Format(" Results : %s\n", res.Data());
3451 }
3452
3453 if (result->GetOutputList() && result->GetOutputList()->GetSize() > 0) {
3454 buffer += TString::Format(" Outlist : %d objects\n",
3455 result->GetOutputList()->GetSize());
3456 buffer += TString::Format("------------------------------------------------------\n");
3457 }
3458 fInfoTextView->LoadBuffer(buffer.Data());
3459
3460 //Float_t pos = Float_t((Double_t)(result->GetEntries() * 100)/(Double_t)total);
3461 if (result->GetStatus() == TQueryResult::kAborted)
3462 frmProg->SetBarColor("red");
3463 else if (result->GetStatus() == TQueryResult::kStopped)
3464 frmProg->SetBarColor("yellow");
3465 else
3466 frmProg->SetBarColor("green");
3467
3468 frmProg->SetPosition(100.0);
3469
3470 buffer = TString::Format(" Processed : %lld events in %.1f sec", result->GetEntries(),
3471 (Float_t)elapsed);
3472 fTotal->SetText(buffer.Data());
3473 buffer = TString::Format(" Processing Rate : %.1f events/sec ", rate);
3474 fRate->SetText(buffer.Data());
3475 fFB->Layout();
3476}
3477
3478//////////////////////////////////////////////////////////////////////////////////////////
3479// Output frame
3480
3481////////////////////////////////////////////////////////////////////////////////
3482/// Constructor.
3483
3485 TGCompositeFrame(p, w, h), fEntryTmp(0), fLVContainer(0), fViewer(0)
3486{
3487}
3488
3489////////////////////////////////////////////////////////////////////////////////
3490/// Destructor.
3491
3493{
3494 delete fLVContainer; // this container is inside the TGListView and is not
3495 // deleted automatically
3496 Cleanup();
3497}
3498
3499////////////////////////////////////////////////////////////////////////////////
3500/// Build query output information frame.
3501
3503{
3504 fViewer = gui;
3507
3508 // Container of object TGListView
3509 TGListView *frmListView = new TGListView(this, 340, 190);
3511 fLVContainer->Associate(frmListView);
3514 4, 4, 4, 4));
3515
3516 frmListView->Connect("Clicked(TGLVEntry*, Int_t, Int_t, Int_t)",
3517 "TSessionOutputFrame", this,
3518 "OnElementClicked(TGLVEntry* ,Int_t, Int_t, Int_t)");
3519 frmListView->Connect("DoubleClicked(TGLVEntry*, Int_t, Int_t, Int_t)",
3520 "TSessionOutputFrame", this,
3521 "OnElementDblClicked(TGLVEntry* ,Int_t, Int_t, Int_t)");
3522}
3523
3524////////////////////////////////////////////////////////////////////////////////
3525/// Handle mouse clicks on list view items.
3526
3528 Int_t y)
3529{
3530 TObject *obj = (TObject *)entry->GetUserData();
3531 if ((obj) && (btn ==3)) {
3532 // if right button, popup context menu
3533 fViewer->GetContextMenu()->Popup(x, y, obj, (TBrowser *)0);
3534 }
3535}
3536
3537////////////////////////////////////////////////////////////////////////////////
3538/// Handle double-clicks on list view items.
3539
3541{
3542 char action[512];
3543 TString act;
3544 TObject *obj = (TObject *)entry->GetUserData();
3545 if (!obj) return;
3546 TString ext = obj->GetName();
3547 gPad->SetEditable(kFALSE);
3548 // check default action from root.mimes
3549 if (fClient->GetMimeTypeList()->GetAction(obj->IsA()->GetName(), action)) {
3550 act = TString::Format("((%s*)0x%zx)%s", obj->IsA()->GetName(), (size_t)obj, action);
3551 if (act[0] == '!') {
3552 act.Remove(0, 1);
3553 gSystem->Exec(act.Data());
3554 } else {
3555 // do not allow browse
3556 if (!act.Contains("Browse"))
3557 gROOT->ProcessLine(act.Data());
3558 }
3559 }
3560}
3561
3562////////////////////////////////////////////////////////////////////////////////
3563/// Add object to output list view.
3564
3566{
3567 TGLVEntry *item;
3568 if (obj) {
3569 item = new TGLVEntry(fLVContainer, obj->GetName(), obj->IsA()->GetName());
3570 item->SetUserData(obj);
3571 fLVContainer->AddItem(item);
3572 }
3573}
3574
3575//////////////////////////////////////////////////////////////////////////////////////////
3576// Input Frame
3577
3578////////////////////////////////////////////////////////////////////////////////
3579/// Constructor.
3580
3582 TGCompositeFrame(p, w, h), fViewer(0), fLVContainer(0)
3583{
3584}
3585
3586////////////////////////////////////////////////////////////////////////////////
3587/// Destructor.
3588
3590{
3591 delete fLVContainer; // this container is inside the TGListView and is not
3592 // deleted automatically
3593 Cleanup();
3594}
3595
3596////////////////////////////////////////////////////////////////////////////////
3597/// Build query input information frame.
3598
3600{
3601 fViewer = gui;
3604
3605 // Container of object TGListView
3606 TGListView *frmListView = new TGListView(this, 340, 190);
3608 fLVContainer->Associate(frmListView);
3611 4, 4, 4, 4));
3612}
3613
3614////////////////////////////////////////////////////////////////////////////////
3615/// Add object to input list view.
3616
3618{
3619 TGLVEntry *item;
3620 if (obj) {
3621 item = new TGLVEntry(fLVContainer, obj->GetName(), obj->IsA()->GetName());
3622 item->SetUserData(obj);
3623 fLVContainer->AddItem(item);
3624 }
3625}
3626
3627//////////////////////////////////////////////////////////////////////////////////////////
3628// Session Viewer Main Frame
3629
3630////////////////////////////////////////////////////////////////////////////////
3631/// Main Session viewer constructor.
3632
3634 TGMainFrame(gClient->GetRoot(), w, h), fSessionHierarchy(0), fSessionItem(0)
3635{
3636 // only one session viewer allowed
3637 if (gSessionViewer)
3638 // coverity[uninit_member]: already done
3639 return;
3640 Build();
3642 Resize(w, h);
3643 gSessionViewer = this;
3644}
3645
3646////////////////////////////////////////////////////////////////////////////////
3647/// Main Session viewer constructor.
3648
3650 UInt_t h) : TGMainFrame(gClient->GetRoot(), w, h),
3651 fSessionHierarchy(0), fSessionItem(0)
3652{
3653 // only one session viewer allowed
3654 if (gSessionViewer)
3655 // coverity[uninit_member]: already done
3656 return;
3657 Build();
3659 Move(x, y);
3660 Resize(w, h);
3661 gSessionViewer = this;
3662}
3663
3664////////////////////////////////////////////////////////////////////////////////
3665/// Read configuration file and populate list of sessions
3666/// list of queries and list of packages.
3667/// Read and set also global options as feedback histos.
3668
3670{
3671 if (fViewerEnv)
3672 delete fViewerEnv;
3673 fViewerEnv = new TEnv();
3674
3675 const char *fn = (filename && strlen(filename)) ? filename : fConfigFile.Data();
3676
3678
3679 Bool_t bval = (Bool_t)fViewerEnv->GetValue("Option.Feedback", 1);
3680 if (bval)
3682 else
3684
3685 bval = (Bool_t)fViewerEnv->GetValue("Option.MasterHistos", 1);
3686 if (bval) {
3688 gEnv->SetValue("Proof.StatsHist", 1);
3689 }
3690 else {
3692 gEnv->SetValue("Proof.StatsHist", 0);
3693 }
3694 bval = (Bool_t)fViewerEnv->GetValue("Option.MasterEvents", 0);
3695 if (bval)
3697 else
3699 bval = (Bool_t)fViewerEnv->GetValue("Option.WorkerEvents", 0);
3700 if (bval)
3702 else
3704
3705 Int_t i = 0;
3706 while (kFeedbackHistos[i]) {
3707 bval = (Bool_t)fViewerEnv->GetValue(Form("Option.%s",kFeedbackHistos[i]),
3708 i == 1 ? 1 : 0);
3709 if (bval)
3710 fCascadeMenu->CheckEntry(41+i);
3711 else
3713 i++;
3714 }
3715 TSessionDescription *proofDesc;
3716 fSessions->Delete();
3717 if (fSessionItem)
3719 else
3721 fBaseIcon);
3722 // add local session description
3724 fLocal, fLocal);
3725 fSessionHierarchy->SetToolTipItem(item, "Local Session");
3726 TSessionDescription *localdesc = new TSessionDescription();
3727 localdesc->fTag = "";
3728 localdesc->fName = "Local";
3729 localdesc->fAddress = "Local";
3730 localdesc->fPort = 0;
3731 localdesc->fConfigFile = "";
3732 localdesc->fLogLevel = 0;
3733 localdesc->fUserName = "";
3734 localdesc->fQueries = new TList();
3735 localdesc->fPackages = new TList();
3736 localdesc->fActQuery = 0;
3737 localdesc->fProof = 0;
3738 localdesc->fProofMgr = 0;
3739 localdesc->fAttached = kFALSE;
3740 localdesc->fConnected = kFALSE;
3741 localdesc->fLocal = kTRUE;
3742 localdesc->fSync = kTRUE;
3743 localdesc->fAutoEnable = kFALSE;
3744 localdesc->fNbHistos = 0;
3745 item->SetUserData(localdesc);
3746 fSessions->Add((TObject *)localdesc);
3747 fActDesc = localdesc;
3748
3749 SysInfo_t info;
3750 gSystem->GetSysInfo(&info);
3751 // if the machine has more than one CPU, add one PROOF lite session
3752 // (not supported on Windows yet)
3753 if (!info.fOS.Contains("Microsoft") && info.fCpus > 1) {
3754 // add proof lite session description
3755 item = fSessionHierarchy->AddItem(fSessionItem, "Lite",
3757 fSessionHierarchy->SetToolTipItem(item, "PROOF Lite");
3758 TSessionDescription *litedesc = new TSessionDescription();
3759 litedesc->fTag = "";
3760 litedesc->fName = "PROOF Lite";
3761 litedesc->fAddress = "lite://";
3762 litedesc->fPort = 0;
3763 litedesc->fConfigFile = "";
3764 litedesc->fLogLevel = 0;
3765 litedesc->fUserName = "";
3766 litedesc->fQueries = new TList();
3767 litedesc->fPackages = new TList();
3768 litedesc->fActQuery = 0;
3769 litedesc->fProof = 0;
3770 litedesc->fProofMgr = 0;
3771 litedesc->fAttached = kFALSE;
3772 litedesc->fConnected = kFALSE;
3773 litedesc->fLocal = kFALSE;
3774 litedesc->fSync = kTRUE;
3775 litedesc->fAutoEnable = kFALSE;
3776 litedesc->fNbHistos = 0;
3777 item->SetUserData(litedesc);
3778 fSessions->Add((TObject *)litedesc);
3779 fActDesc = litedesc;
3780 }
3781 TIter next(fViewerEnv->GetTable());
3782 TEnvRec *er;
3783 while ((er = (TEnvRec*) next())) {
3784 const char *s;
3785 if ((s = strstr(er->GetName(), "SessionDescription."))) {
3786 const char *val = fViewerEnv->GetValue(s, (const char*)0);
3787 if (val) {
3788 Int_t cnt = 0;
3789 char *v = StrDup(val);
3790 s += 7;
3791 while (1) {
3792 TString name = strtok(!cnt ? v : 0, ";");
3793 if (name.IsNull()) break;
3794 TString sessiontag = strtok(0, ";");
3795 TString address = strtok(0, ";");
3796 if (address.IsNull()) break;
3797 TString port = strtok(0, ";");
3798 if (port.IsNull()) break;
3799 TString loglevel = strtok(0, ";");
3800 if (loglevel.IsNull()) break;
3801 TString configfile = strtok(0, ";");
3802 TString user = strtok(0, ";");
3803 if (user.IsNull()) break;
3804 TString sync = strtok(0, ";");
3805 TString autoen = strtok(0, ";");
3806
3807 // build session description
3808 proofDesc = new TSessionDescription();
3809 proofDesc->fTag = sessiontag.Length() > 2 ? sessiontag.Data() : "";
3810 proofDesc->fName = name;
3811 proofDesc->fAddress = address;
3812 proofDesc->fPort = atoi(port);
3813 proofDesc->fConfigFile = configfile.Length() > 2 ? configfile.Data() : "";
3814 proofDesc->fLogLevel = atoi(loglevel);
3815 proofDesc->fConnected = kFALSE;
3816 proofDesc->fAttached = kFALSE;
3817 proofDesc->fLocal = kFALSE;
3818 proofDesc->fQueries = new TList();
3819 proofDesc->fPackages = new TList();
3820 proofDesc->fActQuery = 0;
3821 proofDesc->fProof = 0;
3822 proofDesc->fProofMgr = 0;
3823 proofDesc->fSync = (Bool_t)(atoi(sync));
3824 proofDesc->fAutoEnable = (Bool_t)(atoi(autoen));
3825 proofDesc->fUserName = user;
3826 fSessions->Add((TObject *)proofDesc);
3827 item = fSessionHierarchy->AddItem(
3828 fSessionItem, proofDesc->fName.Data(),
3830 fSessionHierarchy->SetToolTipItem(item, "Proof Session");
3831 item->SetUserData(proofDesc);
3832 fActDesc = proofDesc;
3833 cnt++;
3834 }
3835 delete [] v;
3836 }
3837 }
3838 if ((s = strstr(er->GetName(), "QueryDescription."))) {
3839 const char *val = fViewerEnv->GetValue(s, (const char*)0);
3840 if (val) {
3841 Int_t cnt = 0;
3842 char *v = StrDup(val);
3843 s += 7;
3844 while (1) {
3845
3846 TString status = strtok(!cnt ? v : 0, ";");
3847 if (status.IsNull()) break;
3848
3849 TString reference = strtok(0, ";");
3850 if (reference.IsNull()) break;
3851 TString queryname = strtok(0, ";");
3852 if (queryname.IsNull()) break;
3853 TString selector = strtok(0, ";");
3854 if (selector.IsNull()) break;
3855 TString dset = strtok(0, ";");
3856 TString options = strtok(0, ";");
3857 TString eventlist = strtok(0, ";");
3858 TString nbfiles = strtok(0, ";");
3859 TString nbentries = strtok(0, ";");
3860 TString firstentry = strtok(0, ";");
3861
3862 TQueryDescription *newquery = new TQueryDescription();
3863 newquery->fStatus =
3865 newquery->fSelectorString = selector.Length() > 2 ? selector.Data() : "";
3866 newquery->fReference = reference.Length() > 2 ? reference.Data() : "";
3867 newquery->fTDSetString = dset.Length() > 2 ? dset.Data() : "";
3868 newquery->fQueryName = queryname.Length() > 2 ? queryname.Data() : "";
3869 newquery->fOptions = options.Length() > 2 ? options.Data() : "";
3870 newquery->fEventList = eventlist.Length() > 2 ? eventlist.Data() : "";
3871 newquery->fNbFiles = atoi(nbfiles);
3872 newquery->fNoEntries = atoi(nbentries);
3873 newquery->fFirstEntry = atoi(firstentry);
3874 newquery->fResult = 0;
3875 newquery->fChain = 0;
3876 fActDesc->fQueries->Add((TObject *)newquery);
3877 cnt++;
3881 item1, newquery->fQueryName, fQueryCon, fQueryCon);
3882 item2->SetUserData(newquery);
3883 }
3884 delete [] v;
3885 }
3886 }
3887 }
3890 if (fActDesc == localdesc) {
3893 }
3894 else {
3898 }
3901}
3902
3903////////////////////////////////////////////////////////////////////////////////
3904/// Update list of existing Proof sessions.
3905
3907{
3908 // get list of proof sessions
3909 Bool_t found = kFALSE;
3910 Bool_t exists = kFALSE;
3911 TGListTreeItem *item = 0;
3912 TSeqCollection *proofs = gROOT->GetListOfProofs();
3913 TSessionDescription *desc = 0;
3914 TSessionDescription *newdesc;
3915 if (proofs) {
3916 TObject *o = proofs->First();
3917 if (o && dynamic_cast<TProofMgr *>(o)) {
3918 TProofMgr *mgr = dynamic_cast<TProofMgr *>(o);
3919 if (mgr && mgr->QuerySessions("L")) {
3920 TIter nxd(mgr->QuerySessions("L"));
3921 TProofDesc *d = 0;
3922 TProof *p = 0;
3923 while ((d = (TProofDesc *)nxd())) {
3924 TIter nextfs(fSessions);
3925 // check if session exists in the list
3926 exists = kFALSE;
3927 while ((desc = (TSessionDescription *)nextfs())) {
3928 if ((desc->fTag == d->GetName()) ||
3929 (desc->fName == d->GetTitle())) {
3930 exists = kTRUE;
3931 break;
3932 }
3933 }
3934 TIter nexts(fSessions);
3935 found = kFALSE;
3936 p = d->GetProof();
3937 while ((desc = (TSessionDescription *)nexts())) {
3938 if (desc->fConnected && desc->fAttached)
3939 continue;
3940 if (p && ((exists && ((desc->fTag == d->GetName()) ||
3941 (desc->fName == d->GetTitle()))) ||
3942 (!exists && (desc->fAddress == p->GetMaster())))) {
3943 desc->fConnected = kTRUE;
3944 desc->fAttached = kTRUE;
3945 desc->fProof = p;
3946 desc->fProofMgr = mgr;
3947 desc->fTag = d->GetName();
3949 desc);
3950 if (item) {
3952 if (item == fSessionHierarchy->GetSelected()) {
3953 fActDesc->fProof->Connect("Progress(Long64_t,Long64_t)",
3954 "TSessionQueryFrame", fQueryFrame,
3955 "Progress(Long64_t,Long64_t)");
3956 fActDesc->fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
3957 "TSessionQueryFrame", fQueryFrame,
3958 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
3959 fActDesc->fProof->Connect("StopProcess(Bool_t)",
3960 "TSessionQueryFrame", fQueryFrame,
3961 "IndicateStop(Bool_t)");
3963 "ResetProgressDialog(const char*, Int_t,Long64_t,Long64_t)",
3964 "TSessionQueryFrame", fQueryFrame,
3965 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)");
3966 // enable timer used for status bar icon's animation
3967 EnableTimer();
3968 // change status bar right icon to connected pixmap
3969 ChangeRightLogo("monitor01.xpm");
3970 // do not animate yet
3972 // connect to signal "query result ready"
3973 fActDesc->fProof->Connect("QueryResultReady(char *)",
3974 "TSessionViewer", this, "QueryResultReady(char *)");
3975 // display connection information on status bar
3976 TString msg;
3977 msg.Form("PROOF Cluster %s ready", fActDesc->fName.Data());
3978 fStatusBar->SetText(msg.Data(), 1);
3991 // update session information frame
3994 if (fActFrame != fSessionFrame) {
3998 }
3999 }
4000 }
4001 if (desc->fLogLevel < 0)
4002 desc->fLogLevel = 0;
4003 found = kTRUE;
4004 break;
4005 }
4006 }
4007 if (found) continue;
4008 newdesc = new TSessionDescription();
4009 // and fill information from Proof session
4010 newdesc->fTag = d->GetName();
4011 newdesc->fName = d->GetTitle();
4012 newdesc->fAddress = d->GetTitle();
4013 newdesc->fConnected = kFALSE;
4014 newdesc->fAttached = kFALSE;
4015 newdesc->fProofMgr = mgr;
4016 p = d->GetProof();
4017 if (p) {
4018 newdesc->fConnected = kTRUE;
4019 newdesc->fAttached = kTRUE;
4020 if (p->IsLite())
4021 newdesc->fAddress = "lite://";
4022 else
4023 newdesc->fAddress = p->GetMaster();
4024 newdesc->fConfigFile = p->GetConfFile();
4025 newdesc->fUserName = p->GetUser();
4026 newdesc->fPort = p->GetPort();
4027 newdesc->fLogLevel = p->GetLogLevel();
4028 newdesc->fProof = p;
4029 newdesc->fProof->Connect("Progress(Long64_t,Long64_t)",
4030 "TSessionQueryFrame", fQueryFrame,
4031 "Progress(Long64_t,Long64_t)");
4032 newdesc->fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
4033 "TSessionQueryFrame", fQueryFrame,
4034 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
4035 newdesc->fProof->Connect("StopProcess(Bool_t)",
4036 "TSessionQueryFrame", fQueryFrame,
4037 "IndicateStop(Bool_t)");
4038 newdesc->fProof->Connect(
4039 "ResetProgressDialog(const char*, Int_t,Long64_t,Long64_t)",
4040 "TSessionQueryFrame", fQueryFrame,
4041 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)");
4042 // enable timer used for status bar icon's animation
4043 EnableTimer();
4044 // change status bar right icon to connected pixmap
4045 ChangeRightLogo("monitor01.xpm");
4046 // do not animate yet
4048 // connect to signal "query result ready"
4049 newdesc->fProof->Connect("QueryResultReady(char *)",
4050 "TSessionViewer", this, "QueryResultReady(char *)");
4051 }
4052 newdesc->fQueries = new TList();
4053 newdesc->fPackages = new TList();
4054 if (newdesc->fLogLevel < 0)
4055 newdesc->fLogLevel = 0;
4056 newdesc->fActQuery = 0;
4057 newdesc->fLocal = kFALSE;
4058 newdesc->fSync = kFALSE;
4059 newdesc->fAutoEnable = kFALSE;
4060 newdesc->fNbHistos = 0;
4061 // add new session description in list tree
4062 if (p)
4063 item = fSessionHierarchy->AddItem(fSessionItem, newdesc->fName.Data(),
4065 else
4066 item = fSessionHierarchy->AddItem(fSessionItem, newdesc->fName.Data(),
4068 fSessionHierarchy->SetToolTipItem(item, "Proof Session");
4069 item ->SetUserData(newdesc);
4070 // and in our session description list
4071 fSessions->Add(newdesc);
4072 }
4073 }
4074 return;
4075 }
4076 TIter nextp(proofs);
4077 TProof *proof;
4078 // loop over existing Proof sessions
4079 while ((proof = (TProof *)nextp())) {
4080 TIter nexts(fSessions);
4081 found = kFALSE;
4082 // check if session is already in the list
4083 while ((desc = (TSessionDescription *)nexts())) {
4084 if (desc->fProof == proof) {
4085 desc->fConnected = kTRUE;
4086 desc->fAttached = kTRUE;
4087 found = kTRUE;
4088 break;
4089 }
4090 }
4091 if (found) continue;
4092 // create new session description
4093 newdesc = new TSessionDescription();
4094 // and fill information from Proof session
4095 newdesc->fName = proof->GetMaster();
4096 newdesc->fConfigFile = proof->GetConfFile();
4097 newdesc->fUserName = proof->GetUser();
4098 newdesc->fPort = proof->GetPort();
4099 newdesc->fLogLevel = proof->GetLogLevel();
4100 if (newdesc->fLogLevel < 0)
4101 newdesc->fLogLevel = 0;
4102 if (proof->IsLite())
4103 newdesc->fAddress = "lite://";
4104 else
4105 newdesc->fAddress = proof->GetMaster();
4106 newdesc->fQueries = new TList();
4107 newdesc->fPackages = new TList();
4108 newdesc->fProof = proof;
4109 newdesc->fActQuery = 0;
4110 newdesc->fConnected = kTRUE;
4111 newdesc->fAttached = kTRUE;
4112 newdesc->fLocal = kFALSE;
4113 newdesc->fSync = kFALSE;
4114 newdesc->fAutoEnable = kFALSE;
4115 newdesc->fNbHistos = 0;
4116 // add new session description in list tree
4117 item = fSessionHierarchy->AddItem(fSessionItem, newdesc->fName.Data(),
4119 fSessionHierarchy->SetToolTipItem(item, "Proof Session");
4120 item ->SetUserData(newdesc);
4121 // and in our session description list
4122 fSessions->Add(newdesc);
4123 }
4124 }
4125}
4126
4127////////////////////////////////////////////////////////////////////////////////
4128/// Update list of existing Proof sessions.
4129
4131{
4132 // get list of proof sessions
4133 TGListTreeItem *item;
4134 TList *sessions = fActDesc->fProofMgr->QuerySessions("");
4135 if (sessions) {
4136 TIter nextp(sessions);
4137 TProofDesc *pdesc;
4138 TProof *proof;
4139 TSessionDescription *newdesc;
4140 // loop over existing Proof sessions
4141 while ((pdesc = (TProofDesc *)nextp())) {
4142 TIter nexts(fSessions);
4143 TSessionDescription *desc = 0;
4144 Bool_t found = kFALSE;
4145 // check if session is already in the list
4146 while ((desc = (TSessionDescription *)nexts())) {
4147 if ((desc->fTag == pdesc->GetName()) ||
4148 (desc->fName == pdesc->GetTitle())) {
4149 desc->fConnected = kTRUE;
4150 found = kTRUE;
4151 break;
4152 }
4153 }
4154 if (found) continue;
4155 // create new session description
4156 newdesc = new TSessionDescription();
4157 // and fill information from Proof session
4158 newdesc->fTag = pdesc->GetName();
4159 newdesc->fName = pdesc->GetTitle();
4160 proof = pdesc->GetProof();
4161 if (proof) {
4162 newdesc->fConfigFile = proof->GetConfFile();
4163 newdesc->fUserName = proof->GetUser();
4164 newdesc->fPort = proof->GetPort();
4165 newdesc->fLogLevel = proof->GetLogLevel();
4166 if (newdesc->fLogLevel < 0)
4167 newdesc->fLogLevel = 0;
4168 if (proof->IsLite())
4169 newdesc->fAddress = "lite://";
4170 else
4171 newdesc->fAddress = proof->GetMaster();
4172 newdesc->fProof = proof;
4173 }
4174 else {
4175 newdesc->fProof = 0;
4176 newdesc->fConfigFile = "";
4177 newdesc->fUserName = fActDesc->fUserName;
4178 newdesc->fPort = fActDesc->fPort;
4179 newdesc->fLogLevel = 0;
4180 newdesc->fAddress = fActDesc->fAddress;
4181 }
4182 newdesc->fQueries = new TList();
4183 newdesc->fPackages = new TList();
4184 newdesc->fProofMgr = fActDesc->fProofMgr;
4185 newdesc->fActQuery = 0;
4186 newdesc->fConnected = kTRUE;
4187 newdesc->fAttached = kFALSE;
4188 newdesc->fLocal = kFALSE;
4189 newdesc->fSync = kFALSE;
4190 newdesc->fAutoEnable = kFALSE;
4191 newdesc->fNbHistos = 0;
4192 // add new session description in list tree
4193 item = fSessionHierarchy->AddItem(fSessionItem, newdesc->fName.Data(),
4195 fSessionHierarchy->SetToolTipItem(item, "Proof Session");
4196 item ->SetUserData(newdesc);
4197 // and in our session description list
4198 fSessions->Add(newdesc);
4199 // set actual description to the last one
4200 }
4201 }
4202}
4203
4204////////////////////////////////////////////////////////////////////////////////
4205/// Save actual configuration in config file "filename".
4206
4208{
4209 TSessionDescription *session;
4210 TQueryDescription *query;
4211 Int_t scnt = 0, qcnt = 1;
4212 const char *fname = filename ? filename : fConfigFile.Data();
4213
4214 delete fViewerEnv;
4215 gSystem->Unlink(fname);
4216 fViewerEnv = new TEnv();
4217
4218 fViewerEnv->SetValue("Option.Feedback",
4220 fViewerEnv->SetValue("Option.MasterHistos",
4222 fViewerEnv->SetValue("Option.MasterEvents",
4224 fViewerEnv->SetValue("Option.WorkerEvents",
4226
4227 Int_t i = 0;
4228 // browse list of feedback histos and check user's selected ones
4229 while (kFeedbackHistos[i]) {
4230 fViewerEnv->SetValue(Form("Option.%s",kFeedbackHistos[i]),
4232 i++;
4233 }
4234
4235 TIter snext(fSessions);
4236 while ((session = (TSessionDescription *) snext())) {
4237 if ((scnt > 0) && ((session->fAddress.Length() < 3) ||
4238 session->fUserName.Length() < 2)) {
4239 // skip gROOT's list of sessions
4240 continue;
4241 }
4242 if ((scnt > 0) && (session->fName == session->fAddress)) {
4243 // skip gROOT's list of proofs
4244 continue;
4245 }
4246 TString sessionstring;
4247 sessionstring += session->fName;
4248 sessionstring += ";";
4249 sessionstring += session->fTag.Length() > 1 ? session->fTag.Data() : " ";
4250 sessionstring += ";";
4251 sessionstring += session->fAddress;
4252 sessionstring += ";";
4253 sessionstring += TString::Format("%d", session->fPort);
4254 sessionstring += ";";
4255 sessionstring += TString::Format("%d", session->fLogLevel);
4256 sessionstring += ";";
4257 sessionstring += session->fConfigFile.Length() > 1 ? session->fConfigFile.Data() : " ";
4258 sessionstring += ";";
4259 sessionstring += session->fUserName;
4260 sessionstring += ";";
4261 sessionstring += TString::Format("%d", session->fSync);
4262 sessionstring += ";";
4263 sessionstring += TString::Format("%d", session->fAutoEnable);
4264 if (scnt > 0) // skip local session
4265 fViewerEnv->SetValue(Form("SessionDescription.%d",scnt), sessionstring);
4266 scnt++;
4267
4268 TIter qnext(session->fQueries);
4269 while ((query = (TQueryDescription *) qnext())) {
4270 TString querystring;
4271 querystring += TString::Format("%d", query->fStatus);
4272 querystring += ";";
4273 querystring += query->fReference.Length() > 1 ? query->fReference.Data() : " ";
4274 querystring += ";";
4275 querystring += query->fQueryName;
4276 querystring += ";";
4277 querystring += query->fSelectorString.Length() > 1 ? query->fSelectorString.Data() : " ";
4278 querystring += ";";
4279 querystring += query->fTDSetString.Length() > 1 ? query->fTDSetString.Data() : " ";
4280 querystring += ";";
4281 querystring += query->fOptions.Length() > 1 ? query->fOptions.Data() : " ";
4282 querystring += ";";
4283 querystring += query->fEventList.Length() > 1 ? query->fEventList.Data() : " ";
4284 querystring += ";";
4285 querystring += TString::Format("%d",query->fNbFiles);
4286 querystring += ";";
4287 querystring += TString::Format("%lld",query->fNoEntries);
4288 querystring += ";";
4289 querystring += TString::Format("%lld",query->fFirstEntry);
4290 fViewerEnv->SetValue(Form("QueryDescription.%d",qcnt), querystring);
4291 qcnt++;
4292 }
4293 }
4294
4295 fViewerEnv->WriteFile(fname);
4296}
4297
4298////////////////////////////////////////////////////////////////////////////////
4299/// Build main session viewer frame and subframes.
4300
4302{
4303 TString buf;
4304 fActDesc = 0;
4305 fActFrame = 0;
4306 fLogWindow = 0;
4307 fBusy = kFALSE;
4308 fAutoSave = kTRUE;
4310 fStart = fElapsed = 0;
4311
4313 // set minimun size
4314 SetWMSizeHints(400 + 200, 370+50, 2000, 1000, 1, 1);
4315
4316 // collect icons
4317 fLocal = fClient->GetPicture("local_session.xpm");
4318 fProofCon = fClient->GetPicture("proof_connected.xpm");
4319 fProofDiscon = fClient->GetPicture("proof_disconnected.xpm");
4320 fQueryCon = fClient->GetPicture("query_connected.xpm");
4321 fQueryDiscon = fClient->GetPicture("query_disconnected.xpm");
4322 fBaseIcon = fClient->GetPicture("proof_base.xpm");
4323
4324 //--- File menu
4326 fFileMenu->AddEntry("&Load Config...", kFileLoadConfig);
4327 fFileMenu->AddEntry("&Save Config...", kFileSaveConfig);
4329 fFileMenu->AddEntry("&Close Viewer", kFileCloseViewer);
4331 fFileMenu->AddEntry("&Quit ROOT", kFileQuit);
4332
4333 //--- Session menu
4334 fSessionMenu = new TGPopupMenu(gClient->GetDefaultRoot());
4335 fSessionMenu->AddLabel("Session Management");
4337 fSessionMenu->AddEntry("&New Session", kSessionNew);
4338 fSessionMenu->AddEntry("&Add to the list", kSessionAdd);
4341 fSessionMenu->AddEntry("&Connect...", kSessionConnect);
4342 fSessionMenu->AddEntry("&Disconnect", kSessionDisconnect);
4343 fSessionMenu->AddEntry("Shutdo&wn", kSessionShutdown);
4344 fSessionMenu->AddEntry("&Show status",kSessionShowStatus);
4345 fSessionMenu->AddEntry("&Get Queries",kSessionGetQueries);
4350
4351 //--- Query menu
4352 fQueryMenu = new TGPopupMenu(gClient->GetDefaultRoot());
4353 fQueryMenu->AddLabel("Query Management");
4355 fQueryMenu->AddEntry("&New...", kQueryNew);
4356 fQueryMenu->AddEntry("&Edit", kQueryEdit);
4357 fQueryMenu->AddEntry("&Submit", kQuerySubmit);
4359 fQueryMenu->AddEntry("Start &Viewer", kQueryStartViewer);
4361 fQueryMenu->AddEntry("&Delete", kQueryDelete);
4362
4363 fViewerEnv = 0;
4364#ifdef WIN32
4366#else
4368#endif
4369
4371 Int_t i = 0;
4372 while (kFeedbackHistos[i]) {
4374 i++;
4375 }
4376 fCascadeMenu->AddEntry("User defined...", 50);
4377 // disable it for now (until implemented)
4379
4380 //--- Options menu
4382 fOptionsMenu->AddLabel("Global Options");
4384 fOptionsMenu->AddEntry("&Autosave Config", kOptionsAutoSave);
4386 fOptionsMenu->AddEntry("Master &Histos", kOptionsStatsHist);
4387 fOptionsMenu->AddEntry("&Master Events", kOptionsStatsTrace);
4388 fOptionsMenu->AddEntry("&Worker Events", kOptionsSlaveStatsTrace);
4390 fOptionsMenu->AddEntry("Feedback &Active", kOptionsFeedback);
4392 fOptionsMenu->AddPopup("&Feedback Histos", fCascadeMenu);
4394
4395 //--- Help menu
4396 fHelpMenu = new TGPopupMenu(gClient->GetDefaultRoot());
4397 fHelpMenu->AddEntry("&About ROOT...", kHelpAbout);
4398
4399 fFileMenu->Associate(this);
4400 fSessionMenu->Associate(this);
4401 fQueryMenu->Associate(this);
4402 fOptionsMenu->Associate(this);
4403 fCascadeMenu->Associate(this);
4404 fHelpMenu->Associate(this);
4405
4406 //--- create menubar and add popup menus
4407 fMenuBar = new TGMenuBar(this, 1, 1, kHorizontalFrame);
4408
4410 kLHintsLeft, 0, 4, 0, 0));
4412 kLHintsLeft, 0, 4, 0, 0));
4414 kLHintsLeft, 0, 4, 0, 0));
4416 kLHintsLeft, 0, 4, 0, 0));
4418 kLHintsRight));
4419
4420 TGHorizontal3DLine *toolBarSep = new TGHorizontal3DLine(this);
4421 AddFrame(toolBarSep, new TGLayoutHints(kLHintsTop | kLHintsExpandX));
4422
4424 kLHintsExpandX, 0, 0, 1, 1));
4425
4426 toolBarSep = new TGHorizontal3DLine(this);
4427 AddFrame(toolBarSep, new TGLayoutHints(kLHintsTop | kLHintsExpandX));
4428
4429 //---- toolbar
4430
4431 int spacing = 8;
4432 fToolBar = new TGToolBar(this, 60, 20, kHorizontalFrame);
4433 for (int ii = 0; xpm_toolbar[ii]; ii++) {
4434 tb_data[ii].fPixmap = xpm_toolbar[ii];
4435 if (strlen(xpm_toolbar[ii]) == 0) {
4436 spacing = 8;
4437 continue;
4438 }
4439 fToolBar->AddButton(this, &tb_data[ii], spacing);
4440 spacing = 0;
4441 }
4443 toolBarSep = new TGHorizontal3DLine(this);
4444 AddFrame(toolBarSep, new TGLayoutHints(kLHintsTop | kLHintsExpandX));
4447
4450 fPopupSrv->AddEntry("Disconnect",kSessionDisconnect);
4451 fPopupSrv->AddEntry("Shutdown",kSessionShutdown);
4453 fPopupSrv->AddEntry("Show status",kSessionShowStatus);
4454 fPopupSrv->AddEntry("Delete", kSessionDelete);
4455 fPopupSrv->AddEntry("Get Queries",kSessionGetQueries);
4457 fPopupSrv->AddEntry("Cleanup", kSessionCleanup);
4459 fPopupSrv->Connect("Activated(Int_t)","TSessionViewer", this,
4460 "MyHandleMenu(Int_t)");
4461
4463 fPopupQry->AddEntry("Edit",kQueryEdit);
4464 fPopupQry->AddEntry("Submit",kQuerySubmit);
4466 fPopupQry->AddEntry("Start &Viewer", kQueryStartViewer);
4468 fPopupQry->AddEntry("Delete",kQueryDelete);
4469 fPopupQry->Connect("Activated(Int_t)","TSessionViewer", this,
4470 "MyHandleMenu(Int_t)");
4471
4472
4487
4488 //--- Horizontal mother frame -----------------------------------------------
4489 fHf = new TGHorizontalFrame(this, 10, 10);
4491
4492 //--- fV1 -------------------------------------------------------------------
4493 fV1 = new TGVerticalFrame(fHf, 100, 100, kFixedWidth);
4495
4496 fTreeView = new TGCanvas(fV1, 100, 200, kSunkenFrame | kDoubleBorder);
4498 2, 0, 0, 0));
4501 fSessionHierarchy->Connect("Clicked(TGListTreeItem*,Int_t,Int_t,Int_t)",
4502 "TSessionViewer", this,
4503 "OnListTreeClicked(TGListTreeItem*, Int_t, Int_t, Int_t)");
4504 fSessionHierarchy->Connect("DoubleClicked(TGListTreeItem*,Int_t)",
4505 "TSessionViewer", this,
4506 "OnListTreeDoubleClicked(TGListTreeItem*, Int_t)");
4508
4509 //--- fV2 -------------------------------------------------------------------
4510 fV2 = new TGVerticalFrame(fHf, 350, 310);
4512
4513 //--- Server Frame ----------------------------------------------------------
4514 fServerFrame = new TSessionServerFrame(fV2, 350, 310);
4515 fSessions = new TList;
4517 fServerFrame->Build(this);
4519 kLHintsExpandY, 2, 0, 1, 2));
4520
4521 //--- Session Frame ---------------------------------------------------------
4522 fSessionFrame = new TSessionFrame(fV2, 350, 310);
4523 fSessionFrame->Build(this);
4525 kLHintsExpandY, 2, 0, 1, 2));
4526
4527 //--- Query Frame -----------------------------------------------------------
4528 fQueryFrame = new TSessionQueryFrame(fV2, 350, 310);
4529 fQueryFrame->Build(this);
4531 kLHintsExpandY, 2, 0, 1, 2));
4532
4533 //--- Output Frame ----------------------------------------------------------
4534 fOutputFrame = new TSessionOutputFrame(fV2, 350, 310);
4535 fOutputFrame->Build(this);
4537 kLHintsExpandY, 2, 0, 1, 2));
4538
4539 //--- Input Frame -----------------------------------------------------------
4540 fInputFrame = new TSessionInputFrame(fV2, 350, 310);
4541 fInputFrame->Build(this);
4543 kLHintsExpandY, 2, 0, 1, 2));
4544
4546
4547 // add vertical splitter between list tree and frames
4548 TGVSplitter *splitter = new TGVSplitter(fHf, 4);
4549 splitter->SetFrame(fV1, kTRUE);
4553
4556
4559
4560 // if description available, update server infos frame
4561 if (fActDesc) {
4562 if (!fActDesc->fLocal) {
4564 }
4565 else {
4568 }
4569 }
4570
4571 //--- Status Bar ------------------------------------------------------------
4572 int parts[] = { 36, 49, 15 };
4573 fStatusBar = new TGStatusBar(this, 10, 10);
4575 fStatusBar->SetParts(parts, 3);
4576 for (int p = 0; p < 3; ++p)
4579 kLHintsExpandX, 0, 0, 1, 1));
4580
4581 // connection icon (animation) and time info
4582 fStatusBar->SetText(" 00:00:00", 2);
4583 TGCompositeFrame *leftpart = fStatusBar->GetBarPart(2);
4584 fRightIconPicture = (TGPicture *)fClient->GetPicture("proof_disconnected.xpm");
4585 fRightIcon = new TGIcon(leftpart, fRightIconPicture,
4587 leftpart->AddFrame(fRightIcon, new TGLayoutHints(kLHintsLeft, 2, 0, 0, 0));
4588
4589 // connection progress bar
4590 TGCompositeFrame *rightpart = fStatusBar->GetBarPart(0);
4593 fConnectProg->SetBarColor("green");
4594 rightpart->AddFrame(fConnectProg, new TGLayoutHints(kLHintsExpandX, 1, 1, 1, 1));
4595
4596 // add user info
4598 buf.Form("User : %s - %s", fUserGroup->fRealName.Data(),
4600 fStatusBar->SetText(buf.Data(), 1);
4601
4602 fTimer = 0;
4603
4604 // create context menu
4605 fContextMenu = new TContextMenu("SessionViewerContextMenu") ;
4606
4607 SetWindowName("ROOT Session Viewer");
4608 MapSubwindows();
4609 MapWindow();
4610
4611 // hide frames
4621 Resize(610, 420);
4622}
4623
4624////////////////////////////////////////////////////////////////////////////////
4625/// Destructor.
4626
4628{
4629 delete fUserGroup;
4630 if (gSessionViewer == this)
4631 gSessionViewer = 0;
4632}
4633
4634////////////////////////////////////////////////////////////////////////////////
4635/// Handle mouse clicks in list tree.
4636
4638 Int_t x, Int_t y)
4639{
4640 TList *objlist;
4641 TObject *obj;
4642 TString msg;
4643
4647 if (entry->GetParent() == 0) { // PROOF
4648 // switch frames only if actual one doesn't match
4649 if (fActFrame != fServerFrame) {
4653 }
4662 }
4663 else if (entry->GetParent()->GetParent() == 0) { // Server
4664 if (entry->GetUserData()) {
4665 obj = (TObject *)entry->GetUserData();
4666 if (!obj || obj->IsA() != TSessionDescription::Class())
4667 return;
4668 // update server frame information
4671 // if Proof valid, update connection infos
4674 fActDesc->fProof->cd();
4675 msg.Form("PROOF Cluster %s ready", fActDesc->fName.Data());
4676 }
4677 else {
4678 msg.Form("PROOF Cluster %s not connected", fActDesc->fName.Data());
4679 }
4680 fStatusBar->SetText(msg.Data(), 1);
4681 }
4682 if ((fActDesc->fConnected) && (fActDesc->fAttached)) {
4689 }
4690 else {
4695 }
4696 // local session
4697 if (fActDesc->fLocal) {
4698 if (fActFrame != fSessionFrame) {
4704 }
4708 }
4709 // proof session not connected
4710 if ((!fActDesc->fLocal) && (!fActDesc->fAttached) &&
4711 (fActFrame != fServerFrame)) {
4715 }
4716 // proof session connected
4717 if ((!fActDesc->fLocal) && (fActDesc->fConnected) &&
4718 (fActDesc->fAttached)) {
4719 if (fActFrame != fSessionFrame) {
4723 }
4725 }
4728 if (fActDesc->fAutoEnable)
4730 else
4732 // update session information frame
4737 }
4738 else if (entry->GetParent()->GetParent()->GetParent() == 0) { // query
4739 obj = (TObject *)entry->GetParent()->GetUserData();
4740 if (obj && obj->IsA() == TSessionDescription::Class()) {
4742 }
4743 obj = (TObject *)entry->GetUserData();
4744 if (obj && obj->IsA() == TQueryDescription::Class()) {
4746 }
4747 // update query information and buttons state
4750 if (fActFrame != fQueryFrame) {
4754 }
4755 if ((fActDesc->fConnected) && (fActDesc->fAttached) &&
4760 // trick to update feedback histos
4761 OnCascadeMenu();
4762 }
4763 else { // a list (input, output)
4764 obj = (TObject *)entry->GetParent()->GetParent()->GetUserData();
4765 if (obj && obj->IsA() == TSessionDescription::Class()) {
4767 }
4768 obj = (TObject *)entry->GetParent()->GetUserData();
4769 if (obj && obj->IsA() == TQueryDescription::Class()) {
4771 }
4772 if (fActDesc->fActQuery) {
4773 // update input/output list views
4776 if (fActDesc->fActQuery->fResult) {
4777 objlist = fActDesc->fActQuery->fResult->GetOutputList();
4778 if (objlist) {
4779 TIter nexto(objlist);
4780 while ((obj = (TObject *) nexto())) {
4781 fOutputFrame->AddObject(obj);
4782 }
4783 }
4784 objlist = fActDesc->fActQuery->fResult->GetInputList();
4785 if (objlist) {
4786 TIter nexti(objlist);
4787 while ((obj = (TObject *) nexti())) {
4788 fInputFrame->AddObject(obj);
4789 }
4790 }
4791 }
4792 else {
4793 TChain *chain = (TChain *)fActDesc->fActQuery->fChain;
4794 if (chain && chain->GetPlayer()) {
4795 objlist = chain->GetPlayer()->GetSelectorFromFile()->GetOutputList();
4796 if (objlist) {
4797 TIter nexto(objlist);
4798 while ((obj = (TObject *) nexto())) {
4799 fOutputFrame->AddObject(obj);
4800 }
4801 }
4802 }
4803 }
4808 }
4809 // switch frames
4810 if (strstr(entry->GetText(),"Output")) {
4811 if (fActFrame != fOutputFrame) {
4815 }
4816 }
4817 else if (strstr(entry->GetText(),"Input")) {
4818 if (fActFrame != fInputFrame) {
4822 }
4823 }
4824 }
4825 if (btn == 3) { // right button
4826 // place popup menus
4828 if (!item) return;
4829 obj = (TObject *)item->GetUserData();
4830 if (obj && obj->IsA() == TQueryDescription::Class()) {
4831 fPopupQry->PlaceMenu(x, y, 1, 1);
4832 }
4833 else if (obj && obj->IsA() == TSessionDescription::Class()) {
4834 if (!fActDesc->fLocal)
4835 fPopupSrv->PlaceMenu(x, y, 1, 1);
4836 }
4837 }
4838 // enable / disable menu entries
4856 }
4857 else {
4862 if (entry->GetParent() != 0)
4877 }
4878 if (fActDesc->fLocal) {
4891 }
4892}
4893
4894////////////////////////////////////////////////////////////////////////////////
4895/// Handle mouse double clicks in list tree (connect to server).
4896
4898{
4899 if (entry == fSessionItem)
4900 return;
4901 if (entry->GetParent()->GetParent() == 0) { // Server
4902 if (entry->GetUserData()) {
4903 TObject *obj = (TObject *)entry->GetUserData();
4904 if ((!obj) || (obj->IsA() != TSessionDescription::Class()))
4905 return;
4907 // if Proof valid, update connection infos
4908 }
4909 if ((!fActDesc->fLocal) && ((!fActDesc->fConnected) ||
4910 (!fActDesc->fAttached))) {
4912 }
4913 }
4914}
4915
4916////////////////////////////////////////////////////////////////////////////////
4917/// Terminate Session : save configuration, clean temporary files and close
4918/// Proof connections.
4919
4921{
4922 // clean-up temporary files
4923 TString pathtmp;
4925 if (!gSystem->AccessPathName(pathtmp)) {
4926 gSystem->Unlink(pathtmp);
4927 }
4929 if (!gSystem->AccessPathName(pathtmp)) {
4930 gSystem->Unlink(pathtmp);
4931 }
4932 // close opened Proof sessions (if any)
4933 TIter next(fSessions);
4934 TSessionDescription *desc = 0;
4935 while ((desc = (TSessionDescription *)next())) {
4936 if (desc->fAttached && desc->fProof &&
4937 desc->fProof->IsValid())
4938 desc->fProof->Detach();
4939 }
4940 // Save configuration
4941 if (fAutoSave)
4943}
4944
4945////////////////////////////////////////////////////////////////////////////////
4946/// Close main Session Viewer window.
4947
4949{
4950 // clean-up temporary files
4951 TString pathtmp;
4953 if (!gSystem->AccessPathName(pathtmp)) {
4954 gSystem->Unlink(pathtmp);
4955 }
4957 if (!gSystem->AccessPathName(pathtmp)) {
4958 gSystem->Unlink(pathtmp);
4959 }
4960 // Save configuration
4961 if (fAutoSave)
4963 Cleanup();
4964 fSessions->Delete();
4965 if (fSessionItem)
4967 delete fSessionHierarchy; // this has been put int TGCanvas which isn't a
4968 // TGComposite frame and doesn't do cleanups.
4975 delete fTimer;
4976 DeleteWindow();
4977}
4978
4979////////////////////////////////////////////////////////////////////////////////
4980/// Change the right logo (used for animation).
4981
4983{
4987}
4988
4989////////////////////////////////////////////////////////////////////////////////
4990/// Enable animation timer.
4991
4993{
4994 if (!fTimer) fTimer = new TTimer(this, 500);
4995 fTimer->Reset();
4996 fTimer->TurnOn();
4997 time( &fStart );
4998}
4999
5000////////////////////////////////////////////////////////////////////////////////
5001/// Disable animation timer.
5002
5004{
5005 if (fTimer)
5006 fTimer->TurnOff();
5007 ChangeRightLogo("proof_disconnected.xpm");
5008}
5009
5010////////////////////////////////////////////////////////////////////////////////
5011/// Handle animation timer.
5012
5014{
5015 TString buf;
5016 struct tm *connected;
5017 Int_t count = gRandom->Integer(4);
5018 if (count > 3) {
5019 count = 0;
5020 }
5021 if (fChangePic)
5022 ChangeRightLogo(xpm_names[count]);
5023 time( &fElapsed );
5024 time_t elapsed_time = (time_t)difftime( fElapsed, fStart );
5025 connected = gmtime( &elapsed_time );
5026 if (connected) {
5027 buf.Form(" %02d:%02d:%02d", connected->tm_hour,
5028 connected->tm_min, connected->tm_sec);
5029 fStatusBar->SetText(buf.Data(), 2);
5030 }
5031 else {
5032 fStatusBar->SetText(" 00:00:00", 2);
5033 }
5034
5035 if (fActDesc->fLocal) {
5036 if ((fActDesc->fActQuery) &&
5039 TChain *chain = (TChain *)fActDesc->fActQuery->fChain;
5040 if (chain)
5042 chain->GetReadEntry()+1);
5043 }
5044 }
5045
5046 fTimer->Reset();
5047 return kTRUE;
5048}
5049
5050////////////////////////////////////////////////////////////////////////////////
5051/// Load/append a log msg in the log frame.
5052
5053void TSessionViewer::LogMessage(const char *msg, Bool_t all)
5054{
5055 if (fLogWindow) {
5056 if (all) {
5057 // load buffer
5058 fLogWindow->LoadBuffer(msg);
5059 } else {
5060 // append
5061 fLogWindow->AddBuffer(msg);
5062 }
5063 }
5064}
5065
5066////////////////////////////////////////////////////////////////////////////////
5067/// Handle signal "query result ready" coming from Proof session.
5068
5070{
5071 TString strtmp;
5072 strtmp.Form("Query Result Ready for %s", query);
5073 // show information on status bar
5074 ShowInfo(strtmp.Data());
5075 TGListTreeItem *item=0, *item2=0;
5076 TQueryDescription *lquery = 0;
5077 // loop over actual queries to find which one is ready
5078
5079 TIter nexts(fSessions);
5080 TSessionDescription *desc = 0;
5081 // check if session is already in the list
5082 while ((desc = (TSessionDescription *)nexts())) {
5083 if (desc && !desc->fAttached)
5084 continue;
5085 TIter nextp(desc->fQueries);
5086 while ((lquery = (TQueryDescription *)nextp())) {
5087 if (lquery->fReference.Contains(query)) {
5088 // results are ready for this query
5089 lquery->fResult = desc->fProof->GetQueryResult(query);
5091 if (!lquery->fResult)
5092 break;
5093 // get query status
5094 lquery->fStatus = lquery->fResult->IsFinalized() ?
5097 // get data set
5098 TObject *o = lquery->fResult->GetInputObject("TDSet");
5099 if (o)
5100 lquery->fChain = (TDSet *) o;
5102 if (item) {
5103 item2 = fSessionHierarchy->FindItemByObj(item, lquery);
5104 }
5105 if (item2) {
5106 // add input and output list entries
5107 if (lquery->fResult->GetInputList())
5108 if (!fSessionHierarchy->FindChildByName(item2, "InputList"))
5109 fSessionHierarchy->AddItem(item2, "InputList");
5110 if (lquery->fResult->GetOutputList())
5111 if (!fSessionHierarchy->FindChildByName(item2, "OutputList"))
5112 fSessionHierarchy->AddItem(item2, "OutputList");
5113 }
5114 // update list tree, query frame information, and buttons state
5118 fQueryFrame->UpdateButtons(lquery);
5119 break;
5120 }
5121 }
5122 }
5123}
5124
5125////////////////////////////////////////////////////////////////////////////////
5126/// Clean-up Proof session.
5127
5129{
5131 if (!item) return;
5132 TObject *obj = (TObject *)item->GetUserData();
5133 if (!obj || obj->IsA() != TSessionDescription::Class()) return;
5134 if (!fActDesc->fProof || !fActDesc->fProof->IsValid()) return;
5135 TString m;
5136 m.Form("Are you sure to cleanup the session \"%s::%s\"",
5138 Int_t result;
5139 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), 0,
5141 if (result == kMBYes) {
5142 // send cleanup request for the session specified by the tag reference
5143 TString sessiontag;
5144 sessiontag.Form("session-%s",fActDesc->fTag.Data());
5145 fActDesc->fProof->CleanupSession(sessiontag.Data());
5146 // clear the list of queries
5150 if (fAutoSave)
5152 }
5153 // update list tree
5156}
5157
5158////////////////////////////////////////////////////////////////////////////////
5159/// Reset Proof session.
5160
5162{
5164 if (!item) return;
5165 TObject *obj = (TObject *)item->GetUserData();
5166 if (!obj || obj->IsA() != TSessionDescription::Class()) return;
5167 if (!fActDesc->fProof || !fActDesc->fProof->IsValid()) return;
5168 TString m;
5169 m.Form("Do you really want to reset the session \"%s::%s\"",
5171 Int_t result;
5172 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), 0,
5174 if (result == kMBYes) {
5175 // reset the session
5177 if (mgr && mgr->IsValid()) {
5178 mgr->Reset(fActDesc->fUserName);
5179 }
5180 // reset connected flag
5182 fActDesc->fProof = 0;
5183 // disable animation timer
5184 DisableTimer();
5185 // change list tree item picture to disconnected pixmap
5188 if (item2) item2->SetPictures(fProofDiscon, fProofDiscon);
5189
5193 fStatusBar->SetText("", 1);
5194 }
5195 // update list tree
5198}
5199
5200////////////////////////////////////////////////////////////////////////////////
5201/// Delete query from list tree and ask user if they want to delete it also
5202/// from server.
5203
5205{
5207 if (!item) return;
5208 TObject *obj = (TObject *)item->GetUserData();
5209 if (!obj || obj->IsA() != TQueryDescription::Class()) return;
5210 TQueryDescription *query = (TQueryDescription *)obj;
5211 TString m;
5212 Int_t result = 0;
5213
5217 new TGMsgBox(fClient->GetRoot(), this, "Delete Query",
5218 "Deleting running queries is not allowed", kMBIconExclamation,
5219 kMBOk, &result);
5220 return;
5221 }
5222 m.Form("Do you want to delete query \"%s\" from server too ?",
5223 query->fQueryName.Data());
5224 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), kMBIconQuestion,
5226 }
5227 else {
5228 m.Form("Dou you really want to delete query \"%s\" ?",
5229 query->fQueryName.Data());
5230 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), kMBIconQuestion,
5231 kMBOk | kMBCancel, &result);
5232 }
5233 if (result == kMBYes) {
5234 fActDesc->fProof->Remove(query->fReference.Data());
5235 fActDesc->fQueries->Remove((TObject *)query);
5237 delete query;
5238 }
5239 else if (result == kMBNo || result == kMBOk) {
5240 fActDesc->fQueries->Remove((TObject *)query);
5242 delete query;
5243 }
5246 if (fAutoSave)
5248}
5249
5250////////////////////////////////////////////////////////////////////////////////
5251/// Edit currently selected query.
5252
5254{
5256 if (!item) return;
5257 TObject *obj = (TObject *)item->GetUserData();
5258 if (!obj || obj->IsA() != TQueryDescription::Class()) return;
5259 TQueryDescription *query = (TQueryDescription *)obj;
5260 TNewQueryDlg *dlg = new TNewQueryDlg(this, 350, 310, query, kTRUE);
5261 dlg->Popup();
5262}
5263
5264////////////////////////////////////////////////////////////////////////////////
5265/// Start TreeViewer from selected TChain.
5266
5268{
5270 if (!item) return;
5271 TObject *obj = (TObject *)item->GetUserData();
5272 if (!obj || obj->IsA() != TQueryDescription::Class()) return;
5273 TQueryDescription *query = (TQueryDescription *)obj;
5274 if (!query->fChain && query->fResult &&
5275 (obj = query->fResult->GetInputObject("TDSet"))) {
5276 query->fChain = (TDSet *) obj;
5277 }
5278 if (!query->fChain) return;
5279 if (query->fChain->IsA() == TChain::Class())
5280 ((TChain *)query->fChain)->StartViewer();
5281 else if (query->fChain->IsA() == TDSet::Class())
5282 ((TDSet *)query->fChain)->StartViewer();
5283}
5284
5285////////////////////////////////////////////////////////////////////////////////
5286/// Query the list of uploaded packages from proof and display it
5287/// into a new text window.
5288
5290{
5291 Window_t wdummy;
5292 Int_t ax, ay;
5293
5294 if (fActDesc->fLocal) return;
5295 if (!fActDesc->fProof || !fActDesc->fProof->IsValid())
5296 return;
5297 TString pathtmp = TString::Format("%s/%s", gSystem->TempDirectory(),
5299 // redirect stdout/stderr to temp file
5300 if (gSystem->RedirectOutput(pathtmp.Data(), "w") != 0) {
5301 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
5302 return;
5303 }
5305 // restore stdout/stderr
5306 if (gSystem->RedirectOutput(0) != 0) {
5307 Error("ShowStatus", "stdout/stderr retore failed; skipping");
5308 return;
5309 }
5310 if (!fLogWindow) {
5311 fLogWindow = new TSessionLogView(this, 700, 100);
5312 } else {
5313 // Clear window
5314 fLogWindow->Clear();
5315 }
5316 fLogWindow->LoadFile(pathtmp.Data());
5317 gVirtualX->TranslateCoordinates(GetId(), fClient->GetDefaultRoot()->GetId(),
5318 0, 0, ax, ay, wdummy);
5319 fLogWindow->Move(ax, ay + GetHeight() + 35);
5320 fLogWindow->Popup();
5321}
5322
5323////////////////////////////////////////////////////////////////////////////////
5324/// Update the list of packages.
5325
5327{
5328 TObjString *packname;
5329 TPackageDescription *package;
5333 //fActDesc->fPackages->Clear();
5335 if(packlist) {
5336 TIter nextenabled(packlist);
5337 while ((packname = (TObjString *)nextenabled())) {
5338 package = new TPackageDescription;
5339 package->fName = packname->GetName();
5340 package->fName += ".par";
5341 package->fPathName = package->fName;
5342 package->fId = fActDesc->fPackages->GetEntries();
5343 package->fUploaded = kTRUE;
5344 package->fEnabled = kTRUE;
5345 if (!fActDesc->fPackages->FindObject(package->fName)) {
5346 fActDesc->fPackages->Add((TObject *)package);
5347 }
5348 }
5349 }
5350 packlist = fActDesc->fProof->GetListOfPackages();
5351 if(packlist) {
5352 TIter nextpack(packlist);
5353 while ((packname = (TObjString *)nextpack())) {
5354 package = new TPackageDescription;
5355 package->fName = packname->GetName();
5356 package->fName += ".par";
5357 package->fPathName = package->fName;
5358 package->fId = fActDesc->fPackages->GetEntries();
5359 package->fUploaded = kTRUE;
5360 package->fEnabled = kFALSE;
5361 if (!fActDesc->fPackages->FindObject(package->fName)) {
5362 fActDesc->fPackages->Add((TObject *)package);
5363 }
5364 }
5365 }
5366 }
5367// fSessionFrame->UpdatePackages();
5368}
5369
5370////////////////////////////////////////////////////////////////////////////////
5371/// Query list of enabled packages from proof and display it
5372/// into a new text window.
5373
5375{
5376 Window_t wdummy;
5377 Int_t ax, ay;
5378
5379 if (fActDesc->fLocal) return;
5380 if (!fActDesc->fProof || !fActDesc->fProof->IsValid())
5381 return;
5382 TString pathtmp = TString::Format("%s/%s", gSystem->TempDirectory(),
5384 // redirect stdout/stderr to temp file
5385 if (gSystem->RedirectOutput(pathtmp.Data(), "w") != 0) {
5386 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
5387 return;
5388 }
5390 // restore stdout/stderr
5391 if (gSystem->RedirectOutput(0) != 0) {
5392 Error("ShowStatus", "stdout/stderr retore failed; skipping");
5393 return;
5394 }
5395 if (!fLogWindow) {
5396 fLogWindow = new TSessionLogView(this, 700, 100);
5397 } else {
5398 // Clear window
5399 fLogWindow->Clear();
5400 }
5401 fLogWindow->LoadFile(pathtmp.Data());
5402 gVirtualX->TranslateCoordinates(GetId(), fClient->GetDefaultRoot()->GetId(),
5403 0, 0, ax, ay, wdummy);
5404 fLogWindow->Move(ax, ay + GetHeight() + 35);
5405 fLogWindow->Popup();
5406}
5407
5408////////////////////////////////////////////////////////////////////////////////
5409/// Display the content of the temporary log file for queryref
5410/// into a new text window.
5411
5412void TSessionViewer::ShowLog(const char *queryref)
5413{
5414 Window_t wdummy;
5415 Int_t ax, ay;
5416
5417 if (fActDesc->fProof) {
5418 gVirtualX->SetCursor(GetId(),gVirtualX->CreateCursor(kWatch));
5419 if (!fLogWindow) {
5420 fLogWindow = new TSessionLogView(this, 700, 100);
5421 } else {
5422 // Clear window
5423 fLogWindow->Clear();
5424 }
5425 fActDesc->fProof->Connect("LogMessage(const char*,Bool_t)",
5426 "TSessionViewer", this, "LogMessage(const char*,Bool_t)");
5429 if (queryref)
5430 fActDesc->fProof->ShowLog(queryref);
5431 else
5432 fActDesc->fProof->ShowLog(0);
5433 fActDesc->fProof->SendLogToWindow(logonly);
5434 // set log window position at the bottom of Session Viewer
5435 gVirtualX->TranslateCoordinates(GetId(),
5436 fClient->GetDefaultRoot()->GetId(), 0, 0, ax, ay, wdummy);
5437 fLogWindow->Move(ax, ay + GetHeight() + 35);
5438 fLogWindow->Popup();
5439 gVirtualX->SetCursor(GetId(), 0);
5440 }
5441}
5442
5443////////////////////////////////////////////////////////////////////////////////
5444/// Display text in status bar.
5445
5446void TSessionViewer::ShowInfo(const char *txt)
5447{
5448 fStatusBar->SetText(txt,0);
5451}
5452
5453////////////////////////////////////////////////////////////////////////////////
5454/// Retrieve and display Proof status.
5455
5457{
5458 Window_t wdummy;
5459 Int_t ax, ay;
5460
5461 if (!fActDesc->fProof || !fActDesc->fProof->IsValid())
5462 return;
5463 TString pathtmp = TString::Format("%s/%s", gSystem->TempDirectory(),
5465 // redirect stdout/stderr to temp file
5466 if (gSystem->RedirectOutput(pathtmp.Data(), "w") != 0) {
5467 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
5468 return;
5469 }
5471 // restore stdout/stderr
5472 if (gSystem->RedirectOutput(0) != 0) {
5473 Error("ShowStatus", "stdout/stderr retore failed; skipping");
5474 return;
5475 }
5476 if (!fLogWindow) {
5477 fLogWindow = new TSessionLogView(this, 700, 100);
5478 } else {
5479 // Clear window
5480 fLogWindow->Clear();
5481 }
5482 fLogWindow->LoadFile(pathtmp.Data());
5483 gVirtualX->TranslateCoordinates(GetId(), fClient->GetDefaultRoot()->GetId(),
5484 0, 0, ax, ay, wdummy);
5485 fLogWindow->Move(ax, ay + GetHeight() + 35);
5486 fLogWindow->Popup();
5487}
5488
5489////////////////////////////////////////////////////////////////////////////////
5490/// Handle startup message (connection progress) coming from Proof session.
5491
5493{
5494 Float_t pos = Float_t(Double_t(done * 100)/Double_t(total));
5496 fStatusBar->SetText(msg, 1);
5497}
5498
5499////////////////////////////////////////////////////////////////////////////////
5500/// Handle session viewer custom popup menus.
5501
5503{
5504 switch (id) {
5505
5506 case kSessionDelete:
5508 break;
5509
5510 case kSessionConnect:
5512 break;
5513
5514 case kSessionDisconnect:
5516 break;
5517
5518 case kSessionShutdown:
5520 break;
5521
5522 case kSessionCleanup:
5524 break;
5525
5526 case kSessionReset:
5527 ResetSession();
5528 break;
5529
5530 case kSessionBrowse:
5531 if (fActDesc->fProof && fActDesc->fProof->IsValid()) {
5532 TBrowser *b = new TBrowser();
5534 }
5535 break;
5536
5537 case kSessionShowStatus:
5538 ShowStatus();
5539 break;
5540
5541 case kSessionGetQueries:
5543 break;
5544
5545 case kQueryEdit:
5546 EditQuery();
5547 break;
5548
5549 case kQueryDelete:
5550 DeleteQuery();
5551 break;
5552
5553 case kQueryStartViewer:
5554 StartViewer();
5555 break;
5556
5557 case kQuerySubmit:
5559 break;
5560 }
5561}
5562
5563////////////////////////////////////////////////////////////////////////////////
5564/// Handle feedback histograms configuration menu.
5565
5567{
5568 // divide stats canvas by number of selected feedback histos
5573 if (!fActDesc || !fActDesc->fActQuery) return;
5574 fActDesc->fNbHistos = 0;
5575 Int_t i = 0;
5576
5577 if (fActDesc->fAttached && fActDesc->fProof &&
5578 fActDesc->fProof->IsValid()) {
5580 // browse list of feedback histos and check user's selected ones
5581 while (kFeedbackHistos[i]) {
5582 if (fCascadeMenu->IsEntryChecked(41+i)) {
5584 }
5585 i++;
5586 }
5587 }
5588 else {
5589 // if feedback option not selected, clear Proof's feedback option
5591 }
5592 }
5593
5594 i = 0;
5595 // loop over feedback histo list
5596 while (kFeedbackHistos[i]) {
5597 // check if user has selected this histogram in the option menu
5598 if (fCascadeMenu->IsEntryChecked(41+i))
5600 i++;
5601 }
5604 if (fActDesc->fNbHistos == 4)
5606 else if (fActDesc->fNbHistos > 4)
5608 else
5610
5611 // if actual query has results, update feedback histos
5615 fQueryFrame->ResetProgressDialog("", 0, 0, 0);
5616 }
5617 else if (fActDesc->fActQuery) {
5622 }
5624}
5625////////////////////////////////////////////////////////////////////////////////
5626/// Handle messages send to the TSessionViewer object. E.g. all menu entries
5627/// messages.
5628
5630{
5631 TNewQueryDlg *dlg;
5632
5633 switch (GET_MSG(msg)) {
5634 case kC_COMMAND:
5635 switch (GET_SUBMSG(msg)) {
5636 case kCM_BUTTON:
5637 case kCM_MENU:
5638 switch (parm1) {
5639
5640 case kFileCloseViewer:
5641 CloseWindow();
5642 break;
5643
5644 case kFileLoadConfig:
5645 {
5646 TGFileInfo fi;
5649 fi.fFileTypes = conftypes;
5650 new TGFileDialog(fClient->GetRoot(), this, kFDOpen, &fi);
5651 if (fi.fFilename) {
5655 }
5656 }
5657 break;
5658
5659 case kFileSaveConfig:
5660 {
5661 TGFileInfo fi;
5664 fi.fFileTypes = conftypes;
5665 new TGFileDialog(fClient->GetRoot(), this, kFDSave, &fi);
5666 if (fi.fFilename) {
5669 }
5670 }
5671 break;
5672
5673 case kFileQuit:
5674 Terminate();
5676 delete this;
5678 break;
5679
5680 case kSessionNew:
5682 break;
5683
5684 case kSessionAdd:
5686 break;
5687
5688 case kSessionDelete:
5690 break;
5691
5692 case kSessionCleanup:
5694 break;
5695
5696 case kSessionReset:
5697 ResetSession();
5698 break;
5699
5700 case kSessionConnect:
5702 break;
5703
5704 case kSessionDisconnect:
5706 break;
5707
5708 case kSessionShutdown:
5710 break;
5711
5712 case kSessionShowStatus:
5713 ShowStatus();
5714 break;
5715
5716 case kSessionGetQueries:
5718 break;
5719
5720 case kQueryNew:
5721 dlg = new TNewQueryDlg(this, 350, 310);
5722 dlg->Popup();
5723 break;
5724
5725 case kQueryEdit:
5726 EditQuery();
5727 break;
5728
5729 case kQueryDelete:
5730 DeleteQuery();
5731 break;
5732
5733 case kQueryStartViewer:
5734 StartViewer();
5735 break;
5736
5737 case kQuerySubmit:
5739 break;
5740
5741 case kOptionsAutoSave:
5744 fAutoSave = kFALSE;
5745 }
5746 else {
5748 fAutoSave = kTRUE;
5749 }
5750 break;
5751
5752 case kOptionsStatsHist:
5755 gEnv->SetValue("Proof.StatsHist", 0);
5756 }
5757 else {
5759 gEnv->SetValue("Proof.StatsHist", 1);
5760 }
5761 break;
5762
5763 case kOptionsStatsTrace:
5766 gEnv->SetValue("Proof.StatsTrace", 0);
5767 }
5768 else {
5770 gEnv->SetValue("Proof.StatsTrace", 1);
5771 }
5772 break;
5773
5777 gEnv->SetValue("Proof.SlaveStatsTrace", 0);
5778 }
5779 else {
5781 gEnv->SetValue("Proof.SlaveStatsTrace", 1);
5782 }
5783 break;
5784
5785 case kOptionsFeedback:
5788 }
5789 else {
5791 }
5792 break;
5793
5794 case 41:
5795 case 42:
5796 case 43:
5797 case 44:
5798 case 45:
5799 case 46:
5800 if (fCascadeMenu->IsEntryChecked(parm1)) {
5801 fCascadeMenu->UnCheckEntry(parm1);
5802 }
5803 else {
5804 fCascadeMenu->CheckEntry(parm1);
5805 }
5806 OnCascadeMenu();
5807 break;
5808
5809 case 50:
5810 if (fCascadeMenu->IsEntryChecked(parm1)) {
5811 fCascadeMenu->UnCheckEntry(parm1);
5812 }
5813 else {
5814 fCascadeMenu->CheckEntry(parm1);
5815 }
5816 OnCascadeMenu();
5817 break;
5818
5819 case kHelpAbout:
5820 {
5821#ifdef WIN32
5823#else
5824 char str[32];
5825 snprintf(str, 32, "About ROOT %s...", gROOT->GetVersion());
5826 TRootHelpDialog *hd = new TRootHelpDialog(this, str, 600, 400);
5827 hd->SetText(gHelpAbout);
5828 hd->Popup();
5829#endif
5830 }
5831 break;
5832
5833 default:
5834 break;
5835 }
5836 default:
5837 break;
5838 }
5839 default:
5840 break;
5841 }
5842
5843 return kTRUE;
5844}
@ 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
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:75
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:94
double Double_t
Definition RtypesCore.h:59
long long Long64_t
Definition RtypesCore.h:69
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
#define ClassImp(name)
Definition Rtypes.h:382
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:185
@ 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:406
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:2489
char * StrDup(const char *str)
Duplicate the string str.
Definition TString.cxx:2557
R__EXTERN TSystem * gSystem
Definition TSystem.h:561
#define gPad
#define gVirtualX
Definition TVirtualX.h:337
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:737
TVirtualPad * cd(Int_t subpadnumber=0) override
Set current canvas & pad.
Definition TCanvas.cxx:719
void Update() override
Update canvas pad buffers.
Definition TCanvas.cxx:2489
A chain is a collection of files containing TTree objects.
Definition TChain.h:33
static TClass * Class()
Long64_t GetReadEntry() const override
See TTree::GetReadEntry().
Definition TChain.cxx:1220
Long64_t GetEntries() const override
Return the total number of entries in the chain.
Definition TChain.cxx:978
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
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
~TEditQueryFrame() override
Delete query dialog.
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:147
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:381
void FreePicture(const TGPicture *pic)
Free picture resource.
Definition TGClient.cxx:317
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.
void SetFrame(TGFrame *frame, Bool_t left) override
Set frame to be resized.
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:59
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:400
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
Definition TList.cxx:576
void Add(TObject *obj) override
Definition TList.h:81
TObject * Remove(TObject *obj) override
Remove object from the list.
Definition TList.cxx:820
TObject * Last() const override
Return the last object in the list. Returns 0 when list is empty.
Definition TList.cxx:691
void Delete(Option_t *option="") override
Remove all objects from the list AND delete all heap based objects.
Definition TList.cxx:468
TObject * At(Int_t idx) const override
Returns the object at position idx. Returns 0 if idx is out of range.
Definition TList.cxx:355
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:456
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition TObject.cxx:798
virtual const char * GetTitle() const
Returns title of object.
Definition TObject.cxx:500
virtual TClass * IsA() const
Definition TObject.h:243
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:1249
void SetEditable(Bool_t mode=kTRUE) override
Set pad editable yes/no If a pad is not editable:
Definition TPad.cxx:6055
void Modified(Bool_t flag=true) override
Mark pad modified Will be repainted when TCanvas::Update() will be called next time.
Definition TPad.cxx:7388
void SetBorderMode(Short_t bordermode) override
Definition TPad.h:325
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
void Browse(TBrowser *b) override
Build the PROOF's structure in the browser.
Definition TProof.cxx:10179
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
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()
bool IsFinalized() const
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()
virtual UInt_t Integer(UInt_t imax)
Returns a random integer uniformly distributed on the interval [ 0, imax-1 ].
Definition TRandom.cxx:361
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 override
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
~TSessionFrame() override
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()
void RemoveAll() override
Remove all frames from composite frame.
TSessionInputFrame(TGWindow *parent, Int_t w, Int_t h)
Constructor.
~TSessionInputFrame() override
Destructor.
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.
~TSessionOutputFrame() override
Destructor.
TGLVContainer * fLVContainer
void Build(TSessionViewer *gui)
Build query output information frame.
void RemoveAll() override
Remove all frames from composite frame.
void OnElementDblClicked(TGLVEntry *entry, Int_t btn, Int_t x, Int_t y)
Handle double-clicks on list view items.
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.
~TSessionQueryFrame() override
Destructor.
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.
TGTextButton * fBtnAdd
TSessionServerFrame(TGWindow *parent, Int_t w, Int_t h)
Constructor.
TGTextButton * fBtnConnect
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Process messages for session server frame.
void OnBtnAddClicked()
Add newly created session configuration in the list of sessions.
void OnBtnDeleteClicked()
Delete selected session configuration (remove it from the list).
~TSessionServerFrame() override
Destructor.
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)
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
Bool_t HandleExpose(Event_t *event) override
Handle expose event in server frame.
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
void MyHandleMenu(Int_t)
Handle session viewer custom popup menus.
TSessionDescription * fActDesc
Bool_t HandleTimer(TTimer *) override
Handle animation timer.
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
TGPopupMenu * fSessionMenu
TSessionInputFrame * fInputFrame
Bool_t IsBusy() const
void CloseWindow() override
Close main Session Viewer window.
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
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
~TSessionViewer() override
Destructor.
void OnCascadeMenu()
Handle feedback histograms configuration menu.
const TGPicture * fLocal
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.
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t) override
Handle messages send to the TSessionViewer object.
void ResetSession()
Reset Proof session.
TGPicture * fRightIconPicture
Basic string class.
Definition TString.h:139
Ssiz_t Length() const
Definition TString.h:417
TString & Insert(Ssiz_t pos, const char *s)
Definition TString.h:661
const char * Data() const
Definition TString.h:376
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Definition TString.h:623
Bool_t IsNull() const
Definition TString.h:414
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:2378
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition TString.cxx:2356
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:632
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:1715
virtual TTime Now()
Get current time in milliseconds since 0:00 Jan 1 1995.
Definition TSystem.cxx:463
virtual Int_t Exec(const char *shellcmd)
Execute a command.
Definition TSystem.cxx:653
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:2458
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:1296
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
Definition TSystem.cxx:1063
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition TSystem.cxx:934
virtual const char * HostName()
Return the system's host name.
Definition TSystem.cxx:303
virtual const char * WorkingDirectory()
Return working directory.
Definition TSystem.cxx:871
virtual const char * HomeDirectory(const char *userName=nullptr)
Return the user's home directory.
Definition TSystem.cxx:887
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Definition TSystem.cxx:416
virtual int Unlink(const char *name)
Unlink, i.e.
Definition TSystem.cxx:1381
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
Definition TSystem.cxx:1601
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
Definition TSystem.cxx:1482
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:6295
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 TVirtualPad * cd(Int_t subpadnumber=0)=0
virtual TSelector * GetSelectorFromFile() const =0
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Event structure.
Definition GuiTypes.h:174
Int_t fCpus
Definition TSystem.h:152
TString fOS
Definition TSystem.h:149
const char * fPixmap
Definition TGToolBar.h:24
TString fRealName
Definition TSystem.h:142
TString fGroup
Definition TSystem.h:140
TMarker m
Definition textangle.C:8
auto * tt
Definition textangle.C:16