Logo ROOT  
Reference Guide
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// //
14// TSessionViewer //
15// //
16// Widget used to manage PROOF or local sessions, PROOF connections, //
17// queries construction and results handling. //
18// //
19//////////////////////////////////////////////////////////////////////////
20
21#include "TApplication.h"
22#include "TROOT.h"
23#include "THashList.h"
24#include "TClass.h"
25#include "TSystem.h"
26#include "TGFileDialog.h"
27#include "TBrowser.h"
28#include "TGButton.h"
29#include "TGLayout.h"
30#include "TGListTree.h"
31#include "TGCanvas.h"
32#include "TGLabel.h"
33#include "TGTextEntry.h"
34#include "TGNumberEntry.h"
35#include "TGTableLayout.h"
36#include "TGComboBox.h"
37#include "TGSplitter.h"
38#include "TGProgressBar.h"
39#include "TGListView.h"
40#include "TGMsgBox.h"
41#include "TGMenu.h"
42#include "TGStatusBar.h"
43#include "TGIcon.h"
44#include "TChain.h"
45#include "TDSet.h"
46#include "TFileInfo.h"
47#include "TObjString.h"
48#include "TProof.h"
49#include "TRandom.h"
50#include "TSessionViewer.h"
51#include "TSessionLogView.h"
52#include "TQueryResult.h"
53#include "TGTextView.h"
54#include "TGToolBar.h"
55#include "TGTab.h"
56#include "TRootEmbeddedCanvas.h"
57#include "TCanvas.h"
58#include "TGMimeTypes.h"
59#include "TInterpreter.h"
60#include "TContextMenu.h"
61#include "TG3DLine.h"
62#include "TSessionDialogs.h"
63#include "TEnv.h"
64#include "TH2.h"
65#include "TVirtualTreePlayer.h"
66#include "TSelector.h"
67#include "TFileCollection.h"
68#include "TVirtualX.h"
69#ifdef WIN32
70#include "TWin32SplashThread.h"
71#endif
72#include <stdlib.h>
73
75
76const char *kConfigFile = ".proofgui.conf";
77
86
87const char *xpm_names[] = {
88 "monitor01.xpm",
89 "monitor02.xpm",
90 "monitor03.xpm",
91 "monitor04.xpm",
92 0
93};
94
95const char *conftypes[] = {
96 "Config files", "*.conf",
97 "All files", "*.*",
98 0, 0
99};
100
101const char *pkgtypes[] = {
102 "Package files", "*.par",
103 "All files", "*.*",
104 0, 0
105};
106
107const char *macrotypes[] = {
108 "C files", "*.[C|c]*",
109 "All files", "*",
110 0, 0
111};
112
113
114const char *kFeedbackHistos[] = {
115 "PROOF_PacketsHist",
116 "PROOF_EventsHist",
117 "PROOF_NodeHist",
118 "PROOF_LatencyHist",
119 "PROOF_ProcTimeHist",
120 "PROOF_CpuTimeHist",
121 0
122};
123
124const char* const kSession_RedirectFile = ".templog";
125const char* const kSession_RedirectCmd = ".tempcmd";
126
127// Menu command id's
133
138
146
152
158
161
162const char *xpm_toolbar[] = {
163 "fileopen.xpm",
164 "filesaveas.xpm",
165 "",
166 "connect.xpm",
167 "disconnect.xpm",
168 "",
169 "query_new.xpm",
170 "query_submit.xpm",
171 "",
172 "about.xpm",
173 "",
174 "quit.xpm",
175 0
176};
177
179 { "", "Open Config File", kFALSE, kFileLoadConfig, 0 },
180 { "", "Save Config File", kFALSE, kFileSaveConfig, 0 },
181 { "", 0, 0, -1, 0 },
182 { "", "Connect", kFALSE, kSessionConnect, 0 },
183 { "", "Disconnect", kFALSE, kSessionDisconnect, 0 },
184 { "", 0, 0, -1, 0 },
185 { "", "New Query", kFALSE, kQueryNew, 0 },
186 { "", "Submit Query", kFALSE, kQuerySubmit, 0 },
187 { "", 0, 0, -1, 0 },
188 { "", "About Root", kFALSE, kHelpAbout, 0 },
189 { "", 0, 0, -1, 0 },
190 { "", "Exit Root", kFALSE, kFileQuit, 0 },
191 { 0, 0, 0, 0, 0 }
192};
193
194
195////////////////////////////////////////////////////////////////////////////////
196// Server Frame
197
198////////////////////////////////////////////////////////////////////////////////
199/// Constructor.
200
202 TGCompositeFrame(p, w, h), fFrmNewServer(0), fTxtName(0), fTxtAddress(0),
203 fNumPort(0), fLogLevel(0), fTxtConfig(0), fTxtUsrName(0), fSync(0),
204 fViewer(0), fBtnAdd(0), fBtnConnect(0)
205{
206}
207
208////////////////////////////////////////////////////////////////////////////////
209/// Destructor.
210
212{
213 Cleanup();
214}
215
216////////////////////////////////////////////////////////////////////////////////
217/// Build server configuration frame.
218
220{
222
224
225 fViewer = gui;
226 fFrmNewServer = new TGGroupFrame(this, "New Session");
228
230
232
233 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Session Name:"),
234 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
236 (const char *)0, 1), new TGLayoutHints());
238 fTxtName->Associate(this);
239 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Server name:"),
240 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
242 (const char *)0, 2), new TGLayoutHints());
244 fTxtAddress->Associate(this);
245 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Port (default: 1093):"),
246 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
250 fNumPort->Associate(this);
251 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Configuration File:"),
252 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
254 (const char *)0, 4), new TGLayoutHints());
256 fTxtConfig->Associate(this);
257 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Log Level:"),
258 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
259
264 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
265 fLogLevel->Associate(this);
266
267 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "User Name:"),
268 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
270 (const char *)0, 6), new TGLayoutHints());
272 fTxtUsrName->Associate(this);
273
274 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Process mode :"),
276 3, 3, 3, 3));
278 "&Synchronous"), new TGLayoutHints(kLHintsLeft | kLHintsBottom |
279 kLHintsExpandX, 3, 3, 3, 3));
280 fSync->SetToolTipText("Default Process Mode");
282
283 AddFrame(fBtnAdd = new TGTextButton(this, " Save "),
284 new TGLayoutHints(kLHintsTop | kLHintsCenterX, 5, 5, 15, 5));
285 fBtnAdd->SetToolTipText("Add server to the list");
286 fBtnAdd->Connect("Clicked()", "TSessionServerFrame", this,
287 "OnBtnAddClicked()");
288 AddFrame(fBtnConnect = new TGTextButton(this, " Connect "),
289 new TGLayoutHints(kLHintsTop | kLHintsCenterX, 5, 5, 15, 5));
290 fBtnConnect->Connect("Clicked()", "TSessionServerFrame", this,
291 "OnBtnConnectClicked()");
292 fBtnConnect->SetToolTipText("Connect to the selected server");
293
294 fTxtConfig->Connect("DoubleClicked()", "TSessionServerFrame", this,
295 "OnConfigFileClicked()");
296
297 fTxtName->Connect("TextChanged(char*)", "TSessionServerFrame", this,
298 "SettingsChanged()");
299 fTxtAddress->Connect("TextChanged(char*)", "TSessionServerFrame", this,
300 "SettingsChanged()");
301 fTxtConfig->Connect("TextChanged(char*)", "TSessionServerFrame", this,
302 "SettingsChanged()");
303 fTxtUsrName->Connect("TextChanged(char*)", "TSessionServerFrame", this,
304 "SettingsChanged()");
305 fSync->Connect("Clicked()", "TSessionServerFrame", this,
306 "SettingsChanged()");
307 fLogLevel->Connect("ValueChanged(Long_t)", "TSessionServerFrame", this,
308 "SettingsChanged()");
309 fLogLevel->Connect("ValueSet(Long_t)", "TSessionServerFrame", this,
310 "SettingsChanged()");
311 fNumPort->Connect("ValueChanged(Long_t)", "TSessionServerFrame", this,
312 "SettingsChanged()");
313 fNumPort->Connect("ValueSet(Long_t)", "TSessionServerFrame", this,
314 "SettingsChanged()");
315
316}
317
318////////////////////////////////////////////////////////////////////////////////
319/// Settings have changed, update GUI accordingly.
320
322{
323 TGTextEntry *sender = dynamic_cast<TGTextEntry*>((TQObject*)gTQSender);
324 Bool_t issync = (fSync->GetState() == kButtonDown);
325 if ((fViewer->GetActDesc()->fLocal) ||
326 (strcmp(fViewer->GetActDesc()->GetName(), fTxtName->GetText())) ||
327 (strcmp(fViewer->GetActDesc()->fAddress.Data(), fTxtAddress->GetText())) ||
328 (strcmp(fViewer->GetActDesc()->fConfigFile.Data(), fTxtConfig->GetText())) ||
329 (strcmp(fViewer->GetActDesc()->fUserName.Data(), fTxtUsrName->GetText())) ||
332 (fViewer->GetActDesc()->fSync != issync)) {
335 }
336 else {
339 }
340 if (sender) {
341 sender->SetFocus();
342 }
343}
344
345
346////////////////////////////////////////////////////////////////////////////////
347/// Handle expose event in server frame.
348
350{
351 //fTxtName->SelectAll();
352 //fTxtName->SetFocus();
353 return kTRUE;
354}
355
356////////////////////////////////////////////////////////////////////////////////
357/// Browse configuration files.
358
360{
361 // do nothing if connection in progress
362 if (fViewer->IsBusy())
363 return;
364 TGFileInfo fi;
367 if (!fi.fFilename) return;
369}
370
371////////////////////////////////////////////////////////////////////////////////
372/// Delete selected session configuration (remove it from the list).
373
375{
376 // do nothing if connection in progress
377 if (fViewer->IsBusy())
378 return;
380 TIter next(fViewer->GetSessions());
382
383 if (desc->fLocal) {
384 Int_t retval;
385 new TGMsgBox(fClient->GetRoot(), this, "Error Deleting Session",
386 "Deleting Local Sessions is not allowed !",
387 kMBIconExclamation,kMBOk,&retval);
388 return;
389 }
390 // ask for confirmation
391 TString m;
392 m.Form("Are you sure to delete the server \"%s\"",
393 desc->fName.Data());
394 Int_t result;
395 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), 0,
396 kMBOk | kMBCancel, &result);
397 // if confirmed, delete it
398 if (result == kMBOk) {
399 // remove the Proof session from gROOT list of Proofs
400 if (desc->fConnected && desc->fAttached && desc->fProof) {
401 desc->fProof->Detach("S");
402 }
403 // remove it from our sessions list
404 fViewer->GetSessions()->Remove((TObject *)desc);
405 // update configuration file
408
409 TObject *obj = fViewer->GetSessions()->Last();
411 fViewer->GetSessionItem(), (void *)obj);
412 if (item) {
419 fViewer->OnListTreeClicked(item, 1, 0, 0);
420 }
421 }
422 if (fViewer->IsAutoSave())
424}
425
426////////////////////////////////////////////////////////////////////////////////
427/// Connect to selected server.
428
430{
431 // do nothing if connection in progress
432 if (fViewer->IsBusy())
433 return;
434
437 }
438 else {
441 if (strlen(fTxtConfig->GetText()) > 1)
443 else
448 if (fViewer->IsAutoSave())
450 }
451 // set flag busy
452 fViewer->SetBusy();
453 // avoid input events in list tree while connecting
458 // set watch cursor to indicate connection in progress
460 gVirtualX->CreateCursor(kWatch));
461 gVirtualX->SetCursor(GetId(),gVirtualX->CreateCursor(kWatch));
462 // display connection progress bar in first part of status bar
464 // connect to proof startup message (to update progress bar)
465 TQObject::Connect("TProof", "StartupMessage(char *,Bool_t,Int_t,Int_t)",
466 "TSessionViewer", fViewer, "StartupMessage(char *,Bool_t,Int_t,Int_t)");
467 // collect and set-up configuration
468 TString address = fTxtAddress->GetText();
469 TString url;
470 if (address == "lite://") {
471 url = address;
472 }
473 else {
474 // collect and set-up configuration
475 url = fTxtUsrName->GetText();
476 url += "@"; url += address.Data();
477 if (fNumPort->GetIntNumber() > 0) {
478 url += ":";
479 url += fNumPort->GetIntNumber();
480 }
481 }
482
483 TProofDesc *desc;
485 if (!fViewer->GetActDesc()->fProofMgr ||
487 // hide connection progress bar from status bar
489 // release busy flag
491 // restore cursors and input
492 gVirtualX->SetCursor(GetId(), 0);
497 gVirtualX->SetCursor(fViewer->GetSessionHierarchy()->GetId(), 0);
498 return;
499 }
501 // check if the session already exist before to recreate it
502 TList *sessions = fViewer->GetActDesc()->fProofMgr->QuerySessions("");
503 if (sessions) {
504 TIter nextp(sessions);
505 // loop over existing Proof sessions
506 while ((desc = (TProofDesc *)nextp())) {
507 if ((desc->GetName() == fViewer->GetActDesc()->fTag) ||
508 (desc->GetTitle() == fViewer->GetActDesc()->fName)) {
511 fViewer->GetActDesc()->fTag = desc->GetName();
515
517 Int_t i = 0;
518 // browse list of feedback histos and check user's selected ones
519 while (kFeedbackHistos[i]) {
520 if (fViewer->GetCascadeMenu()->IsEntryChecked(41+i)) {
523 }
524 i++;
525 }
526 // connect feedback signal
527 fViewer->GetActDesc()->fProof->Connect("Feedback(TList *objs)",
528 "TSessionQueryFrame", fViewer->GetQueryFrame(),
529 "Feedback(TList *objs)");
530 gROOT->Time();
531 }
532 else {
533 // if feedback option not selected, clear Proof's feedback option
535 }
536
537 break;
538 }
539 }
540 }
541 if (fViewer->GetActDesc()->fProof == 0) {
542 if (fViewer->GetActDesc()->fProofMgr->IsValid()) {
545 desc = 0;
546 sessions = fViewer->GetActDesc()->fProofMgr->QuerySessions("");
547 if (sessions)
548 desc = (TProofDesc *)sessions->Last();
549 if (desc) {
551 fViewer->GetActDesc()->fTag = desc->GetName();
554 }
555 }
556 }
557 if (fViewer->GetActDesc()->fProof) {
562 if (fViewer->GetActDesc()->fLogLevel < 0)
564 if (fViewer->GetActDesc()->fProof->IsLite())
565 fViewer->GetActDesc()->fAddress = "lite://";
566 else
570 }
572
573 // check if connected and valid
574 if (fViewer->GetActDesc()->fProof &&
576 // set log level
578 // set query type (synch / asynch)
581 // set connected flag
583 // change list tree item picture to connected pixmap
586 if (item) {
588 // update viewer
589 fViewer->OnListTreeClicked(item, 1, 0, 0);
592 }
593 // connect to progress related signals
594 fViewer->GetActDesc()->fProof->Connect("Progress(Long64_t,Long64_t)",
595 "TSessionQueryFrame", fViewer->GetQueryFrame(),
596 "Progress(Long64_t,Long64_t)");
597 fViewer->GetActDesc()->fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
598 "TSessionQueryFrame", fViewer->GetQueryFrame(),
599 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
600 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)",
601 "TSessionQueryFrame", fViewer->GetQueryFrame(),
602 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
603 fViewer->GetActDesc()->fProof->Connect("StopProcess(Bool_t)",
604 "TSessionQueryFrame", fViewer->GetQueryFrame(),
605 "IndicateStop(Bool_t)");
607 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)",
608 "TSessionQueryFrame", fViewer->GetQueryFrame(),
609 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)");
610 // enable timer used for status bar icon's animation
612 // change status bar right icon to connected pixmap
613 fViewer->ChangeRightLogo("monitor01.xpm");
614 // do not animate yet
616 // connect to signal "query result ready"
617 fViewer->GetActDesc()->fProof->Connect("QueryResultReady(char *)",
618 "TSessionViewer", fViewer, "QueryResultReady(char *)");
619 // display connection information on status bar
620 TString msg;
621 msg.Form("PROOF Cluster %s ready", fViewer->GetActDesc()->fName.Data());
622 fViewer->GetStatusBar()->SetText(msg.Data(), 1);
626 // Enable previously uploaded packages if in auto-enable mode
628 TPackageDescription *package;
630 while ((package = (TPackageDescription *)next())) {
631 if (!package->fEnabled) {
632 if (fViewer->GetActDesc()->fProof->EnablePackage(package->fName) != 0)
633 Error("Submit", "Enable package failed");
634 else {
635 package->fEnabled = kTRUE;
637 }
638 }
639 }
640 }
641 }
642 // hide connection progress bar from status bar
644 // release busy flag
646 // restore cursors and input
647 gVirtualX->SetCursor(GetId(), 0);
652 gVirtualX->SetCursor(fViewer->GetSessionHierarchy()->GetId(), 0);
653}
654
655////////////////////////////////////////////////////////////////////////////////
656/// Reset server configuration fields.
657
659{
660 // do nothing if connection in progress
661 if (fViewer->IsBusy())
662 return;
670 fTxtName->SetText("");
671 fTxtAddress->SetText("");
672 fTxtConfig->SetText("");
673 fNumPort->SetIntNumber(1093);
675 fTxtUsrName->SetText("");
676}
677
678////////////////////////////////////////////////////////////////////////////////
679/// Add newly created session configuration in the list of sessions.
680
682{
683 Int_t retval;
684 Bool_t newSession = kTRUE;
685 TSessionDescription* desc = 0;
686 // do nothing if connection in progress
687 if (fViewer->IsBusy())
688 return;
689
690 if ((!fTxtName->GetBuffer()->GetTextLength()) ||
693 new TGMsgBox(fClient->GetRoot(), fViewer, "Error Adding Session",
694 "At least one required field is empty !",
695 kMBIconExclamation, kMBOk, &retval);
696 return;
697 }
699 if (obj)
700 desc = dynamic_cast<TSessionDescription*>(obj);
701 if (desc) {
702 new TGMsgBox(fClient->GetRoot(), fViewer, "Adding Session",
703 TString::Format("The session \"%s\" already exists ! Overwrite ?",
705 kMBCancel, &retval);
706 if (retval != kMBYes)
707 return;
708 newSession = kFALSE;
709 }
710 if (newSession) {
711 desc = new TSessionDescription();
712 desc->fName = fTxtName->GetText();
713 desc->fTag = "";
714 desc->fQueries = new TList();
715 desc->fPackages = new TList();
716 desc->fActQuery = 0;
717 desc->fProof = 0;
718 desc->fProofMgr = 0;
719 desc->fAutoEnable = kFALSE;
720 desc->fAddress = fTxtAddress->GetText();
721 desc->fPort = fNumPort->GetIntNumber();
722 desc->fConnected = kFALSE;
723 desc->fAttached = kFALSE;
724 desc->fLocal = kFALSE;
725 if (strlen(fTxtConfig->GetText()) > 1)
727 else
728 desc->fConfigFile = "";
730 desc->fUserName = fTxtUsrName->GetText();
731 desc->fSync = (fSync->GetState() == kButtonDown);
732 // add newly created session config to our session list
733 fViewer->GetSessions()->Add((TObject *)desc);
734 // save into configuration file
736 fViewer->GetSessionItem(), desc->fName.Data(),
738 fViewer->GetSessionHierarchy()->SetToolTipItem(item, "Proof Session");
739 item->SetUserData(desc);
747 fViewer->OnListTreeClicked(item, 1, 0, 0);
748 }
749 else {
753 if (strlen(fTxtConfig->GetText()) > 1)
759 item2->SetUserData(fViewer->GetActDesc());
761 1, 0, 0);
762 }
765 if (fViewer->IsAutoSave())
767}
768
769////////////////////////////////////////////////////////////////////////////////
770/// Update fields with values from session description desc.
771
773{
774 if (desc->fLocal) {
775 fTxtName->SetText("");
776 fTxtAddress->SetText("");
777 fNumPort->SetIntNumber(1093);
778 fTxtConfig->SetText("");
779 fTxtUsrName->SetText("");
781 return;
782 }
783
784 fTxtName->SetText(desc->fName);
788
789 if (desc->fConfigFile.Length() > 1) {
791 }
792 else {
793 fTxtConfig->SetText("");
794 }
796}
797
798////////////////////////////////////////////////////////////////////////////////
799/// Process messages for session server frame.
800/// Used to navigate between text entry fields.
801
803{
804 switch (GET_MSG(msg)) {
805 case kC_TEXTENTRY:
806 switch (GET_SUBMSG(msg)) {
807 case kTE_ENTER:
808 case kTE_TAB:
809 switch (parm1) {
810 case 1: // session name
813 break;
814 case 2: // server address
817 break;
818 case 3: // port number
821 break;
822 case 4: // configuration file
825 break;
826 case 5: // log level
829 break;
830 case 6: // user name
833 break;
834 }
835 break;
836
837 default:
838 break;
839 }
840 break;
841
842 default:
843 break;
844 }
845 return kTRUE;
846}
847
848////////////////////////////////////////////////////////////////////////////////
849// Session Frame
850
851////////////////////////////////////////////////////////////////////////////////
852/// Constructor.
853
855 TGCompositeFrame(p, w, h), fTab(0), fFA(0), fFB(0), fFC(0), fFD(0), fFE(0),
856 fCommandTxt(0), fCommandBuf(0), fInfoTextView(0), fClearCheck(0),
857 fBtnShowLog(0), fBtnNewQuery(0), fBtnGetQueries(0), fLBPackages(0),
858 fBtnAdd(0), fBtnRemove(0), fBtnUp(0), fBtnDown(0), fBtnShow(0),
859 fBtnShowEnabled(0), fChkMulti(0), fChkEnable(0), fBtnUpload(0),
860 fBtnEnable(0), fBtnClear(0), fBtnDisable(0), fDSetView(0), fDataSetTree(0),
861 fBtnUploadDSet(0), fBtnRemoveDSet(0), fBtnVerifyDSet(0), fBtnRefresh(0),
862 fTxtParallel(0), fLogLevel(0), fApplyLogLevel(0), fApplyParallel(0),
863 fViewer(0)
864{
865 for (int i=0;i<19;++i) fInfoLine[i] = 0;
866}
867
868////////////////////////////////////////////////////////////////////////////////
869/// Destructor.
870
872{
873 Cleanup();
874}
875
876////////////////////////////////////////////////////////////////////////////////
877/// Build session frame.
878
880{
883 fViewer = gui;
884 Int_t i,j;
885
886 // main session tab
887 fTab = new TGTab(this, 200, 200);
889 kLHintsExpandY, 2, 2, 2, 2));
890
891 // add "Status" tab element
892 TGCompositeFrame *tf = fTab->AddTab("Status");
893 fFA = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
896
897 // add first session information line
898 fInfoLine[0] = new TGLabel(fFA, " ");
900 kLHintsExpandX, 5, 5, 15, 5));
901
902 TGCompositeFrame* frmInfos = new TGHorizontalFrame(fFA, 350, 100);
903 frmInfos->SetLayoutManager(new TGTableLayout(frmInfos, 9, 2));
904
905 // add session information lines
906 j = 0;
907 for (i=0;i<17;i+=2) {
908 fInfoLine[i+1] = new TGLabel(frmInfos, " ");
909 frmInfos->AddFrame(fInfoLine[i+1], new TGTableLayoutHints(0, 1, j, j+1,
910 kLHintsLeft | kLHintsCenterY, 5, 5, 2, 2));
911 fInfoLine[i+2] = new TGLabel(frmInfos, " ");
912 frmInfos->AddFrame(fInfoLine[i+2], new TGTableLayoutHints(1, 2, j, j+1,
913 kLHintsLeft | kLHintsCenterY, 5, 5, 2, 2));
914 j++;
915 }
917 kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5));
918
919 // add "new query" and "get queries" buttons
920 TGCompositeFrame* frmBut1 = new TGHorizontalFrame(fFA, 350, 100);
921 frmBut1->SetCleanup(kDeepCleanup);
922 frmBut1->AddFrame(fBtnNewQuery = new TGTextButton(frmBut1, "New Query..."),
923 new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5));
924 fBtnNewQuery->SetToolTipText("Open New Query Dialog");
925 frmBut1->AddFrame(fBtnGetQueries = new TGTextButton(frmBut1, " Get Queries "),
926 new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5));
927 fBtnGetQueries->SetToolTipText("Get List of Queries from the server");
928 fBtnShowLog = new TGTextButton(frmBut1, "Show log...");
929 fBtnShowLog->SetToolTipText("Show Session log (opens log window)");
931 kLHintsExpandX, 5, 5, 5, 5));
934
935 // add "Commands" tab element
936 tf = fTab->AddTab("Commands");
937 fFC = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
940
941 // add command line label and text entry
942 TGCompositeFrame* frmCmd = new TGHorizontalFrame(fFC, 350, 100);
943 frmCmd->SetCleanup(kDeepCleanup);
944 frmCmd->AddFrame(new TGLabel(frmCmd, "Command Line :"),
945 new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 5, 5, 15, 5));
946 fCommandBuf = new TGTextBuffer(120);
947 frmCmd->AddFrame(fCommandTxt = new TGTextEntry(frmCmd,
949 kLHintsExpandX, 5, 5, 15, 5));
950 fFC->AddFrame(frmCmd, new TGLayoutHints(kLHintsExpandX, 5, 5, 10, 5));
951 // connect command line text entry to "return pressed" signal
952 fCommandTxt->Connect("ReturnPressed()", "TSessionFrame", this,
953 "OnCommandLine()");
954
955 // check box for option "clear view"
956 fClearCheck = new TGCheckButton(fFC, "Clear view after each command");
958 10, 5, 5, 5));
960 // add text view for redirected output
961 fFC->AddFrame(new TGLabel(fFC, "Output :"),
962 new TGLayoutHints(kLHintsLeft | kLHintsTop, 10, 5, 5, 5));
963 fInfoTextView = new TGTextView(fFC, 330, 150, "", kSunkenFrame |
966 kLHintsTop | kLHintsExpandX | kLHintsExpandY, 10, 10, 5, 5));
967
968 // add "Packages" tab element
969 tf = fTab->AddTab("Packages");
970 fFB = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
973
974 // new frame containing packages listbox and control buttons
975 TGCompositeFrame* frmcanvas = new TGHorizontalFrame(fFB, 350, 100);
976
977 // packages listbox
978 fLBPackages = new TGListBox(frmcanvas);
979 fLBPackages->Resize(80,150);
982 kLHintsExpandY, 5, 5, 5, 5));
983 // control buttons frame
984 TGCompositeFrame* frmBut2 = new TGVerticalFrame(frmcanvas, 150, 100);
985
986 fChkMulti = new TGCheckButton(frmBut2, "Multiple Selection");
987 fChkMulti->SetToolTipText("Enable multiple selection in the package list");
988 frmBut2->AddFrame(fChkMulti, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
989
990 fBtnAdd = new TGTextButton(frmBut2, " Add... ");
991 fBtnAdd->SetToolTipText("Add a package to the list");
993 kLHintsExpandX, 5, 5, 5, 5));
994 fBtnRemove = new TGTextButton(frmBut2, "Remove");
995 fBtnRemove->SetToolTipText("Remove package from the list");
997 kLHintsExpandX, 5, 5, 5, 5));
998 fBtnUp = new TGTextButton(frmBut2, "Move Up");
999 fBtnUp->SetToolTipText("Move package one step upward in the list");
1001 kLHintsExpandX, 5, 5, 5, 5));
1002 fBtnDown = new TGTextButton(frmBut2, "Move Down");
1003 fBtnDown->SetToolTipText("Move package one step downward in the list");
1005 kLHintsExpandX, 5, 5, 5, 5));
1006 frmcanvas->AddFrame(frmBut2, new TGLayoutHints(kLHintsLeft | kLHintsCenterY |
1008 fFB->AddFrame(frmcanvas, new TGLayoutHints(kLHintsLeft | kLHintsTop |
1010
1011 TGCompositeFrame* frmLeg = new TGHorizontalFrame(fFB, 300, 100);
1012 frmLeg->SetCleanup(kDeepCleanup);
1013 TGPicture *pic1 = (TGPicture *)fClient->GetPicture("package.xpm");
1014 TGIcon *icn1 = new TGIcon(frmLeg, pic1, pic1->GetWidth(), pic1->GetHeight());
1015 frmLeg->AddFrame(icn1, new TGLayoutHints(kLHintsLeft | kLHintsTop,
1016 5, 5, 0, 5));
1017 frmLeg->AddFrame(new TGLabel(frmLeg, ": Local"),
1018 new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 10, 0, 5));
1019
1020 TGPicture *pic2 = (TGPicture *)fClient->GetPicture("package_delete.xpm");
1021 TGIcon *icn2 = new TGIcon(frmLeg, pic2, pic2->GetWidth(), pic2->GetHeight());
1022 frmLeg->AddFrame(icn2, new TGLayoutHints(kLHintsLeft | kLHintsTop,
1023 5, 5, 0, 5));
1024 frmLeg->AddFrame(new TGLabel(frmLeg, ": Uploaded"),
1025 new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 10, 0, 5));
1026
1027 TGPicture *pic3 = (TGPicture *)fClient->GetPicture("package_add.xpm");
1028 TGIcon *icn3 = new TGIcon(frmLeg, pic3, pic3->GetWidth(), pic3->GetHeight());
1029 frmLeg->AddFrame(icn3, new TGLayoutHints(kLHintsLeft | kLHintsTop,
1030 5, 5, 0, 5));
1031 frmLeg->AddFrame(new TGLabel(frmLeg, ": Enabled"),
1032 new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 10, 0, 5));
1034 kLHintsExpandX, 0, 0, 0, 0));
1035
1036 TGCompositeFrame* frmBtn = new TGHorizontalFrame(fFB, 300, 100);
1037 frmBtn->SetCleanup(kDeepCleanup);
1038 frmBtn->AddFrame(fBtnUpload = new TGTextButton(frmBtn,
1039 " Upload "), new TGLayoutHints(kLHintsLeft | kLHintsExpandX |
1040 kLHintsCenterY, 5, 5, 5, 5));
1041 fBtnUpload->SetToolTipText("Upload selected package(s) to the server");
1042 frmBtn->AddFrame(fBtnEnable = new TGTextButton(frmBtn,
1043 " Enable "), new TGLayoutHints(kLHintsLeft | kLHintsExpandX |
1044 kLHintsCenterY, 5, 5, 5, 5));
1045 fBtnEnable->SetToolTipText("Enable selected package(s) on the server");
1046 frmBtn->AddFrame(fBtnDisable = new TGTextButton(frmBtn,
1047 " Disable "), new TGLayoutHints(kLHintsLeft | kLHintsExpandX |
1048 kLHintsCenterY, 5, 5, 5, 5));
1049 fBtnDisable->SetToolTipText("Disable selected package(s) on the server");
1050 frmBtn->AddFrame(fBtnClear = new TGTextButton(frmBtn,
1051 " Clear "), new TGLayoutHints(kLHintsLeft | kLHintsExpandX |
1052 kLHintsCenterY, 5, 5, 5, 5));
1053 fBtnClear->SetToolTipText("Clear all packages on the server");
1054 fFB->AddFrame(frmBtn, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
1055
1057
1058 TGCompositeFrame* frmBtn3 = new TGHorizontalFrame(fFB, 300, 100);
1059 frmBtn3->SetCleanup(kDeepCleanup);
1060 fBtnShow = new TGTextButton(frmBtn3, "Show packages");
1061 fBtnShow->SetToolTipText("Show (list) available packages on the server");
1063 kLHintsExpandX, 5, 5, 5, 5));
1064 fBtnShowEnabled = new TGTextButton(frmBtn3, "Show Enabled");
1065 fBtnShowEnabled->SetToolTipText("Show (list) enabled packages on the server");
1067 kLHintsExpandX, 5, 5, 5, 5));
1068 fFB->AddFrame(frmBtn3, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
1069
1070 fChkEnable = new TGCheckButton(fFB, "Enable at session startup");
1071 fChkEnable->SetToolTipText("Enable packages on the server at startup time");
1072 fFB->AddFrame(fChkEnable, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
1073
1074 // add "DataSets" tab element
1075 tf = fTab->AddTab("DataSets");
1076 fFE = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
1079
1080 // new frame containing datasets treeview and control buttons
1081 TGCompositeFrame* frmdataset = new TGHorizontalFrame(fFE, 350, 100);
1082
1083 // datasets list tree
1084 fDSetView = new TGCanvas(frmdataset, 200, 200, kSunkenFrame | kDoubleBorder);
1086 5, 5, 5, 5));
1088 fDataSetTree->AddItem(0, "DataSets");
1089
1090 // control buttons frame
1091 TGCompositeFrame* frmBut3 = new TGVerticalFrame(frmdataset, 150, 100);
1092
1093 fBtnUploadDSet = new TGTextButton(frmBut3, " Upload... ");
1094 fBtnUploadDSet->SetToolTipText("Upload a dataset to the cluster");
1096 kLHintsExpandX, 5, 5, 5, 5));
1097 fBtnRemoveDSet = new TGTextButton(frmBut3, "Remove");
1098 fBtnRemoveDSet->SetToolTipText("Remove dataset from the cluster");
1100 kLHintsExpandX, 5, 5, 5, 5));
1101 fBtnVerifyDSet = new TGTextButton(frmBut3, "Verify");
1102 fBtnVerifyDSet->SetToolTipText("Verify dataset on the cluster");
1104 kLHintsExpandX, 5, 5, 5, 5));
1105 fBtnRefresh = new TGTextButton(frmBut3, "Refresh List");
1106 fBtnRefresh->SetToolTipText("Refresh List of DataSet/Files present on the cluster");
1108 kLHintsExpandX, 5, 5, 15, 5));
1109
1110 frmdataset->AddFrame(frmBut3, new TGLayoutHints(kLHintsLeft | kLHintsCenterY |
1111 kLHintsExpandY, 5, 5, 5, 0));
1112
1113 fFE->AddFrame(frmdataset, new TGLayoutHints(kLHintsLeft | kLHintsTop |
1115
1116 // add "Options" tab element
1117 tf = fTab->AddTab("Options");
1118 fFD = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
1121
1122 // add Log Level label and text entry
1123 TGCompositeFrame* frmLog = new TGHorizontalFrame(fFD, 310, 100, kFixedWidth);
1124 frmLog->SetCleanup(kDeepCleanup);
1125 frmLog->AddFrame(fApplyLogLevel = new TGTextButton(frmLog,
1126 " Apply "), new TGLayoutHints(kLHintsRight |
1127 kLHintsCenterY, 10, 5, 5, 5));
1128 fApplyLogLevel->SetToolTipText("Apply currently selected log level");
1132 kLHintsCenterY, 5, 5, 5, 5));
1133 frmLog->AddFrame(new TGLabel(frmLog, "Log Level :"),
1134 new TGLayoutHints(kLHintsRight | kLHintsCenterY, 5, 5, 5, 5));
1135 fFD->AddFrame(frmLog, new TGLayoutHints(kLHintsLeft, 5, 5, 15, 5));
1136
1137 // add Parallel Nodes label and text entry
1138 TGCompositeFrame* frmPar = new TGHorizontalFrame(fFD, 310, 100, kFixedWidth);
1139 frmPar->SetCleanup(kDeepCleanup);
1140 frmPar->AddFrame(fApplyParallel = new TGTextButton(frmPar,
1141 " Apply "), new TGLayoutHints(kLHintsRight |
1142 kLHintsCenterY, 10, 5, 5, 5));
1143 fApplyParallel->SetToolTipText("Apply currently selected parallel nodes");
1144 fTxtParallel = new TGTextEntry(frmPar);
1146 fTxtParallel->SetText("99999");
1149 kLHintsCenterY, 5, 5, 5, 5));
1150 frmPar->AddFrame(new TGLabel(frmPar, "Set Parallel Nodes :"),
1151 new TGLayoutHints(kLHintsRight | kLHintsCenterY, 5, 5, 5, 5));
1152 fFD->AddFrame(frmPar, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
1153
1154 // connect button actions to functions
1155 fBtnShowLog->Connect("Clicked()", "TSessionFrame", this,
1156 "OnBtnShowLogClicked()");
1157 fBtnNewQuery->Connect("Clicked()", "TSessionFrame", this,
1158 "OnBtnNewQueryClicked()");
1159 fBtnGetQueries->Connect("Clicked()", "TSessionFrame", this,
1160 "OnBtnGetQueriesClicked()");
1161
1162 fChkEnable->Connect("Toggled(Bool_t)", "TSessionFrame", this,
1163 "OnStartupEnable(Bool_t)");
1164 fChkMulti->Connect("Toggled(Bool_t)", "TSessionFrame", this,
1165 "OnMultipleSelection(Bool_t)");
1166 fBtnAdd->Connect("Clicked()", "TSessionFrame", this,
1167 "OnBtnAddClicked()");
1168 fBtnRemove->Connect("Clicked()", "TSessionFrame", this,
1169 "OnBtnRemoveClicked()");
1170 fBtnUp->Connect("Clicked()", "TSessionFrame", this,
1171 "OnBtnUpClicked()");
1172 fBtnDown->Connect("Clicked()", "TSessionFrame", this,
1173 "OnBtnDownClicked()");
1174 fApplyLogLevel->Connect("Clicked()", "TSessionFrame", this,
1175 "OnApplyLogLevel()");
1176 fApplyParallel->Connect("Clicked()", "TSessionFrame", this,
1177 "OnApplyParallel()");
1178 fBtnUpload->Connect("Clicked()", "TSessionFrame", this,
1179 "OnUploadPackages()");
1180 fBtnEnable->Connect("Clicked()", "TSessionFrame", this,
1181 "OnEnablePackages()");
1182 fBtnDisable->Connect("Clicked()", "TSessionFrame", this,
1183 "OnDisablePackages()");
1184 fBtnClear->Connect("Clicked()", "TSessionFrame", this,
1185 "OnClearPackages()");
1186 fBtnShowEnabled->Connect("Clicked()", "TSessionViewer", fViewer,
1187 "ShowEnabledPackages()");
1188 fBtnShow->Connect("Clicked()", "TSessionViewer", fViewer,
1189 "ShowPackages()");
1190
1191 fBtnUploadDSet->Connect("Clicked()", "TSessionFrame", this,
1192 "OnBtnUploadDSet()");
1193 fBtnRemoveDSet->Connect("Clicked()", "TSessionFrame", this,
1194 "OnBtnRemoveDSet()");
1195 fBtnVerifyDSet->Connect("Clicked()", "TSessionFrame", this,
1196 "OnBtnVerifyDSet()");
1197 fBtnRefresh->Connect("Clicked()", "TSessionFrame", this,
1198 "UpdateListOfDataSets()");
1199}
1200
1201////////////////////////////////////////////////////////////////////////////////
1202/// Display information on current session.
1203
1205{
1206 TString buf;
1207
1208 // if local session
1209 if (fViewer->GetActDesc()->fLocal) {
1210 buf.Form("*** Local Session on %s ***", gSystem->HostName());
1211 fInfoLine[0]->SetText(buf.Data());
1212 UserGroup_t *userGroup = gSystem->GetUserInfo();
1213 fInfoLine[1]->SetText("User :");
1214 if (userGroup) buf.Form("%s", userGroup->fRealName.Data());
1215 fInfoLine[2]->SetText(buf.Data());
1216 fInfoLine[3]->SetText("Working directory :");
1217 buf.Form("%s", gSystem->WorkingDirectory());
1218 fInfoLine[4]->SetText(buf.Data());
1219 fInfoLine[5]->SetText(" ");
1220 fInfoLine[6]->SetText(" ");
1221 fInfoLine[7]->SetText(" ");
1222 fInfoLine[8]->SetText(" ");
1223 fInfoLine[9]->SetText(" ");
1224 fInfoLine[10]->SetText(" ");
1225 fInfoLine[11]->SetText(" ");
1226 fInfoLine[12]->SetText(" ");
1227 fInfoLine[13]->SetText(" ");
1228 fInfoLine[14]->SetText(" ");
1229 fInfoLine[15]->SetText(" ");
1230 fInfoLine[16]->SetText(" ");
1231 fInfoLine[17]->SetText(" ");
1232 fInfoLine[18]->SetText(" ");
1233 if (userGroup) delete userGroup;
1234 Layout();
1236 return;
1237 }
1238 // return if not a valid Proof session
1239 if (!fViewer->GetActDesc()->fConnected ||
1241 !fViewer->GetActDesc()->fProof ||
1243 return;
1244
1245 if (!fViewer->GetActDesc()->fProof->IsMaster()) {
1247 buf.Form("*** Connected to %s (parallel mode, %d workers) ***",
1250 else
1251 buf.Form("*** Connected to %s (sequential mode) ***",
1253 fInfoLine[0]->SetText(buf.Data());
1254 fInfoLine[1]->SetText("Port number : ");
1255 buf.Form("%d", fViewer->GetActDesc()->fProof->GetPort());
1256 fInfoLine[2]->SetText(buf.Data());
1257 fInfoLine[3]->SetText("User : ");
1258 buf.Form("%s", fViewer->GetActDesc()->fProof->GetUser());
1259 fInfoLine[4]->SetText(buf.Data());
1260 fInfoLine[5]->SetText("Client protocol version : ");
1262 fInfoLine[6]->SetText(buf.Data());
1263 fInfoLine[7]->SetText("Remote protocol version : ");
1265 fInfoLine[8]->SetText(buf.Data());
1266 fInfoLine[9]->SetText("Log level : ");
1267 buf.Form("%d", fViewer->GetActDesc()->fProof->GetLogLevel());
1268 fInfoLine[10]->SetText(buf.Data());
1269 fInfoLine[11]->SetText("Session unique tag : ");
1270 buf.Form("%s", fViewer->GetActDesc()->fProof->IsValid() ?
1271 fViewer->GetActDesc()->fProof->GetSessionTag() : " ");
1272 fInfoLine[12]->SetText(buf.Data());
1273 fInfoLine[13]->SetText("Total MB's processed :");
1274 buf.Form("%.2f", float(fViewer->GetActDesc()->fProof->GetBytesRead())/(1024*1024));
1275 fInfoLine[14]->SetText(buf.Data());
1276 fInfoLine[15]->SetText("Total real time used (s) :");
1277 buf.Form("%.3f", fViewer->GetActDesc()->fProof->GetRealTime());
1278 fInfoLine[16]->SetText(buf.Data());
1279 fInfoLine[17]->SetText("Total CPU time used (s) :");
1280 buf.Form("%.3f", fViewer->GetActDesc()->fProof->GetCpuTime());
1281 fInfoLine[18]->SetText(buf.Data());
1282 }
1283 else {
1285 buf.Form("*** Master server %s (parallel mode, %d workers) ***",
1288 else
1289 buf.Form("*** Master server %s (sequential mode) ***",
1291 fInfoLine[0]->SetText(buf.Data());
1292 fInfoLine[1]->SetText("Port number : ");
1293 buf.Form("%d", fViewer->GetActDesc()->fProof->GetPort());
1294 fInfoLine[2]->SetText(buf.Data());
1295 fInfoLine[3]->SetText("User : ");
1296 buf.Form("%s", fViewer->GetActDesc()->fProof->GetUser());
1297 fInfoLine[4]->SetText(buf.Data());
1298 fInfoLine[5]->SetText("Protocol version : ");
1300 fInfoLine[6]->SetText(buf.Data());
1301 fInfoLine[7]->SetText("Image name : ");
1302 buf.Form("%s",fViewer->GetActDesc()->fProof->GetImage());
1303 fInfoLine[8]->SetText(buf.Data());
1304 fInfoLine[9]->SetText("Config directory : ");
1305 buf.Form("%s", fViewer->GetActDesc()->fProof->GetConfDir());
1306 fInfoLine[10]->SetText(buf.Data());
1307 fInfoLine[11]->SetText("Config file : ");
1308 buf.Form("%s", fViewer->GetActDesc()->fProof->GetConfFile());
1309 fInfoLine[12]->SetText(buf.Data());
1310 fInfoLine[13]->SetText("Total MB's processed :");
1311 buf.Form("%.2f", float(fViewer->GetActDesc()->fProof->GetBytesRead())/(1024*1024));
1312 fInfoLine[14]->SetText(buf.Data());
1313 fInfoLine[15]->SetText("Total real time used (s) :");
1314 buf.Form("%.3f", fViewer->GetActDesc()->fProof->GetRealTime());
1315 fInfoLine[16]->SetText(buf.Data());
1316 fInfoLine[17]->SetText("Total CPU time used (s) :");
1317 buf.Form("%.3f", fViewer->GetActDesc()->fProof->GetCpuTime());
1318 fInfoLine[18]->SetText(buf.Data());
1319 }
1320 Layout();
1322}
1323
1324////////////////////////////////////////////////////////////////////////////////
1325/// Open Upload Dataset dialog.
1326
1328{
1329 if (fViewer->IsBusy())
1330 return;
1331 if (fViewer->GetActDesc()->fLocal) return;
1332 new TUploadDataSetDlg(fViewer, 450, 360);
1333}
1334
1335////////////////////////////////////////////////////////////////////////////////
1336/// Update list of dataset present on the cluster.
1337
1339{
1340 TObjString *dsetname;
1341 TFileInfo *dsetfilename;
1342 // cleanup the list
1347
1348 const TGPicture *dseticon = fClient->GetPicture("rootdb_t.xpm");
1349 // ask for the list of datasets
1350
1351 // TODO: is now returning a TMap; viewer has to be adapted
1352 TList *dsetlist = 0; //fViewer->GetActDesc()->fProof->GetDataSets();
1353 // coverity[dead_error_condition]: to be changed for TMap usage
1354 if (dsetlist) {
1355 TGListTreeItem *dsetitem;
1357 TIter nextdset(dsetlist);
1358 while ((dsetname = (TObjString *)nextdset())) {
1360 // add the dataset in the tree
1362 dsetname->GetName(), dsetname);
1363 // ask for the list of files in the dataset
1364 TList *dsetfilelist = fViewer->GetActDesc()->fProof->GetDataSet(
1365 dsetname->GetName())->GetList();
1366 if(dsetfilelist) {
1367 TIter nextdsetfile(dsetfilelist);
1368 while ((dsetfilename = (TFileInfo *)nextdsetfile())) {
1369 if (! fDataSetTree->FindItemByObj(dsetitem, dsetfilename)) {
1370 // if not already in, add the file name in the tree
1371 fDataSetTree->AddItem(dsetitem,
1372 dsetfilename->GetFirstUrl()->GetUrl(),
1373 dsetfilename, dseticon, dseticon);
1374 }
1375 }
1376 // open the dataset item in order to show the files
1377 fDataSetTree->OpenItem(dsetitem);
1378 }
1379 }
1380 }
1381 }
1382 }
1383 // refresh list tree
1385}
1386
1387////////////////////////////////////////////////////////////////////////////////
1388/// Remove dataset from the list and from the cluster.
1389
1391{
1392 TGListTreeItem *item;
1393 TObjString *obj = 0;
1394 if (fViewer->GetActDesc()->fLocal) return;
1395
1396 item = fDataSetTree->GetSelected();
1397 if (!item) return;
1398 if (item->GetParent() == 0) return;
1399 if (item->GetParent() == fDataSetTree->GetFirstItem()) {
1400 // Dataset itself
1401 obj = (TObjString *)item->GetUserData();
1402 }
1403 else if (item->GetParent()->GetParent() == fDataSetTree->GetFirstItem()) {
1404 // One file of the dataset
1405 obj = (TObjString *)item->GetParent()->GetUserData();
1406 }
1407
1408 // if valid Proof session, set parallel slaves
1409 if (obj && fViewer->GetActDesc()->fProof &&
1413 }
1414}
1415
1416////////////////////////////////////////////////////////////////////////////////
1417/// Verify that the files in the selected dataset are present on the cluster.
1418
1420{
1421 TGListTreeItem *item;
1422 TObjString *obj = 0;
1423 if (fViewer->GetActDesc()->fLocal) return;
1424
1425 item = fDataSetTree->GetSelected();
1426 if (!item) return;
1427 if (item->GetParent() == 0) return;
1428 if (item->GetParent() == fDataSetTree->GetFirstItem()) {
1429 // Dataset itself
1430 obj = (TObjString *)item->GetUserData();
1431 }
1432 else if (item->GetParent()->GetParent() == fDataSetTree->GetFirstItem()) {
1433 // One file of the dataset
1434 obj = (TObjString *)item->GetParent()->GetUserData();
1435 }
1436
1437 // if valid Proof session, set parallel slaves
1438 if (obj && fViewer->GetActDesc()->fProof &&
1441 }
1442}
1443
1444////////////////////////////////////////////////////////////////////////////////
1445/// Apply selected log level on current session.
1446
1448{
1449 // if local session, do nothing
1450 if (fViewer->GetActDesc()->fLocal) return;
1451 // if valid Proof session, set log level
1452 if (fViewer->GetActDesc()->fProof &&
1456 }
1458}
1459
1460////////////////////////////////////////////////////////////////////////////////
1461/// Apply selected number of workers on current Proof session.
1462
1464{
1465 // if local session, do nothing
1466 if (fViewer->GetActDesc()->fLocal) return;
1467 // if valid Proof session, set parallel slaves
1468 if (fViewer->GetActDesc()->fProof &&
1470 Int_t nodes = atoi(fTxtParallel->GetText());
1472 }
1474}
1475
1476////////////////////////////////////////////////////////////////////////////////
1477/// Handle multiple selection check button.
1478
1480{
1482}
1483
1484////////////////////////////////////////////////////////////////////////////////
1485/// Handle multiple selection check button.
1486
1488{
1489 if (fViewer->GetActDesc())
1491}
1492
1493////////////////////////////////////////////////////////////////////////////////
1494/// Update list of packages.
1495
1497{
1498 TPackageDescription *package;
1499 const TGPicture *pict;
1502 while ((package = (TPackageDescription *)next())) {
1503 if (package->fEnabled)
1504 pict = fClient->GetPicture("package_add.xpm");
1505 else if (package->fUploaded)
1506 pict = fClient->GetPicture("package_delete.xpm");
1507 else
1508 pict = fClient->GetPicture("package.xpm");
1510 package->fId, package->fPathName, pict);
1512 }
1515}
1516
1517////////////////////////////////////////////////////////////////////////////////
1518/// Upload selected package(s) to the current session.
1519
1521{
1522 // if local session, do nothing
1523 if (fViewer->GetActDesc()->fLocal) return;
1524 // if valid Proof session, upload packages
1525 if (fViewer->GetActDesc()->fProof &&
1527 TObject *obj;
1528 TList selected;
1529 fLBPackages->GetSelectedEntries(&selected);
1530 TIter next(&selected);
1531 while ((obj = next())) {
1532 TString name = obj->GetTitle();
1533 if (fViewer->GetActDesc()->fProof->UploadPackage(name.Data()) != 0)
1534 Error("Submit", "Upload package failed");
1535 else {
1537 if (!o) continue;
1538 TPackageDescription *package =
1539 dynamic_cast<TPackageDescription *>(o);
1540 if (package) {
1541 package->fUploaded = kTRUE;
1542 ((TGIconLBEntry *)obj)->SetPicture(
1543 fClient->GetPicture("package_delete.xpm"));
1544 }
1545 }
1546 }
1548 }
1551}
1552
1553////////////////////////////////////////////////////////////////////////////////
1554/// Enable selected package(s) in the current session.
1555
1557{
1558 // if local session, do nothing
1559 if (fViewer->GetActDesc()->fLocal) return;
1560 // if valid Proof session, enable packages
1561 if (fViewer->GetActDesc()->fProof &&
1563 TObject *obj;
1564 TList selected;
1566 fLBPackages->GetSelectedEntries(&selected);
1567 TIter next(&selected);
1568 while ((obj = next())) {
1569 TString name = obj->GetTitle();
1571 if (!o) continue;
1572 TPackageDescription *package =
1573 dynamic_cast<TPackageDescription *>(o);
1574 if (package) {
1575 if (!package->fUploaded) {
1576 if (fViewer->GetActDesc()->fProof->UploadPackage(name.Data()) != 0)
1577 Error("Submit", "Upload package failed");
1578 else {
1579 package->fUploaded = kTRUE;
1580 ((TGIconLBEntry *)obj)->SetPicture(
1581 fClient->GetPicture("package_delete.xpm"));
1582 }
1583 }
1584 }
1586 Error("Submit", "Enable package failed");
1587 else {
1588 package->fEnabled = kTRUE;
1589 ((TGIconLBEntry *)obj)->SetPicture(fClient->GetPicture("package_add.xpm"));
1590 }
1591 }
1594 }
1597}
1598
1599////////////////////////////////////////////////////////////////////////////////
1600/// Disable selected package(s) in the current session.
1601
1603{
1604 // if local session, do nothing
1605 if (fViewer->GetActDesc()->fLocal) return;
1606 // if valid Proof session, disable (clear) packages
1607 if (fViewer->GetActDesc()->fProof &&
1609 TObject *obj;
1610 TList selected;
1611 fLBPackages->GetSelectedEntries(&selected);
1612 TIter next(&selected);
1613 while ((obj = next())) {
1614 TString name = obj->GetTitle();
1615 if (fViewer->GetActDesc()->fProof->ClearPackage(name) != 0)
1616 Error("Submit", "Clear package failed");
1617 else {
1619 if (!o) continue;
1620 TPackageDescription *package =
1621 dynamic_cast<TPackageDescription *>(o);
1622 if (package) {
1623 package->fEnabled = kFALSE;
1624 package->fUploaded = kFALSE;
1625 ((TGIconLBEntry *)obj)->SetPicture(fClient->GetPicture("package.xpm"));
1626 }
1627 }
1628 }
1630 }
1633}
1634
1635////////////////////////////////////////////////////////////////////////////////
1636/// Clear (disable) all packages in the current session.
1637
1639{
1640 TPackageDescription *package;
1641 // if local session, do nothing
1642 if (fViewer->GetActDesc()->fLocal) return;
1643 // if valid Proof session, clear packages
1644 if (fViewer->GetActDesc()->fProof &&
1646 if (fViewer->GetActDesc()->fProof->ClearPackages() != 0)
1647 Error("Submit", "Clear packages failed");
1648 else {
1650 while ((package = (TPackageDescription *)next())) {
1651 package->fEnabled = kFALSE;
1652 }
1653 }
1654 }
1657}
1658
1659////////////////////////////////////////////////////////////////////////////////
1660/// Open file dialog and add selected package file to the list.
1661
1663{
1664 if (fViewer->IsBusy())
1665 return;
1666 TGFileInfo fi;
1667 TPackageDescription *package;
1668 TGIconLBEntry *entry;
1669 fi.fFileTypes = pkgtypes;
1671 if (fi.fMultipleSelection && fi.fFileNamesList) {
1672 TObjString *el;
1673 TIter next(fi.fFileNamesList);
1674 while ((el = (TObjString *) next())) {
1675 package = new TPackageDescription;
1676 package->fName = gSystem->BaseName(gSystem->UnixPathName(el->GetString()));
1677 package->fPathName = gSystem->UnixPathName(el->GetString());
1678 package->fId = fViewer->GetActDesc()->fPackages->GetEntries();
1679 package->fUploaded = kFALSE;
1680 package->fEnabled = kFALSE;
1681 fViewer->GetActDesc()->fPackages->Add((TObject *)package);
1682 entry = new TGIconLBEntry(fLBPackages->GetContainer(),
1683 package->fId, package->fPathName,
1684 fClient->GetPicture("package.xpm"));
1686 }
1687 }
1688 else if (fi.fFilename) {
1689 package = new TPackageDescription;
1691 package->fPathName = gSystem->UnixPathName(fi.fFilename);
1692 package->fId = fViewer->GetActDesc()->fPackages->GetEntries();
1693 package->fUploaded = kFALSE;
1694 package->fEnabled = kFALSE;
1695 fViewer->GetActDesc()->fPackages->Add((TObject *)package);
1696 entry = new TGIconLBEntry(fLBPackages->GetContainer(),
1697 package->fId, package->fPathName,
1698 fClient->GetPicture("package.xpm"));
1700 }
1703}
1704
1705////////////////////////////////////////////////////////////////////////////////
1706/// Remove selected package from the list.
1707
1709{
1710 TPackageDescription *package;
1711 const TGPicture *pict;
1712 Int_t pos = fLBPackages->GetSelected();
1715 fViewer->GetActDesc()->fPackages->At(pos));
1716 Int_t id = 0;
1718 while ((package = (TPackageDescription *)next())) {
1719 package->fId = id;
1720 id++;
1721 if (package->fEnabled)
1722 pict = fClient->GetPicture("package_add.xpm");
1723 else if (package->fUploaded)
1724 pict = fClient->GetPicture("package_delete.xpm");
1725 else
1726 pict = fClient->GetPicture("package.xpm");
1728 package->fId, package->fPathName, pict);
1730 }
1733}
1734
1735////////////////////////////////////////////////////////////////////////////////
1736/// Move selected package entry one position up in the list.
1737
1739{
1740 TPackageDescription *package;
1741 const TGPicture *pict;
1742 Int_t pos = fLBPackages->GetSelected();
1743 if (pos <= 0) return;
1745 package = (TPackageDescription *)fViewer->GetActDesc()->fPackages->At(pos);
1747 fViewer->GetActDesc()->fPackages->At(pos));
1748 package->fId -= 1;
1749 fViewer->GetActDesc()->fPackages->AddAt(package, package->fId);
1750 Int_t id = 0;
1752 while ((package = (TPackageDescription *)next())) {
1753 package->fId = id;
1754 id++;
1755 if (package->fEnabled)
1756 pict = fClient->GetPicture("package_add.xpm");
1757 else if (package->fUploaded)
1758 pict = fClient->GetPicture("package_delete.xpm");
1759 else
1760 pict = fClient->GetPicture("package.xpm");
1762 package->fId, package->fPathName, pict);
1764 }
1765 fLBPackages->Select(pos-1);
1768}
1769
1770////////////////////////////////////////////////////////////////////////////////
1771/// Move selected package entry one position down in the list.
1772
1774{
1775 TPackageDescription *package;
1776 const TGPicture *pict;
1777 Int_t pos = fLBPackages->GetSelected();
1778 if (pos == -1 || pos == fViewer->GetActDesc()->fPackages->GetEntries()-1)
1779 return;
1781 package = (TPackageDescription *)fViewer->GetActDesc()->fPackages->At(pos);
1783 fViewer->GetActDesc()->fPackages->At(pos));
1784 package->fId += 1;
1785 fViewer->GetActDesc()->fPackages->AddAt(package, package->fId);
1786 Int_t id = 0;
1788 while ((package = (TPackageDescription *)next())) {
1789 package->fId = id;
1790 id++;
1791 if (package->fEnabled)
1792 pict = fClient->GetPicture("package_add.xpm");
1793 else if (package->fUploaded)
1794 pict = fClient->GetPicture("package_delete.xpm");
1795 else
1796 pict = fClient->GetPicture("package.xpm");
1798 package->fId, package->fPathName, pict);
1800 }
1801 fLBPackages->Select(pos+1);
1804}
1805
1806////////////////////////////////////////////////////////////////////////////////
1807/// Disconnect from current Proof session.
1808
1810{
1811 // if local session, do nothing
1812 if (fViewer->GetActDesc()->fLocal) return;
1813 // if valid Proof session, disconnect (close)
1814 if (fViewer->GetActDesc()->fAttached &&
1818 }
1819 // reset connected flag
1821 fViewer->GetActDesc()->fProof = 0;
1822 // disable animation timer
1824 // change list tree item picture to disconnected pixmap
1827 if (item) {
1830 }
1831 // update viewer
1833 1, 0, 0);
1836 fViewer->GetStatusBar()->SetText("", 1);
1837}
1838
1839////////////////////////////////////////////////////////////////////////////////
1840/// Show session log.
1841
1843{
1844 fViewer->ShowLog(0);
1845}
1846
1847////////////////////////////////////////////////////////////////////////////////
1848/// Call "New Query" Dialog.
1849
1851{
1852 TNewQueryDlg *dlg = new TNewQueryDlg(fViewer, 350, 310);
1853 dlg->Popup();
1854}
1855
1856////////////////////////////////////////////////////////////////////////////////
1857/// Get list of queries from current Proof server and populate the list tree.
1858
1860{
1861 TList *lqueries = 0;
1862 TQueryResult *query = 0;
1863 TQueryDescription *newquery = 0, *lquery = 0;
1864 if (fViewer->GetActDesc()->fProof &&
1866 lqueries = fViewer->GetActDesc()->fProof->GetListOfQueries();
1867 }
1868 if (lqueries) {
1869 TIter nextp(lqueries);
1870 // loop over list of queries received from Proof server
1871 while ((query = (TQueryResult *)nextp())) {
1872 // create new query description
1873 newquery = new TQueryDescription();
1874 newquery->fReference = TString::Format("%s:%s", query->GetTitle(),
1875 query->GetName());
1876 // check in our tree if it is already there
1877 TGListTreeItem *item =
1880 // if already there, skip
1882 newquery->fReference.Data()))
1883 continue;
1884 // check also in our query description list
1885 Bool_t found = kFALSE;
1886 TIter nextp2(fViewer->GetActDesc()->fQueries);
1887 while ((lquery = (TQueryDescription *)nextp2())) {
1888 if (lquery->fReference.CompareTo(newquery->fReference) == 0) {
1889 found = kTRUE;
1890 break;
1891 }
1892 }
1893 if (found) continue;
1894 // build new query description with infos from Proof
1895 newquery->fStatus = query->IsFinalized() ?
1898 newquery->fSelectorString = query->GetSelecImp()->GetName();
1899 newquery->fQueryName = TString::Format("%s:%s", query->GetTitle(),
1900 query->GetName());
1901 newquery->fOptions = query->GetOptions();
1902 newquery->fEventList = "";
1903 newquery->fNbFiles = 0;
1904 newquery->fNoEntries = query->GetEntries();
1905 newquery->fFirstEntry = query->GetFirst();
1906 newquery->fResult = query;
1907 newquery->fChain = 0;
1908 fViewer->GetActDesc()->fQueries->Add((TObject *)newquery);
1910 newquery->fQueryName, fViewer->GetQueryConPict(),
1912 item2->SetUserData(newquery);
1913 if (query->GetInputList())
1914 fViewer->GetSessionHierarchy()->AddItem(item2, "InputList");
1915 if (query->GetOutputList())
1916 fViewer->GetSessionHierarchy()->AddItem(item2, "OutputList");
1917 }
1918 }
1919 // at the end, update list tree
1922}
1923
1924////////////////////////////////////////////////////////////////////////////////
1925/// Command line handling.
1926
1928{
1929 // get command string
1930 const char *cmd = fCommandTxt->GetText();
1931 char opt[2];
1932 // form temporary file path
1933 TString pathtmp = TString::Format("%s/%s", gSystem->TempDirectory(),
1935 // if check box "clear view" is checked, open temp file in write mode
1936 // (overwrite), in append mode otherwise.
1937 if (fClearCheck->IsOn())
1938 snprintf(opt, 2, "w");
1939 else
1940 snprintf(opt, 2, "a");
1941
1942 // if valid Proof session, pass the command to Proof
1943 if (fViewer->GetActDesc()->fProof &&
1945 // redirect stdout/stderr to temp file
1946 if (gSystem->RedirectOutput(pathtmp.Data(), opt) != 0) {
1947 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
1948 return;
1949 }
1950 // execute command line
1951 fViewer->GetActDesc()->fProof->Exec(cmd);
1952 // restore back stdout/stderr
1953 if (gSystem->RedirectOutput(0) != 0) {
1954 Error("ShowStatus", "stdout/stderr retore failed; skipping");
1955 return;
1956 }
1957 // if check box "clear view" is checked, clear text view
1958 if (fClearCheck->IsOn())
1960 // load (display) temp file in text view
1961 fInfoTextView->LoadFile(pathtmp.Data());
1962 // set focus to "command line" text entry
1964 }
1965 else {
1966 // if no Proof session, or Proof session not valid,
1967 // lets execute command line by TApplication
1968
1969 // redirect stdout/stderr to temp file
1970 if (gSystem->RedirectOutput(pathtmp.Data(), opt) != 0) {
1971 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
1972 }
1973 // execute command line
1975 // restore back stdout/stderr
1976 if (gSystem->RedirectOutput(0) != 0) {
1977 Error("ShowStatus", "stdout/stderr retore failed; skipping");
1978 }
1979 // if check box "clear view" is checked, clear text view
1980 if (fClearCheck->IsOn())
1982 // load (display) temp file in text view
1983 fInfoTextView->LoadFile(pathtmp.Data());
1984 // set focus to "command line" text entry
1986 }
1987 // display bottom of text view
1989}
1990
1991////////////////////////////////////////////////////////////////////////////////
1992/// Switch widgets status/visibility for local/remote sessions.
1993
1995{
1996 if (local) {
1999 fTab->HideFrame(fTab->GetTabTab("Options"));
2000 fTab->HideFrame(fTab->GetTabTab("Packages"));
2001 fTab->HideFrame(fTab->GetTabTab("DataSets"));
2002 }
2003 else {
2006 fTab->ShowFrame(fTab->GetTabTab("Options"));
2007 fTab->ShowFrame(fTab->GetTabTab("Packages"));
2008 fTab->ShowFrame(fTab->GetTabTab("DataSets"));
2009 }
2010}
2011
2012////////////////////////////////////////////////////////////////////////////////
2013/// Shutdown current session.
2014
2016{
2017 // do nothing if connection in progress
2018 if (fViewer->IsBusy())
2019 return;
2020
2021 if (fViewer->GetActDesc()->fLocal) {
2022 Int_t retval;
2023 new TGMsgBox(fClient->GetRoot(), this, "Error Shutting down Session",
2024 "Shutting down Local Sessions is not allowed !",
2025 kMBIconExclamation,kMBOk,&retval);
2026 return;
2027 }
2028 if (!fViewer->GetActDesc()->fAttached ||
2029 !fViewer->GetActDesc()->fProof ||
2031 return;
2032 // ask for confirmation
2033 TString m;
2034 m.Form("Are you sure to shutdown the session \"%s\"",
2036 Int_t result;
2037 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), 0,
2038 kMBOk | kMBCancel, &result);
2039 // if confirmed, delete it
2040 if (result != kMBOk)
2041 return;
2042 // remove the Proof session from gROOT list of Proofs
2043 fViewer->GetActDesc()->fProof->Detach("S");
2044 // reset connected flag
2046 fViewer->GetActDesc()->fProof = 0;
2047 // disable animation timer
2049 // change list tree item picture to disconnected pixmap
2052 if (item) {
2055 }
2056 // update viewer
2058 1, 0, 0);
2061 fViewer->GetStatusBar()->SetText("", 1);
2062}
2063
2064//////////////////////////////////////////////////////////////////////////
2065// Edit Query Frame
2066//////////////////////////////////////////////////////////////////////////
2067
2068////////////////////////////////////////////////////////////////////////////////
2069/// Create a new Query dialog, used by the Session Viewer, to Edit a Query if
2070/// the editmode flag is set, or to create a new one if not set.
2071
2073 TGCompositeFrame(p, w, h, kVerticalFrame), fFrmMore(0), fBtnMore(0),
2074 fTxtQueryName(0), fTxtChain(0), fTxtSelector(0), fTxtOptions(0),
2075 fNumEntries(0), fNumFirstEntry(0), fTxtParFile(0), fTxtEventList(0),
2076 fViewer(0), fQuery(0), fChain(0)
2077{
2078}
2079
2080////////////////////////////////////////////////////////////////////////////////
2081/// Delete query dialog.
2082
2084{
2085 Cleanup();
2086}
2087
2088////////////////////////////////////////////////////////////////////////////////
2089/// Build the "new query" dialog.
2090
2092{
2093 TGButton *btnTmp;
2094 fViewer = gui;
2096 SetLayoutManager(new TGTableLayout(this, 6, 5));
2097
2098 // add "Query Name" label and text entry
2099 AddFrame(new TGLabel(this, "Query Name :"),
2100 new TGTableLayoutHints(0, 1, 0, 1, kLHintsCenterY, 5, 5, 4, 0));
2102 (const char *)0, 1), new TGTableLayoutHints(1, 2, 0, 1,
2103 kLHintsCenterY, 5, 5, 4, 0));
2104
2105 // add "TChain" label and text entry
2106 AddFrame(new TGLabel(this, "TChain :"),
2107 new TGTableLayoutHints(0, 1, 1, 2, kLHintsCenterY, 5, 5, 4, 0));
2108 AddFrame(fTxtChain = new TGTextEntry(this,
2109 (const char *)0, 2), new TGTableLayoutHints(1, 2, 1, 2,
2110 kLHintsCenterY, 5, 5, 4, 0));
2111 fTxtChain->SetToolTipText("Specify TChain or TDSet from memory or file");
2113 // add "Browse" button
2114 AddFrame(btnTmp = new TGTextButton(this, "Browse..."),
2115 new TGTableLayoutHints(2, 3, 1, 2, kLHintsCenterY, 5, 0, 4, 8));
2116 btnTmp->Connect("Clicked()", "TEditQueryFrame", this, "OnBrowseChain()");
2117
2118 // add "Selector" label and text entry
2119 AddFrame(new TGLabel(this, "Selector :"),
2120 new TGTableLayoutHints(0, 1, 2, 3, kLHintsCenterY, 5, 5, 0, 0));
2122 (const char *)0, 3), new TGTableLayoutHints(1, 2, 2, 3,
2123 kLHintsCenterY, 5, 5, 0, 0));
2124 // add "Browse" button
2125 AddFrame(btnTmp = new TGTextButton(this, "Browse..."),
2126 new TGTableLayoutHints(2, 3, 2, 3, kLHintsCenterY, 5, 0, 0, 8));
2127 btnTmp->Connect("Clicked()", "TEditQueryFrame", this, "OnBrowseSelector()");
2128
2129 // add "Less <<" ("More >>") button
2130 AddFrame(fBtnMore = new TGTextButton(this, " Less << "),
2131 new TGTableLayoutHints(2, 3, 4, 5, kLHintsCenterY, 5, 5, 4, 0));
2132 fBtnMore->Connect("Clicked()", "TEditQueryFrame", this, "OnNewQueryMore()");
2133
2134 // add (initially hidden) options frame
2135 fFrmMore = new TGCompositeFrame(this, 200, 200);
2137
2138 AddFrame(fFrmMore, new TGTableLayoutHints(0, 3, 5, 6,
2141
2142 // add "Options" label and text entry
2143 fFrmMore->AddFrame(new TGLabel(fFrmMore, "Options :"),
2144 new TGTableLayoutHints(0, 1, 0, 1, kLHintsCenterY, 5, 5, 0, 0));
2146 (const char *)0, 4), new TGTableLayoutHints(1, 2, 0, 1, 0, 17,
2147 0, 0, 8));
2148 //fTxtOptions->SetText("ASYN");
2149 fTxtOptions->SetText("");
2150
2151 // add "Nb Entries" label and number entry
2152 fFrmMore->AddFrame(new TGLabel(fFrmMore, "Nb Entries :"),
2153 new TGTableLayoutHints(0, 1, 1, 2, kLHintsCenterY, 5, 5, 0, 0));
2157 0, 17, 0, 0, 8));
2158 // coverity[negative_returns]: no problem with -1, the format is kNESInteger
2160 // add "First Entry" label and number entry
2161 fFrmMore->AddFrame(new TGLabel(fFrmMore, "First entry :"),
2162 new TGTableLayoutHints(0, 1, 2, 3, kLHintsCenterY, 5, 5, 0, 0));
2166 17, 0, 0, 8));
2167
2168 // add "Event list" label and text entry
2169 fFrmMore->AddFrame(new TGLabel(fFrmMore, "Event list :"),
2170 new TGTableLayoutHints(0, 1, 3, 4, kLHintsCenterY, 5, 5, 0, 0));
2172 (const char *)0, 6), new TGTableLayoutHints(1, 2, 3, 4, 0, 17,
2173 5, 0, 0));
2174 // add "Browse" button
2175 fFrmMore->AddFrame(btnTmp = new TGTextButton(fFrmMore, "Browse..."),
2176 new TGTableLayoutHints(2, 3, 3, 4, 0, 6, 0, 0, 8));
2177 btnTmp->Connect("Clicked()", "TEditQueryFrame", this, "OnBrowseEventList()");
2178
2179 fTxtQueryName->Associate(this);
2180 fTxtChain->Associate(this);
2181 fTxtSelector->Associate(this);
2182 fTxtOptions->Associate(this);
2183 fNumEntries->Associate(this);
2185 fTxtEventList->Associate(this);
2186
2187 fTxtQueryName->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2188 "SettingsChanged()");
2189 fTxtChain->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2190 "SettingsChanged()");
2191 fTxtSelector->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2192 "SettingsChanged()");
2193 fTxtOptions->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2194 "SettingsChanged()");
2195 fNumEntries->Connect("ValueChanged(Long_t)", "TEditQueryFrame", this,
2196 "SettingsChanged()");
2197 fNumFirstEntry->Connect("ValueChanged(Long_t)", "TEditQueryFrame", this,
2198 "SettingsChanged()");
2199 fTxtEventList->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2200 "SettingsChanged()");
2201}
2202
2203////////////////////////////////////////////////////////////////////////////////
2204/// Show/hide options frame and update button text accordingly.
2205
2207{
2208 if (IsVisible(fFrmMore)) {
2210 fBtnMore->SetText(" More >> ");
2211 }
2212 else {
2214 fBtnMore->SetText(" Less << ");
2215 }
2216}
2217
2218////////////////////////////////////////////////////////////////////////////////
2219/// Call new chain dialog.
2220
2222{
2223 TNewChainDlg *dlg = new TNewChainDlg(fClient->GetRoot(), this);
2224 dlg->Connect("OnElementSelected(TObject *)", "TEditQueryFrame",
2225 this, "OnElementSelected(TObject *)");
2226}
2227
2228////////////////////////////////////////////////////////////////////////////////
2229/// Handle OnElementSelected signal coming from new chain dialog.
2230
2232{
2233 if (obj) {
2234 fChain = obj;
2235 if (obj->IsA() == TChain::Class())
2237 else if (obj->IsA() == TDSet::Class())
2238 fTxtChain->SetText(((TDSet *)fChain)->GetObjName());
2239 }
2240}
2241
2242////////////////////////////////////////////////////////////////////////////////
2243/// Open file browser to choose selector macro.
2244
2246{
2247 TGFileInfo fi;
2249 new TGFileDialog(fClient->GetRoot(), this, kFDOpen, &fi);
2250 if (!fi.fFilename) return;
2252}
2253
2254////////////////////////////////////////////////////////////////////////////////
2255///Browse event list
2256
2258{
2259}
2260
2261////////////////////////////////////////////////////////////////////////////////
2262/// Save current settings in main session viewer.
2263
2265{
2266 // if we are in edition mode and query description is valid,
2267 // use it, otherwise create a new one
2268 TQueryDescription *newquery;
2269 if (fQuery)
2270 newquery = fQuery;
2271 else
2272 newquery = new TQueryDescription();
2273
2274 // update query description fields
2275 newquery->fSelectorString = fTxtSelector->GetText();
2276 if (fChain) {
2277 newquery->fTDSetString = fChain->GetName();
2278 newquery->fChain = fChain;
2279 }
2280 else {
2281 newquery->fTDSetString = "";
2282 newquery->fChain = 0;
2283 }
2284 newquery->fQueryName = fTxtQueryName->GetText();
2285 newquery->fOptions = fTxtOptions->GetText();
2286 newquery->fNoEntries = fNumEntries->GetIntNumber();
2288 newquery->fNbFiles = 0;
2289 newquery->fResult = 0;
2290
2291 if (newquery->fChain) {
2292 if (newquery->fChain->IsA() == TChain::Class())
2293 newquery->fNbFiles = ((TChain *)newquery->fChain)->GetListOfFiles()->GetEntriesFast();
2294 else if (newquery->fChain->IsA() == TDSet::Class())
2295 newquery->fNbFiles = ((TDSet *)newquery->fChain)->GetListOfElements()->GetSize();
2296 }
2297 // update user data with modified query description
2299 fViewer->GetSessionHierarchy()->RenameItem(item, newquery->fQueryName);
2300 item->SetUserData(newquery);
2301 // update list tree
2308 if (fViewer->GetActDesc()->fLocal ||
2312 fViewer->GetActDesc()->fProof->IsValid())) {
2313 fViewer->GetQueryFrame()->GetTab()->SetTab("Status");
2315 }
2316}
2317
2318////////////////////////////////////////////////////////////////////////////////
2319/// Settings have changed, update GUI accordingly.
2320
2322{
2323 if (fQuery) {
2324 if ((strcmp(fQuery->fSelectorString.Data(), fTxtSelector->GetText())) ||
2325 (strcmp(fQuery->fQueryName.Data(), fTxtQueryName->GetText())) ||
2326 (strcmp(fQuery->fOptions.Data(), fTxtOptions->GetText())) ||
2329 (fQuery->fChain != fChain)) {
2331 }
2332 else {
2334 }
2335 }
2336 else {
2337 if ((fTxtQueryName->GetText()) &&
2338 ((fTxtQueryName->GetText()) ||
2339 (fTxtChain->GetText())))
2341 else
2343 }
2344}
2345
2346////////////////////////////////////////////////////////////////////////////////
2347/// Update entry fields with query description values.
2348
2350{
2351 fChain = 0;
2352 fQuery = desc;
2353 fTxtChain->SetText("");
2354 if (desc->fChain) {
2355 fChain = desc->fChain;
2357 }
2364}
2365
2366////////////////////////////////////////////////////////////////////////////////
2367// Query Frame
2368
2369////////////////////////////////////////////////////////////////////////////////
2370/// Constructor
2371
2373 TGCompositeFrame(p, w, h), fBtnSubmit(0), fBtnFinalize(0), fBtnStop(0),
2374 fBtnAbort(0), fBtnShowLog(0), fBtnRetrieve(0), fBtnSave(0), fInfoTextView(0),
2375 fModified(0), fFiles(0), fFirst(0), fEntries(0), fPrevTotal(0),
2376 fPrevProcessed(0), fLabInfos(0), fLabStatus(0), fTotal(0), fRate(0),
2377 fStatus(kStopped), fTab(0), fFA(0), fFB(0), fFC(0), fFD(0), frmProg(0),
2378 fECanvas(0), fStatsCanvas(0), fViewer(0), fDesc(0)
2379{
2380}
2381
2382////////////////////////////////////////////////////////////////////////////////
2383/// Destructor.
2384
2386{
2387 Cleanup();
2388}
2389
2390////////////////////////////////////////////////////////////////////////////////
2391/// Build query information frame.
2392
2394{
2397 fFirst = fEntries = fPrevTotal = 0;
2398 fPrevProcessed = 0;
2399 fViewer = gui;
2400 fModified = kFALSE;
2401
2402 // main query tab
2403 fTab = new TGTab(this, 200, 200);
2405 kLHintsExpandY, 2, 2, 2, 2));
2406
2407 // add "Status" tab element
2408 TGCompositeFrame *tf = fTab->AddTab("Status");
2409 fFB = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
2412
2413 // new frame containing control buttons and feedback histos canvas
2414 TGCompositeFrame* frmcanvas = new TGHorizontalFrame(fFB, 350, 100);
2415 // control buttons frame
2416 TGCompositeFrame* frmBut2 = new TGVerticalFrame(frmcanvas, 150, 100);
2417 fBtnSubmit = new TGTextButton(frmBut2, " Submit ");
2418 fBtnSubmit->SetToolTipText("Submit (process) selected query");
2420 kLHintsExpandX, 5, 5, 5, 5));
2421 fBtnStop = new TGTextButton(frmBut2, "Stop");
2422 fBtnStop->SetToolTipText("Stop processing query");
2424 kLHintsExpandX, 5, 5, 5, 5));
2425 fBtnAbort = new TGTextButton(frmBut2, "Abort");
2426 fBtnAbort->SetToolTipText("Abort processing query");
2428 kLHintsExpandX, 5, 5, 5, 5));
2429 frmcanvas->AddFrame(frmBut2, new TGLayoutHints(kLHintsLeft | kLHintsCenterY |
2431 // feedback histos embedded canvas
2432 fECanvas = new TRootEmbeddedCanvas("fECanvas", frmcanvas, 400, 150);
2437 4, 4, 4, 4));
2438 fFB->AddFrame(frmcanvas, new TGLayoutHints(kLHintsLeft | kLHintsTop |
2440
2441 // progress infos label
2442 fLabInfos = new TGLabel(fFB, " ");
2443 fFB->AddFrame(fLabInfos, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
2444 // progress status label
2445 fLabStatus = new TGLabel(fFB, " ");
2446 fFB->AddFrame(fLabStatus, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
2447
2448 //progress bar
2451 frmProg->SetBarColor("green");
2452 fFB->AddFrame(frmProg, new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5));
2453 // total progress infos
2454 fFB->AddFrame(fTotal = new TGLabel(fFB,
2455 " Estimated time left : 0 sec (--- events of --- processed) "),
2456 new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
2457 // progress rate infos
2458 fFB->AddFrame(fRate = new TGLabel(fFB,
2459 " Processing Rate : -- events/sec "),
2460 new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
2461
2462 // add "Results" tab element
2463 tf = fTab->AddTab("Results");
2464 fFC = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
2467 // query result (header) information text view
2468 fInfoTextView = new TGTextView(fFC, 330, 185, "", kSunkenFrame |
2471 kLHintsExpandY | kLHintsExpandX, 5, 5, 10, 10));
2472
2473 // add "Retrieve", "Finalize" and "Show Log" buttons
2474 TGCompositeFrame* frmBut3 = new TGHorizontalFrame(fFC, 350, 100);
2475 fBtnRetrieve = new TGTextButton(frmBut3, "Retrieve");
2476 fBtnRetrieve->SetToolTipText("Retrieve query results");
2478 kLHintsExpandX, 5, 5, 10, 10));
2479 fBtnFinalize = new TGTextButton(frmBut3, "Finalize");
2480 fBtnFinalize->SetToolTipText("Finalize query");
2482 kLHintsExpandX, 5, 5, 10, 10));
2483 fBtnShowLog = new TGTextButton(frmBut3, "Show Log");
2484 fBtnShowLog->SetToolTipText("Show query log (open log window)");
2486 kLHintsExpandX, 5, 5, 10, 10));
2488
2489 // add "Results" tab element
2490 tf = fTab->AddTab("Edit Query");
2491 fFD = new TEditQueryFrame(tf, 100, 100);
2492 fFD->Build(fViewer);
2493 tf->AddFrame(fFD, new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 10, 0));
2494 TString btntxt;
2495 if (fViewer->GetActDesc()->fLocal ||
2496 (fViewer->GetActDesc()->fProof &&
2497 fViewer->GetActDesc()->fProof->IsValid())) {
2498 btntxt = " Submit ";
2499 }
2500 else {
2501 btntxt = " Apply changes ";
2502 }
2503 tf->AddFrame(fBtnSave = new TGTextButton(tf, btntxt),
2504 new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 5, 25, 5));
2505
2506 // connect button actions to functions
2507 fBtnSave->Connect("Clicked()", "TEditQueryFrame", fFD,
2508 "OnBtnSave()");
2509 fBtnSubmit->Connect("Clicked()", "TSessionQueryFrame", this,
2510 "OnBtnSubmit()");
2511 fBtnFinalize->Connect("Clicked()", "TSessionQueryFrame", this,
2512 "OnBtnFinalize()");
2513 fBtnStop->Connect("Clicked()", "TSessionQueryFrame", this,
2514 "OnBtnStop()");
2515 fBtnAbort->Connect("Clicked()", "TSessionQueryFrame", this,
2516 "OnBtnAbort()");
2517 fBtnShowLog->Connect("Clicked()", "TSessionQueryFrame", this,
2518 "OnBtnShowLog()");
2519 fBtnRetrieve->Connect("Clicked()", "TSessionQueryFrame", this,
2520 "OnBtnRetrieve()");
2521// fBtnSave->SetState(kButtonDisabled);
2522 Resize(350, 310);
2523}
2524
2525////////////////////////////////////////////////////////////////////////////////
2526/// Notify changes in query editor settings.
2527
2529{
2530 fModified = mod;
2531 if (fModified) {
2533 }
2534 else {
2536 }
2537 if (fViewer->GetActDesc()->fLocal ||
2538 (fViewer->GetActDesc()->fProof &&
2541}
2542
2543////////////////////////////////////////////////////////////////////////////////
2544/// Feedback function connected to Feedback signal.
2545/// Used to update feedback histograms.
2546
2548{
2549 // if no actual session, just return
2550 if (!fViewer->GetActDesc()->fAttached)
2551 return;
2552 if (!fViewer->GetActDesc()->fProof)
2553 return;
2554 if ((fViewer->GetActDesc()->fActQuery) &&
2559 return;
2560 TProof *sender = dynamic_cast<TProof*>((TQObject*)gTQSender);
2561 // if Proof sender match actual session one, update feedback histos
2562 if (sender && (sender == fViewer->GetActDesc()->fProof))
2563 UpdateHistos(objs);
2564}
2565
2566////////////////////////////////////////////////////////////////////////////////
2567/// Update feedback histograms.
2568
2570{
2571 TVirtualPad *save = gPad;
2572 TObject *o;
2573 Int_t pos = 1;
2574 Int_t i = 0;
2575 while (kFeedbackHistos[i]) {
2576 // check if user has selected this histogram in the option menu
2577 if (fViewer->GetCascadeMenu()->IsEntryChecked(41+i)) {
2578 if ( (o = objs->FindObject(kFeedbackHistos[i]))) {
2579 fStatsCanvas->cd(pos);
2580 gPad->SetEditable(kTRUE);
2581 if (TH1 *h = dynamic_cast<TH1*>(o)) {
2582 h->SetStats(0);
2583 h->SetBarWidth(0.75);
2584 h->SetBarOffset(0.125);
2585 h->SetFillColor(9);
2586 h->Draw("bar");
2587 pos++;
2588 }
2589 else if (TH2 *h2 = dynamic_cast<TH2*>(o)) {
2590 h2->Draw();
2591 pos++;
2592 }
2593 gPad->Modified();
2594 }
2595 }
2596 i++;
2597 }
2598 // update canvas
2599 fStatsCanvas->cd();
2602 if (save != 0) {
2603 save->cd();
2604 } else {
2605 gPad = 0;
2606 }
2607}
2608
2609////////////////////////////////////////////////////////////////////////////////
2610/// Update progress bar and status labels.
2611
2613{
2614 Long_t tt;
2615 UInt_t hh=0, mm=0, ss=0;
2616 TString stm;
2617 // if no actual session, just return
2618 if (!fViewer->GetActDesc()->fProof)
2619 return;
2620 // if Proof sender does't match actual session one, return
2621 TProof *sender = dynamic_cast<TProof*>((TQObject*)gTQSender);
2622 if (!sender || (sender != fViewer->GetActDesc()->fProof))
2623 return;
2624
2625 if ((fViewer->GetActDesc()->fActQuery) &&
2630 fTotal->SetText(" Estimated time left : 0 sec (0 events of 0 processed) ");
2631 fRate->SetText(" Processing Rate : 0.0f events/sec ");
2632 frmProg->Reset();
2633 fFB->Layout();
2634 return;
2635 }
2636
2637 if (total < 0)
2638 total = fPrevTotal;
2639 else
2640 fPrevTotal = total;
2641
2642 // if no change since last call, just return
2643 if (fPrevProcessed == processed)
2644 return;
2645 TString buf;
2646
2647 // Update information at first call
2648 if (fEntries != total) {
2649 buf.Form("PROOF cluster : \"%s\" - %d worker nodes",
2652 fLabInfos->SetText(buf);
2653
2654 fEntries = total;
2655 buf.Form(" %d files, %lld events, starting event %lld",
2657 fLabStatus->SetText(buf);
2658 }
2659
2660 // compute progress bar position and update
2661 Float_t pos = (Float_t)((Double_t)(processed * 100)/(Double_t)total);
2662 frmProg->SetPosition(pos);
2663 // if 100%, stop animation and set icon to "connected"
2664 if (pos >= 100.0) {
2666 fViewer->ChangeRightLogo("monitor01.xpm");
2667 }
2668
2669 // get current time
2670 if ((fViewer->GetActDesc()->fActQuery->fStatus ==
2677 Float_t eta = 0;
2678 if (processed)
2679 eta = ((Float_t)((Long64_t)tdiff)*total/Float_t(processed) -
2680 Long64_t(tdiff))/1000.;
2681
2682 tt = (Long_t)eta;
2683 if (tt > 0) {
2684 hh = (UInt_t)(tt / 3600);
2685 mm = (UInt_t)((tt % 3600) / 60);
2686 ss = (UInt_t)((tt % 3600) % 60);
2687 }
2688 if (hh)
2689 stm.Form("%d h %d min %d sec", hh, mm, ss);
2690 else if (mm)
2691 stm.Form("%d min %d sec", mm, ss);
2692 else
2693 stm.Form("%d sec", ss);
2694 if (processed == total) {
2695 // finished
2696 tt = (Long_t) Long64_t(tdiff)/1000;
2697 if (tt > 0) {
2698 hh = (UInt_t)(tt / 3600);
2699 mm = (UInt_t)((tt % 3600) / 60);
2700 ss = (UInt_t)((tt % 3600) % 60);
2701 }
2702 if (hh)
2703 stm.Form("%d h %d min %d sec", hh, mm, ss);
2704 else if (mm)
2705 stm.Form("%d min %d sec", mm, ss);
2706 else
2707 stm.Form("%d sec", ss);
2708 buf.Form(" Processed : %lld events in %s", total, stm.Data());
2709 fTotal->SetText(buf.Data());
2710 } else {
2711 // update status infos
2712 buf.Form(" Estimated time left : %s (%lld events of %lld processed) ",
2713 stm.Data(), processed, total);
2714 fTotal->SetText(buf.Data());
2715 }
2716 if (processed > 0 && (Long64_t)tdiff > 0) {
2717 buf.Form(" Processing Rate : %.1f events/sec ",
2718 (Float_t)processed/(Long64_t)tdiff*1000.);
2719 fRate->SetText(buf);
2720 }
2721 fPrevProcessed = processed;
2722
2723 fFB->Layout();
2724}
2725
2726////////////////////////////////////////////////////////////////////////////////
2727/// New version of Progress (just forward to the old version
2728/// for the time being).
2729
2731 Long64_t /*bytesread*/, Float_t /*initTime*/,
2732 Float_t /*procTime*/, Float_t /*evtrti*/,
2733 Float_t /*mbrti*/, Int_t /*actw*/,
2734 Int_t /*tses*/, Float_t /*eses*/)
2735{
2736 Progress(total, processed);
2737}
2738
2739////////////////////////////////////////////////////////////////////////////////
2740/// Update progress bar and status labels.
2741
2743{
2744 Long_t tt;
2745 UInt_t hh=0, mm=0, ss=0;
2746 TString stm;
2747 TString cproc;
2748 Int_t status;
2749
2750 switch (fViewer->GetActDesc()->fActQuery->fStatus) {
2751
2753 cproc = " - ABORTED";
2754 status = kAborted;
2755 break;
2757 cproc = " - STOPPED";
2758 status = kStopped;
2759 break;
2761 cproc = " ";
2762 status = kRunning;
2763 break;
2766 cproc = " ";
2767 status = kDone;
2768 break;
2769 default:
2770 status = -1;
2771 break;
2772 }
2773 if (processed < 0) processed = 0;
2774
2775 frmProg->SetBarColor("green");
2776 if (status == kAborted)
2777 frmProg->SetBarColor("red");
2778 else if (status == kStopped)
2779 frmProg->SetBarColor("yellow");
2780 else if (status == -1 ) {
2781 fTotal->SetText(" Estimated time left : 0 sec (0 events of 0 processed) ");
2782 fRate->SetText(" Processing Rate : 0.0f events/sec ");
2783 frmProg->Reset();
2784 fFB->Layout();
2785 return;
2786 }
2787
2788 if (total < 0)
2789 total = fPrevTotal;
2790 else
2791 fPrevTotal = total;
2792
2793 // if no change since last call, just return
2794 TString buf;
2795
2796 // Update information at first call
2797 if (fEntries != total) {
2798 fLabInfos->SetText("Local Session");
2799
2800 fEntries = total;
2801 buf.Form(" %d files, %lld events, starting event %lld",
2803 fLabStatus->SetText(buf.Data());
2804 }
2805
2806 // compute progress bar position and update
2807 Float_t pos = 0.0;
2808 if (processed > 0 && total > 0)
2809 pos = (Float_t)((Double_t)(processed * 100)/(Double_t)total);
2810 frmProg->SetPosition(pos);
2811 // if 100%, stop animation and set icon to "connected"
2812 if (pos >= 100.0) {
2814 fViewer->ChangeRightLogo("monitor01.xpm");
2815 }
2816
2817 // get current time
2818 if (status == kRunning)
2822 Float_t eta = 0;
2823 if (processed)
2824 eta = ((Float_t)((Long64_t)tdiff)*total/(Float_t)(processed) -
2825 (Long64_t)(tdiff))/1000.;
2826
2827 tt = (Long_t)eta;
2828 if (tt > 0) {
2829 hh = (UInt_t)(tt / 3600);
2830 mm = (UInt_t)((tt % 3600) / 60);
2831 ss = (UInt_t)((tt % 3600) % 60);
2832 }
2833 if (hh)
2834 stm = TString::Format("%d h %d min %d sec", hh, mm, ss);
2835 else if (mm)
2836 stm = TString::Format("%d min %d sec", mm, ss);
2837 else
2838 stm = TString::Format("%d sec", ss);
2839 if ((processed != total) && (status == kRunning)) {
2840 // update status infos
2841 buf.Form(" Estimated time left : %s (%lld events of %lld processed) ",
2842 stm.Data(), processed, total);
2843 fTotal->SetText(buf);
2844 } else {
2845 tt = (Long_t) Long64_t(tdiff)/1000;
2846 if (tt > 0) {
2847 hh = (UInt_t)(tt / 3600);
2848 mm = (UInt_t)((tt % 3600) / 60);
2849 ss = (UInt_t)((tt % 3600) % 60);
2850 }
2851 if (hh)
2852 stm = TString::Format("%d h %d min %d sec", hh, mm, ss);
2853 else if (mm)
2854 stm = TString::Format("%d min %d sec", mm, ss);
2855 else
2856 stm = TString::Format("%d sec", ss);
2857 buf.Form(" Processed : %ld events in %s",
2858 (Long_t)processed, stm.Data());
2859 buf += cproc;
2860 fTotal->SetText(buf.Data());
2861 }
2862 if (processed > 0 && (Long64_t)tdiff > 0) {
2863 buf.Form(" Processing Rate : %.1f events/sec ",
2864 (Float_t)processed/(Long64_t)tdiff*1000.);
2865 fRate->SetText(buf.Data());
2866 }
2867 fPrevProcessed = processed;
2868
2869 fFB->Layout();
2870}
2871
2872////////////////////////////////////////////////////////////////////////////////
2873/// Indicate that Cancel or Stop was clicked.
2874
2876{
2877 if (aborted == kTRUE) {
2878 // Aborted
2879 frmProg->SetBarColor("red");
2880 }
2881 else {
2882 // Stopped
2883 frmProg->SetBarColor("yellow");
2884 }
2885 // disconnect progress related signals
2886 if (fViewer->GetActDesc()->fProof &&
2888 fViewer->GetActDesc()->fProof->Disconnect("Progress(Long64_t,Long64_t)",
2889 this, "Progress(Long64_t,Long64_t)");
2890 fViewer->GetActDesc()->fProof->Disconnect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
2891 this, "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
2892 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)",
2893 this, "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
2894 fViewer->GetActDesc()->fProof->Disconnect("StopProcess(Bool_t)", this,
2895 "IndicateStop(Bool_t)");
2896 }
2897}
2898
2899////////////////////////////////////////////////////////////////////////////////
2900/// Reset progress frame information fields.
2901
2902void TSessionQueryFrame::ResetProgressDialog(const char * /*selector*/, Int_t files,
2903 Long64_t first, Long64_t entries)
2904{
2905 TString buf;
2906 fFiles = files > 0 ? files : 0;
2907 fFirst = first;
2908 fEntries = entries;
2909 fPrevProcessed = 0;
2910 fPrevTotal = 0;
2911
2912 if (!fViewer->GetActDesc()->fLocal) {
2913 frmProg->SetBarColor("green");
2914 frmProg->Reset();
2915 }
2916
2917 buf.Form("%0d files, %0lld events, starting event %0lld",
2918 fFiles > 0 ? fFiles : 0, fEntries > 0 ? fEntries : 0,
2919 fFirst >= 0 ? fFirst : 0);
2920 fLabStatus->SetText(buf.Data());
2921 // Reconnect the slots
2922 if (fViewer->GetActDesc()->fProof &&
2924 fViewer->GetActDesc()->fProof->Connect("Progress(Long64_t,Long64_t)",
2925 "TSessionQueryFrame", this, "Progress(Long64_t,Long64_t)");
2926 fViewer->GetActDesc()->fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
2927 "TSessionQueryFrame", this,
2928 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
2929 fViewer->GetActDesc()->fProof->Connect("StopProcess(Bool_t)",
2930 "TSessionQueryFrame", this, "IndicateStop(Bool_t)");
2931 buf.Form("PROOF cluster : \"%s\" - %d worker nodes",
2934 fLabInfos->SetText(buf.Data());
2935 }
2936 else if (fViewer->GetActDesc()->fLocal) {
2938 fLabInfos->SetText("Local Session");
2939 fLabStatus->SetText(" ");
2940 }
2941 else {
2942 fLabInfos->SetText(" ");
2943 fLabStatus->SetText(" ");
2944 }
2945 fFB->Layout();
2946}
2947
2948////////////////////////////////////////////////////////////////////////////////
2949/// Finalize query.
2950
2952{
2953 // check if Proof is valid
2954 if (fViewer->GetActDesc()->fProof &&
2956 gPad->SetEditable(kFALSE);
2958 if (!item) return;
2959 TObject *obj = (TObject *)item->GetUserData();
2960 if ((obj) && (obj->IsA() == TQueryDescription::Class())) {
2961 // as it can take time, set watch cursor
2962 gVirtualX->SetCursor(GetId(),gVirtualX->CreateCursor(kWatch));
2963 TQueryDescription *query = (TQueryDescription *)obj;
2965 UpdateButtons(query);
2966 // restore cursor
2967 gVirtualX->SetCursor(GetId(), 0);
2968 }
2969 }
2970 if (fViewer->GetActDesc()->fLocal) {
2971 gPad->SetEditable(kFALSE);
2973 if (chain && chain->GetPlayer())
2975 }
2976}
2977
2978////////////////////////////////////////////////////////////////////////////////
2979/// Stop processing query.
2980
2982{
2983 // check for proof validity
2984 if (fViewer->GetActDesc()->fProof &&
2987 }
2988 if (fViewer->GetActDesc()->fLocal) {
2989 gROOT->SetInterrupt();
2992 }
2993 // stop icon animation and set connected icon
2994 fViewer->ChangeRightLogo("monitor01.xpm");
2996}
2997
2998////////////////////////////////////////////////////////////////////////////////
2999/// Show query log.
3000
3002{
3004 if (!item) return;
3005 TObject *obj = (TObject *)item->GetUserData();
3006 if ((!obj) || (obj->IsA() != TQueryDescription::Class()))
3007 return;
3008 TQueryDescription *query = (TQueryDescription *)obj;
3009 fViewer->ShowLog(query->fReference.Data());
3010}
3011
3012////////////////////////////////////////////////////////////////////////////////
3013/// Retrieve query.
3014
3016{
3017 // check for proof validity
3018 if (fViewer->GetActDesc()->fAttached &&
3022 if (!item) return;
3023 TObject *obj = (TObject *)item->GetUserData();
3024 if (obj && obj->IsA() == TQueryDescription::Class()) {
3025 // as it can take time, set watch cursor
3026 gVirtualX->SetCursor(GetId(), gVirtualX->CreateCursor(kWatch));
3027 TQueryDescription *query = (TQueryDescription *)obj;
3029 if (rc == 0)
3031 // restore cursor
3032 gVirtualX->SetCursor(GetId(), 0);
3033 }
3034 }
3035 if (fViewer->GetActDesc()->fLocal) {
3036 TGListTreeItem *item=0, *item2=0;
3038 fViewer->GetActDesc());
3039 if (item) {
3040 item2 = fViewer->GetSessionHierarchy()->FindItemByObj(item,
3042 }
3043 if (item2) {
3044 // add input and output list entries
3046 if (chain && chain->GetPlayer()) {
3047 TSelector *selector = chain->GetPlayer()->GetSelectorFromFile();
3048 if (selector) {
3049 TList *objlist = selector->GetOutputList();
3050 if (objlist)
3051 if (!fViewer->GetSessionHierarchy()->FindChildByName(item2, "OutputList"))
3052 fViewer->GetSessionHierarchy()->AddItem(item2, "OutputList");
3053 }
3054 }
3055 }
3056 // update list tree, query frame information, and buttons state
3059 UpdateInfos();
3061 }
3062}
3063
3064////////////////////////////////////////////////////////////////////////////////
3065/// Abort processing query.
3066
3068{
3069 // check for proof validity
3070 if (fViewer->GetActDesc()->fProof &&
3073 }
3074 if (fViewer->GetActDesc()->fLocal) {
3075 gROOT->SetInterrupt();
3078 }
3079 // stop icon animation and set connected icon
3080 fViewer->ChangeRightLogo("monitor01.xpm");
3082}
3083
3084////////////////////////////////////////////////////////////////////////////////
3085/// Submit query.
3086
3088{
3089 Int_t retval;
3090 Long64_t id = 0;
3092 if (!item) return;
3093 // retrieve query description attached to list tree item
3094 TObject *obj = (TObject *)item->GetUserData();
3095 if (!obj || obj->IsA() != TQueryDescription::Class())
3096 return;
3097 TQueryDescription *newquery = (TQueryDescription *)obj;
3098 // reset progress information
3100 newquery->fNbFiles, newquery->fFirstEntry, newquery->fNoEntries);
3101 // set query start time
3102 newquery->fStartTime = gSystem->Now();
3104 // check for proof validity
3105 if (fViewer->GetActDesc()->fProof &&
3108 // set query description status to submitted
3110 // if feedback option selected
3112 Int_t i = 0;
3113 // browse list of feedback histos and check user's selected ones
3114 while (kFeedbackHistos[i]) {
3115 if (fViewer->GetCascadeMenu()->IsEntryChecked(41+i)) {
3118 }
3119 i++;
3120 }
3121 // connect feedback signal
3122 fViewer->GetActDesc()->fProof->Connect("Feedback(TList *objs)",
3123 "TSessionQueryFrame", fViewer->GetQueryFrame(),
3124 "Feedback(TList *objs)");
3125 gROOT->Time();
3126 }
3127 else {
3128 // if feedback option not selected, clear Proof's feedback option
3130 }
3131 // set current proof session
3132 fViewer->GetActDesc()->fProof->cd();
3133 // check if parameter file has been specified
3134 if (newquery->fChain) {
3135 if (fViewer->GetActDesc()->fProof->IsLite()) {
3136 newquery->fOptions = "";
3137 }
3138 // set query reference id
3139 newquery->fReference= TString::Format("session-%s:q%d",
3142 if (newquery->fChain->IsA() == TChain::Class()) {
3143 // TChain case
3145 ((TChain *)newquery->fChain)->SetProof(fViewer->GetActDesc()->fProof);
3146 id = ((TChain *)newquery->fChain)->Process(newquery->fSelectorString,
3147 newquery->fOptions,
3148 newquery->fNoEntries > 0 ? newquery->fNoEntries : 1234567890,
3149 newquery->fFirstEntry);
3150 }
3151 else if (newquery->fChain->IsA() == TDSet::Class()) {
3152 // TDSet case
3154 id = ((TDSet *)newquery->fChain)->Process(newquery->fSelectorString,
3155 newquery->fOptions,
3156 newquery->fNoEntries,
3157 newquery->fFirstEntry);
3158 }
3159 }
3160 else {
3161 Error("Submit", "No TChain defined; skipping");
3163 return;
3164 }
3165 // set query reference id to unique identifier
3166 newquery->fReference= TString::Format("session-%s:q%lld",
3168 // start icon animation
3170 }
3171 else if (fViewer->GetActDesc()->fLocal) { // local session case
3172 // if feedback option selected
3174 Int_t i = 0;
3175 // browse list of feedback histos and check user's selected ones
3176 while (kFeedbackHistos[i]) {
3177 if (fViewer->GetCascadeMenu()->IsEntryChecked(41+i)) {
3179 }
3180 i++;
3181 }
3182 }
3183 if (newquery->fChain) {
3184 if (newquery->fChain->IsA() == TChain::Class()) {
3185 // TChain case
3188 UpdateButtons(newquery);
3189 gPad->SetEditable(kFALSE);
3190 ((TChain *)newquery->fChain)->SetTimerInterval(100);
3191 id = ((TChain *)newquery->fChain)->Process(newquery->fSelectorString,
3192 newquery->fOptions,
3193 newquery->fNoEntries > 0 ? newquery->fNoEntries : 1234567890,
3194 newquery->fFirstEntry);
3195 ((TChain *)newquery->fChain)->SetTimerInterval(0);
3196 OnBtnRetrieve();
3197 TChain *chain = (TChain *)newquery->fChain;
3198 ProgressLocal(chain->GetEntries(),
3199 chain->GetReadEntry()+1);
3203 UpdateButtons(newquery);
3204 }
3205 else {
3206 new TGMsgBox(fClient->GetRoot(), this, "Error Submitting Query",
3207 "Only TChains are allowed in Local Session (no TDSet) !",
3208 kMBIconExclamation,kMBOk,&retval);
3209 }
3210 }
3211 else {
3212 Error("Submit", "No TChain defined; skipping");
3214 return;
3215 }
3216 // set query reference id to unique identifier
3217 newquery->fReference = TString::Format("local-session-%s:q%lld", newquery->fQueryName.Data(), id);
3218 }
3219 // update buttons state
3220 UpdateButtons(newquery);
3221}
3222
3223////////////////////////////////////////////////////////////////////////////////
3224/// Update buttons state for the current query status.
3225
3227{
3229 if (!item) return;
3230 // retrieve query description attached to list tree item
3231 TObject *obj = (TObject *)item->GetUserData();
3232 if (!obj || obj->IsA() != TQueryDescription::Class())
3233 return;
3234 TQueryDescription *query = (TQueryDescription *)obj;
3235 if (desc != query) return;
3236
3237 Bool_t submit_en = kFALSE;
3238 if ((fViewer->GetActDesc()->fProof &&
3239 fViewer->GetActDesc()->fProof->IsValid()) ||
3241 submit_en = kTRUE;
3242
3243 switch (desc->fStatus) {
3245 fBtnSubmit->SetEnabled(submit_en);
3251 break;
3252
3254 fBtnSubmit->SetEnabled(submit_en);
3256 if (((desc->fResult == 0) || (desc->fResult &&
3257 (desc->fResult->IsFinalized() ||
3258 (desc->fResult->GetInputObject("TDSet") == 0)))) &&
3259 !(fViewer->GetActDesc()->fLocal))
3265 break;
3266
3268 fBtnSubmit->SetEnabled(submit_en);
3274 break;
3275
3283 break;
3284
3292 break;
3293
3295 fBtnSubmit->SetEnabled(submit_en);
3301 break;
3302
3304 fBtnSubmit->SetEnabled(submit_en);
3310 break;
3311
3313 fBtnSubmit->SetEnabled(submit_en);
3319 break;
3320
3321 default:
3322 break;
3323 }
3324 if (fViewer->GetActDesc()->fLocal &&
3328 }
3329}
3330
3331////////////////////////////////////////////////////////////////////////////////
3332/// Update query information (header) text view.
3333
3335{
3336 TString buffer;
3337 const char *qst[] = {"aborted ", "submitted", "running ",
3338 "stopped ", "completed"};
3339
3342
3343 if (fViewer->GetActDesc()->fLocal ||
3347 fViewer->GetActDesc()->fProof->IsValid())) {
3348 fBtnSave->SetText(" Submit ");
3349 }
3350 else {
3351 fBtnSave->SetText(" Apply changes ");
3352 }
3355 if (!fViewer->GetActDesc()->fActQuery ||
3357 ResetProgressDialog("", 0, 0, 0);
3358 if (fViewer->GetActDesc()->fLocal) {
3359 if (fViewer->GetActDesc()->fActQuery) {
3361 if (chain) {
3362 ProgressLocal(chain->GetEntries(),
3363 chain->GetReadEntry()+1);
3364 }
3365 else {
3366 ProgressLocal(0, 0);
3367 }
3369 }
3370 }
3371 else {
3372 fTotal->SetText(" Estimated time left : 0 sec (0 events of 0 processed) ");
3373 fRate->SetText(" Processing Rate : 0.0f events/sec ");
3374 frmProg->Reset();
3375 fFB->Layout();
3376 }
3377 return;
3378 }
3380
3381 // Status label
3382 Int_t st = (result->GetStatus() > 0 && result->GetStatus() <=
3383 TQueryResult::kCompleted) ? result->GetStatus() : 0;
3384
3385 Int_t qry = result->GetSeqNum();
3386
3387 buffer = TString::Format("------------------------------------------------------\n");
3388 // Print header
3389 if (!result->IsDraw()) {
3390 const char *fin = result->IsFinalized() ? "finalized" : qst[st];
3391 const char *arc = result->IsArchived() ? "(A)" : "";
3392 buffer = TString::Format(" Query No : %d\n", qry);
3393 buffer += TString::Format(" Ref : \"%s:%s\"\n", result->GetTitle(),
3394 result->GetName());
3395 buffer += TString::Format(" Selector : %s\n",
3396 result->GetSelecImp()->GetTitle());
3397 buffer += TString::Format("Status : %9s%s\n", fin, arc);
3398 buffer += TString::Format("------------------------------------------------------\n");
3399 } else {
3400 buffer += TString::Format(" Query No : %d\n", qry);
3401 buffer += TString::Format(" Ref : \"%s:%s\"\n", result->GetTitle(),
3402 result->GetName());
3403 buffer += TString::Format(" Selector : %s\n",
3404 result->GetSelecImp()->GetTitle());
3405 buffer += TString::Format("------------------------------------------------------\n");
3406 }
3407
3408 // Time information
3409 Int_t elapsed = (Int_t)(result->GetEndTime().Convert() -
3410 result->GetStartTime().Convert());
3411 buffer += TString::Format(" Started : %s\n",
3412 result->GetStartTime().AsString());
3413 buffer += TString::Format(" Real time : %d sec (CPU time: %.1f sec)\n",
3414 elapsed, result->GetUsedCPU());
3415
3416 // Number of events processed, rate, size
3417 Double_t rate = 0.0;
3418 if (result->GetEntries() > -1 && elapsed > 0)
3419 rate = result->GetEntries() / (Double_t)elapsed ;
3420 Float_t size = ((Float_t)result->GetBytes())/(1024*1024);
3421 buffer += TString::Format(" Processed : %lld events (size: %.3f MBs)\n",
3422 result->GetEntries(), size);
3423 buffer += TString::Format(" Rate : %.1f evts/sec\n", rate);
3424
3425 // Package information
3426 if (strlen(result->GetParList()) > 1) {
3427 buffer += TString::Format(" Packages : %s\n", result->GetParList());
3428 }
3429
3430 // Result information
3431 TString res = result->GetResultFile();
3432 if (!result->IsArchived()) {
3433 Int_t dq = res.Index("queries");
3434 if (dq > -1) {
3435 res.Remove(0,res.Index("queries"));
3436 res.Insert(0,"<PROOF_SandBox>/");
3437 }
3438 if (res.BeginsWith("-")) {
3439 res = (result->GetStatus() == TQueryResult::kAborted) ?
3440 "not available" : "sent to client";
3441 }
3442 }
3443 if (res.Length() > 1) {
3444 buffer += TString::Format("------------------------------------------------------\n");
3445 buffer += TString::Format(" Results : %s\n", res.Data());
3446 }
3447
3448 if (result->GetOutputList() && result->GetOutputList()->GetSize() > 0) {
3449 buffer += TString::Format(" Outlist : %d objects\n",
3450 result->GetOutputList()->GetSize());
3451 buffer += TString::Format("------------------------------------------------------\n");
3452 }
3453 fInfoTextView->LoadBuffer(buffer.Data());
3454
3455 //Float_t pos = Float_t((Double_t)(result->GetEntries() * 100)/(Double_t)total);
3456 if (result->GetStatus() == TQueryResult::kAborted)
3457 frmProg->SetBarColor("red");
3458 else if (result->GetStatus() == TQueryResult::kStopped)
3459 frmProg->SetBarColor("yellow");
3460 else
3461 frmProg->SetBarColor("green");
3462
3463 frmProg->SetPosition(100.0);
3464
3465 buffer = TString::Format(" Processed : %lld events in %.1f sec", result->GetEntries(),
3466 (Float_t)elapsed);
3467 fTotal->SetText(buffer.Data());
3468 buffer = TString::Format(" Processing Rate : %.1f events/sec ", rate);
3469 fRate->SetText(buffer.Data());
3470 fFB->Layout();
3471}
3472
3473//////////////////////////////////////////////////////////////////////////////////////////
3474// Output frame
3475
3476////////////////////////////////////////////////////////////////////////////////
3477/// Constructor.
3478
3480 TGCompositeFrame(p, w, h), fEntryTmp(0), fLVContainer(0), fViewer(0)
3481{
3482}
3483
3484////////////////////////////////////////////////////////////////////////////////
3485/// Destructor.
3486
3488{
3489 delete fLVContainer; // this container is inside the TGListView and is not
3490 // deleted automatically
3491 Cleanup();
3492}
3493
3494////////////////////////////////////////////////////////////////////////////////
3495/// Build query output information frame.
3496
3498{
3499 fViewer = gui;
3502
3503 // Container of object TGListView
3504 TGListView *frmListView = new TGListView(this, 340, 190);
3506 fLVContainer->Associate(frmListView);
3509 4, 4, 4, 4));
3510
3511 frmListView->Connect("Clicked(TGLVEntry*, Int_t, Int_t, Int_t)",
3512 "TSessionOutputFrame", this,
3513 "OnElementClicked(TGLVEntry* ,Int_t, Int_t, Int_t)");
3514 frmListView->Connect("DoubleClicked(TGLVEntry*, Int_t, Int_t, Int_t)",
3515 "TSessionOutputFrame", this,
3516 "OnElementDblClicked(TGLVEntry* ,Int_t, Int_t, Int_t)");
3517}
3518
3519////////////////////////////////////////////////////////////////////////////////
3520/// Handle mouse clicks on list view items.
3521
3523 Int_t y)
3524{
3525 TObject *obj = (TObject *)entry->GetUserData();
3526 if ((obj) && (btn ==3)) {
3527 // if right button, popup context menu
3528 fViewer->GetContextMenu()->Popup(x, y, obj, (TBrowser *)0);
3529 }
3530}
3531
3532////////////////////////////////////////////////////////////////////////////////
3533/// Handle double-clicks on list view items.
3534
3536{
3537 char action[512];
3538 TString act;
3539 TObject *obj = (TObject *)entry->GetUserData();
3540 if (!obj) return;
3541 TString ext = obj->GetName();
3542 gPad->SetEditable(kFALSE);
3543 // check default action from root.mimes
3544 if (fClient->GetMimeTypeList()->GetAction(obj->IsA()->GetName(), action)) {
3545 act = TString::Format("((%s*)0x%lx)%s", obj->IsA()->GetName(), (Long_t)obj, action);
3546 if (act[0] == '!') {
3547 act.Remove(0, 1);
3548 gSystem->Exec(act.Data());
3549 } else {
3550 // do not allow browse
3551 if (!act.Contains("Browse"))
3552 gROOT->ProcessLine(act.Data());
3553 }
3554 }
3555}
3556
3557////////////////////////////////////////////////////////////////////////////////
3558/// Add object to output list view.
3559
3561{
3562 TGLVEntry *item;
3563 if (obj) {
3564 item = new TGLVEntry(fLVContainer, obj->GetName(), obj->IsA()->GetName());
3565 item->SetUserData(obj);
3566 fLVContainer->AddItem(item);
3567 }
3568}
3569
3570//////////////////////////////////////////////////////////////////////////////////////////
3571// Input Frame
3572
3573////////////////////////////////////////////////////////////////////////////////
3574/// Constructor.
3575
3577 TGCompositeFrame(p, w, h), fViewer(0), fLVContainer(0)
3578{
3579}
3580
3581////////////////////////////////////////////////////////////////////////////////
3582/// Destructor.
3583
3585{
3586 delete fLVContainer; // this container is inside the TGListView and is not
3587 // deleted automatically
3588 Cleanup();
3589}
3590
3591////////////////////////////////////////////////////////////////////////////////
3592/// Build query input information frame.
3593
3595{
3596 fViewer = gui;
3599
3600 // Container of object TGListView
3601 TGListView *frmListView = new TGListView(this, 340, 190);
3603 fLVContainer->Associate(frmListView);
3606 4, 4, 4, 4));
3607}
3608
3609////////////////////////////////////////////////////////////////////////////////
3610/// Add object to input list view.
3611
3613{
3614 TGLVEntry *item;
3615 if (obj) {
3616 item = new TGLVEntry(fLVContainer, obj->GetName(), obj->IsA()->GetName());
3617 item->SetUserData(obj);
3618 fLVContainer->AddItem(item);
3619 }
3620}
3621
3622//////////////////////////////////////////////////////////////////////////////////////////
3623// Session Viewer Main Frame
3624
3625////////////////////////////////////////////////////////////////////////////////
3626/// Main Session viewer constructor.
3627
3629 TGMainFrame(gClient->GetRoot(), w, h), fSessionHierarchy(0), fSessionItem(0)
3630{
3631 // only one session viewer allowed
3632 if (gSessionViewer)
3633 // coverity[uninit_member]: already done
3634 return;
3635 Build();
3637 Resize(w, h);
3638 gSessionViewer = this;
3639}
3640
3641////////////////////////////////////////////////////////////////////////////////
3642/// Main Session viewer constructor.
3643
3645 UInt_t h) : TGMainFrame(gClient->GetRoot(), w, h),
3646 fSessionHierarchy(0), fSessionItem(0)
3647{
3648 // only one session viewer allowed
3649 if (gSessionViewer)
3650 // coverity[uninit_member]: already done
3651 return;
3652 Build();
3654 Move(x, y);
3655 Resize(w, h);
3656 gSessionViewer = this;
3657}
3658
3659////////////////////////////////////////////////////////////////////////////////
3660/// Read configuration file and populate list of sessions
3661/// list of queries and list of packages.
3662/// Read and set also global options as feedback histos.
3663
3664void TSessionViewer::ReadConfiguration(const char *filename)
3665{
3666 if (fViewerEnv)
3667 delete fViewerEnv;
3668 fViewerEnv = new TEnv();
3669
3670 const char *fn = (filename && strlen(filename)) ? filename : fConfigFile.Data();
3671
3673
3674 Bool_t bval = (Bool_t)fViewerEnv->GetValue("Option.Feedback", 1);
3675 if (bval)
3677 else
3679
3680 bval = (Bool_t)fViewerEnv->GetValue("Option.MasterHistos", 1);
3681 if (bval) {
3683 gEnv->SetValue("Proof.StatsHist", 1);
3684 }
3685 else {
3687 gEnv->SetValue("Proof.StatsHist", 0);
3688 }
3689 bval = (Bool_t)fViewerEnv->GetValue("Option.MasterEvents", 0);
3690 if (bval)
3692 else
3694 bval = (Bool_t)fViewerEnv->GetValue("Option.WorkerEvents", 0);
3695 if (bval)
3697 else
3699
3700 Int_t i = 0;
3701 while (kFeedbackHistos[i]) {
3702 bval = (Bool_t)fViewerEnv->GetValue(Form("Option.%s",kFeedbackHistos[i]),
3703 i == 1 ? 1 : 0);
3704 if (bval)
3705 fCascadeMenu->CheckEntry(41+i);
3706 else
3708 i++;
3709 }
3710 TSessionDescription *proofDesc;
3711 fSessions->Delete();
3712 if (fSessionItem)
3714 else
3716 fBaseIcon);
3717 // add local session description
3719 fLocal, fLocal);
3720 fSessionHierarchy->SetToolTipItem(item, "Local Session");
3721 TSessionDescription *localdesc = new TSessionDescription();
3722 localdesc->fTag = "";
3723 localdesc->fName = "Local";
3724 localdesc->fAddress = "Local";
3725 localdesc->fPort = 0;
3726 localdesc->fConfigFile = "";
3727 localdesc->fLogLevel = 0;
3728 localdesc->fUserName = "";
3729 localdesc->fQueries = new TList();
3730 localdesc->fPackages = new TList();
3731 localdesc->fActQuery = 0;
3732 localdesc->fProof = 0;
3733 localdesc->fProofMgr = 0;
3734 localdesc->fAttached = kFALSE;
3735 localdesc->fConnected = kFALSE;
3736 localdesc->fLocal = kTRUE;
3737 localdesc->fSync = kTRUE;
3738 localdesc->fAutoEnable = kFALSE;
3739 localdesc->fNbHistos = 0;
3740 item->SetUserData(localdesc);
3741 fSessions->Add((TObject *)localdesc);
3742 fActDesc = localdesc;
3743
3744 SysInfo_t info;
3745 gSystem->GetSysInfo(&info);
3746 // if the machine has more than one CPU, add one PROOF lite session
3747 // (not supported on Windows yet)
3748 if (!info.fOS.Contains("Microsoft") && info.fCpus > 1) {
3749 // add proof lite session description
3750 item = fSessionHierarchy->AddItem(fSessionItem, "Lite",
3752 fSessionHierarchy->SetToolTipItem(item, "PROOF Lite");
3753 TSessionDescription *litedesc = new TSessionDescription();
3754 litedesc->fTag = "";
3755 litedesc->fName = "PROOF Lite";
3756 litedesc->fAddress = "lite://";
3757 litedesc->fPort = 0;
3758 litedesc->fConfigFile = "";
3759 litedesc->fLogLevel = 0;
3760 litedesc->fUserName = "";
3761 litedesc->fQueries = new TList();
3762 litedesc->fPackages = new TList();
3763 litedesc->fActQuery = 0;
3764 litedesc->fProof = 0;
3765 litedesc->fProofMgr = 0;
3766 litedesc->fAttached = kFALSE;
3767 litedesc->fConnected = kFALSE;
3768 litedesc->fLocal = kFALSE;
3769 litedesc->fSync = kTRUE;
3770 litedesc->fAutoEnable = kFALSE;
3771 litedesc->fNbHistos = 0;
3772 item->SetUserData(litedesc);
3773 fSessions->Add((TObject *)litedesc);
3774 fActDesc = litedesc;
3775 }
3776 TIter next(fViewerEnv->GetTable());
3777 TEnvRec *er;
3778 while ((er = (TEnvRec*) next())) {
3779 const char *s;
3780 if ((s = strstr(er->GetName(), "SessionDescription."))) {
3781 const char *val = fViewerEnv->GetValue(s, (const char*)0);
3782 if (val) {
3783 Int_t cnt = 0;
3784 char *v = StrDup(val);
3785 s += 7;
3786 while (1) {
3787 TString name = strtok(!cnt ? v : 0, ";");
3788 if (name.IsNull()) break;
3789 TString sessiontag = strtok(0, ";");
3790 TString address = strtok(0, ";");
3791 if (address.IsNull()) break;
3792 TString port = strtok(0, ";");
3793 if (port.IsNull()) break;
3794 TString loglevel = strtok(0, ";");
3795 if (loglevel.IsNull()) break;
3796 TString configfile = strtok(0, ";");
3797 TString user = strtok(0, ";");
3798 if (user.IsNull()) break;
3799 TString sync = strtok(0, ";");
3800 TString autoen = strtok(0, ";");
3801
3802 // build session description
3803 proofDesc = new TSessionDescription();
3804 proofDesc->fTag = sessiontag.Length() > 2 ? sessiontag.Data() : "";
3805 proofDesc->fName = name;
3806 proofDesc->fAddress = address;
3807 proofDesc->fPort = atoi(port);
3808 proofDesc->fConfigFile = configfile.Length() > 2 ? configfile.Data() : "";
3809 proofDesc->fLogLevel = atoi(loglevel);
3810 proofDesc->fConnected = kFALSE;
3811 proofDesc->fAttached = kFALSE;
3812 proofDesc->fLocal = kFALSE;
3813 proofDesc->fQueries = new TList();
3814 proofDesc->fPackages = new TList();
3815 proofDesc->fActQuery = 0;
3816 proofDesc->fProof = 0;
3817 proofDesc->fProofMgr = 0;
3818 proofDesc->fSync = (Bool_t)(atoi(sync));
3819 proofDesc->fAutoEnable = (Bool_t)(atoi(autoen));
3820 proofDesc->fUserName = user;
3821 fSessions->Add((TObject *)proofDesc);
3822 item = fSessionHierarchy->AddItem(
3823 fSessionItem, proofDesc->fName.Data(),
3825 fSessionHierarchy->SetToolTipItem(item, "Proof Session");
3826 item->SetUserData(proofDesc);
3827 fActDesc = proofDesc;
3828 cnt++;
3829 }
3830 delete [] v;
3831 }
3832 }
3833 if ((s = strstr(er->GetName(), "QueryDescription."))) {
3834 const char *val = fViewerEnv->GetValue(s, (const char*)0);
3835 if (val) {
3836 Int_t cnt = 0;
3837 char *v = StrDup(val);
3838 s += 7;
3839 while (1) {
3840
3841 TString status = strtok(!cnt ? v : 0, ";");
3842 if (status.IsNull()) break;
3843
3844 TString reference = strtok(0, ";");
3845 if (reference.IsNull()) break;
3846 TString queryname = strtok(0, ";");
3847 if (queryname.IsNull()) break;
3848 TString selector = strtok(0, ";");
3849 if (selector.IsNull()) break;
3850 TString dset = strtok(0, ";");
3851 TString options = strtok(0, ";");
3852 TString eventlist = strtok(0, ";");
3853 TString nbfiles = strtok(0, ";");
3854 TString nbentries = strtok(0, ";");
3855 TString firstentry = strtok(0, ";");
3856
3857 TQueryDescription *newquery = new TQueryDescription();
3858 newquery->fStatus =
3860 newquery->fSelectorString = selector.Length() > 2 ? selector.Data() : "";
3861 newquery->fReference = reference.Length() > 2 ? reference.Data() : "";
3862 newquery->fTDSetString = dset.Length() > 2 ? dset.Data() : "";
3863 newquery->fQueryName = queryname.Length() > 2 ? queryname.Data() : "";
3864 newquery->fOptions = options.Length() > 2 ? options.Data() : "";
3865 newquery->fEventList = eventlist.Length() > 2 ? eventlist.Data() : "";
3866 newquery->fNbFiles = atoi(nbfiles);
3867 newquery->fNoEntries = atoi(nbentries);
3868 newquery->fFirstEntry = atoi(firstentry);
3869 newquery->fResult = 0;
3870 newquery->fChain = 0;
3871 fActDesc->fQueries->Add((TObject *)newquery);
3872 cnt++;
3876 item1, newquery->fQueryName, fQueryCon, fQueryCon);
3877 item2->SetUserData(newquery);
3878 }
3879 delete [] v;
3880 }
3881 }
3882 }
3885 if (fActDesc == localdesc) {
3888 }
3889 else {
3893 }
3896}
3897
3898////////////////////////////////////////////////////////////////////////////////
3899/// Update list of existing Proof sessions.
3900
3902{
3903 // get list of proof sessions
3904 Bool_t found = kFALSE;
3905 Bool_t exists = kFALSE;
3906 TGListTreeItem *item = 0;
3907 TSeqCollection *proofs = gROOT->GetListOfProofs();
3908 TSessionDescription *desc = 0;
3909 TSessionDescription *newdesc;
3910 if (proofs) {
3911 TObject *o = proofs->First();
3912 if (o && dynamic_cast<TProofMgr *>(o)) {
3913 TProofMgr *mgr = dynamic_cast<TProofMgr *>(o);
3914 if (mgr && mgr->QuerySessions("L")) {
3915 TIter nxd(mgr->QuerySessions("L"));
3916 TProofDesc *d = 0;
3917 TProof *p = 0;
3918 while ((d = (TProofDesc *)nxd())) {
3919 TIter nextfs(fSessions);
3920 // check if session exists in the list
3921 exists = kFALSE;
3922 while ((desc = (TSessionDescription *)nextfs())) {
3923 if ((desc->fTag == d->GetName()) ||
3924 (desc->fName == d->GetTitle())) {
3925 exists = kTRUE;
3926 break;
3927 }
3928 }
3929 TIter nexts(fSessions);
3930 found = kFALSE;
3931 p = d->GetProof();
3932 while ((desc = (TSessionDescription *)nexts())) {
3933 if (desc->fConnected && desc->fAttached)
3934 continue;
3935 if (p && ((exists && ((desc->fTag == d->GetName()) ||
3936 (desc->fName == d->GetTitle()))) ||
3937 (!exists && (desc->fAddress == p->GetMaster())))) {
3938 desc->fConnected = kTRUE;
3939 desc->fAttached = kTRUE;
3940 desc->fProof = p;
3941 desc->fProofMgr = mgr;
3942 desc->fTag = d->GetName();
3944 desc);
3945 if (item) {
3947 if (item == fSessionHierarchy->GetSelected()) {
3948 fActDesc->fProof->Connect("Progress(Long64_t,Long64_t)",
3949 "TSessionQueryFrame", fQueryFrame,
3950 "Progress(Long64_t,Long64_t)");
3951 fActDesc->fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
3952 "TSessionQueryFrame", fQueryFrame,
3953 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
3954 fActDesc->fProof->Connect("StopProcess(Bool_t)",
3955 "TSessionQueryFrame", fQueryFrame,
3956 "IndicateStop(Bool_t)");
3958 "ResetProgressDialog(const char*, Int_t,Long64_t,Long64_t)",
3959 "TSessionQueryFrame", fQueryFrame,
3960 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)");
3961 // enable timer used for status bar icon's animation
3962 EnableTimer();
3963 // change status bar right icon to connected pixmap
3964 ChangeRightLogo("monitor01.xpm");
3965 // do not animate yet
3967 // connect to signal "query result ready"
3968 fActDesc->fProof->Connect("QueryResultReady(char *)",
3969 "TSessionViewer", this, "QueryResultReady(char *)");
3970 // display connection information on status bar
3971 TString msg;
3972 msg.Form("PROOF Cluster %s ready", fActDesc->fName.Data());
3973 fStatusBar->SetText(msg.Data(), 1);
3986 // update session information frame
3989 if (fActFrame != fSessionFrame) {
3993 }
3994 }
3995 }
3996 if (desc->fLogLevel < 0)
3997 desc->fLogLevel = 0;
3998 found = kTRUE;
3999 break;
4000 }
4001 }
4002 if (found) continue;
4003 newdesc = new TSessionDescription();
4004 // and fill information from Proof session
4005 newdesc->fTag = d->GetName();
4006 newdesc->fName = d->GetTitle();
4007 newdesc->fAddress = d->GetTitle();
4008 newdesc->fConnected = kFALSE;
4009 newdesc->fAttached = kFALSE;
4010 newdesc->fProofMgr = mgr;
4011 p = d->GetProof();
4012 if (p) {
4013 newdesc->fConnected = kTRUE;
4014 newdesc->fAttached = kTRUE;
4015 if (p->IsLite())
4016 newdesc->fAddress = "lite://";
4017 else
4018 newdesc->fAddress = p->GetMaster();
4019 newdesc->fConfigFile = p->GetConfFile();
4020 newdesc->fUserName = p->GetUser();
4021 newdesc->fPort = p->GetPort();
4022 newdesc->fLogLevel = p->GetLogLevel();
4023 newdesc->fProof = p;
4024 newdesc->fProof->Connect("Progress(Long64_t,Long64_t)",
4025 "TSessionQueryFrame", fQueryFrame,
4026 "Progress(Long64_t,Long64_t)");
4027 newdesc->fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
4028 "TSessionQueryFrame", fQueryFrame,
4029 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
4030 newdesc->fProof->Connect("StopProcess(Bool_t)",
4031 "TSessionQueryFrame", fQueryFrame,
4032 "IndicateStop(Bool_t)");
4033 newdesc->fProof->Connect(
4034 "ResetProgressDialog(const char*, Int_t,Long64_t,Long64_t)",
4035 "TSessionQueryFrame", fQueryFrame,
4036 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)");
4037 // enable timer used for status bar icon's animation
4038 EnableTimer();
4039 // change status bar right icon to connected pixmap
4040 ChangeRightLogo("monitor01.xpm");
4041 // do not animate yet
4043 // connect to signal "query result ready"
4044 newdesc->fProof->Connect("QueryResultReady(char *)",
4045 "TSessionViewer", this, "QueryResultReady(char *)");
4046 }
4047 newdesc->fQueries = new TList();
4048 newdesc->fPackages = new TList();
4049 if (newdesc->fLogLevel < 0)
4050 newdesc->fLogLevel = 0;
4051 newdesc->fActQuery = 0;
4052 newdesc->fLocal = kFALSE;
4053 newdesc->fSync = kFALSE;
4054 newdesc->fAutoEnable = kFALSE;
4055 newdesc->fNbHistos = 0;
4056 // add new session description in list tree
4057 if (p)
4058 item = fSessionHierarchy->AddItem(fSessionItem, newdesc->fName.Data(),
4060 else
4061 item = fSessionHierarchy->AddItem(fSessionItem, newdesc->fName.Data(),
4063 fSessionHierarchy->SetToolTipItem(item, "Proof Session");
4064 item ->SetUserData(newdesc);
4065 // and in our session description list
4066 fSessions->Add(newdesc);
4067 }
4068 }
4069 return;
4070 }
4071 TIter nextp(proofs);
4072 TProof *proof;
4073 // loop over existing Proof sessions
4074 while ((proof = (TProof *)nextp())) {
4075 TIter nexts(fSessions);
4076 found = kFALSE;
4077 // check if session is already in the list
4078 while ((desc = (TSessionDescription *)nexts())) {
4079 if (desc->fProof == proof) {
4080 desc->fConnected = kTRUE;
4081 desc->fAttached = kTRUE;
4082 found = kTRUE;
4083 break;
4084 }
4085 }
4086 if (found) continue;
4087 // create new session description
4088 newdesc = new TSessionDescription();
4089 // and fill information from Proof session
4090 newdesc->fName = proof->GetMaster();
4091 newdesc->fConfigFile = proof->GetConfFile();
4092 newdesc->fUserName = proof->GetUser();
4093 newdesc->fPort = proof->GetPort();
4094 newdesc->fLogLevel = proof->GetLogLevel();
4095 if (newdesc->fLogLevel < 0)
4096 newdesc->fLogLevel = 0;
4097 if (proof->IsLite())
4098 newdesc->fAddress = "lite://";
4099 else
4100 newdesc->fAddress = proof->GetMaster();
4101 newdesc->fQueries = new TList();
4102 newdesc->fPackages = new TList();
4103 newdesc->fProof = proof;
4104 newdesc->fActQuery = 0;
4105 newdesc->fConnected = kTRUE;
4106 newdesc->fAttached = kTRUE;
4107 newdesc->fLocal = kFALSE;
4108 newdesc->fSync = kFALSE;
4109 newdesc->fAutoEnable = kFALSE;
4110 newdesc->fNbHistos = 0;
4111 // add new session description in list tree
4112 item = fSessionHierarchy->AddItem(fSessionItem, newdesc->fName.Data(),
4114 fSessionHierarchy->SetToolTipItem(item, "Proof Session");
4115 item ->SetUserData(newdesc);
4116 // and in our session description list
4117 fSessions->Add(newdesc);
4118 }
4119 }
4120}
4121
4122////////////////////////////////////////////////////////////////////////////////
4123/// Update list of existing Proof sessions.
4124
4126{
4127 // get list of proof sessions
4128 TGListTreeItem *item;
4129 TList *sessions = fActDesc->fProofMgr->QuerySessions("");
4130 if (sessions) {
4131 TIter nextp(sessions);
4132 TProofDesc *pdesc;
4133 TProof *proof;
4134 TSessionDescription *newdesc;
4135 // loop over existing Proof sessions
4136 while ((pdesc = (TProofDesc *)nextp())) {
4137 TIter nexts(fSessions);
4138 TSessionDescription *desc = 0;
4139 Bool_t found = kFALSE;
4140 // check if session is already in the list
4141 while ((desc = (TSessionDescription *)nexts())) {
4142 if ((desc->fTag == pdesc->GetName()) ||
4143 (desc->fName == pdesc->GetTitle())) {
4144 desc->fConnected = kTRUE;
4145 found = kTRUE;
4146 break;
4147 }
4148 }
4149 if (found) continue;
4150 // create new session description
4151 newdesc = new TSessionDescription();
4152 // and fill information from Proof session
4153 newdesc->fTag = pdesc->GetName();
4154 newdesc->fName = pdesc->GetTitle();
4155 proof = pdesc->GetProof();
4156 if (proof) {
4157 newdesc->fConfigFile = proof->GetConfFile();
4158 newdesc->fUserName = proof->GetUser();
4159 newdesc->fPort = proof->GetPort();
4160 newdesc->fLogLevel = proof->GetLogLevel();
4161 if (newdesc->fLogLevel < 0)
4162 newdesc->fLogLevel = 0;
4163 if (proof->IsLite())
4164 newdesc->fAddress = "lite://";
4165 else
4166 newdesc->fAddress = proof->GetMaster();
4167 newdesc->fProof = proof;
4168 }
4169 else {
4170 newdesc->fProof = 0;
4171 newdesc->fConfigFile = "";
4172 newdesc->fUserName = fActDesc->fUserName;
4173 newdesc->fPort = fActDesc->fPort;
4174 newdesc->fLogLevel = 0;
4175 newdesc->fAddress = fActDesc->fAddress;
4176 }
4177 newdesc->fQueries = new TList();
4178 newdesc->fPackages = new TList();
4179 newdesc->fProofMgr = fActDesc->fProofMgr;
4180 newdesc->fActQuery = 0;
4181 newdesc->fConnected = kTRUE;
4182 newdesc->fAttached = kFALSE;
4183 newdesc->fLocal = kFALSE;
4184 newdesc->fSync = kFALSE;
4185 newdesc->fAutoEnable = kFALSE;
4186 newdesc->fNbHistos = 0;
4187 // add new session description in list tree
4188 item = fSessionHierarchy->AddItem(fSessionItem, newdesc->fName.Data(),
4190 fSessionHierarchy->SetToolTipItem(item, "Proof Session");
4191 item ->SetUserData(newdesc);
4192 // and in our session description list
4193 fSessions->Add(newdesc);
4194 // set actual description to the last one
4195 }
4196 }
4197}
4198
4199////////////////////////////////////////////////////////////////////////////////
4200/// Save actual configuration in config file "filename".
4201
4202void TSessionViewer::WriteConfiguration(const char *filename)
4203{
4204 TSessionDescription *session;
4205 TQueryDescription *query;
4206 Int_t scnt = 0, qcnt = 1;
4207 const char *fname = filename ? filename : fConfigFile.Data();
4208
4209 delete fViewerEnv;
4210 gSystem->Unlink(fname);
4211 fViewerEnv = new TEnv();
4212
4213 fViewerEnv->SetValue("Option.Feedback",
4215 fViewerEnv->SetValue("Option.MasterHistos",
4217 fViewerEnv->SetValue("Option.MasterEvents",
4219 fViewerEnv->SetValue("Option.WorkerEvents",
4221
4222 Int_t i = 0;
4223 // browse list of feedback histos and check user's selected ones
4224 while (kFeedbackHistos[i]) {
4225 fViewerEnv->SetValue(Form("Option.%s",kFeedbackHistos[i]),
4227 i++;
4228 }
4229
4231 while ((session = (TSessionDescription *) snext())) {
4232 if ((scnt > 0) && ((session->fAddress.Length() < 3) ||
4233 session->fUserName.Length() < 2)) {
4234 // skip gROOT's list of sessions
4235 continue;
4236 }
4237 if ((scnt > 0) && (session->fName == session->fAddress)) {
4238 // skip gROOT's list of proofs
4239 continue;
4240 }
4241 TString sessionstring;
4242 sessionstring += session->fName;
4243 sessionstring += ";";
4244 sessionstring += session->fTag.Length() > 1 ? session->fTag.Data() : " ";
4245 sessionstring += ";";
4246 sessionstring += session->fAddress;
4247 sessionstring += ";";
4248 sessionstring += TString::Format("%d", session->fPort);
4249 sessionstring += ";";
4250 sessionstring += TString::Format("%d", session->fLogLevel);
4251 sessionstring += ";";
4252 sessionstring += session->fConfigFile.Length() > 1 ? session->fConfigFile.Data() : " ";
4253 sessionstring += ";";
4254 sessionstring += session->fUserName;
4255 sessionstring += ";";
4256 sessionstring += TString::Format("%d", session->fSync);
4257 sessionstring += ";";
4258 sessionstring += TString::Format("%d", session->fAutoEnable);
4259 if (scnt > 0) // skip local session
4260 fViewerEnv->SetValue(Form("SessionDescription.%d",scnt), sessionstring);
4261 scnt++;
4262
4263 TIter qnext(session->fQueries);
4264 while ((query = (TQueryDescription *) qnext())) {
4265 TString querystring;
4266 querystring += TString::Format("%d", query->fStatus);
4267 querystring += ";";
4268 querystring += query->fReference.Length() > 1 ? query->fReference.Data() : " ";
4269 querystring += ";";
4270 querystring += query->fQueryName;
4271 querystring += ";";
4272 querystring += query->fSelectorString.Length() > 1 ? query->fSelectorString.Data() : " ";
4273 querystring += ";";
4274 querystring += query->fTDSetString.Length() > 1 ? query->fTDSetString.Data() : " ";
4275 querystring += ";";
4276 querystring += query->fOptions.Length() > 1 ? query->fOptions.Data() : " ";
4277 querystring += ";";
4278 querystring += query->fEventList.Length() > 1 ? query->fEventList.Data() : " ";
4279 querystring += ";";
4280 querystring += TString::Format("%d",query->fNbFiles);
4281 querystring += ";";
4282 querystring += TString::Format("%lld",query->fNoEntries);
4283 querystring += ";";
4284 querystring += TString::Format("%lld",query->fFirstEntry);
4285 fViewerEnv->SetValue(Form("QueryDescription.%d",qcnt), querystring);
4286 qcnt++;
4287 }
4288 }
4289
4290 fViewerEnv->WriteFile(fname);
4291}
4292
4293////////////////////////////////////////////////////////////////////////////////
4294/// Build main session viewer frame and subframes.
4295
4297{
4298 TString buf;
4299 fActDesc = 0;
4300 fActFrame = 0;
4301 fLogWindow = 0;
4302 fBusy = kFALSE;
4303 fAutoSave = kTRUE;
4305 fStart = fElapsed = 0;
4306
4308 // set minimun size
4309 SetWMSizeHints(400 + 200, 370+50, 2000, 1000, 1, 1);
4310
4311 // collect icons
4312 fLocal = fClient->GetPicture("local_session.xpm");
4313 fProofCon = fClient->GetPicture("proof_connected.xpm");
4314 fProofDiscon = fClient->GetPicture("proof_disconnected.xpm");
4315 fQueryCon = fClient->GetPicture("query_connected.xpm");
4316 fQueryDiscon = fClient->GetPicture("query_disconnected.xpm");
4317 fBaseIcon = fClient->GetPicture("proof_base.xpm");
4318
4319 //--- File menu
4321 fFileMenu->AddEntry("&Load Config...", kFileLoadConfig);
4322 fFileMenu->AddEntry("&Save Config...", kFileSaveConfig);
4324 fFileMenu->AddEntry("&Close Viewer", kFileCloseViewer);
4326 fFileMenu->AddEntry("&Quit ROOT", kFileQuit);
4327
4328 //--- Session menu
4329 fSessionMenu = new TGPopupMenu(gClient->GetDefaultRoot());
4330 fSessionMenu->AddLabel("Session Management");
4332 fSessionMenu->AddEntry("&New Session", kSessionNew);
4333 fSessionMenu->AddEntry("&Add to the list", kSessionAdd);
4336 fSessionMenu->AddEntry("&Connect...", kSessionConnect);
4337 fSessionMenu->AddEntry("&Disconnect", kSessionDisconnect);
4338 fSessionMenu->AddEntry("Shutdo&wn", kSessionShutdown);
4339 fSessionMenu->AddEntry("&Show status",kSessionShowStatus);
4340 fSessionMenu->AddEntry("&Get Queries",kSessionGetQueries);
4345
4346 //--- Query menu
4347 fQueryMenu = new TGPopupMenu(gClient->GetDefaultRoot());
4348 fQueryMenu->AddLabel("Query Management");
4350 fQueryMenu->AddEntry("&New...", kQueryNew);
4351 fQueryMenu->AddEntry("&Edit", kQueryEdit);
4352 fQueryMenu->AddEntry("&Submit", kQuerySubmit);
4354 fQueryMenu->AddEntry("Start &Viewer", kQueryStartViewer);
4356 fQueryMenu->AddEntry("&Delete", kQueryDelete);
4357
4358 fViewerEnv = 0;
4359#ifdef WIN32
4361#else
4363#endif
4364
4366 Int_t i = 0;
4367 while (kFeedbackHistos[i]) {
4369 i++;
4370 }
4371 fCascadeMenu->AddEntry("User defined...", 50);
4372 // disable it for now (until implemented)
4374
4375 //--- Options menu
4377 fOptionsMenu->AddLabel("Global Options");
4379 fOptionsMenu->AddEntry("&Autosave Config", kOptionsAutoSave);
4381 fOptionsMenu->AddEntry("Master &Histos", kOptionsStatsHist);
4382 fOptionsMenu->AddEntry("&Master Events", kOptionsStatsTrace);
4383 fOptionsMenu->AddEntry("&Worker Events", kOptionsSlaveStatsTrace);
4385 fOptionsMenu->AddEntry("Feedback &Active", kOptionsFeedback);
4387 fOptionsMenu->AddPopup("&Feedback Histos", fCascadeMenu);
4389
4390 //--- Help menu
4391 fHelpMenu = new TGPopupMenu(gClient->GetDefaultRoot());
4392 fHelpMenu->AddEntry("&About ROOT...", kHelpAbout);
4393
4394 fFileMenu->Associate(this);
4395 fSessionMenu->Associate(this);
4396 fQueryMenu->Associate(this);
4397 fOptionsMenu->Associate(this);
4398 fCascadeMenu->Associate(this);
4399 fHelpMenu->Associate(this);
4400
4401 //--- create menubar and add popup menus
4402 fMenuBar = new TGMenuBar(this, 1, 1, kHorizontalFrame);
4403
4405 kLHintsLeft, 0, 4, 0, 0));
4407 kLHintsLeft, 0, 4, 0, 0));
4409 kLHintsLeft, 0, 4, 0, 0));
4411 kLHintsLeft, 0, 4, 0, 0));
4413 kLHintsRight));
4414
4415 TGHorizontal3DLine *toolBarSep = new TGHorizontal3DLine(this);
4416 AddFrame(toolBarSep, new TGLayoutHints(kLHintsTop | kLHintsExpandX));
4417
4419 kLHintsExpandX, 0, 0, 1, 1));
4420
4421 toolBarSep = new TGHorizontal3DLine(this);
4422 AddFrame(toolBarSep, new TGLayoutHints(kLHintsTop | kLHintsExpandX));
4423
4424 //---- toolbar
4425
4426 int spacing = 8;
4427 fToolBar = new TGToolBar(this, 60, 20, kHorizontalFrame);
4428 for (int ii = 0; xpm_toolbar[ii]; ii++) {
4429 tb_data[ii].fPixmap = xpm_toolbar[ii];
4430 if (strlen(xpm_toolbar[ii]) == 0) {
4431 spacing = 8;
4432 continue;
4433 }
4434 fToolBar->AddButton(this, &tb_data[ii], spacing);
4435 spacing = 0;
4436 }
4438 toolBarSep = new TGHorizontal3DLine(this);
4439 AddFrame(toolBarSep, new TGLayoutHints(kLHintsTop | kLHintsExpandX));
4442
4445 fPopupSrv->AddEntry("Disconnect",kSessionDisconnect);
4446 fPopupSrv->AddEntry("Shutdown",kSessionShutdown);
4448 fPopupSrv->AddEntry("Show status",kSessionShowStatus);
4449 fPopupSrv->AddEntry("Delete", kSessionDelete);
4450 fPopupSrv->AddEntry("Get Queries",kSessionGetQueries);
4452 fPopupSrv->AddEntry("Cleanup", kSessionCleanup);
4454 fPopupSrv->Connect("Activated(Int_t)","TSessionViewer", this,
4455 "MyHandleMenu(Int_t)");
4456
4458 fPopupQry->AddEntry("Edit",kQueryEdit);
4459 fPopupQry->AddEntry("Submit",kQuerySubmit);
4461 fPopupQry->AddEntry("Start &Viewer", kQueryStartViewer);
4463 fPopupQry->AddEntry("Delete",kQueryDelete);
4464 fPopupQry->Connect("Activated(Int_t)","TSessionViewer", this,
4465 "MyHandleMenu(Int_t)");
4466
4467
4482
4483 //--- Horizontal mother frame -----------------------------------------------
4484 fHf = new TGHorizontalFrame(this, 10, 10);
4486
4487 //--- fV1 -------------------------------------------------------------------
4488 fV1 = new TGVerticalFrame(fHf, 100, 100, kFixedWidth);
4490
4491 fTreeView = new TGCanvas(fV1, 100, 200, kSunkenFrame | kDoubleBorder);
4493 2, 0, 0, 0));
4496 fSessionHierarchy->Connect("Clicked(TGListTreeItem*,Int_t,Int_t,Int_t)",
4497 "TSessionViewer", this,
4498 "OnListTreeClicked(TGListTreeItem*, Int_t, Int_t, Int_t)");
4499 fSessionHierarchy->Connect("DoubleClicked(TGListTreeItem*,Int_t)",
4500 "TSessionViewer", this,
4501 "OnListTreeDoubleClicked(TGListTreeItem*, Int_t)");
4503
4504 //--- fV2 -------------------------------------------------------------------
4505 fV2 = new TGVerticalFrame(fHf, 350, 310);
4507
4508 //--- Server Frame ----------------------------------------------------------
4509 fServerFrame = new TSessionServerFrame(fV2, 350, 310);
4510 fSessions = new TList;
4512 fServerFrame->Build(this);
4514 kLHintsExpandY, 2, 0, 1, 2));
4515
4516 //--- Session Frame ---------------------------------------------------------
4517 fSessionFrame = new TSessionFrame(fV2, 350, 310);
4518 fSessionFrame->Build(this);
4520 kLHintsExpandY, 2, 0, 1, 2));
4521
4522 //--- Query Frame -----------------------------------------------------------
4523 fQueryFrame = new TSessionQueryFrame(fV2, 350, 310);
4524 fQueryFrame->Build(this);
4526 kLHintsExpandY, 2, 0, 1, 2));
4527
4528 //--- Output Frame ----------------------------------------------------------
4529 fOutputFrame = new TSessionOutputFrame(fV2, 350, 310);
4530 fOutputFrame->Build(this);
4532 kLHintsExpandY, 2, 0, 1, 2));
4533
4534 //--- Input Frame -----------------------------------------------------------
4535 fInputFrame = new TSessionInputFrame(fV2, 350, 310);
4536 fInputFrame->Build(this);
4538 kLHintsExpandY, 2, 0, 1, 2));
4539
4541
4542 // add vertical splitter between list tree and frames
4544 splitter->SetFrame(fV1, kTRUE);
4548
4551
4554
4555 // if description available, update server infos frame
4556 if (fActDesc) {
4557 if (!fActDesc->fLocal) {
4559 }
4560 else {
4563 }
4564 }
4565
4566 //--- Status Bar ------------------------------------------------------------
4567 int parts[] = { 36, 49, 15 };
4568 fStatusBar = new TGStatusBar(this, 10, 10);
4570 fStatusBar->SetParts(parts, 3);
4571 for (int p = 0; p < 3; ++p)
4574 kLHintsExpandX, 0, 0, 1, 1));
4575
4576 // connection icon (animation) and time info
4577 fStatusBar->SetText(" 00:00:00", 2);
4578 TGCompositeFrame *leftpart = fStatusBar->GetBarPart(2);
4579 fRightIconPicture = (TGPicture *)fClient->GetPicture("proof_disconnected.xpm");
4580 fRightIcon = new TGIcon(leftpart, fRightIconPicture,
4582 leftpart->AddFrame(fRightIcon, new TGLayoutHints(kLHintsLeft, 2, 0, 0, 0));
4583
4584 // connection progress bar
4585 TGCompositeFrame *rightpart = fStatusBar->GetBarPart(0);
4588 fConnectProg->SetBarColor("green");
4589 rightpart->AddFrame(fConnectProg, new TGLayoutHints(kLHintsExpandX, 1, 1, 1, 1));
4590
4591 // add user info
4593 buf.Form("User : %s - %s", fUserGroup->fRealName.Data(),
4595 fStatusBar->SetText(buf.Data(), 1);
4596
4597 fTimer = 0;
4598
4599 // create context menu
4600 fContextMenu = new TContextMenu("SessionViewerContextMenu") ;
4601
4602 SetWindowName("ROOT Session Viewer");
4603 MapSubwindows();
4604 MapWindow();
4605
4606 // hide frames
4616 Resize(610, 420);
4617}
4618
4619////////////////////////////////////////////////////////////////////////////////
4620/// Destructor.
4621
4623{
4624 delete fUserGroup;
4625 if (gSessionViewer == this)
4626 gSessionViewer = 0;
4627}
4628
4629////////////////////////////////////////////////////////////////////////////////
4630/// Handle mouse clicks in list tree.
4631
4633 Int_t x, Int_t y)
4634{
4635 TList *objlist;
4636 TObject *obj;
4637 TString msg;
4638
4642 if (entry->GetParent() == 0) { // PROOF
4643 // switch frames only if actual one doesn't match
4644 if (fActFrame != fServerFrame) {
4648 }
4657 }
4658 else if (entry->GetParent()->GetParent() == 0) { // Server
4659 if (entry->GetUserData()) {
4660 obj = (TObject *)entry->GetUserData();
4661 if (!obj || obj->IsA() != TSessionDescription::Class())
4662 return;
4663 // update server frame information
4666 // if Proof valid, update connection infos
4669 fActDesc->fProof->cd();
4670 msg.Form("PROOF Cluster %s ready", fActDesc->fName.Data());
4671 }
4672 else {
4673 msg.Form("PROOF Cluster %s not connected", fActDesc->fName.Data());
4674 }
4675 fStatusBar->SetText(msg.Data(), 1);
4676 }
4677 if ((fActDesc->fConnected) && (fActDesc->fAttached)) {
4684 }
4685 else {
4690 }
4691 // local session
4692 if (fActDesc->fLocal) {
4693 if (fActFrame != fSessionFrame) {
4699 }
4703 }
4704 // proof session not connected
4705 if ((!fActDesc->fLocal) && (!fActDesc->fAttached) &&
4706 (fActFrame != fServerFrame)) {
4710 }
4711 // proof session connected
4712 if ((!fActDesc->fLocal) && (fActDesc->fConnected) &&
4713 (fActDesc->fAttached)) {
4714 if (fActFrame != fSessionFrame) {
4718 }
4720 }
4723 if (fActDesc->fAutoEnable)
4725 else
4727 // update session information frame
4732 }
4733 else if (entry->GetParent()->GetParent()->GetParent() == 0) { // query
4734 obj = (TObject *)entry->GetParent()->GetUserData();
4735 if (obj && obj->IsA() == TSessionDescription::Class()) {
4737 }
4738 obj = (TObject *)entry->GetUserData();
4739 if (obj && obj->IsA() == TQueryDescription::Class()) {
4741 }
4742 // update query information and buttons state
4745 if (fActFrame != fQueryFrame) {
4749 }
4750 if ((fActDesc->fConnected) && (fActDesc->fAttached) &&
4755 // trick to update feedback histos
4756 OnCascadeMenu();
4757 }
4758 else { // a list (input, output)
4759 obj = (TObject *)entry->GetParent()->GetParent()->GetUserData();
4760 if (obj && obj->IsA() == TSessionDescription::Class()) {
4762 }
4763 obj = (TObject *)entry->GetParent()->GetUserData();
4764 if (obj && obj->IsA() == TQueryDescription::Class()) {
4766 }
4767 if (fActDesc->fActQuery) {
4768 // update input/output list views
4771 if (fActDesc->fActQuery->fResult) {
4772 objlist = fActDesc->fActQuery->fResult->GetOutputList();
4773 if (objlist) {
4774 TIter nexto(objlist);
4775 while ((obj = (TObject *) nexto())) {
4776 fOutputFrame->AddObject(obj);
4777 }
4778 }
4779 objlist = fActDesc->fActQuery->fResult->GetInputList();
4780 if (objlist) {
4781 TIter nexti(objlist);
4782 while ((obj = (TObject *) nexti())) {
4783 fInputFrame->AddObject(obj);
4784 }
4785 }
4786 }
4787 else {
4788 TChain *chain = (TChain *)fActDesc->fActQuery->fChain;
4789 if (chain && chain->GetPlayer()) {
4790 objlist = chain->GetPlayer()->GetSelectorFromFile()->GetOutputList();
4791 if (objlist) {
4792 TIter nexto(objlist);
4793 while ((obj = (TObject *) nexto())) {
4794 fOutputFrame->AddObject(obj);
4795 }
4796 }
4797 }
4798 }
4803 }
4804 // switch frames
4805 if (strstr(entry->GetText(),"Output")) {
4806 if (fActFrame != fOutputFrame) {
4810 }
4811 }
4812 else if (strstr(entry->GetText(),"Input")) {
4813 if (fActFrame != fInputFrame) {
4817 }
4818 }
4819 }
4820 if (btn == 3) { // right button
4821 // place popup menus
4823 if (!item) return;
4824 obj = (TObject *)item->GetUserData();
4825 if (obj && obj->IsA() == TQueryDescription::Class()) {
4826 fPopupQry->PlaceMenu(x, y, 1, 1);
4827 }
4828 else if (obj && obj->IsA() == TSessionDescription::Class()) {
4829 if (!fActDesc->fLocal)
4830 fPopupSrv->PlaceMenu(x, y, 1, 1);
4831 }
4832 }
4833 // enable / disable menu entries
4851 }
4852 else {
4857 if (entry->GetParent() != 0)
4872 }
4873 if (fActDesc->fLocal) {
4886 }
4887}
4888
4889////////////////////////////////////////////////////////////////////////////////
4890/// Handle mouse double clicks in list tree (connect to server).
4891
4893{
4894 if (entry == fSessionItem)
4895 return;
4896 if (entry->GetParent()->GetParent() == 0) { // Server
4897 if (entry->GetUserData()) {
4898 TObject *obj = (TObject *)entry->GetUserData();
4899 if ((!obj) || (obj->IsA() != TSessionDescription::Class()))
4900 return;
4902 // if Proof valid, update connection infos
4903 }
4904 if ((!fActDesc->fLocal) && ((!fActDesc->fConnected) ||
4905 (!fActDesc->fAttached))) {
4907 }
4908 }
4909}
4910
4911////////////////////////////////////////////////////////////////////////////////
4912/// Terminate Session : save configuration, clean temporary files and close
4913/// Proof connections.
4914
4916{
4917 // clean-up temporary files
4918 TString pathtmp;
4920 if (!gSystem->AccessPathName(pathtmp)) {
4921 gSystem->Unlink(pathtmp);
4922 }
4924 if (!gSystem->AccessPathName(pathtmp)) {
4925 gSystem->Unlink(pathtmp);
4926 }
4927 // close opened Proof sessions (if any)
4928 TIter next(fSessions);
4929 TSessionDescription *desc = 0;
4930 while ((desc = (TSessionDescription *)next())) {
4931 if (desc->fAttached && desc->fProof &&
4932 desc->fProof->IsValid())
4933 desc->fProof->Detach();
4934 }
4935 // Save configuration
4936 if (fAutoSave)
4938}
4939
4940////////////////////////////////////////////////////////////////////////////////
4941/// Close main Session Viewer window.
4942
4944{
4945 // clean-up temporary files
4946 TString pathtmp;
4948 if (!gSystem->AccessPathName(pathtmp)) {
4949 gSystem->Unlink(pathtmp);
4950 }
4952 if (!gSystem->AccessPathName(pathtmp)) {
4953 gSystem->Unlink(pathtmp);
4954 }
4955 // Save configuration
4956 if (fAutoSave)
4958 Cleanup();
4959 fSessions->Delete();
4960 if (fSessionItem)
4962 delete fSessionHierarchy; // this has been put int TGCanvas which isn't a
4963 // TGComposite frame and doesn't do cleanups.
4970 delete fTimer;
4971 DeleteWindow();
4972}
4973
4974////////////////////////////////////////////////////////////////////////////////
4975/// Change the right logo (used for animation).
4976
4978{
4982}
4983
4984////////////////////////////////////////////////////////////////////////////////
4985/// Enable animation timer.
4986
4988{
4989 if (!fTimer) fTimer = new TTimer(this, 500);
4990 fTimer->Reset();
4991 fTimer->TurnOn();
4992 time( &fStart );
4993}
4994
4995////////////////////////////////////////////////////////////////////////////////
4996/// Disable animation timer.
4997
4999{
5000 if (fTimer)
5001 fTimer->TurnOff();
5002 ChangeRightLogo("proof_disconnected.xpm");
5003}
5004
5005////////////////////////////////////////////////////////////////////////////////
5006/// Handle animation timer.
5007
5009{
5010 TString buf;
5011 struct tm *connected;
5012 Int_t count = gRandom->Integer(4);
5013 if (count > 3) {
5014 count = 0;
5015 }
5016 if (fChangePic)
5017 ChangeRightLogo(xpm_names[count]);
5018 time( &fElapsed );
5019 time_t elapsed_time = (time_t)difftime( fElapsed, fStart );
5020 connected = gmtime( &elapsed_time );
5021 if (connected) {
5022 buf.Form(" %02d:%02d:%02d", connected->tm_hour,
5023 connected->tm_min, connected->tm_sec);
5024 fStatusBar->SetText(buf.Data(), 2);
5025 }
5026 else {
5027 fStatusBar->SetText(" 00:00:00", 2);
5028 }
5029
5030 if (fActDesc->fLocal) {
5031 if ((fActDesc->fActQuery) &&
5034 TChain *chain = (TChain *)fActDesc->fActQuery->fChain;
5035 if (chain)
5037 chain->GetReadEntry()+1);
5038 }
5039 }
5040
5041 fTimer->Reset();
5042 return kTRUE;
5043}
5044
5045////////////////////////////////////////////////////////////////////////////////
5046/// Load/append a log msg in the log frame.
5047
5048void TSessionViewer::LogMessage(const char *msg, Bool_t all)
5049{
5050 if (fLogWindow) {
5051 if (all) {
5052 // load buffer
5053 fLogWindow->LoadBuffer(msg);
5054 } else {
5055 // append
5056 fLogWindow->AddBuffer(msg);
5057 }
5058 }
5059}
5060
5061////////////////////////////////////////////////////////////////////////////////
5062/// Handle signal "query result ready" coming from Proof session.
5063
5065{
5066 TString strtmp;
5067 strtmp.Form("Query Result Ready for %s", query);
5068 // show information on status bar
5069 ShowInfo(strtmp.Data());
5070 TGListTreeItem *item=0, *item2=0;
5071 TQueryDescription *lquery = 0;
5072 // loop over actual queries to find which one is ready
5073
5074 TIter nexts(fSessions);
5075 TSessionDescription *desc = 0;
5076 // check if session is already in the list
5077 while ((desc = (TSessionDescription *)nexts())) {
5078 if (desc && !desc->fAttached)
5079 continue;
5080 TIter nextp(desc->fQueries);
5081 while ((lquery = (TQueryDescription *)nextp())) {
5082 if (lquery->fReference.Contains(query)) {
5083 // results are ready for this query
5084 lquery->fResult = desc->fProof->GetQueryResult(query);
5086 if (!lquery->fResult)
5087 break;
5088 // get query status
5089 lquery->fStatus = lquery->fResult->IsFinalized() ?
5092 // get data set
5093 TObject *o = lquery->fResult->GetInputObject("TDSet");
5094 if (o)
5095 lquery->fChain = (TDSet *) o;
5097 if (item) {
5098 item2 = fSessionHierarchy->FindItemByObj(item, lquery);
5099 }
5100 if (item2) {
5101 // add input and output list entries
5102 if (lquery->fResult->GetInputList())
5103 if (!fSessionHierarchy->FindChildByName(item2, "InputList"))
5104 fSessionHierarchy->AddItem(item2, "InputList");
5105 if (lquery->fResult->GetOutputList())
5106 if (!fSessionHierarchy->FindChildByName(item2, "OutputList"))
5107 fSessionHierarchy->AddItem(item2, "OutputList");
5108 }
5109 // update list tree, query frame information, and buttons state
5113 fQueryFrame->UpdateButtons(lquery);
5114 break;
5115 }
5116 }
5117 }
5118}
5119
5120////////////////////////////////////////////////////////////////////////////////
5121/// Clean-up Proof session.
5122
5124{
5126 if (!item) return;
5127 TObject *obj = (TObject *)item->GetUserData();
5128 if (!obj || obj->IsA() != TSessionDescription::Class()) return;
5129 if (!fActDesc->fProof || !fActDesc->fProof->IsValid()) return;
5130 TString m;
5131 m.Form("Are you sure to cleanup the session \"%s::%s\"",
5133 Int_t result;
5134 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), 0,
5135 kMBYes | kMBNo | kMBCancel, &result);
5136 if (result == kMBYes) {
5137 // send cleanup request for the session specified by the tag reference
5138 TString sessiontag;
5139 sessiontag.Form("session-%s",fActDesc->fTag.Data());
5140 fActDesc->fProof->CleanupSession(sessiontag.Data());
5141 // clear the list of queries
5145 if (fAutoSave)
5147 }
5148 // update list tree
5151}
5152
5153////////////////////////////////////////////////////////////////////////////////
5154/// Reset Proof session.
5155
5157{
5159 if (!item) return;
5160 TObject *obj = (TObject *)item->GetUserData();
5161 if (!obj || obj->IsA() != TSessionDescription::Class()) return;
5162 if (!fActDesc->fProof || !fActDesc->fProof->IsValid()) return;
5163 TString m;
5164 m.Form("Do you really want to reset the session \"%s::%s\"",
5166 Int_t result;
5167 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), 0,
5168 kMBYes | kMBNo | kMBCancel, &result);
5169 if (result == kMBYes) {
5170 // reset the session
5172 if (mgr && mgr->IsValid()) {
5173 mgr->Reset(fActDesc->fUserName);
5174 }
5175 // reset connected flag
5177 fActDesc->fProof = 0;
5178 // disable animation timer
5179 DisableTimer();
5180 // change list tree item picture to disconnected pixmap
5183 if (item2) item2->SetPictures(fProofDiscon, fProofDiscon);
5184
5188 fStatusBar->SetText("", 1);
5189 }
5190 // update list tree
5193}
5194
5195////////////////////////////////////////////////////////////////////////////////
5196/// Delete query from list tree and ask user if they want to delete it also
5197/// from server.
5198
5200{
5202 if (!item) return;
5203 TObject *obj = (TObject *)item->GetUserData();
5204 if (!obj || obj->IsA() != TQueryDescription::Class()) return;
5205 TQueryDescription *query = (TQueryDescription *)obj;
5206 TString m;
5207 Int_t result = 0;
5208
5212 new TGMsgBox(fClient->GetRoot(), this, "Delete Query",
5213 "Deleting running queries is not allowed", kMBIconExclamation,
5214 kMBOk, &result);
5215 return;
5216 }
5217 m.Form("Do you want to delete query \"%s\" from server too ?",
5218 query->fQueryName.Data());
5219 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), kMBIconQuestion,
5220 kMBYes | kMBNo | kMBCancel, &result);
5221 }
5222 else {
5223 m.Form("Dou you really want to delete query \"%s\" ?",
5224 query->fQueryName.Data());
5225 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), kMBIconQuestion,
5226 kMBOk | kMBCancel, &result);
5227 }
5228 if (result == kMBYes) {
5229 fActDesc->fProof->Remove(query->fReference.Data());
5230 fActDesc->fQueries->Remove((TObject *)query);
5232 delete query;
5233 }
5234 else if (result == kMBNo || result == kMBOk) {
5235 fActDesc->fQueries->Remove((TObject *)query);
5237 delete query;
5238 }
5241 if (fAutoSave)
5243}
5244
5245////////////////////////////////////////////////////////////////////////////////
5246/// Edit currently selected query.
5247
5249{
5251 if (!item) return;
5252 TObject *obj = (TObject *)item->GetUserData();
5253 if (!obj || obj->IsA() != TQueryDescription::Class()) return;
5254 TQueryDescription *query = (TQueryDescription *)obj;
5255 TNewQueryDlg *dlg = new TNewQueryDlg(this, 350, 310, query, kTRUE);
5256 dlg->Popup();
5257}
5258
5259////////////////////////////////////////////////////////////////////////////////
5260/// Start TreeViewer from selected TChain.
5261
5263{
5265 if (!item) return;
5266 TObject *obj = (TObject *)item->GetUserData();
5267 if (!obj || obj->IsA() != TQueryDescription::Class()) return;
5268 TQueryDescription *query = (TQueryDescription *)obj;
5269 if (!query->fChain && query->fResult &&
5270 (obj = query->fResult->GetInputObject("TDSet"))) {
5271 query->fChain = (TDSet *) obj;
5272 }
5273 if (!query->fChain) return;
5274 if (query->fChain->IsA() == TChain::Class())
5275 ((TChain *)query->fChain)->StartViewer();
5276 else if (query->fChain->IsA() == TDSet::Class())
5277 ((TDSet *)query->fChain)->StartViewer();
5278}
5279
5280////////////////////////////////////////////////////////////////////////////////
5281/// Query the list of uploaded packages from proof and display it
5282/// into a new text window.
5283
5285{
5286 Window_t wdummy;
5287 Int_t ax, ay;
5288
5289 if (fActDesc->fLocal) return;
5290 if (!fActDesc->fProof || !fActDesc->fProof->IsValid())
5291 return;
5292 TString pathtmp = TString::Format("%s/%s", gSystem->TempDirectory(),
5294 // redirect stdout/stderr to temp file
5295 if (gSystem->RedirectOutput(pathtmp.Data(), "w") != 0) {
5296 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
5297 return;
5298 }
5300 // restore stdout/stderr
5301 if (gSystem->RedirectOutput(0) != 0) {
5302 Error("ShowStatus", "stdout/stderr retore failed; skipping");
5303 return;
5304 }
5305 if (!fLogWindow) {
5306 fLogWindow = new TSessionLogView(this, 700, 100);
5307 } else {
5308 // Clear window
5309 fLogWindow->Clear();
5310 }
5311 fLogWindow->LoadFile(pathtmp.Data());
5312 gVirtualX->TranslateCoordinates(GetId(), fClient->GetDefaultRoot()->GetId(),
5313 0, 0, ax, ay, wdummy);
5314 fLogWindow->Move(ax, ay + GetHeight() + 35);
5315 fLogWindow->Popup();
5316}
5317
5318////////////////////////////////////////////////////////////////////////////////
5319/// Update the list of packages.
5320
5322{
5323 TObjString *packname;
5324 TPackageDescription *package;
5328 //fActDesc->fPackages->Clear();
5330 if(packlist) {
5331 TIter nextenabled(packlist);
5332 while ((packname = (TObjString *)nextenabled())) {
5333 package = new TPackageDescription;
5334 package->fName = packname->GetName();
5335 package->fName += ".par";
5336 package->fPathName = package->fName;
5337 package->fId = fActDesc->fPackages->GetEntries();
5338 package->fUploaded = kTRUE;
5339 package->fEnabled = kTRUE;
5340 if (!fActDesc->fPackages->FindObject(package->fName)) {
5341 fActDesc->fPackages->Add((TObject *)package);
5342 }
5343 }
5344 }
5345 packlist = fActDesc->fProof->GetListOfPackages();
5346 if(packlist) {
5347 TIter nextpack(packlist);
5348 while ((packname = (TObjString *)nextpack())) {
5349 package = new TPackageDescription;
5350 package->fName = packname->GetName();
5351 package->fName += ".par";
5352 package->fPathName = package->fName;
5353 package->fId = fActDesc->fPackages->GetEntries();
5354 package->fUploaded = kTRUE;
5355 package->fEnabled = kFALSE;
5356 if (!fActDesc->fPackages->FindObject(package->fName)) {
5357 fActDesc->fPackages->Add((TObject *)package);
5358 }
5359 }
5360 }
5361 }
5362// fSessionFrame->UpdatePackages();
5363}
5364
5365////////////////////////////////////////////////////////////////////////////////
5366/// Query list of enabled packages from proof and display it
5367/// into a new text window.
5368
5370{
5371 Window_t wdummy;
5372 Int_t ax, ay;
5373
5374 if (fActDesc->fLocal) return;
5375 if (!fActDesc->fProof || !fActDesc->fProof->IsValid())
5376 return;
5377 TString pathtmp = TString::Format("%s/%s", gSystem->TempDirectory(),
5379 // redirect stdout/stderr to temp file
5380 if (gSystem->RedirectOutput(pathtmp.Data(), "w") != 0) {
5381 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
5382 return;
5383 }
5385 // restore stdout/stderr
5386 if (gSystem->RedirectOutput(0) != 0) {
5387 Error("ShowStatus", "stdout/stderr retore failed; skipping");
5388 return;
5389 }
5390 if (!fLogWindow) {
5391 fLogWindow = new TSessionLogView(this, 700, 100);
5392 } else {
5393 // Clear window
5394 fLogWindow->Clear();
5395 }
5396 fLogWindow->LoadFile(pathtmp.Data());
5397 gVirtualX->TranslateCoordinates(GetId(), fClient->GetDefaultRoot()->GetId(),
5398 0, 0, ax, ay, wdummy);
5399 fLogWindow->Move(ax, ay + GetHeight() + 35);
5400 fLogWindow->Popup();
5401}
5402
5403////////////////////////////////////////////////////////////////////////////////
5404/// Display the content of the temporary log file for queryref
5405/// into a new text window.
5406
5407void TSessionViewer::ShowLog(const char *queryref)
5408{
5409 Window_t wdummy;
5410 Int_t ax, ay;
5411
5412 if (fActDesc->fProof) {
5413 gVirtualX->SetCursor(GetId(),gVirtualX->CreateCursor(kWatch));
5414 if (!fLogWindow) {
5415 fLogWindow = new TSessionLogView(this, 700, 100);
5416 } else {
5417 // Clear window
5418 fLogWindow->Clear();
5419 }
5420 fActDesc->fProof->Connect("LogMessage(const char*,Bool_t)",
5421 "TSessionViewer", this, "LogMessage(const char*,Bool_t)");
5424 if (queryref)
5425 fActDesc->fProof->ShowLog(queryref);
5426 else
5427 fActDesc->fProof->ShowLog(0);
5428 fActDesc->fProof->SendLogToWindow(logonly);
5429 // set log window position at the bottom of Session Viewer
5430 gVirtualX->TranslateCoordinates(GetId(),
5431 fClient->GetDefaultRoot()->GetId(), 0, 0, ax, ay, wdummy);
5432 fLogWindow->Move(ax, ay + GetHeight() + 35);
5433 fLogWindow->Popup();
5434 gVirtualX->SetCursor(GetId(), 0);
5435 }
5436}
5437
5438////////////////////////////////////////////////////////////////////////////////
5439/// Display text in status bar.
5440
5441void TSessionViewer::ShowInfo(const char *txt)
5442{
5443 fStatusBar->SetText(txt,0);
5446}
5447
5448////////////////////////////////////////////////////////////////////////////////
5449/// Retrieve and display Proof status.
5450
5452{
5453 Window_t wdummy;
5454 Int_t ax, ay;
5455
5456 if (!fActDesc->fProof || !fActDesc->fProof->IsValid())
5457 return;
5458 TString pathtmp = TString::Format("%s/%s", gSystem->TempDirectory(),
5460 // redirect stdout/stderr to temp file
5461 if (gSystem->RedirectOutput(pathtmp.Data(), "w") != 0) {
5462 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
5463 return;
5464 }
5466 // restore stdout/stderr
5467 if (gSystem->RedirectOutput(0) != 0) {
5468 Error("ShowStatus", "stdout/stderr retore failed; skipping");
5469 return;
5470 }
5471 if (!fLogWindow) {
5472 fLogWindow = new TSessionLogView(this, 700, 100);
5473 } else {
5474 // Clear window
5475 fLogWindow->Clear();
5476 }
5477 fLogWindow->LoadFile(pathtmp.Data());
5478 gVirtualX->TranslateCoordinates(GetId(), fClient->GetDefaultRoot()->GetId(),
5479 0, 0, ax, ay, wdummy);
5480 fLogWindow->Move(ax, ay + GetHeight() + 35);
5481 fLogWindow->Popup();
5482}
5483
5484////////////////////////////////////////////////////////////////////////////////
5485/// Handle startup message (connection progress) coming from Proof session.
5486
5488{
5489 Float_t pos = Float_t(Double_t(done * 100)/Double_t(total));
5491 fStatusBar->SetText(msg, 1);
5492}
5493
5494////////////////////////////////////////////////////////////////////////////////
5495/// Handle session viewer custom popup menus.
5496
5498{
5499 switch (id) {
5500
5501 case kSessionDelete:
5503 break;
5504
5505 case kSessionConnect:
5507 break;
5508
5509 case kSessionDisconnect:
5511 break;
5512
5513 case kSessionShutdown:
5515 break;
5516
5517 case kSessionCleanup:
5519 break;
5520
5521 case kSessionReset:
5522 ResetSession();
5523 break;
5524
5525 case kSessionBrowse:
5526 if (fActDesc->fProof && fActDesc->fProof->IsValid()) {
5527 TBrowser *b = new TBrowser();
5529 }
5530 break;
5531
5532 case kSessionShowStatus:
5533 ShowStatus();
5534 break;
5535
5536 case kSessionGetQueries:
5538 break;
5539
5540 case kQueryEdit:
5541 EditQuery();
5542 break;
5543
5544 case kQueryDelete:
5545 DeleteQuery();
5546 break;
5547
5548 case kQueryStartViewer:
5549 StartViewer();
5550 break;
5551
5552 case kQuerySubmit:
5554 break;
5555 }
5556}
5557
5558////////////////////////////////////////////////////////////////////////////////
5559/// Handle feedback histograms configuration menu.
5560
5562{
5563 // divide stats canvas by number of selected feedback histos
5568 if (!fActDesc || !fActDesc->fActQuery) return;
5569 fActDesc->fNbHistos = 0;
5570 Int_t i = 0;
5571
5572 if (fActDesc->fAttached && fActDesc->fProof &&
5573 fActDesc->fProof->IsValid()) {
5575 // browse list of feedback histos and check user's selected ones
5576 while (kFeedbackHistos[i]) {
5577 if (fCascadeMenu->IsEntryChecked(41+i)) {
5579 }
5580 i++;
5581 }
5582 }
5583 else {
5584 // if feedback option not selected, clear Proof's feedback option
5586 }
5587 }
5588
5589 i = 0;
5590 // loop over feedback histo list
5591 while (kFeedbackHistos[i]) {
5592 // check if user has selected this histogram in the option menu
5593 if (fCascadeMenu->IsEntryChecked(41+i))
5595 i++;
5596 }
5599 if (fActDesc->fNbHistos == 4)
5601 else if (fActDesc->fNbHistos > 4)
5603 else
5605
5606 // if actual query has results, update feedback histos
5610 fQueryFrame->ResetProgressDialog("", 0, 0, 0);
5611 }
5612 else if (fActDesc->fActQuery) {
5617 }
5619}
5620////////////////////////////////////////////////////////////////////////////////
5621/// Handle messages send to the TSessionViewer object. E.g. all menu entries
5622/// messages.
5623
5625{
5626 TNewQueryDlg *dlg;
5627
5628 switch (GET_MSG(msg)) {
5629 case kC_COMMAND:
5630 switch (GET_SUBMSG(msg)) {
5631 case kCM_BUTTON:
5632 case kCM_MENU:
5633 switch (parm1) {
5634
5635 case kFileCloseViewer:
5636 CloseWindow();
5637 break;
5638
5639 case kFileLoadConfig:
5640 {
5641 TGFileInfo fi;
5644 fi.fFileTypes = conftypes;
5645 new TGFileDialog(fClient->GetRoot(), this, kFDOpen, &fi);
5646 if (fi.fFilename) {
5650 }
5651 }
5652 break;
5653
5654 case kFileSaveConfig:
5655 {
5656 TGFileInfo fi;
5659 fi.fFileTypes = conftypes;
5660 new TGFileDialog(fClient->GetRoot(), this, kFDSave, &fi);
5661 if (fi.fFilename) {
5664 }
5665 }
5666 break;
5667
5668 case kFileQuit:
5669 Terminate();
5671 delete this;
5673 break;
5674
5675 case kSessionNew:
5677 break;
5678
5679 case kSessionAdd:
5681 break;
5682
5683 case kSessionDelete:
5685 break;
5686
5687 case kSessionCleanup:
5689 break;
5690
5691 case kSessionReset:
5692 ResetSession();
5693 break;
5694
5695 case kSessionConnect:
5697 break;
5698
5699 case kSessionDisconnect:
5701 break;
5702
5703 case kSessionShutdown:
5705 break;
5706
5707 case kSessionShowStatus:
5708 ShowStatus();
5709 break;
5710
5711 case kSessionGetQueries:
5713 break;
5714
5715 case kQueryNew:
5716 dlg = new TNewQueryDlg(this, 350, 310);
5717 dlg->Popup();
5718 break;
5719
5720 case kQueryEdit:
5721 EditQuery();
5722 break;
5723
5724 case kQueryDelete:
5725 DeleteQuery();
5726 break;
5727
5728 case kQueryStartViewer:
5729 StartViewer();
5730 break;
5731
5732 case kQuerySubmit:
5734 break;
5735
5736 case kOptionsAutoSave:
5739 fAutoSave = kFALSE;
5740 }
5741 else {
5743 fAutoSave = kTRUE;
5744 }
5745 break;
5746
5747 case kOptionsStatsHist:
5750 gEnv->SetValue("Proof.StatsHist", 0);
5751 }
5752 else {
5754 gEnv->SetValue("Proof.StatsHist", 1);
5755 }
5756 break;
5757
5758 case kOptionsStatsTrace:
5761 gEnv->SetValue("Proof.StatsTrace", 0);
5762 }
5763 else {
5765 gEnv->SetValue("Proof.StatsTrace", 1);
5766 }
5767 break;
5768
5772 gEnv->SetValue("Proof.SlaveStatsTrace", 0);
5773 }
5774 else {
5776 gEnv->SetValue("Proof.SlaveStatsTrace", 1);
5777 }
5778 break;
5779
5780 case kOptionsFeedback:
5783 }
5784 else {
5786 }
5787 break;
5788
5789 case 41:
5790 case 42:
5791 case 43:
5792 case 44:
5793 case 45:
5794 case 46:
5795 if (fCascadeMenu->IsEntryChecked(parm1)) {
5796 fCascadeMenu->UnCheckEntry(parm1);
5797 }
5798 else {
5799 fCascadeMenu->CheckEntry(parm1);
5800 }
5801 OnCascadeMenu();
5802 break;
5803
5804 case 50:
5805 if (fCascadeMenu->IsEntryChecked(parm1)) {
5806 fCascadeMenu->UnCheckEntry(parm1);
5807 }
5808 else {
5809 fCascadeMenu->CheckEntry(parm1);
5810 }
5811 OnCascadeMenu();
5812 break;
5813
5814 case kHelpAbout:
5815 {
5816#ifdef R__UNIX
5817 TString rootx = TROOT::GetBinDir() + "/root -a &";
5818 gSystem->Exec(rootx);
5819#else
5820#ifdef WIN32
5822#else
5823 char str[32];
5824 sprintf(str, "About ROOT %s...", gROOT->GetVersion());
5825 TRootHelpDialog *hd = new TRootHelpDialog(this, str, 600, 400);
5826 hd->SetText(gHelpAbout);
5827 hd->Popup();
5828#endif
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}
void Class()
Definition: Class.C:29
const Mask_t kButtonPressMask
Definition: GuiTypes.h:160
const Mask_t kAnyModifier
Definition: GuiTypes.h:209
const Mask_t kKeyPressMask
Definition: GuiTypes.h:158
const Mask_t kPointerMotionMask
Definition: GuiTypes.h:162
@ 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:87
const Mask_t kLeaveWindowMask
Definition: GuiTypes.h:167
const Mask_t kButtonReleaseMask
Definition: GuiTypes.h:161
@ kWatch
Definition: GuiTypes.h:374
const Mask_t kEnterWindowMask
Definition: GuiTypes.h:166
@ kAnyButton
Definition: GuiTypes.h:213
Handle_t Window_t
Definition: GuiTypes.h:28
R__EXTERN const char gHelpAbout[]
Definition: HelpText.h:14
#define d(i)
Definition: RSha256.hxx:102
#define b(i)
Definition: RSha256.hxx:100
#define h(i)
Definition: RSha256.hxx:106
int Int_t
Definition: RtypesCore.h:43
unsigned int UInt_t
Definition: RtypesCore.h:44
const Bool_t kFALSE
Definition: RtypesCore.h:90
long Long_t
Definition: RtypesCore.h:52
bool Bool_t
Definition: RtypesCore.h:61
double Double_t
Definition: RtypesCore.h:57
long long Long64_t
Definition: RtypesCore.h:71
float Float_t
Definition: RtypesCore.h:55
const Bool_t kTRUE
Definition: RtypesCore.h:89
#define ClassImp(name)
Definition: Rtypes.h:361
R__EXTERN TApplication * gApplication
Definition: TApplication.h:166
R__EXTERN TEnv * gEnv
Definition: TEnv.h:171
@ kEnvUser
Definition: TEnv.h:72
@ kButtonDown
Definition: TGButton.h:54
@ kButtonDisabled
Definition: TGButton.h:56
@ kButtonUp
Definition: TGButton.h:53
#define gClient
Definition: TGClient.h:166
@ kFDOpen
Definition: TGFileDialog.h:38
@ kFDSave
Definition: TGFileDialog.h:39
@ kDeepCleanup
Definition: TGFrame.h:51
@ kLHintsRight
Definition: TGLayout.h:33
@ kLHintsExpandY
Definition: TGLayout.h:38
@ kLHintsLeft
Definition: TGLayout.h:31
@ kLHintsCenterY
Definition: TGLayout.h:35
@ kLHintsCenterX
Definition: TGLayout.h:32
@ kLHintsBottom
Definition: TGLayout.h:36
@ kLHintsTop
Definition: TGLayout.h:34
@ kLHintsExpandX
Definition: TGLayout.h:37
@ kMBNo
Definition: TGMsgBox.h:43
@ kMBYes
Definition: TGMsgBox.h:42
@ kMBCancel
Definition: TGMsgBox.h:48
@ kMBOk
Definition: TGMsgBox.h:44
@ kMBIconExclamation
Definition: TGMsgBox.h:35
@ kMBIconQuestion
Definition: TGMsgBox.h:34
@ kTextRight
Definition: TGWidget.h:35
static unsigned int total
XFontStruct * id
Definition: TGX11.cxx:108
char name[80]
Definition: TGX11.cxx:109
R__EXTERN void * gTQSender
Definition: TQObject.h:44
#define gROOT
Definition: TROOT.h:406
R__EXTERN TRandom * gRandom
Definition: TRandom.h:62
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[]
char * Form(const char *fmt,...)
char * StrDup(const char *str)
Duplicate the string str.
Definition: TString.cxx:2490
R__EXTERN TSystem * gSystem
Definition: TSystem.h:556
#define gPad
Definition: TVirtualPad.h:287
#define gVirtualX
Definition: TVirtualX.h:338
Int_t GET_MSG(Long_t val)
@ kCM_MENU
@ kTE_ENTER
@ kC_COMMAND
@ kCM_BUTTON
@ kTE_TAB
@ kC_TEXTENTRY
Int_t GET_SUBMSG(Long_t val)
T1 fFirst
Definition: X11Events.mm:86
#define snprintf
Definition: civetweb.c:1540
Bool_t ReturnFromRun() const
Definition: TApplication.h:149
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...
virtual Long_t ProcessLine(const char *line, Bool_t sync=kFALSE, Int_t *error=0)
Process a single command line, either a C++ statement or an interpreter command starting with a "....
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="")
Remove all primitives from the canvas.
Definition: TCanvas.cxx:720
virtual void Update()
Update canvas pad buffers.
Definition: TCanvas.cxx:2433
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
Definition: TCanvas.cxx:701
A chain is a collection of files containing TTree objects.
Definition: TChain.h:34
virtual Long64_t GetEntries() const
Return the total number of entries in the chain.
Definition: TChain.cxx:944
virtual Long64_t GetReadEntry() const
See TTree::GetReadEntry().
Definition: TChain.cxx:1186
virtual Int_t GetEntries() const
Definition: TCollection.h:177
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Definition: TCollection.h:182
This class provides an interface to context sensitive popup menus.
Definition: TContextMenu.h:40
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
UInt_t Convert(Bool_t toGMT=kFALSE) const
Convert fDatime from TDatime format to the standard time_t format.
Definition: TDatime.cxx:181
const char * AsString() const
Return the date & time as a string (ctime() format).
Definition: TDatime.cxx:101
void UpdateFields(TQueryDescription *desc)
Update entry fields with query description values.
TGNumberEntry * fNumEntries
TGTextEntry * fTxtQueryName
void OnNewQueryMore()
Show/hide options frame and update button text accordingly.
TGNumberEntry * fNumFirstEntry
void SettingsChanged()
Settings have changed, update GUI accordingly.
TQueryDescription * fQuery
virtual ~TEditQueryFrame()
Delete query dialog.
void OnBrowseEventList()
Browse event list.
TGTextEntry * fTxtEventList
void Build(TSessionViewer *gui)
Build the "new query" dialog.
TEditQueryFrame(TGWindow *p, Int_t w, Int_t h)
Create a new Query dialog, used by the Session Viewer, to Edit a Query if the editmode flag is set,...
TSessionViewer * fViewer
TGTextButton * fBtnMore
void OnElementSelected(TObject *obj)
Handle OnElementSelected signal coming from new chain dialog.
TGCompositeFrame * fFrmMore
TGTextEntry * fTxtSelector
void OnBrowseSelector()
Open file browser to choose selector macro.
TGTextEntry * fTxtChain
void OnBtnSave()
Save current settings in main session viewer.
void OnBrowseChain()
Call new chain dialog.
TGTextEntry * fTxtOptions
Definition: TEnv.h:87
const char * GetName() const
Returns name of object.
Definition: TEnv.h:110
The TEnv class reads config files, by default named .rootrc.
Definition: TEnv.h:125
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:141
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=0)
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:36
TUrl * GetFirstUrl() const
Definition: TFileInfo.h:69
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition: TGButton.cxx:397
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:411
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition: TGButton.cxx:187
virtual Bool_t IsOn() const
Definition: TGButton.h:311
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
Definition: TGButton.cxx:1202
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:155
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition: TGClient.cxx:289
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:372
void FreePicture(const TGPicture *pic)
Free picture resource.
Definition: TGClient.cxx:308
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
Definition: TGFrame.cxx:984
TGCompositeFrame(const TGCompositeFrame &)
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1101
virtual UInt_t GetDefaultWidth() const
Definition: TGFrame.h:349
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition: TGFrame.cxx:951
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1241
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1056
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGFrame.h:353
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1148
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition: TGFrame.cxx:1188
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:351
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition: TGFrame.cxx:1174
Bool_t IsVisible(TGFrame *f) const
Get state of sub frame.
Definition: TGFrame.cxx:1215
virtual void Associate(const TGWindow *w)
Definition: TGCanvas.h:99
virtual void ClearViewPort()
Clear view port and redraw full content.
Definition: TGCanvas.cxx:886
TList * fFileNamesList
Definition: TGFileDialog.h:67
char * fFilename
Definition: TGFileDialog.h:61
const char ** fFileTypes
Definition: TGFileDialog.h:63
void SetFilename(const char *fname)
Set file name.
Bool_t fMultipleSelection
Definition: TGFileDialog.h:66
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:323
void RemoveInput(UInt_t emask)
Remove events specified in emask from the events the frame should handle.
Definition: TGFrame.cxx:332
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition: TGFrame.cxx:693
virtual UInt_t GetDefaultWidth() const
Definition: TGFrame.h:215
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:216
virtual void DeleteWindow()
Delete window.
Definition: TGFrame.cxx:260
virtual void Move(Int_t x, Int_t y)
Move frame.
Definition: TGFrame.cxx:577
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:589
UInt_t GetHeight() const
Definition: TGFrame.h:250
virtual void MapWindow()
map window
Definition: TGFrame.h:229
void ShowPosition(Bool_t set=kTRUE, Bool_t percent=kTRUE, const char *format="%.2f")
Show postion text, either in percent or formatted according format.
Definition: TGIcon.h:30
virtual void SetPicture(const TGPicture *pic)
Set icon picture.
Definition: TGIcon.cxx:80
virtual void AddItem(TGLVEntry *item)
Definition: TGListView.h:225
void * GetUserData() const
Definition: TGListView.h:113
void SetUserData(void *userData)
Definition: TGListView.h:112
virtual void SetText(TGString *newText)
Set new text in label.
Definition: TGLabel.cxx:178
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
Definition: TGListBox.cxx:1420
virtual TGLBEntry * Select(Int_t id, Bool_t sel=kTRUE)
Definition: TGListBox.h:352
virtual Int_t GetNumberOfEntries() const
Definition: TGListBox.h:331
virtual Int_t GetSelected() const
Return id of selected listbox item.
Definition: TGListBox.cxx:1524
virtual void AddEntry(TGString *s, Int_t id)
Add entry with specified string and id to listbox.
Definition: TGListBox.cxx:1212
virtual void SetMultipleSelections(Bool_t multi=kTRUE)
Definition: TGListBox.h:327
virtual TGFrame * GetContainer() const
Definition: TGListBox.h:335
virtual void Layout()
Layout the listbox components.
Definition: TGListBox.cxx:1461
virtual void GetSelectedEntries(TList *selected)
Adds all selected entries (TGLBEntry) of the list box into the list selected.
Definition: TGListBox.cxx:1534
virtual void RemoveEntries(Int_t from_ID, Int_t to_ID)
Remove a range of entries defined by from_ID and to_ID.
Definition: TGListBox.cxx:1362
virtual const char * GetText() const =0
TGListTreeItem * GetParent() const
Definition: TGListTree.h:73
virtual void SetPictures(const TGPicture *, const TGPicture *)
Definition: TGListTree.h:98
virtual void * GetUserData() const =0
virtual void SetUserData(void *, Bool_t=kFALSE)
Definition: TGListTree.h:94
void DisableOpen(Bool_t disable=kTRUE)
Definition: TGListTree.h:391
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:397
Int_t DeleteItem(TGListTreeItem *item)
Delete item from list tree.
void SetSelected(TGListTreeItem *item)
Definition: TGListTree.h:368
TGListTreeItem * GetFirstItem() const
Definition: TGListTree.h:396
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.
void SetWMSizeHints(UInt_t wmin, UInt_t hmin, UInt_t wmax, UInt_t hmax, UInt_t winc, UInt_t hinc)
Give the window manager minimum and maximum size hints.
Definition: TGFrame.cxx:1864
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1748
virtual void AddPopup(TGHotString *s, TGPopupMenu *menu, TGLayoutHints *l, TGPopupMenu *before=0)
Add popup menu to menu bar.
Definition: TGMenu.cxx:416
Bool_t GetAction(const char *filename, char *action)
Return in action the mime action string belonging to filename.
virtual void SetIntNumber(Long_t val)
TGNumberEntryField * GetNumberEntry() const
virtual void Associate(const TGWindow *w)
Make w the window that will receive the generated messages.
virtual Long_t GetIntNumber() const
TGClient * fClient
Definition: TGObject.h:37
Handle_t GetId() const
Definition: TGObject.h:47
UInt_t GetHeight() const
Definition: TGPicture.h:64
UInt_t GetWidth() const
Definition: TGPicture.h:63
virtual void AddLabel(TGHotString *s, const TGPicture *p=0, TGMenuEntry *before=0)
Add a menu label to the menu.
Definition: TGMenu.cxx:1093
virtual void AddPopup(TGHotString *s, TGPopupMenu *popup, TGMenuEntry *before=0, const TGPicture *p=0)
Add a (cascading) popup menu to a popup menu.
Definition: TGMenu.cxx:1150
virtual Bool_t IsEntryChecked(Int_t id)
Return true if menu item is checked.
Definition: TGMenu.cxx:1843
virtual void AddEntry(TGHotString *s, Int_t id, void *ud=0, const TGPicture *p=0, TGMenuEntry *before=0)
Add a menu entry.
Definition: TGMenu.cxx:988
virtual void AddSeparator(TGMenuEntry *before=0)
Add a menu separator to the menu.
Definition: TGMenu.cxx:1058
virtual void CheckEntry(Int_t id)
Check a menu entry (i.e. add a check mark in front of it).
Definition: TGMenu.cxx:1780
virtual void DisableEntry(Int_t id)
Disable entry (disabled entries appear in a sunken relieve).
Definition: TGMenu.cxx:1722
virtual void EnableEntry(Int_t id)
Enable entry. By default entries are enabled.
Definition: TGMenu.cxx:1703
virtual void UnCheckEntry(Int_t id)
Uncheck menu entry (i.e. remove check mark).
Definition: TGMenu.cxx:1805
virtual void Associate(const TGWindow *w)
Definition: TGMenu.h:219
virtual void PlaceMenu(Int_t x, Int_t y, Bool_t stick_mode, Bool_t grab_pointer)
Popup a popup menu.
Definition: TGMenu.cxx:1239
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).
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.
Definition: TGTab.h:62
TGTabElement * GetTabTab(Int_t tabIndex) const
Return the tab element of tab with index tabIndex.
Definition: TGTab.cxx:613
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:508
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
Definition: TGTab.cxx:342
UInt_t GetTextLength() const
Definition: TGTextBuffer.h:45
virtual void SetText(TGHotString *new_label)
Set new button text.
Definition: TGButton.cxx:596
virtual void SetFocus()
Set focus to this text entry.
TGTextBuffer * GetBuffer() const
Definition: TGTextEntry.h:127
const char * GetText() const
Definition: TGTextEntry.h:134
void SetEnabled(Bool_t flag=kTRUE)
Definition: TGTextEntry.h:164
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.
virtual Bool_t LoadFile(const char *fname, long startpos=0, long length=-1)
Load a file in the text view widget.
Definition: TGTextView.cxx:453
virtual Bool_t LoadBuffer(const char *txtbuf)
Load text from a text buffer. Return false in case of failure.
Definition: TGTextView.cxx:470
virtual void Clear(Option_t *="")
Clear text view widget.
Definition: TGTextView.cxx:429
virtual void ShowBottom()
Show bottom of the page.
virtual TGButton * AddButton(const TGWindow *w, ToolBarData_t *button, Int_t spacing=0)
Add button to toolbar.
Definition: TGToolBar.cxx:91
virtual TGButton * GetButton(Int_t id) const
Finds and returns a pointer to the button with the specified identifier id.
Definition: TGToolBar.cxx:156
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:84
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:326
The TH1 histogram class.
Definition: TH1.h:56
Service class for 2-Dim histogram classes.
Definition: TH2.h:30
A doubly linked list.
Definition: TList.h:44
virtual void Add(TObject *obj)
Definition: TList.h:87
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Definition: TList.cxx:821
virtual void AddAt(TObject *obj, Int_t idx)
Insert object at position idx in the list.
Definition: TList.cxx:305
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Definition: TList.cxx:577
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
Definition: TList.cxx:356
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
Definition: TList.cxx:692
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
Definition: TList.cxx:469
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Definition: TList.cxx:401
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:48
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
void Popup()
Display dialog and set focus to query name text entry.
Collectable string class.
Definition: TObjString.h:28
const char * GetName() const
Returns name of object.
Definition: TObjString.h:38
const TString & GetString() const
Definition: TObjString.h:46
Mother of all ROOT objects.
Definition: TObject.h:37
virtual void Clear(Option_t *="")
Definition: TObject.h:115
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:357
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:694
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:891
virtual const char * GetTitle() const
Returns title of object.
Definition: TObject.cxx:401
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
Definition: TPad.cxx:1165
virtual void SetBorderMode(Short_t bordermode)
Definition: TPad.h:320
void Modified(Bool_t flag=1)
Definition: TPad.h:417
virtual void SetEditable(Bool_t mode=kTRUE)
Set pad editable yes/no If a pad is not editable:
Definition: TPad.cxx:5859
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.
Definition: TProofMgr.cxx:307
virtual TList * QuerySessions(Option_t *opt="S")
Get list of sessions accessible to this manager.
Definition: TProofMgr.cxx:229
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.
Definition: TProofMgr.cxx:499
virtual TProof * CreateSession(const char *=0, const char *=0, Int_t=-1)
Create a new remote session (master and associated workers).
Definition: TProofMgr.cxx:387
virtual Bool_t IsValid() const
Definition: TProofMgr.h:77
virtual TProof * AttachSession(Int_t, Bool_t=kFALSE)
Dummy version provided for completeness.
Definition: TProofMgr.cxx:124
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:6523
void ShowPackages(Bool_t all=kFALSE, Bool_t redirlog=kFALSE)
List contents of package directory.
Definition: TProof.cxx:7760
static TProofMgr * Mgr(const char *url)
Get instance of the effective manager for 'url' Return 0 on failure.
Definition: TProof.cxx:11714
Int_t UploadPackage(const char *par, EUploadPackageOpt opt=kUntar, TList *workers=0)
Upload a PROOF archive (PAR file).
Definition: TProof.cxx:8431
void SendLogToWindow(Bool_t mode)
Definition: TProof.h:1017
Int_t GetClientProtocol() const
Definition: TProof.h:914
void AddFeedback(const char *name)
Add object to feedback list.
Definition: TProof.cxx:9979
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:6082
TList * GetListOfPackages()
Get from the master the list of names of the packages available.
Definition: TProof.cxx:9098
TQueryResult * GetQueryResult(const char *ref=0)
Return pointer to the full TQueryResult instance owned by the player and referenced by 'ref'.
Definition: TProof.cxx:2138
void ClearFeedback()
Clear feedback list.
Definition: TProof.cxx:10002
void Browse(TBrowser *b)
Build the PROOF's structure in the browser.
Definition: TProof.cxx:10169
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:7130
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:7847
Int_t ClearPackages()
Remove all packages.
Definition: TProof.cxx:7830
Int_t GetParallel() const
Returns number of slaves active in parallel mode.
Definition: TProof.cxx:2294
Int_t Remove(Int_t query, Bool_t all=kFALSE)
Send remove request for the qry-th query in fQueries.
Definition: TProof.cxx:6003
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:10573
void Detach(Option_t *opt="")
Detach this instance to its proofserv.
Definition: TProof.cxx:10508
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:10486
Int_t Retrieve(Int_t query, const char *path=0)
Send retrieve request for the qry-th query in fQueries.
Definition: TProof.cxx:5938
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:10981
void SetQueryMode(EQueryMode mode)
Change query running mode to the one specified by 'mode'.
Definition: TProof.cxx:6097
@ 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:5873
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:6214
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:10361
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:10927
TList * GetListOfEnabledPackages()
Get from the master the list of names of the packages enabled.
Definition: TProof.cxx:9114
virtual TList * GetListOfQueries(Option_t *opt="")
Ask the master for the list of queries.
Definition: TProof.cxx:2078
void SetLogLevel(Int_t level, UInt_t mask=TProofDebug::kAll)
Set server logging level.
Definition: TProof.cxx:7069
Bool_t IsMaster() const
Definition: TProof.h:936
void ShowEnabledPackages(Bool_t all=kFALSE)
List which packages are enabled.
Definition: TProof.cxx:7808
@ 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:8165
virtual Int_t VerifyDataSet(const char *dataset, const char *optStr="")
Verify if all files in the specified dataset are available.
Definition: TProof.cxx:11120
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:866
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
Definition: TQObject.cxx:1024
ESessionQueryStatus fStatus
TQueryResult * fResult
A container class for query results.
Definition: TQueryResult.h:36
Long64_t GetEntries() const
Definition: TQueryResult.h:122
Int_t GetSeqNum() const
Definition: TQueryResult.h:115
TDatime GetEndTime() const
Definition: TQueryResult.h:118
TMacro * GetSelecImp() const
Definition: TQueryResult.h:128
TList * GetOutputList()
Definition: TQueryResult.h:131
TDatime GetStartTime() const
Definition: TQueryResult.h:117
TObject * GetInputObject(const char *classname) const
Return first instance of class 'classname' in the input list.
EQueryStatus GetStatus() const
Definition: TQueryResult.h:116
const char * GetResultFile() const
Definition: TQueryResult.h:132
const char * GetOptions() const
Definition: TQueryResult.h:119
Long64_t GetFirst() const
Definition: TQueryResult.h:123
Bool_t IsDraw() const
Definition: TQueryResult.h:144
TList * GetInputList()
Definition: TQueryResult.h:120
Float_t GetUsedCPU() const
Definition: TQueryResult.h:125
const char * GetParList() const
Definition: TQueryResult.h:130
Long64_t GetBytes() const
Definition: TQueryResult.h:124
Bool_t IsArchived() const
Definition: TQueryResult.h:142
Bool_t IsFinalized() const
Definition: TQueryResult.h:145
static const TString & GetBinDir()
Get the binary directory in the installation. Static utility function.
Definition: TROOT.cxx:2887
virtual UInt_t Integer(UInt_t imax)
Returns a random integer uniformly distributed on the interval [ 0, imax-1 ].
Definition: TRandom.cxx:349
TCanvas * GetCanvas() const
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:33
virtual TList * GetOutputList() const
Definition: TSelector.h:71
virtual void Terminate()
Definition: TSelector.h:73
Sequenceable collection abstract base class.
virtual TObject * First() const =0
const char * GetName() const
Returns name of object.
TQueryDescription * fActQuery
TGTextButton * fBtnShowLog
TGTextButton * fBtnUploadDSet
TGCheckButton * fChkEnable
TGTextButton * fBtnEnable
TGNumberEntry * fLogLevel
TGCompositeFrame * fFE
void OnBtnShowLogClicked()
Show session log.
TGCompositeFrame * fFC
void OnBtnDisconnectClicked()
Disconnect from current Proof session.
TGTextButton * fBtnUp
void OnBtnRemoveClicked()
Remove selected package from the list.
void UpdatePackages()
Update list of packages.
TGTextButton * fBtnDisable
TGTextButton * fBtnShowEnabled
void OnUploadPackages()
Upload selected package(s) to the current session.
TGLabel * fInfoLine[19]
TGTextButton * fBtnClear
TGTextButton * fBtnUpload
TGTextButton * fBtnRefresh
void OnBtnAddClicked()
Open file dialog and add selected package file to the list.
TGTextButton * fBtnShow
TGTextEntry * fCommandTxt
TGTextButton * fBtnRemoveDSet
virtual ~TSessionFrame()
Destructor.
void OnBtnRemoveDSet()
Remove dataset from the list and from the cluster.
void OnCommandLine()
Command line handling.
void OnDisablePackages()
Disable selected package(s) in the current session.
void OnBtnNewQueryClicked()
Call "New Query" Dialog.
void OnApplyLogLevel()
Apply selected log level on current session.
TGCheckButton * fClearCheck
void Build(TSessionViewer *gui)
Build session frame.
TGTextButton * fBtnNewQuery
TGTextButton * fApplyLogLevel
void OnBtnVerifyDSet()
Verify that the files in the selected dataset are present on the cluster.
TGCanvas * fDSetView
TGCompositeFrame * fFB
void OnBtnUploadDSet()
Open Upload Dataset dialog.
TGTextBuffer * fCommandBuf
void OnBtnDownClicked()
Move selected package entry one position down in the list.
void OnBtnUpClicked()
Move selected package entry one position up in the list.
TSessionFrame(TGWindow *parent, Int_t w, Int_t h)
Constructor.
void OnStartupEnable(Bool_t on)
Handle multiple selection check button.
void OnBtnGetQueriesClicked()
Get list of queries from current Proof server and populate the list tree.
TGTextView * fInfoTextView
TGCheckButton * fChkMulti
void OnMultipleSelection(Bool_t on)
Handle multiple selection check button.
void UpdateListOfDataSets()
Update list of dataset present on the cluster.
TGTextEntry * fTxtParallel
TGTextButton * fBtnRemove
void OnClearPackages()
Clear (disable) all packages in the current session.
TSessionViewer * fViewer
void ShutdownSession()
Shutdown current session.
TGTextButton * fBtnAdd
TGTextButton * fBtnVerifyDSet
TGListTree * fDataSetTree
void ProofInfos()
Display information on current session.
TGCompositeFrame * fFA
TGTextButton * fBtnGetQueries
void SetLocal(Bool_t local=kTRUE)
Switch widgets status/visibility for local/remote sessions.
TGTextButton * fBtnDown
void OnApplyParallel()
Apply selected number of workers on current Proof session.
TGTextButton * fApplyParallel
TGCompositeFrame * fFD
TGListBox * fLBPackages
void CheckAutoEnPack(Bool_t checked=kTRUE)
void SetLogLevel(Int_t log)
void OnEnablePackages()
Enable selected package(s) in the current session.
TSessionViewer * fViewer
TGLVContainer * fLVContainer
void Build(TSessionViewer *gui)
Build query input information frame.
TGLVContainer * GetLVContainer()
virtual ~TSessionInputFrame()
Destructor.
void RemoveAll()
Remove all frames from composite frame.
TSessionInputFrame(TGWindow *parent, Int_t w, Int_t h)
Constructor.
void AddObject(TObject *obj)
Add object to input list view.
void LoadFile(const char *file)
Load a file in the editor.
void LoadBuffer(const char *buffer)
Load a text buffer in the editor.
void AddBuffer(const char *buffer)
Load a text buffer in the editor.
void Popup()
Show editor.
void RemoveAll()
Remove all frames from composite frame.
TGLVContainer * fLVContainer
void Build(TSessionViewer *gui)
Build query output information frame.
void OnElementDblClicked(TGLVEntry *entry, Int_t btn, Int_t x, Int_t y)
Handle double-clicks on list view items.
virtual ~TSessionOutputFrame()
Destructor.
TGLVContainer * GetLVContainer()
TSessionViewer * fViewer
void OnElementClicked(TGLVEntry *entry, Int_t btn, Int_t x, Int_t y)
Handle mouse clicks on list view items.
void AddObject(TObject *obj)
Add object to output list view.
TSessionOutputFrame(TGWindow *parent, Int_t w, Int_t h)
Constructor.
void UpdateInfos()
Update query information (header) text view.
TGTextButton * fBtnShowLog
void Build(TSessionViewer *gui)
Build query information frame.
TGCompositeFrame * fFC
TRootEmbeddedCanvas * fECanvas
void UpdateHistos(TList *objs)
Update feedback histograms.
void Progress(Long64_t total, Long64_t processed)
Update progress bar and status labels.
void Feedback(TList *objs)
Feedback function connected to Feedback signal.
void OnBtnSubmit()
Submit query.
void ProgressLocal(Long64_t total, Long64_t processed)
Update progress bar and status labels.
TEditQueryFrame * GetQueryEditFrame() const
TSessionViewer * fViewer
TGTextButton * fBtnSave
TGTextButton * fBtnSubmit
void OnBtnFinalize()
Finalize query.
void OnBtnStop()
Stop processing query.
void Modified(Bool_t mod=kTRUE)
Notify changes in query editor settings.
void IndicateStop(Bool_t aborted)
Indicate that Cancel or Stop was clicked.
TGTextButton * fBtnRetrieve
void ResetProgressDialog(const char *selec, Int_t files, Long64_t first, Long64_t entries)
Reset progress frame information fields.
TGTab * GetTab() const
TGTextButton * fBtnAbort
TGTextButton * fBtnStop
TGTextView * fInfoTextView
TEditQueryFrame * fFD
void UpdateButtons(TQueryDescription *desc)
Update buttons state for the current query status.
void OnBtnShowLog()
Show query log.
TCanvas * GetStatsCanvas() const
TGHProgressBar * frmProg
void OnBtnAbort()
Abort processing query.
TGCompositeFrame * fFB
TSessionQueryFrame(TGWindow *parent, Int_t w, Int_t h)
Constructor.
TGTextButton * fBtnFinalize
void OnBtnRetrieve()
Retrieve query.
virtual ~TSessionQueryFrame()
Destructor.
TGTextButton * fBtnAdd
TSessionServerFrame(TGWindow *parent, Int_t w, Int_t h)
Constructor.
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages for session server frame.
TGTextButton * fBtnConnect
void OnBtnAddClicked()
Add newly created session configuration in the list of sessions.
void OnBtnDeleteClicked()
Delete selected session configuration (remove it from the list).
TSessionViewer * fViewer
TGCheckButton * fSync
void SetAddEnabled(Bool_t on=kTRUE)
TGTextEntry * fTxtConfig
void SetLogLevel(Int_t log)
TGNumberEntry * fNumPort
TGNumberEntry * fLogLevel
void SetConnectEnabled(Bool_t on=kTRUE)
virtual ~TSessionServerFrame()
Destructor.
virtual Bool_t HandleExpose(Event_t *event)
Handle expose event in server frame.
void OnBtnNewServerClicked()
Reset server configuration fields.
TGTextEntry * fTxtAddress
void OnConfigFileClicked()
Browse configuration files.
TGCompositeFrame * fFrmNewServer
TGTextEntry * fTxtName
void Build(TSessionViewer *gui)
Build server configuration frame.
void SettingsChanged()
Settings have changed, update GUI accordingly.
void OnBtnConnectClicked()
Connect to selected server.
TGTextEntry * fTxtUsrName
void Update(TSessionDescription *desc)
Update fields with values from session description desc.
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
void WriteConfiguration(const char *filename=0)
Save actual configuration in config file "filename".
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.
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t)
Handle messages send to the TSessionViewer object.
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
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.
TGIcon * fRightIcon
TGListTreeItem * GetSessionItem() const
TGFrame * fActFrame
void OnListTreeDoubleClicked(TGListTreeItem *entry, Int_t btn)
Handle mouse double clicks in list tree (connect to server).
Bool_t IsAutoSave() const
const TGPicture * GetQueryConPict() const
const TGPicture * fProofCon
UserGroup_t * fUserGroup
TSessionFrame * fSessionFrame
Bool_t HandleTimer(TTimer *)
Handle animation timer.
TGPopupMenu * fSessionMenu
TSessionInputFrame * fInputFrame
Bool_t IsBusy() const
TGPopupMenu * fQueryMenu
TGStatusBar * GetStatusBar() const
void CleanupSession()
Clean-up Proof session.
TGVerticalFrame * fV1
TSessionDescription * GetActDesc() const
void EnableTimer()
Enable animation timer.
TGListTree * fSessionHierarchy
void UpdateListOfSessions()
Update list of existing Proof sessions.
TSessionLogView * fLogWindow
TContextMenu * fContextMenu
virtual ~TSessionViewer()
Destructor.
void SetChangePic(Bool_t change)
const TGPicture * GetProofDisconPict() const
TGPopupMenu * fOptionsMenu
TGHProgressBar * GetConnectProg() const
void ShowLog(const char *queryref)
Display the content of the temporary log file for queryref into a new text window.
TSessionServerFrame * fServerFrame
void OnCascadeMenu()
Handle feedback histograms configuration menu.
const TGPicture * fLocal
void ReadConfiguration(const char *filename=0)
Read configuration file and populate list of sessions list of queries and list of packages.
void CloseWindow()
Close main Session Viewer window.
const TGPicture * fProofDiscon
void DisableTimer()
Disable animation timer.
void DeleteQuery()
Delete query from list tree and ask user if they want to delete it also from server.
void Terminate()
Terminate Session : save configuration, clean temporary files and close Proof connections.
TSessionQueryFrame * fQueryFrame
TList * GetSessions() const
void ShowStatus()
Retrieve and display Proof status.
void ChangeRightLogo(const char *name)
Change the right logo (used for animation).
TGCanvas * fTreeView
void StartupMessage(char *msg, Bool_t stat, Int_t curr, Int_t total)
Handle startup message (connection progress) coming from Proof session.
void ResetSession()
Reset Proof session.
TGPicture * fRightIconPicture
Basic string class.
Definition: TString.h:131
Ssiz_t Length() const
Definition: TString.h:405
TString & Insert(Ssiz_t pos, const char *s)
Definition: TString.h:644
const char * Data() const
Definition: TString.h:364
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Definition: TString.h:610
Bool_t IsNull() const
Definition: TString.h:402
TString & Remove(Ssiz_t pos)
Definition: TString.h:668
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:2311
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2289
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:619
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition: TString.h:634
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:1708
virtual TTime Now()
Get current time in milliseconds since 0:00 Jan 1 1995.
Definition: TSystem.cxx:461
virtual Int_t Exec(const char *shellcmd)
Execute a command.
Definition: TSystem.cxx:651
virtual int GetSysInfo(SysInfo_t *info) const
Returns static system info, like OS type, CPU type, number of CPUs RAM size, etc into the SysInfo_t s...
Definition: TSystem.cxx:2459
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
Definition: TSystem.cxx:1291
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
Definition: TSystem.cxx:1058
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition: TSystem.cxx:930
virtual const char * HostName()
Return the system's host name.
Definition: TSystem.cxx:301
virtual const char * WorkingDirectory()
Return working directory.
Definition: TSystem.cxx:867
virtual const char * HomeDirectory(const char *userName=nullptr)
Return the user's home directory.
Definition: TSystem.cxx:883
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Definition: TSystem.cxx:414
virtual int Unlink(const char *name)
Unlink, i.e.
Definition: TSystem.cxx:1376
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
Definition: TSystem.cxx:1594
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
Definition: TSystem.cxx:1477
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:229
virtual void TurnOn()
Add the timer to the system timer list.
Definition: TTimer.cxx:241
void Reset()
Reset the timer.
Definition: TTimer.cxx:157
TVirtualTreePlayer * GetPlayer()
Load the TTreePlayer (if not already done).
Definition: TTree.cxx:6208
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
Definition: TUrl.cxx:387
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:51
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
static constexpr double s
static constexpr double mm
Definition: first.py:1
const char * cnt
Definition: TXMLSetup.cxx:74
Int_t fCpus
Definition: TSystem.h:153
TString fOS
Definition: TSystem.h:150
const char * fPixmap
Definition: TGToolBar.h:33
TString fRealName
Definition: TSystem.h:143
TString fGroup
Definition: TSystem.h:141
auto * m
Definition: textangle.C:8
auto * tt
Definition: textangle.C:16
REAL splitter
Definition: triangle.c:616
#define snext(osub1, osub2)
Definition: triangle.c:1167