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 "TProof.h"
48#include "TRandom.h"
49#include "TSessionViewer.h"
50#include "TSessionLogView.h"
51#include "TQueryResult.h"
52#include "TGTextView.h"
53#include "TGMenu.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 "TTreePlayer.h"
66#include "TFileCollection.h"
67#ifdef WIN32
68#include "TWin32SplashThread.h"
69#endif
70#include <stdlib.h>
71
73
74const char *kConfigFile = ".proofgui.conf";
75
84
85const char *xpm_names[] = {
86 "monitor01.xpm",
87 "monitor02.xpm",
88 "monitor03.xpm",
89 "monitor04.xpm",
90 0
91};
92
93const char *conftypes[] = {
94 "Config files", "*.conf",
95 "All files", "*.*",
96 0, 0
97};
98
99const char *pkgtypes[] = {
100 "Package files", "*.par",
101 "All files", "*.*",
102 0, 0
103};
104
105const char *macrotypes[] = {
106 "C files", "*.[C|c]*",
107 "All files", "*",
108 0, 0
109};
110
111
112const char *kFeedbackHistos[] = {
113 "PROOF_PacketsHist",
114 "PROOF_EventsHist",
115 "PROOF_NodeHist",
116 "PROOF_LatencyHist",
117 "PROOF_ProcTimeHist",
118 "PROOF_CpuTimeHist",
119 0
120};
121
122const char* const kSession_RedirectFile = ".templog";
123const char* const kSession_RedirectCmd = ".tempcmd";
124
125// Menu command id's
131
136
144
150
156
159
160const char *xpm_toolbar[] = {
161 "fileopen.xpm",
162 "filesaveas.xpm",
163 "",
164 "connect.xpm",
165 "disconnect.xpm",
166 "",
167 "query_new.xpm",
168 "query_submit.xpm",
169 "",
170 "about.xpm",
171 "",
172 "quit.xpm",
173 0
174};
175
177 { "", "Open Config File", kFALSE, kFileLoadConfig, 0 },
178 { "", "Save Config File", kFALSE, kFileSaveConfig, 0 },
179 { "", 0, 0, -1, 0 },
180 { "", "Connect", kFALSE, kSessionConnect, 0 },
181 { "", "Disconnect", kFALSE, kSessionDisconnect, 0 },
182 { "", 0, 0, -1, 0 },
183 { "", "New Query", kFALSE, kQueryNew, 0 },
184 { "", "Submit Query", kFALSE, kQuerySubmit, 0 },
185 { "", 0, 0, -1, 0 },
186 { "", "About Root", kFALSE, kHelpAbout, 0 },
187 { "", 0, 0, -1, 0 },
188 { "", "Exit Root", kFALSE, kFileQuit, 0 },
189 { 0, 0, 0, 0, 0 }
190};
191
192
193////////////////////////////////////////////////////////////////////////////////
194// Server Frame
195
196////////////////////////////////////////////////////////////////////////////////
197/// Constructor.
198
200 TGCompositeFrame(p, w, h), fFrmNewServer(0), fTxtName(0), fTxtAddress(0),
201 fNumPort(0), fLogLevel(0), fTxtConfig(0), fTxtUsrName(0), fSync(0),
202 fViewer(0), fBtnAdd(0), fBtnConnect(0)
203{
204}
205
206////////////////////////////////////////////////////////////////////////////////
207/// Destructor.
208
210{
211 Cleanup();
212}
213
214////////////////////////////////////////////////////////////////////////////////
215/// Build server configuration frame.
216
218{
220
222
223 fViewer = gui;
224 fFrmNewServer = new TGGroupFrame(this, "New Session");
226
228
230
231 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Session Name:"),
232 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
234 (const char *)0, 1), new TGLayoutHints());
236 fTxtName->Associate(this);
237 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Server name:"),
238 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
240 (const char *)0, 2), new TGLayoutHints());
242 fTxtAddress->Associate(this);
243 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Port (default: 1093):"),
244 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
248 fNumPort->Associate(this);
249 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Configuration File:"),
250 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
252 (const char *)0, 4), new TGLayoutHints());
254 fTxtConfig->Associate(this);
255 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Log Level:"),
256 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
257
262 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
263 fLogLevel->Associate(this);
264
265 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "User Name:"),
266 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
268 (const char *)0, 6), new TGLayoutHints());
270 fTxtUsrName->Associate(this);
271
272 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Process mode :"),
274 3, 3, 3, 3));
276 "&Synchronous"), new TGLayoutHints(kLHintsLeft | kLHintsBottom |
277 kLHintsExpandX, 3, 3, 3, 3));
278 fSync->SetToolTipText("Default Process Mode");
280
281 AddFrame(fBtnAdd = new TGTextButton(this, " Save "),
282 new TGLayoutHints(kLHintsTop | kLHintsCenterX, 5, 5, 15, 5));
283 fBtnAdd->SetToolTipText("Add server to the list");
284 fBtnAdd->Connect("Clicked()", "TSessionServerFrame", this,
285 "OnBtnAddClicked()");
286 AddFrame(fBtnConnect = new TGTextButton(this, " Connect "),
287 new TGLayoutHints(kLHintsTop | kLHintsCenterX, 5, 5, 15, 5));
288 fBtnConnect->Connect("Clicked()", "TSessionServerFrame", this,
289 "OnBtnConnectClicked()");
290 fBtnConnect->SetToolTipText("Connect to the selected server");
291
292 fTxtConfig->Connect("DoubleClicked()", "TSessionServerFrame", this,
293 "OnConfigFileClicked()");
294
295 fTxtName->Connect("TextChanged(char*)", "TSessionServerFrame", this,
296 "SettingsChanged()");
297 fTxtAddress->Connect("TextChanged(char*)", "TSessionServerFrame", this,
298 "SettingsChanged()");
299 fTxtConfig->Connect("TextChanged(char*)", "TSessionServerFrame", this,
300 "SettingsChanged()");
301 fTxtUsrName->Connect("TextChanged(char*)", "TSessionServerFrame", this,
302 "SettingsChanged()");
303 fSync->Connect("Clicked()", "TSessionServerFrame", this,
304 "SettingsChanged()");
305 fLogLevel->Connect("ValueChanged(Long_t)", "TSessionServerFrame", this,
306 "SettingsChanged()");
307 fLogLevel->Connect("ValueSet(Long_t)", "TSessionServerFrame", this,
308 "SettingsChanged()");
309 fNumPort->Connect("ValueChanged(Long_t)", "TSessionServerFrame", this,
310 "SettingsChanged()");
311 fNumPort->Connect("ValueSet(Long_t)", "TSessionServerFrame", this,
312 "SettingsChanged()");
313
314}
315
316////////////////////////////////////////////////////////////////////////////////
317/// Settings have changed, update GUI accordingly.
318
320{
321 TGTextEntry *sender = dynamic_cast<TGTextEntry*>((TQObject*)gTQSender);
322 Bool_t issync = (fSync->GetState() == kButtonDown);
323 if ((fViewer->GetActDesc()->fLocal) ||
324 (strcmp(fViewer->GetActDesc()->GetName(), fTxtName->GetText())) ||
325 (strcmp(fViewer->GetActDesc()->fAddress.Data(), fTxtAddress->GetText())) ||
326 (strcmp(fViewer->GetActDesc()->fConfigFile.Data(), fTxtConfig->GetText())) ||
327 (strcmp(fViewer->GetActDesc()->fUserName.Data(), fTxtUsrName->GetText())) ||
330 (fViewer->GetActDesc()->fSync != issync)) {
333 }
334 else {
337 }
338 if (sender) {
339 sender->SetFocus();
340 }
341}
342
343
344////////////////////////////////////////////////////////////////////////////////
345/// Handle expose event in server frame.
346
348{
349 //fTxtName->SelectAll();
350 //fTxtName->SetFocus();
351 return kTRUE;
352}
353
354////////////////////////////////////////////////////////////////////////////////
355/// Browse configuration files.
356
358{
359 // do nothing if connection in progress
360 if (fViewer->IsBusy())
361 return;
362 TGFileInfo fi;
365 if (!fi.fFilename) return;
367}
368
369////////////////////////////////////////////////////////////////////////////////
370/// Delete selected session configuration (remove it from the list).
371
373{
374 // do nothing if connection in progress
375 if (fViewer->IsBusy())
376 return;
378 TIter next(fViewer->GetSessions());
380
381 if (desc->fLocal) {
382 Int_t retval;
383 new TGMsgBox(fClient->GetRoot(), this, "Error Deleting Session",
384 "Deleting Local Sessions is not allowed !",
385 kMBIconExclamation,kMBOk,&retval);
386 return;
387 }
388 // ask for confirmation
389 TString m;
390 m.Form("Are you sure to delete the server \"%s\"",
391 desc->fName.Data());
392 Int_t result;
393 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), 0,
394 kMBOk | kMBCancel, &result);
395 // if confirmed, delete it
396 if (result == kMBOk) {
397 // remove the Proof session from gROOT list of Proofs
398 if (desc->fConnected && desc->fAttached && desc->fProof) {
399 desc->fProof->Detach("S");
400 }
401 // remove it from our sessions list
402 fViewer->GetSessions()->Remove((TObject *)desc);
403 // update configuration file
406
407 TObject *obj = fViewer->GetSessions()->Last();
409 fViewer->GetSessionItem(), (void *)obj);
410 if (item) {
417 fViewer->OnListTreeClicked(item, 1, 0, 0);
418 }
419 }
420 if (fViewer->IsAutoSave())
422}
423
424////////////////////////////////////////////////////////////////////////////////
425/// Connect to selected server.
426
428{
429 // do nothing if connection in progress
430 if (fViewer->IsBusy())
431 return;
432
435 }
436 else {
439 if (strlen(fTxtConfig->GetText()) > 1)
441 else
446 if (fViewer->IsAutoSave())
448 }
449 // set flag busy
450 fViewer->SetBusy();
451 // avoid input events in list tree while connecting
456 // set watch cursor to indicate connection in progress
458 gVirtualX->CreateCursor(kWatch));
459 gVirtualX->SetCursor(GetId(),gVirtualX->CreateCursor(kWatch));
460 // display connection progress bar in first part of status bar
462 // connect to proof startup message (to update progress bar)
463 TQObject::Connect("TProof", "StartupMessage(char *,Bool_t,Int_t,Int_t)",
464 "TSessionViewer", fViewer, "StartupMessage(char *,Bool_t,Int_t,Int_t)");
465 // collect and set-up configuration
466 TString address = fTxtAddress->GetText();
467 TString url;
468 if (address == "lite://") {
469 url = address;
470 }
471 else {
472 // collect and set-up configuration
473 url = fTxtUsrName->GetText();
474 url += "@"; url += address.Data();
475 if (fNumPort->GetIntNumber() > 0) {
476 url += ":";
477 url += fNumPort->GetIntNumber();
478 }
479 }
480
481 TProofDesc *desc;
483 if (!fViewer->GetActDesc()->fProofMgr ||
485 // hide connection progress bar from status bar
487 // release busy flag
489 // restore cursors and input
490 gVirtualX->SetCursor(GetId(), 0);
495 gVirtualX->SetCursor(fViewer->GetSessionHierarchy()->GetId(), 0);
496 return;
497 }
499 // check if the session already exist before to recreate it
500 TList *sessions = fViewer->GetActDesc()->fProofMgr->QuerySessions("");
501 if (sessions) {
502 TIter nextp(sessions);
503 // loop over existing Proof sessions
504 while ((desc = (TProofDesc *)nextp())) {
505 if ((desc->GetName() == fViewer->GetActDesc()->fTag) ||
506 (desc->GetTitle() == fViewer->GetActDesc()->fName)) {
509 fViewer->GetActDesc()->fTag = desc->GetName();
513
515 Int_t i = 0;
516 // browse list of feedback histos and check user's selected ones
517 while (kFeedbackHistos[i]) {
518 if (fViewer->GetCascadeMenu()->IsEntryChecked(41+i)) {
521 }
522 i++;
523 }
524 // connect feedback signal
525 fViewer->GetActDesc()->fProof->Connect("Feedback(TList *objs)",
526 "TSessionQueryFrame", fViewer->GetQueryFrame(),
527 "Feedback(TList *objs)");
528 gROOT->Time();
529 }
530 else {
531 // if feedback option not selected, clear Proof's feedback option
533 }
534
535 break;
536 }
537 }
538 }
539 if (fViewer->GetActDesc()->fProof == 0) {
540 if (fViewer->GetActDesc()->fProofMgr->IsValid()) {
543 desc = 0;
544 sessions = fViewer->GetActDesc()->fProofMgr->QuerySessions("");
545 if (sessions)
546 desc = (TProofDesc *)sessions->Last();
547 if (desc) {
549 fViewer->GetActDesc()->fTag = desc->GetName();
552 }
553 }
554 }
555 if (fViewer->GetActDesc()->fProof) {
560 if (fViewer->GetActDesc()->fLogLevel < 0)
562 if (fViewer->GetActDesc()->fProof->IsLite())
563 fViewer->GetActDesc()->fAddress = "lite://";
564 else
568 }
570
571 // check if connected and valid
572 if (fViewer->GetActDesc()->fProof &&
574 // set log level
576 // set query type (synch / asynch)
579 // set connected flag
581 // change list tree item picture to connected pixmap
584 if (item) {
586 // update viewer
587 fViewer->OnListTreeClicked(item, 1, 0, 0);
590 }
591 // connect to progress related signals
592 fViewer->GetActDesc()->fProof->Connect("Progress(Long64_t,Long64_t)",
593 "TSessionQueryFrame", fViewer->GetQueryFrame(),
594 "Progress(Long64_t,Long64_t)");
595 fViewer->GetActDesc()->fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
596 "TSessionQueryFrame", fViewer->GetQueryFrame(),
597 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
598 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)",
599 "TSessionQueryFrame", fViewer->GetQueryFrame(),
600 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
601 fViewer->GetActDesc()->fProof->Connect("StopProcess(Bool_t)",
602 "TSessionQueryFrame", fViewer->GetQueryFrame(),
603 "IndicateStop(Bool_t)");
605 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)",
606 "TSessionQueryFrame", fViewer->GetQueryFrame(),
607 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)");
608 // enable timer used for status bar icon's animation
610 // change status bar right icon to connected pixmap
611 fViewer->ChangeRightLogo("monitor01.xpm");
612 // do not animate yet
614 // connect to signal "query result ready"
615 fViewer->GetActDesc()->fProof->Connect("QueryResultReady(char *)",
616 "TSessionViewer", fViewer, "QueryResultReady(char *)");
617 // display connection information on status bar
618 TString msg;
619 msg.Form("PROOF Cluster %s ready", fViewer->GetActDesc()->fName.Data());
620 fViewer->GetStatusBar()->SetText(msg.Data(), 1);
624 // Enable previously uploaded packages if in auto-enable mode
626 TPackageDescription *package;
628 while ((package = (TPackageDescription *)next())) {
629 if (!package->fEnabled) {
630 if (fViewer->GetActDesc()->fProof->EnablePackage(package->fName) != 0)
631 Error("Submit", "Enable package failed");
632 else {
633 package->fEnabled = kTRUE;
635 }
636 }
637 }
638 }
639 }
640 // hide connection progress bar from status bar
642 // release busy flag
644 // restore cursors and input
645 gVirtualX->SetCursor(GetId(), 0);
650 gVirtualX->SetCursor(fViewer->GetSessionHierarchy()->GetId(), 0);
651}
652
653////////////////////////////////////////////////////////////////////////////////
654/// Reset server configuration fields.
655
657{
658 // do nothing if connection in progress
659 if (fViewer->IsBusy())
660 return;
668 fTxtName->SetText("");
669 fTxtAddress->SetText("");
670 fTxtConfig->SetText("");
671 fNumPort->SetIntNumber(1093);
673 fTxtUsrName->SetText("");
674}
675
676////////////////////////////////////////////////////////////////////////////////
677/// Add newly created session configuration in the list of sessions.
678
680{
681 Int_t retval;
682 Bool_t newSession = kTRUE;
683 TSessionDescription* desc = 0;
684 // do nothing if connection in progress
685 if (fViewer->IsBusy())
686 return;
687
688 if ((!fTxtName->GetBuffer()->GetTextLength()) ||
691 new TGMsgBox(fClient->GetRoot(), fViewer, "Error Adding Session",
692 "At least one required field is empty !",
693 kMBIconExclamation, kMBOk, &retval);
694 return;
695 }
697 if (obj)
698 desc = dynamic_cast<TSessionDescription*>(obj);
699 if (desc) {
700 new TGMsgBox(fClient->GetRoot(), fViewer, "Adding Session",
701 TString::Format("The session \"%s\" already exists ! Overwrite ?",
703 kMBCancel, &retval);
704 if (retval != kMBYes)
705 return;
706 newSession = kFALSE;
707 }
708 if (newSession) {
709 desc = new TSessionDescription();
710 desc->fName = fTxtName->GetText();
711 desc->fTag = "";
712 desc->fQueries = new TList();
713 desc->fPackages = new TList();
714 desc->fActQuery = 0;
715 desc->fProof = 0;
716 desc->fProofMgr = 0;
717 desc->fAutoEnable = kFALSE;
718 desc->fAddress = fTxtAddress->GetText();
719 desc->fPort = fNumPort->GetIntNumber();
720 desc->fConnected = kFALSE;
721 desc->fAttached = kFALSE;
722 desc->fLocal = kFALSE;
723 if (strlen(fTxtConfig->GetText()) > 1)
725 else
726 desc->fConfigFile = "";
728 desc->fUserName = fTxtUsrName->GetText();
729 desc->fSync = (fSync->GetState() == kButtonDown);
730 // add newly created session config to our session list
731 fViewer->GetSessions()->Add((TObject *)desc);
732 // save into configuration file
734 fViewer->GetSessionItem(), desc->fName.Data(),
736 fViewer->GetSessionHierarchy()->SetToolTipItem(item, "Proof Session");
737 item->SetUserData(desc);
745 fViewer->OnListTreeClicked(item, 1, 0, 0);
746 }
747 else {
751 if (strlen(fTxtConfig->GetText()) > 1)
757 item2->SetUserData(fViewer->GetActDesc());
759 1, 0, 0);
760 }
763 if (fViewer->IsAutoSave())
765}
766
767////////////////////////////////////////////////////////////////////////////////
768/// Update fields with values from session description desc.
769
771{
772 if (desc->fLocal) {
773 fTxtName->SetText("");
774 fTxtAddress->SetText("");
775 fNumPort->SetIntNumber(1093);
776 fTxtConfig->SetText("");
777 fTxtUsrName->SetText("");
779 return;
780 }
781
782 fTxtName->SetText(desc->fName);
786
787 if (desc->fConfigFile.Length() > 1) {
789 }
790 else {
791 fTxtConfig->SetText("");
792 }
794}
795
796////////////////////////////////////////////////////////////////////////////////
797/// Process messages for session server frame.
798/// Used to navigate between text entry fields.
799
801{
802 switch (GET_MSG(msg)) {
803 case kC_TEXTENTRY:
804 switch (GET_SUBMSG(msg)) {
805 case kTE_ENTER:
806 case kTE_TAB:
807 switch (parm1) {
808 case 1: // session name
811 break;
812 case 2: // server address
815 break;
816 case 3: // port number
819 break;
820 case 4: // configuration file
823 break;
824 case 5: // log level
827 break;
828 case 6: // user name
831 break;
832 }
833 break;
834
835 default:
836 break;
837 }
838 break;
839
840 default:
841 break;
842 }
843 return kTRUE;
844}
845
846////////////////////////////////////////////////////////////////////////////////
847// Session Frame
848
849////////////////////////////////////////////////////////////////////////////////
850/// Constructor.
851
853 TGCompositeFrame(p, w, h), fTab(0), fFA(0), fFB(0), fFC(0), fFD(0), fFE(0),
854 fCommandTxt(0), fCommandBuf(0), fInfoTextView(0), fClearCheck(0),
855 fBtnShowLog(0), fBtnNewQuery(0), fBtnGetQueries(0), fLBPackages(0),
856 fBtnAdd(0), fBtnRemove(0), fBtnUp(0), fBtnDown(0), fBtnShow(0),
857 fBtnShowEnabled(0), fChkMulti(0), fChkEnable(0), fBtnUpload(0),
858 fBtnEnable(0), fBtnClear(0), fBtnDisable(0), fDSetView(0), fDataSetTree(0),
859 fBtnUploadDSet(0), fBtnRemoveDSet(0), fBtnVerifyDSet(0), fBtnRefresh(0),
860 fTxtParallel(0), fLogLevel(0), fApplyLogLevel(0), fApplyParallel(0),
861 fViewer(0)
862{
863 for (int i=0;i<19;++i) fInfoLine[i] = 0;
864}
865
866////////////////////////////////////////////////////////////////////////////////
867/// Destructor.
868
870{
871 Cleanup();
872}
873
874////////////////////////////////////////////////////////////////////////////////
875/// Build session frame.
876
878{
881 fViewer = gui;
882 Int_t i,j;
883
884 // main session tab
885 fTab = new TGTab(this, 200, 200);
887 kLHintsExpandY, 2, 2, 2, 2));
888
889 // add "Status" tab element
890 TGCompositeFrame *tf = fTab->AddTab("Status");
891 fFA = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
894
895 // add first session information line
896 fInfoLine[0] = new TGLabel(fFA, " ");
898 kLHintsExpandX, 5, 5, 15, 5));
899
900 TGCompositeFrame* frmInfos = new TGHorizontalFrame(fFA, 350, 100);
901 frmInfos->SetLayoutManager(new TGTableLayout(frmInfos, 9, 2));
902
903 // add session information lines
904 j = 0;
905 for (i=0;i<17;i+=2) {
906 fInfoLine[i+1] = new TGLabel(frmInfos, " ");
907 frmInfos->AddFrame(fInfoLine[i+1], new TGTableLayoutHints(0, 1, j, j+1,
908 kLHintsLeft | kLHintsCenterY, 5, 5, 2, 2));
909 fInfoLine[i+2] = new TGLabel(frmInfos, " ");
910 frmInfos->AddFrame(fInfoLine[i+2], new TGTableLayoutHints(1, 2, j, j+1,
911 kLHintsLeft | kLHintsCenterY, 5, 5, 2, 2));
912 j++;
913 }
915 kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5));
916
917 // add "new query" and "get queries" buttons
918 TGCompositeFrame* frmBut1 = new TGHorizontalFrame(fFA, 350, 100);
919 frmBut1->SetCleanup(kDeepCleanup);
920 frmBut1->AddFrame(fBtnNewQuery = new TGTextButton(frmBut1, "New Query..."),
921 new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5));
922 fBtnNewQuery->SetToolTipText("Open New Query Dialog");
923 frmBut1->AddFrame(fBtnGetQueries = new TGTextButton(frmBut1, " Get Queries "),
924 new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5));
925 fBtnGetQueries->SetToolTipText("Get List of Queries from the server");
926 fBtnShowLog = new TGTextButton(frmBut1, "Show log...");
927 fBtnShowLog->SetToolTipText("Show Session log (opens log window)");
929 kLHintsExpandX, 5, 5, 5, 5));
932
933 // add "Commands" tab element
934 tf = fTab->AddTab("Commands");
935 fFC = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
938
939 // add command line label and text entry
940 TGCompositeFrame* frmCmd = new TGHorizontalFrame(fFC, 350, 100);
941 frmCmd->SetCleanup(kDeepCleanup);
942 frmCmd->AddFrame(new TGLabel(frmCmd, "Command Line :"),
943 new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 5, 5, 15, 5));
944 fCommandBuf = new TGTextBuffer(120);
945 frmCmd->AddFrame(fCommandTxt = new TGTextEntry(frmCmd,
947 kLHintsExpandX, 5, 5, 15, 5));
948 fFC->AddFrame(frmCmd, new TGLayoutHints(kLHintsExpandX, 5, 5, 10, 5));
949 // connect command line text entry to "return pressed" signal
950 fCommandTxt->Connect("ReturnPressed()", "TSessionFrame", this,
951 "OnCommandLine()");
952
953 // check box for option "clear view"
954 fClearCheck = new TGCheckButton(fFC, "Clear view after each command");
956 10, 5, 5, 5));
958 // add text view for redirected output
959 fFC->AddFrame(new TGLabel(fFC, "Output :"),
960 new TGLayoutHints(kLHintsLeft | kLHintsTop, 10, 5, 5, 5));
961 fInfoTextView = new TGTextView(fFC, 330, 150, "", kSunkenFrame |
964 kLHintsTop | kLHintsExpandX | kLHintsExpandY, 10, 10, 5, 5));
965
966 // add "Packages" tab element
967 tf = fTab->AddTab("Packages");
968 fFB = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
971
972 // new frame containing packages listbox and control buttons
973 TGCompositeFrame* frmcanvas = new TGHorizontalFrame(fFB, 350, 100);
974
975 // packages listbox
976 fLBPackages = new TGListBox(frmcanvas);
977 fLBPackages->Resize(80,150);
980 kLHintsExpandY, 5, 5, 5, 5));
981 // control buttons frame
982 TGCompositeFrame* frmBut2 = new TGVerticalFrame(frmcanvas, 150, 100);
983
984 fChkMulti = new TGCheckButton(frmBut2, "Multiple Selection");
985 fChkMulti->SetToolTipText("Enable multiple selection in the package list");
986 frmBut2->AddFrame(fChkMulti, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
987
988 fBtnAdd = new TGTextButton(frmBut2, " Add... ");
989 fBtnAdd->SetToolTipText("Add a package to the list");
991 kLHintsExpandX, 5, 5, 5, 5));
992 fBtnRemove = new TGTextButton(frmBut2, "Remove");
993 fBtnRemove->SetToolTipText("Remove package from the list");
995 kLHintsExpandX, 5, 5, 5, 5));
996 fBtnUp = new TGTextButton(frmBut2, "Move Up");
997 fBtnUp->SetToolTipText("Move package one step upward in the list");
999 kLHintsExpandX, 5, 5, 5, 5));
1000 fBtnDown = new TGTextButton(frmBut2, "Move Down");
1001 fBtnDown->SetToolTipText("Move package one step downward in the list");
1003 kLHintsExpandX, 5, 5, 5, 5));
1004 frmcanvas->AddFrame(frmBut2, new TGLayoutHints(kLHintsLeft | kLHintsCenterY |
1006 fFB->AddFrame(frmcanvas, new TGLayoutHints(kLHintsLeft | kLHintsTop |
1008
1009 TGCompositeFrame* frmLeg = new TGHorizontalFrame(fFB, 300, 100);
1010 frmLeg->SetCleanup(kDeepCleanup);
1011 TGPicture *pic1 = (TGPicture *)fClient->GetPicture("package.xpm");
1012 TGIcon *icn1 = new TGIcon(frmLeg, pic1, pic1->GetWidth(), pic1->GetHeight());
1013 frmLeg->AddFrame(icn1, new TGLayoutHints(kLHintsLeft | kLHintsTop,
1014 5, 5, 0, 5));
1015 frmLeg->AddFrame(new TGLabel(frmLeg, ": Local"),
1016 new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 10, 0, 5));
1017
1018 TGPicture *pic2 = (TGPicture *)fClient->GetPicture("package_delete.xpm");
1019 TGIcon *icn2 = new TGIcon(frmLeg, pic2, pic2->GetWidth(), pic2->GetHeight());
1020 frmLeg->AddFrame(icn2, new TGLayoutHints(kLHintsLeft | kLHintsTop,
1021 5, 5, 0, 5));
1022 frmLeg->AddFrame(new TGLabel(frmLeg, ": Uploaded"),
1023 new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 10, 0, 5));
1024
1025 TGPicture *pic3 = (TGPicture *)fClient->GetPicture("package_add.xpm");
1026 TGIcon *icn3 = new TGIcon(frmLeg, pic3, pic3->GetWidth(), pic3->GetHeight());
1027 frmLeg->AddFrame(icn3, new TGLayoutHints(kLHintsLeft | kLHintsTop,
1028 5, 5, 0, 5));
1029 frmLeg->AddFrame(new TGLabel(frmLeg, ": Enabled"),
1030 new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 10, 0, 5));
1032 kLHintsExpandX, 0, 0, 0, 0));
1033
1034 TGCompositeFrame* frmBtn = new TGHorizontalFrame(fFB, 300, 100);
1035 frmBtn->SetCleanup(kDeepCleanup);
1036 frmBtn->AddFrame(fBtnUpload = new TGTextButton(frmBtn,
1037 " Upload "), new TGLayoutHints(kLHintsLeft | kLHintsExpandX |
1038 kLHintsCenterY, 5, 5, 5, 5));
1039 fBtnUpload->SetToolTipText("Upload selected package(s) to the server");
1040 frmBtn->AddFrame(fBtnEnable = new TGTextButton(frmBtn,
1041 " Enable "), new TGLayoutHints(kLHintsLeft | kLHintsExpandX |
1042 kLHintsCenterY, 5, 5, 5, 5));
1043 fBtnEnable->SetToolTipText("Enable selected package(s) on the server");
1044 frmBtn->AddFrame(fBtnDisable = new TGTextButton(frmBtn,
1045 " Disable "), new TGLayoutHints(kLHintsLeft | kLHintsExpandX |
1046 kLHintsCenterY, 5, 5, 5, 5));
1047 fBtnDisable->SetToolTipText("Disable selected package(s) on the server");
1048 frmBtn->AddFrame(fBtnClear = new TGTextButton(frmBtn,
1049 " Clear "), new TGLayoutHints(kLHintsLeft | kLHintsExpandX |
1050 kLHintsCenterY, 5, 5, 5, 5));
1051 fBtnClear->SetToolTipText("Clear all packages on the server");
1052 fFB->AddFrame(frmBtn, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
1053
1055
1056 TGCompositeFrame* frmBtn3 = new TGHorizontalFrame(fFB, 300, 100);
1057 frmBtn3->SetCleanup(kDeepCleanup);
1058 fBtnShow = new TGTextButton(frmBtn3, "Show packages");
1059 fBtnShow->SetToolTipText("Show (list) available packages on the server");
1061 kLHintsExpandX, 5, 5, 5, 5));
1062 fBtnShowEnabled = new TGTextButton(frmBtn3, "Show Enabled");
1063 fBtnShowEnabled->SetToolTipText("Show (list) enabled packages on the server");
1065 kLHintsExpandX, 5, 5, 5, 5));
1066 fFB->AddFrame(frmBtn3, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
1067
1068 fChkEnable = new TGCheckButton(fFB, "Enable at session startup");
1069 fChkEnable->SetToolTipText("Enable packages on the server at startup time");
1070 fFB->AddFrame(fChkEnable, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
1071
1072 // add "DataSets" tab element
1073 tf = fTab->AddTab("DataSets");
1074 fFE = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
1077
1078 // new frame containing datasets treeview and control buttons
1079 TGCompositeFrame* frmdataset = new TGHorizontalFrame(fFE, 350, 100);
1080
1081 // datasets list tree
1082 fDSetView = new TGCanvas(frmdataset, 200, 200, kSunkenFrame | kDoubleBorder);
1084 5, 5, 5, 5));
1086 fDataSetTree->AddItem(0, "DataSets");
1087
1088 // control buttons frame
1089 TGCompositeFrame* frmBut3 = new TGVerticalFrame(frmdataset, 150, 100);
1090
1091 fBtnUploadDSet = new TGTextButton(frmBut3, " Upload... ");
1092 fBtnUploadDSet->SetToolTipText("Upload a dataset to the cluster");
1094 kLHintsExpandX, 5, 5, 5, 5));
1095 fBtnRemoveDSet = new TGTextButton(frmBut3, "Remove");
1096 fBtnRemoveDSet->SetToolTipText("Remove dataset from the cluster");
1098 kLHintsExpandX, 5, 5, 5, 5));
1099 fBtnVerifyDSet = new TGTextButton(frmBut3, "Verify");
1100 fBtnVerifyDSet->SetToolTipText("Verify dataset on the cluster");
1102 kLHintsExpandX, 5, 5, 5, 5));
1103 fBtnRefresh = new TGTextButton(frmBut3, "Refresh List");
1104 fBtnRefresh->SetToolTipText("Refresh List of DataSet/Files present on the cluster");
1106 kLHintsExpandX, 5, 5, 15, 5));
1107
1108 frmdataset->AddFrame(frmBut3, new TGLayoutHints(kLHintsLeft | kLHintsCenterY |
1109 kLHintsExpandY, 5, 5, 5, 0));
1110
1111 fFE->AddFrame(frmdataset, new TGLayoutHints(kLHintsLeft | kLHintsTop |
1113
1114 // add "Options" tab element
1115 tf = fTab->AddTab("Options");
1116 fFD = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
1119
1120 // add Log Level label and text entry
1121 TGCompositeFrame* frmLog = new TGHorizontalFrame(fFD, 310, 100, kFixedWidth);
1122 frmLog->SetCleanup(kDeepCleanup);
1123 frmLog->AddFrame(fApplyLogLevel = new TGTextButton(frmLog,
1124 " Apply "), new TGLayoutHints(kLHintsRight |
1125 kLHintsCenterY, 10, 5, 5, 5));
1126 fApplyLogLevel->SetToolTipText("Apply currently selected log level");
1130 kLHintsCenterY, 5, 5, 5, 5));
1131 frmLog->AddFrame(new TGLabel(frmLog, "Log Level :"),
1132 new TGLayoutHints(kLHintsRight | kLHintsCenterY, 5, 5, 5, 5));
1133 fFD->AddFrame(frmLog, new TGLayoutHints(kLHintsLeft, 5, 5, 15, 5));
1134
1135 // add Parallel Nodes label and text entry
1136 TGCompositeFrame* frmPar = new TGHorizontalFrame(fFD, 310, 100, kFixedWidth);
1137 frmPar->SetCleanup(kDeepCleanup);
1138 frmPar->AddFrame(fApplyParallel = new TGTextButton(frmPar,
1139 " Apply "), new TGLayoutHints(kLHintsRight |
1140 kLHintsCenterY, 10, 5, 5, 5));
1141 fApplyParallel->SetToolTipText("Apply currently selected parallel nodes");
1142 fTxtParallel = new TGTextEntry(frmPar);
1144 fTxtParallel->SetText("99999");
1147 kLHintsCenterY, 5, 5, 5, 5));
1148 frmPar->AddFrame(new TGLabel(frmPar, "Set Parallel Nodes :"),
1149 new TGLayoutHints(kLHintsRight | kLHintsCenterY, 5, 5, 5, 5));
1150 fFD->AddFrame(frmPar, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
1151
1152 // connect button actions to functions
1153 fBtnShowLog->Connect("Clicked()", "TSessionFrame", this,
1154 "OnBtnShowLogClicked()");
1155 fBtnNewQuery->Connect("Clicked()", "TSessionFrame", this,
1156 "OnBtnNewQueryClicked()");
1157 fBtnGetQueries->Connect("Clicked()", "TSessionFrame", this,
1158 "OnBtnGetQueriesClicked()");
1159
1160 fChkEnable->Connect("Toggled(Bool_t)", "TSessionFrame", this,
1161 "OnStartupEnable(Bool_t)");
1162 fChkMulti->Connect("Toggled(Bool_t)", "TSessionFrame", this,
1163 "OnMultipleSelection(Bool_t)");
1164 fBtnAdd->Connect("Clicked()", "TSessionFrame", this,
1165 "OnBtnAddClicked()");
1166 fBtnRemove->Connect("Clicked()", "TSessionFrame", this,
1167 "OnBtnRemoveClicked()");
1168 fBtnUp->Connect("Clicked()", "TSessionFrame", this,
1169 "OnBtnUpClicked()");
1170 fBtnDown->Connect("Clicked()", "TSessionFrame", this,
1171 "OnBtnDownClicked()");
1172 fApplyLogLevel->Connect("Clicked()", "TSessionFrame", this,
1173 "OnApplyLogLevel()");
1174 fApplyParallel->Connect("Clicked()", "TSessionFrame", this,
1175 "OnApplyParallel()");
1176 fBtnUpload->Connect("Clicked()", "TSessionFrame", this,
1177 "OnUploadPackages()");
1178 fBtnEnable->Connect("Clicked()", "TSessionFrame", this,
1179 "OnEnablePackages()");
1180 fBtnDisable->Connect("Clicked()", "TSessionFrame", this,
1181 "OnDisablePackages()");
1182 fBtnClear->Connect("Clicked()", "TSessionFrame", this,
1183 "OnClearPackages()");
1184 fBtnShowEnabled->Connect("Clicked()", "TSessionViewer", fViewer,
1185 "ShowEnabledPackages()");
1186 fBtnShow->Connect("Clicked()", "TSessionViewer", fViewer,
1187 "ShowPackages()");
1188
1189 fBtnUploadDSet->Connect("Clicked()", "TSessionFrame", this,
1190 "OnBtnUploadDSet()");
1191 fBtnRemoveDSet->Connect("Clicked()", "TSessionFrame", this,
1192 "OnBtnRemoveDSet()");
1193 fBtnVerifyDSet->Connect("Clicked()", "TSessionFrame", this,
1194 "OnBtnVerifyDSet()");
1195 fBtnRefresh->Connect("Clicked()", "TSessionFrame", this,
1196 "UpdateListOfDataSets()");
1197}
1198
1199////////////////////////////////////////////////////////////////////////////////
1200/// Display information on current session.
1201
1203{
1204 TString buf;
1205
1206 // if local session
1207 if (fViewer->GetActDesc()->fLocal) {
1208 buf.Form("*** Local Session on %s ***", gSystem->HostName());
1209 fInfoLine[0]->SetText(buf.Data());
1210 UserGroup_t *userGroup = gSystem->GetUserInfo();
1211 fInfoLine[1]->SetText("User :");
1212 if (userGroup) buf.Form("%s", userGroup->fRealName.Data());
1213 fInfoLine[2]->SetText(buf.Data());
1214 fInfoLine[3]->SetText("Working directory :");
1215 buf.Form("%s", gSystem->WorkingDirectory());
1216 fInfoLine[4]->SetText(buf.Data());
1217 fInfoLine[5]->SetText(" ");
1218 fInfoLine[6]->SetText(" ");
1219 fInfoLine[7]->SetText(" ");
1220 fInfoLine[8]->SetText(" ");
1221 fInfoLine[9]->SetText(" ");
1222 fInfoLine[10]->SetText(" ");
1223 fInfoLine[11]->SetText(" ");
1224 fInfoLine[12]->SetText(" ");
1225 fInfoLine[13]->SetText(" ");
1226 fInfoLine[14]->SetText(" ");
1227 fInfoLine[15]->SetText(" ");
1228 fInfoLine[16]->SetText(" ");
1229 fInfoLine[17]->SetText(" ");
1230 fInfoLine[18]->SetText(" ");
1231 if (userGroup) delete userGroup;
1232 Layout();
1234 return;
1235 }
1236 // return if not a valid Proof session
1237 if (!fViewer->GetActDesc()->fConnected ||
1239 !fViewer->GetActDesc()->fProof ||
1241 return;
1242
1243 if (!fViewer->GetActDesc()->fProof->IsMaster()) {
1245 buf.Form("*** Connected to %s (parallel mode, %d workers) ***",
1248 else
1249 buf.Form("*** Connected to %s (sequential mode) ***",
1251 fInfoLine[0]->SetText(buf.Data());
1252 fInfoLine[1]->SetText("Port number : ");
1253 buf.Form("%d", fViewer->GetActDesc()->fProof->GetPort());
1254 fInfoLine[2]->SetText(buf.Data());
1255 fInfoLine[3]->SetText("User : ");
1256 buf.Form("%s", fViewer->GetActDesc()->fProof->GetUser());
1257 fInfoLine[4]->SetText(buf.Data());
1258 fInfoLine[5]->SetText("Client protocol version : ");
1260 fInfoLine[6]->SetText(buf.Data());
1261 fInfoLine[7]->SetText("Remote protocol version : ");
1263 fInfoLine[8]->SetText(buf.Data());
1264 fInfoLine[9]->SetText("Log level : ");
1265 buf.Form("%d", fViewer->GetActDesc()->fProof->GetLogLevel());
1266 fInfoLine[10]->SetText(buf.Data());
1267 fInfoLine[11]->SetText("Session unique tag : ");
1268 buf.Form("%s", fViewer->GetActDesc()->fProof->IsValid() ?
1269 fViewer->GetActDesc()->fProof->GetSessionTag() : " ");
1270 fInfoLine[12]->SetText(buf.Data());
1271 fInfoLine[13]->SetText("Total MB's processed :");
1272 buf.Form("%.2f", float(fViewer->GetActDesc()->fProof->GetBytesRead())/(1024*1024));
1273 fInfoLine[14]->SetText(buf.Data());
1274 fInfoLine[15]->SetText("Total real time used (s) :");
1275 buf.Form("%.3f", fViewer->GetActDesc()->fProof->GetRealTime());
1276 fInfoLine[16]->SetText(buf.Data());
1277 fInfoLine[17]->SetText("Total CPU time used (s) :");
1278 buf.Form("%.3f", fViewer->GetActDesc()->fProof->GetCpuTime());
1279 fInfoLine[18]->SetText(buf.Data());
1280 }
1281 else {
1283 buf.Form("*** Master server %s (parallel mode, %d workers) ***",
1286 else
1287 buf.Form("*** Master server %s (sequential mode) ***",
1289 fInfoLine[0]->SetText(buf.Data());
1290 fInfoLine[1]->SetText("Port number : ");
1291 buf.Form("%d", fViewer->GetActDesc()->fProof->GetPort());
1292 fInfoLine[2]->SetText(buf.Data());
1293 fInfoLine[3]->SetText("User : ");
1294 buf.Form("%s", fViewer->GetActDesc()->fProof->GetUser());
1295 fInfoLine[4]->SetText(buf.Data());
1296 fInfoLine[5]->SetText("Protocol version : ");
1298 fInfoLine[6]->SetText(buf.Data());
1299 fInfoLine[7]->SetText("Image name : ");
1300 buf.Form("%s",fViewer->GetActDesc()->fProof->GetImage());
1301 fInfoLine[8]->SetText(buf.Data());
1302 fInfoLine[9]->SetText("Config directory : ");
1303 buf.Form("%s", fViewer->GetActDesc()->fProof->GetConfDir());
1304 fInfoLine[10]->SetText(buf.Data());
1305 fInfoLine[11]->SetText("Config file : ");
1306 buf.Form("%s", fViewer->GetActDesc()->fProof->GetConfFile());
1307 fInfoLine[12]->SetText(buf.Data());
1308 fInfoLine[13]->SetText("Total MB's processed :");
1309 buf.Form("%.2f", float(fViewer->GetActDesc()->fProof->GetBytesRead())/(1024*1024));
1310 fInfoLine[14]->SetText(buf.Data());
1311 fInfoLine[15]->SetText("Total real time used (s) :");
1312 buf.Form("%.3f", fViewer->GetActDesc()->fProof->GetRealTime());
1313 fInfoLine[16]->SetText(buf.Data());
1314 fInfoLine[17]->SetText("Total CPU time used (s) :");
1315 buf.Form("%.3f", fViewer->GetActDesc()->fProof->GetCpuTime());
1316 fInfoLine[18]->SetText(buf.Data());
1317 }
1318 Layout();
1320}
1321
1322////////////////////////////////////////////////////////////////////////////////
1323/// Open Upload Dataset dialog.
1324
1326{
1327 if (fViewer->IsBusy())
1328 return;
1329 if (fViewer->GetActDesc()->fLocal) return;
1330 new TUploadDataSetDlg(fViewer, 450, 360);
1331}
1332
1333////////////////////////////////////////////////////////////////////////////////
1334/// Update list of dataset present on the cluster.
1335
1337{
1338 TObjString *dsetname;
1339 TFileInfo *dsetfilename;
1340 // cleanup the list
1345
1346 const TGPicture *dseticon = fClient->GetPicture("rootdb_t.xpm");
1347 // ask for the list of datasets
1348
1349 // TODO: is now returning a TMap; viewer has to be adapted
1350 TList *dsetlist = 0; //fViewer->GetActDesc()->fProof->GetDataSets();
1351 // coverity[dead_error_condition]: to be changed for TMap usage
1352 if (dsetlist) {
1353 TGListTreeItem *dsetitem;
1355 TIter nextdset(dsetlist);
1356 while ((dsetname = (TObjString *)nextdset())) {
1358 // add the dataset in the tree
1360 dsetname->GetName(), dsetname);
1361 // ask for the list of files in the dataset
1362 TList *dsetfilelist = fViewer->GetActDesc()->fProof->GetDataSet(
1363 dsetname->GetName())->GetList();
1364 if(dsetfilelist) {
1365 TIter nextdsetfile(dsetfilelist);
1366 while ((dsetfilename = (TFileInfo *)nextdsetfile())) {
1367 if (! fDataSetTree->FindItemByObj(dsetitem, dsetfilename)) {
1368 // if not already in, add the file name in the tree
1369 fDataSetTree->AddItem(dsetitem,
1370 dsetfilename->GetFirstUrl()->GetUrl(),
1371 dsetfilename, dseticon, dseticon);
1372 }
1373 }
1374 // open the dataset item in order to show the files
1375 fDataSetTree->OpenItem(dsetitem);
1376 }
1377 }
1378 }
1379 }
1380 }
1381 // refresh list tree
1383}
1384
1385////////////////////////////////////////////////////////////////////////////////
1386/// Remove dataset from the list and from the cluster.
1387
1389{
1390 TGListTreeItem *item;
1391 TObjString *obj = 0;
1392 if (fViewer->GetActDesc()->fLocal) return;
1393
1394 item = fDataSetTree->GetSelected();
1395 if (!item) return;
1396 if (item->GetParent() == 0) return;
1397 if (item->GetParent() == fDataSetTree->GetFirstItem()) {
1398 // Dataset itself
1399 obj = (TObjString *)item->GetUserData();
1400 }
1401 else if (item->GetParent()->GetParent() == fDataSetTree->GetFirstItem()) {
1402 // One file of the dataset
1403 obj = (TObjString *)item->GetParent()->GetUserData();
1404 }
1405
1406 // if valid Proof session, set parallel slaves
1407 if (obj && fViewer->GetActDesc()->fProof &&
1411 }
1412}
1413
1414////////////////////////////////////////////////////////////////////////////////
1415/// Verify that the files in the selected dataset are present on the cluster.
1416
1418{
1419 TGListTreeItem *item;
1420 TObjString *obj = 0;
1421 if (fViewer->GetActDesc()->fLocal) return;
1422
1423 item = fDataSetTree->GetSelected();
1424 if (!item) return;
1425 if (item->GetParent() == 0) return;
1426 if (item->GetParent() == fDataSetTree->GetFirstItem()) {
1427 // Dataset itself
1428 obj = (TObjString *)item->GetUserData();
1429 }
1430 else if (item->GetParent()->GetParent() == fDataSetTree->GetFirstItem()) {
1431 // One file of the dataset
1432 obj = (TObjString *)item->GetParent()->GetUserData();
1433 }
1434
1435 // if valid Proof session, set parallel slaves
1436 if (obj && fViewer->GetActDesc()->fProof &&
1439 }
1440}
1441
1442////////////////////////////////////////////////////////////////////////////////
1443/// Apply selected log level on current session.
1444
1446{
1447 // if local session, do nothing
1448 if (fViewer->GetActDesc()->fLocal) return;
1449 // if valid Proof session, set log level
1450 if (fViewer->GetActDesc()->fProof &&
1454 }
1456}
1457
1458////////////////////////////////////////////////////////////////////////////////
1459/// Apply selected number of workers on current Proof session.
1460
1462{
1463 // if local session, do nothing
1464 if (fViewer->GetActDesc()->fLocal) return;
1465 // if valid Proof session, set parallel slaves
1466 if (fViewer->GetActDesc()->fProof &&
1468 Int_t nodes = atoi(fTxtParallel->GetText());
1470 }
1472}
1473
1474////////////////////////////////////////////////////////////////////////////////
1475/// Handle multiple selection check button.
1476
1478{
1480}
1481
1482////////////////////////////////////////////////////////////////////////////////
1483/// Handle multiple selection check button.
1484
1486{
1487 if (fViewer->GetActDesc())
1489}
1490
1491////////////////////////////////////////////////////////////////////////////////
1492/// Update list of packages.
1493
1495{
1496 TPackageDescription *package;
1497 const TGPicture *pict;
1500 while ((package = (TPackageDescription *)next())) {
1501 if (package->fEnabled)
1502 pict = fClient->GetPicture("package_add.xpm");
1503 else if (package->fUploaded)
1504 pict = fClient->GetPicture("package_delete.xpm");
1505 else
1506 pict = fClient->GetPicture("package.xpm");
1508 package->fId, package->fPathName, pict);
1510 }
1513}
1514
1515////////////////////////////////////////////////////////////////////////////////
1516/// Upload selected package(s) to the current session.
1517
1519{
1520 // if local session, do nothing
1521 if (fViewer->GetActDesc()->fLocal) return;
1522 // if valid Proof session, upload packages
1523 if (fViewer->GetActDesc()->fProof &&
1525 TObject *obj;
1526 TList selected;
1527 fLBPackages->GetSelectedEntries(&selected);
1528 TIter next(&selected);
1529 while ((obj = next())) {
1530 TString name = obj->GetTitle();
1531 if (fViewer->GetActDesc()->fProof->UploadPackage(name.Data()) != 0)
1532 Error("Submit", "Upload package failed");
1533 else {
1535 if (!o) continue;
1536 TPackageDescription *package =
1537 dynamic_cast<TPackageDescription *>(o);
1538 if (package) {
1539 package->fUploaded = kTRUE;
1540 ((TGIconLBEntry *)obj)->SetPicture(
1541 fClient->GetPicture("package_delete.xpm"));
1542 }
1543 }
1544 }
1546 }
1549}
1550
1551////////////////////////////////////////////////////////////////////////////////
1552/// Enable selected package(s) in the current session.
1553
1555{
1556 // if local session, do nothing
1557 if (fViewer->GetActDesc()->fLocal) return;
1558 // if valid Proof session, enable packages
1559 if (fViewer->GetActDesc()->fProof &&
1561 TObject *obj;
1562 TList selected;
1564 fLBPackages->GetSelectedEntries(&selected);
1565 TIter next(&selected);
1566 while ((obj = next())) {
1567 TString name = obj->GetTitle();
1569 if (!o) continue;
1570 TPackageDescription *package =
1571 dynamic_cast<TPackageDescription *>(o);
1572 if (package) {
1573 if (!package->fUploaded) {
1574 if (fViewer->GetActDesc()->fProof->UploadPackage(name.Data()) != 0)
1575 Error("Submit", "Upload package failed");
1576 else {
1577 package->fUploaded = kTRUE;
1578 ((TGIconLBEntry *)obj)->SetPicture(
1579 fClient->GetPicture("package_delete.xpm"));
1580 }
1581 }
1582 }
1584 Error("Submit", "Enable package failed");
1585 else {
1586 package->fEnabled = kTRUE;
1587 ((TGIconLBEntry *)obj)->SetPicture(fClient->GetPicture("package_add.xpm"));
1588 }
1589 }
1592 }
1595}
1596
1597////////////////////////////////////////////////////////////////////////////////
1598/// Disable selected package(s) in the current session.
1599
1601{
1602 // if local session, do nothing
1603 if (fViewer->GetActDesc()->fLocal) return;
1604 // if valid Proof session, disable (clear) packages
1605 if (fViewer->GetActDesc()->fProof &&
1607 TObject *obj;
1608 TList selected;
1609 fLBPackages->GetSelectedEntries(&selected);
1610 TIter next(&selected);
1611 while ((obj = next())) {
1612 TString name = obj->GetTitle();
1613 if (fViewer->GetActDesc()->fProof->ClearPackage(name) != 0)
1614 Error("Submit", "Clear package failed");
1615 else {
1617 if (!o) continue;
1618 TPackageDescription *package =
1619 dynamic_cast<TPackageDescription *>(o);
1620 if (package) {
1621 package->fEnabled = kFALSE;
1622 package->fUploaded = kFALSE;
1623 ((TGIconLBEntry *)obj)->SetPicture(fClient->GetPicture("package.xpm"));
1624 }
1625 }
1626 }
1628 }
1631}
1632
1633////////////////////////////////////////////////////////////////////////////////
1634/// Clear (disable) all packages in the current session.
1635
1637{
1638 TPackageDescription *package;
1639 // if local session, do nothing
1640 if (fViewer->GetActDesc()->fLocal) return;
1641 // if valid Proof session, clear packages
1642 if (fViewer->GetActDesc()->fProof &&
1644 if (fViewer->GetActDesc()->fProof->ClearPackages() != 0)
1645 Error("Submit", "Clear packages failed");
1646 else {
1648 while ((package = (TPackageDescription *)next())) {
1649 package->fEnabled = kFALSE;
1650 }
1651 }
1652 }
1655}
1656
1657////////////////////////////////////////////////////////////////////////////////
1658/// Open file dialog and add selected package file to the list.
1659
1661{
1662 if (fViewer->IsBusy())
1663 return;
1664 TGFileInfo fi;
1665 TPackageDescription *package;
1666 TGIconLBEntry *entry;
1667 fi.fFileTypes = pkgtypes;
1669 if (fi.fMultipleSelection && fi.fFileNamesList) {
1670 TObjString *el;
1671 TIter next(fi.fFileNamesList);
1672 while ((el = (TObjString *) next())) {
1673 package = new TPackageDescription;
1674 package->fName = gSystem->BaseName(gSystem->UnixPathName(el->GetString()));
1675 package->fPathName = gSystem->UnixPathName(el->GetString());
1676 package->fId = fViewer->GetActDesc()->fPackages->GetEntries();
1677 package->fUploaded = kFALSE;
1678 package->fEnabled = kFALSE;
1679 fViewer->GetActDesc()->fPackages->Add((TObject *)package);
1680 entry = new TGIconLBEntry(fLBPackages->GetContainer(),
1681 package->fId, package->fPathName,
1682 fClient->GetPicture("package.xpm"));
1684 }
1685 }
1686 else if (fi.fFilename) {
1687 package = new TPackageDescription;
1689 package->fPathName = gSystem->UnixPathName(fi.fFilename);
1690 package->fId = fViewer->GetActDesc()->fPackages->GetEntries();
1691 package->fUploaded = kFALSE;
1692 package->fEnabled = kFALSE;
1693 fViewer->GetActDesc()->fPackages->Add((TObject *)package);
1694 entry = new TGIconLBEntry(fLBPackages->GetContainer(),
1695 package->fId, package->fPathName,
1696 fClient->GetPicture("package.xpm"));
1698 }
1701}
1702
1703////////////////////////////////////////////////////////////////////////////////
1704/// Remove selected package from the list.
1705
1707{
1708 TPackageDescription *package;
1709 const TGPicture *pict;
1710 Int_t pos = fLBPackages->GetSelected();
1713 fViewer->GetActDesc()->fPackages->At(pos));
1714 Int_t id = 0;
1716 while ((package = (TPackageDescription *)next())) {
1717 package->fId = id;
1718 id++;
1719 if (package->fEnabled)
1720 pict = fClient->GetPicture("package_add.xpm");
1721 else if (package->fUploaded)
1722 pict = fClient->GetPicture("package_delete.xpm");
1723 else
1724 pict = fClient->GetPicture("package.xpm");
1726 package->fId, package->fPathName, pict);
1728 }
1731}
1732
1733////////////////////////////////////////////////////////////////////////////////
1734/// Move selected package entry one position up in the list.
1735
1737{
1738 TPackageDescription *package;
1739 const TGPicture *pict;
1740 Int_t pos = fLBPackages->GetSelected();
1741 if (pos <= 0) return;
1743 package = (TPackageDescription *)fViewer->GetActDesc()->fPackages->At(pos);
1745 fViewer->GetActDesc()->fPackages->At(pos));
1746 package->fId -= 1;
1747 fViewer->GetActDesc()->fPackages->AddAt(package, package->fId);
1748 Int_t id = 0;
1750 while ((package = (TPackageDescription *)next())) {
1751 package->fId = id;
1752 id++;
1753 if (package->fEnabled)
1754 pict = fClient->GetPicture("package_add.xpm");
1755 else if (package->fUploaded)
1756 pict = fClient->GetPicture("package_delete.xpm");
1757 else
1758 pict = fClient->GetPicture("package.xpm");
1760 package->fId, package->fPathName, pict);
1762 }
1763 fLBPackages->Select(pos-1);
1766}
1767
1768////////////////////////////////////////////////////////////////////////////////
1769/// Move selected package entry one position down in the list.
1770
1772{
1773 TPackageDescription *package;
1774 const TGPicture *pict;
1775 Int_t pos = fLBPackages->GetSelected();
1776 if (pos == -1 || pos == fViewer->GetActDesc()->fPackages->GetEntries()-1)
1777 return;
1779 package = (TPackageDescription *)fViewer->GetActDesc()->fPackages->At(pos);
1781 fViewer->GetActDesc()->fPackages->At(pos));
1782 package->fId += 1;
1783 fViewer->GetActDesc()->fPackages->AddAt(package, package->fId);
1784 Int_t id = 0;
1786 while ((package = (TPackageDescription *)next())) {
1787 package->fId = id;
1788 id++;
1789 if (package->fEnabled)
1790 pict = fClient->GetPicture("package_add.xpm");
1791 else if (package->fUploaded)
1792 pict = fClient->GetPicture("package_delete.xpm");
1793 else
1794 pict = fClient->GetPicture("package.xpm");
1796 package->fId, package->fPathName, pict);
1798 }
1799 fLBPackages->Select(pos+1);
1802}
1803
1804////////////////////////////////////////////////////////////////////////////////
1805/// Disconnect from current Proof session.
1806
1808{
1809 // if local session, do nothing
1810 if (fViewer->GetActDesc()->fLocal) return;
1811 // if valid Proof session, disconnect (close)
1812 if (fViewer->GetActDesc()->fAttached &&
1816 }
1817 // reset connected flag
1819 fViewer->GetActDesc()->fProof = 0;
1820 // disable animation timer
1822 // change list tree item picture to disconnected pixmap
1825 if (item) {
1828 }
1829 // update viewer
1831 1, 0, 0);
1834 fViewer->GetStatusBar()->SetText("", 1);
1835}
1836
1837////////////////////////////////////////////////////////////////////////////////
1838/// Show session log.
1839
1841{
1842 fViewer->ShowLog(0);
1843}
1844
1845////////////////////////////////////////////////////////////////////////////////
1846/// Call "New Query" Dialog.
1847
1849{
1850 TNewQueryDlg *dlg = new TNewQueryDlg(fViewer, 350, 310);
1851 dlg->Popup();
1852}
1853
1854////////////////////////////////////////////////////////////////////////////////
1855/// Get list of queries from current Proof server and populate the list tree.
1856
1858{
1859 TList *lqueries = 0;
1860 TQueryResult *query = 0;
1861 TQueryDescription *newquery = 0, *lquery = 0;
1862 if (fViewer->GetActDesc()->fProof &&
1864 lqueries = fViewer->GetActDesc()->fProof->GetListOfQueries();
1865 }
1866 if (lqueries) {
1867 TIter nextp(lqueries);
1868 // loop over list of queries received from Proof server
1869 while ((query = (TQueryResult *)nextp())) {
1870 // create new query description
1871 newquery = new TQueryDescription();
1872 newquery->fReference = TString::Format("%s:%s", query->GetTitle(),
1873 query->GetName());
1874 // check in our tree if it is already there
1875 TGListTreeItem *item =
1878 // if already there, skip
1880 newquery->fReference.Data()))
1881 continue;
1882 // check also in our query description list
1883 Bool_t found = kFALSE;
1884 TIter nextp2(fViewer->GetActDesc()->fQueries);
1885 while ((lquery = (TQueryDescription *)nextp2())) {
1886 if (lquery->fReference.CompareTo(newquery->fReference) == 0) {
1887 found = kTRUE;
1888 break;
1889 }
1890 }
1891 if (found) continue;
1892 // build new query description with infos from Proof
1893 newquery->fStatus = query->IsFinalized() ?
1896 newquery->fSelectorString = query->GetSelecImp()->GetName();
1897 newquery->fQueryName = TString::Format("%s:%s", query->GetTitle(),
1898 query->GetName());
1899 newquery->fOptions = query->GetOptions();
1900 newquery->fEventList = "";
1901 newquery->fNbFiles = 0;
1902 newquery->fNoEntries = query->GetEntries();
1903 newquery->fFirstEntry = query->GetFirst();
1904 newquery->fResult = query;
1905 newquery->fChain = 0;
1906 fViewer->GetActDesc()->fQueries->Add((TObject *)newquery);
1908 newquery->fQueryName, fViewer->GetQueryConPict(),
1910 item2->SetUserData(newquery);
1911 if (query->GetInputList())
1912 fViewer->GetSessionHierarchy()->AddItem(item2, "InputList");
1913 if (query->GetOutputList())
1914 fViewer->GetSessionHierarchy()->AddItem(item2, "OutputList");
1915 }
1916 }
1917 // at the end, update list tree
1920}
1921
1922////////////////////////////////////////////////////////////////////////////////
1923/// Command line handling.
1924
1926{
1927 // get command string
1928 const char *cmd = fCommandTxt->GetText();
1929 char opt[2];
1930 // form temporary file path
1931 TString pathtmp = TString::Format("%s/%s", gSystem->TempDirectory(),
1933 // if check box "clear view" is checked, open temp file in write mode
1934 // (overwrite), in append mode otherwise.
1935 if (fClearCheck->IsOn())
1936 snprintf(opt, 2, "w");
1937 else
1938 snprintf(opt, 2, "a");
1939
1940 // if valid Proof session, pass the command to Proof
1941 if (fViewer->GetActDesc()->fProof &&
1943 // redirect stdout/stderr to temp file
1944 if (gSystem->RedirectOutput(pathtmp.Data(), opt) != 0) {
1945 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
1946 return;
1947 }
1948 // execute command line
1949 fViewer->GetActDesc()->fProof->Exec(cmd);
1950 // restore back stdout/stderr
1951 if (gSystem->RedirectOutput(0) != 0) {
1952 Error("ShowStatus", "stdout/stderr retore failed; skipping");
1953 return;
1954 }
1955 // if check box "clear view" is checked, clear text view
1956 if (fClearCheck->IsOn())
1958 // load (display) temp file in text view
1959 fInfoTextView->LoadFile(pathtmp.Data());
1960 // set focus to "command line" text entry
1962 }
1963 else {
1964 // if no Proof session, or Proof session not valid,
1965 // lets execute command line by TApplication
1966
1967 // redirect stdout/stderr to temp file
1968 if (gSystem->RedirectOutput(pathtmp.Data(), opt) != 0) {
1969 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
1970 }
1971 // execute command line
1973 // restore back stdout/stderr
1974 if (gSystem->RedirectOutput(0) != 0) {
1975 Error("ShowStatus", "stdout/stderr retore failed; skipping");
1976 }
1977 // if check box "clear view" is checked, clear text view
1978 if (fClearCheck->IsOn())
1980 // load (display) temp file in text view
1981 fInfoTextView->LoadFile(pathtmp.Data());
1982 // set focus to "command line" text entry
1984 }
1985 // display bottom of text view
1987}
1988
1989////////////////////////////////////////////////////////////////////////////////
1990/// Switch widgets status/visibility for local/remote sessions.
1991
1993{
1994 if (local) {
1997 fTab->HideFrame(fTab->GetTabTab("Options"));
1998 fTab->HideFrame(fTab->GetTabTab("Packages"));
1999 fTab->HideFrame(fTab->GetTabTab("DataSets"));
2000 }
2001 else {
2004 fTab->ShowFrame(fTab->GetTabTab("Options"));
2005 fTab->ShowFrame(fTab->GetTabTab("Packages"));
2006 fTab->ShowFrame(fTab->GetTabTab("DataSets"));
2007 }
2008}
2009
2010////////////////////////////////////////////////////////////////////////////////
2011/// Shutdown current session.
2012
2014{
2015 // do nothing if connection in progress
2016 if (fViewer->IsBusy())
2017 return;
2018
2019 if (fViewer->GetActDesc()->fLocal) {
2020 Int_t retval;
2021 new TGMsgBox(fClient->GetRoot(), this, "Error Shutting down Session",
2022 "Shutting down Local Sessions is not allowed !",
2023 kMBIconExclamation,kMBOk,&retval);
2024 return;
2025 }
2026 if (!fViewer->GetActDesc()->fAttached ||
2027 !fViewer->GetActDesc()->fProof ||
2029 return;
2030 // ask for confirmation
2031 TString m;
2032 m.Form("Are you sure to shutdown the session \"%s\"",
2034 Int_t result;
2035 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), 0,
2036 kMBOk | kMBCancel, &result);
2037 // if confirmed, delete it
2038 if (result != kMBOk)
2039 return;
2040 // remove the Proof session from gROOT list of Proofs
2041 fViewer->GetActDesc()->fProof->Detach("S");
2042 // reset connected flag
2044 fViewer->GetActDesc()->fProof = 0;
2045 // disable animation timer
2047 // change list tree item picture to disconnected pixmap
2050 if (item) {
2053 }
2054 // update viewer
2056 1, 0, 0);
2059 fViewer->GetStatusBar()->SetText("", 1);
2060}
2061
2062//////////////////////////////////////////////////////////////////////////
2063// Edit Query Frame
2064//////////////////////////////////////////////////////////////////////////
2065
2066////////////////////////////////////////////////////////////////////////////////
2067/// Create a new Query dialog, used by the Session Viewer, to Edit a Query if
2068/// the editmode flag is set, or to create a new one if not set.
2069
2071 TGCompositeFrame(p, w, h, kVerticalFrame), fFrmMore(0), fBtnMore(0),
2072 fTxtQueryName(0), fTxtChain(0), fTxtSelector(0), fTxtOptions(0),
2073 fNumEntries(0), fNumFirstEntry(0), fTxtParFile(0), fTxtEventList(0),
2074 fViewer(0), fQuery(0), fChain(0)
2075{
2076}
2077
2078////////////////////////////////////////////////////////////////////////////////
2079/// Delete query dialog.
2080
2082{
2083 Cleanup();
2084}
2085
2086////////////////////////////////////////////////////////////////////////////////
2087/// Build the "new query" dialog.
2088
2090{
2091 TGButton *btnTmp;
2092 fViewer = gui;
2094 SetLayoutManager(new TGTableLayout(this, 6, 5));
2095
2096 // add "Query Name" label and text entry
2097 AddFrame(new TGLabel(this, "Query Name :"),
2098 new TGTableLayoutHints(0, 1, 0, 1, kLHintsCenterY, 5, 5, 4, 0));
2100 (const char *)0, 1), new TGTableLayoutHints(1, 2, 0, 1,
2101 kLHintsCenterY, 5, 5, 4, 0));
2102
2103 // add "TChain" label and text entry
2104 AddFrame(new TGLabel(this, "TChain :"),
2105 new TGTableLayoutHints(0, 1, 1, 2, kLHintsCenterY, 5, 5, 4, 0));
2106 AddFrame(fTxtChain = new TGTextEntry(this,
2107 (const char *)0, 2), new TGTableLayoutHints(1, 2, 1, 2,
2108 kLHintsCenterY, 5, 5, 4, 0));
2109 fTxtChain->SetToolTipText("Specify TChain or TDSet from memory or file");
2111 // add "Browse" button
2112 AddFrame(btnTmp = new TGTextButton(this, "Browse..."),
2113 new TGTableLayoutHints(2, 3, 1, 2, kLHintsCenterY, 5, 0, 4, 8));
2114 btnTmp->Connect("Clicked()", "TEditQueryFrame", this, "OnBrowseChain()");
2115
2116 // add "Selector" label and text entry
2117 AddFrame(new TGLabel(this, "Selector :"),
2118 new TGTableLayoutHints(0, 1, 2, 3, kLHintsCenterY, 5, 5, 0, 0));
2120 (const char *)0, 3), new TGTableLayoutHints(1, 2, 2, 3,
2121 kLHintsCenterY, 5, 5, 0, 0));
2122 // add "Browse" button
2123 AddFrame(btnTmp = new TGTextButton(this, "Browse..."),
2124 new TGTableLayoutHints(2, 3, 2, 3, kLHintsCenterY, 5, 0, 0, 8));
2125 btnTmp->Connect("Clicked()", "TEditQueryFrame", this, "OnBrowseSelector()");
2126
2127 // add "Less <<" ("More >>") button
2128 AddFrame(fBtnMore = new TGTextButton(this, " Less << "),
2129 new TGTableLayoutHints(2, 3, 4, 5, kLHintsCenterY, 5, 5, 4, 0));
2130 fBtnMore->Connect("Clicked()", "TEditQueryFrame", this, "OnNewQueryMore()");
2131
2132 // add (initially hidden) options frame
2133 fFrmMore = new TGCompositeFrame(this, 200, 200);
2135
2136 AddFrame(fFrmMore, new TGTableLayoutHints(0, 3, 5, 6,
2139
2140 // add "Options" label and text entry
2141 fFrmMore->AddFrame(new TGLabel(fFrmMore, "Options :"),
2142 new TGTableLayoutHints(0, 1, 0, 1, kLHintsCenterY, 5, 5, 0, 0));
2144 (const char *)0, 4), new TGTableLayoutHints(1, 2, 0, 1, 0, 17,
2145 0, 0, 8));
2146 //fTxtOptions->SetText("ASYN");
2147 fTxtOptions->SetText("");
2148
2149 // add "Nb Entries" label and number entry
2150 fFrmMore->AddFrame(new TGLabel(fFrmMore, "Nb Entries :"),
2151 new TGTableLayoutHints(0, 1, 1, 2, kLHintsCenterY, 5, 5, 0, 0));
2155 0, 17, 0, 0, 8));
2156 // coverity[negative_returns]: no problem with -1, the format is kNESInteger
2158 // add "First Entry" label and number entry
2159 fFrmMore->AddFrame(new TGLabel(fFrmMore, "First entry :"),
2160 new TGTableLayoutHints(0, 1, 2, 3, kLHintsCenterY, 5, 5, 0, 0));
2164 17, 0, 0, 8));
2165
2166 // add "Event list" label and text entry
2167 fFrmMore->AddFrame(new TGLabel(fFrmMore, "Event list :"),
2168 new TGTableLayoutHints(0, 1, 3, 4, kLHintsCenterY, 5, 5, 0, 0));
2170 (const char *)0, 6), new TGTableLayoutHints(1, 2, 3, 4, 0, 17,
2171 5, 0, 0));
2172 // add "Browse" button
2173 fFrmMore->AddFrame(btnTmp = new TGTextButton(fFrmMore, "Browse..."),
2174 new TGTableLayoutHints(2, 3, 3, 4, 0, 6, 0, 0, 8));
2175 btnTmp->Connect("Clicked()", "TEditQueryFrame", this, "OnBrowseEventList()");
2176
2177 fTxtQueryName->Associate(this);
2178 fTxtChain->Associate(this);
2179 fTxtSelector->Associate(this);
2180 fTxtOptions->Associate(this);
2181 fNumEntries->Associate(this);
2183 fTxtEventList->Associate(this);
2184
2185 fTxtQueryName->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2186 "SettingsChanged()");
2187 fTxtChain->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2188 "SettingsChanged()");
2189 fTxtSelector->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2190 "SettingsChanged()");
2191 fTxtOptions->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2192 "SettingsChanged()");
2193 fNumEntries->Connect("ValueChanged(Long_t)", "TEditQueryFrame", this,
2194 "SettingsChanged()");
2195 fNumFirstEntry->Connect("ValueChanged(Long_t)", "TEditQueryFrame", this,
2196 "SettingsChanged()");
2197 fTxtEventList->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2198 "SettingsChanged()");
2199}
2200
2201////////////////////////////////////////////////////////////////////////////////
2202/// Show/hide options frame and update button text accordingly.
2203
2205{
2206 if (IsVisible(fFrmMore)) {
2208 fBtnMore->SetText(" More >> ");
2209 }
2210 else {
2212 fBtnMore->SetText(" Less << ");
2213 }
2214}
2215
2216////////////////////////////////////////////////////////////////////////////////
2217/// Call new chain dialog.
2218
2220{
2221 TNewChainDlg *dlg = new TNewChainDlg(fClient->GetRoot(), this);
2222 dlg->Connect("OnElementSelected(TObject *)", "TEditQueryFrame",
2223 this, "OnElementSelected(TObject *)");
2224}
2225
2226////////////////////////////////////////////////////////////////////////////////
2227/// Handle OnElementSelected signal coming from new chain dialog.
2228
2230{
2231 if (obj) {
2232 fChain = obj;
2233 if (obj->IsA() == TChain::Class())
2235 else if (obj->IsA() == TDSet::Class())
2236 fTxtChain->SetText(((TDSet *)fChain)->GetObjName());
2237 }
2238}
2239
2240////////////////////////////////////////////////////////////////////////////////
2241/// Open file browser to choose selector macro.
2242
2244{
2245 TGFileInfo fi;
2247 new TGFileDialog(fClient->GetRoot(), this, kFDOpen, &fi);
2248 if (!fi.fFilename) return;
2250}
2251
2252////////////////////////////////////////////////////////////////////////////////
2253///Browse event list
2254
2256{
2257}
2258
2259////////////////////////////////////////////////////////////////////////////////
2260/// Save current settings in main session viewer.
2261
2263{
2264 // if we are in edition mode and query description is valid,
2265 // use it, otherwise create a new one
2266 TQueryDescription *newquery;
2267 if (fQuery)
2268 newquery = fQuery;
2269 else
2270 newquery = new TQueryDescription();
2271
2272 // update query description fields
2273 newquery->fSelectorString = fTxtSelector->GetText();
2274 if (fChain) {
2275 newquery->fTDSetString = fChain->GetName();
2276 newquery->fChain = fChain;
2277 }
2278 else {
2279 newquery->fTDSetString = "";
2280 newquery->fChain = 0;
2281 }
2282 newquery->fQueryName = fTxtQueryName->GetText();
2283 newquery->fOptions = fTxtOptions->GetText();
2284 newquery->fNoEntries = fNumEntries->GetIntNumber();
2286 newquery->fNbFiles = 0;
2287 newquery->fResult = 0;
2288
2289 if (newquery->fChain) {
2290 if (newquery->fChain->IsA() == TChain::Class())
2291 newquery->fNbFiles = ((TChain *)newquery->fChain)->GetListOfFiles()->GetEntriesFast();
2292 else if (newquery->fChain->IsA() == TDSet::Class())
2293 newquery->fNbFiles = ((TDSet *)newquery->fChain)->GetListOfElements()->GetSize();
2294 }
2295 // update user data with modified query description
2297 fViewer->GetSessionHierarchy()->RenameItem(item, newquery->fQueryName);
2298 item->SetUserData(newquery);
2299 // update list tree
2306 if (fViewer->GetActDesc()->fLocal ||
2310 fViewer->GetActDesc()->fProof->IsValid())) {
2311 fViewer->GetQueryFrame()->GetTab()->SetTab("Status");
2313 }
2314}
2315
2316////////////////////////////////////////////////////////////////////////////////
2317/// Settings have changed, update GUI accordingly.
2318
2320{
2321 if (fQuery) {
2322 if ((strcmp(fQuery->fSelectorString.Data(), fTxtSelector->GetText())) ||
2323 (strcmp(fQuery->fQueryName.Data(), fTxtQueryName->GetText())) ||
2324 (strcmp(fQuery->fOptions.Data(), fTxtOptions->GetText())) ||
2327 (fQuery->fChain != fChain)) {
2329 }
2330 else {
2332 }
2333 }
2334 else {
2335 if ((fTxtQueryName->GetText()) &&
2336 ((fTxtQueryName->GetText()) ||
2337 (fTxtChain->GetText())))
2339 else
2341 }
2342}
2343
2344////////////////////////////////////////////////////////////////////////////////
2345/// Update entry fields with query description values.
2346
2348{
2349 fChain = 0;
2350 fQuery = desc;
2351 fTxtChain->SetText("");
2352 if (desc->fChain) {
2353 fChain = desc->fChain;
2355 }
2362}
2363
2364////////////////////////////////////////////////////////////////////////////////
2365// Query Frame
2366
2367////////////////////////////////////////////////////////////////////////////////
2368/// Constructor
2369
2371 TGCompositeFrame(p, w, h), fBtnSubmit(0), fBtnFinalize(0), fBtnStop(0),
2372 fBtnAbort(0), fBtnShowLog(0), fBtnRetrieve(0), fBtnSave(0), fInfoTextView(0),
2373 fModified(0), fFiles(0), fFirst(0), fEntries(0), fPrevTotal(0),
2374 fPrevProcessed(0), fLabInfos(0), fLabStatus(0), fTotal(0), fRate(0),
2375 fStatus(kStopped), fTab(0), fFA(0), fFB(0), fFC(0), fFD(0), frmProg(0),
2376 fECanvas(0), fStatsCanvas(0), fViewer(0), fDesc(0)
2377{
2378}
2379
2380////////////////////////////////////////////////////////////////////////////////
2381/// Destructor.
2382
2384{
2385 Cleanup();
2386}
2387
2388////////////////////////////////////////////////////////////////////////////////
2389/// Build query information frame.
2390
2392{
2395 fFirst = fEntries = fPrevTotal = 0;
2396 fPrevProcessed = 0;
2397 fViewer = gui;
2398 fModified = kFALSE;
2399
2400 // main query tab
2401 fTab = new TGTab(this, 200, 200);
2403 kLHintsExpandY, 2, 2, 2, 2));
2404
2405 // add "Status" tab element
2406 TGCompositeFrame *tf = fTab->AddTab("Status");
2407 fFB = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
2410
2411 // new frame containing control buttons and feedback histos canvas
2412 TGCompositeFrame* frmcanvas = new TGHorizontalFrame(fFB, 350, 100);
2413 // control buttons frame
2414 TGCompositeFrame* frmBut2 = new TGVerticalFrame(frmcanvas, 150, 100);
2415 fBtnSubmit = new TGTextButton(frmBut2, " Submit ");
2416 fBtnSubmit->SetToolTipText("Submit (process) selected query");
2418 kLHintsExpandX, 5, 5, 5, 5));
2419 fBtnStop = new TGTextButton(frmBut2, "Stop");
2420 fBtnStop->SetToolTipText("Stop processing query");
2422 kLHintsExpandX, 5, 5, 5, 5));
2423 fBtnAbort = new TGTextButton(frmBut2, "Abort");
2424 fBtnAbort->SetToolTipText("Abort processing query");
2426 kLHintsExpandX, 5, 5, 5, 5));
2427 frmcanvas->AddFrame(frmBut2, new TGLayoutHints(kLHintsLeft | kLHintsCenterY |
2429 // feedback histos embedded canvas
2430 fECanvas = new TRootEmbeddedCanvas("fECanvas", frmcanvas, 400, 150);
2435 4, 4, 4, 4));
2436 fFB->AddFrame(frmcanvas, new TGLayoutHints(kLHintsLeft | kLHintsTop |
2438
2439 // progress infos label
2440 fLabInfos = new TGLabel(fFB, " ");
2441 fFB->AddFrame(fLabInfos, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
2442 // progress status label
2443 fLabStatus = new TGLabel(fFB, " ");
2444 fFB->AddFrame(fLabStatus, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
2445
2446 //progress bar
2449 frmProg->SetBarColor("green");
2450 fFB->AddFrame(frmProg, new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5));
2451 // total progress infos
2452 fFB->AddFrame(fTotal = new TGLabel(fFB,
2453 " Estimated time left : 0 sec (--- events of --- processed) "),
2454 new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
2455 // progress rate infos
2456 fFB->AddFrame(fRate = new TGLabel(fFB,
2457 " Processing Rate : -- events/sec "),
2458 new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
2459
2460 // add "Results" tab element
2461 tf = fTab->AddTab("Results");
2462 fFC = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
2465 // query result (header) information text view
2466 fInfoTextView = new TGTextView(fFC, 330, 185, "", kSunkenFrame |
2469 kLHintsExpandY | kLHintsExpandX, 5, 5, 10, 10));
2470
2471 // add "Retrieve", "Finalize" and "Show Log" buttons
2472 TGCompositeFrame* frmBut3 = new TGHorizontalFrame(fFC, 350, 100);
2473 fBtnRetrieve = new TGTextButton(frmBut3, "Retrieve");
2474 fBtnRetrieve->SetToolTipText("Retrieve query results");
2476 kLHintsExpandX, 5, 5, 10, 10));
2477 fBtnFinalize = new TGTextButton(frmBut3, "Finalize");
2478 fBtnFinalize->SetToolTipText("Finalize query");
2480 kLHintsExpandX, 5, 5, 10, 10));
2481 fBtnShowLog = new TGTextButton(frmBut3, "Show Log");
2482 fBtnShowLog->SetToolTipText("Show query log (open log window)");
2484 kLHintsExpandX, 5, 5, 10, 10));
2486
2487 // add "Results" tab element
2488 tf = fTab->AddTab("Edit Query");
2489 fFD = new TEditQueryFrame(tf, 100, 100);
2490 fFD->Build(fViewer);
2491 tf->AddFrame(fFD, new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 10, 0));
2492 TString btntxt;
2493 if (fViewer->GetActDesc()->fLocal ||
2494 (fViewer->GetActDesc()->fProof &&
2495 fViewer->GetActDesc()->fProof->IsValid())) {
2496 btntxt = " Submit ";
2497 }
2498 else {
2499 btntxt = " Apply changes ";
2500 }
2501 tf->AddFrame(fBtnSave = new TGTextButton(tf, btntxt),
2502 new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 5, 25, 5));
2503
2504 // connect button actions to functions
2505 fBtnSave->Connect("Clicked()", "TEditQueryFrame", fFD,
2506 "OnBtnSave()");
2507 fBtnSubmit->Connect("Clicked()", "TSessionQueryFrame", this,
2508 "OnBtnSubmit()");
2509 fBtnFinalize->Connect("Clicked()", "TSessionQueryFrame", this,
2510 "OnBtnFinalize()");
2511 fBtnStop->Connect("Clicked()", "TSessionQueryFrame", this,
2512 "OnBtnStop()");
2513 fBtnAbort->Connect("Clicked()", "TSessionQueryFrame", this,
2514 "OnBtnAbort()");
2515 fBtnShowLog->Connect("Clicked()", "TSessionQueryFrame", this,
2516 "OnBtnShowLog()");
2517 fBtnRetrieve->Connect("Clicked()", "TSessionQueryFrame", this,
2518 "OnBtnRetrieve()");
2519// fBtnSave->SetState(kButtonDisabled);
2520 Resize(350, 310);
2521}
2522
2523////////////////////////////////////////////////////////////////////////////////
2524/// Notify changes in query editor settings.
2525
2527{
2528 fModified = mod;
2529 if (fModified) {
2531 }
2532 else {
2534 }
2535 if (fViewer->GetActDesc()->fLocal ||
2536 (fViewer->GetActDesc()->fProof &&
2539}
2540
2541////////////////////////////////////////////////////////////////////////////////
2542/// Feedback function connected to Feedback signal.
2543/// Used to update feedback histograms.
2544
2546{
2547 // if no actual session, just return
2548 if (!fViewer->GetActDesc()->fAttached)
2549 return;
2550 if (!fViewer->GetActDesc()->fProof)
2551 return;
2552 if ((fViewer->GetActDesc()->fActQuery) &&
2557 return;
2558 TProof *sender = dynamic_cast<TProof*>((TQObject*)gTQSender);
2559 // if Proof sender match actual session one, update feedback histos
2560 if (sender && (sender == fViewer->GetActDesc()->fProof))
2561 UpdateHistos(objs);
2562}
2563
2564////////////////////////////////////////////////////////////////////////////////
2565/// Update feedback histograms.
2566
2568{
2569 TVirtualPad *save = gPad;
2570 TObject *o;
2571 Int_t pos = 1;
2572 Int_t i = 0;
2573 while (kFeedbackHistos[i]) {
2574 // check if user has selected this histogram in the option menu
2575 if (fViewer->GetCascadeMenu()->IsEntryChecked(41+i)) {
2576 if ( (o = objs->FindObject(kFeedbackHistos[i]))) {
2577 fStatsCanvas->cd(pos);
2578 gPad->SetEditable(kTRUE);
2579 if (TH1 *h = dynamic_cast<TH1*>(o)) {
2580 h->SetStats(0);
2581 h->SetBarWidth(0.75);
2582 h->SetBarOffset(0.125);
2583 h->SetFillColor(9);
2584 h->Draw("bar");
2585 pos++;
2586 }
2587 else if (TH2 *h2 = dynamic_cast<TH2*>(o)) {
2588 h2->Draw();
2589 pos++;
2590 }
2591 gPad->Modified();
2592 }
2593 }
2594 i++;
2595 }
2596 // update canvas
2597 fStatsCanvas->cd();
2600 if (save != 0) {
2601 save->cd();
2602 } else {
2603 gPad = 0;
2604 }
2605}
2606
2607////////////////////////////////////////////////////////////////////////////////
2608/// Update progress bar and status labels.
2609
2611{
2612 Long_t tt;
2613 UInt_t hh=0, mm=0, ss=0;
2614 TString stm;
2615 // if no actual session, just return
2616 if (!fViewer->GetActDesc()->fProof)
2617 return;
2618 // if Proof sender does't match actual session one, return
2619 TProof *sender = dynamic_cast<TProof*>((TQObject*)gTQSender);
2620 if (!sender || (sender != fViewer->GetActDesc()->fProof))
2621 return;
2622
2623 if ((fViewer->GetActDesc()->fActQuery) &&
2628 fTotal->SetText(" Estimated time left : 0 sec (0 events of 0 processed) ");
2629 fRate->SetText(" Processing Rate : 0.0f events/sec ");
2630 frmProg->Reset();
2631 fFB->Layout();
2632 return;
2633 }
2634
2635 if (total < 0)
2636 total = fPrevTotal;
2637 else
2638 fPrevTotal = total;
2639
2640 // if no change since last call, just return
2641 if (fPrevProcessed == processed)
2642 return;
2643 TString buf;
2644
2645 // Update information at first call
2646 if (fEntries != total) {
2647 buf.Form("PROOF cluster : \"%s\" - %d worker nodes",
2650 fLabInfos->SetText(buf);
2651
2652 fEntries = total;
2653 buf.Form(" %d files, %lld events, starting event %lld",
2655 fLabStatus->SetText(buf);
2656 }
2657
2658 // compute progress bar position and update
2659 Float_t pos = (Float_t)((Double_t)(processed * 100)/(Double_t)total);
2660 frmProg->SetPosition(pos);
2661 // if 100%, stop animation and set icon to "connected"
2662 if (pos >= 100.0) {
2664 fViewer->ChangeRightLogo("monitor01.xpm");
2665 }
2666
2667 // get current time
2668 if ((fViewer->GetActDesc()->fActQuery->fStatus ==
2675 Float_t eta = 0;
2676 if (processed)
2677 eta = ((Float_t)((Long64_t)tdiff)*total/Float_t(processed) -
2678 Long64_t(tdiff))/1000.;
2679
2680 tt = (Long_t)eta;
2681 if (tt > 0) {
2682 hh = (UInt_t)(tt / 3600);
2683 mm = (UInt_t)((tt % 3600) / 60);
2684 ss = (UInt_t)((tt % 3600) % 60);
2685 }
2686 if (hh)
2687 stm.Form("%d h %d min %d sec", hh, mm, ss);
2688 else if (mm)
2689 stm.Form("%d min %d sec", mm, ss);
2690 else
2691 stm.Form("%d sec", ss);
2692 if (processed == total) {
2693 // finished
2694 tt = (Long_t) Long64_t(tdiff)/1000;
2695 if (tt > 0) {
2696 hh = (UInt_t)(tt / 3600);
2697 mm = (UInt_t)((tt % 3600) / 60);
2698 ss = (UInt_t)((tt % 3600) % 60);
2699 }
2700 if (hh)
2701 stm.Form("%d h %d min %d sec", hh, mm, ss);
2702 else if (mm)
2703 stm.Form("%d min %d sec", mm, ss);
2704 else
2705 stm.Form("%d sec", ss);
2706 buf.Form(" Processed : %lld events in %s", total, stm.Data());
2707 fTotal->SetText(buf.Data());
2708 } else {
2709 // update status infos
2710 buf.Form(" Estimated time left : %s (%lld events of %lld processed) ",
2711 stm.Data(), processed, total);
2712 fTotal->SetText(buf.Data());
2713 }
2714 if (processed > 0 && (Long64_t)tdiff > 0) {
2715 buf.Form(" Processing Rate : %.1f events/sec ",
2716 (Float_t)processed/(Long64_t)tdiff*1000.);
2717 fRate->SetText(buf);
2718 }
2719 fPrevProcessed = processed;
2720
2721 fFB->Layout();
2722}
2723
2724////////////////////////////////////////////////////////////////////////////////
2725/// New version of Progress (just forward to the old version
2726/// for the time being).
2727
2729 Long64_t /*bytesread*/, Float_t /*initTime*/,
2730 Float_t /*procTime*/, Float_t /*evtrti*/,
2731 Float_t /*mbrti*/, Int_t /*actw*/,
2732 Int_t /*tses*/, Float_t /*eses*/)
2733{
2734 Progress(total, processed);
2735}
2736
2737////////////////////////////////////////////////////////////////////////////////
2738/// Update progress bar and status labels.
2739
2741{
2742 Long_t tt;
2743 UInt_t hh=0, mm=0, ss=0;
2744 TString stm;
2745 TString cproc;
2746 Int_t status;
2747
2748 switch (fViewer->GetActDesc()->fActQuery->fStatus) {
2749
2751 cproc = " - ABORTED";
2752 status = kAborted;
2753 break;
2755 cproc = " - STOPPED";
2756 status = kStopped;
2757 break;
2759 cproc = " ";
2760 status = kRunning;
2761 break;
2764 cproc = " ";
2765 status = kDone;
2766 break;
2767 default:
2768 status = -1;
2769 break;
2770 }
2771 if (processed < 0) processed = 0;
2772
2773 frmProg->SetBarColor("green");
2774 if (status == kAborted)
2775 frmProg->SetBarColor("red");
2776 else if (status == kStopped)
2777 frmProg->SetBarColor("yellow");
2778 else if (status == -1 ) {
2779 fTotal->SetText(" Estimated time left : 0 sec (0 events of 0 processed) ");
2780 fRate->SetText(" Processing Rate : 0.0f events/sec ");
2781 frmProg->Reset();
2782 fFB->Layout();
2783 return;
2784 }
2785
2786 if (total < 0)
2787 total = fPrevTotal;
2788 else
2789 fPrevTotal = total;
2790
2791 // if no change since last call, just return
2792 TString buf;
2793
2794 // Update information at first call
2795 if (fEntries != total) {
2796 fLabInfos->SetText("Local Session");
2797
2798 fEntries = total;
2799 buf.Form(" %d files, %lld events, starting event %lld",
2801 fLabStatus->SetText(buf.Data());
2802 }
2803
2804 // compute progress bar position and update
2805 Float_t pos = 0.0;
2806 if (processed > 0 && total > 0)
2807 pos = (Float_t)((Double_t)(processed * 100)/(Double_t)total);
2808 frmProg->SetPosition(pos);
2809 // if 100%, stop animation and set icon to "connected"
2810 if (pos >= 100.0) {
2812 fViewer->ChangeRightLogo("monitor01.xpm");
2813 }
2814
2815 // get current time
2816 if (status == kRunning)
2820 Float_t eta = 0;
2821 if (processed)
2822 eta = ((Float_t)((Long64_t)tdiff)*total/(Float_t)(processed) -
2823 (Long64_t)(tdiff))/1000.;
2824
2825 tt = (Long_t)eta;
2826 if (tt > 0) {
2827 hh = (UInt_t)(tt / 3600);
2828 mm = (UInt_t)((tt % 3600) / 60);
2829 ss = (UInt_t)((tt % 3600) % 60);
2830 }
2831 if (hh)
2832 stm = TString::Format("%d h %d min %d sec", hh, mm, ss);
2833 else if (mm)
2834 stm = TString::Format("%d min %d sec", mm, ss);
2835 else
2836 stm = TString::Format("%d sec", ss);
2837 if ((processed != total) && (status == kRunning)) {
2838 // update status infos
2839 buf.Form(" Estimated time left : %s (%lld events of %lld processed) ",
2840 stm.Data(), processed, total);
2841 fTotal->SetText(buf);
2842 } else {
2843 tt = (Long_t) Long64_t(tdiff)/1000;
2844 if (tt > 0) {
2845 hh = (UInt_t)(tt / 3600);
2846 mm = (UInt_t)((tt % 3600) / 60);
2847 ss = (UInt_t)((tt % 3600) % 60);
2848 }
2849 if (hh)
2850 stm = TString::Format("%d h %d min %d sec", hh, mm, ss);
2851 else if (mm)
2852 stm = TString::Format("%d min %d sec", mm, ss);
2853 else
2854 stm = TString::Format("%d sec", ss);
2855 buf.Form(" Processed : %ld events in %s",
2856 (Long_t)processed, stm.Data());
2857 buf += cproc;
2858 fTotal->SetText(buf.Data());
2859 }
2860 if (processed > 0 && (Long64_t)tdiff > 0) {
2861 buf.Form(" Processing Rate : %.1f events/sec ",
2862 (Float_t)processed/(Long64_t)tdiff*1000.);
2863 fRate->SetText(buf.Data());
2864 }
2865 fPrevProcessed = processed;
2866
2867 fFB->Layout();
2868}
2869
2870////////////////////////////////////////////////////////////////////////////////
2871/// Indicate that Cancel or Stop was clicked.
2872
2874{
2875 if (aborted == kTRUE) {
2876 // Aborted
2877 frmProg->SetBarColor("red");
2878 }
2879 else {
2880 // Stopped
2881 frmProg->SetBarColor("yellow");
2882 }
2883 // disconnect progress related signals
2884 if (fViewer->GetActDesc()->fProof &&
2886 fViewer->GetActDesc()->fProof->Disconnect("Progress(Long64_t,Long64_t)",
2887 this, "Progress(Long64_t,Long64_t)");
2888 fViewer->GetActDesc()->fProof->Disconnect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
2889 this, "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
2890 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)",
2891 this, "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
2892 fViewer->GetActDesc()->fProof->Disconnect("StopProcess(Bool_t)", this,
2893 "IndicateStop(Bool_t)");
2894 }
2895}
2896
2897////////////////////////////////////////////////////////////////////////////////
2898/// Reset progress frame information fields.
2899
2900void TSessionQueryFrame::ResetProgressDialog(const char * /*selector*/, Int_t files,
2901 Long64_t first, Long64_t entries)
2902{
2903 TString buf;
2904 fFiles = files > 0 ? files : 0;
2905 fFirst = first;
2906 fEntries = entries;
2907 fPrevProcessed = 0;
2908 fPrevTotal = 0;
2909
2910 if (!fViewer->GetActDesc()->fLocal) {
2911 frmProg->SetBarColor("green");
2912 frmProg->Reset();
2913 }
2914
2915 buf.Form("%0d files, %0lld events, starting event %0lld",
2916 fFiles > 0 ? fFiles : 0, fEntries > 0 ? fEntries : 0,
2917 fFirst >= 0 ? fFirst : 0);
2918 fLabStatus->SetText(buf.Data());
2919 // Reconnect the slots
2920 if (fViewer->GetActDesc()->fProof &&
2922 fViewer->GetActDesc()->fProof->Connect("Progress(Long64_t,Long64_t)",
2923 "TSessionQueryFrame", this, "Progress(Long64_t,Long64_t)");
2924 fViewer->GetActDesc()->fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
2925 "TSessionQueryFrame", this,
2926 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
2927 fViewer->GetActDesc()->fProof->Connect("StopProcess(Bool_t)",
2928 "TSessionQueryFrame", this, "IndicateStop(Bool_t)");
2929 buf.Form("PROOF cluster : \"%s\" - %d worker nodes",
2932 fLabInfos->SetText(buf.Data());
2933 }
2934 else if (fViewer->GetActDesc()->fLocal) {
2936 fLabInfos->SetText("Local Session");
2937 fLabStatus->SetText(" ");
2938 }
2939 else {
2940 fLabInfos->SetText(" ");
2941 fLabStatus->SetText(" ");
2942 }
2943 fFB->Layout();
2944}
2945
2946////////////////////////////////////////////////////////////////////////////////
2947/// Finalize query.
2948
2950{
2951 // check if Proof is valid
2952 if (fViewer->GetActDesc()->fProof &&
2954 gPad->SetEditable(kFALSE);
2956 if (!item) return;
2957 TObject *obj = (TObject *)item->GetUserData();
2958 if ((obj) && (obj->IsA() == TQueryDescription::Class())) {
2959 // as it can take time, set watch cursor
2960 gVirtualX->SetCursor(GetId(),gVirtualX->CreateCursor(kWatch));
2961 TQueryDescription *query = (TQueryDescription *)obj;
2963 UpdateButtons(query);
2964 // restore cursor
2965 gVirtualX->SetCursor(GetId(), 0);
2966 }
2967 }
2968 if (fViewer->GetActDesc()->fLocal) {
2969 gPad->SetEditable(kFALSE);
2971 if (chain)
2972 ((TTreePlayer *)(chain->GetPlayer()))->GetSelectorFromFile()->Terminate();
2973 }
2974}
2975
2976////////////////////////////////////////////////////////////////////////////////
2977/// Stop processing query.
2978
2980{
2981 // check for proof validity
2982 if (fViewer->GetActDesc()->fProof &&
2985 }
2986 if (fViewer->GetActDesc()->fLocal) {
2987 gROOT->SetInterrupt();
2990 }
2991 // stop icon animation and set connected icon
2992 fViewer->ChangeRightLogo("monitor01.xpm");
2994}
2995
2996////////////////////////////////////////////////////////////////////////////////
2997/// Show query log.
2998
3000{
3002 if (!item) return;
3003 TObject *obj = (TObject *)item->GetUserData();
3004 if ((!obj) || (obj->IsA() != TQueryDescription::Class()))
3005 return;
3006 TQueryDescription *query = (TQueryDescription *)obj;
3007 fViewer->ShowLog(query->fReference.Data());
3008}
3009
3010////////////////////////////////////////////////////////////////////////////////
3011/// Retrieve query.
3012
3014{
3015 // check for proof validity
3016 if (fViewer->GetActDesc()->fAttached &&
3020 if (!item) return;
3021 TObject *obj = (TObject *)item->GetUserData();
3022 if (obj && obj->IsA() == TQueryDescription::Class()) {
3023 // as it can take time, set watch cursor
3024 gVirtualX->SetCursor(GetId(), gVirtualX->CreateCursor(kWatch));
3025 TQueryDescription *query = (TQueryDescription *)obj;
3027 if (rc == 0)
3029 // restore cursor
3030 gVirtualX->SetCursor(GetId(), 0);
3031 }
3032 }
3033 if (fViewer->GetActDesc()->fLocal) {
3034 TGListTreeItem *item=0, *item2=0;
3036 fViewer->GetActDesc());
3037 if (item) {
3038 item2 = fViewer->GetSessionHierarchy()->FindItemByObj(item,
3040 }
3041 if (item2) {
3042 // add input and output list entries
3044 if (chain) {
3045 TSelector *selector = ((TTreePlayer *)(chain->GetPlayer()))->GetSelectorFromFile();
3046 if (selector) {
3047 TList *objlist = selector->GetOutputList();
3048 if (objlist)
3049 if (!fViewer->GetSessionHierarchy()->FindChildByName(item2, "OutputList"))
3050 fViewer->GetSessionHierarchy()->AddItem(item2, "OutputList");
3051 }
3052 }
3053 }
3054 // update list tree, query frame information, and buttons state
3057 UpdateInfos();
3059 }
3060}
3061
3062////////////////////////////////////////////////////////////////////////////////
3063/// Abort processing query.
3064
3066{
3067 // check for proof validity
3068 if (fViewer->GetActDesc()->fProof &&
3071 }
3072 if (fViewer->GetActDesc()->fLocal) {
3073 gROOT->SetInterrupt();
3076 }
3077 // stop icon animation and set connected icon
3078 fViewer->ChangeRightLogo("monitor01.xpm");
3080}
3081
3082////////////////////////////////////////////////////////////////////////////////
3083/// Submit query.
3084
3086{
3087 Int_t retval;
3088 Long64_t id = 0;
3090 if (!item) return;
3091 // retrieve query description attached to list tree item
3092 TObject *obj = (TObject *)item->GetUserData();
3093 if (!obj || obj->IsA() != TQueryDescription::Class())
3094 return;
3095 TQueryDescription *newquery = (TQueryDescription *)obj;
3096 // reset progress information
3098 newquery->fNbFiles, newquery->fFirstEntry, newquery->fNoEntries);
3099 // set query start time
3100 newquery->fStartTime = gSystem->Now();
3102 // check for proof validity
3103 if (fViewer->GetActDesc()->fProof &&
3106 // set query description status to submitted
3108 // if feedback option selected
3110 Int_t i = 0;
3111 // browse list of feedback histos and check user's selected ones
3112 while (kFeedbackHistos[i]) {
3113 if (fViewer->GetCascadeMenu()->IsEntryChecked(41+i)) {
3116 }
3117 i++;
3118 }
3119 // connect feedback signal
3120 fViewer->GetActDesc()->fProof->Connect("Feedback(TList *objs)",
3121 "TSessionQueryFrame", fViewer->GetQueryFrame(),
3122 "Feedback(TList *objs)");
3123 gROOT->Time();
3124 }
3125 else {
3126 // if feedback option not selected, clear Proof's feedback option
3128 }
3129 // set current proof session
3130 fViewer->GetActDesc()->fProof->cd();
3131 // check if parameter file has been specified
3132 if (newquery->fChain) {
3133 if (fViewer->GetActDesc()->fProof->IsLite()) {
3134 newquery->fOptions = "";
3135 }
3136 // set query reference id
3137 newquery->fReference= TString::Format("session-%s:q%d",
3140 if (newquery->fChain->IsA() == TChain::Class()) {
3141 // TChain case
3143 ((TChain *)newquery->fChain)->SetProof(fViewer->GetActDesc()->fProof);
3144 id = ((TChain *)newquery->fChain)->Process(newquery->fSelectorString,
3145 newquery->fOptions,
3146 newquery->fNoEntries > 0 ? newquery->fNoEntries : 1234567890,
3147 newquery->fFirstEntry);
3148 }
3149 else if (newquery->fChain->IsA() == TDSet::Class()) {
3150 // TDSet case
3152 id = ((TDSet *)newquery->fChain)->Process(newquery->fSelectorString,
3153 newquery->fOptions,
3154 newquery->fNoEntries,
3155 newquery->fFirstEntry);
3156 }
3157 }
3158 else {
3159 Error("Submit", "No TChain defined; skipping");
3161 return;
3162 }
3163 // set query reference id to unique identifier
3164 newquery->fReference= TString::Format("session-%s:q%lld",
3166 // start icon animation
3168 }
3169 else if (fViewer->GetActDesc()->fLocal) { // local session case
3170 // if feedback option selected
3172 Int_t i = 0;
3173 // browse list of feedback histos and check user's selected ones
3174 while (kFeedbackHistos[i]) {
3175 if (fViewer->GetCascadeMenu()->IsEntryChecked(41+i)) {
3177 }
3178 i++;
3179 }
3180 }
3181 if (newquery->fChain) {
3182 if (newquery->fChain->IsA() == TChain::Class()) {
3183 // TChain case
3186 UpdateButtons(newquery);
3187 gPad->SetEditable(kFALSE);
3188 ((TChain *)newquery->fChain)->SetTimerInterval(100);
3189 id = ((TChain *)newquery->fChain)->Process(newquery->fSelectorString,
3190 newquery->fOptions,
3191 newquery->fNoEntries > 0 ? newquery->fNoEntries : 1234567890,
3192 newquery->fFirstEntry);
3193 ((TChain *)newquery->fChain)->SetTimerInterval(0);
3194 OnBtnRetrieve();
3195 TChain *chain = (TChain *)newquery->fChain;
3196 ProgressLocal(chain->GetEntries(),
3197 chain->GetReadEntry()+1);
3201 UpdateButtons(newquery);
3202 }
3203 else {
3204 new TGMsgBox(fClient->GetRoot(), this, "Error Submitting Query",
3205 "Only TChains are allowed in Local Session (no TDSet) !",
3206 kMBIconExclamation,kMBOk,&retval);
3207 }
3208 }
3209 else {
3210 Error("Submit", "No TChain defined; skipping");
3212 return;
3213 }
3214 // set query reference id to unique identifier
3215 newquery->fReference = TString::Format("local-session-%s:q%lld", newquery->fQueryName.Data(), id);
3216 }
3217 // update buttons state
3218 UpdateButtons(newquery);
3219}
3220
3221////////////////////////////////////////////////////////////////////////////////
3222/// Update buttons state for the current query status.
3223
3225{
3227 if (!item) return;
3228 // retrieve query description attached to list tree item
3229 TObject *obj = (TObject *)item->GetUserData();
3230 if (!obj || obj->IsA() != TQueryDescription::Class())
3231 return;
3232 TQueryDescription *query = (TQueryDescription *)obj;
3233 if (desc != query) return;
3234
3235 Bool_t submit_en = kFALSE;
3236 if ((fViewer->GetActDesc()->fProof &&
3237 fViewer->GetActDesc()->fProof->IsValid()) ||
3239 submit_en = kTRUE;
3240
3241 switch (desc->fStatus) {
3243 fBtnSubmit->SetEnabled(submit_en);
3249 break;
3250
3252 fBtnSubmit->SetEnabled(submit_en);
3254 if (((desc->fResult == 0) || (desc->fResult &&
3255 (desc->fResult->IsFinalized() ||
3256 (desc->fResult->GetInputObject("TDSet") == 0)))) &&
3257 !(fViewer->GetActDesc()->fLocal))
3263 break;
3264
3266 fBtnSubmit->SetEnabled(submit_en);
3272 break;
3273
3281 break;
3282
3290 break;
3291
3293 fBtnSubmit->SetEnabled(submit_en);
3299 break;
3300
3302 fBtnSubmit->SetEnabled(submit_en);
3308 break;
3309
3311 fBtnSubmit->SetEnabled(submit_en);
3317 break;
3318
3319 default:
3320 break;
3321 }
3322 if (fViewer->GetActDesc()->fLocal &&
3326 }
3327}
3328
3329////////////////////////////////////////////////////////////////////////////////
3330/// Update query information (header) text view.
3331
3333{
3334 TString buffer;
3335 const char *qst[] = {"aborted ", "submitted", "running ",
3336 "stopped ", "completed"};
3337
3340
3341 if (fViewer->GetActDesc()->fLocal ||
3345 fViewer->GetActDesc()->fProof->IsValid())) {
3346 fBtnSave->SetText(" Submit ");
3347 }
3348 else {
3349 fBtnSave->SetText(" Apply changes ");
3350 }
3353 if (!fViewer->GetActDesc()->fActQuery ||
3355 ResetProgressDialog("", 0, 0, 0);
3356 if (fViewer->GetActDesc()->fLocal) {
3357 if (fViewer->GetActDesc()->fActQuery) {
3359 if (chain) {
3360 ProgressLocal(chain->GetEntries(),
3361 chain->GetReadEntry()+1);
3362 }
3363 else {
3364 ProgressLocal(0, 0);
3365 }
3367 }
3368 }
3369 else {
3370 fTotal->SetText(" Estimated time left : 0 sec (0 events of 0 processed) ");
3371 fRate->SetText(" Processing Rate : 0.0f events/sec ");
3372 frmProg->Reset();
3373 fFB->Layout();
3374 }
3375 return;
3376 }
3378
3379 // Status label
3380 Int_t st = (result->GetStatus() > 0 && result->GetStatus() <=
3381 TQueryResult::kCompleted) ? result->GetStatus() : 0;
3382
3383 Int_t qry = result->GetSeqNum();
3384
3385 buffer = TString::Format("------------------------------------------------------\n");
3386 // Print header
3387 if (!result->IsDraw()) {
3388 const char *fin = result->IsFinalized() ? "finalized" : qst[st];
3389 const char *arc = result->IsArchived() ? "(A)" : "";
3390 buffer = TString::Format(" Query No : %d\n", qry);
3391 buffer += TString::Format(" Ref : \"%s:%s\"\n", result->GetTitle(),
3392 result->GetName());
3393 buffer += TString::Format(" Selector : %s\n",
3394 result->GetSelecImp()->GetTitle());
3395 buffer += TString::Format("Status : %9s%s\n", fin, arc);
3396 buffer += TString::Format("------------------------------------------------------\n");
3397 } else {
3398 buffer += TString::Format(" Query No : %d\n", qry);
3399 buffer += TString::Format(" Ref : \"%s:%s\"\n", result->GetTitle(),
3400 result->GetName());
3401 buffer += TString::Format(" Selector : %s\n",
3402 result->GetSelecImp()->GetTitle());
3403 buffer += TString::Format("------------------------------------------------------\n");
3404 }
3405
3406 // Time information
3407 Int_t elapsed = (Int_t)(result->GetEndTime().Convert() -
3408 result->GetStartTime().Convert());
3409 buffer += TString::Format(" Started : %s\n",
3410 result->GetStartTime().AsString());
3411 buffer += TString::Format(" Real time : %d sec (CPU time: %.1f sec)\n",
3412 elapsed, result->GetUsedCPU());
3413
3414 // Number of events processed, rate, size
3415 Double_t rate = 0.0;
3416 if (result->GetEntries() > -1 && elapsed > 0)
3417 rate = result->GetEntries() / (Double_t)elapsed ;
3418 Float_t size = ((Float_t)result->GetBytes())/(1024*1024);
3419 buffer += TString::Format(" Processed : %lld events (size: %.3f MBs)\n",
3420 result->GetEntries(), size);
3421 buffer += TString::Format(" Rate : %.1f evts/sec\n", rate);
3422
3423 // Package information
3424 if (strlen(result->GetParList()) > 1) {
3425 buffer += TString::Format(" Packages : %s\n", result->GetParList());
3426 }
3427
3428 // Result information
3429 TString res = result->GetResultFile();
3430 if (!result->IsArchived()) {
3431 Int_t dq = res.Index("queries");
3432 if (dq > -1) {
3433 res.Remove(0,res.Index("queries"));
3434 res.Insert(0,"<PROOF_SandBox>/");
3435 }
3436 if (res.BeginsWith("-")) {
3437 res = (result->GetStatus() == TQueryResult::kAborted) ?
3438 "not available" : "sent to client";
3439 }
3440 }
3441 if (res.Length() > 1) {
3442 buffer += TString::Format("------------------------------------------------------\n");
3443 buffer += TString::Format(" Results : %s\n", res.Data());
3444 }
3445
3446 if (result->GetOutputList() && result->GetOutputList()->GetSize() > 0) {
3447 buffer += TString::Format(" Outlist : %d objects\n",
3448 result->GetOutputList()->GetSize());
3449 buffer += TString::Format("------------------------------------------------------\n");
3450 }
3451 fInfoTextView->LoadBuffer(buffer.Data());
3452
3453 //Float_t pos = Float_t((Double_t)(result->GetEntries() * 100)/(Double_t)total);
3454 if (result->GetStatus() == TQueryResult::kAborted)
3455 frmProg->SetBarColor("red");
3456 else if (result->GetStatus() == TQueryResult::kStopped)
3457 frmProg->SetBarColor("yellow");
3458 else
3459 frmProg->SetBarColor("green");
3460
3461 frmProg->SetPosition(100.0);
3462
3463 buffer = TString::Format(" Processed : %lld events in %.1f sec", result->GetEntries(),
3464 (Float_t)elapsed);
3465 fTotal->SetText(buffer.Data());
3466 buffer = TString::Format(" Processing Rate : %.1f events/sec ", rate);
3467 fRate->SetText(buffer.Data());
3468 fFB->Layout();
3469}
3470
3471//////////////////////////////////////////////////////////////////////////////////////////
3472// Output frame
3473
3474////////////////////////////////////////////////////////////////////////////////
3475/// Constructor.
3476
3478 TGCompositeFrame(p, w, h), fEntryTmp(0), fLVContainer(0), fViewer(0)
3479{
3480}
3481
3482////////////////////////////////////////////////////////////////////////////////
3483/// Destructor.
3484
3486{
3487 delete fLVContainer; // this container is inside the TGListView and is not
3488 // deleted automatically
3489 Cleanup();
3490}
3491
3492////////////////////////////////////////////////////////////////////////////////
3493/// Build query output information frame.
3494
3496{
3497 fViewer = gui;
3500
3501 // Container of object TGListView
3502 TGListView *frmListView = new TGListView(this, 340, 190);
3504 fLVContainer->Associate(frmListView);
3507 4, 4, 4, 4));
3508
3509 frmListView->Connect("Clicked(TGLVEntry*, Int_t, Int_t, Int_t)",
3510 "TSessionOutputFrame", this,
3511 "OnElementClicked(TGLVEntry* ,Int_t, Int_t, Int_t)");
3512 frmListView->Connect("DoubleClicked(TGLVEntry*, Int_t, Int_t, Int_t)",
3513 "TSessionOutputFrame", this,
3514 "OnElementDblClicked(TGLVEntry* ,Int_t, Int_t, Int_t)");
3515}
3516
3517////////////////////////////////////////////////////////////////////////////////
3518/// Handle mouse clicks on list view items.
3519
3521 Int_t y)
3522{
3523 TObject *obj = (TObject *)entry->GetUserData();
3524 if ((obj) && (btn ==3)) {
3525 // if right button, popup context menu
3526 fViewer->GetContextMenu()->Popup(x, y, obj, (TBrowser *)0);
3527 }
3528}
3529
3530////////////////////////////////////////////////////////////////////////////////
3531/// Handle double-clicks on list view items.
3532
3534{
3535 char action[512];
3536 TString act;
3537 TObject *obj = (TObject *)entry->GetUserData();
3538 if (!obj) return;
3539 TString ext = obj->GetName();
3540 gPad->SetEditable(kFALSE);
3541 // check default action from root.mimes
3542 if (fClient->GetMimeTypeList()->GetAction(obj->IsA()->GetName(), action)) {
3543 act = TString::Format("((%s*)0x%lx)%s", obj->IsA()->GetName(), (Long_t)obj, action);
3544 if (act[0] == '!') {
3545 act.Remove(0, 1);
3546 gSystem->Exec(act.Data());
3547 } else {
3548 // do not allow browse
3549 if (!act.Contains("Browse"))
3550 gROOT->ProcessLine(act.Data());
3551 }
3552 }
3553}
3554
3555////////////////////////////////////////////////////////////////////////////////
3556/// Add object to output list view.
3557
3559{
3560 TGLVEntry *item;
3561 if (obj) {
3562 item = new TGLVEntry(fLVContainer, obj->GetName(), obj->IsA()->GetName());
3563 item->SetUserData(obj);
3564 fLVContainer->AddItem(item);
3565 }
3566}
3567
3568//////////////////////////////////////////////////////////////////////////////////////////
3569// Input Frame
3570
3571////////////////////////////////////////////////////////////////////////////////
3572/// Constructor.
3573
3575 TGCompositeFrame(p, w, h), fViewer(0), fLVContainer(0)
3576{
3577}
3578
3579////////////////////////////////////////////////////////////////////////////////
3580/// Destructor.
3581
3583{
3584 delete fLVContainer; // this container is inside the TGListView and is not
3585 // deleted automatically
3586 Cleanup();
3587}
3588
3589////////////////////////////////////////////////////////////////////////////////
3590/// Build query input information frame.
3591
3593{
3594 fViewer = gui;
3597
3598 // Container of object TGListView
3599 TGListView *frmListView = new TGListView(this, 340, 190);
3601 fLVContainer->Associate(frmListView);
3604 4, 4, 4, 4));
3605}
3606
3607////////////////////////////////////////////////////////////////////////////////
3608/// Add object to input list view.
3609
3611{
3612 TGLVEntry *item;
3613 if (obj) {
3614 item = new TGLVEntry(fLVContainer, obj->GetName(), obj->IsA()->GetName());
3615 item->SetUserData(obj);
3616 fLVContainer->AddItem(item);
3617 }
3618}
3619
3620//////////////////////////////////////////////////////////////////////////////////////////
3621// Session Viewer Main Frame
3622
3623////////////////////////////////////////////////////////////////////////////////
3624/// Main Session viewer constructor.
3625
3627 TGMainFrame(gClient->GetRoot(), w, h), fSessionHierarchy(0), fSessionItem(0)
3628{
3629 // only one session viewer allowed
3630 if (gSessionViewer)
3631 // coverity[uninit_member]: already done
3632 return;
3633 Build();
3635 Resize(w, h);
3636 gSessionViewer = this;
3637}
3638
3639////////////////////////////////////////////////////////////////////////////////
3640/// Main Session viewer constructor.
3641
3643 UInt_t h) : TGMainFrame(gClient->GetRoot(), w, h),
3644 fSessionHierarchy(0), fSessionItem(0)
3645{
3646 // only one session viewer allowed
3647 if (gSessionViewer)
3648 // coverity[uninit_member]: already done
3649 return;
3650 Build();
3652 Move(x, y);
3653 Resize(w, h);
3654 gSessionViewer = this;
3655}
3656
3657////////////////////////////////////////////////////////////////////////////////
3658/// Read configuration file and populate list of sessions
3659/// list of queries and list of packages.
3660/// Read and set also global options as feedback histos.
3661
3662void TSessionViewer::ReadConfiguration(const char *filename)
3663{
3664 if (fViewerEnv)
3665 delete fViewerEnv;
3666 fViewerEnv = new TEnv();
3667
3668 const char *fn = (filename && strlen(filename)) ? filename : fConfigFile.Data();
3669
3671
3672 Bool_t bval = (Bool_t)fViewerEnv->GetValue("Option.Feedback", 1);
3673 if (bval)
3675 else
3677
3678 bval = (Bool_t)fViewerEnv->GetValue("Option.MasterHistos", 1);
3679 if (bval) {
3681 gEnv->SetValue("Proof.StatsHist", 1);
3682 }
3683 else {
3685 gEnv->SetValue("Proof.StatsHist", 0);
3686 }
3687 bval = (Bool_t)fViewerEnv->GetValue("Option.MasterEvents", 0);
3688 if (bval)
3690 else
3692 bval = (Bool_t)fViewerEnv->GetValue("Option.WorkerEvents", 0);
3693 if (bval)
3695 else
3697
3698 Int_t i = 0;
3699 while (kFeedbackHistos[i]) {
3700 bval = (Bool_t)fViewerEnv->GetValue(Form("Option.%s",kFeedbackHistos[i]),
3701 i == 1 ? 1 : 0);
3702 if (bval)
3703 fCascadeMenu->CheckEntry(41+i);
3704 else
3706 i++;
3707 }
3708 TSessionDescription *proofDesc;
3709 fSessions->Delete();
3710 if (fSessionItem)
3712 else
3714 fBaseIcon);
3715 // add local session description
3717 fLocal, fLocal);
3718 fSessionHierarchy->SetToolTipItem(item, "Local Session");
3719 TSessionDescription *localdesc = new TSessionDescription();
3720 localdesc->fTag = "";
3721 localdesc->fName = "Local";
3722 localdesc->fAddress = "Local";
3723 localdesc->fPort = 0;
3724 localdesc->fConfigFile = "";
3725 localdesc->fLogLevel = 0;
3726 localdesc->fUserName = "";
3727 localdesc->fQueries = new TList();
3728 localdesc->fPackages = new TList();
3729 localdesc->fActQuery = 0;
3730 localdesc->fProof = 0;
3731 localdesc->fProofMgr = 0;
3732 localdesc->fAttached = kFALSE;
3733 localdesc->fConnected = kFALSE;
3734 localdesc->fLocal = kTRUE;
3735 localdesc->fSync = kTRUE;
3736 localdesc->fAutoEnable = kFALSE;
3737 localdesc->fNbHistos = 0;
3738 item->SetUserData(localdesc);
3739 fSessions->Add((TObject *)localdesc);
3740 fActDesc = localdesc;
3741
3742 SysInfo_t info;
3743 gSystem->GetSysInfo(&info);
3744 // if the machine has more than one CPU, add one PROOF lite session
3745 // (not supported on Windows yet)
3746 if (!info.fOS.Contains("Microsoft") && info.fCpus > 1) {
3747 // add proof lite session description
3748 item = fSessionHierarchy->AddItem(fSessionItem, "Lite",
3750 fSessionHierarchy->SetToolTipItem(item, "PROOF Lite");
3751 TSessionDescription *litedesc = new TSessionDescription();
3752 litedesc->fTag = "";
3753 litedesc->fName = "PROOF Lite";
3754 litedesc->fAddress = "lite://";
3755 litedesc->fPort = 0;
3756 litedesc->fConfigFile = "";
3757 litedesc->fLogLevel = 0;
3758 litedesc->fUserName = "";
3759 litedesc->fQueries = new TList();
3760 litedesc->fPackages = new TList();
3761 litedesc->fActQuery = 0;
3762 litedesc->fProof = 0;
3763 litedesc->fProofMgr = 0;
3764 litedesc->fAttached = kFALSE;
3765 litedesc->fConnected = kFALSE;
3766 litedesc->fLocal = kFALSE;
3767 litedesc->fSync = kTRUE;
3768 litedesc->fAutoEnable = kFALSE;
3769 litedesc->fNbHistos = 0;
3770 item->SetUserData(litedesc);
3771 fSessions->Add((TObject *)litedesc);
3772 fActDesc = litedesc;
3773 }
3774 TIter next(fViewerEnv->GetTable());
3775 TEnvRec *er;
3776 while ((er = (TEnvRec*) next())) {
3777 const char *s;
3778 if ((s = strstr(er->GetName(), "SessionDescription."))) {
3779 const char *val = fViewerEnv->GetValue(s, (const char*)0);
3780 if (val) {
3781 Int_t cnt = 0;
3782 char *v = StrDup(val);
3783 s += 7;
3784 while (1) {
3785 TString name = strtok(!cnt ? v : 0, ";");
3786 if (name.IsNull()) break;
3787 TString sessiontag = strtok(0, ";");
3788 TString address = strtok(0, ";");
3789 if (address.IsNull()) break;
3790 TString port = strtok(0, ";");
3791 if (port.IsNull()) break;
3792 TString loglevel = strtok(0, ";");
3793 if (loglevel.IsNull()) break;
3794 TString configfile = strtok(0, ";");
3795 TString user = strtok(0, ";");
3796 if (user.IsNull()) break;
3797 TString sync = strtok(0, ";");
3798 TString autoen = strtok(0, ";");
3799
3800 // build session description
3801 proofDesc = new TSessionDescription();
3802 proofDesc->fTag = sessiontag.Length() > 2 ? sessiontag.Data() : "";
3803 proofDesc->fName = name;
3804 proofDesc->fAddress = address;
3805 proofDesc->fPort = atoi(port);
3806 proofDesc->fConfigFile = configfile.Length() > 2 ? configfile.Data() : "";
3807 proofDesc->fLogLevel = atoi(loglevel);
3808 proofDesc->fConnected = kFALSE;
3809 proofDesc->fAttached = kFALSE;
3810 proofDesc->fLocal = kFALSE;
3811 proofDesc->fQueries = new TList();
3812 proofDesc->fPackages = new TList();
3813 proofDesc->fActQuery = 0;
3814 proofDesc->fProof = 0;
3815 proofDesc->fProofMgr = 0;
3816 proofDesc->fSync = (Bool_t)(atoi(sync));
3817 proofDesc->fAutoEnable = (Bool_t)(atoi(autoen));
3818 proofDesc->fUserName = user;
3819 fSessions->Add((TObject *)proofDesc);
3820 item = fSessionHierarchy->AddItem(
3821 fSessionItem, proofDesc->fName.Data(),
3823 fSessionHierarchy->SetToolTipItem(item, "Proof Session");
3824 item->SetUserData(proofDesc);
3825 fActDesc = proofDesc;
3826 cnt++;
3827 }
3828 delete [] v;
3829 }
3830 }
3831 if ((s = strstr(er->GetName(), "QueryDescription."))) {
3832 const char *val = fViewerEnv->GetValue(s, (const char*)0);
3833 if (val) {
3834 Int_t cnt = 0;
3835 char *v = StrDup(val);
3836 s += 7;
3837 while (1) {
3838
3839 TString status = strtok(!cnt ? v : 0, ";");
3840 if (status.IsNull()) break;
3841
3842 TString reference = strtok(0, ";");
3843 if (reference.IsNull()) break;
3844 TString queryname = strtok(0, ";");
3845 if (queryname.IsNull()) break;
3846 TString selector = strtok(0, ";");
3847 if (selector.IsNull()) break;
3848 TString dset = strtok(0, ";");
3849 TString options = strtok(0, ";");
3850 TString eventlist = strtok(0, ";");
3851 TString nbfiles = strtok(0, ";");
3852 TString nbentries = strtok(0, ";");
3853 TString firstentry = strtok(0, ";");
3854
3855 TQueryDescription *newquery = new TQueryDescription();
3856 newquery->fStatus =
3858 newquery->fSelectorString = selector.Length() > 2 ? selector.Data() : "";
3859 newquery->fReference = reference.Length() > 2 ? reference.Data() : "";
3860 newquery->fTDSetString = dset.Length() > 2 ? dset.Data() : "";
3861 newquery->fQueryName = queryname.Length() > 2 ? queryname.Data() : "";
3862 newquery->fOptions = options.Length() > 2 ? options.Data() : "";
3863 newquery->fEventList = eventlist.Length() > 2 ? eventlist.Data() : "";
3864 newquery->fNbFiles = atoi(nbfiles);
3865 newquery->fNoEntries = atoi(nbentries);
3866 newquery->fFirstEntry = atoi(firstentry);
3867 newquery->fResult = 0;
3868 newquery->fChain = 0;
3869 fActDesc->fQueries->Add((TObject *)newquery);
3870 cnt++;
3874 item1, newquery->fQueryName, fQueryCon, fQueryCon);
3875 item2->SetUserData(newquery);
3876 }
3877 delete [] v;
3878 }
3879 }
3880 }
3883 if (fActDesc == localdesc) {
3886 }
3887 else {
3891 }
3894}
3895
3896////////////////////////////////////////////////////////////////////////////////
3897/// Update list of existing Proof sessions.
3898
3900{
3901 // get list of proof sessions
3902 Bool_t found = kFALSE;
3903 Bool_t exists = kFALSE;
3904 TGListTreeItem *item = 0;
3905 TSeqCollection *proofs = gROOT->GetListOfProofs();
3906 TSessionDescription *desc = 0;
3907 TSessionDescription *newdesc;
3908 if (proofs) {
3909 TObject *o = proofs->First();
3910 if (o && dynamic_cast<TProofMgr *>(o)) {
3911 TProofMgr *mgr = dynamic_cast<TProofMgr *>(o);
3912 if (mgr && mgr->QuerySessions("L")) {
3913 TIter nxd(mgr->QuerySessions("L"));
3914 TProofDesc *d = 0;
3915 TProof *p = 0;
3916 while ((d = (TProofDesc *)nxd())) {
3917 TIter nextfs(fSessions);
3918 // check if session exists in the list
3919 exists = kFALSE;
3920 while ((desc = (TSessionDescription *)nextfs())) {
3921 if ((desc->fTag == d->GetName()) ||
3922 (desc->fName == d->GetTitle())) {
3923 exists = kTRUE;
3924 break;
3925 }
3926 }
3927 TIter nexts(fSessions);
3928 found = kFALSE;
3929 p = d->GetProof();
3930 while ((desc = (TSessionDescription *)nexts())) {
3931 if (desc->fConnected && desc->fAttached)
3932 continue;
3933 if (p && ((exists && ((desc->fTag == d->GetName()) ||
3934 (desc->fName == d->GetTitle()))) ||
3935 (!exists && (desc->fAddress == p->GetMaster())))) {
3936 desc->fConnected = kTRUE;
3937 desc->fAttached = kTRUE;
3938 desc->fProof = p;
3939 desc->fProofMgr = mgr;
3940 desc->fTag = d->GetName();
3942 desc);
3943 if (item) {
3945 if (item == fSessionHierarchy->GetSelected()) {
3946 fActDesc->fProof->Connect("Progress(Long64_t,Long64_t)",
3947 "TSessionQueryFrame", fQueryFrame,
3948 "Progress(Long64_t,Long64_t)");
3949 fActDesc->fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
3950 "TSessionQueryFrame", fQueryFrame,
3951 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
3952 fActDesc->fProof->Connect("StopProcess(Bool_t)",
3953 "TSessionQueryFrame", fQueryFrame,
3954 "IndicateStop(Bool_t)");
3956 "ResetProgressDialog(const char*, Int_t,Long64_t,Long64_t)",
3957 "TSessionQueryFrame", fQueryFrame,
3958 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)");
3959 // enable timer used for status bar icon's animation
3960 EnableTimer();
3961 // change status bar right icon to connected pixmap
3962 ChangeRightLogo("monitor01.xpm");
3963 // do not animate yet
3965 // connect to signal "query result ready"
3966 fActDesc->fProof->Connect("QueryResultReady(char *)",
3967 "TSessionViewer", this, "QueryResultReady(char *)");
3968 // display connection information on status bar
3969 TString msg;
3970 msg.Form("PROOF Cluster %s ready", fActDesc->fName.Data());
3971 fStatusBar->SetText(msg.Data(), 1);
3984 // update session information frame
3987 if (fActFrame != fSessionFrame) {
3991 }
3992 }
3993 }
3994 if (desc->fLogLevel < 0)
3995 desc->fLogLevel = 0;
3996 found = kTRUE;
3997 break;
3998 }
3999 }
4000 if (found) continue;
4001 newdesc = new TSessionDescription();
4002 // and fill information from Proof session
4003 newdesc->fTag = d->GetName();
4004 newdesc->fName = d->GetTitle();
4005 newdesc->fAddress = d->GetTitle();
4006 newdesc->fConnected = kFALSE;
4007 newdesc->fAttached = kFALSE;
4008 newdesc->fProofMgr = mgr;
4009 p = d->GetProof();
4010 if (p) {
4011 newdesc->fConnected = kTRUE;
4012 newdesc->fAttached = kTRUE;
4013 if (p->IsLite())
4014 newdesc->fAddress = "lite://";
4015 else
4016 newdesc->fAddress = p->GetMaster();
4017 newdesc->fConfigFile = p->GetConfFile();
4018 newdesc->fUserName = p->GetUser();
4019 newdesc->fPort = p->GetPort();
4020 newdesc->fLogLevel = p->GetLogLevel();
4021 newdesc->fProof = p;
4022 newdesc->fProof->Connect("Progress(Long64_t,Long64_t)",
4023 "TSessionQueryFrame", fQueryFrame,
4024 "Progress(Long64_t,Long64_t)");
4025 newdesc->fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
4026 "TSessionQueryFrame", fQueryFrame,
4027 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
4028 newdesc->fProof->Connect("StopProcess(Bool_t)",
4029 "TSessionQueryFrame", fQueryFrame,
4030 "IndicateStop(Bool_t)");
4031 newdesc->fProof->Connect(
4032 "ResetProgressDialog(const char*, Int_t,Long64_t,Long64_t)",
4033 "TSessionQueryFrame", fQueryFrame,
4034 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)");
4035 // enable timer used for status bar icon's animation
4036 EnableTimer();
4037 // change status bar right icon to connected pixmap
4038 ChangeRightLogo("monitor01.xpm");
4039 // do not animate yet
4041 // connect to signal "query result ready"
4042 newdesc->fProof->Connect("QueryResultReady(char *)",
4043 "TSessionViewer", this, "QueryResultReady(char *)");
4044 }
4045 newdesc->fQueries = new TList();
4046 newdesc->fPackages = new TList();
4047 if (newdesc->fLogLevel < 0)
4048 newdesc->fLogLevel = 0;
4049 newdesc->fActQuery = 0;
4050 newdesc->fLocal = kFALSE;
4051 newdesc->fSync = kFALSE;
4052 newdesc->fAutoEnable = kFALSE;
4053 newdesc->fNbHistos = 0;
4054 // add new session description in list tree
4055 if (p)
4056 item = fSessionHierarchy->AddItem(fSessionItem, newdesc->fName.Data(),
4058 else
4059 item = fSessionHierarchy->AddItem(fSessionItem, newdesc->fName.Data(),
4061 fSessionHierarchy->SetToolTipItem(item, "Proof Session");
4062 item ->SetUserData(newdesc);
4063 // and in our session description list
4064 fSessions->Add(newdesc);
4065 }
4066 }
4067 return;
4068 }
4069 TIter nextp(proofs);
4070 TProof *proof;
4071 // loop over existing Proof sessions
4072 while ((proof = (TProof *)nextp())) {
4073 TIter nexts(fSessions);
4074 found = kFALSE;
4075 // check if session is already in the list
4076 while ((desc = (TSessionDescription *)nexts())) {
4077 if (desc->fProof == proof) {
4078 desc->fConnected = kTRUE;
4079 desc->fAttached = kTRUE;
4080 found = kTRUE;
4081 break;
4082 }
4083 }
4084 if (found) continue;
4085 // create new session description
4086 newdesc = new TSessionDescription();
4087 // and fill information from Proof session
4088 newdesc->fName = proof->GetMaster();
4089 newdesc->fConfigFile = proof->GetConfFile();
4090 newdesc->fUserName = proof->GetUser();
4091 newdesc->fPort = proof->GetPort();
4092 newdesc->fLogLevel = proof->GetLogLevel();
4093 if (newdesc->fLogLevel < 0)
4094 newdesc->fLogLevel = 0;
4095 if (proof->IsLite())
4096 newdesc->fAddress = "lite://";
4097 else
4098 newdesc->fAddress = proof->GetMaster();
4099 newdesc->fQueries = new TList();
4100 newdesc->fPackages = new TList();
4101 newdesc->fProof = proof;
4102 newdesc->fActQuery = 0;
4103 newdesc->fConnected = kTRUE;
4104 newdesc->fAttached = kTRUE;
4105 newdesc->fLocal = kFALSE;
4106 newdesc->fSync = kFALSE;
4107 newdesc->fAutoEnable = kFALSE;
4108 newdesc->fNbHistos = 0;
4109 // add new session description in list tree
4110 item = fSessionHierarchy->AddItem(fSessionItem, newdesc->fName.Data(),
4112 fSessionHierarchy->SetToolTipItem(item, "Proof Session");
4113 item ->SetUserData(newdesc);
4114 // and in our session description list
4115 fSessions->Add(newdesc);
4116 }
4117 }
4118}
4119
4120////////////////////////////////////////////////////////////////////////////////
4121/// Update list of existing Proof sessions.
4122
4124{
4125 // get list of proof sessions
4126 TGListTreeItem *item;
4127 TList *sessions = fActDesc->fProofMgr->QuerySessions("");
4128 if (sessions) {
4129 TIter nextp(sessions);
4130 TProofDesc *pdesc;
4131 TProof *proof;
4132 TSessionDescription *newdesc;
4133 // loop over existing Proof sessions
4134 while ((pdesc = (TProofDesc *)nextp())) {
4135 TIter nexts(fSessions);
4136 TSessionDescription *desc = 0;
4137 Bool_t found = kFALSE;
4138 // check if session is already in the list
4139 while ((desc = (TSessionDescription *)nexts())) {
4140 if ((desc->fTag == pdesc->GetName()) ||
4141 (desc->fName == pdesc->GetTitle())) {
4142 desc->fConnected = kTRUE;
4143 found = kTRUE;
4144 break;
4145 }
4146 }
4147 if (found) continue;
4148 // create new session description
4149 newdesc = new TSessionDescription();
4150 // and fill information from Proof session
4151 newdesc->fTag = pdesc->GetName();
4152 newdesc->fName = pdesc->GetTitle();
4153 proof = pdesc->GetProof();
4154 if (proof) {
4155 newdesc->fConfigFile = proof->GetConfFile();
4156 newdesc->fUserName = proof->GetUser();
4157 newdesc->fPort = proof->GetPort();
4158 newdesc->fLogLevel = proof->GetLogLevel();
4159 if (newdesc->fLogLevel < 0)
4160 newdesc->fLogLevel = 0;
4161 if (proof->IsLite())
4162 newdesc->fAddress = "lite://";
4163 else
4164 newdesc->fAddress = proof->GetMaster();
4165 newdesc->fProof = proof;
4166 }
4167 else {
4168 newdesc->fProof = 0;
4169 newdesc->fConfigFile = "";
4170 newdesc->fUserName = fActDesc->fUserName;
4171 newdesc->fPort = fActDesc->fPort;
4172 newdesc->fLogLevel = 0;
4173 newdesc->fAddress = fActDesc->fAddress;
4174 }
4175 newdesc->fQueries = new TList();
4176 newdesc->fPackages = new TList();
4177 newdesc->fProofMgr = fActDesc->fProofMgr;
4178 newdesc->fActQuery = 0;
4179 newdesc->fConnected = kTRUE;
4180 newdesc->fAttached = kFALSE;
4181 newdesc->fLocal = kFALSE;
4182 newdesc->fSync = kFALSE;
4183 newdesc->fAutoEnable = kFALSE;
4184 newdesc->fNbHistos = 0;
4185 // add new session description in list tree
4186 item = fSessionHierarchy->AddItem(fSessionItem, newdesc->fName.Data(),
4188 fSessionHierarchy->SetToolTipItem(item, "Proof Session");
4189 item ->SetUserData(newdesc);
4190 // and in our session description list
4191 fSessions->Add(newdesc);
4192 // set actual description to the last one
4193 }
4194 }
4195}
4196
4197////////////////////////////////////////////////////////////////////////////////
4198/// Save actual configuration in config file "filename".
4199
4200void TSessionViewer::WriteConfiguration(const char *filename)
4201{
4202 TSessionDescription *session;
4203 TQueryDescription *query;
4204 Int_t scnt = 0, qcnt = 1;
4205 const char *fname = filename ? filename : fConfigFile.Data();
4206
4207 delete fViewerEnv;
4208 gSystem->Unlink(fname);
4209 fViewerEnv = new TEnv();
4210
4211 fViewerEnv->SetValue("Option.Feedback",
4213 fViewerEnv->SetValue("Option.MasterHistos",
4215 fViewerEnv->SetValue("Option.MasterEvents",
4217 fViewerEnv->SetValue("Option.WorkerEvents",
4219
4220 Int_t i = 0;
4221 // browse list of feedback histos and check user's selected ones
4222 while (kFeedbackHistos[i]) {
4223 fViewerEnv->SetValue(Form("Option.%s",kFeedbackHistos[i]),
4225 i++;
4226 }
4227
4229 while ((session = (TSessionDescription *) snext())) {
4230 if ((scnt > 0) && ((session->fAddress.Length() < 3) ||
4231 session->fUserName.Length() < 2)) {
4232 // skip gROOT's list of sessions
4233 continue;
4234 }
4235 if ((scnt > 0) && (session->fName == session->fAddress)) {
4236 // skip gROOT's list of proofs
4237 continue;
4238 }
4239 TString sessionstring;
4240 sessionstring += session->fName;
4241 sessionstring += ";";
4242 sessionstring += session->fTag.Length() > 1 ? session->fTag.Data() : " ";
4243 sessionstring += ";";
4244 sessionstring += session->fAddress;
4245 sessionstring += ";";
4246 sessionstring += TString::Format("%d", session->fPort);
4247 sessionstring += ";";
4248 sessionstring += TString::Format("%d", session->fLogLevel);
4249 sessionstring += ";";
4250 sessionstring += session->fConfigFile.Length() > 1 ? session->fConfigFile.Data() : " ";
4251 sessionstring += ";";
4252 sessionstring += session->fUserName;
4253 sessionstring += ";";
4254 sessionstring += TString::Format("%d", session->fSync);
4255 sessionstring += ";";
4256 sessionstring += TString::Format("%d", session->fAutoEnable);
4257 if (scnt > 0) // skip local session
4258 fViewerEnv->SetValue(Form("SessionDescription.%d",scnt), sessionstring);
4259 scnt++;
4260
4261 TIter qnext(session->fQueries);
4262 while ((query = (TQueryDescription *) qnext())) {
4263 TString querystring;
4264 querystring += TString::Format("%d", query->fStatus);
4265 querystring += ";";
4266 querystring += query->fReference.Length() > 1 ? query->fReference.Data() : " ";
4267 querystring += ";";
4268 querystring += query->fQueryName;
4269 querystring += ";";
4270 querystring += query->fSelectorString.Length() > 1 ? query->fSelectorString.Data() : " ";
4271 querystring += ";";
4272 querystring += query->fTDSetString.Length() > 1 ? query->fTDSetString.Data() : " ";
4273 querystring += ";";
4274 querystring += query->fOptions.Length() > 1 ? query->fOptions.Data() : " ";
4275 querystring += ";";
4276 querystring += query->fEventList.Length() > 1 ? query->fEventList.Data() : " ";
4277 querystring += ";";
4278 querystring += TString::Format("%d",query->fNbFiles);
4279 querystring += ";";
4280 querystring += TString::Format("%lld",query->fNoEntries);
4281 querystring += ";";
4282 querystring += TString::Format("%lld",query->fFirstEntry);
4283 fViewerEnv->SetValue(Form("QueryDescription.%d",qcnt), querystring);
4284 qcnt++;
4285 }
4286 }
4287
4288 fViewerEnv->WriteFile(fname);
4289}
4290
4291////////////////////////////////////////////////////////////////////////////////
4292/// Build main session viewer frame and subframes.
4293
4295{
4296 TString buf;
4297 fActDesc = 0;
4298 fActFrame = 0;
4299 fLogWindow = 0;
4300 fBusy = kFALSE;
4301 fAutoSave = kTRUE;
4303 fStart = fElapsed = 0;
4304
4306 // set minimun size
4307 SetWMSizeHints(400 + 200, 370+50, 2000, 1000, 1, 1);
4308
4309 // collect icons
4310 fLocal = fClient->GetPicture("local_session.xpm");
4311 fProofCon = fClient->GetPicture("proof_connected.xpm");
4312 fProofDiscon = fClient->GetPicture("proof_disconnected.xpm");
4313 fQueryCon = fClient->GetPicture("query_connected.xpm");
4314 fQueryDiscon = fClient->GetPicture("query_disconnected.xpm");
4315 fBaseIcon = fClient->GetPicture("proof_base.xpm");
4316
4317 //--- File menu
4319 fFileMenu->AddEntry("&Load Config...", kFileLoadConfig);
4320 fFileMenu->AddEntry("&Save Config...", kFileSaveConfig);
4322 fFileMenu->AddEntry("&Close Viewer", kFileCloseViewer);
4324 fFileMenu->AddEntry("&Quit ROOT", kFileQuit);
4325
4326 //--- Session menu
4327 fSessionMenu = new TGPopupMenu(gClient->GetDefaultRoot());
4328 fSessionMenu->AddLabel("Session Management");
4330 fSessionMenu->AddEntry("&New Session", kSessionNew);
4331 fSessionMenu->AddEntry("&Add to the list", kSessionAdd);
4334 fSessionMenu->AddEntry("&Connect...", kSessionConnect);
4335 fSessionMenu->AddEntry("&Disconnect", kSessionDisconnect);
4336 fSessionMenu->AddEntry("Shutdo&wn", kSessionShutdown);
4337 fSessionMenu->AddEntry("&Show status",kSessionShowStatus);
4338 fSessionMenu->AddEntry("&Get Queries",kSessionGetQueries);
4343
4344 //--- Query menu
4345 fQueryMenu = new TGPopupMenu(gClient->GetDefaultRoot());
4346 fQueryMenu->AddLabel("Query Management");
4348 fQueryMenu->AddEntry("&New...", kQueryNew);
4349 fQueryMenu->AddEntry("&Edit", kQueryEdit);
4350 fQueryMenu->AddEntry("&Submit", kQuerySubmit);
4352 fQueryMenu->AddEntry("Start &Viewer", kQueryStartViewer);
4354 fQueryMenu->AddEntry("&Delete", kQueryDelete);
4355
4356 fViewerEnv = 0;
4357#ifdef WIN32
4359#else
4361#endif
4362
4364 Int_t i = 0;
4365 while (kFeedbackHistos[i]) {
4367 i++;
4368 }
4369 fCascadeMenu->AddEntry("User defined...", 50);
4370 // disable it for now (until implemented)
4372
4373 //--- Options menu
4375 fOptionsMenu->AddLabel("Global Options");
4377 fOptionsMenu->AddEntry("&Autosave Config", kOptionsAutoSave);
4379 fOptionsMenu->AddEntry("Master &Histos", kOptionsStatsHist);
4380 fOptionsMenu->AddEntry("&Master Events", kOptionsStatsTrace);
4381 fOptionsMenu->AddEntry("&Worker Events", kOptionsSlaveStatsTrace);
4383 fOptionsMenu->AddEntry("Feedback &Active", kOptionsFeedback);
4385 fOptionsMenu->AddPopup("&Feedback Histos", fCascadeMenu);
4387
4388 //--- Help menu
4389 fHelpMenu = new TGPopupMenu(gClient->GetDefaultRoot());
4390 fHelpMenu->AddEntry("&About ROOT...", kHelpAbout);
4391
4392 fFileMenu->Associate(this);
4393 fSessionMenu->Associate(this);
4394 fQueryMenu->Associate(this);
4395 fOptionsMenu->Associate(this);
4396 fCascadeMenu->Associate(this);
4397 fHelpMenu->Associate(this);
4398
4399 //--- create menubar and add popup menus
4400 fMenuBar = new TGMenuBar(this, 1, 1, kHorizontalFrame);
4401
4403 kLHintsLeft, 0, 4, 0, 0));
4405 kLHintsLeft, 0, 4, 0, 0));
4407 kLHintsLeft, 0, 4, 0, 0));
4409 kLHintsLeft, 0, 4, 0, 0));
4411 kLHintsRight));
4412
4413 TGHorizontal3DLine *toolBarSep = new TGHorizontal3DLine(this);
4414 AddFrame(toolBarSep, new TGLayoutHints(kLHintsTop | kLHintsExpandX));
4415
4417 kLHintsExpandX, 0, 0, 1, 1));
4418
4419 toolBarSep = new TGHorizontal3DLine(this);
4420 AddFrame(toolBarSep, new TGLayoutHints(kLHintsTop | kLHintsExpandX));
4421
4422 //---- toolbar
4423
4424 int spacing = 8;
4425 fToolBar = new TGToolBar(this, 60, 20, kHorizontalFrame);
4426 for (int ii = 0; xpm_toolbar[ii]; ii++) {
4427 tb_data[ii].fPixmap = xpm_toolbar[ii];
4428 if (strlen(xpm_toolbar[ii]) == 0) {
4429 spacing = 8;
4430 continue;
4431 }
4432 fToolBar->AddButton(this, &tb_data[ii], spacing);
4433 spacing = 0;
4434 }
4436 toolBarSep = new TGHorizontal3DLine(this);
4437 AddFrame(toolBarSep, new TGLayoutHints(kLHintsTop | kLHintsExpandX));
4440
4443 fPopupSrv->AddEntry("Disconnect",kSessionDisconnect);
4444 fPopupSrv->AddEntry("Shutdown",kSessionShutdown);
4446 fPopupSrv->AddEntry("Show status",kSessionShowStatus);
4447 fPopupSrv->AddEntry("Delete", kSessionDelete);
4448 fPopupSrv->AddEntry("Get Queries",kSessionGetQueries);
4450 fPopupSrv->AddEntry("Cleanup", kSessionCleanup);
4452 fPopupSrv->Connect("Activated(Int_t)","TSessionViewer", this,
4453 "MyHandleMenu(Int_t)");
4454
4456 fPopupQry->AddEntry("Edit",kQueryEdit);
4457 fPopupQry->AddEntry("Submit",kQuerySubmit);
4459 fPopupQry->AddEntry("Start &Viewer", kQueryStartViewer);
4461 fPopupQry->AddEntry("Delete",kQueryDelete);
4462 fPopupQry->Connect("Activated(Int_t)","TSessionViewer", this,
4463 "MyHandleMenu(Int_t)");
4464
4465
4480
4481 //--- Horizontal mother frame -----------------------------------------------
4482 fHf = new TGHorizontalFrame(this, 10, 10);
4484
4485 //--- fV1 -------------------------------------------------------------------
4486 fV1 = new TGVerticalFrame(fHf, 100, 100, kFixedWidth);
4488
4489 fTreeView = new TGCanvas(fV1, 100, 200, kSunkenFrame | kDoubleBorder);
4491 2, 0, 0, 0));
4494 fSessionHierarchy->Connect("Clicked(TGListTreeItem*,Int_t,Int_t,Int_t)",
4495 "TSessionViewer", this,
4496 "OnListTreeClicked(TGListTreeItem*, Int_t, Int_t, Int_t)");
4497 fSessionHierarchy->Connect("DoubleClicked(TGListTreeItem*,Int_t)",
4498 "TSessionViewer", this,
4499 "OnListTreeDoubleClicked(TGListTreeItem*, Int_t)");
4501
4502 //--- fV2 -------------------------------------------------------------------
4503 fV2 = new TGVerticalFrame(fHf, 350, 310);
4505
4506 //--- Server Frame ----------------------------------------------------------
4507 fServerFrame = new TSessionServerFrame(fV2, 350, 310);
4508 fSessions = new TList;
4510 fServerFrame->Build(this);
4512 kLHintsExpandY, 2, 0, 1, 2));
4513
4514 //--- Session Frame ---------------------------------------------------------
4515 fSessionFrame = new TSessionFrame(fV2, 350, 310);
4516 fSessionFrame->Build(this);
4518 kLHintsExpandY, 2, 0, 1, 2));
4519
4520 //--- Query Frame -----------------------------------------------------------
4521 fQueryFrame = new TSessionQueryFrame(fV2, 350, 310);
4522 fQueryFrame->Build(this);
4524 kLHintsExpandY, 2, 0, 1, 2));
4525
4526 //--- Output Frame ----------------------------------------------------------
4527 fOutputFrame = new TSessionOutputFrame(fV2, 350, 310);
4528 fOutputFrame->Build(this);
4530 kLHintsExpandY, 2, 0, 1, 2));
4531
4532 //--- Input Frame -----------------------------------------------------------
4533 fInputFrame = new TSessionInputFrame(fV2, 350, 310);
4534 fInputFrame->Build(this);
4536 kLHintsExpandY, 2, 0, 1, 2));
4537
4539
4540 // add vertical splitter between list tree and frames
4542 splitter->SetFrame(fV1, kTRUE);
4546
4549
4552
4553 // if description available, update server infos frame
4554 if (fActDesc) {
4555 if (!fActDesc->fLocal) {
4557 }
4558 else {
4561 }
4562 }
4563
4564 //--- Status Bar ------------------------------------------------------------
4565 int parts[] = { 36, 49, 15 };
4566 fStatusBar = new TGStatusBar(this, 10, 10);
4568 fStatusBar->SetParts(parts, 3);
4569 for (int p = 0; p < 3; ++p)
4572 kLHintsExpandX, 0, 0, 1, 1));
4573
4574 // connection icon (animation) and time info
4575 fStatusBar->SetText(" 00:00:00", 2);
4576 TGCompositeFrame *leftpart = fStatusBar->GetBarPart(2);
4577 fRightIconPicture = (TGPicture *)fClient->GetPicture("proof_disconnected.xpm");
4578 fRightIcon = new TGIcon(leftpart, fRightIconPicture,
4580 leftpart->AddFrame(fRightIcon, new TGLayoutHints(kLHintsLeft, 2, 0, 0, 0));
4581
4582 // connection progress bar
4583 TGCompositeFrame *rightpart = fStatusBar->GetBarPart(0);
4586 fConnectProg->SetBarColor("green");
4587 rightpart->AddFrame(fConnectProg, new TGLayoutHints(kLHintsExpandX, 1, 1, 1, 1));
4588
4589 // add user info
4591 buf.Form("User : %s - %s", fUserGroup->fRealName.Data(),
4593 fStatusBar->SetText(buf.Data(), 1);
4594
4595 fTimer = 0;
4596
4597 // create context menu
4598 fContextMenu = new TContextMenu("SessionViewerContextMenu") ;
4599
4600 SetWindowName("ROOT Session Viewer");
4601 MapSubwindows();
4602 MapWindow();
4603
4604 // hide frames
4614 Resize(610, 420);
4615}
4616
4617////////////////////////////////////////////////////////////////////////////////
4618/// Destructor.
4619
4621{
4622 delete fUserGroup;
4623 if (gSessionViewer == this)
4624 gSessionViewer = 0;
4625}
4626
4627////////////////////////////////////////////////////////////////////////////////
4628/// Handle mouse clicks in list tree.
4629
4631 Int_t x, Int_t y)
4632{
4633 TList *objlist;
4634 TObject *obj;
4635 TString msg;
4636
4640 if (entry->GetParent() == 0) { // PROOF
4641 // switch frames only if actual one doesn't match
4642 if (fActFrame != fServerFrame) {
4646 }
4655 }
4656 else if (entry->GetParent()->GetParent() == 0) { // Server
4657 if (entry->GetUserData()) {
4658 obj = (TObject *)entry->GetUserData();
4659 if (!obj || obj->IsA() != TSessionDescription::Class())
4660 return;
4661 // update server frame information
4664 // if Proof valid, update connection infos
4667 fActDesc->fProof->cd();
4668 msg.Form("PROOF Cluster %s ready", fActDesc->fName.Data());
4669 }
4670 else {
4671 msg.Form("PROOF Cluster %s not connected", fActDesc->fName.Data());
4672 }
4673 fStatusBar->SetText(msg.Data(), 1);
4674 }
4675 if ((fActDesc->fConnected) && (fActDesc->fAttached)) {
4682 }
4683 else {
4688 }
4689 // local session
4690 if (fActDesc->fLocal) {
4691 if (fActFrame != fSessionFrame) {
4697 }
4701 }
4702 // proof session not connected
4703 if ((!fActDesc->fLocal) && (!fActDesc->fAttached) &&
4704 (fActFrame != fServerFrame)) {
4708 }
4709 // proof session connected
4710 if ((!fActDesc->fLocal) && (fActDesc->fConnected) &&
4711 (fActDesc->fAttached)) {
4712 if (fActFrame != fSessionFrame) {
4716 }
4718 }
4721 if (fActDesc->fAutoEnable)
4723 else
4725 // update session information frame
4730 }
4731 else if (entry->GetParent()->GetParent()->GetParent() == 0) { // query
4732 obj = (TObject *)entry->GetParent()->GetUserData();
4733 if (obj && obj->IsA() == TSessionDescription::Class()) {
4735 }
4736 obj = (TObject *)entry->GetUserData();
4737 if (obj && obj->IsA() == TQueryDescription::Class()) {
4739 }
4740 // update query information and buttons state
4743 if (fActFrame != fQueryFrame) {
4747 }
4748 if ((fActDesc->fConnected) && (fActDesc->fAttached) &&
4753 // trick to update feedback histos
4754 OnCascadeMenu();
4755 }
4756 else { // a list (input, output)
4757 obj = (TObject *)entry->GetParent()->GetParent()->GetUserData();
4758 if (obj && obj->IsA() == TSessionDescription::Class()) {
4760 }
4761 obj = (TObject *)entry->GetParent()->GetUserData();
4762 if (obj && obj->IsA() == TQueryDescription::Class()) {
4764 }
4765 if (fActDesc->fActQuery) {
4766 // update input/output list views
4769 if (fActDesc->fActQuery->fResult) {
4770 objlist = fActDesc->fActQuery->fResult->GetOutputList();
4771 if (objlist) {
4772 TIter nexto(objlist);
4773 while ((obj = (TObject *) nexto())) {
4774 fOutputFrame->AddObject(obj);
4775 }
4776 }
4777 objlist = fActDesc->fActQuery->fResult->GetInputList();
4778 if (objlist) {
4779 TIter nexti(objlist);
4780 while ((obj = (TObject *) nexti())) {
4781 fInputFrame->AddObject(obj);
4782 }
4783 }
4784 }
4785 else {
4786 TChain *chain = (TChain *)fActDesc->fActQuery->fChain;
4787 if (chain) {
4788 objlist = ((TTreePlayer *)(chain->GetPlayer()))->GetSelectorFromFile()->GetOutputList();
4789 if (objlist) {
4790 TIter nexto(objlist);
4791 while ((obj = (TObject *) nexto())) {
4792 fOutputFrame->AddObject(obj);
4793 }
4794 }
4795 }
4796 }
4801 }
4802 // switch frames
4803 if (strstr(entry->GetText(),"Output")) {
4804 if (fActFrame != fOutputFrame) {
4808 }
4809 }
4810 else if (strstr(entry->GetText(),"Input")) {
4811 if (fActFrame != fInputFrame) {
4815 }
4816 }
4817 }
4818 if (btn == 3) { // right button
4819 // place popup menus
4821 if (!item) return;
4822 obj = (TObject *)item->GetUserData();
4823 if (obj && obj->IsA() == TQueryDescription::Class()) {
4824 fPopupQry->PlaceMenu(x, y, 1, 1);
4825 }
4826 else if (obj && obj->IsA() == TSessionDescription::Class()) {
4827 if (!fActDesc->fLocal)
4828 fPopupSrv->PlaceMenu(x, y, 1, 1);
4829 }
4830 }
4831 // enable / disable menu entries
4849 }
4850 else {
4855 if (entry->GetParent() != 0)
4870 }
4871 if (fActDesc->fLocal) {
4884 }
4885}
4886
4887////////////////////////////////////////////////////////////////////////////////
4888/// Handle mouse double clicks in list tree (connect to server).
4889
4891{
4892 if (entry == fSessionItem)
4893 return;
4894 if (entry->GetParent()->GetParent() == 0) { // Server
4895 if (entry->GetUserData()) {
4896 TObject *obj = (TObject *)entry->GetUserData();
4897 if ((!obj) || (obj->IsA() != TSessionDescription::Class()))
4898 return;
4900 // if Proof valid, update connection infos
4901 }
4902 if ((!fActDesc->fLocal) && ((!fActDesc->fConnected) ||
4903 (!fActDesc->fAttached))) {
4905 }
4906 }
4907}
4908
4909////////////////////////////////////////////////////////////////////////////////
4910/// Terminate Session : save configuration, clean temporary files and close
4911/// Proof connections.
4912
4914{
4915 // clean-up temporary files
4916 TString pathtmp;
4918 if (!gSystem->AccessPathName(pathtmp)) {
4919 gSystem->Unlink(pathtmp);
4920 }
4922 if (!gSystem->AccessPathName(pathtmp)) {
4923 gSystem->Unlink(pathtmp);
4924 }
4925 // close opened Proof sessions (if any)
4926 TIter next(fSessions);
4927 TSessionDescription *desc = 0;
4928 while ((desc = (TSessionDescription *)next())) {
4929 if (desc->fAttached && desc->fProof &&
4930 desc->fProof->IsValid())
4931 desc->fProof->Detach();
4932 }
4933 // Save configuration
4934 if (fAutoSave)
4936}
4937
4938////////////////////////////////////////////////////////////////////////////////
4939/// Close main Session Viewer window.
4940
4942{
4943 // clean-up temporary files
4944 TString pathtmp;
4946 if (!gSystem->AccessPathName(pathtmp)) {
4947 gSystem->Unlink(pathtmp);
4948 }
4950 if (!gSystem->AccessPathName(pathtmp)) {
4951 gSystem->Unlink(pathtmp);
4952 }
4953 // Save configuration
4954 if (fAutoSave)
4956 Cleanup();
4957 fSessions->Delete();
4958 if (fSessionItem)
4960 delete fSessionHierarchy; // this has been put int TGCanvas which isn't a
4961 // TGComposite frame and doesn't do cleanups.
4968 delete fTimer;
4969 DeleteWindow();
4970}
4971
4972////////////////////////////////////////////////////////////////////////////////
4973/// Change the right logo (used for animation).
4974
4976{
4980}
4981
4982////////////////////////////////////////////////////////////////////////////////
4983/// Enable animation timer.
4984
4986{
4987 if (!fTimer) fTimer = new TTimer(this, 500);
4988 fTimer->Reset();
4989 fTimer->TurnOn();
4990 time( &fStart );
4991}
4992
4993////////////////////////////////////////////////////////////////////////////////
4994/// Disable animation timer.
4995
4997{
4998 if (fTimer)
4999 fTimer->TurnOff();
5000 ChangeRightLogo("proof_disconnected.xpm");
5001}
5002
5003////////////////////////////////////////////////////////////////////////////////
5004/// Handle animation timer.
5005
5007{
5008 TString buf;
5009 struct tm *connected;
5010 Int_t count = gRandom->Integer(4);
5011 if (count > 3) {
5012 count = 0;
5013 }
5014 if (fChangePic)
5015 ChangeRightLogo(xpm_names[count]);
5016 time( &fElapsed );
5017 time_t elapsed_time = (time_t)difftime( fElapsed, fStart );
5018 connected = gmtime( &elapsed_time );
5019 if (connected) {
5020 buf.Form(" %02d:%02d:%02d", connected->tm_hour,
5021 connected->tm_min, connected->tm_sec);
5022 fStatusBar->SetText(buf.Data(), 2);
5023 }
5024 else {
5025 fStatusBar->SetText(" 00:00:00", 2);
5026 }
5027
5028 if (fActDesc->fLocal) {
5029 if ((fActDesc->fActQuery) &&
5032 TChain *chain = (TChain *)fActDesc->fActQuery->fChain;
5033 if (chain)
5035 chain->GetReadEntry()+1);
5036 }
5037 }
5038
5039 fTimer->Reset();
5040 return kTRUE;
5041}
5042
5043////////////////////////////////////////////////////////////////////////////////
5044/// Load/append a log msg in the log frame.
5045
5046void TSessionViewer::LogMessage(const char *msg, Bool_t all)
5047{
5048 if (fLogWindow) {
5049 if (all) {
5050 // load buffer
5051 fLogWindow->LoadBuffer(msg);
5052 } else {
5053 // append
5054 fLogWindow->AddBuffer(msg);
5055 }
5056 }
5057}
5058
5059////////////////////////////////////////////////////////////////////////////////
5060/// Handle signal "query result ready" coming from Proof session.
5061
5063{
5064 TString strtmp;
5065 strtmp.Form("Query Result Ready for %s", query);
5066 // show information on status bar
5067 ShowInfo(strtmp.Data());
5068 TGListTreeItem *item=0, *item2=0;
5069 TQueryDescription *lquery = 0;
5070 // loop over actual queries to find which one is ready
5071
5072 TIter nexts(fSessions);
5073 TSessionDescription *desc = 0;
5074 // check if session is already in the list
5075 while ((desc = (TSessionDescription *)nexts())) {
5076 if (desc && !desc->fAttached)
5077 continue;
5078 TIter nextp(desc->fQueries);
5079 while ((lquery = (TQueryDescription *)nextp())) {
5080 if (lquery->fReference.Contains(query)) {
5081 // results are ready for this query
5082 lquery->fResult = desc->fProof->GetQueryResult(query);
5084 if (!lquery->fResult)
5085 break;
5086 // get query status
5087 lquery->fStatus = lquery->fResult->IsFinalized() ?
5090 // get data set
5091 TObject *o = lquery->fResult->GetInputObject("TDSet");
5092 if (o)
5093 lquery->fChain = (TDSet *) o;
5095 if (item) {
5096 item2 = fSessionHierarchy->FindItemByObj(item, lquery);
5097 }
5098 if (item2) {
5099 // add input and output list entries
5100 if (lquery->fResult->GetInputList())
5101 if (!fSessionHierarchy->FindChildByName(item2, "InputList"))
5102 fSessionHierarchy->AddItem(item2, "InputList");
5103 if (lquery->fResult->GetOutputList())
5104 if (!fSessionHierarchy->FindChildByName(item2, "OutputList"))
5105 fSessionHierarchy->AddItem(item2, "OutputList");
5106 }
5107 // update list tree, query frame information, and buttons state
5111 fQueryFrame->UpdateButtons(lquery);
5112 break;
5113 }
5114 }
5115 }
5116}
5117
5118////////////////////////////////////////////////////////////////////////////////
5119/// Clean-up Proof session.
5120
5122{
5124 if (!item) return;
5125 TObject *obj = (TObject *)item->GetUserData();
5126 if (!obj || obj->IsA() != TSessionDescription::Class()) return;
5127 if (!fActDesc->fProof || !fActDesc->fProof->IsValid()) return;
5128 TString m;
5129 m.Form("Are you sure to cleanup the session \"%s::%s\"",
5131 Int_t result;
5132 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), 0,
5133 kMBYes | kMBNo | kMBCancel, &result);
5134 if (result == kMBYes) {
5135 // send cleanup request for the session specified by the tag reference
5136 TString sessiontag;
5137 sessiontag.Form("session-%s",fActDesc->fTag.Data());
5138 fActDesc->fProof->CleanupSession(sessiontag.Data());
5139 // clear the list of queries
5143 if (fAutoSave)
5145 }
5146 // update list tree
5149}
5150
5151////////////////////////////////////////////////////////////////////////////////
5152/// Reset Proof session.
5153
5155{
5157 if (!item) return;
5158 TObject *obj = (TObject *)item->GetUserData();
5159 if (!obj || obj->IsA() != TSessionDescription::Class()) return;
5160 if (!fActDesc->fProof || !fActDesc->fProof->IsValid()) return;
5161 TString m;
5162 m.Form("Do you really want to reset the session \"%s::%s\"",
5164 Int_t result;
5165 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), 0,
5166 kMBYes | kMBNo | kMBCancel, &result);
5167 if (result == kMBYes) {
5168 // reset the session
5170 if (mgr && mgr->IsValid()) {
5171 mgr->Reset(fActDesc->fUserName);
5172 }
5173 // reset connected flag
5175 fActDesc->fProof = 0;
5176 // disable animation timer
5177 DisableTimer();
5178 // change list tree item picture to disconnected pixmap
5181 if (item2) item2->SetPictures(fProofDiscon, fProofDiscon);
5182
5186 fStatusBar->SetText("", 1);
5187 }
5188 // update list tree
5191}
5192
5193////////////////////////////////////////////////////////////////////////////////
5194/// Delete query from list tree and ask user if they want to delete it also
5195/// from server.
5196
5198{
5200 if (!item) return;
5201 TObject *obj = (TObject *)item->GetUserData();
5202 if (!obj || obj->IsA() != TQueryDescription::Class()) return;
5203 TQueryDescription *query = (TQueryDescription *)obj;
5204 TString m;
5205 Int_t result = 0;
5206
5210 new TGMsgBox(fClient->GetRoot(), this, "Delete Query",
5211 "Deleting running queries is not allowed", kMBIconExclamation,
5212 kMBOk, &result);
5213 return;
5214 }
5215 m.Form("Do you want to delete query \"%s\" from server too ?",
5216 query->fQueryName.Data());
5217 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), kMBIconQuestion,
5218 kMBYes | kMBNo | kMBCancel, &result);
5219 }
5220 else {
5221 m.Form("Dou you really want to delete query \"%s\" ?",
5222 query->fQueryName.Data());
5223 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), kMBIconQuestion,
5224 kMBOk | kMBCancel, &result);
5225 }
5226 if (result == kMBYes) {
5227 fActDesc->fProof->Remove(query->fReference.Data());
5228 fActDesc->fQueries->Remove((TObject *)query);
5230 delete query;
5231 }
5232 else if (result == kMBNo || result == kMBOk) {
5233 fActDesc->fQueries->Remove((TObject *)query);
5235 delete query;
5236 }
5239 if (fAutoSave)
5241}
5242
5243////////////////////////////////////////////////////////////////////////////////
5244/// Edit currently selected query.
5245
5247{
5249 if (!item) return;
5250 TObject *obj = (TObject *)item->GetUserData();
5251 if (!obj || obj->IsA() != TQueryDescription::Class()) return;
5252 TQueryDescription *query = (TQueryDescription *)obj;
5253 TNewQueryDlg *dlg = new TNewQueryDlg(this, 350, 310, query, kTRUE);
5254 dlg->Popup();
5255}
5256
5257////////////////////////////////////////////////////////////////////////////////
5258/// Start TreeViewer from selected TChain.
5259
5261{
5263 if (!item) return;
5264 TObject *obj = (TObject *)item->GetUserData();
5265 if (!obj || obj->IsA() != TQueryDescription::Class()) return;
5266 TQueryDescription *query = (TQueryDescription *)obj;
5267 if (!query->fChain && query->fResult &&
5268 (obj = query->fResult->GetInputObject("TDSet"))) {
5269 query->fChain = (TDSet *) obj;
5270 }
5271 if (!query->fChain) return;
5272 if (query->fChain->IsA() == TChain::Class())
5273 ((TChain *)query->fChain)->StartViewer();
5274 else if (query->fChain->IsA() == TDSet::Class())
5275 ((TDSet *)query->fChain)->StartViewer();
5276}
5277
5278////////////////////////////////////////////////////////////////////////////////
5279/// Query the list of uploaded packages from proof and display it
5280/// into a new text window.
5281
5283{
5284 Window_t wdummy;
5285 Int_t ax, ay;
5286
5287 if (fActDesc->fLocal) return;
5288 if (!fActDesc->fProof || !fActDesc->fProof->IsValid())
5289 return;
5290 TString pathtmp = TString::Format("%s/%s", gSystem->TempDirectory(),
5292 // redirect stdout/stderr to temp file
5293 if (gSystem->RedirectOutput(pathtmp.Data(), "w") != 0) {
5294 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
5295 return;
5296 }
5298 // restore stdout/stderr
5299 if (gSystem->RedirectOutput(0) != 0) {
5300 Error("ShowStatus", "stdout/stderr retore failed; skipping");
5301 return;
5302 }
5303 if (!fLogWindow) {
5304 fLogWindow = new TSessionLogView(this, 700, 100);
5305 } else {
5306 // Clear window
5307 fLogWindow->Clear();
5308 }
5309 fLogWindow->LoadFile(pathtmp.Data());
5310 gVirtualX->TranslateCoordinates(GetId(), fClient->GetDefaultRoot()->GetId(),
5311 0, 0, ax, ay, wdummy);
5312 fLogWindow->Move(ax, ay + GetHeight() + 35);
5313 fLogWindow->Popup();
5314}
5315
5316////////////////////////////////////////////////////////////////////////////////
5317/// Update the list of packages.
5318
5320{
5321 TObjString *packname;
5322 TPackageDescription *package;
5326 //fActDesc->fPackages->Clear();
5328 if(packlist) {
5329 TIter nextenabled(packlist);
5330 while ((packname = (TObjString *)nextenabled())) {
5331 package = new TPackageDescription;
5332 package->fName = packname->GetName();
5333 package->fName += ".par";
5334 package->fPathName = package->fName;
5335 package->fId = fActDesc->fPackages->GetEntries();
5336 package->fUploaded = kTRUE;
5337 package->fEnabled = kTRUE;
5338 if (!fActDesc->fPackages->FindObject(package->fName)) {
5339 fActDesc->fPackages->Add((TObject *)package);
5340 }
5341 }
5342 }
5343 packlist = fActDesc->fProof->GetListOfPackages();
5344 if(packlist) {
5345 TIter nextpack(packlist);
5346 while ((packname = (TObjString *)nextpack())) {
5347 package = new TPackageDescription;
5348 package->fName = packname->GetName();
5349 package->fName += ".par";
5350 package->fPathName = package->fName;
5351 package->fId = fActDesc->fPackages->GetEntries();
5352 package->fUploaded = kTRUE;
5353 package->fEnabled = kFALSE;
5354 if (!fActDesc->fPackages->FindObject(package->fName)) {
5355 fActDesc->fPackages->Add((TObject *)package);
5356 }
5357 }
5358 }
5359 }
5360// fSessionFrame->UpdatePackages();
5361}
5362
5363////////////////////////////////////////////////////////////////////////////////
5364/// Query list of enabled packages from proof and display it
5365/// into a new text window.
5366
5368{
5369 Window_t wdummy;
5370 Int_t ax, ay;
5371
5372 if (fActDesc->fLocal) return;
5373 if (!fActDesc->fProof || !fActDesc->fProof->IsValid())
5374 return;
5375 TString pathtmp = TString::Format("%s/%s", gSystem->TempDirectory(),
5377 // redirect stdout/stderr to temp file
5378 if (gSystem->RedirectOutput(pathtmp.Data(), "w") != 0) {
5379 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
5380 return;
5381 }
5383 // restore stdout/stderr
5384 if (gSystem->RedirectOutput(0) != 0) {
5385 Error("ShowStatus", "stdout/stderr retore failed; skipping");
5386 return;
5387 }
5388 if (!fLogWindow) {
5389 fLogWindow = new TSessionLogView(this, 700, 100);
5390 } else {
5391 // Clear window
5392 fLogWindow->Clear();
5393 }
5394 fLogWindow->LoadFile(pathtmp.Data());
5395 gVirtualX->TranslateCoordinates(GetId(), fClient->GetDefaultRoot()->GetId(),
5396 0, 0, ax, ay, wdummy);
5397 fLogWindow->Move(ax, ay + GetHeight() + 35);
5398 fLogWindow->Popup();
5399}
5400
5401////////////////////////////////////////////////////////////////////////////////
5402/// Display the content of the temporary log file for queryref
5403/// into a new text window.
5404
5405void TSessionViewer::ShowLog(const char *queryref)
5406{
5407 Window_t wdummy;
5408 Int_t ax, ay;
5409
5410 if (fActDesc->fProof) {
5411 gVirtualX->SetCursor(GetId(),gVirtualX->CreateCursor(kWatch));
5412 if (!fLogWindow) {
5413 fLogWindow = new TSessionLogView(this, 700, 100);
5414 } else {
5415 // Clear window
5416 fLogWindow->Clear();
5417 }
5418 fActDesc->fProof->Connect("LogMessage(const char*,Bool_t)",
5419 "TSessionViewer", this, "LogMessage(const char*,Bool_t)");
5422 if (queryref)
5423 fActDesc->fProof->ShowLog(queryref);
5424 else
5425 fActDesc->fProof->ShowLog(0);
5426 fActDesc->fProof->SendLogToWindow(logonly);
5427 // set log window position at the bottom of Session Viewer
5428 gVirtualX->TranslateCoordinates(GetId(),
5429 fClient->GetDefaultRoot()->GetId(), 0, 0, ax, ay, wdummy);
5430 fLogWindow->Move(ax, ay + GetHeight() + 35);
5431 fLogWindow->Popup();
5432 gVirtualX->SetCursor(GetId(), 0);
5433 }
5434}
5435
5436////////////////////////////////////////////////////////////////////////////////
5437/// Display text in status bar.
5438
5439void TSessionViewer::ShowInfo(const char *txt)
5440{
5441 fStatusBar->SetText(txt,0);
5444}
5445
5446////////////////////////////////////////////////////////////////////////////////
5447/// Retrieve and display Proof status.
5448
5450{
5451 Window_t wdummy;
5452 Int_t ax, ay;
5453
5454 if (!fActDesc->fProof || !fActDesc->fProof->IsValid())
5455 return;
5456 TString pathtmp = TString::Format("%s/%s", gSystem->TempDirectory(),
5458 // redirect stdout/stderr to temp file
5459 if (gSystem->RedirectOutput(pathtmp.Data(), "w") != 0) {
5460 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
5461 return;
5462 }
5464 // restore stdout/stderr
5465 if (gSystem->RedirectOutput(0) != 0) {
5466 Error("ShowStatus", "stdout/stderr retore failed; skipping");
5467 return;
5468 }
5469 if (!fLogWindow) {
5470 fLogWindow = new TSessionLogView(this, 700, 100);
5471 } else {
5472 // Clear window
5473 fLogWindow->Clear();
5474 }
5475 fLogWindow->LoadFile(pathtmp.Data());
5476 gVirtualX->TranslateCoordinates(GetId(), fClient->GetDefaultRoot()->GetId(),
5477 0, 0, ax, ay, wdummy);
5478 fLogWindow->Move(ax, ay + GetHeight() + 35);
5479 fLogWindow->Popup();
5480}
5481
5482////////////////////////////////////////////////////////////////////////////////
5483/// Handle startup message (connection progress) coming from Proof session.
5484
5486{
5487 Float_t pos = Float_t(Double_t(done * 100)/Double_t(total));
5489 fStatusBar->SetText(msg, 1);
5490}
5491
5492////////////////////////////////////////////////////////////////////////////////
5493/// Handle session viewer custom popup menus.
5494
5496{
5497 switch (id) {
5498
5499 case kSessionDelete:
5501 break;
5502
5503 case kSessionConnect:
5505 break;
5506
5507 case kSessionDisconnect:
5509 break;
5510
5511 case kSessionShutdown:
5513 break;
5514
5515 case kSessionCleanup:
5517 break;
5518
5519 case kSessionReset:
5520 ResetSession();
5521 break;
5522
5523 case kSessionBrowse:
5524 if (fActDesc->fProof && fActDesc->fProof->IsValid()) {
5525 TBrowser *b = new TBrowser();
5527 }
5528 break;
5529
5530 case kSessionShowStatus:
5531 ShowStatus();
5532 break;
5533
5534 case kSessionGetQueries:
5536 break;
5537
5538 case kQueryEdit:
5539 EditQuery();
5540 break;
5541
5542 case kQueryDelete:
5543 DeleteQuery();
5544 break;
5545
5546 case kQueryStartViewer:
5547 StartViewer();
5548 break;
5549
5550 case kQuerySubmit:
5552 break;
5553 }
5554}
5555
5556////////////////////////////////////////////////////////////////////////////////
5557/// Handle feedback histograms configuration menu.
5558
5560{
5561 // divide stats canvas by number of selected feedback histos
5566 if (!fActDesc || !fActDesc->fActQuery) return;
5567 fActDesc->fNbHistos = 0;
5568 Int_t i = 0;
5569
5570 if (fActDesc->fAttached && fActDesc->fProof &&
5571 fActDesc->fProof->IsValid()) {
5573 // browse list of feedback histos and check user's selected ones
5574 while (kFeedbackHistos[i]) {
5575 if (fCascadeMenu->IsEntryChecked(41+i)) {
5577 }
5578 i++;
5579 }
5580 }
5581 else {
5582 // if feedback option not selected, clear Proof's feedback option
5584 }
5585 }
5586
5587 i = 0;
5588 // loop over feedback histo list
5589 while (kFeedbackHistos[i]) {
5590 // check if user has selected this histogram in the option menu
5591 if (fCascadeMenu->IsEntryChecked(41+i))
5593 i++;
5594 }
5597 if (fActDesc->fNbHistos == 4)
5599 else if (fActDesc->fNbHistos > 4)
5601 else
5603
5604 // if actual query has results, update feedback histos
5608 fQueryFrame->ResetProgressDialog("", 0, 0, 0);
5609 }
5610 else if (fActDesc->fActQuery) {
5615 }
5617}
5618////////////////////////////////////////////////////////////////////////////////
5619/// Handle messages send to the TSessionViewer object. E.g. all menu entries
5620/// messages.
5621
5623{
5624 TNewQueryDlg *dlg;
5625
5626 switch (GET_MSG(msg)) {
5627 case kC_COMMAND:
5628 switch (GET_SUBMSG(msg)) {
5629 case kCM_BUTTON:
5630 case kCM_MENU:
5631 switch (parm1) {
5632
5633 case kFileCloseViewer:
5634 CloseWindow();
5635 break;
5636
5637 case kFileLoadConfig:
5638 {
5639 TGFileInfo fi;
5640 fi.fFilename = strdup((char *)gSystem->BaseName(fConfigFile));
5641 fi.fIniDir = strdup((char *)gSystem->HomeDirectory());
5642 fi.fFileTypes = conftypes;
5643 new TGFileDialog(fClient->GetRoot(), this, kFDOpen, &fi);
5644 if (fi.fFilename) {
5648 }
5649 }
5650 break;
5651
5652 case kFileSaveConfig:
5653 {
5654 TGFileInfo fi;
5655 fi.fFilename = strdup((char *)gSystem->BaseName(fConfigFile));
5656 fi.fIniDir = strdup((char *)gSystem->HomeDirectory());
5657 fi.fFileTypes = conftypes;
5658 new TGFileDialog(fClient->GetRoot(), this, kFDSave, &fi);
5659 if (fi.fFilename) {
5662 }
5663 }
5664 break;
5665
5666 case kFileQuit:
5667 Terminate();
5669 delete this;
5671 break;
5672
5673 case kSessionNew:
5675 break;
5676
5677 case kSessionAdd:
5679 break;
5680
5681 case kSessionDelete:
5683 break;
5684
5685 case kSessionCleanup:
5687 break;
5688
5689 case kSessionReset:
5690 ResetSession();
5691 break;
5692
5693 case kSessionConnect:
5695 break;
5696
5697 case kSessionDisconnect:
5699 break;
5700
5701 case kSessionShutdown:
5703 break;
5704
5705 case kSessionShowStatus:
5706 ShowStatus();
5707 break;
5708
5709 case kSessionGetQueries:
5711 break;
5712
5713 case kQueryNew:
5714 dlg = new TNewQueryDlg(this, 350, 310);
5715 dlg->Popup();
5716 break;
5717
5718 case kQueryEdit:
5719 EditQuery();
5720 break;
5721
5722 case kQueryDelete:
5723 DeleteQuery();
5724 break;
5725
5726 case kQueryStartViewer:
5727 StartViewer();
5728 break;
5729
5730 case kQuerySubmit:
5732 break;
5733
5734 case kOptionsAutoSave:
5737 fAutoSave = kFALSE;
5738 }
5739 else {
5741 fAutoSave = kTRUE;
5742 }
5743 break;
5744
5745 case kOptionsStatsHist:
5748 gEnv->SetValue("Proof.StatsHist", 0);
5749 }
5750 else {
5752 gEnv->SetValue("Proof.StatsHist", 1);
5753 }
5754 break;
5755
5756 case kOptionsStatsTrace:
5759 gEnv->SetValue("Proof.StatsTrace", 0);
5760 }
5761 else {
5763 gEnv->SetValue("Proof.StatsTrace", 1);
5764 }
5765 break;
5766
5770 gEnv->SetValue("Proof.SlaveStatsTrace", 0);
5771 }
5772 else {
5774 gEnv->SetValue("Proof.SlaveStatsTrace", 1);
5775 }
5776 break;
5777
5778 case kOptionsFeedback:
5781 }
5782 else {
5784 }
5785 break;
5786
5787 case 41:
5788 case 42:
5789 case 43:
5790 case 44:
5791 case 45:
5792 case 46:
5793 if (fCascadeMenu->IsEntryChecked(parm1)) {
5794 fCascadeMenu->UnCheckEntry(parm1);
5795 }
5796 else {
5797 fCascadeMenu->CheckEntry(parm1);
5798 }
5799 OnCascadeMenu();
5800 break;
5801
5802 case 50:
5803 if (fCascadeMenu->IsEntryChecked(parm1)) {
5804 fCascadeMenu->UnCheckEntry(parm1);
5805 }
5806 else {
5807 fCascadeMenu->CheckEntry(parm1);
5808 }
5809 OnCascadeMenu();
5810 break;
5811
5812 case kHelpAbout:
5813 {
5814#ifdef R__UNIX
5815 TString rootx = TROOT::GetBinDir() + "/root -a &";
5816 gSystem->Exec(rootx);
5817#else
5818#ifdef WIN32
5820#else
5821 char str[32];
5822 sprintf(str, "About ROOT %s...", gROOT->GetVersion());
5823 TRootHelpDialog *hd = new TRootHelpDialog(this, str, 600, 400);
5824 hd->SetText(gHelpAbout);
5825 hd->Popup();
5826#endif
5827#endif
5828 }
5829 break;
5830
5831 default:
5832 break;
5833 }
5834 default:
5835 break;
5836 }
5837 default:
5838 break;
5839 }
5840
5841 return kTRUE;
5842}
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
const Handle_t kNone
Definition: GuiTypes.h:87
const Mask_t kLeaveWindowMask
Definition: GuiTypes.h:167
const Mask_t kButtonReleaseMask
Definition: GuiTypes.h:161
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:41
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
long Long_t
Definition: RtypesCore.h:50
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
long long Long64_t
Definition: RtypesCore.h:69
float Float_t
Definition: RtypesCore.h:53
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassImp(name)
Definition: Rtypes.h:365
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
@ kSunkenFrame
Definition: TGFrame.h:61
@ kVerticalFrame
Definition: TGFrame.h:59
@ kDoubleBorder
Definition: TGFrame.h:63
@ kFixedWidth
Definition: TGFrame.h:65
@ kHorizontalFrame
Definition: TGFrame.h:60
@ 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:415
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:560
#define gPad
Definition: TVirtualPad.h:286
#define gVirtualX
Definition: TVirtualX.h:345
@ kWatch
Definition: TVirtualX.h:47
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:715
virtual void Update()
Update canvas pad buffers.
Definition: TCanvas.cxx:2339
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
Definition: TCanvas.cxx:696
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:940
virtual Long64_t GetReadEntry() const
See TTree::GetReadEntry().
Definition: TChain.cxx:1182
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:38
TUrl * GetFirstUrl() const
Definition: TFileInfo.h:71
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition: TGButton.cxx:395
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:409
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition: TGButton.cxx:185
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:1200
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:982
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:1099
virtual UInt_t GetDefaultWidth() const
Definition: TGFrame.h:371
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition: TGFrame.cxx:949
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1239
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1054
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGFrame.h:375
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1146
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition: TGFrame.cxx:1186
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:373
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition: TGFrame.cxx:1172
Bool_t IsVisible(TGFrame *f) const
Get state of sub frame.
Definition: TGFrame.cxx:1213
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
char * fIniDir
Definition: TGFileDialog.h:62
Bool_t fMultipleSelection
Definition: TGFileDialog.h:66
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition: TGFrame.cxx:321
void RemoveInput(UInt_t emask)
Remove events specified in emask from the events the frame should handle.
Definition: TGFrame.cxx:330
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition: TGFrame.cxx:691
virtual UInt_t GetDefaultWidth() const
Definition: TGFrame.h:237
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:238
virtual void DeleteWindow()
Delete window.
Definition: TGFrame.cxx:258
virtual void Move(Int_t x, Int_t y)
Move frame.
Definition: TGFrame.cxx:575
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:587
UInt_t GetHeight() const
Definition: TGFrame.h:272
virtual void MapWindow()
Definition: TGFrame.h:251
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:177
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
Definition: TGListBox.cxx:1419
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:1523
virtual void AddEntry(TGString *s, Int_t id)
Add entry with specified string and id to listbox.
Definition: TGListBox.cxx:1211
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:1460
virtual void GetSelectedEntries(TList *selected)
Adds all selected entries (TGLBEntry) of the list box into the list selected.
Definition: TGListBox.cxx:1533
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:1361
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:1862
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1746
virtual void AddPopup(TGHotString *s, TGPopupMenu *menu, TGLayoutHints *l, TGPopupMenu *before=0)
Add popup menu to menu bar.
Definition: TGMenu.cxx:415
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:1092
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:1149
virtual Bool_t IsEntryChecked(Int_t id)
Return true if menu item is checked.
Definition: TGMenu.cxx:1842
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:987
virtual void AddSeparator(TGMenuEntry *before=0)
Add a menu separator to the menu.
Definition: TGMenu.cxx:1057
virtual void CheckEntry(Int_t id)
Check a menu entry (i.e. add a check mark in front of it).
Definition: TGMenu.cxx:1779
virtual void DisableEntry(Int_t id)
Disable entry (disabled entries appear in a sunken relieve).
Definition: TGMenu.cxx:1721
virtual void EnableEntry(Int_t id)
Enable entry. By default entries are enabled.
Definition: TGMenu.cxx:1702
virtual void UnCheckEntry(Int_t id)
Uncheck menu entry (i.e. remove check mark).
Definition: TGMenu.cxx:1804
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:1238
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:612
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:507
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
Definition: TGTab.cxx:341
UInt_t GetTextLength() const
Definition: TGTextBuffer.h:45
virtual void SetText(TGHotString *new_label)
Set new button text.
Definition: TGButton.cxx:594
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:452
virtual Bool_t LoadBuffer(const char *txtbuf)
Load text from a text buffer. Return false in case of failure.
Definition: TGTextView.cxx:469
virtual void Clear(Option_t *="")
Clear text view widget.
Definition: TGTextView.cxx:428
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:221
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:819
virtual void AddAt(TObject *obj, Int_t idx)
Insert object at position idx in the list.
Definition: TList.cxx:303
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Definition: TList.cxx:575
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
Definition: TList.cxx:354
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
Definition: TList.cxx:690
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
Definition: TList.cxx:467
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Definition: TList.cxx:399
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:100
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:880
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:1163
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:5819
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:306
virtual TList * QuerySessions(Option_t *opt="S")
Get list of sessions accessible to this manager.
Definition: TProofMgr.cxx:228
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:498
virtual TProof * CreateSession(const char *=0, const char *=0, Int_t=-1)
Create a new remote session (master and associated workers).
Definition: TProofMgr.cxx:386
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:123
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:6506
void ShowPackages(Bool_t all=kFALSE, Bool_t redirlog=kFALSE)
List contents of package directory.
Definition: TProof.cxx:7743
static TProofMgr * Mgr(const char *url)
Get instance of the effective manager for 'url' Return 0 on failure.
Definition: TProof.cxx:11697
Int_t UploadPackage(const char *par, EUploadPackageOpt opt=kUntar, TList *workers=0)
Upload a PROOF archive (PAR file).
Definition: TProof.cxx:8414
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:9962
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:6065
TList * GetListOfPackages()
Get from the master the list of names of the packages available.
Definition: TProof.cxx:9081
TQueryResult * GetQueryResult(const char *ref=0)
Return pointer to the full TQueryResult instance owned by the player and referenced by 'ref'.
Definition: TProof.cxx:2127
void ClearFeedback()
Clear feedback list.
Definition: TProof.cxx:9985
void Browse(TBrowser *b)
Build the PROOF's structure in the browser.
Definition: TProof.cxx:10152
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:7113
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:7830
Int_t ClearPackages()
Remove all packages.
Definition: TProof.cxx:7813
Int_t GetParallel() const
Returns number of slaves active in parallel mode.
Definition: TProof.cxx:2283
Int_t Remove(Int_t query, Bool_t all=kFALSE)
Send remove request for the qry-th query in fQueries.
Definition: TProof.cxx:5986
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:10556
void Detach(Option_t *opt="")
Detach this instance to its proofserv.
Definition: TProof.cxx:10491
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:10469
Int_t Retrieve(Int_t query, const char *path=0)
Send retrieve request for the qry-th query in fQueries.
Definition: TProof.cxx:5921
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:10964
void SetQueryMode(EQueryMode mode)
Change query running mode to the one specified by 'mode'.
Definition: TProof.cxx:6080
@ 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:5856
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:6197
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:10344
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:10910
TList * GetListOfEnabledPackages()
Get from the master the list of names of the packages enabled.
Definition: TProof.cxx:9097
virtual TList * GetListOfQueries(Option_t *opt="")
Ask the master for the list of queries.
Definition: TProof.cxx:2067
void SetLogLevel(Int_t level, UInt_t mask=TProofDebug::kAll)
Set server logging level.
Definition: TProof.cxx:7052
Bool_t IsMaster() const
Definition: TProof.h:936
void ShowEnabledPackages(Bool_t all=kFALSE)
List which packages are enabled.
Definition: TProof.cxx:7791
@ 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:8148
virtual Int_t VerifyDataSet(const char *dataset, const char *optStr="")
Verify if all files in the specified dataset are available.
Definition: TProof.cxx:11103
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:867
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:1025
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:2935
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
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 TTime Now()
Get current time in milliseconds since 0:00 Jan 1 1995.
Definition: TSystem.cxx:473
virtual Int_t Exec(const char *shellcmd)
Execute a command.
Definition: TSystem.cxx:663
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:2503
virtual const char * HomeDirectory(const char *userName=0)
Return the user's home directory.
Definition: TSystem.cxx:895
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:1287
virtual const char * UnixPathName(const char *unixpathname)
Convert from a Unix pathname to a local pathname.
Definition: TSystem.cxx:1054
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition: TSystem.cxx:942
virtual const char * HostName()
Return the system's host name.
Definition: TSystem.cxx:313
virtual const char * WorkingDirectory()
Return working directory.
Definition: TSystem.cxx:879
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Definition: TSystem.cxx:426
virtual int Unlink(const char *name)
Unlink, i.e.
Definition: TSystem.cxx:1372
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
Definition: TSystem.cxx:1589
virtual Int_t RedirectOutput(const char *name, const char *mode="a", RedirectHandle_t *h=0)
Redirect standard output (stdout, stderr) to the specified file.
Definition: TSystem.cxx:1703
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
Definition: TSystem.cxx:1473
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
Implement some of the functionality of the class TTree requiring access to extra libraries (Histogram...
Definition: TTreePlayer.h:37
TVirtualTreePlayer * GetPlayer()
Load the TTreePlayer (if not already done).
Definition: TTree.cxx:6161
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
Definition: TUrl.cxx:385
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:50
virtual TVirtualPad * cd(Int_t subpadnumber=0)=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:155
TString fOS
Definition: TSystem.h:152
const char * fPixmap
Definition: TGToolBar.h:33
TString fRealName
Definition: TSystem.h:145
TString fGroup
Definition: TSystem.h:143
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