Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TSessionViewer.cxx
Go to the documentation of this file.
1// @(#)root/sessionviewer:$Id$
2// Author: Marek Biskup, Jakub Madejczyk, Bertrand Bellenot 10/08/2005
3
4/*************************************************************************
5 * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12//////////////////////////////////////////////////////////////////////////
13// //
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 "TGListBox.h"
37#include "TGSplitter.h"
38#include "TGProgressBar.h"
39#include "TGListView.h"
40#include "TGMsgBox.h"
41#include "TGMenu.h"
42#include "TGStatusBar.h"
43#include "TGIcon.h"
44#include "TChain.h"
45#include "TDSet.h"
46#include "TFileInfo.h"
47#include "TObjString.h"
48#include "TProof.h"
49#include "TRandom.h"
50#include "TSessionViewer.h"
51#include "TSessionLogView.h"
52#include "TQueryResult.h"
53#include "TGTextView.h"
54#include "TGToolBar.h"
55#include "TGTab.h"
56#include "TRootEmbeddedCanvas.h"
57#include "TCanvas.h"
58#include "TGMimeTypes.h"
59#include "TInterpreter.h"
60#include "TContextMenu.h"
61#include "TG3DLine.h"
62#include "TSessionDialogs.h"
63#include "TEnv.h"
64#include "TH2.h"
65#include "TVirtualTreePlayer.h"
66#include "TSelector.h"
67#include "TFileCollection.h"
68#include "TVirtualX.h"
69#include "snprintf.h"
70#ifdef WIN32
71#include "TWin32SplashThread.h"
72#endif
73
74#include <cstdlib>
75
77
78const char *kConfigFile = ".proofgui.conf";
79
88
89const char *xpm_names[] = {
90 "monitor01.xpm",
91 "monitor02.xpm",
92 "monitor03.xpm",
93 "monitor04.xpm",
94 0
95};
96
97const char *conftypes[] = {
98 "Config files", "*.conf",
99 "All files", "*.*",
100 0, 0
101};
102
103const char *pkgtypes[] = {
104 "Package files", "*.par",
105 "All files", "*.*",
106 0, 0
107};
108
109const char *macrotypes[] = {
110 "C files", "*.[C|c]*",
111 "All files", "*",
112 0, 0
113};
114
115
116const char *kFeedbackHistos[] = {
117 "PROOF_PacketsHist",
118 "PROOF_EventsHist",
119 "PROOF_NodeHist",
120 "PROOF_LatencyHist",
121 "PROOF_ProcTimeHist",
122 "PROOF_CpuTimeHist",
123 0
124};
125
126const char* const kSession_RedirectFile = ".templog";
127const char* const kSession_RedirectCmd = ".tempcmd";
128
129// Menu command id's
135
140
148
154
160
163
164const char *xpm_toolbar[] = {
165 "fileopen.xpm",
166 "filesaveas.xpm",
167 "",
168 "connect.xpm",
169 "disconnect.xpm",
170 "",
171 "query_new.xpm",
172 "query_submit.xpm",
173 "",
174 "about.xpm",
175 "",
176 "quit.xpm",
177 0
178};
179
181 { "", "Open Config File", kFALSE, kFileLoadConfig, 0 },
182 { "", "Save Config File", kFALSE, kFileSaveConfig, 0 },
183 { "", 0, 0, -1, 0 },
184 { "", "Connect", kFALSE, kSessionConnect, 0 },
185 { "", "Disconnect", kFALSE, kSessionDisconnect, 0 },
186 { "", 0, 0, -1, 0 },
187 { "", "New Query", kFALSE, kQueryNew, 0 },
188 { "", "Submit Query", kFALSE, kQuerySubmit, 0 },
189 { "", 0, 0, -1, 0 },
190 { "", "About Root", kFALSE, kHelpAbout, 0 },
191 { "", 0, 0, -1, 0 },
192 { "", "Exit Root", kFALSE, kFileQuit, 0 },
193 { 0, 0, 0, 0, 0 }
194};
195
196
197////////////////////////////////////////////////////////////////////////////////
198// Server Frame
199
200////////////////////////////////////////////////////////////////////////////////
201/// Constructor.
202
204 TGCompositeFrame(p, w, h), fFrmNewServer(0), fTxtName(0), fTxtAddress(0),
205 fNumPort(0), fLogLevel(0), fTxtConfig(0), fTxtUsrName(0), fSync(0),
206 fViewer(0), fBtnAdd(0), fBtnConnect(0)
207{
208}
209
210////////////////////////////////////////////////////////////////////////////////
211/// Destructor.
212
214{
215 Cleanup();
216}
217
218////////////////////////////////////////////////////////////////////////////////
219/// Build server configuration frame.
220
222{
224
226
227 fViewer = gui;
228 fFrmNewServer = new TGGroupFrame(this, "New Session");
230
232
234
235 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Session Name:"),
236 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
238 (const char *)0, 1), new TGLayoutHints());
240 fTxtName->Associate(this);
241 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Server name:"),
242 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
244 (const char *)0, 2), new TGLayoutHints());
246 fTxtAddress->Associate(this);
247 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Port (default: 1093):"),
248 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
252 fNumPort->Associate(this);
253 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Configuration File:"),
254 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
256 (const char *)0, 4), new TGLayoutHints());
258 fTxtConfig->Associate(this);
259 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Log Level:"),
260 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
261
266 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
267 fLogLevel->Associate(this);
268
269 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "User Name:"),
270 new TGLayoutHints(kLHintsLeft, 3, 3, 3, 3));
272 (const char *)0, 6), new TGLayoutHints());
274 fTxtUsrName->Associate(this);
275
276 fFrmNewServer->AddFrame(new TGLabel(fFrmNewServer, "Process mode :"),
278 3, 3, 3, 3));
280 "&Synchronous"), new TGLayoutHints(kLHintsLeft | kLHintsBottom |
281 kLHintsExpandX, 3, 3, 3, 3));
282 fSync->SetToolTipText("Default Process Mode");
284
285 AddFrame(fBtnAdd = new TGTextButton(this, " Save "),
286 new TGLayoutHints(kLHintsTop | kLHintsCenterX, 5, 5, 15, 5));
287 fBtnAdd->SetToolTipText("Add server to the list");
288 fBtnAdd->Connect("Clicked()", "TSessionServerFrame", this,
289 "OnBtnAddClicked()");
290 AddFrame(fBtnConnect = new TGTextButton(this, " Connect "),
291 new TGLayoutHints(kLHintsTop | kLHintsCenterX, 5, 5, 15, 5));
292 fBtnConnect->Connect("Clicked()", "TSessionServerFrame", this,
293 "OnBtnConnectClicked()");
294 fBtnConnect->SetToolTipText("Connect to the selected server");
295
296 fTxtConfig->Connect("DoubleClicked()", "TSessionServerFrame", this,
297 "OnConfigFileClicked()");
298
299 fTxtName->Connect("TextChanged(char*)", "TSessionServerFrame", this,
300 "SettingsChanged()");
301 fTxtAddress->Connect("TextChanged(char*)", "TSessionServerFrame", this,
302 "SettingsChanged()");
303 fTxtConfig->Connect("TextChanged(char*)", "TSessionServerFrame", this,
304 "SettingsChanged()");
305 fTxtUsrName->Connect("TextChanged(char*)", "TSessionServerFrame", this,
306 "SettingsChanged()");
307 fSync->Connect("Clicked()", "TSessionServerFrame", this,
308 "SettingsChanged()");
309 fLogLevel->Connect("ValueChanged(Long_t)", "TSessionServerFrame", this,
310 "SettingsChanged()");
311 fLogLevel->Connect("ValueSet(Long_t)", "TSessionServerFrame", this,
312 "SettingsChanged()");
313 fNumPort->Connect("ValueChanged(Long_t)", "TSessionServerFrame", this,
314 "SettingsChanged()");
315 fNumPort->Connect("ValueSet(Long_t)", "TSessionServerFrame", this,
316 "SettingsChanged()");
317
318}
319
320////////////////////////////////////////////////////////////////////////////////
321/// Settings have changed, update GUI accordingly.
322
324{
325 TGTextEntry *sender = dynamic_cast<TGTextEntry*>((TQObject*)gTQSender);
326 Bool_t issync = (fSync->GetState() == kButtonDown);
327 if ((fViewer->GetActDesc()->fLocal) ||
328 (strcmp(fViewer->GetActDesc()->GetName(), fTxtName->GetText())) ||
329 (strcmp(fViewer->GetActDesc()->fAddress.Data(), fTxtAddress->GetText())) ||
330 (strcmp(fViewer->GetActDesc()->fConfigFile.Data(), fTxtConfig->GetText())) ||
331 (strcmp(fViewer->GetActDesc()->fUserName.Data(), fTxtUsrName->GetText())) ||
334 (fViewer->GetActDesc()->fSync != issync)) {
337 }
338 else {
341 }
342 if (sender) {
343 sender->SetFocus();
344 }
345}
346
347
348////////////////////////////////////////////////////////////////////////////////
349/// Handle expose event in server frame.
350
352{
353 //fTxtName->SelectAll();
354 //fTxtName->SetFocus();
355 return kTRUE;
356}
357
358////////////////////////////////////////////////////////////////////////////////
359/// Browse configuration files.
360
362{
363 // do nothing if connection in progress
364 if (fViewer->IsBusy())
365 return;
366 TGFileInfo fi;
369 if (!fi.fFilename) return;
371}
372
373////////////////////////////////////////////////////////////////////////////////
374/// Delete selected session configuration (remove it from the list).
375
377{
378 // do nothing if connection in progress
379 if (fViewer->IsBusy())
380 return;
382 TIter next(fViewer->GetSessions());
384
385 if (desc->fLocal) {
386 Int_t retval;
387 new TGMsgBox(fClient->GetRoot(), this, "Error Deleting Session",
388 "Deleting Local Sessions is not allowed !",
389 kMBIconExclamation,kMBOk,&retval);
390 return;
391 }
392 // ask for confirmation
393 TString m;
394 m.Form("Are you sure to delete the server \"%s\"",
395 desc->fName.Data());
396 Int_t result;
397 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), 0,
398 kMBOk | kMBCancel, &result);
399 // if confirmed, delete it
400 if (result == kMBOk) {
401 // remove the Proof session from gROOT list of Proofs
402 if (desc->fConnected && desc->fAttached && desc->fProof) {
403 desc->fProof->Detach("S");
404 }
405 // remove it from our sessions list
406 fViewer->GetSessions()->Remove((TObject *)desc);
407 // update configuration file
410
411 TObject *obj = fViewer->GetSessions()->Last();
413 fViewer->GetSessionItem(), (void *)obj);
414 if (item) {
421 fViewer->OnListTreeClicked(item, 1, 0, 0);
422 }
423 }
424 if (fViewer->IsAutoSave())
426}
427
428////////////////////////////////////////////////////////////////////////////////
429/// Connect to selected server.
430
432{
433 // do nothing if connection in progress
434 if (fViewer->IsBusy())
435 return;
436
439 }
440 else {
443 if (strlen(fTxtConfig->GetText()) > 1)
445 else
450 if (fViewer->IsAutoSave())
452 }
453 // set flag busy
454 fViewer->SetBusy();
455 // avoid input events in list tree while connecting
460 // set watch cursor to indicate connection in progress
462 gVirtualX->CreateCursor(kWatch));
463 gVirtualX->SetCursor(GetId(),gVirtualX->CreateCursor(kWatch));
464 // display connection progress bar in first part of status bar
466 // connect to proof startup message (to update progress bar)
467 TQObject::Connect("TProof", "StartupMessage(char *,Bool_t,Int_t,Int_t)",
468 "TSessionViewer", fViewer, "StartupMessage(char *,Bool_t,Int_t,Int_t)");
469 // collect and set-up configuration
470 TString address = fTxtAddress->GetText();
471 TString url;
472 if (address == "lite://") {
473 url = address;
474 }
475 else {
476 // collect and set-up configuration
477 url = fTxtUsrName->GetText();
478 url += "@"; url += address.Data();
479 if (fNumPort->GetIntNumber() > 0) {
480 url += ":";
481 url += fNumPort->GetIntNumber();
482 }
483 }
484
485 TProofDesc *desc;
487 if (!fViewer->GetActDesc()->fProofMgr ||
489 // hide connection progress bar from status bar
491 // release busy flag
493 // restore cursors and input
494 gVirtualX->SetCursor(GetId(), 0);
499 gVirtualX->SetCursor(fViewer->GetSessionHierarchy()->GetId(), 0);
500 return;
501 }
503 // check if the session already exist before to recreate it
504 TList *sessions = fViewer->GetActDesc()->fProofMgr->QuerySessions("");
505 if (sessions) {
506 TIter nextp(sessions);
507 // loop over existing Proof sessions
508 while ((desc = (TProofDesc *)nextp())) {
509 if ((desc->GetName() == fViewer->GetActDesc()->fTag) ||
510 (desc->GetTitle() == fViewer->GetActDesc()->fName)) {
513 fViewer->GetActDesc()->fTag = desc->GetName();
517
519 Int_t i = 0;
520 // browse list of feedback histos and check user's selected ones
521 while (kFeedbackHistos[i]) {
522 if (fViewer->GetCascadeMenu()->IsEntryChecked(41+i)) {
525 }
526 i++;
527 }
528 // connect feedback signal
529 fViewer->GetActDesc()->fProof->Connect("Feedback(TList *objs)",
530 "TSessionQueryFrame", fViewer->GetQueryFrame(),
531 "Feedback(TList *objs)");
532 gROOT->Time();
533 }
534 else {
535 // if feedback option not selected, clear Proof's feedback option
537 }
538
539 break;
540 }
541 }
542 }
543 if (fViewer->GetActDesc()->fProof == 0) {
544 if (fViewer->GetActDesc()->fProofMgr->IsValid()) {
547 desc = 0;
548 sessions = fViewer->GetActDesc()->fProofMgr->QuerySessions("");
549 if (sessions)
550 desc = (TProofDesc *)sessions->Last();
551 if (desc) {
553 fViewer->GetActDesc()->fTag = desc->GetName();
556 }
557 }
558 }
559 if (fViewer->GetActDesc()->fProof) {
564 if (fViewer->GetActDesc()->fLogLevel < 0)
566 if (fViewer->GetActDesc()->fProof->IsLite())
567 fViewer->GetActDesc()->fAddress = "lite://";
568 else
572 }
574
575 // check if connected and valid
576 if (fViewer->GetActDesc()->fProof &&
578 // set log level
580 // set query type (synch / asynch)
583 // set connected flag
585 // change list tree item picture to connected pixmap
588 if (item) {
590 // update viewer
591 fViewer->OnListTreeClicked(item, 1, 0, 0);
594 }
595 // connect to progress related signals
596 fViewer->GetActDesc()->fProof->Connect("Progress(Long64_t,Long64_t)",
597 "TSessionQueryFrame", fViewer->GetQueryFrame(),
598 "Progress(Long64_t,Long64_t)");
599 fViewer->GetActDesc()->fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
600 "TSessionQueryFrame", fViewer->GetQueryFrame(),
601 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
602 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)",
603 "TSessionQueryFrame", fViewer->GetQueryFrame(),
604 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
605 fViewer->GetActDesc()->fProof->Connect("StopProcess(Bool_t)",
606 "TSessionQueryFrame", fViewer->GetQueryFrame(),
607 "IndicateStop(Bool_t)");
609 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)",
610 "TSessionQueryFrame", fViewer->GetQueryFrame(),
611 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)");
612 // enable timer used for status bar icon's animation
614 // change status bar right icon to connected pixmap
615 fViewer->ChangeRightLogo("monitor01.xpm");
616 // do not animate yet
618 // connect to signal "query result ready"
619 fViewer->GetActDesc()->fProof->Connect("QueryResultReady(char *)",
620 "TSessionViewer", fViewer, "QueryResultReady(char *)");
621 // display connection information on status bar
622 TString msg;
623 msg.Form("PROOF Cluster %s ready", fViewer->GetActDesc()->fName.Data());
624 fViewer->GetStatusBar()->SetText(msg.Data(), 1);
628 // Enable previously uploaded packages if in auto-enable mode
630 TPackageDescription *package;
632 while ((package = (TPackageDescription *)next())) {
633 if (!package->fEnabled) {
634 if (fViewer->GetActDesc()->fProof->EnablePackage(package->fName) != 0)
635 Error("Submit", "Enable package failed");
636 else {
637 package->fEnabled = kTRUE;
639 }
640 }
641 }
642 }
643 }
644 // hide connection progress bar from status bar
646 // release busy flag
648 // restore cursors and input
649 gVirtualX->SetCursor(GetId(), 0);
654 gVirtualX->SetCursor(fViewer->GetSessionHierarchy()->GetId(), 0);
655}
656
657////////////////////////////////////////////////////////////////////////////////
658/// Reset server configuration fields.
659
661{
662 // do nothing if connection in progress
663 if (fViewer->IsBusy())
664 return;
672 fTxtName->SetText("");
673 fTxtAddress->SetText("");
674 fTxtConfig->SetText("");
675 fNumPort->SetIntNumber(1093);
677 fTxtUsrName->SetText("");
678}
679
680////////////////////////////////////////////////////////////////////////////////
681/// Add newly created session configuration in the list of sessions.
682
684{
685 Int_t retval;
686 Bool_t newSession = kTRUE;
687 TSessionDescription* desc = 0;
688 // do nothing if connection in progress
689 if (fViewer->IsBusy())
690 return;
691
692 if ((!fTxtName->GetBuffer()->GetTextLength()) ||
695 new TGMsgBox(fClient->GetRoot(), fViewer, "Error Adding Session",
696 "At least one required field is empty !",
697 kMBIconExclamation, kMBOk, &retval);
698 return;
699 }
701 if (obj)
702 desc = dynamic_cast<TSessionDescription*>(obj);
703 if (desc) {
704 new TGMsgBox(fClient->GetRoot(), fViewer, "Adding Session",
705 TString::Format("The session \"%s\" already exists ! Overwrite ?",
707 kMBCancel, &retval);
708 if (retval != kMBYes)
709 return;
710 newSession = kFALSE;
711 }
712 if (newSession) {
713 desc = new TSessionDescription();
714 desc->fName = fTxtName->GetText();
715 desc->fTag = "";
716 desc->fQueries = new TList();
717 desc->fPackages = new TList();
718 desc->fActQuery = 0;
719 desc->fProof = 0;
720 desc->fProofMgr = 0;
721 desc->fAutoEnable = kFALSE;
722 desc->fAddress = fTxtAddress->GetText();
723 desc->fPort = fNumPort->GetIntNumber();
724 desc->fConnected = kFALSE;
725 desc->fAttached = kFALSE;
726 desc->fLocal = kFALSE;
727 if (strlen(fTxtConfig->GetText()) > 1)
729 else
730 desc->fConfigFile = "";
732 desc->fUserName = fTxtUsrName->GetText();
733 desc->fSync = (fSync->GetState() == kButtonDown);
734 // add newly created session config to our session list
735 fViewer->GetSessions()->Add((TObject *)desc);
736 // save into configuration file
738 fViewer->GetSessionItem(), desc->fName.Data(),
740 fViewer->GetSessionHierarchy()->SetToolTipItem(item, "Proof Session");
741 item->SetUserData(desc);
749 fViewer->OnListTreeClicked(item, 1, 0, 0);
750 }
751 else {
755 if (strlen(fTxtConfig->GetText()) > 1)
761 item2->SetUserData(fViewer->GetActDesc());
763 1, 0, 0);
764 }
767 if (fViewer->IsAutoSave())
769}
770
771////////////////////////////////////////////////////////////////////////////////
772/// Update fields with values from session description desc.
773
775{
776 if (desc->fLocal) {
777 fTxtName->SetText("");
778 fTxtAddress->SetText("");
779 fNumPort->SetIntNumber(1093);
780 fTxtConfig->SetText("");
781 fTxtUsrName->SetText("");
783 return;
784 }
785
786 fTxtName->SetText(desc->fName);
790
791 if (desc->fConfigFile.Length() > 1) {
793 }
794 else {
795 fTxtConfig->SetText("");
796 }
798}
799
800////////////////////////////////////////////////////////////////////////////////
801/// Process messages for session server frame.
802/// Used to navigate between text entry fields.
803
805{
806 switch (GET_MSG(msg)) {
807 case kC_TEXTENTRY:
808 switch (GET_SUBMSG(msg)) {
809 case kTE_ENTER:
810 case kTE_TAB:
811 switch (parm1) {
812 case 1: // session name
815 break;
816 case 2: // server address
819 break;
820 case 3: // port number
823 break;
824 case 4: // configuration file
827 break;
828 case 5: // log level
831 break;
832 case 6: // user name
835 break;
836 }
837 break;
838
839 default:
840 break;
841 }
842 break;
843
844 default:
845 break;
846 }
847 return kTRUE;
848}
849
850////////////////////////////////////////////////////////////////////////////////
851// Session Frame
852
853////////////////////////////////////////////////////////////////////////////////
854/// Constructor.
855
857 TGCompositeFrame(p, w, h), fTab(0), fFA(0), fFB(0), fFC(0), fFD(0), fFE(0),
858 fCommandTxt(0), fCommandBuf(0), fInfoTextView(0), fClearCheck(0),
859 fBtnShowLog(0), fBtnNewQuery(0), fBtnGetQueries(0), fLBPackages(0),
860 fBtnAdd(0), fBtnRemove(0), fBtnUp(0), fBtnDown(0), fBtnShow(0),
861 fBtnShowEnabled(0), fChkMulti(0), fChkEnable(0), fBtnUpload(0),
862 fBtnEnable(0), fBtnClear(0), fBtnDisable(0), fDSetView(0), fDataSetTree(0),
863 fBtnUploadDSet(0), fBtnRemoveDSet(0), fBtnVerifyDSet(0), fBtnRefresh(0),
864 fTxtParallel(0), fLogLevel(0), fApplyLogLevel(0), fApplyParallel(0),
865 fViewer(0)
866{
867 for (int i=0;i<19;++i) fInfoLine[i] = 0;
868}
869
870////////////////////////////////////////////////////////////////////////////////
871/// Destructor.
872
874{
875 Cleanup();
876}
877
878////////////////////////////////////////////////////////////////////////////////
879/// Build session frame.
880
882{
885 fViewer = gui;
886 Int_t i,j;
887
888 // main session tab
889 fTab = new TGTab(this, 200, 200);
891 kLHintsExpandY, 2, 2, 2, 2));
892
893 // add "Status" tab element
894 TGCompositeFrame *tf = fTab->AddTab("Status");
895 fFA = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
898
899 // add first session information line
900 fInfoLine[0] = new TGLabel(fFA, " ");
902 kLHintsExpandX, 5, 5, 15, 5));
903
904 TGCompositeFrame* frmInfos = new TGHorizontalFrame(fFA, 350, 100);
905 frmInfos->SetLayoutManager(new TGTableLayout(frmInfos, 9, 2));
906
907 // add session information lines
908 j = 0;
909 for (i=0;i<17;i+=2) {
910 fInfoLine[i+1] = new TGLabel(frmInfos, " ");
911 frmInfos->AddFrame(fInfoLine[i+1], new TGTableLayoutHints(0, 1, j, j+1,
912 kLHintsLeft | kLHintsCenterY, 5, 5, 2, 2));
913 fInfoLine[i+2] = new TGLabel(frmInfos, " ");
914 frmInfos->AddFrame(fInfoLine[i+2], new TGTableLayoutHints(1, 2, j, j+1,
915 kLHintsLeft | kLHintsCenterY, 5, 5, 2, 2));
916 j++;
917 }
919 kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5));
920
921 // add "new query" and "get queries" buttons
922 TGCompositeFrame* frmBut1 = new TGHorizontalFrame(fFA, 350, 100);
923 frmBut1->SetCleanup(kDeepCleanup);
924 frmBut1->AddFrame(fBtnNewQuery = new TGTextButton(frmBut1, "New Query..."),
925 new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5));
926 fBtnNewQuery->SetToolTipText("Open New Query Dialog");
927 frmBut1->AddFrame(fBtnGetQueries = new TGTextButton(frmBut1, " Get Queries "),
928 new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5));
929 fBtnGetQueries->SetToolTipText("Get List of Queries from the server");
930 fBtnShowLog = new TGTextButton(frmBut1, "Show log...");
931 fBtnShowLog->SetToolTipText("Show Session log (opens log window)");
933 kLHintsExpandX, 5, 5, 5, 5));
936
937 // add "Commands" tab element
938 tf = fTab->AddTab("Commands");
939 fFC = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
942
943 // add command line label and text entry
944 TGCompositeFrame* frmCmd = new TGHorizontalFrame(fFC, 350, 100);
945 frmCmd->SetCleanup(kDeepCleanup);
946 frmCmd->AddFrame(new TGLabel(frmCmd, "Command Line :"),
947 new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 5, 5, 15, 5));
948 fCommandBuf = new TGTextBuffer(120);
949 frmCmd->AddFrame(fCommandTxt = new TGTextEntry(frmCmd,
951 kLHintsExpandX, 5, 5, 15, 5));
952 fFC->AddFrame(frmCmd, new TGLayoutHints(kLHintsExpandX, 5, 5, 10, 5));
953 // connect command line text entry to "return pressed" signal
954 fCommandTxt->Connect("ReturnPressed()", "TSessionFrame", this,
955 "OnCommandLine()");
956
957 // check box for option "clear view"
958 fClearCheck = new TGCheckButton(fFC, "Clear view after each command");
960 10, 5, 5, 5));
962 // add text view for redirected output
963 fFC->AddFrame(new TGLabel(fFC, "Output :"),
964 new TGLayoutHints(kLHintsLeft | kLHintsTop, 10, 5, 5, 5));
965 fInfoTextView = new TGTextView(fFC, 330, 150, "", kSunkenFrame |
968 kLHintsTop | kLHintsExpandX | kLHintsExpandY, 10, 10, 5, 5));
969
970 // add "Packages" tab element
971 tf = fTab->AddTab("Packages");
972 fFB = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
975
976 // new frame containing packages listbox and control buttons
977 TGCompositeFrame* frmcanvas = new TGHorizontalFrame(fFB, 350, 100);
978
979 // packages listbox
980 fLBPackages = new TGListBox(frmcanvas);
981 fLBPackages->Resize(80,150);
984 kLHintsExpandY, 5, 5, 5, 5));
985 // control buttons frame
986 TGCompositeFrame* frmBut2 = new TGVerticalFrame(frmcanvas, 150, 100);
987
988 fChkMulti = new TGCheckButton(frmBut2, "Multiple Selection");
989 fChkMulti->SetToolTipText("Enable multiple selection in the package list");
990 frmBut2->AddFrame(fChkMulti, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
991
992 fBtnAdd = new TGTextButton(frmBut2, " Add... ");
993 fBtnAdd->SetToolTipText("Add a package to the list");
995 kLHintsExpandX, 5, 5, 5, 5));
996 fBtnRemove = new TGTextButton(frmBut2, "Remove");
997 fBtnRemove->SetToolTipText("Remove package from the list");
999 kLHintsExpandX, 5, 5, 5, 5));
1000 fBtnUp = new TGTextButton(frmBut2, "Move Up");
1001 fBtnUp->SetToolTipText("Move package one step upward in the list");
1003 kLHintsExpandX, 5, 5, 5, 5));
1004 fBtnDown = new TGTextButton(frmBut2, "Move Down");
1005 fBtnDown->SetToolTipText("Move package one step downward in the list");
1007 kLHintsExpandX, 5, 5, 5, 5));
1008 frmcanvas->AddFrame(frmBut2, new TGLayoutHints(kLHintsLeft | kLHintsCenterY |
1010 fFB->AddFrame(frmcanvas, new TGLayoutHints(kLHintsLeft | kLHintsTop |
1012
1013 TGCompositeFrame* frmLeg = new TGHorizontalFrame(fFB, 300, 100);
1014 frmLeg->SetCleanup(kDeepCleanup);
1015 TGPicture *pic1 = (TGPicture *)fClient->GetPicture("package.xpm");
1016 TGIcon *icn1 = new TGIcon(frmLeg, pic1, pic1->GetWidth(), pic1->GetHeight());
1017 frmLeg->AddFrame(icn1, new TGLayoutHints(kLHintsLeft | kLHintsTop,
1018 5, 5, 0, 5));
1019 frmLeg->AddFrame(new TGLabel(frmLeg, ": Local"),
1020 new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 10, 0, 5));
1021
1022 TGPicture *pic2 = (TGPicture *)fClient->GetPicture("package_delete.xpm");
1023 TGIcon *icn2 = new TGIcon(frmLeg, pic2, pic2->GetWidth(), pic2->GetHeight());
1024 frmLeg->AddFrame(icn2, new TGLayoutHints(kLHintsLeft | kLHintsTop,
1025 5, 5, 0, 5));
1026 frmLeg->AddFrame(new TGLabel(frmLeg, ": Uploaded"),
1027 new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 10, 0, 5));
1028
1029 TGPicture *pic3 = (TGPicture *)fClient->GetPicture("package_add.xpm");
1030 TGIcon *icn3 = new TGIcon(frmLeg, pic3, pic3->GetWidth(), pic3->GetHeight());
1031 frmLeg->AddFrame(icn3, new TGLayoutHints(kLHintsLeft | kLHintsTop,
1032 5, 5, 0, 5));
1033 frmLeg->AddFrame(new TGLabel(frmLeg, ": Enabled"),
1034 new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 10, 0, 5));
1036 kLHintsExpandX, 0, 0, 0, 0));
1037
1038 TGCompositeFrame* frmBtn = new TGHorizontalFrame(fFB, 300, 100);
1039 frmBtn->SetCleanup(kDeepCleanup);
1040 frmBtn->AddFrame(fBtnUpload = new TGTextButton(frmBtn,
1041 " Upload "), new TGLayoutHints(kLHintsLeft | kLHintsExpandX |
1042 kLHintsCenterY, 5, 5, 5, 5));
1043 fBtnUpload->SetToolTipText("Upload selected package(s) to the server");
1044 frmBtn->AddFrame(fBtnEnable = new TGTextButton(frmBtn,
1045 " Enable "), new TGLayoutHints(kLHintsLeft | kLHintsExpandX |
1046 kLHintsCenterY, 5, 5, 5, 5));
1047 fBtnEnable->SetToolTipText("Enable selected package(s) on the server");
1048 frmBtn->AddFrame(fBtnDisable = new TGTextButton(frmBtn,
1049 " Disable "), new TGLayoutHints(kLHintsLeft | kLHintsExpandX |
1050 kLHintsCenterY, 5, 5, 5, 5));
1051 fBtnDisable->SetToolTipText("Disable selected package(s) on the server");
1052 frmBtn->AddFrame(fBtnClear = new TGTextButton(frmBtn,
1053 " Clear "), new TGLayoutHints(kLHintsLeft | kLHintsExpandX |
1054 kLHintsCenterY, 5, 5, 5, 5));
1055 fBtnClear->SetToolTipText("Clear all packages on the server");
1056 fFB->AddFrame(frmBtn, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
1057
1059
1060 TGCompositeFrame* frmBtn3 = new TGHorizontalFrame(fFB, 300, 100);
1061 frmBtn3->SetCleanup(kDeepCleanup);
1062 fBtnShow = new TGTextButton(frmBtn3, "Show packages");
1063 fBtnShow->SetToolTipText("Show (list) available packages on the server");
1065 kLHintsExpandX, 5, 5, 5, 5));
1066 fBtnShowEnabled = new TGTextButton(frmBtn3, "Show Enabled");
1067 fBtnShowEnabled->SetToolTipText("Show (list) enabled packages on the server");
1069 kLHintsExpandX, 5, 5, 5, 5));
1070 fFB->AddFrame(frmBtn3, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
1071
1072 fChkEnable = new TGCheckButton(fFB, "Enable at session startup");
1073 fChkEnable->SetToolTipText("Enable packages on the server at startup time");
1074 fFB->AddFrame(fChkEnable, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
1075
1076 // add "DataSets" tab element
1077 tf = fTab->AddTab("DataSets");
1078 fFE = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
1081
1082 // new frame containing datasets treeview and control buttons
1083 TGCompositeFrame* frmdataset = new TGHorizontalFrame(fFE, 350, 100);
1084
1085 // datasets list tree
1086 fDSetView = new TGCanvas(frmdataset, 200, 200, kSunkenFrame | kDoubleBorder);
1088 5, 5, 5, 5));
1090 fDataSetTree->AddItem(0, "DataSets");
1091
1092 // control buttons frame
1093 TGCompositeFrame* frmBut3 = new TGVerticalFrame(frmdataset, 150, 100);
1094
1095 fBtnUploadDSet = new TGTextButton(frmBut3, " Upload... ");
1096 fBtnUploadDSet->SetToolTipText("Upload a dataset to the cluster");
1098 kLHintsExpandX, 5, 5, 5, 5));
1099 fBtnRemoveDSet = new TGTextButton(frmBut3, "Remove");
1100 fBtnRemoveDSet->SetToolTipText("Remove dataset from the cluster");
1102 kLHintsExpandX, 5, 5, 5, 5));
1103 fBtnVerifyDSet = new TGTextButton(frmBut3, "Verify");
1104 fBtnVerifyDSet->SetToolTipText("Verify dataset on the cluster");
1106 kLHintsExpandX, 5, 5, 5, 5));
1107 fBtnRefresh = new TGTextButton(frmBut3, "Refresh List");
1108 fBtnRefresh->SetToolTipText("Refresh List of DataSet/Files present on the cluster");
1110 kLHintsExpandX, 5, 5, 15, 5));
1111
1112 frmdataset->AddFrame(frmBut3, new TGLayoutHints(kLHintsLeft | kLHintsCenterY |
1113 kLHintsExpandY, 5, 5, 5, 0));
1114
1115 fFE->AddFrame(frmdataset, new TGLayoutHints(kLHintsLeft | kLHintsTop |
1117
1118 // add "Options" tab element
1119 tf = fTab->AddTab("Options");
1120 fFD = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
1123
1124 // add Log Level label and text entry
1125 TGCompositeFrame* frmLog = new TGHorizontalFrame(fFD, 310, 100, kFixedWidth);
1126 frmLog->SetCleanup(kDeepCleanup);
1127 frmLog->AddFrame(fApplyLogLevel = new TGTextButton(frmLog,
1128 " Apply "), new TGLayoutHints(kLHintsRight |
1129 kLHintsCenterY, 10, 5, 5, 5));
1130 fApplyLogLevel->SetToolTipText("Apply currently selected log level");
1134 kLHintsCenterY, 5, 5, 5, 5));
1135 frmLog->AddFrame(new TGLabel(frmLog, "Log Level :"),
1136 new TGLayoutHints(kLHintsRight | kLHintsCenterY, 5, 5, 5, 5));
1137 fFD->AddFrame(frmLog, new TGLayoutHints(kLHintsLeft, 5, 5, 15, 5));
1138
1139 // add Parallel Nodes label and text entry
1140 TGCompositeFrame* frmPar = new TGHorizontalFrame(fFD, 310, 100, kFixedWidth);
1141 frmPar->SetCleanup(kDeepCleanup);
1142 frmPar->AddFrame(fApplyParallel = new TGTextButton(frmPar,
1143 " Apply "), new TGLayoutHints(kLHintsRight |
1144 kLHintsCenterY, 10, 5, 5, 5));
1145 fApplyParallel->SetToolTipText("Apply currently selected parallel nodes");
1146 fTxtParallel = new TGTextEntry(frmPar);
1148 fTxtParallel->SetText("99999");
1151 kLHintsCenterY, 5, 5, 5, 5));
1152 frmPar->AddFrame(new TGLabel(frmPar, "Set Parallel Nodes :"),
1153 new TGLayoutHints(kLHintsRight | kLHintsCenterY, 5, 5, 5, 5));
1154 fFD->AddFrame(frmPar, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
1155
1156 // connect button actions to functions
1157 fBtnShowLog->Connect("Clicked()", "TSessionFrame", this,
1158 "OnBtnShowLogClicked()");
1159 fBtnNewQuery->Connect("Clicked()", "TSessionFrame", this,
1160 "OnBtnNewQueryClicked()");
1161 fBtnGetQueries->Connect("Clicked()", "TSessionFrame", this,
1162 "OnBtnGetQueriesClicked()");
1163
1164 fChkEnable->Connect("Toggled(Bool_t)", "TSessionFrame", this,
1165 "OnStartupEnable(Bool_t)");
1166 fChkMulti->Connect("Toggled(Bool_t)", "TSessionFrame", this,
1167 "OnMultipleSelection(Bool_t)");
1168 fBtnAdd->Connect("Clicked()", "TSessionFrame", this,
1169 "OnBtnAddClicked()");
1170 fBtnRemove->Connect("Clicked()", "TSessionFrame", this,
1171 "OnBtnRemoveClicked()");
1172 fBtnUp->Connect("Clicked()", "TSessionFrame", this,
1173 "OnBtnUpClicked()");
1174 fBtnDown->Connect("Clicked()", "TSessionFrame", this,
1175 "OnBtnDownClicked()");
1176 fApplyLogLevel->Connect("Clicked()", "TSessionFrame", this,
1177 "OnApplyLogLevel()");
1178 fApplyParallel->Connect("Clicked()", "TSessionFrame", this,
1179 "OnApplyParallel()");
1180 fBtnUpload->Connect("Clicked()", "TSessionFrame", this,
1181 "OnUploadPackages()");
1182 fBtnEnable->Connect("Clicked()", "TSessionFrame", this,
1183 "OnEnablePackages()");
1184 fBtnDisable->Connect("Clicked()", "TSessionFrame", this,
1185 "OnDisablePackages()");
1186 fBtnClear->Connect("Clicked()", "TSessionFrame", this,
1187 "OnClearPackages()");
1188 fBtnShowEnabled->Connect("Clicked()", "TSessionViewer", fViewer,
1189 "ShowEnabledPackages()");
1190 fBtnShow->Connect("Clicked()", "TSessionViewer", fViewer,
1191 "ShowPackages()");
1192
1193 fBtnUploadDSet->Connect("Clicked()", "TSessionFrame", this,
1194 "OnBtnUploadDSet()");
1195 fBtnRemoveDSet->Connect("Clicked()", "TSessionFrame", this,
1196 "OnBtnRemoveDSet()");
1197 fBtnVerifyDSet->Connect("Clicked()", "TSessionFrame", this,
1198 "OnBtnVerifyDSet()");
1199 fBtnRefresh->Connect("Clicked()", "TSessionFrame", this,
1200 "UpdateListOfDataSets()");
1201}
1202
1203////////////////////////////////////////////////////////////////////////////////
1204/// Display information on current session.
1205
1207{
1208 TString buf;
1209
1210 // if local session
1211 if (fViewer->GetActDesc()->fLocal) {
1212 buf.Form("*** Local Session on %s ***", gSystem->HostName());
1213 fInfoLine[0]->SetText(buf.Data());
1214 UserGroup_t *userGroup = gSystem->GetUserInfo();
1215 fInfoLine[1]->SetText("User :");
1216 if (userGroup) buf.Form("%s", userGroup->fRealName.Data());
1217 fInfoLine[2]->SetText(buf.Data());
1218 fInfoLine[3]->SetText("Working directory :");
1219 buf.Form("%s", gSystem->WorkingDirectory());
1220 fInfoLine[4]->SetText(buf.Data());
1221 fInfoLine[5]->SetText(" ");
1222 fInfoLine[6]->SetText(" ");
1223 fInfoLine[7]->SetText(" ");
1224 fInfoLine[8]->SetText(" ");
1225 fInfoLine[9]->SetText(" ");
1226 fInfoLine[10]->SetText(" ");
1227 fInfoLine[11]->SetText(" ");
1228 fInfoLine[12]->SetText(" ");
1229 fInfoLine[13]->SetText(" ");
1230 fInfoLine[14]->SetText(" ");
1231 fInfoLine[15]->SetText(" ");
1232 fInfoLine[16]->SetText(" ");
1233 fInfoLine[17]->SetText(" ");
1234 fInfoLine[18]->SetText(" ");
1235 if (userGroup) delete userGroup;
1236 Layout();
1238 return;
1239 }
1240 // return if not a valid Proof session
1241 if (!fViewer->GetActDesc()->fConnected ||
1243 !fViewer->GetActDesc()->fProof ||
1245 return;
1246
1247 if (!fViewer->GetActDesc()->fProof->IsMaster()) {
1249 buf.Form("*** Connected to %s (parallel mode, %d workers) ***",
1252 else
1253 buf.Form("*** Connected to %s (sequential mode) ***",
1255 fInfoLine[0]->SetText(buf.Data());
1256 fInfoLine[1]->SetText("Port number : ");
1257 buf.Form("%d", fViewer->GetActDesc()->fProof->GetPort());
1258 fInfoLine[2]->SetText(buf.Data());
1259 fInfoLine[3]->SetText("User : ");
1260 buf.Form("%s", fViewer->GetActDesc()->fProof->GetUser());
1261 fInfoLine[4]->SetText(buf.Data());
1262 fInfoLine[5]->SetText("Client protocol version : ");
1264 fInfoLine[6]->SetText(buf.Data());
1265 fInfoLine[7]->SetText("Remote protocol version : ");
1267 fInfoLine[8]->SetText(buf.Data());
1268 fInfoLine[9]->SetText("Log level : ");
1269 buf.Form("%d", fViewer->GetActDesc()->fProof->GetLogLevel());
1270 fInfoLine[10]->SetText(buf.Data());
1271 fInfoLine[11]->SetText("Session unique tag : ");
1272 buf.Form("%s", fViewer->GetActDesc()->fProof->IsValid() ?
1273 fViewer->GetActDesc()->fProof->GetSessionTag() : " ");
1274 fInfoLine[12]->SetText(buf.Data());
1275 fInfoLine[13]->SetText("Total MB's processed :");
1276 buf.Form("%.2f", float(fViewer->GetActDesc()->fProof->GetBytesRead())/(1024*1024));
1277 fInfoLine[14]->SetText(buf.Data());
1278 fInfoLine[15]->SetText("Total real time used (s) :");
1279 buf.Form("%.3f", fViewer->GetActDesc()->fProof->GetRealTime());
1280 fInfoLine[16]->SetText(buf.Data());
1281 fInfoLine[17]->SetText("Total CPU time used (s) :");
1282 buf.Form("%.3f", fViewer->GetActDesc()->fProof->GetCpuTime());
1283 fInfoLine[18]->SetText(buf.Data());
1284 }
1285 else {
1287 buf.Form("*** Master server %s (parallel mode, %d workers) ***",
1290 else
1291 buf.Form("*** Master server %s (sequential mode) ***",
1293 fInfoLine[0]->SetText(buf.Data());
1294 fInfoLine[1]->SetText("Port number : ");
1295 buf.Form("%d", fViewer->GetActDesc()->fProof->GetPort());
1296 fInfoLine[2]->SetText(buf.Data());
1297 fInfoLine[3]->SetText("User : ");
1298 buf.Form("%s", fViewer->GetActDesc()->fProof->GetUser());
1299 fInfoLine[4]->SetText(buf.Data());
1300 fInfoLine[5]->SetText("Protocol version : ");
1302 fInfoLine[6]->SetText(buf.Data());
1303 fInfoLine[7]->SetText("Image name : ");
1304 buf.Form("%s",fViewer->GetActDesc()->fProof->GetImage());
1305 fInfoLine[8]->SetText(buf.Data());
1306 fInfoLine[9]->SetText("Config directory : ");
1307 buf.Form("%s", fViewer->GetActDesc()->fProof->GetConfDir());
1308 fInfoLine[10]->SetText(buf.Data());
1309 fInfoLine[11]->SetText("Config file : ");
1310 buf.Form("%s", fViewer->GetActDesc()->fProof->GetConfFile());
1311 fInfoLine[12]->SetText(buf.Data());
1312 fInfoLine[13]->SetText("Total MB's processed :");
1313 buf.Form("%.2f", float(fViewer->GetActDesc()->fProof->GetBytesRead())/(1024*1024));
1314 fInfoLine[14]->SetText(buf.Data());
1315 fInfoLine[15]->SetText("Total real time used (s) :");
1316 buf.Form("%.3f", fViewer->GetActDesc()->fProof->GetRealTime());
1317 fInfoLine[16]->SetText(buf.Data());
1318 fInfoLine[17]->SetText("Total CPU time used (s) :");
1319 buf.Form("%.3f", fViewer->GetActDesc()->fProof->GetCpuTime());
1320 fInfoLine[18]->SetText(buf.Data());
1321 }
1322 Layout();
1324}
1325
1326////////////////////////////////////////////////////////////////////////////////
1327/// Open Upload Dataset dialog.
1328
1330{
1331 if (fViewer->IsBusy())
1332 return;
1333 if (fViewer->GetActDesc()->fLocal) return;
1334 new TUploadDataSetDlg(fViewer, 450, 360);
1335}
1336
1337////////////////////////////////////////////////////////////////////////////////
1338/// Update list of dataset present on the cluster.
1339
1341{
1342 TObjString *dsetname;
1343 TFileInfo *dsetfilename;
1344 // cleanup the list
1349
1350 const TGPicture *dseticon = fClient->GetPicture("rootdb_t.xpm");
1351 // ask for the list of datasets
1352
1353 // TODO: is now returning a TMap; viewer has to be adapted
1354 TList *dsetlist = 0; //fViewer->GetActDesc()->fProof->GetDataSets();
1355 // coverity[dead_error_condition]: to be changed for TMap usage
1356 if (dsetlist) {
1357 TGListTreeItem *dsetitem;
1359 TIter nextdset(dsetlist);
1360 while ((dsetname = (TObjString *)nextdset())) {
1362 // add the dataset in the tree
1364 dsetname->GetName(), dsetname);
1365 // ask for the list of files in the dataset
1366 TList *dsetfilelist = fViewer->GetActDesc()->fProof->GetDataSet(
1367 dsetname->GetName())->GetList();
1368 if(dsetfilelist) {
1369 TIter nextdsetfile(dsetfilelist);
1370 while ((dsetfilename = (TFileInfo *)nextdsetfile())) {
1371 if (! fDataSetTree->FindItemByObj(dsetitem, dsetfilename)) {
1372 // if not already in, add the file name in the tree
1373 fDataSetTree->AddItem(dsetitem,
1374 dsetfilename->GetFirstUrl()->GetUrl(),
1375 dsetfilename, dseticon, dseticon);
1376 }
1377 }
1378 // open the dataset item in order to show the files
1379 fDataSetTree->OpenItem(dsetitem);
1380 }
1381 }
1382 }
1383 }
1384 }
1385 // refresh list tree
1387}
1388
1389////////////////////////////////////////////////////////////////////////////////
1390/// Remove dataset from the list and from the cluster.
1391
1393{
1394 TGListTreeItem *item;
1395 TObjString *obj = 0;
1396 if (fViewer->GetActDesc()->fLocal) return;
1397
1398 item = fDataSetTree->GetSelected();
1399 if (!item) return;
1400 if (item->GetParent() == 0) return;
1401 if (item->GetParent() == fDataSetTree->GetFirstItem()) {
1402 // Dataset itself
1403 obj = (TObjString *)item->GetUserData();
1404 }
1405 else if (item->GetParent()->GetParent() == fDataSetTree->GetFirstItem()) {
1406 // One file of the dataset
1407 obj = (TObjString *)item->GetParent()->GetUserData();
1408 }
1409
1410 // if valid Proof session, set parallel slaves
1411 if (obj && fViewer->GetActDesc()->fProof &&
1415 }
1416}
1417
1418////////////////////////////////////////////////////////////////////////////////
1419/// Verify that the files in the selected dataset are present on the cluster.
1420
1422{
1423 TGListTreeItem *item;
1424 TObjString *obj = 0;
1425 if (fViewer->GetActDesc()->fLocal) return;
1426
1427 item = fDataSetTree->GetSelected();
1428 if (!item) return;
1429 if (item->GetParent() == 0) return;
1430 if (item->GetParent() == fDataSetTree->GetFirstItem()) {
1431 // Dataset itself
1432 obj = (TObjString *)item->GetUserData();
1433 }
1434 else if (item->GetParent()->GetParent() == fDataSetTree->GetFirstItem()) {
1435 // One file of the dataset
1436 obj = (TObjString *)item->GetParent()->GetUserData();
1437 }
1438
1439 // if valid Proof session, set parallel slaves
1440 if (obj && fViewer->GetActDesc()->fProof &&
1443 }
1444}
1445
1446////////////////////////////////////////////////////////////////////////////////
1447/// Apply selected log level on current session.
1448
1450{
1451 // if local session, do nothing
1452 if (fViewer->GetActDesc()->fLocal) return;
1453 // if valid Proof session, set log level
1454 if (fViewer->GetActDesc()->fProof &&
1458 }
1460}
1461
1462////////////////////////////////////////////////////////////////////////////////
1463/// Apply selected number of workers on current Proof session.
1464
1466{
1467 // if local session, do nothing
1468 if (fViewer->GetActDesc()->fLocal) return;
1469 // if valid Proof session, set parallel slaves
1470 if (fViewer->GetActDesc()->fProof &&
1472 Int_t nodes = atoi(fTxtParallel->GetText());
1474 }
1476}
1477
1478////////////////////////////////////////////////////////////////////////////////
1479/// Handle multiple selection check button.
1480
1482{
1484}
1485
1486////////////////////////////////////////////////////////////////////////////////
1487/// Handle multiple selection check button.
1488
1490{
1491 if (fViewer->GetActDesc())
1493}
1494
1495////////////////////////////////////////////////////////////////////////////////
1496/// Update list of packages.
1497
1499{
1500 TPackageDescription *package;
1501 const TGPicture *pict;
1504 while ((package = (TPackageDescription *)next())) {
1505 if (package->fEnabled)
1506 pict = fClient->GetPicture("package_add.xpm");
1507 else if (package->fUploaded)
1508 pict = fClient->GetPicture("package_delete.xpm");
1509 else
1510 pict = fClient->GetPicture("package.xpm");
1512 package->fId, package->fPathName, pict);
1514 }
1517}
1518
1519////////////////////////////////////////////////////////////////////////////////
1520/// Upload selected package(s) to the current session.
1521
1523{
1524 // if local session, do nothing
1525 if (fViewer->GetActDesc()->fLocal) return;
1526 // if valid Proof session, upload packages
1527 if (fViewer->GetActDesc()->fProof &&
1529 TObject *obj;
1530 TList selected;
1531 fLBPackages->GetSelectedEntries(&selected);
1532 TIter next(&selected);
1533 while ((obj = next())) {
1534 TString name = obj->GetTitle();
1535 if (fViewer->GetActDesc()->fProof->UploadPackage(name.Data()) != 0)
1536 Error("Submit", "Upload package failed");
1537 else {
1539 if (!o) continue;
1540 TPackageDescription *package =
1541 dynamic_cast<TPackageDescription *>(o);
1542 if (package) {
1543 package->fUploaded = kTRUE;
1544 ((TGIconLBEntry *)obj)->SetPicture(
1545 fClient->GetPicture("package_delete.xpm"));
1546 }
1547 }
1548 }
1550 }
1553}
1554
1555////////////////////////////////////////////////////////////////////////////////
1556/// Enable selected package(s) in the current session.
1557
1559{
1560 // if local session, do nothing
1561 if (fViewer->GetActDesc()->fLocal) return;
1562 // if valid Proof session, enable packages
1563 if (fViewer->GetActDesc()->fProof &&
1565 TObject *obj;
1566 TList selected;
1568 fLBPackages->GetSelectedEntries(&selected);
1569 TIter next(&selected);
1570 while ((obj = next())) {
1571 TString name = obj->GetTitle();
1573 if (!o) continue;
1574 TPackageDescription *package =
1575 dynamic_cast<TPackageDescription *>(o);
1576 if (package) {
1577 if (!package->fUploaded) {
1578 if (fViewer->GetActDesc()->fProof->UploadPackage(name.Data()) != 0)
1579 Error("Submit", "Upload package failed");
1580 else {
1581 package->fUploaded = kTRUE;
1582 ((TGIconLBEntry *)obj)->SetPicture(
1583 fClient->GetPicture("package_delete.xpm"));
1584 }
1585 }
1586 }
1587 if (fViewer->GetActDesc()->fProof->EnablePackage(name) != 0)
1588 Error("Submit", "Enable package failed");
1589 else {
1590 package->fEnabled = kTRUE;
1591 ((TGIconLBEntry *)obj)->SetPicture(fClient->GetPicture("package_add.xpm"));
1592 }
1593 }
1596 }
1599}
1600
1601////////////////////////////////////////////////////////////////////////////////
1602/// Disable selected package(s) in the current session.
1603
1605{
1606 // if local session, do nothing
1607 if (fViewer->GetActDesc()->fLocal) return;
1608 // if valid Proof session, disable (clear) packages
1609 if (fViewer->GetActDesc()->fProof &&
1611 TObject *obj;
1612 TList selected;
1613 fLBPackages->GetSelectedEntries(&selected);
1614 TIter next(&selected);
1615 while ((obj = next())) {
1616 TString name = obj->GetTitle();
1617 if (fViewer->GetActDesc()->fProof->ClearPackage(name) != 0)
1618 Error("Submit", "Clear package failed");
1619 else {
1621 if (!o) continue;
1622 TPackageDescription *package =
1623 dynamic_cast<TPackageDescription *>(o);
1624 if (package) {
1625 package->fEnabled = kFALSE;
1626 package->fUploaded = kFALSE;
1627 ((TGIconLBEntry *)obj)->SetPicture(fClient->GetPicture("package.xpm"));
1628 }
1629 }
1630 }
1632 }
1635}
1636
1637////////////////////////////////////////////////////////////////////////////////
1638/// Clear (disable) all packages in the current session.
1639
1641{
1642 TPackageDescription *package;
1643 // if local session, do nothing
1644 if (fViewer->GetActDesc()->fLocal) return;
1645 // if valid Proof session, clear packages
1646 if (fViewer->GetActDesc()->fProof &&
1648 if (fViewer->GetActDesc()->fProof->ClearPackages() != 0)
1649 Error("Submit", "Clear packages failed");
1650 else {
1652 while ((package = (TPackageDescription *)next())) {
1653 package->fEnabled = kFALSE;
1654 }
1655 }
1656 }
1659}
1660
1661////////////////////////////////////////////////////////////////////////////////
1662/// Open file dialog and add selected package file to the list.
1663
1665{
1666 if (fViewer->IsBusy())
1667 return;
1668 TGFileInfo fi;
1669 TPackageDescription *package;
1670 TGIconLBEntry *entry;
1671 fi.fFileTypes = pkgtypes;
1673 if (fi.fMultipleSelection && fi.fFileNamesList) {
1674 TObjString *el;
1675 TIter next(fi.fFileNamesList);
1676 while ((el = (TObjString *) next())) {
1677 package = new TPackageDescription;
1678 package->fName = gSystem->BaseName(gSystem->UnixPathName(el->GetString()));
1679 package->fPathName = gSystem->UnixPathName(el->GetString());
1680 package->fId = fViewer->GetActDesc()->fPackages->GetEntries();
1681 package->fUploaded = kFALSE;
1682 package->fEnabled = kFALSE;
1683 fViewer->GetActDesc()->fPackages->Add((TObject *)package);
1684 entry = new TGIconLBEntry(fLBPackages->GetContainer(),
1685 package->fId, package->fPathName,
1686 fClient->GetPicture("package.xpm"));
1687 fLBPackages->AddEntry(entry, new TGLayoutHints(kLHintsExpandX | kLHintsTop));
1688 }
1689 }
1690 else if (fi.fFilename) {
1691 package = new TPackageDescription;
1693 package->fPathName = gSystem->UnixPathName(fi.fFilename);
1694 package->fId = fViewer->GetActDesc()->fPackages->GetEntries();
1695 package->fUploaded = kFALSE;
1696 package->fEnabled = kFALSE;
1697 fViewer->GetActDesc()->fPackages->Add((TObject *)package);
1698 entry = new TGIconLBEntry(fLBPackages->GetContainer(),
1699 package->fId, package->fPathName,
1700 fClient->GetPicture("package.xpm"));
1701 fLBPackages->AddEntry(entry, new TGLayoutHints(kLHintsExpandX | kLHintsTop));
1702 }
1705}
1706
1707////////////////////////////////////////////////////////////////////////////////
1708/// Remove selected package from the list.
1709
1711{
1712 TPackageDescription *package;
1713 const TGPicture *pict;
1714 Int_t pos = fLBPackages->GetSelected();
1717 fViewer->GetActDesc()->fPackages->At(pos));
1718 Int_t id = 0;
1720 while ((package = (TPackageDescription *)next())) {
1721 package->fId = id;
1722 id++;
1723 if (package->fEnabled)
1724 pict = fClient->GetPicture("package_add.xpm");
1725 else if (package->fUploaded)
1726 pict = fClient->GetPicture("package_delete.xpm");
1727 else
1728 pict = fClient->GetPicture("package.xpm");
1730 package->fId, package->fPathName, pict);
1732 }
1735}
1736
1737////////////////////////////////////////////////////////////////////////////////
1738/// Move selected package entry one position up in the list.
1739
1741{
1742 TPackageDescription *package;
1743 const TGPicture *pict;
1744 Int_t pos = fLBPackages->GetSelected();
1745 if (pos <= 0) return;
1747 package = (TPackageDescription *)fViewer->GetActDesc()->fPackages->At(pos);
1748 fViewer->GetActDesc()->fPackages->Remove(
1749 fViewer->GetActDesc()->fPackages->At(pos));
1750 package->fId -= 1;
1751 fViewer->GetActDesc()->fPackages->AddAt(package, package->fId);
1752 Int_t id = 0;
1753 TIter next(fViewer->GetActDesc()->fPackages);
1754 while ((package = (TPackageDescription *)next())) {
1755 package->fId = id;
1756 id++;
1757 if (package->fEnabled)
1758 pict = fClient->GetPicture("package_add.xpm");
1759 else if (package->fUploaded)
1760 pict = fClient->GetPicture("package_delete.xpm");
1761 else
1762 pict = fClient->GetPicture("package.xpm");
1763 TGIconLBEntry *entry = new TGIconLBEntry(fLBPackages->GetContainer(),
1764 package->fId, package->fPathName, pict);
1765 fLBPackages->AddEntry(entry, new TGLayoutHints(kLHintsExpandX | kLHintsTop));
1766 }
1767 fLBPackages->Select(pos-1);
1768 fLBPackages->Layout();
1769 fClient->NeedRedraw(fLBPackages->GetContainer());
1770}
1771
1772////////////////////////////////////////////////////////////////////////////////
1773/// Move selected package entry one position down in the list.
1774
1776{
1777 TPackageDescription *package;
1778 const TGPicture *pict;
1779 Int_t pos = fLBPackages->GetSelected();
1780 if (pos == -1 || pos == fViewer->GetActDesc()->fPackages->GetEntries()-1)
1781 return;
1783 package = (TPackageDescription *)fViewer->GetActDesc()->fPackages->At(pos);
1784 fViewer->GetActDesc()->fPackages->Remove(
1785 fViewer->GetActDesc()->fPackages->At(pos));
1786 package->fId += 1;
1787 fViewer->GetActDesc()->fPackages->AddAt(package, package->fId);
1788 Int_t id = 0;
1789 TIter next(fViewer->GetActDesc()->fPackages);
1790 while ((package = (TPackageDescription *)next())) {
1791 package->fId = id;
1792 id++;
1793 if (package->fEnabled)
1794 pict = fClient->GetPicture("package_add.xpm");
1795 else if (package->fUploaded)
1796 pict = fClient->GetPicture("package_delete.xpm");
1797 else
1798 pict = fClient->GetPicture("package.xpm");
1799 TGIconLBEntry *entry = new TGIconLBEntry(fLBPackages->GetContainer(),
1800 package->fId, package->fPathName, pict);
1801 fLBPackages->AddEntry(entry, new TGLayoutHints(kLHintsExpandX | kLHintsTop));
1802 }
1803 fLBPackages->Select(pos+1);
1804 fLBPackages->Layout();
1805 fClient->NeedRedraw(fLBPackages->GetContainer());
1806}
1807
1808////////////////////////////////////////////////////////////////////////////////
1809/// Disconnect from current Proof session.
1810
1812{
1813 // if local session, do nothing
1814 if (fViewer->GetActDesc()->fLocal) return;
1815 // if valid Proof session, disconnect (close)
1816 if (fViewer->GetActDesc()->fAttached &&
1820 }
1821 // reset connected flag
1823 fViewer->GetActDesc()->fProof = 0;
1824 // disable animation timer
1826 // change list tree item picture to disconnected pixmap
1829 if (item) {
1832 }
1833 // update viewer
1835 1, 0, 0);
1838 fViewer->GetStatusBar()->SetText("", 1);
1839}
1840
1841////////////////////////////////////////////////////////////////////////////////
1842/// Show session log.
1843
1845{
1846 fViewer->ShowLog(0);
1847}
1848
1849////////////////////////////////////////////////////////////////////////////////
1850/// Call "New Query" Dialog.
1851
1853{
1854 TNewQueryDlg *dlg = new TNewQueryDlg(fViewer, 350, 310);
1855 dlg->Popup();
1856}
1857
1858////////////////////////////////////////////////////////////////////////////////
1859/// Get list of queries from current Proof server and populate the list tree.
1860
1862{
1863 TList *lqueries = 0;
1864 TQueryResult *query = 0;
1865 TQueryDescription *newquery = 0, *lquery = 0;
1866 if (fViewer->GetActDesc()->fProof &&
1868 lqueries = fViewer->GetActDesc()->fProof->GetListOfQueries();
1869 }
1870 if (lqueries) {
1871 TIter nextp(lqueries);
1872 // loop over list of queries received from Proof server
1873 while ((query = (TQueryResult *)nextp())) {
1874 // create new query description
1875 newquery = new TQueryDescription();
1876 newquery->fReference = TString::Format("%s:%s", query->GetTitle(),
1877 query->GetName());
1878 // check in our tree if it is already there
1879 TGListTreeItem *item =
1882 // if already there, skip
1884 newquery->fReference.Data()))
1885 continue;
1886 // check also in our query description list
1887 Bool_t found = kFALSE;
1888 TIter nextp2(fViewer->GetActDesc()->fQueries);
1889 while ((lquery = (TQueryDescription *)nextp2())) {
1890 if (lquery->fReference.CompareTo(newquery->fReference) == 0) {
1891 found = kTRUE;
1892 break;
1893 }
1894 }
1895 if (found) continue;
1896 // build new query description with infos from Proof
1897 newquery->fStatus = query->IsFinalized() ?
1900 newquery->fSelectorString = query->GetSelecImp()->GetName();
1901 newquery->fQueryName = TString::Format("%s:%s", query->GetTitle(),
1902 query->GetName());
1903 newquery->fOptions = query->GetOptions();
1904 newquery->fEventList = "";
1905 newquery->fNbFiles = 0;
1906 newquery->fNoEntries = query->GetEntries();
1907 newquery->fFirstEntry = query->GetFirst();
1908 newquery->fResult = query;
1909 newquery->fChain = 0;
1910 fViewer->GetActDesc()->fQueries->Add((TObject *)newquery);
1912 newquery->fQueryName, fViewer->GetQueryConPict(),
1914 item2->SetUserData(newquery);
1915 if (query->GetInputList())
1916 fViewer->GetSessionHierarchy()->AddItem(item2, "InputList");
1917 if (query->GetOutputList())
1918 fViewer->GetSessionHierarchy()->AddItem(item2, "OutputList");
1919 }
1920 }
1921 // at the end, update list tree
1924}
1925
1926////////////////////////////////////////////////////////////////////////////////
1927/// Command line handling.
1928
1930{
1931 // get command string
1932 const char *cmd = fCommandTxt->GetText();
1933 char opt[2];
1934 // form temporary file path
1935 TString pathtmp = TString::Format("%s/%s", gSystem->TempDirectory(),
1937 // if check box "clear view" is checked, open temp file in write mode
1938 // (overwrite), in append mode otherwise.
1939 if (fClearCheck->IsOn())
1940 snprintf(opt, 2, "w");
1941 else
1942 snprintf(opt, 2, "a");
1943
1944 // if valid Proof session, pass the command to Proof
1945 if (fViewer->GetActDesc()->fProof &&
1947 // redirect stdout/stderr to temp file
1948 if (gSystem->RedirectOutput(pathtmp.Data(), opt) != 0) {
1949 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
1950 return;
1951 }
1952 // execute command line
1953 fViewer->GetActDesc()->fProof->Exec(cmd);
1954 // restore back stdout/stderr
1955 if (gSystem->RedirectOutput(0) != 0) {
1956 Error("ShowStatus", "stdout/stderr retore failed; skipping");
1957 return;
1958 }
1959 // if check box "clear view" is checked, clear text view
1960 if (fClearCheck->IsOn())
1962 // load (display) temp file in text view
1963 fInfoTextView->LoadFile(pathtmp.Data());
1964 // set focus to "command line" text entry
1966 }
1967 else {
1968 // if no Proof session, or Proof session not valid,
1969 // lets execute command line by TApplication
1970
1971 // redirect stdout/stderr to temp file
1972 if (gSystem->RedirectOutput(pathtmp.Data(), opt) != 0) {
1973 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
1974 }
1975 // execute command line
1977 // restore back stdout/stderr
1978 if (gSystem->RedirectOutput(0) != 0) {
1979 Error("ShowStatus", "stdout/stderr retore failed; skipping");
1980 }
1981 // if check box "clear view" is checked, clear text view
1982 if (fClearCheck->IsOn())
1984 // load (display) temp file in text view
1985 fInfoTextView->LoadFile(pathtmp.Data());
1986 // set focus to "command line" text entry
1988 }
1989 // display bottom of text view
1991}
1992
1993////////////////////////////////////////////////////////////////////////////////
1994/// Switch widgets status/visibility for local/remote sessions.
1995
1997{
1998 if (local) {
2001 fTab->HideFrame(fTab->GetTabTab("Options"));
2002 fTab->HideFrame(fTab->GetTabTab("Packages"));
2003 fTab->HideFrame(fTab->GetTabTab("DataSets"));
2004 }
2005 else {
2008 fTab->ShowFrame(fTab->GetTabTab("Options"));
2009 fTab->ShowFrame(fTab->GetTabTab("Packages"));
2010 fTab->ShowFrame(fTab->GetTabTab("DataSets"));
2011 }
2012}
2013
2014////////////////////////////////////////////////////////////////////////////////
2015/// Shutdown current session.
2016
2018{
2019 // do nothing if connection in progress
2020 if (fViewer->IsBusy())
2021 return;
2022
2023 if (fViewer->GetActDesc()->fLocal) {
2024 Int_t retval;
2025 new TGMsgBox(fClient->GetRoot(), this, "Error Shutting down Session",
2026 "Shutting down Local Sessions is not allowed !",
2027 kMBIconExclamation,kMBOk,&retval);
2028 return;
2029 }
2030 if (!fViewer->GetActDesc()->fAttached ||
2031 !fViewer->GetActDesc()->fProof ||
2033 return;
2034 // ask for confirmation
2035 TString m;
2036 m.Form("Are you sure to shutdown the session \"%s\"",
2038 Int_t result;
2039 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), 0,
2040 kMBOk | kMBCancel, &result);
2041 // if confirmed, delete it
2042 if (result != kMBOk)
2043 return;
2044 // remove the Proof session from gROOT list of Proofs
2045 fViewer->GetActDesc()->fProof->Detach("S");
2046 // reset connected flag
2048 fViewer->GetActDesc()->fProof = 0;
2049 // disable animation timer
2051 // change list tree item picture to disconnected pixmap
2054 if (item) {
2057 }
2058 // update viewer
2060 1, 0, 0);
2063 fViewer->GetStatusBar()->SetText("", 1);
2064}
2065
2066//////////////////////////////////////////////////////////////////////////
2067// Edit Query Frame
2068//////////////////////////////////////////////////////////////////////////
2069
2070////////////////////////////////////////////////////////////////////////////////
2071/// Create a new Query dialog, used by the Session Viewer, to Edit a Query if
2072/// the editmode flag is set, or to create a new one if not set.
2073
2075 TGCompositeFrame(p, w, h, kVerticalFrame), fFrmMore(0), fBtnMore(0),
2076 fTxtQueryName(0), fTxtChain(0), fTxtSelector(0), fTxtOptions(0),
2077 fNumEntries(0), fNumFirstEntry(0), fTxtParFile(0), fTxtEventList(0),
2078 fViewer(0), fQuery(0), fChain(0)
2079{
2080}
2081
2082////////////////////////////////////////////////////////////////////////////////
2083/// Delete query dialog.
2084
2086{
2087 Cleanup();
2088}
2089
2090////////////////////////////////////////////////////////////////////////////////
2091/// Build the "new query" dialog.
2092
2094{
2095 TGButton *btnTmp;
2096 fViewer = gui;
2098 SetLayoutManager(new TGTableLayout(this, 6, 5));
2099
2100 // add "Query Name" label and text entry
2101 AddFrame(new TGLabel(this, "Query Name :"),
2102 new TGTableLayoutHints(0, 1, 0, 1, kLHintsCenterY, 5, 5, 4, 0));
2104 (const char *)0, 1), new TGTableLayoutHints(1, 2, 0, 1,
2105 kLHintsCenterY, 5, 5, 4, 0));
2106
2107 // add "TChain" label and text entry
2108 AddFrame(new TGLabel(this, "TChain :"),
2109 new TGTableLayoutHints(0, 1, 1, 2, kLHintsCenterY, 5, 5, 4, 0));
2110 AddFrame(fTxtChain = new TGTextEntry(this,
2111 (const char *)0, 2), new TGTableLayoutHints(1, 2, 1, 2,
2112 kLHintsCenterY, 5, 5, 4, 0));
2113 fTxtChain->SetToolTipText("Specify TChain or TDSet from memory or file");
2115 // add "Browse" button
2116 AddFrame(btnTmp = new TGTextButton(this, "Browse..."),
2117 new TGTableLayoutHints(2, 3, 1, 2, kLHintsCenterY, 5, 0, 4, 8));
2118 btnTmp->Connect("Clicked()", "TEditQueryFrame", this, "OnBrowseChain()");
2119
2120 // add "Selector" label and text entry
2121 AddFrame(new TGLabel(this, "Selector :"),
2122 new TGTableLayoutHints(0, 1, 2, 3, kLHintsCenterY, 5, 5, 0, 0));
2124 (const char *)0, 3), new TGTableLayoutHints(1, 2, 2, 3,
2125 kLHintsCenterY, 5, 5, 0, 0));
2126 // add "Browse" button
2127 AddFrame(btnTmp = new TGTextButton(this, "Browse..."),
2128 new TGTableLayoutHints(2, 3, 2, 3, kLHintsCenterY, 5, 0, 0, 8));
2129 btnTmp->Connect("Clicked()", "TEditQueryFrame", this, "OnBrowseSelector()");
2130
2131 // add "Less <<" ("More >>") button
2132 AddFrame(fBtnMore = new TGTextButton(this, " Less << "),
2133 new TGTableLayoutHints(2, 3, 4, 5, kLHintsCenterY, 5, 5, 4, 0));
2134 fBtnMore->Connect("Clicked()", "TEditQueryFrame", this, "OnNewQueryMore()");
2135
2136 // add (initially hidden) options frame
2137 fFrmMore = new TGCompositeFrame(this, 200, 200);
2139
2140 AddFrame(fFrmMore, new TGTableLayoutHints(0, 3, 5, 6,
2143
2144 // add "Options" label and text entry
2145 fFrmMore->AddFrame(new TGLabel(fFrmMore, "Options :"),
2146 new TGTableLayoutHints(0, 1, 0, 1, kLHintsCenterY, 5, 5, 0, 0));
2148 (const char *)0, 4), new TGTableLayoutHints(1, 2, 0, 1, 0, 17,
2149 0, 0, 8));
2150 //fTxtOptions->SetText("ASYN");
2151 fTxtOptions->SetText("");
2152
2153 // add "Nb Entries" label and number entry
2154 fFrmMore->AddFrame(new TGLabel(fFrmMore, "Nb Entries :"),
2155 new TGTableLayoutHints(0, 1, 1, 2, kLHintsCenterY, 5, 5, 0, 0));
2159 0, 17, 0, 0, 8));
2160 // coverity[negative_returns]: no problem with -1, the format is kNESInteger
2162 // add "First Entry" label and number entry
2163 fFrmMore->AddFrame(new TGLabel(fFrmMore, "First entry :"),
2164 new TGTableLayoutHints(0, 1, 2, 3, kLHintsCenterY, 5, 5, 0, 0));
2168 17, 0, 0, 8));
2169
2170 // add "Event list" label and text entry
2171 fFrmMore->AddFrame(new TGLabel(fFrmMore, "Event list :"),
2172 new TGTableLayoutHints(0, 1, 3, 4, kLHintsCenterY, 5, 5, 0, 0));
2174 (const char *)0, 6), new TGTableLayoutHints(1, 2, 3, 4, 0, 17,
2175 5, 0, 0));
2176 // add "Browse" button
2177 fFrmMore->AddFrame(btnTmp = new TGTextButton(fFrmMore, "Browse..."),
2178 new TGTableLayoutHints(2, 3, 3, 4, 0, 6, 0, 0, 8));
2179 btnTmp->Connect("Clicked()", "TEditQueryFrame", this, "OnBrowseEventList()");
2180
2181 fTxtQueryName->Associate(this);
2182 fTxtChain->Associate(this);
2183 fTxtSelector->Associate(this);
2184 fTxtOptions->Associate(this);
2185 fNumEntries->Associate(this);
2187 fTxtEventList->Associate(this);
2188
2189 fTxtQueryName->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2190 "SettingsChanged()");
2191 fTxtChain->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2192 "SettingsChanged()");
2193 fTxtSelector->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2194 "SettingsChanged()");
2195 fTxtOptions->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2196 "SettingsChanged()");
2197 fNumEntries->Connect("ValueChanged(Long_t)", "TEditQueryFrame", this,
2198 "SettingsChanged()");
2199 fNumFirstEntry->Connect("ValueChanged(Long_t)", "TEditQueryFrame", this,
2200 "SettingsChanged()");
2201 fTxtEventList->Connect("TextChanged(char*)", "TEditQueryFrame", this,
2202 "SettingsChanged()");
2203}
2204
2205////////////////////////////////////////////////////////////////////////////////
2206/// Show/hide options frame and update button text accordingly.
2207
2209{
2210 if (IsVisible(fFrmMore)) {
2212 fBtnMore->SetText(" More >> ");
2213 }
2214 else {
2216 fBtnMore->SetText(" Less << ");
2217 }
2218}
2219
2220////////////////////////////////////////////////////////////////////////////////
2221/// Call new chain dialog.
2222
2224{
2225 TNewChainDlg *dlg = new TNewChainDlg(fClient->GetRoot(), this);
2226 dlg->Connect("OnElementSelected(TObject *)", "TEditQueryFrame",
2227 this, "OnElementSelected(TObject *)");
2228}
2229
2230////////////////////////////////////////////////////////////////////////////////
2231/// Handle OnElementSelected signal coming from new chain dialog.
2232
2234{
2235 if (obj) {
2236 fChain = obj;
2237 if (obj->IsA() == TChain::Class())
2239 else if (obj->IsA() == TDSet::Class())
2240 fTxtChain->SetText(((TDSet *)fChain)->GetObjName());
2241 }
2242}
2243
2244////////////////////////////////////////////////////////////////////////////////
2245/// Open file browser to choose selector macro.
2246
2248{
2249 TGFileInfo fi;
2251 new TGFileDialog(fClient->GetRoot(), this, kFDOpen, &fi);
2252 if (!fi.fFilename) return;
2254}
2255
2256////////////////////////////////////////////////////////////////////////////////
2257///Browse event list
2258
2260{
2261}
2262
2263////////////////////////////////////////////////////////////////////////////////
2264/// Save current settings in main session viewer.
2265
2267{
2268 // if we are in edition mode and query description is valid,
2269 // use it, otherwise create a new one
2270 TQueryDescription *newquery;
2271 if (fQuery)
2272 newquery = fQuery;
2273 else
2274 newquery = new TQueryDescription();
2275
2276 // update query description fields
2277 newquery->fSelectorString = fTxtSelector->GetText();
2278 if (fChain) {
2279 newquery->fTDSetString = fChain->GetName();
2280 newquery->fChain = fChain;
2281 }
2282 else {
2283 newquery->fTDSetString = "";
2284 newquery->fChain = 0;
2285 }
2286 newquery->fQueryName = fTxtQueryName->GetText();
2287 newquery->fOptions = fTxtOptions->GetText();
2288 newquery->fNoEntries = fNumEntries->GetIntNumber();
2290 newquery->fNbFiles = 0;
2291 newquery->fResult = 0;
2292
2293 if (newquery->fChain) {
2294 if (newquery->fChain->IsA() == TChain::Class())
2295 newquery->fNbFiles = ((TChain *)newquery->fChain)->GetListOfFiles()->GetEntriesFast();
2296 else if (newquery->fChain->IsA() == TDSet::Class())
2297 newquery->fNbFiles = ((TDSet *)newquery->fChain)->GetListOfElements()->GetSize();
2298 }
2299 // update user data with modified query description
2301 fViewer->GetSessionHierarchy()->RenameItem(item, newquery->fQueryName);
2302 item->SetUserData(newquery);
2303 // update list tree
2310 if (fViewer->GetActDesc()->fLocal ||
2314 fViewer->GetActDesc()->fProof->IsValid())) {
2315 fViewer->GetQueryFrame()->GetTab()->SetTab("Status");
2317 }
2318}
2319
2320////////////////////////////////////////////////////////////////////////////////
2321/// Settings have changed, update GUI accordingly.
2322
2324{
2325 if (fQuery) {
2326 if ((strcmp(fQuery->fSelectorString.Data(), fTxtSelector->GetText())) ||
2327 (strcmp(fQuery->fQueryName.Data(), fTxtQueryName->GetText())) ||
2328 (strcmp(fQuery->fOptions.Data(), fTxtOptions->GetText())) ||
2331 (fQuery->fChain != fChain)) {
2333 }
2334 else {
2336 }
2337 }
2338 else {
2339 if ((fTxtQueryName->GetText()) &&
2340 ((fTxtQueryName->GetText()) ||
2341 (fTxtChain->GetText())))
2343 else
2345 }
2346}
2347
2348////////////////////////////////////////////////////////////////////////////////
2349/// Update entry fields with query description values.
2350
2352{
2353 fChain = 0;
2354 fQuery = desc;
2355 fTxtChain->SetText("");
2356 if (desc->fChain) {
2357 fChain = desc->fChain;
2359 }
2366}
2367
2368////////////////////////////////////////////////////////////////////////////////
2369// Query Frame
2370
2371////////////////////////////////////////////////////////////////////////////////
2372/// Constructor
2373
2375 TGCompositeFrame(p, w, h), fBtnSubmit(0), fBtnFinalize(0), fBtnStop(0),
2376 fBtnAbort(0), fBtnShowLog(0), fBtnRetrieve(0), fBtnSave(0), fInfoTextView(0),
2377 fModified(0), fFiles(0), fFirst(0), fEntries(0), fPrevTotal(0),
2378 fPrevProcessed(0), fLabInfos(0), fLabStatus(0), fTotal(0), fRate(0),
2379 fStatus(kStopped), fTab(0), fFA(0), fFB(0), fFC(0), fFD(0), frmProg(0),
2380 fECanvas(0), fStatsCanvas(0), fViewer(0), fDesc(0)
2381{
2382}
2383
2384////////////////////////////////////////////////////////////////////////////////
2385/// Destructor.
2386
2388{
2389 Cleanup();
2390}
2391
2392////////////////////////////////////////////////////////////////////////////////
2393/// Build query information frame.
2394
2396{
2399 fFirst = fEntries = fPrevTotal = 0;
2400 fPrevProcessed = 0;
2401 fViewer = gui;
2402 fModified = kFALSE;
2403
2404 // main query tab
2405 fTab = new TGTab(this, 200, 200);
2407 kLHintsExpandY, 2, 2, 2, 2));
2408
2409 // add "Status" tab element
2410 TGCompositeFrame *tf = fTab->AddTab("Status");
2411 fFB = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
2414
2415 // new frame containing control buttons and feedback histos canvas
2416 TGCompositeFrame* frmcanvas = new TGHorizontalFrame(fFB, 350, 100);
2417 // control buttons frame
2418 TGCompositeFrame* frmBut2 = new TGVerticalFrame(frmcanvas, 150, 100);
2419 fBtnSubmit = new TGTextButton(frmBut2, " Submit ");
2420 fBtnSubmit->SetToolTipText("Submit (process) selected query");
2422 kLHintsExpandX, 5, 5, 5, 5));
2423 fBtnStop = new TGTextButton(frmBut2, "Stop");
2424 fBtnStop->SetToolTipText("Stop processing query");
2426 kLHintsExpandX, 5, 5, 5, 5));
2427 fBtnAbort = new TGTextButton(frmBut2, "Abort");
2428 fBtnAbort->SetToolTipText("Abort processing query");
2430 kLHintsExpandX, 5, 5, 5, 5));
2431 frmcanvas->AddFrame(frmBut2, new TGLayoutHints(kLHintsLeft | kLHintsCenterY |
2433 // feedback histos embedded canvas
2434 fECanvas = new TRootEmbeddedCanvas("fECanvas", frmcanvas, 400, 150);
2439 4, 4, 4, 4));
2440 fFB->AddFrame(frmcanvas, new TGLayoutHints(kLHintsLeft | kLHintsTop |
2442
2443 // progress infos label
2444 fLabInfos = new TGLabel(fFB, " ");
2445 fFB->AddFrame(fLabInfos, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
2446 // progress status label
2447 fLabStatus = new TGLabel(fFB, " ");
2448 fFB->AddFrame(fLabStatus, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
2449
2450 //progress bar
2453 frmProg->SetBarColor("green");
2454 fFB->AddFrame(frmProg, new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5));
2455 // total progress infos
2456 fFB->AddFrame(fTotal = new TGLabel(fFB,
2457 " Estimated time left : 0 sec (--- events of --- processed) "),
2458 new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
2459 // progress rate infos
2460 fFB->AddFrame(fRate = new TGLabel(fFB,
2461 " Processing Rate : -- events/sec "),
2462 new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
2463
2464 // add "Results" tab element
2465 tf = fTab->AddTab("Results");
2466 fFC = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
2469 // query result (header) information text view
2470 fInfoTextView = new TGTextView(fFC, 330, 185, "", kSunkenFrame |
2473 kLHintsExpandY | kLHintsExpandX, 5, 5, 10, 10));
2474
2475 // add "Retrieve", "Finalize" and "Show Log" buttons
2476 TGCompositeFrame* frmBut3 = new TGHorizontalFrame(fFC, 350, 100);
2477 fBtnRetrieve = new TGTextButton(frmBut3, "Retrieve");
2478 fBtnRetrieve->SetToolTipText("Retrieve query results");
2480 kLHintsExpandX, 5, 5, 10, 10));
2481 fBtnFinalize = new TGTextButton(frmBut3, "Finalize");
2482 fBtnFinalize->SetToolTipText("Finalize query");
2484 kLHintsExpandX, 5, 5, 10, 10));
2485 fBtnShowLog = new TGTextButton(frmBut3, "Show Log");
2486 fBtnShowLog->SetToolTipText("Show query log (open log window)");
2488 kLHintsExpandX, 5, 5, 10, 10));
2490
2491 // add "Results" tab element
2492 tf = fTab->AddTab("Edit Query");
2493 fFD = new TEditQueryFrame(tf, 100, 100);
2494 fFD->Build(fViewer);
2495 tf->AddFrame(fFD, new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 10, 0));
2496 TString btntxt;
2497 if (fViewer->GetActDesc()->fLocal ||
2498 (fViewer->GetActDesc()->fProof &&
2499 fViewer->GetActDesc()->fProof->IsValid())) {
2500 btntxt = " Submit ";
2501 }
2502 else {
2503 btntxt = " Apply changes ";
2504 }
2505 tf->AddFrame(fBtnSave = new TGTextButton(tf, btntxt),
2506 new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 5, 25, 5));
2507
2508 // connect button actions to functions
2509 fBtnSave->Connect("Clicked()", "TEditQueryFrame", fFD,
2510 "OnBtnSave()");
2511 fBtnSubmit->Connect("Clicked()", "TSessionQueryFrame", this,
2512 "OnBtnSubmit()");
2513 fBtnFinalize->Connect("Clicked()", "TSessionQueryFrame", this,
2514 "OnBtnFinalize()");
2515 fBtnStop->Connect("Clicked()", "TSessionQueryFrame", this,
2516 "OnBtnStop()");
2517 fBtnAbort->Connect("Clicked()", "TSessionQueryFrame", this,
2518 "OnBtnAbort()");
2519 fBtnShowLog->Connect("Clicked()", "TSessionQueryFrame", this,
2520 "OnBtnShowLog()");
2521 fBtnRetrieve->Connect("Clicked()", "TSessionQueryFrame", this,
2522 "OnBtnRetrieve()");
2523// fBtnSave->SetState(kButtonDisabled);
2524 Resize(350, 310);
2525}
2526
2527////////////////////////////////////////////////////////////////////////////////
2528/// Notify changes in query editor settings.
2529
2531{
2532 fModified = mod;
2533 if (fModified) {
2535 }
2536 else {
2538 }
2539 if (fViewer->GetActDesc()->fLocal ||
2540 (fViewer->GetActDesc()->fProof &&
2543}
2544
2545////////////////////////////////////////////////////////////////////////////////
2546/// Feedback function connected to Feedback signal.
2547/// Used to update feedback histograms.
2548
2550{
2551 // if no actual session, just return
2552 if (!fViewer->GetActDesc()->fAttached)
2553 return;
2554 if (!fViewer->GetActDesc()->fProof)
2555 return;
2556 if ((fViewer->GetActDesc()->fActQuery) &&
2561 return;
2562 TProof *sender = dynamic_cast<TProof*>((TQObject*)gTQSender);
2563 // if Proof sender match actual session one, update feedback histos
2564 if (sender && (sender == fViewer->GetActDesc()->fProof))
2565 UpdateHistos(objs);
2566}
2567
2568////////////////////////////////////////////////////////////////////////////////
2569/// Update feedback histograms.
2570
2572{
2573 TVirtualPad *save = gPad;
2574 TObject *o;
2575 Int_t pos = 1;
2576 Int_t i = 0;
2577 while (kFeedbackHistos[i]) {
2578 // check if user has selected this histogram in the option menu
2579 if (fViewer->GetCascadeMenu()->IsEntryChecked(41+i)) {
2580 if ( (o = objs->FindObject(kFeedbackHistos[i]))) {
2581 fStatsCanvas->cd(pos);
2583 if (TH1 *h = dynamic_cast<TH1*>(o)) {
2584 h->SetStats(0);
2585 h->SetBarWidth(0.75);
2586 h->SetBarOffset(0.125);
2587 h->SetFillColor(9);
2588 h->Draw("bar");
2589 pos++;
2590 }
2591 else if (TH2 *h2 = dynamic_cast<TH2*>(o)) {
2592 h2->Draw();
2593 pos++;
2594 }
2595 gPad->Modified();
2596 }
2597 }
2598 i++;
2599 }
2600 // update canvas
2601 fStatsCanvas->cd();
2604 if (save != 0) {
2605 save->cd();
2606 } else {
2607 gPad = 0;
2608 }
2609}
2610
2611////////////////////////////////////////////////////////////////////////////////
2612/// Update progress bar and status labels.
2613
2615{
2616 Long_t tt;
2617 UInt_t hh=0, mm=0, ss=0;
2618 TString stm;
2619 // if no actual session, just return
2620 if (!fViewer->GetActDesc()->fProof)
2621 return;
2622 // if Proof sender does't match actual session one, return
2623 TProof *sender = dynamic_cast<TProof*>((TQObject*)gTQSender);
2624 if (!sender || (sender != fViewer->GetActDesc()->fProof))
2625 return;
2626
2627 if ((fViewer->GetActDesc()->fActQuery) &&
2632 fTotal->SetText(" Estimated time left : 0 sec (0 events of 0 processed) ");
2633 fRate->SetText(" Processing Rate : 0.0f events/sec ");
2634 frmProg->Reset();
2635 fFB->Layout();
2636 return;
2637 }
2638
2639 if (total < 0)
2640 total = fPrevTotal;
2641 else
2642 fPrevTotal = total;
2643
2644 // if no change since last call, just return
2645 if (fPrevProcessed == processed)
2646 return;
2647 TString buf;
2648
2649 // Update information at first call
2650 if (fEntries != total) {
2651 buf.Form("PROOF cluster : \"%s\" - %d worker nodes",
2654 fLabInfos->SetText(buf);
2655
2656 fEntries = total;
2657 buf.Form(" %d files, %lld events, starting event %lld",
2659 fLabStatus->SetText(buf);
2660 }
2661
2662 // compute progress bar position and update
2663 Float_t pos = (Float_t)((Double_t)(processed * 100)/(Double_t)total);
2664 frmProg->SetPosition(pos);
2665 // if 100%, stop animation and set icon to "connected"
2666 if (pos >= 100.0) {
2668 fViewer->ChangeRightLogo("monitor01.xpm");
2669 }
2670
2671 // get current time
2672 if ((fViewer->GetActDesc()->fActQuery->fStatus ==
2679 Float_t eta = 0;
2680 if (processed)
2681 eta = ((Float_t)((Long64_t)tdiff)*total/Float_t(processed) -
2682 Long64_t(tdiff))/1000.;
2683
2684 tt = (Long_t)eta;
2685 if (tt > 0) {
2686 hh = (UInt_t)(tt / 3600);
2687 mm = (UInt_t)((tt % 3600) / 60);
2688 ss = (UInt_t)((tt % 3600) % 60);
2689 }
2690 if (hh)
2691 stm.Form("%d h %d min %d sec", hh, mm, ss);
2692 else if (mm)
2693 stm.Form("%d min %d sec", mm, ss);
2694 else
2695 stm.Form("%d sec", ss);
2696 if (processed == total) {
2697 // finished
2698 tt = (Long_t) Long64_t(tdiff)/1000;
2699 if (tt > 0) {
2700 hh = (UInt_t)(tt / 3600);
2701 mm = (UInt_t)((tt % 3600) / 60);
2702 ss = (UInt_t)((tt % 3600) % 60);
2703 }
2704 if (hh)
2705 stm.Form("%d h %d min %d sec", hh, mm, ss);
2706 else if (mm)
2707 stm.Form("%d min %d sec", mm, ss);
2708 else
2709 stm.Form("%d sec", ss);
2710 buf.Form(" Processed : %lld events in %s", total, stm.Data());
2711 fTotal->SetText(buf.Data());
2712 } else {
2713 // update status infos
2714 buf.Form(" Estimated time left : %s (%lld events of %lld processed) ",
2715 stm.Data(), processed, total);
2716 fTotal->SetText(buf.Data());
2717 }
2718 if (processed > 0 && (Long64_t)tdiff > 0) {
2719 buf.Form(" Processing Rate : %.1f events/sec ",
2720 (Float_t)processed/(Long64_t)tdiff*1000.);
2721 fRate->SetText(buf);
2722 }
2723 fPrevProcessed = processed;
2724
2725 fFB->Layout();
2726}
2727
2728////////////////////////////////////////////////////////////////////////////////
2729/// New version of Progress (just forward to the old version
2730/// for the time being).
2731
2733 Long64_t /*bytesread*/, Float_t /*initTime*/,
2734 Float_t /*procTime*/, Float_t /*evtrti*/,
2735 Float_t /*mbrti*/, Int_t /*actw*/,
2736 Int_t /*tses*/, Float_t /*eses*/)
2737{
2738 Progress(total, processed);
2739}
2740
2741////////////////////////////////////////////////////////////////////////////////
2742/// Update progress bar and status labels.
2743
2745{
2746 Long_t tt;
2747 UInt_t hh=0, mm=0, ss=0;
2748 TString stm;
2749 TString cproc;
2750 Int_t status;
2751
2752 switch (fViewer->GetActDesc()->fActQuery->fStatus) {
2753
2755 cproc = " - ABORTED";
2756 status = kAborted;
2757 break;
2759 cproc = " - STOPPED";
2760 status = kStopped;
2761 break;
2763 cproc = " ";
2764 status = kRunning;
2765 break;
2768 cproc = " ";
2769 status = kDone;
2770 break;
2771 default:
2772 status = -1;
2773 break;
2774 }
2775 if (processed < 0) processed = 0;
2776
2777 frmProg->SetBarColor("green");
2778 if (status == kAborted)
2779 frmProg->SetBarColor("red");
2780 else if (status == kStopped)
2781 frmProg->SetBarColor("yellow");
2782 else if (status == -1 ) {
2783 fTotal->SetText(" Estimated time left : 0 sec (0 events of 0 processed) ");
2784 fRate->SetText(" Processing Rate : 0.0f events/sec ");
2785 frmProg->Reset();
2786 fFB->Layout();
2787 return;
2788 }
2789
2790 if (total < 0)
2791 total = fPrevTotal;
2792 else
2793 fPrevTotal = total;
2794
2795 // if no change since last call, just return
2796 TString buf;
2797
2798 // Update information at first call
2799 if (fEntries != total) {
2800 fLabInfos->SetText("Local Session");
2801
2802 fEntries = total;
2803 buf.Form(" %d files, %lld events, starting event %lld",
2805 fLabStatus->SetText(buf.Data());
2806 }
2807
2808 // compute progress bar position and update
2809 Float_t pos = 0.0;
2810 if (processed > 0 && total > 0)
2811 pos = (Float_t)((Double_t)(processed * 100)/(Double_t)total);
2812 frmProg->SetPosition(pos);
2813 // if 100%, stop animation and set icon to "connected"
2814 if (pos >= 100.0) {
2816 fViewer->ChangeRightLogo("monitor01.xpm");
2817 }
2818
2819 // get current time
2820 if (status == kRunning)
2824 Float_t eta = 0;
2825 if (processed)
2826 eta = ((Float_t)((Long64_t)tdiff)*total/(Float_t)(processed) -
2827 (Long64_t)(tdiff))/1000.;
2828
2829 tt = (Long_t)eta;
2830 if (tt > 0) {
2831 hh = (UInt_t)(tt / 3600);
2832 mm = (UInt_t)((tt % 3600) / 60);
2833 ss = (UInt_t)((tt % 3600) % 60);
2834 }
2835 if (hh)
2836 stm = TString::Format("%d h %d min %d sec", hh, mm, ss);
2837 else if (mm)
2838 stm = TString::Format("%d min %d sec", mm, ss);
2839 else
2840 stm = TString::Format("%d sec", ss);
2841 if ((processed != total) && (status == kRunning)) {
2842 // update status infos
2843 buf.Form(" Estimated time left : %s (%lld events of %lld processed) ",
2844 stm.Data(), processed, total);
2845 fTotal->SetText(buf);
2846 } else {
2847 tt = (Long_t) Long64_t(tdiff)/1000;
2848 if (tt > 0) {
2849 hh = (UInt_t)(tt / 3600);
2850 mm = (UInt_t)((tt % 3600) / 60);
2851 ss = (UInt_t)((tt % 3600) % 60);
2852 }
2853 if (hh)
2854 stm = TString::Format("%d h %d min %d sec", hh, mm, ss);
2855 else if (mm)
2856 stm = TString::Format("%d min %d sec", mm, ss);
2857 else
2858 stm = TString::Format("%d sec", ss);
2859 buf.Form(" Processed : %ld events in %s",
2860 (Long_t)processed, stm.Data());
2861 buf += cproc;
2862 fTotal->SetText(buf.Data());
2863 }
2864 if (processed > 0 && (Long64_t)tdiff > 0) {
2865 buf.Form(" Processing Rate : %.1f events/sec ",
2866 (Float_t)processed/(Long64_t)tdiff*1000.);
2867 fRate->SetText(buf.Data());
2868 }
2869 fPrevProcessed = processed;
2870
2871 fFB->Layout();
2872}
2873
2874////////////////////////////////////////////////////////////////////////////////
2875/// Indicate that Cancel or Stop was clicked.
2876
2878{
2879 if (aborted == kTRUE) {
2880 // Aborted
2881 frmProg->SetBarColor("red");
2882 }
2883 else {
2884 // Stopped
2885 frmProg->SetBarColor("yellow");
2886 }
2887 // disconnect progress related signals
2888 if (fViewer->GetActDesc()->fProof &&
2890 fViewer->GetActDesc()->fProof->Disconnect("Progress(Long64_t,Long64_t)",
2891 this, "Progress(Long64_t,Long64_t)");
2892 fViewer->GetActDesc()->fProof->Disconnect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
2893 this, "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
2894 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)",
2895 this, "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
2896 fViewer->GetActDesc()->fProof->Disconnect("StopProcess(Bool_t)", this,
2897 "IndicateStop(Bool_t)");
2898 }
2899}
2900
2901////////////////////////////////////////////////////////////////////////////////
2902/// Reset progress frame information fields.
2903
2904void TSessionQueryFrame::ResetProgressDialog(const char * /*selector*/, Int_t files,
2905 Long64_t first, Long64_t entries)
2906{
2907 TString buf;
2908 fFiles = files > 0 ? files : 0;
2909 fFirst = first;
2910 fEntries = entries;
2911 fPrevProcessed = 0;
2912 fPrevTotal = 0;
2913
2914 if (!fViewer->GetActDesc()->fLocal) {
2915 frmProg->SetBarColor("green");
2916 frmProg->Reset();
2917 }
2918
2919 buf.Form("%0d files, %0lld events, starting event %0lld",
2920 fFiles > 0 ? fFiles : 0, fEntries > 0 ? fEntries : 0,
2921 fFirst >= 0 ? fFirst : 0);
2922 fLabStatus->SetText(buf.Data());
2923 // Reconnect the slots
2924 if (fViewer->GetActDesc()->fProof &&
2926 fViewer->GetActDesc()->fProof->Connect("Progress(Long64_t,Long64_t)",
2927 "TSessionQueryFrame", this, "Progress(Long64_t,Long64_t)");
2928 fViewer->GetActDesc()->fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
2929 "TSessionQueryFrame", this,
2930 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
2931 fViewer->GetActDesc()->fProof->Connect("StopProcess(Bool_t)",
2932 "TSessionQueryFrame", this, "IndicateStop(Bool_t)");
2933 buf.Form("PROOF cluster : \"%s\" - %d worker nodes",
2936 fLabInfos->SetText(buf.Data());
2937 }
2938 else if (fViewer->GetActDesc()->fLocal) {
2940 fLabInfos->SetText("Local Session");
2941 fLabStatus->SetText(" ");
2942 }
2943 else {
2944 fLabInfos->SetText(" ");
2945 fLabStatus->SetText(" ");
2946 }
2947 fFB->Layout();
2948}
2949
2950////////////////////////////////////////////////////////////////////////////////
2951/// Finalize query.
2952
2954{
2955 // check if Proof is valid
2956 if (fViewer->GetActDesc()->fProof &&
2958 gPad->SetEditable(kFALSE);
2960 if (!item) return;
2961 TObject *obj = (TObject *)item->GetUserData();
2962 if ((obj) && (obj->IsA() == TQueryDescription::Class())) {
2963 // as it can take time, set watch cursor
2964 gVirtualX->SetCursor(GetId(),gVirtualX->CreateCursor(kWatch));
2965 TQueryDescription *query = (TQueryDescription *)obj;
2967 UpdateButtons(query);
2968 // restore cursor
2969 gVirtualX->SetCursor(GetId(), 0);
2970 }
2971 }
2972 if (fViewer->GetActDesc()->fLocal) {
2973 gPad->SetEditable(kFALSE);
2975 if (chain && chain->GetPlayer())
2977 }
2978}
2979
2980////////////////////////////////////////////////////////////////////////////////
2981/// Stop processing query.
2982
2984{
2985 // check for proof validity
2986 if (fViewer->GetActDesc()->fProof &&
2989 }
2990 if (fViewer->GetActDesc()->fLocal) {
2991 gROOT->SetInterrupt();
2994 }
2995 // stop icon animation and set connected icon
2996 fViewer->ChangeRightLogo("monitor01.xpm");
2998}
2999
3000////////////////////////////////////////////////////////////////////////////////
3001/// Show query log.
3002
3004{
3006 if (!item) return;
3007 TObject *obj = (TObject *)item->GetUserData();
3008 if ((!obj) || (obj->IsA() != TQueryDescription::Class()))
3009 return;
3010 TQueryDescription *query = (TQueryDescription *)obj;
3011 fViewer->ShowLog(query->fReference.Data());
3012}
3013
3014////////////////////////////////////////////////////////////////////////////////
3015/// Retrieve query.
3016
3018{
3019 // check for proof validity
3020 if (fViewer->GetActDesc()->fAttached &&
3024 if (!item) return;
3025 TObject *obj = (TObject *)item->GetUserData();
3026 if (obj && obj->IsA() == TQueryDescription::Class()) {
3027 // as it can take time, set watch cursor
3028 gVirtualX->SetCursor(GetId(), gVirtualX->CreateCursor(kWatch));
3029 TQueryDescription *query = (TQueryDescription *)obj;
3031 if (rc == 0)
3033 // restore cursor
3034 gVirtualX->SetCursor(GetId(), 0);
3035 }
3036 }
3037 if (fViewer->GetActDesc()->fLocal) {
3038 TGListTreeItem *item=0, *item2=0;
3040 fViewer->GetActDesc());
3041 if (item) {
3042 item2 = fViewer->GetSessionHierarchy()->FindItemByObj(item,
3044 }
3045 if (item2) {
3046 // add input and output list entries
3048 if (chain && chain->GetPlayer()) {
3049 TSelector *selector = chain->GetPlayer()->GetSelectorFromFile();
3050 if (selector) {
3051 TList *objlist = selector->GetOutputList();
3052 if (objlist)
3053 if (!fViewer->GetSessionHierarchy()->FindChildByName(item2, "OutputList"))
3054 fViewer->GetSessionHierarchy()->AddItem(item2, "OutputList");
3055 }
3056 }
3057 }
3058 // update list tree, query frame information, and buttons state
3061 UpdateInfos();
3063 }
3064}
3065
3066////////////////////////////////////////////////////////////////////////////////
3067/// Abort processing query.
3068
3070{
3071 // check for proof validity
3072 if (fViewer->GetActDesc()->fProof &&
3075 }
3076 if (fViewer->GetActDesc()->fLocal) {
3077 gROOT->SetInterrupt();
3080 }
3081 // stop icon animation and set connected icon
3082 fViewer->ChangeRightLogo("monitor01.xpm");
3084}
3085
3086////////////////////////////////////////////////////////////////////////////////
3087/// Submit query.
3088
3090{
3091 Int_t retval;
3092 Long64_t id = 0;
3094 if (!item) return;
3095 // retrieve query description attached to list tree item
3096 TObject *obj = (TObject *)item->GetUserData();
3097 if (!obj || obj->IsA() != TQueryDescription::Class())
3098 return;
3099 TQueryDescription *newquery = (TQueryDescription *)obj;
3100 // reset progress information
3102 newquery->fNbFiles, newquery->fFirstEntry, newquery->fNoEntries);
3103 // set query start time
3104 newquery->fStartTime = gSystem->Now();
3106 // check for proof validity
3107 if (fViewer->GetActDesc()->fProof &&
3110 // set query description status to submitted
3112 // if feedback option selected
3114 Int_t i = 0;
3115 // browse list of feedback histos and check user's selected ones
3116 while (kFeedbackHistos[i]) {
3117 if (fViewer->GetCascadeMenu()->IsEntryChecked(41+i)) {
3120 }
3121 i++;
3122 }
3123 // connect feedback signal
3124 fViewer->GetActDesc()->fProof->Connect("Feedback(TList *objs)",
3125 "TSessionQueryFrame", fViewer->GetQueryFrame(),
3126 "Feedback(TList *objs)");
3127 gROOT->Time();
3128 }
3129 else {
3130 // if feedback option not selected, clear Proof's feedback option
3132 }
3133 // set current proof session
3134 fViewer->GetActDesc()->fProof->cd();
3135 // check if parameter file has been specified
3136 if (newquery->fChain) {
3137 if (fViewer->GetActDesc()->fProof->IsLite()) {
3138 newquery->fOptions = "";
3139 }
3140 // set query reference id
3141 newquery->fReference= TString::Format("session-%s:q%d",
3144 if (newquery->fChain->IsA() == TChain::Class()) {
3145 // TChain case
3147 ((TChain *)newquery->fChain)->SetProof(fViewer->GetActDesc()->fProof);
3148 id = ((TChain *)newquery->fChain)->Process(newquery->fSelectorString,
3149 newquery->fOptions,
3150 newquery->fNoEntries > 0 ? newquery->fNoEntries : 1234567890,
3151 newquery->fFirstEntry);
3152 }
3153 else if (newquery->fChain->IsA() == TDSet::Class()) {
3154 // TDSet case
3156 id = ((TDSet *)newquery->fChain)->Process(newquery->fSelectorString,
3157 newquery->fOptions,
3158 newquery->fNoEntries,
3159 newquery->fFirstEntry);
3160 }
3161 }
3162 else {
3163 Error("Submit", "No TChain defined; skipping");
3165 return;
3166 }
3167 // set query reference id to unique identifier
3168 newquery->fReference= TString::Format("session-%s:q%lld",
3170 // start icon animation
3172 }
3173 else if (fViewer->GetActDesc()->fLocal) { // local session case
3174 // if feedback option selected
3176 Int_t i = 0;
3177 // browse list of feedback histos and check user's selected ones
3178 while (kFeedbackHistos[i]) {
3179 if (fViewer->GetCascadeMenu()->IsEntryChecked(41+i)) {
3181 }
3182 i++;
3183 }
3184 }
3185 if (newquery->fChain) {
3186 if (newquery->fChain->IsA() == TChain::Class()) {
3187 // TChain case
3190 UpdateButtons(newquery);
3191 gPad->SetEditable(kFALSE);
3192 ((TChain *)newquery->fChain)->SetTimerInterval(100);
3193 id = ((TChain *)newquery->fChain)->Process(newquery->fSelectorString,
3194 newquery->fOptions,
3195 newquery->fNoEntries > 0 ? newquery->fNoEntries : 1234567890,
3196 newquery->fFirstEntry);
3197 ((TChain *)newquery->fChain)->SetTimerInterval(0);
3198 OnBtnRetrieve();
3199 TChain *chain = (TChain *)newquery->fChain;
3200 ProgressLocal(chain->GetEntries(),
3201 chain->GetReadEntry()+1);
3205 UpdateButtons(newquery);
3206 }
3207 else {
3208 new TGMsgBox(fClient->GetRoot(), this, "Error Submitting Query",
3209 "Only TChains are allowed in Local Session (no TDSet) !",
3210 kMBIconExclamation,kMBOk,&retval);
3211 }
3212 }
3213 else {
3214 Error("Submit", "No TChain defined; skipping");
3216 return;
3217 }
3218 // set query reference id to unique identifier
3219 newquery->fReference = TString::Format("local-session-%s:q%lld", newquery->fQueryName.Data(), id);
3220 }
3221 // update buttons state
3222 UpdateButtons(newquery);
3223}
3224
3225////////////////////////////////////////////////////////////////////////////////
3226/// Update buttons state for the current query status.
3227
3229{
3231 if (!item) return;
3232 // retrieve query description attached to list tree item
3233 TObject *obj = (TObject *)item->GetUserData();
3234 if (!obj || obj->IsA() != TQueryDescription::Class())
3235 return;
3236 TQueryDescription *query = (TQueryDescription *)obj;
3237 if (desc != query) return;
3238
3239 Bool_t submit_en = kFALSE;
3240 if ((fViewer->GetActDesc()->fProof &&
3241 fViewer->GetActDesc()->fProof->IsValid()) ||
3243 submit_en = kTRUE;
3244
3245 switch (desc->fStatus) {
3247 fBtnSubmit->SetEnabled(submit_en);
3253 break;
3254
3256 fBtnSubmit->SetEnabled(submit_en);
3258 if (((desc->fResult == 0) || (desc->fResult &&
3259 (desc->fResult->IsFinalized() ||
3260 (desc->fResult->GetInputObject("TDSet") == 0)))) &&
3261 !(fViewer->GetActDesc()->fLocal))
3267 break;
3268
3270 fBtnSubmit->SetEnabled(submit_en);
3276 break;
3277
3285 break;
3286
3294 break;
3295
3297 fBtnSubmit->SetEnabled(submit_en);
3303 break;
3304
3306 fBtnSubmit->SetEnabled(submit_en);
3312 break;
3313
3315 fBtnSubmit->SetEnabled(submit_en);
3321 break;
3322
3323 default:
3324 break;
3325 }
3326 if (fViewer->GetActDesc()->fLocal &&
3330 }
3331}
3332
3333////////////////////////////////////////////////////////////////////////////////
3334/// Update query information (header) text view.
3335
3337{
3338 TString buffer;
3339 const char *qst[] = {"aborted ", "submitted", "running ",
3340 "stopped ", "completed"};
3341
3344
3345 if (fViewer->GetActDesc()->fLocal ||
3349 fViewer->GetActDesc()->fProof->IsValid())) {
3350 fBtnSave->SetText(" Submit ");
3351 }
3352 else {
3353 fBtnSave->SetText(" Apply changes ");
3354 }
3357 if (!fViewer->GetActDesc()->fActQuery ||
3359 ResetProgressDialog("", 0, 0, 0);
3360 if (fViewer->GetActDesc()->fLocal) {
3361 if (fViewer->GetActDesc()->fActQuery) {
3363 if (chain) {
3364 ProgressLocal(chain->GetEntries(),
3365 chain->GetReadEntry()+1);
3366 }
3367 else {
3368 ProgressLocal(0, 0);
3369 }
3371 }
3372 }
3373 else {
3374 fTotal->SetText(" Estimated time left : 0 sec (0 events of 0 processed) ");
3375 fRate->SetText(" Processing Rate : 0.0f events/sec ");
3376 frmProg->Reset();
3377 fFB->Layout();
3378 }
3379 return;
3380 }
3382
3383 // Status label
3384 Int_t st = (result->GetStatus() > 0 && result->GetStatus() <=
3385 TQueryResult::kCompleted) ? result->GetStatus() : 0;
3386
3387 Int_t qry = result->GetSeqNum();
3388
3389 buffer = TString::Format("------------------------------------------------------\n");
3390 // Print header
3391 if (!result->IsDraw()) {
3392 const char *fin = result->IsFinalized() ? "finalized" : qst[st];
3393 const char *arc = result->IsArchived() ? "(A)" : "";
3394 buffer = TString::Format(" Query No : %d\n", qry);
3395 buffer += TString::Format(" Ref : \"%s:%s\"\n", result->GetTitle(),
3396 result->GetName());
3397 buffer += TString::Format(" Selector : %s\n",
3398 result->GetSelecImp()->GetTitle());
3399 buffer += TString::Format("Status : %9s%s\n", fin, arc);
3400 buffer += TString::Format("------------------------------------------------------\n");
3401 } else {
3402 buffer += TString::Format(" Query No : %d\n", qry);
3403 buffer += TString::Format(" Ref : \"%s:%s\"\n", result->GetTitle(),
3404 result->GetName());
3405 buffer += TString::Format(" Selector : %s\n",
3406 result->GetSelecImp()->GetTitle());
3407 buffer += TString::Format("------------------------------------------------------\n");
3408 }
3409
3410 // Time information
3411 Int_t elapsed = (Int_t)(result->GetEndTime().Convert() -
3412 result->GetStartTime().Convert());
3413 buffer += TString::Format(" Started : %s\n",
3414 result->GetStartTime().AsString());
3415 buffer += TString::Format(" Real time : %d sec (CPU time: %.1f sec)\n",
3416 elapsed, result->GetUsedCPU());
3417
3418 // Number of events processed, rate, size
3419 Double_t rate = 0.0;
3420 if (result->GetEntries() > -1 && elapsed > 0)
3421 rate = result->GetEntries() / (Double_t)elapsed ;
3422 Float_t size = ((Float_t)result->GetBytes())/(1024*1024);
3423 buffer += TString::Format(" Processed : %lld events (size: %.3f MBs)\n",
3424 result->GetEntries(), size);
3425 buffer += TString::Format(" Rate : %.1f evts/sec\n", rate);
3426
3427 // Package information
3428 if (strlen(result->GetParList()) > 1) {
3429 buffer += TString::Format(" Packages : %s\n", result->GetParList());
3430 }
3431
3432 // Result information
3433 TString res = result->GetResultFile();
3434 if (!result->IsArchived()) {
3435 Int_t dq = res.Index("queries");
3436 if (dq > -1) {
3437 res.Remove(0,res.Index("queries"));
3438 res.Insert(0,"<PROOF_SandBox>/");
3439 }
3440 if (res.BeginsWith("-")) {
3441 res = (result->GetStatus() == TQueryResult::kAborted) ?
3442 "not available" : "sent to client";
3443 }
3444 }
3445 if (res.Length() > 1) {
3446 buffer += TString::Format("------------------------------------------------------\n");
3447 buffer += TString::Format(" Results : %s\n", res.Data());
3448 }
3449
3450 if (result->GetOutputList() && result->GetOutputList()->GetSize() > 0) {
3451 buffer += TString::Format(" Outlist : %d objects\n",
3452 result->GetOutputList()->GetSize());
3453 buffer += TString::Format("------------------------------------------------------\n");
3454 }
3455 fInfoTextView->LoadBuffer(buffer.Data());
3456
3457 //Float_t pos = Float_t((Double_t)(result->GetEntries() * 100)/(Double_t)total);
3458 if (result->GetStatus() == TQueryResult::kAborted)
3459 frmProg->SetBarColor("red");
3460 else if (result->GetStatus() == TQueryResult::kStopped)
3461 frmProg->SetBarColor("yellow");
3462 else
3463 frmProg->SetBarColor("green");
3464
3465 frmProg->SetPosition(100.0);
3466
3467 buffer = TString::Format(" Processed : %lld events in %.1f sec", result->GetEntries(),
3468 (Float_t)elapsed);
3469 fTotal->SetText(buffer.Data());
3470 buffer = TString::Format(" Processing Rate : %.1f events/sec ", rate);
3471 fRate->SetText(buffer.Data());
3472 fFB->Layout();
3473}
3474
3475//////////////////////////////////////////////////////////////////////////////////////////
3476// Output frame
3477
3478////////////////////////////////////////////////////////////////////////////////
3479/// Constructor.
3480
3482 TGCompositeFrame(p, w, h), fEntryTmp(0), fLVContainer(0), fViewer(0)
3483{
3484}
3485
3486////////////////////////////////////////////////////////////////////////////////
3487/// Destructor.
3488
3490{
3491 delete fLVContainer; // this container is inside the TGListView and is not
3492 // deleted automatically
3493 Cleanup();
3494}
3495
3496////////////////////////////////////////////////////////////////////////////////
3497/// Build query output information frame.
3498
3500{
3501 fViewer = gui;
3504
3505 // Container of object TGListView
3506 TGListView *frmListView = new TGListView(this, 340, 190);
3508 fLVContainer->Associate(frmListView);
3511 4, 4, 4, 4));
3512
3513 frmListView->Connect("Clicked(TGLVEntry*, Int_t, Int_t, Int_t)",
3514 "TSessionOutputFrame", this,
3515 "OnElementClicked(TGLVEntry* ,Int_t, Int_t, Int_t)");
3516 frmListView->Connect("DoubleClicked(TGLVEntry*, Int_t, Int_t, Int_t)",
3517 "TSessionOutputFrame", this,
3518 "OnElementDblClicked(TGLVEntry* ,Int_t, Int_t, Int_t)");
3519}
3520
3521////////////////////////////////////////////////////////////////////////////////
3522/// Handle mouse clicks on list view items.
3523
3525 Int_t y)
3526{
3527 TObject *obj = (TObject *)entry->GetUserData();
3528 if ((obj) && (btn ==3)) {
3529 // if right button, popup context menu
3530 fViewer->GetContextMenu()->Popup(x, y, obj, (TBrowser *)0);
3531 }
3532}
3533
3534////////////////////////////////////////////////////////////////////////////////
3535/// Handle double-clicks on list view items.
3536
3538{
3539 char action[512];
3540 TString act;
3541 TObject *obj = (TObject *)entry->GetUserData();
3542 if (!obj) return;
3543 TString ext = obj->GetName();
3544 gPad->SetEditable(kFALSE);
3545 // check default action from root.mimes
3546 if (fClient->GetMimeTypeList()->GetAction(obj->IsA()->GetName(), action)) {
3547 act = TString::Format("((%s*)0x%lx)%s", obj->IsA()->GetName(), (Long_t)obj, action);
3548 if (act[0] == '!') {
3549 act.Remove(0, 1);
3550 gSystem->Exec(act.Data());
3551 } else {
3552 // do not allow browse
3553 if (!act.Contains("Browse"))
3554 gROOT->ProcessLine(act.Data());
3555 }
3556 }
3557}
3558
3559////////////////////////////////////////////////////////////////////////////////
3560/// Add object to output list view.
3561
3563{
3564 TGLVEntry *item;
3565 if (obj) {
3566 item = new TGLVEntry(fLVContainer, obj->GetName(), obj->IsA()->GetName());
3567 item->SetUserData(obj);
3568 fLVContainer->AddItem(item);
3569 }
3570}
3571
3572//////////////////////////////////////////////////////////////////////////////////////////
3573// Input Frame
3574
3575////////////////////////////////////////////////////////////////////////////////
3576/// Constructor.
3577
3579 TGCompositeFrame(p, w, h), fViewer(0), fLVContainer(0)
3580{
3581}
3582
3583////////////////////////////////////////////////////////////////////////////////
3584/// Destructor.
3585
3587{
3588 delete fLVContainer; // this container is inside the TGListView and is not
3589 // deleted automatically
3590 Cleanup();
3591}
3592
3593////////////////////////////////////////////////////////////////////////////////
3594/// Build query input information frame.
3595
3597{
3598 fViewer = gui;
3601
3602 // Container of object TGListView
3603 TGListView *frmListView = new TGListView(this, 340, 190);
3605 fLVContainer->Associate(frmListView);
3608 4, 4, 4, 4));
3609}
3610
3611////////////////////////////////////////////////////////////////////////////////
3612/// Add object to input list view.
3613
3615{
3616 TGLVEntry *item;
3617 if (obj) {
3618 item = new TGLVEntry(fLVContainer, obj->GetName(), obj->IsA()->GetName());
3619 item->SetUserData(obj);
3620 fLVContainer->AddItem(item);
3621 }
3622}
3623
3624//////////////////////////////////////////////////////////////////////////////////////////
3625// Session Viewer Main Frame
3626
3627////////////////////////////////////////////////////////////////////////////////
3628/// Main Session viewer constructor.
3629
3631 TGMainFrame(gClient->GetRoot(), w, h), fSessionHierarchy(0), fSessionItem(0)
3632{
3633 // only one session viewer allowed
3634 if (gSessionViewer)
3635 // coverity[uninit_member]: already done
3636 return;
3637 Build();
3639 Resize(w, h);
3640 gSessionViewer = this;
3641}
3642
3643////////////////////////////////////////////////////////////////////////////////
3644/// Main Session viewer constructor.
3645
3647 UInt_t h) : TGMainFrame(gClient->GetRoot(), w, h),
3648 fSessionHierarchy(0), fSessionItem(0)
3649{
3650 // only one session viewer allowed
3651 if (gSessionViewer)
3652 // coverity[uninit_member]: already done
3653 return;
3654 Build();
3656 Move(x, y);
3657 Resize(w, h);
3658 gSessionViewer = this;
3659}
3660
3661////////////////////////////////////////////////////////////////////////////////
3662/// Read configuration file and populate list of sessions
3663/// list of queries and list of packages.
3664/// Read and set also global options as feedback histos.
3665
3666void TSessionViewer::ReadConfiguration(const char *filename)
3667{
3668 if (fViewerEnv)
3669 delete fViewerEnv;
3670 fViewerEnv = new TEnv();
3671
3672 const char *fn = (filename && strlen(filename)) ? filename : fConfigFile.Data();
3673
3675
3676 Bool_t bval = (Bool_t)fViewerEnv->GetValue("Option.Feedback", 1);
3677 if (bval)
3679 else
3681
3682 bval = (Bool_t)fViewerEnv->GetValue("Option.MasterHistos", 1);
3683 if (bval) {
3685 gEnv->SetValue("Proof.StatsHist", 1);
3686 }
3687 else {
3689 gEnv->SetValue("Proof.StatsHist", 0);
3690 }
3691 bval = (Bool_t)fViewerEnv->GetValue("Option.MasterEvents", 0);
3692 if (bval)
3694 else
3696 bval = (Bool_t)fViewerEnv->GetValue("Option.WorkerEvents", 0);
3697 if (bval)
3699 else
3701
3702 Int_t i = 0;
3703 while (kFeedbackHistos[i]) {
3704 bval = (Bool_t)fViewerEnv->GetValue(Form("Option.%s",kFeedbackHistos[i]),
3705 i == 1 ? 1 : 0);
3706 if (bval)
3707 fCascadeMenu->CheckEntry(41+i);
3708 else
3710 i++;
3711 }
3712 TSessionDescription *proofDesc;
3713 fSessions->Delete();
3714 if (fSessionItem)
3716 else
3718 fBaseIcon);
3719 // add local session description
3721 fLocal, fLocal);
3722 fSessionHierarchy->SetToolTipItem(item, "Local Session");
3723 TSessionDescription *localdesc = new TSessionDescription();
3724 localdesc->fTag = "";
3725 localdesc->fName = "Local";
3726 localdesc->fAddress = "Local";
3727 localdesc->fPort = 0;
3728 localdesc->fConfigFile = "";
3729 localdesc->fLogLevel = 0;
3730 localdesc->fUserName = "";
3731 localdesc->fQueries = new TList();
3732 localdesc->fPackages = new TList();
3733 localdesc->fActQuery = 0;
3734 localdesc->fProof = 0;
3735 localdesc->fProofMgr = 0;
3736 localdesc->fAttached = kFALSE;
3737 localdesc->fConnected = kFALSE;
3738 localdesc->fLocal = kTRUE;
3739 localdesc->fSync = kTRUE;
3740 localdesc->fAutoEnable = kFALSE;
3741 localdesc->fNbHistos = 0;
3742 item->SetUserData(localdesc);
3743 fSessions->Add((TObject *)localdesc);
3744 fActDesc = localdesc;
3745
3746 SysInfo_t info;
3747 gSystem->GetSysInfo(&info);
3748 // if the machine has more than one CPU, add one PROOF lite session
3749 // (not supported on Windows yet)
3750 if (!info.fOS.Contains("Microsoft") && info.fCpus > 1) {
3751 // add proof lite session description
3752 item = fSessionHierarchy->AddItem(fSessionItem, "Lite",
3754 fSessionHierarchy->SetToolTipItem(item, "PROOF Lite");
3755 TSessionDescription *litedesc = new TSessionDescription();
3756 litedesc->fTag = "";
3757 litedesc->fName = "PROOF Lite";
3758 litedesc->fAddress = "lite://";
3759 litedesc->fPort = 0;
3760 litedesc->fConfigFile = "";
3761 litedesc->fLogLevel = 0;
3762 litedesc->fUserName = "";
3763 litedesc->fQueries = new TList();
3764 litedesc->fPackages = new TList();
3765 litedesc->fActQuery = 0;
3766 litedesc->fProof = 0;
3767 litedesc->fProofMgr = 0;
3768 litedesc->fAttached = kFALSE;
3769 litedesc->fConnected = kFALSE;
3770 litedesc->fLocal = kFALSE;
3771 litedesc->fSync = kTRUE;
3772 litedesc->fAutoEnable = kFALSE;
3773 litedesc->fNbHistos = 0;
3774 item->SetUserData(litedesc);
3775 fSessions->Add((TObject *)litedesc);
3776 fActDesc = litedesc;
3777 }
3778 TIter next(fViewerEnv->GetTable());
3779 TEnvRec *er;
3780 while ((er = (TEnvRec*) next())) {
3781 const char *s;
3782 if ((s = strstr(er->GetName(), "SessionDescription."))) {
3783 const char *val = fViewerEnv->GetValue(s, (const char*)0);
3784 if (val) {
3785 Int_t cnt = 0;
3786 char *v = StrDup(val);
3787 s += 7;
3788 while (1) {
3789 TString name = strtok(!cnt ? v : 0, ";");
3790 if (name.IsNull()) break;
3791 TString sessiontag = strtok(0, ";");
3792 TString address = strtok(0, ";");
3793 if (address.IsNull()) break;
3794 TString port = strtok(0, ";");
3795 if (port.IsNull()) break;
3796 TString loglevel = strtok(0, ";");
3797 if (loglevel.IsNull()) break;
3798 TString configfile = strtok(0, ";");
3799 TString user = strtok(0, ";");
3800 if (user.IsNull()) break;
3801 TString sync = strtok(0, ";");
3802 TString autoen = strtok(0, ";");
3803
3804 // build session description
3805 proofDesc = new TSessionDescription();
3806 proofDesc->fTag = sessiontag.Length() > 2 ? sessiontag.Data() : "";
3807 proofDesc->fName = name;
3808 proofDesc->fAddress = address;
3809 proofDesc->fPort = atoi(port);
3810 proofDesc->fConfigFile = configfile.Length() > 2 ? configfile.Data() : "";
3811 proofDesc->fLogLevel = atoi(loglevel);
3812 proofDesc->fConnected = kFALSE;
3813 proofDesc->fAttached = kFALSE;
3814 proofDesc->fLocal = kFALSE;
3815 proofDesc->fQueries = new TList();
3816 proofDesc->fPackages = new TList();
3817 proofDesc->fActQuery = 0;
3818 proofDesc->fProof = 0;
3819 proofDesc->fProofMgr = 0;
3820 proofDesc->fSync = (Bool_t)(atoi(sync));
3821 proofDesc->fAutoEnable = (Bool_t)(atoi(autoen));
3822 proofDesc->fUserName = user;
3823 fSessions->Add((TObject *)proofDesc);
3824 item = fSessionHierarchy->AddItem(
3825 fSessionItem, proofDesc->fName.Data(),
3827 fSessionHierarchy->SetToolTipItem(item, "Proof Session");
3828 item->SetUserData(proofDesc);
3829 fActDesc = proofDesc;
3830 cnt++;
3831 }
3832 delete [] v;
3833 }
3834 }
3835 if ((s = strstr(er->GetName(), "QueryDescription."))) {
3836 const char *val = fViewerEnv->GetValue(s, (const char*)0);
3837 if (val) {
3838 Int_t cnt = 0;
3839 char *v = StrDup(val);
3840 s += 7;
3841 while (1) {
3842
3843 TString status = strtok(!cnt ? v : 0, ";");
3844 if (status.IsNull()) break;
3845
3846 TString reference = strtok(0, ";");
3847 if (reference.IsNull()) break;
3848 TString queryname = strtok(0, ";");
3849 if (queryname.IsNull()) break;
3850 TString selector = strtok(0, ";");
3851 if (selector.IsNull()) break;
3852 TString dset = strtok(0, ";");
3853 TString options = strtok(0, ";");
3854 TString eventlist = strtok(0, ";");
3855 TString nbfiles = strtok(0, ";");
3856 TString nbentries = strtok(0, ";");
3857 TString firstentry = strtok(0, ";");
3858
3859 TQueryDescription *newquery = new TQueryDescription();
3860 newquery->fStatus =
3862 newquery->fSelectorString = selector.Length() > 2 ? selector.Data() : "";
3863 newquery->fReference = reference.Length() > 2 ? reference.Data() : "";
3864 newquery->fTDSetString = dset.Length() > 2 ? dset.Data() : "";
3865 newquery->fQueryName = queryname.Length() > 2 ? queryname.Data() : "";
3866 newquery->fOptions = options.Length() > 2 ? options.Data() : "";
3867 newquery->fEventList = eventlist.Length() > 2 ? eventlist.Data() : "";
3868 newquery->fNbFiles = atoi(nbfiles);
3869 newquery->fNoEntries = atoi(nbentries);
3870 newquery->fFirstEntry = atoi(firstentry);
3871 newquery->fResult = 0;
3872 newquery->fChain = 0;
3873 fActDesc->fQueries->Add((TObject *)newquery);
3874 cnt++;
3878 item1, newquery->fQueryName, fQueryCon, fQueryCon);
3879 item2->SetUserData(newquery);
3880 }
3881 delete [] v;
3882 }
3883 }
3884 }
3887 if (fActDesc == localdesc) {
3890 }
3891 else {
3895 }
3898}
3899
3900////////////////////////////////////////////////////////////////////////////////
3901/// Update list of existing Proof sessions.
3902
3904{
3905 // get list of proof sessions
3906 Bool_t found = kFALSE;
3907 Bool_t exists = kFALSE;
3908 TGListTreeItem *item = 0;
3909 TSeqCollection *proofs = gROOT->GetListOfProofs();
3910 TSessionDescription *desc = 0;
3911 TSessionDescription *newdesc;
3912 if (proofs) {
3913 TObject *o = proofs->First();
3914 if (o && dynamic_cast<TProofMgr *>(o)) {
3915 TProofMgr *mgr = dynamic_cast<TProofMgr *>(o);
3916 if (mgr && mgr->QuerySessions("L")) {
3917 TIter nxd(mgr->QuerySessions("L"));
3918 TProofDesc *d = 0;
3919 TProof *p = 0;
3920 while ((d = (TProofDesc *)nxd())) {
3921 TIter nextfs(fSessions);
3922 // check if session exists in the list
3923 exists = kFALSE;
3924 while ((desc = (TSessionDescription *)nextfs())) {
3925 if ((desc->fTag == d->GetName()) ||
3926 (desc->fName == d->GetTitle())) {
3927 exists = kTRUE;
3928 break;
3929 }
3930 }
3931 TIter nexts(fSessions);
3932 found = kFALSE;
3933 p = d->GetProof();
3934 while ((desc = (TSessionDescription *)nexts())) {
3935 if (desc->fConnected && desc->fAttached)
3936 continue;
3937 if (p && ((exists && ((desc->fTag == d->GetName()) ||
3938 (desc->fName == d->GetTitle()))) ||
3939 (!exists && (desc->fAddress == p->GetMaster())))) {
3940 desc->fConnected = kTRUE;
3941 desc->fAttached = kTRUE;
3942 desc->fProof = p;
3943 desc->fProofMgr = mgr;
3944 desc->fTag = d->GetName();
3946 desc);
3947 if (item) {
3949 if (item == fSessionHierarchy->GetSelected()) {
3950 fActDesc->fProof->Connect("Progress(Long64_t,Long64_t)",
3951 "TSessionQueryFrame", fQueryFrame,
3952 "Progress(Long64_t,Long64_t)");
3953 fActDesc->fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
3954 "TSessionQueryFrame", fQueryFrame,
3955 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
3956 fActDesc->fProof->Connect("StopProcess(Bool_t)",
3957 "TSessionQueryFrame", fQueryFrame,
3958 "IndicateStop(Bool_t)");
3960 "ResetProgressDialog(const char*, Int_t,Long64_t,Long64_t)",
3961 "TSessionQueryFrame", fQueryFrame,
3962 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)");
3963 // enable timer used for status bar icon's animation
3964 EnableTimer();
3965 // change status bar right icon to connected pixmap
3966 ChangeRightLogo("monitor01.xpm");
3967 // do not animate yet
3969 // connect to signal "query result ready"
3970 fActDesc->fProof->Connect("QueryResultReady(char *)",
3971 "TSessionViewer", this, "QueryResultReady(char *)");
3972 // display connection information on status bar
3973 TString msg;
3974 msg.Form("PROOF Cluster %s ready", fActDesc->fName.Data());
3975 fStatusBar->SetText(msg.Data(), 1);
3988 // update session information frame
3991 if (fActFrame != fSessionFrame) {
3995 }
3996 }
3997 }
3998 if (desc->fLogLevel < 0)
3999 desc->fLogLevel = 0;
4000 found = kTRUE;
4001 break;
4002 }
4003 }
4004 if (found) continue;
4005 newdesc = new TSessionDescription();
4006 // and fill information from Proof session
4007 newdesc->fTag = d->GetName();
4008 newdesc->fName = d->GetTitle();
4009 newdesc->fAddress = d->GetTitle();
4010 newdesc->fConnected = kFALSE;
4011 newdesc->fAttached = kFALSE;
4012 newdesc->fProofMgr = mgr;
4013 p = d->GetProof();
4014 if (p) {
4015 newdesc->fConnected = kTRUE;
4016 newdesc->fAttached = kTRUE;
4017 if (p->IsLite())
4018 newdesc->fAddress = "lite://";
4019 else
4020 newdesc->fAddress = p->GetMaster();
4021 newdesc->fConfigFile = p->GetConfFile();
4022 newdesc->fUserName = p->GetUser();
4023 newdesc->fPort = p->GetPort();
4024 newdesc->fLogLevel = p->GetLogLevel();
4025 newdesc->fProof = p;
4026 newdesc->fProof->Connect("Progress(Long64_t,Long64_t)",
4027 "TSessionQueryFrame", fQueryFrame,
4028 "Progress(Long64_t,Long64_t)");
4029 newdesc->fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
4030 "TSessionQueryFrame", fQueryFrame,
4031 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
4032 newdesc->fProof->Connect("StopProcess(Bool_t)",
4033 "TSessionQueryFrame", fQueryFrame,
4034 "IndicateStop(Bool_t)");
4035 newdesc->fProof->Connect(
4036 "ResetProgressDialog(const char*, Int_t,Long64_t,Long64_t)",
4037 "TSessionQueryFrame", fQueryFrame,
4038 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)");
4039 // enable timer used for status bar icon's animation
4040 EnableTimer();
4041 // change status bar right icon to connected pixmap
4042 ChangeRightLogo("monitor01.xpm");
4043 // do not animate yet
4045 // connect to signal "query result ready"
4046 newdesc->fProof->Connect("QueryResultReady(char *)",
4047 "TSessionViewer", this, "QueryResultReady(char *)");
4048 }
4049 newdesc->fQueries = new TList();
4050 newdesc->fPackages = new TList();
4051 if (newdesc->fLogLevel < 0)
4052 newdesc->fLogLevel = 0;
4053 newdesc->fActQuery = 0;
4054 newdesc->fLocal = kFALSE;
4055 newdesc->fSync = kFALSE;
4056 newdesc->fAutoEnable = kFALSE;
4057 newdesc->fNbHistos = 0;
4058 // add new session description in list tree
4059 if (p)
4060 item = fSessionHierarchy->AddItem(fSessionItem, newdesc->fName.Data(),
4062 else
4063 item = fSessionHierarchy->AddItem(fSessionItem, newdesc->fName.Data(),
4065 fSessionHierarchy->SetToolTipItem(item, "Proof Session");
4066 item ->SetUserData(newdesc);
4067 // and in our session description list
4068 fSessions->Add(newdesc);
4069 }
4070 }
4071 return;
4072 }
4073 TIter nextp(proofs);
4074 TProof *proof;
4075 // loop over existing Proof sessions
4076 while ((proof = (TProof *)nextp())) {
4077 TIter nexts(fSessions);
4078 found = kFALSE;
4079 // check if session is already in the list
4080 while ((desc = (TSessionDescription *)nexts())) {
4081 if (desc->fProof == proof) {
4082 desc->fConnected = kTRUE;
4083 desc->fAttached = kTRUE;
4084 found = kTRUE;
4085 break;
4086 }
4087 }
4088 if (found) continue;
4089 // create new session description
4090 newdesc = new TSessionDescription();
4091 // and fill information from Proof session
4092 newdesc->fName = proof->GetMaster();
4093 newdesc->fConfigFile = proof->GetConfFile();
4094 newdesc->fUserName = proof->GetUser();
4095 newdesc->fPort = proof->GetPort();
4096 newdesc->fLogLevel = proof->GetLogLevel();
4097 if (newdesc->fLogLevel < 0)
4098 newdesc->fLogLevel = 0;
4099 if (proof->IsLite())
4100 newdesc->fAddress = "lite://";
4101 else
4102 newdesc->fAddress = proof->GetMaster();
4103 newdesc->fQueries = new TList();
4104 newdesc->fPackages = new TList();
4105 newdesc->fProof = proof;
4106 newdesc->fActQuery = 0;
4107 newdesc->fConnected = kTRUE;
4108 newdesc->fAttached = kTRUE;
4109 newdesc->fLocal = kFALSE;
4110 newdesc->fSync = kFALSE;
4111 newdesc->fAutoEnable = kFALSE;
4112 newdesc->fNbHistos = 0;
4113 // add new session description in list tree
4114 item = fSessionHierarchy->AddItem(fSessionItem, newdesc->fName.Data(),
4116 fSessionHierarchy->SetToolTipItem(item, "Proof Session");
4117 item ->SetUserData(newdesc);
4118 // and in our session description list
4119 fSessions->Add(newdesc);
4120 }
4121 }
4122}
4123
4124////////////////////////////////////////////////////////////////////////////////
4125/// Update list of existing Proof sessions.
4126
4128{
4129 // get list of proof sessions
4130 TGListTreeItem *item;
4131 TList *sessions = fActDesc->fProofMgr->QuerySessions("");
4132 if (sessions) {
4133 TIter nextp(sessions);
4134 TProofDesc *pdesc;
4135 TProof *proof;
4136 TSessionDescription *newdesc;
4137 // loop over existing Proof sessions
4138 while ((pdesc = (TProofDesc *)nextp())) {
4139 TIter nexts(fSessions);
4140 TSessionDescription *desc = 0;
4141 Bool_t found = kFALSE;
4142 // check if session is already in the list
4143 while ((desc = (TSessionDescription *)nexts())) {
4144 if ((desc->fTag == pdesc->GetName()) ||
4145 (desc->fName == pdesc->GetTitle())) {
4146 desc->fConnected = kTRUE;
4147 found = kTRUE;
4148 break;
4149 }
4150 }
4151 if (found) continue;
4152 // create new session description
4153 newdesc = new TSessionDescription();
4154 // and fill information from Proof session
4155 newdesc->fTag = pdesc->GetName();
4156 newdesc->fName = pdesc->GetTitle();
4157 proof = pdesc->GetProof();
4158 if (proof) {
4159 newdesc->fConfigFile = proof->GetConfFile();
4160 newdesc->fUserName = proof->GetUser();
4161 newdesc->fPort = proof->GetPort();
4162 newdesc->fLogLevel = proof->GetLogLevel();
4163 if (newdesc->fLogLevel < 0)
4164 newdesc->fLogLevel = 0;
4165 if (proof->IsLite())
4166 newdesc->fAddress = "lite://";
4167 else
4168 newdesc->fAddress = proof->GetMaster();
4169 newdesc->fProof = proof;
4170 }
4171 else {
4172 newdesc->fProof = 0;
4173 newdesc->fConfigFile = "";
4174 newdesc->fUserName = fActDesc->fUserName;
4175 newdesc->fPort = fActDesc->fPort;
4176 newdesc->fLogLevel = 0;
4177 newdesc->fAddress = fActDesc->fAddress;
4178 }
4179 newdesc->fQueries = new TList();
4180 newdesc->fPackages = new TList();
4181 newdesc->fProofMgr = fActDesc->fProofMgr;
4182 newdesc->fActQuery = 0;
4183 newdesc->fConnected = kTRUE;
4184 newdesc->fAttached = kFALSE;
4185 newdesc->fLocal = kFALSE;
4186 newdesc->fSync = kFALSE;
4187 newdesc->fAutoEnable = kFALSE;
4188 newdesc->fNbHistos = 0;
4189 // add new session description in list tree
4190 item = fSessionHierarchy->AddItem(fSessionItem, newdesc->fName.Data(),
4192 fSessionHierarchy->SetToolTipItem(item, "Proof Session");
4193 item ->SetUserData(newdesc);
4194 // and in our session description list
4195 fSessions->Add(newdesc);
4196 // set actual description to the last one
4197 }
4198 }
4199}
4200
4201////////////////////////////////////////////////////////////////////////////////
4202/// Save actual configuration in config file "filename".
4203
4204void TSessionViewer::WriteConfiguration(const char *filename)
4205{
4206 TSessionDescription *session;
4207 TQueryDescription *query;
4208 Int_t scnt = 0, qcnt = 1;
4209 const char *fname = filename ? filename : fConfigFile.Data();
4210
4211 delete fViewerEnv;
4212 gSystem->Unlink(fname);
4213 fViewerEnv = new TEnv();
4214
4215 fViewerEnv->SetValue("Option.Feedback",
4217 fViewerEnv->SetValue("Option.MasterHistos",
4219 fViewerEnv->SetValue("Option.MasterEvents",
4221 fViewerEnv->SetValue("Option.WorkerEvents",
4223
4224 Int_t i = 0;
4225 // browse list of feedback histos and check user's selected ones
4226 while (kFeedbackHistos[i]) {
4227 fViewerEnv->SetValue(Form("Option.%s",kFeedbackHistos[i]),
4229 i++;
4230 }
4231
4233 while ((session = (TSessionDescription *) snext())) {
4234 if ((scnt > 0) && ((session->fAddress.Length() < 3) ||
4235 session->fUserName.Length() < 2)) {
4236 // skip gROOT's list of sessions
4237 continue;
4238 }
4239 if ((scnt > 0) && (session->fName == session->fAddress)) {
4240 // skip gROOT's list of proofs
4241 continue;
4242 }
4243 TString sessionstring;
4244 sessionstring += session->fName;
4245 sessionstring += ";";
4246 sessionstring += session->fTag.Length() > 1 ? session->fTag.Data() : " ";
4247 sessionstring += ";";
4248 sessionstring += session->fAddress;
4249 sessionstring += ";";
4250 sessionstring += TString::Format("%d", session->fPort);
4251 sessionstring += ";";
4252 sessionstring += TString::Format("%d", session->fLogLevel);
4253 sessionstring += ";";
4254 sessionstring += session->fConfigFile.Length() > 1 ? session->fConfigFile.Data() : " ";
4255 sessionstring += ";";
4256 sessionstring += session->fUserName;
4257 sessionstring += ";";
4258 sessionstring += TString::Format("%d", session->fSync);
4259 sessionstring += ";";
4260 sessionstring += TString::Format("%d", session->fAutoEnable);
4261 if (scnt > 0) // skip local session
4262 fViewerEnv->SetValue(Form("SessionDescription.%d",scnt), sessionstring);
4263 scnt++;
4264
4265 TIter qnext(session->fQueries);
4266 while ((query = (TQueryDescription *) qnext())) {
4267 TString querystring;
4268 querystring += TString::Format("%d", query->fStatus);
4269 querystring += ";";
4270 querystring += query->fReference.Length() > 1 ? query->fReference.Data() : " ";
4271 querystring += ";";
4272 querystring += query->fQueryName;
4273 querystring += ";";
4274 querystring += query->fSelectorString.Length() > 1 ? query->fSelectorString.Data() : " ";
4275 querystring += ";";
4276 querystring += query->fTDSetString.Length() > 1 ? query->fTDSetString.Data() : " ";
4277 querystring += ";";
4278 querystring += query->fOptions.Length() > 1 ? query->fOptions.Data() : " ";
4279 querystring += ";";
4280 querystring += query->fEventList.Length() > 1 ? query->fEventList.Data() : " ";
4281 querystring += ";";
4282 querystring += TString::Format("%d",query->fNbFiles);
4283 querystring += ";";
4284 querystring += TString::Format("%lld",query->fNoEntries);
4285 querystring += ";";
4286 querystring += TString::Format("%lld",query->fFirstEntry);
4287 fViewerEnv->SetValue(Form("QueryDescription.%d",qcnt), querystring);
4288 qcnt++;
4289 }
4290 }
4291
4292 fViewerEnv->WriteFile(fname);
4293}
4294
4295////////////////////////////////////////////////////////////////////////////////
4296/// Build main session viewer frame and subframes.
4297
4299{
4300 TString buf;
4301 fActDesc = 0;
4302 fActFrame = 0;
4303 fLogWindow = 0;
4304 fBusy = kFALSE;
4305 fAutoSave = kTRUE;
4307 fStart = fElapsed = 0;
4308
4310 // set minimun size
4311 SetWMSizeHints(400 + 200, 370+50, 2000, 1000, 1, 1);
4312
4313 // collect icons
4314 fLocal = fClient->GetPicture("local_session.xpm");
4315 fProofCon = fClient->GetPicture("proof_connected.xpm");
4316 fProofDiscon = fClient->GetPicture("proof_disconnected.xpm");
4317 fQueryCon = fClient->GetPicture("query_connected.xpm");
4318 fQueryDiscon = fClient->GetPicture("query_disconnected.xpm");
4319 fBaseIcon = fClient->GetPicture("proof_base.xpm");
4320
4321 //--- File menu
4323 fFileMenu->AddEntry("&Load Config...", kFileLoadConfig);
4324 fFileMenu->AddEntry("&Save Config...", kFileSaveConfig);
4326 fFileMenu->AddEntry("&Close Viewer", kFileCloseViewer);
4328 fFileMenu->AddEntry("&Quit ROOT", kFileQuit);
4329
4330 //--- Session menu
4331 fSessionMenu = new TGPopupMenu(gClient->GetDefaultRoot());
4332 fSessionMenu->AddLabel("Session Management");
4334 fSessionMenu->AddEntry("&New Session", kSessionNew);
4335 fSessionMenu->AddEntry("&Add to the list", kSessionAdd);
4338 fSessionMenu->AddEntry("&Connect...", kSessionConnect);
4339 fSessionMenu->AddEntry("&Disconnect", kSessionDisconnect);
4340 fSessionMenu->AddEntry("Shutdo&wn", kSessionShutdown);
4341 fSessionMenu->AddEntry("&Show status",kSessionShowStatus);
4342 fSessionMenu->AddEntry("&Get Queries",kSessionGetQueries);
4347
4348 //--- Query menu
4349 fQueryMenu = new TGPopupMenu(gClient->GetDefaultRoot());
4350 fQueryMenu->AddLabel("Query Management");
4352 fQueryMenu->AddEntry("&New...", kQueryNew);
4353 fQueryMenu->AddEntry("&Edit", kQueryEdit);
4354 fQueryMenu->AddEntry("&Submit", kQuerySubmit);
4356 fQueryMenu->AddEntry("Start &Viewer", kQueryStartViewer);
4358 fQueryMenu->AddEntry("&Delete", kQueryDelete);
4359
4360 fViewerEnv = 0;
4361#ifdef WIN32
4363#else
4365#endif
4366
4368 Int_t i = 0;
4369 while (kFeedbackHistos[i]) {
4371 i++;
4372 }
4373 fCascadeMenu->AddEntry("User defined...", 50);
4374 // disable it for now (until implemented)
4376
4377 //--- Options menu
4379 fOptionsMenu->AddLabel("Global Options");
4381 fOptionsMenu->AddEntry("&Autosave Config", kOptionsAutoSave);
4383 fOptionsMenu->AddEntry("Master &Histos", kOptionsStatsHist);
4384 fOptionsMenu->AddEntry("&Master Events", kOptionsStatsTrace);
4385 fOptionsMenu->AddEntry("&Worker Events", kOptionsSlaveStatsTrace);
4387 fOptionsMenu->AddEntry("Feedback &Active", kOptionsFeedback);
4389 fOptionsMenu->AddPopup("&Feedback Histos", fCascadeMenu);
4391
4392 //--- Help menu
4393 fHelpMenu = new TGPopupMenu(gClient->GetDefaultRoot());
4394 fHelpMenu->AddEntry("&About ROOT...", kHelpAbout);
4395
4396 fFileMenu->Associate(this);
4397 fSessionMenu->Associate(this);
4398 fQueryMenu->Associate(this);
4399 fOptionsMenu->Associate(this);
4400 fCascadeMenu->Associate(this);
4401 fHelpMenu->Associate(this);
4402
4403 //--- create menubar and add popup menus
4404 fMenuBar = new TGMenuBar(this, 1, 1, kHorizontalFrame);
4405
4407 kLHintsLeft, 0, 4, 0, 0));
4409 kLHintsLeft, 0, 4, 0, 0));
4411 kLHintsLeft, 0, 4, 0, 0));
4413 kLHintsLeft, 0, 4, 0, 0));
4415 kLHintsRight));
4416
4417 TGHorizontal3DLine *toolBarSep = new TGHorizontal3DLine(this);
4418 AddFrame(toolBarSep, new TGLayoutHints(kLHintsTop | kLHintsExpandX));
4419
4421 kLHintsExpandX, 0, 0, 1, 1));
4422
4423 toolBarSep = new TGHorizontal3DLine(this);
4424 AddFrame(toolBarSep, new TGLayoutHints(kLHintsTop | kLHintsExpandX));
4425
4426 //---- toolbar
4427
4428 int spacing = 8;
4429 fToolBar = new TGToolBar(this, 60, 20, kHorizontalFrame);
4430 for (int ii = 0; xpm_toolbar[ii]; ii++) {
4431 tb_data[ii].fPixmap = xpm_toolbar[ii];
4432 if (strlen(xpm_toolbar[ii]) == 0) {
4433 spacing = 8;
4434 continue;
4435 }
4436 fToolBar->AddButton(this, &tb_data[ii], spacing);
4437 spacing = 0;
4438 }
4440 toolBarSep = new TGHorizontal3DLine(this);
4441 AddFrame(toolBarSep, new TGLayoutHints(kLHintsTop | kLHintsExpandX));
4444
4447 fPopupSrv->AddEntry("Disconnect",kSessionDisconnect);
4448 fPopupSrv->AddEntry("Shutdown",kSessionShutdown);
4450 fPopupSrv->AddEntry("Show status",kSessionShowStatus);
4451 fPopupSrv->AddEntry("Delete", kSessionDelete);
4452 fPopupSrv->AddEntry("Get Queries",kSessionGetQueries);
4454 fPopupSrv->AddEntry("Cleanup", kSessionCleanup);
4456 fPopupSrv->Connect("Activated(Int_t)","TSessionViewer", this,
4457 "MyHandleMenu(Int_t)");
4458
4460 fPopupQry->AddEntry("Edit",kQueryEdit);
4461 fPopupQry->AddEntry("Submit",kQuerySubmit);
4463 fPopupQry->AddEntry("Start &Viewer", kQueryStartViewer);
4465 fPopupQry->AddEntry("Delete",kQueryDelete);
4466 fPopupQry->Connect("Activated(Int_t)","TSessionViewer", this,
4467 "MyHandleMenu(Int_t)");
4468
4469
4484
4485 //--- Horizontal mother frame -----------------------------------------------
4486 fHf = new TGHorizontalFrame(this, 10, 10);
4488
4489 //--- fV1 -------------------------------------------------------------------
4490 fV1 = new TGVerticalFrame(fHf, 100, 100, kFixedWidth);
4492
4493 fTreeView = new TGCanvas(fV1, 100, 200, kSunkenFrame | kDoubleBorder);
4495 2, 0, 0, 0));
4498 fSessionHierarchy->Connect("Clicked(TGListTreeItem*,Int_t,Int_t,Int_t)",
4499 "TSessionViewer", this,
4500 "OnListTreeClicked(TGListTreeItem*, Int_t, Int_t, Int_t)");
4501 fSessionHierarchy->Connect("DoubleClicked(TGListTreeItem*,Int_t)",
4502 "TSessionViewer", this,
4503 "OnListTreeDoubleClicked(TGListTreeItem*, Int_t)");
4505
4506 //--- fV2 -------------------------------------------------------------------
4507 fV2 = new TGVerticalFrame(fHf, 350, 310);
4509
4510 //--- Server Frame ----------------------------------------------------------
4511 fServerFrame = new TSessionServerFrame(fV2, 350, 310);
4512 fSessions = new TList;
4514 fServerFrame->Build(this);
4516 kLHintsExpandY, 2, 0, 1, 2));
4517
4518 //--- Session Frame ---------------------------------------------------------
4519 fSessionFrame = new TSessionFrame(fV2, 350, 310);
4520 fSessionFrame->Build(this);
4522 kLHintsExpandY, 2, 0, 1, 2));
4523
4524 //--- Query Frame -----------------------------------------------------------
4525 fQueryFrame = new TSessionQueryFrame(fV2, 350, 310);
4526 fQueryFrame->Build(this);
4528 kLHintsExpandY, 2, 0, 1, 2));
4529
4530 //--- Output Frame ----------------------------------------------------------
4531 fOutputFrame = new TSessionOutputFrame(fV2, 350, 310);
4532 fOutputFrame->Build(this);
4534 kLHintsExpandY, 2, 0, 1, 2));
4535
4536 //--- Input Frame -----------------------------------------------------------
4537 fInputFrame = new TSessionInputFrame(fV2, 350, 310);
4538 fInputFrame->Build(this);
4540 kLHintsExpandY, 2, 0, 1, 2));
4541
4543
4544 // add vertical splitter between list tree and frames
4546 splitter->SetFrame(fV1, kTRUE);
4550
4553
4556
4557 // if description available, update server infos frame
4558 if (fActDesc) {
4559 if (!fActDesc->fLocal) {
4561 }
4562 else {
4565 }
4566 }
4567
4568 //--- Status Bar ------------------------------------------------------------
4569 int parts[] = { 36, 49, 15 };
4570 fStatusBar = new TGStatusBar(this, 10, 10);
4572 fStatusBar->SetParts(parts, 3);
4573 for (int p = 0; p < 3; ++p)
4576 kLHintsExpandX, 0, 0, 1, 1));
4577
4578 // connection icon (animation) and time info
4579 fStatusBar->SetText(" 00:00:00", 2);
4580 TGCompositeFrame *leftpart = fStatusBar->GetBarPart(2);
4581 fRightIconPicture = (TGPicture *)fClient->GetPicture("proof_disconnected.xpm");
4582 fRightIcon = new TGIcon(leftpart, fRightIconPicture,
4584 leftpart->AddFrame(fRightIcon, new TGLayoutHints(kLHintsLeft, 2, 0, 0, 0));
4585
4586 // connection progress bar
4587 TGCompositeFrame *rightpart = fStatusBar->GetBarPart(0);
4590 fConnectProg->SetBarColor("green");
4591 rightpart->AddFrame(fConnectProg, new TGLayoutHints(kLHintsExpandX, 1, 1, 1, 1));
4592
4593 // add user info
4595 buf.Form("User : %s - %s", fUserGroup->fRealName.Data(),
4597 fStatusBar->SetText(buf.Data(), 1);
4598
4599 fTimer = 0;
4600
4601 // create context menu
4602 fContextMenu = new TContextMenu("SessionViewerContextMenu") ;
4603
4604 SetWindowName("ROOT Session Viewer");
4605 MapSubwindows();
4606 MapWindow();
4607
4608 // hide frames
4618 Resize(610, 420);
4619}
4620
4621////////////////////////////////////////////////////////////////////////////////
4622/// Destructor.
4623
4625{
4626 delete fUserGroup;
4627 if (gSessionViewer == this)
4628 gSessionViewer = 0;
4629}
4630
4631////////////////////////////////////////////////////////////////////////////////
4632/// Handle mouse clicks in list tree.
4633
4635 Int_t x, Int_t y)
4636{
4637 TList *objlist;
4638 TObject *obj;
4639 TString msg;
4640
4644 if (entry->GetParent() == 0) { // PROOF
4645 // switch frames only if actual one doesn't match
4646 if (fActFrame != fServerFrame) {
4650 }
4659 }
4660 else if (entry->GetParent()->GetParent() == 0) { // Server
4661 if (entry->GetUserData()) {
4662 obj = (TObject *)entry->GetUserData();
4663 if (!obj || obj->IsA() != TSessionDescription::Class())
4664 return;
4665 // update server frame information
4668 // if Proof valid, update connection infos
4671 fActDesc->fProof->cd();
4672 msg.Form("PROOF Cluster %s ready", fActDesc->fName.Data());
4673 }
4674 else {
4675 msg.Form("PROOF Cluster %s not connected", fActDesc->fName.Data());
4676 }
4677 fStatusBar->SetText(msg.Data(), 1);
4678 }
4679 if ((fActDesc->fConnected) && (fActDesc->fAttached)) {
4686 }
4687 else {
4692 }
4693 // local session
4694 if (fActDesc->fLocal) {
4695 if (fActFrame != fSessionFrame) {
4701 }
4705 }
4706 // proof session not connected
4707 if ((!fActDesc->fLocal) && (!fActDesc->fAttached) &&
4708 (fActFrame != fServerFrame)) {
4712 }
4713 // proof session connected
4714 if ((!fActDesc->fLocal) && (fActDesc->fConnected) &&
4715 (fActDesc->fAttached)) {
4716 if (fActFrame != fSessionFrame) {
4720 }
4722 }
4725 if (fActDesc->fAutoEnable)
4727 else
4729 // update session information frame
4734 }
4735 else if (entry->GetParent()->GetParent()->GetParent() == 0) { // query
4736 obj = (TObject *)entry->GetParent()->GetUserData();
4737 if (obj && obj->IsA() == TSessionDescription::Class()) {
4739 }
4740 obj = (TObject *)entry->GetUserData();
4741 if (obj && obj->IsA() == TQueryDescription::Class()) {
4743 }
4744 // update query information and buttons state
4747 if (fActFrame != fQueryFrame) {
4751 }
4752 if ((fActDesc->fConnected) && (fActDesc->fAttached) &&
4757 // trick to update feedback histos
4758 OnCascadeMenu();
4759 }
4760 else { // a list (input, output)
4761 obj = (TObject *)entry->GetParent()->GetParent()->GetUserData();
4762 if (obj && obj->IsA() == TSessionDescription::Class()) {
4764 }
4765 obj = (TObject *)entry->GetParent()->GetUserData();
4766 if (obj && obj->IsA() == TQueryDescription::Class()) {
4768 }
4769 if (fActDesc->fActQuery) {
4770 // update input/output list views
4773 if (fActDesc->fActQuery->fResult) {
4774 objlist = fActDesc->fActQuery->fResult->GetOutputList();
4775 if (objlist) {
4776 TIter nexto(objlist);
4777 while ((obj = (TObject *) nexto())) {
4778 fOutputFrame->AddObject(obj);
4779 }
4780 }
4781 objlist = fActDesc->fActQuery->fResult->GetInputList();
4782 if (objlist) {
4783 TIter nexti(objlist);
4784 while ((obj = (TObject *) nexti())) {
4785 fInputFrame->AddObject(obj);
4786 }
4787 }
4788 }
4789 else {
4790 TChain *chain = (TChain *)fActDesc->fActQuery->fChain;
4791 if (chain && chain->GetPlayer()) {
4792 objlist = chain->GetPlayer()->GetSelectorFromFile()->GetOutputList();
4793 if (objlist) {
4794 TIter nexto(objlist);
4795 while ((obj = (TObject *) nexto())) {
4796 fOutputFrame->AddObject(obj);
4797 }
4798 }
4799 }
4800 }
4805 }
4806 // switch frames
4807 if (strstr(entry->GetText(),"Output")) {
4808 if (fActFrame != fOutputFrame) {
4812 }
4813 }
4814 else if (strstr(entry->GetText(),"Input")) {
4815 if (fActFrame != fInputFrame) {
4819 }
4820 }
4821 }
4822 if (btn == 3) { // right button
4823 // place popup menus
4825 if (!item) return;
4826 obj = (TObject *)item->GetUserData();
4827 if (obj && obj->IsA() == TQueryDescription::Class()) {
4828 fPopupQry->PlaceMenu(x, y, 1, 1);
4829 }
4830 else if (obj && obj->IsA() == TSessionDescription::Class()) {
4831 if (!fActDesc->fLocal)
4832 fPopupSrv->PlaceMenu(x, y, 1, 1);
4833 }
4834 }
4835 // enable / disable menu entries
4853 }
4854 else {
4859 if (entry->GetParent() != 0)
4874 }
4875 if (fActDesc->fLocal) {
4888 }
4889}
4890
4891////////////////////////////////////////////////////////////////////////////////
4892/// Handle mouse double clicks in list tree (connect to server).
4893
4895{
4896 if (entry == fSessionItem)
4897 return;
4898 if (entry->GetParent()->GetParent() == 0) { // Server
4899 if (entry->GetUserData()) {
4900 TObject *obj = (TObject *)entry->GetUserData();
4901 if ((!obj) || (obj->IsA() != TSessionDescription::Class()))
4902 return;
4904 // if Proof valid, update connection infos
4905 }
4906 if ((!fActDesc->fLocal) && ((!fActDesc->fConnected) ||
4907 (!fActDesc->fAttached))) {
4909 }
4910 }
4911}
4912
4913////////////////////////////////////////////////////////////////////////////////
4914/// Terminate Session : save configuration, clean temporary files and close
4915/// Proof connections.
4916
4918{
4919 // clean-up temporary files
4920 TString pathtmp;
4922 if (!gSystem->AccessPathName(pathtmp)) {
4923 gSystem->Unlink(pathtmp);
4924 }
4926 if (!gSystem->AccessPathName(pathtmp)) {
4927 gSystem->Unlink(pathtmp);
4928 }
4929 // close opened Proof sessions (if any)
4930 TIter next(fSessions);
4931 TSessionDescription *desc = 0;
4932 while ((desc = (TSessionDescription *)next())) {
4933 if (desc->fAttached && desc->fProof &&
4934 desc->fProof->IsValid())
4935 desc->fProof->Detach();
4936 }
4937 // Save configuration
4938 if (fAutoSave)
4940}
4941
4942////////////////////////////////////////////////////////////////////////////////
4943/// Close main Session Viewer window.
4944
4946{
4947 // clean-up temporary files
4948 TString pathtmp;
4950 if (!gSystem->AccessPathName(pathtmp)) {
4951 gSystem->Unlink(pathtmp);
4952 }
4954 if (!gSystem->AccessPathName(pathtmp)) {
4955 gSystem->Unlink(pathtmp);
4956 }
4957 // Save configuration
4958 if (fAutoSave)
4960 Cleanup();
4961 fSessions->Delete();
4962 if (fSessionItem)
4964 delete fSessionHierarchy; // this has been put int TGCanvas which isn't a
4965 // TGComposite frame and doesn't do cleanups.
4972 delete fTimer;
4973 DeleteWindow();
4974}
4975
4976////////////////////////////////////////////////////////////////////////////////
4977/// Change the right logo (used for animation).
4978
4980{
4984}
4985
4986////////////////////////////////////////////////////////////////////////////////
4987/// Enable animation timer.
4988
4990{
4991 if (!fTimer) fTimer = new TTimer(this, 500);
4992 fTimer->Reset();
4993 fTimer->TurnOn();
4994 time( &fStart );
4995}
4996
4997////////////////////////////////////////////////////////////////////////////////
4998/// Disable animation timer.
4999
5001{
5002 if (fTimer)
5003 fTimer->TurnOff();
5004 ChangeRightLogo("proof_disconnected.xpm");
5005}
5006
5007////////////////////////////////////////////////////////////////////////////////
5008/// Handle animation timer.
5009
5011{
5012 TString buf;
5013 struct tm *connected;
5014 Int_t count = gRandom->Integer(4);
5015 if (count > 3) {
5016 count = 0;
5017 }
5018 if (fChangePic)
5019 ChangeRightLogo(xpm_names[count]);
5020 time( &fElapsed );
5021 time_t elapsed_time = (time_t)difftime( fElapsed, fStart );
5022 connected = gmtime( &elapsed_time );
5023 if (connected) {
5024 buf.Form(" %02d:%02d:%02d", connected->tm_hour,
5025 connected->tm_min, connected->tm_sec);
5026 fStatusBar->SetText(buf.Data(), 2);
5027 }
5028 else {
5029 fStatusBar->SetText(" 00:00:00", 2);
5030 }
5031
5032 if (fActDesc->fLocal) {
5033 if ((fActDesc->fActQuery) &&
5036 TChain *chain = (TChain *)fActDesc->fActQuery->fChain;
5037 if (chain)
5039 chain->GetReadEntry()+1);
5040 }
5041 }
5042
5043 fTimer->Reset();
5044 return kTRUE;
5045}
5046
5047////////////////////////////////////////////////////////////////////////////////
5048/// Load/append a log msg in the log frame.
5049
5050void TSessionViewer::LogMessage(const char *msg, Bool_t all)
5051{
5052 if (fLogWindow) {
5053 if (all) {
5054 // load buffer
5055 fLogWindow->LoadBuffer(msg);
5056 } else {
5057 // append
5058 fLogWindow->AddBuffer(msg);
5059 }
5060 }
5061}
5062
5063////////////////////////////////////////////////////////////////////////////////
5064/// Handle signal "query result ready" coming from Proof session.
5065
5067{
5068 TString strtmp;
5069 strtmp.Form("Query Result Ready for %s", query);
5070 // show information on status bar
5071 ShowInfo(strtmp.Data());
5072 TGListTreeItem *item=0, *item2=0;
5073 TQueryDescription *lquery = 0;
5074 // loop over actual queries to find which one is ready
5075
5076 TIter nexts(fSessions);
5077 TSessionDescription *desc = 0;
5078 // check if session is already in the list
5079 while ((desc = (TSessionDescription *)nexts())) {
5080 if (desc && !desc->fAttached)
5081 continue;
5082 TIter nextp(desc->fQueries);
5083 while ((lquery = (TQueryDescription *)nextp())) {
5084 if (lquery->fReference.Contains(query)) {
5085 // results are ready for this query
5086 lquery->fResult = desc->fProof->GetQueryResult(query);
5088 if (!lquery->fResult)
5089 break;
5090 // get query status
5091 lquery->fStatus = lquery->fResult->IsFinalized() ?
5094 // get data set
5095 TObject *o = lquery->fResult->GetInputObject("TDSet");
5096 if (o)
5097 lquery->fChain = (TDSet *) o;
5099 if (item) {
5100 item2 = fSessionHierarchy->FindItemByObj(item, lquery);
5101 }
5102 if (item2) {
5103 // add input and output list entries
5104 if (lquery->fResult->GetInputList())
5105 if (!fSessionHierarchy->FindChildByName(item2, "InputList"))
5106 fSessionHierarchy->AddItem(item2, "InputList");
5107 if (lquery->fResult->GetOutputList())
5108 if (!fSessionHierarchy->FindChildByName(item2, "OutputList"))
5109 fSessionHierarchy->AddItem(item2, "OutputList");
5110 }
5111 // update list tree, query frame information, and buttons state
5115 fQueryFrame->UpdateButtons(lquery);
5116 break;
5117 }
5118 }
5119 }
5120}
5121
5122////////////////////////////////////////////////////////////////////////////////
5123/// Clean-up Proof session.
5124
5126{
5128 if (!item) return;
5129 TObject *obj = (TObject *)item->GetUserData();
5130 if (!obj || obj->IsA() != TSessionDescription::Class()) return;
5131 if (!fActDesc->fProof || !fActDesc->fProof->IsValid()) return;
5132 TString m;
5133 m.Form("Are you sure to cleanup the session \"%s::%s\"",
5135 Int_t result;
5136 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), 0,
5137 kMBYes | kMBNo | kMBCancel, &result);
5138 if (result == kMBYes) {
5139 // send cleanup request for the session specified by the tag reference
5140 TString sessiontag;
5141 sessiontag.Form("session-%s",fActDesc->fTag.Data());
5142 fActDesc->fProof->CleanupSession(sessiontag.Data());
5143 // clear the list of queries
5147 if (fAutoSave)
5149 }
5150 // update list tree
5153}
5154
5155////////////////////////////////////////////////////////////////////////////////
5156/// Reset Proof session.
5157
5159{
5161 if (!item) return;
5162 TObject *obj = (TObject *)item->GetUserData();
5163 if (!obj || obj->IsA() != TSessionDescription::Class()) return;
5164 if (!fActDesc->fProof || !fActDesc->fProof->IsValid()) return;
5165 TString m;
5166 m.Form("Do you really want to reset the session \"%s::%s\"",
5168 Int_t result;
5169 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), 0,
5170 kMBYes | kMBNo | kMBCancel, &result);
5171 if (result == kMBYes) {
5172 // reset the session
5174 if (mgr && mgr->IsValid()) {
5175 mgr->Reset(fActDesc->fUserName);
5176 }
5177 // reset connected flag
5179 fActDesc->fProof = 0;
5180 // disable animation timer
5181 DisableTimer();
5182 // change list tree item picture to disconnected pixmap
5185 if (item2) item2->SetPictures(fProofDiscon, fProofDiscon);
5186
5190 fStatusBar->SetText("", 1);
5191 }
5192 // update list tree
5195}
5196
5197////////////////////////////////////////////////////////////////////////////////
5198/// Delete query from list tree and ask user if they want to delete it also
5199/// from server.
5200
5202{
5204 if (!item) return;
5205 TObject *obj = (TObject *)item->GetUserData();
5206 if (!obj || obj->IsA() != TQueryDescription::Class()) return;
5207 TQueryDescription *query = (TQueryDescription *)obj;
5208 TString m;
5209 Int_t result = 0;
5210
5214 new TGMsgBox(fClient->GetRoot(), this, "Delete Query",
5215 "Deleting running queries is not allowed", kMBIconExclamation,
5216 kMBOk, &result);
5217 return;
5218 }
5219 m.Form("Do you want to delete query \"%s\" from server too ?",
5220 query->fQueryName.Data());
5221 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), kMBIconQuestion,
5222 kMBYes | kMBNo | kMBCancel, &result);
5223 }
5224 else {
5225 m.Form("Dou you really want to delete query \"%s\" ?",
5226 query->fQueryName.Data());
5227 new TGMsgBox(fClient->GetRoot(), this, "", m.Data(), kMBIconQuestion,
5228 kMBOk | kMBCancel, &result);
5229 }
5230 if (result == kMBYes) {
5231 fActDesc->fProof->Remove(query->fReference.Data());
5232 fActDesc->fQueries->Remove((TObject *)query);
5234 delete query;
5235 }
5236 else if (result == kMBNo || result == kMBOk) {
5237 fActDesc->fQueries->Remove((TObject *)query);
5239 delete query;
5240 }
5243 if (fAutoSave)
5245}
5246
5247////////////////////////////////////////////////////////////////////////////////
5248/// Edit currently selected query.
5249
5251{
5253 if (!item) return;
5254 TObject *obj = (TObject *)item->GetUserData();
5255 if (!obj || obj->IsA() != TQueryDescription::Class()) return;
5256 TQueryDescription *query = (TQueryDescription *)obj;
5257 TNewQueryDlg *dlg = new TNewQueryDlg(this, 350, 310, query, kTRUE);
5258 dlg->Popup();
5259}
5260
5261////////////////////////////////////////////////////////////////////////////////
5262/// Start TreeViewer from selected TChain.
5263
5265{
5267 if (!item) return;
5268 TObject *obj = (TObject *)item->GetUserData();
5269 if (!obj || obj->IsA() != TQueryDescription::Class()) return;
5270 TQueryDescription *query = (TQueryDescription *)obj;
5271 if (!query->fChain && query->fResult &&
5272 (obj = query->fResult->GetInputObject("TDSet"))) {
5273 query->fChain = (TDSet *) obj;
5274 }
5275 if (!query->fChain) return;
5276 if (query->fChain->IsA() == TChain::Class())
5277 ((TChain *)query->fChain)->StartViewer();
5278 else if (query->fChain->IsA() == TDSet::Class())
5279 ((TDSet *)query->fChain)->StartViewer();
5280}
5281
5282////////////////////////////////////////////////////////////////////////////////
5283/// Query the list of uploaded packages from proof and display it
5284/// into a new text window.
5285
5287{
5288 Window_t wdummy;
5289 Int_t ax, ay;
5290
5291 if (fActDesc->fLocal) return;
5292 if (!fActDesc->fProof || !fActDesc->fProof->IsValid())
5293 return;
5294 TString pathtmp = TString::Format("%s/%s", gSystem->TempDirectory(),
5296 // redirect stdout/stderr to temp file
5297 if (gSystem->RedirectOutput(pathtmp.Data(), "w") != 0) {
5298 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
5299 return;
5300 }
5302 // restore stdout/stderr
5303 if (gSystem->RedirectOutput(0) != 0) {
5304 Error("ShowStatus", "stdout/stderr retore failed; skipping");
5305 return;
5306 }
5307 if (!fLogWindow) {
5308 fLogWindow = new TSessionLogView(this, 700, 100);
5309 } else {
5310 // Clear window
5311 fLogWindow->Clear();
5312 }
5313 fLogWindow->LoadFile(pathtmp.Data());
5314 gVirtualX->TranslateCoordinates(GetId(), fClient->GetDefaultRoot()->GetId(),
5315 0, 0, ax, ay, wdummy);
5316 fLogWindow->Move(ax, ay + GetHeight() + 35);
5317 fLogWindow->Popup();
5318}
5319
5320////////////////////////////////////////////////////////////////////////////////
5321/// Update the list of packages.
5322
5324{
5325 TObjString *packname;
5326 TPackageDescription *package;
5330 //fActDesc->fPackages->Clear();
5332 if(packlist) {
5333 TIter nextenabled(packlist);
5334 while ((packname = (TObjString *)nextenabled())) {
5335 package = new TPackageDescription;
5336 package->fName = packname->GetName();
5337 package->fName += ".par";
5338 package->fPathName = package->fName;
5339 package->fId = fActDesc->fPackages->GetEntries();
5340 package->fUploaded = kTRUE;
5341 package->fEnabled = kTRUE;
5342 if (!fActDesc->fPackages->FindObject(package->fName)) {
5343 fActDesc->fPackages->Add((TObject *)package);
5344 }
5345 }
5346 }
5347 packlist = fActDesc->fProof->GetListOfPackages();
5348 if(packlist) {
5349 TIter nextpack(packlist);
5350 while ((packname = (TObjString *)nextpack())) {
5351 package = new TPackageDescription;
5352 package->fName = packname->GetName();
5353 package->fName += ".par";
5354 package->fPathName = package->fName;
5355 package->fId = fActDesc->fPackages->GetEntries();
5356 package->fUploaded = kTRUE;
5357 package->fEnabled = kFALSE;
5358 if (!fActDesc->fPackages->FindObject(package->fName)) {
5359 fActDesc->fPackages->Add((TObject *)package);
5360 }
5361 }
5362 }
5363 }
5364// fSessionFrame->UpdatePackages();
5365}
5366
5367////////////////////////////////////////////////////////////////////////////////
5368/// Query list of enabled packages from proof and display it
5369/// into a new text window.
5370
5372{
5373 Window_t wdummy;
5374 Int_t ax, ay;
5375
5376 if (fActDesc->fLocal) return;
5377 if (!fActDesc->fProof || !fActDesc->fProof->IsValid())
5378 return;
5379 TString pathtmp = TString::Format("%s/%s", gSystem->TempDirectory(),
5381 // redirect stdout/stderr to temp file
5382 if (gSystem->RedirectOutput(pathtmp.Data(), "w") != 0) {
5383 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
5384 return;
5385 }
5387 // restore stdout/stderr
5388 if (gSystem->RedirectOutput(0) != 0) {
5389 Error("ShowStatus", "stdout/stderr retore failed; skipping");
5390 return;
5391 }
5392 if (!fLogWindow) {
5393 fLogWindow = new TSessionLogView(this, 700, 100);
5394 } else {
5395 // Clear window
5396 fLogWindow->Clear();
5397 }
5398 fLogWindow->LoadFile(pathtmp.Data());
5399 gVirtualX->TranslateCoordinates(GetId(), fClient->GetDefaultRoot()->GetId(),
5400 0, 0, ax, ay, wdummy);
5401 fLogWindow->Move(ax, ay + GetHeight() + 35);
5402 fLogWindow->Popup();
5403}
5404
5405////////////////////////////////////////////////////////////////////////////////
5406/// Display the content of the temporary log file for queryref
5407/// into a new text window.
5408
5409void TSessionViewer::ShowLog(const char *queryref)
5410{
5411 Window_t wdummy;
5412 Int_t ax, ay;
5413
5414 if (fActDesc->fProof) {
5415 gVirtualX->SetCursor(GetId(),gVirtualX->CreateCursor(kWatch));
5416 if (!fLogWindow) {
5417 fLogWindow = new TSessionLogView(this, 700, 100);
5418 } else {
5419 // Clear window
5420 fLogWindow->Clear();
5421 }
5422 fActDesc->fProof->Connect("LogMessage(const char*,Bool_t)",
5423 "TSessionViewer", this, "LogMessage(const char*,Bool_t)");
5426 if (queryref)
5427 fActDesc->fProof->ShowLog(queryref);
5428 else
5429 fActDesc->fProof->ShowLog(0);
5430 fActDesc->fProof->SendLogToWindow(logonly);
5431 // set log window position at the bottom of Session Viewer
5432 gVirtualX->TranslateCoordinates(GetId(),
5433 fClient->GetDefaultRoot()->GetId(), 0, 0, ax, ay, wdummy);
5434 fLogWindow->Move(ax, ay + GetHeight() + 35);
5435 fLogWindow->Popup();
5436 gVirtualX->SetCursor(GetId(), 0);
5437 }
5438}
5439
5440////////////////////////////////////////////////////////////////////////////////
5441/// Display text in status bar.
5442
5443void TSessionViewer::ShowInfo(const char *txt)
5444{
5445 fStatusBar->SetText(txt,0);
5448}
5449
5450////////////////////////////////////////////////////////////////////////////////
5451/// Retrieve and display Proof status.
5452
5454{
5455 Window_t wdummy;
5456 Int_t ax, ay;
5457
5458 if (!fActDesc->fProof || !fActDesc->fProof->IsValid())
5459 return;
5460 TString pathtmp = TString::Format("%s/%s", gSystem->TempDirectory(),
5462 // redirect stdout/stderr to temp file
5463 if (gSystem->RedirectOutput(pathtmp.Data(), "w") != 0) {
5464 Error("ShowStatus", "stdout/stderr redirection failed; skipping");
5465 return;
5466 }
5468 // restore stdout/stderr
5469 if (gSystem->RedirectOutput(0) != 0) {
5470 Error("ShowStatus", "stdout/stderr retore failed; skipping");
5471 return;
5472 }
5473 if (!fLogWindow) {
5474 fLogWindow = new TSessionLogView(this, 700, 100);
5475 } else {
5476 // Clear window
5477 fLogWindow->Clear();
5478 }
5479 fLogWindow->LoadFile(pathtmp.Data());
5480 gVirtualX->TranslateCoordinates(GetId(), fClient->GetDefaultRoot()->GetId(),
5481 0, 0, ax, ay, wdummy);
5482 fLogWindow->Move(ax, ay + GetHeight() + 35);
5483 fLogWindow->Popup();
5484}
5485
5486////////////////////////////////////////////////////////////////////////////////
5487/// Handle startup message (connection progress) coming from Proof session.
5488
5490{
5491 Float_t pos = Float_t(Double_t(done * 100)/Double_t(total));
5493 fStatusBar->SetText(msg, 1);
5494}
5495
5496////////////////////////////////////////////////////////////////////////////////
5497/// Handle session viewer custom popup menus.
5498
5500{
5501 switch (id) {
5502
5503 case kSessionDelete:
5505 break;
5506
5507 case kSessionConnect:
5509 break;
5510
5511 case kSessionDisconnect:
5513 break;
5514
5515 case kSessionShutdown:
5517 break;
5518
5519 case kSessionCleanup:
5521 break;
5522
5523 case kSessionReset:
5524 ResetSession();
5525 break;
5526
5527 case kSessionBrowse:
5528 if (fActDesc->fProof && fActDesc->fProof->IsValid()) {
5529 TBrowser *b = new TBrowser();
5531 }
5532 break;
5533
5534 case kSessionShowStatus:
5535 ShowStatus();
5536 break;
5537
5538 case kSessionGetQueries:
5540 break;
5541
5542 case kQueryEdit:
5543 EditQuery();
5544 break;
5545
5546 case kQueryDelete:
5547 DeleteQuery();
5548 break;
5549
5550 case kQueryStartViewer:
5551 StartViewer();
5552 break;
5553
5554 case kQuerySubmit:
5556 break;
5557 }
5558}
5559
5560////////////////////////////////////////////////////////////////////////////////
5561/// Handle feedback histograms configuration menu.
5562
5564{
5565 // divide stats canvas by number of selected feedback histos
5570 if (!fActDesc || !fActDesc->fActQuery) return;
5571 fActDesc->fNbHistos = 0;
5572 Int_t i = 0;
5573
5574 if (fActDesc->fAttached && fActDesc->fProof &&
5575 fActDesc->fProof->IsValid()) {
5577 // browse list of feedback histos and check user's selected ones
5578 while (kFeedbackHistos[i]) {
5579 if (fCascadeMenu->IsEntryChecked(41+i)) {
5581 }
5582 i++;
5583 }
5584 }
5585 else {
5586 // if feedback option not selected, clear Proof's feedback option
5588 }
5589 }
5590
5591 i = 0;
5592 // loop over feedback histo list
5593 while (kFeedbackHistos[i]) {
5594 // check if user has selected this histogram in the option menu
5595 if (fCascadeMenu->IsEntryChecked(41+i))
5597 i++;
5598 }
5601 if (fActDesc->fNbHistos == 4)
5603 else if (fActDesc->fNbHistos > 4)
5605 else
5607
5608 // if actual query has results, update feedback histos
5612 fQueryFrame->ResetProgressDialog("", 0, 0, 0);
5613 }
5614 else if (fActDesc->fActQuery) {
5619 }
5621}
5622////////////////////////////////////////////////////////////////////////////////
5623/// Handle messages send to the TSessionViewer object. E.g. all menu entries
5624/// messages.
5625
5627{
5628 TNewQueryDlg *dlg;
5629
5630 switch (GET_MSG(msg)) {
5631 case kC_COMMAND:
5632 switch (GET_SUBMSG(msg)) {
5633 case kCM_BUTTON:
5634 case kCM_MENU:
5635 switch (parm1) {
5636
5637 case kFileCloseViewer:
5638 CloseWindow();
5639 break;
5640
5641 case kFileLoadConfig:
5642 {
5643 TGFileInfo fi;
5646 fi.fFileTypes = conftypes;
5647 new TGFileDialog(fClient->GetRoot(), this, kFDOpen, &fi);
5648 if (fi.fFilename) {
5652 }
5653 }
5654 break;
5655
5656 case kFileSaveConfig:
5657 {
5658 TGFileInfo fi;
5661 fi.fFileTypes = conftypes;
5662 new TGFileDialog(fClient->GetRoot(), this, kFDSave, &fi);
5663 if (fi.fFilename) {
5666 }
5667 }
5668 break;
5669
5670 case kFileQuit:
5671 Terminate();
5673 delete this;
5675 break;
5676
5677 case kSessionNew:
5679 break;
5680
5681 case kSessionAdd:
5683 break;
5684
5685 case kSessionDelete:
5687 break;
5688
5689 case kSessionCleanup:
5691 break;
5692
5693 case kSessionReset:
5694 ResetSession();
5695 break;
5696
5697 case kSessionConnect:
5699 break;
5700
5701 case kSessionDisconnect:
5703 break;
5704
5705 case kSessionShutdown:
5707 break;
5708
5709 case kSessionShowStatus:
5710 ShowStatus();
5711 break;
5712
5713 case kSessionGetQueries:
5715 break;
5716
5717 case kQueryNew:
5718 dlg = new TNewQueryDlg(this, 350, 310);
5719 dlg->Popup();
5720 break;
5721
5722 case kQueryEdit:
5723 EditQuery();
5724 break;
5725
5726 case kQueryDelete:
5727 DeleteQuery();
5728 break;
5729
5730 case kQueryStartViewer:
5731 StartViewer();
5732 break;
5733
5734 case kQuerySubmit:
5736 break;
5737
5738 case kOptionsAutoSave:
5741 fAutoSave = kFALSE;
5742 }
5743 else {
5745 fAutoSave = kTRUE;
5746 }
5747 break;
5748
5749 case kOptionsStatsHist:
5752 gEnv->SetValue("Proof.StatsHist", 0);
5753 }
5754 else {
5756 gEnv->SetValue("Proof.StatsHist", 1);
5757 }
5758 break;
5759
5760 case kOptionsStatsTrace:
5763 gEnv->SetValue("Proof.StatsTrace", 0);
5764 }
5765 else {
5767 gEnv->SetValue("Proof.StatsTrace", 1);
5768 }
5769 break;
5770
5774 gEnv->SetValue("Proof.SlaveStatsTrace", 0);
5775 }
5776 else {
5778 gEnv->SetValue("Proof.SlaveStatsTrace", 1);
5779 }
5780 break;
5781
5782 case kOptionsFeedback:
5785 }
5786 else {
5788 }
5789 break;
5790
5791 case 41:
5792 case 42:
5793 case 43:
5794 case 44:
5795 case 45:
5796 case 46:
5797 if (fCascadeMenu->IsEntryChecked(parm1)) {
5798 fCascadeMenu->UnCheckEntry(parm1);
5799 }
5800 else {
5801 fCascadeMenu->CheckEntry(parm1);
5802 }
5803 OnCascadeMenu();
5804 break;
5805
5806 case 50:
5807 if (fCascadeMenu->IsEntryChecked(parm1)) {
5808 fCascadeMenu->UnCheckEntry(parm1);
5809 }
5810 else {
5811 fCascadeMenu->CheckEntry(parm1);
5812 }
5813 OnCascadeMenu();
5814 break;
5815
5816 case kHelpAbout:
5817 {
5818#ifdef R__UNIX
5819 TString rootx = TROOT::GetBinDir() + "/root -a &";
5820 gSystem->Exec(rootx);
5821#else
5822#ifdef WIN32
5824#else
5825 char str[32];
5826 sprintf(str, "About ROOT %s...", gROOT->GetVersion());
5827 TRootHelpDialog *hd = new TRootHelpDialog(this, str, 600, 400);
5828 hd->SetText(gHelpAbout);
5829 hd->Popup();
5830#endif
5831#endif
5832 }
5833 break;
5834
5835 default:
5836 break;
5837 }
5838 default:
5839 break;
5840 }
5841 default:
5842 break;
5843 }
5844
5845 return kTRUE;
5846}
const Mask_t kButtonPressMask
Definition GuiTypes.h:161
const Mask_t kAnyModifier
Definition GuiTypes.h:210
const Mask_t kKeyPressMask
Definition GuiTypes.h:159
const Mask_t kPointerMotionMask
Definition GuiTypes.h:163
@ kSunkenFrame
Definition GuiTypes.h:383
@ kVerticalFrame
Definition GuiTypes.h:381
@ kDoubleBorder
Definition GuiTypes.h:385
@ kFixedWidth
Definition GuiTypes.h:387
@ kHorizontalFrame
Definition GuiTypes.h:382
const Handle_t kNone
Definition GuiTypes.h:88
const Mask_t kLeaveWindowMask
Definition GuiTypes.h:168
const Mask_t kButtonReleaseMask
Definition GuiTypes.h:162
@ kWatch
Definition GuiTypes.h:375
const Mask_t kEnterWindowMask
Definition GuiTypes.h:167
@ kAnyButton
Definition GuiTypes.h:214
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
R__EXTERN const char gHelpAbout[]
Definition HelpText.h:17
#define d(i)
Definition RSha256.hxx:102
#define b(i)
Definition RSha256.hxx:100
#define h(i)
Definition RSha256.hxx:106
int Int_t
Definition RtypesCore.h:45
unsigned int UInt_t
Definition RtypesCore.h:46
const Bool_t kFALSE
Definition RtypesCore.h:92
long Long_t
Definition RtypesCore.h:54
bool Bool_t
Definition RtypesCore.h:63
double Double_t
Definition RtypesCore.h:59
long long Long64_t
Definition RtypesCore.h:73
float Float_t
Definition RtypesCore.h:57
const Bool_t kTRUE
Definition RtypesCore.h:91
#define ClassImp(name)
Definition Rtypes.h:364
R__EXTERN TApplication * gApplication
R__EXTERN TEnv * gEnv
Definition TEnv.h:171
@ kEnvUser
Definition TEnv.h:72
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:187
@ kButtonDown
Definition TGButton.h:54
@ kButtonDisabled
Definition TGButton.h:56
@ kButtonUp
Definition TGButton.h:53
#define gClient
Definition TGClient.h:166
@ kFDOpen
@ kFDSave
@ kDeepCleanup
Definition TGFrame.h:50
@ 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:39
@ kMBYes
Definition TGMsgBox.h:38
@ kMBCancel
Definition TGMsgBox.h:44
@ kMBOk
Definition TGMsgBox.h:40
@ kMBIconExclamation
Definition TGMsgBox.h:31
@ kMBIconQuestion
Definition TGMsgBox.h:30
@ kTextRight
Definition TGWidget.h:34
static unsigned int total
XFontStruct * id
Definition TGX11.cxx:109
char name[80]
Definition TGX11.cxx:110
R__EXTERN void * gTQSender
Definition TQObject.h:46
#define gROOT
Definition TROOT.h:406
R__EXTERN TRandom * gRandom
Definition TRandom.h:62
@ kFileQuit
@ kHelpAbout
const char * xpm_toolbar[]
const char *const kSession_RedirectFile
TSessionViewer * gSessionViewer
const char * pkgtypes[]
ESessionViewerCommands
@ kOptionsSlaveStatsTrace
@ kSessionBrowse
@ kQueryDelete
@ kFileLoadConfig
@ kSessionNew
@ kOptionsFeedback
@ kQueryStartViewer
@ kFileSaveConfig
@ kSessionConnect
@ kSessionDelete
@ kFileQuit
@ kSessionShowStatus
@ kSessionShutdown
@ kOptionsStatsHist
@ kSessionGetQueries
@ kQueryEdit
@ kSessionCleanup
@ kOptionsStatsTrace
@ kSessionAdd
@ kQuerySubmit
@ kFileCloseViewer
@ kSessionReset
@ kQueryNew
@ kOptionsAutoSave
@ kSessionDisconnect
@ kHelpAbout
const char * xpm_names[]
const char * kConfigFile
const char * conftypes[]
const char *const kSession_RedirectCmd
const char * kFeedbackHistos[]
const char * macrotypes[]
ToolBarData_t tb_data[]
R__EXTERN TSessionViewer * gSessionViewer
char * Form(const char *fmt,...)
char * StrDup(const char *str)
Duplicate the string str.
Definition TString.cxx:2510
R__EXTERN TSystem * gSystem
Definition TSystem.h:559
#define gPad
#define gVirtualX
Definition TVirtualX.h:338
Int_t GET_MSG(Long_t val)
@ kCM_MENU
@ kTE_ENTER
@ kC_COMMAND
@ kCM_BUTTON
@ kTE_TAB
@ kC_TEXTENTRY
Int_t GET_SUBMSG(Long_t val)
T1 fFirst
Definition X11Events.mm:86
#define snprintf
Definition civetweb.c:1540
Bool_t ReturnFromRun() const
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...
virtual 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="") override
Remove all primitives from the canvas.
Definition TCanvas.cxx:727
TVirtualPad * cd(Int_t subpadnumber=0) override
Set current canvas & pad.
Definition TCanvas.cxx:708
void Update() override
Update canvas pad buffers.
Definition TCanvas.cxx:2504
A chain is a collection of files containing TTree objects.
Definition TChain.h:33
virtual Long64_t GetEntries() const
Return the total number of entries in the chain.
Definition TChain.cxx:947
virtual Long64_t GetReadEntry() const
See TTree::GetReadEntry().
Definition TChain.cxx:1189
virtual Int_t GetEntries() const
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
This class provides an interface to context sensitive popup menus.
virtual void Popup(Int_t x, Int_t y, TObject *obj, TVirtualPad *c=nullptr, TVirtualPad *p=nullptr)
Popup context menu at given location in canvas c and pad p for selected object.
This class implements a data set to be used for PROOF processing.
Definition TDSet.h:153
UInt_t Convert(Bool_t toGMT=kFALSE) const
Convert fDatime from TDatime format to the standard time_t format.
Definition TDatime.cxx:182
const char * AsString() const
Return the date & time as a string (ctime() format).
Definition TDatime.cxx:102
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=nullptr)
Set the value of a resource or create a new resource.
Definition TEnv.cxx:736
THashList * GetList()
Class describing a generic file including meta information.
Definition TFileInfo.h:39
TUrl * GetFirstUrl() const
Definition TFileInfo.h:72
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition TGButton.cxx:398
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:412
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition TGButton.cxx:188
virtual Bool_t IsOn() const
Definition TGButton.h:311
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition TGClient.cxx:233
const TGWindow * GetRoot() const
Returns current root (i.e.
Definition TGClient.cxx:223
TGMimeTypes * GetMimeTypeList() const
Definition TGClient.h:155
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition TGClient.cxx:288
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition TGClient.cxx:371
void FreePicture(const TGPicture *pic)
Free picture resource.
Definition TGClient.cxx:307
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
Definition TGFrame.cxx:985
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1102
virtual UInt_t GetDefaultWidth() const
Definition TGFrame.h:348
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:952
virtual void Layout()
Layout the elements of the composite frame.
Definition TGFrame.cxx:1242
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition TGFrame.cxx:1057
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition TGFrame.h:352
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1149
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition TGFrame.cxx:1189
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:350
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition TGFrame.cxx:1175
Bool_t IsVisible(TGFrame *f) const
Get state of sub frame.
Definition TGFrame.cxx:1216
virtual void Associate(const TGWindow *w)
Definition TGCanvas.h:99
virtual void ClearViewPort()
Clear view port and redraw full content.
Definition TGCanvas.cxx:887
TList * fFileNamesList
char * fFilename
const char ** fFileTypes
void SetFilename(const char *fname)
Set file name.
Bool_t fMultipleSelection
void SetIniDir(const char *inidir)
Set directory name.
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition TGFrame.cxx:324
void RemoveInput(UInt_t emask)
Remove events specified in emask from the events the frame should handle.
Definition TGFrame.cxx:333
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition TGFrame.cxx:694
virtual UInt_t GetDefaultWidth() const
Definition TGFrame.h:214
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:215
virtual void DeleteWindow()
Delete window.
Definition TGFrame.cxx:261
virtual void Move(Int_t x, Int_t y)
Move frame.
Definition TGFrame.cxx:578
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition TGFrame.cxx:590
UInt_t GetHeight() const
Definition TGFrame.h:249
virtual void MapWindow()
map window
Definition TGFrame.h:228
void ShowPosition(Bool_t set=kTRUE, Bool_t percent=kTRUE, const char *format="%.2f")
Show postion text, either in percent or formatted according format.
virtual void SetPicture(const TGPicture *pic)
Set icon picture.
Definition TGIcon.cxx:78
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:179
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
virtual Int_t GetNumberOfEntries() const
Definition TGListBox.h:330
virtual Int_t GetSelected() const
Return id of selected listbox item.
virtual void AddEntry(TGString *s, Int_t id)
Add entry with specified string and id to listbox.
virtual void SetMultipleSelections(Bool_t multi=kTRUE)
Definition TGListBox.h:326
virtual TGFrame * GetContainer() const
Definition TGListBox.h:334
virtual void Layout()
Layout the listbox components.
virtual void GetSelectedEntries(TList *selected)
Adds all selected entries (TGLBEntry) of the list box into the list selected.
virtual void RemoveEntries(Int_t from_ID, Int_t to_ID)
Remove a range of entries defined by from_ID and to_ID.
virtual const char * GetText() const =0
TGListTreeItem * GetParent() const
Definition TGListTree.h: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:1865
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition TGFrame.cxx:1749
virtual void AddPopup(TGHotString *s, TGPopupMenu *menu, TGLayoutHints *l, TGPopupMenu *before=0)
Add popup menu to menu bar.
Definition TGMenu.cxx:417
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
Pixmap_t GetPicture() const
Definition TGPicture.h:65
UInt_t GetWidth() const
Definition TGPicture.h:63
virtual void AddLabel(TGHotString *s, const TGPicture *p=nullptr, TGMenuEntry *before=nullptr)
Add a menu label to the menu.
Definition TGMenu.cxx:1094
virtual Bool_t IsEntryChecked(Int_t id)
Return true if menu item is checked.
Definition TGMenu.cxx:1844
virtual void AddPopup(TGHotString *s, TGPopupMenu *popup, TGMenuEntry *before=nullptr, const TGPicture *p=nullptr)
Add a (cascading) popup menu to a popup menu.
Definition TGMenu.cxx:1151
virtual void CheckEntry(Int_t id)
Check a menu entry (i.e. add a check mark in front of it).
Definition TGMenu.cxx:1781
virtual void DisableEntry(Int_t id)
Disable entry (disabled entries appear in a sunken relieve).
Definition TGMenu.cxx:1723
virtual void EnableEntry(Int_t id)
Enable entry. By default entries are enabled.
Definition TGMenu.cxx:1704
virtual void UnCheckEntry(Int_t id)
Uncheck menu entry (i.e. remove check mark).
Definition TGMenu.cxx:1806
virtual void Associate(const TGWindow *w)
Definition TGMenu.h:219
virtual void AddSeparator(TGMenuEntry *before=nullptr)
Add a menu separator to the menu.
Definition TGMenu.cxx:1059
virtual void AddEntry(TGHotString *s, Int_t id, void *ud=nullptr, const TGPicture *p=nullptr, TGMenuEntry *before=nullptr)
Add a menu entry.
Definition TGMenu.cxx:989
virtual void PlaceMenu(Int_t x, Int_t y, Bool_t stick_mode, Bool_t grab_pointer)
Popup a popup menu.
Definition TGMenu.cxx:1240
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:614
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:509
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
Definition TGTab.cxx:343
UInt_t GetTextLength() const
virtual void SetText(TGHotString *new_label)
Set new button text.
Definition TGButton.cxx:597
virtual void SetFocus()
Set focus to this text entry.
TGTextBuffer * GetBuffer() const
const char * GetText() const
void SetEnabled(Bool_t flag=kTRUE)
virtual void SelectAll()
Selects all text (i.e.
virtual void SetAlignment(ETextJustification mode=kTextLeft)
Sets the alignment of the text entry.
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
virtual void SetText(const char *text, Bool_t emit=kTRUE)
Sets text entry to text, clears the selection and moves the cursor to the end of the line.
virtual Bool_t LoadFile(const char *fname, long startpos=0, long length=-1)
Load a file in the text view widget.
virtual Bool_t LoadBuffer(const char *txtbuf)
Load text from a text buffer. Return false in case of failure.
virtual void Clear(Option_t *="")
Clear text view widget.
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.
virtual void Associate(const TGWindow *w)
Definition TGWidget.h:82
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition TGWindow.cxx:335
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:58
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:822
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Definition TList.cxx:578
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
Definition TList.cxx:357
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
Definition TList.cxx:693
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
Definition TList.cxx:470
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Definition TList.cxx:402
virtual const char * GetTitle() const
Returns title of object.
Definition TNamed.h:48
virtual const char * GetName() const
Returns name of object.
Definition TNamed.h:47
void Popup()
Display dialog and set focus to query name text entry.
Collectable string class.
Definition TObjString.h:28
const char * GetName() const
Returns name of object.
Definition TObjString.h:38
const TString & GetString() const
Definition TObjString.h:46
Mother of all ROOT objects.
Definition TObject.h:37
virtual void Clear(Option_t *="")
Definition TObject.h:115
virtual const char * GetName() const
Returns name of object.
Definition TObject.cxx:359
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition TObject.cxx:696
virtual const char * GetTitle() const
Returns title of object.
Definition TObject.cxx:403
void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0) override
Automatic pad generation by division.
Definition TPad.cxx:1177
void SetEditable(Bool_t mode=kTRUE) override
Set pad editable yes/no If a pad is not editable:
Definition TPad.cxx:5902
void Modified(Bool_t flag=1) override
Definition TPad.h:414
void SetBorderMode(Short_t bordermode) override
Definition TPad.h:317
TProof * GetProof() const
Definition TProofMgr.h:164
Int_t GetLocalId() const
Definition TProofMgr.h:163
The PROOF manager interacts with the PROOF server coordinator to create or destroy a PROOF session,...
Definition TProofMgr.h:43
virtual Int_t Reset(Bool_t hard=kFALSE, const char *usr=0)
Send a cleanup request for the sessions associated with the current user.
virtual TList * QuerySessions(Option_t *opt="S")
Get list of sessions accessible to this manager.
static TProofMgr * Create(const char *url, Int_t loglevel=-1, const char *alias=0, Bool_t xpd=kTRUE)
Static method returning the appropriate TProofMgr object using the plugin manager.
virtual TProof * CreateSession(const char *=0, const char *=0, Int_t=-1)
Create a new remote session (master and associated workers).
virtual Bool_t IsValid() const
Definition TProofMgr.h:77
virtual TProof * AttachSession(Int_t, Bool_t=kFALSE)
Dummy version provided for completeness.
This class controls a Parallel ROOT Facility, PROOF, cluster.
Definition TProof.h:316
const char * GetSessionTag() const
Definition TProof.h:909
Int_t Exec(const char *cmd, ESlaves list, Bool_t plusMaster)
Send command to be executed on the PROOF master and/or slaves.
Definition TProof.cxx:6523
void ShowPackages(Bool_t all=kFALSE, Bool_t redirlog=kFALSE)
List contents of package directory.
Definition TProof.cxx:7760
static TProofMgr * Mgr(const char *url)
Get instance of the effective manager for 'url' Return 0 on failure.
Definition TProof.cxx:11714
Int_t UploadPackage(const char *par, EUploadPackageOpt opt=kUntar, TList *workers=0)
Upload a PROOF archive (PAR file).
Definition TProof.cxx:8431
void SendLogToWindow(Bool_t mode)
Definition TProof.h:1017
Int_t GetClientProtocol() const
Definition TProof.h:914
void AddFeedback(const char *name)
Add object to feedback list.
Definition TProof.cxx:9979
Bool_t IsParallel() const
Definition TProof.h:939
Int_t CleanupSession(const char *sessiontag)
Send cleanup request for the session specified by tag.
Definition TProof.cxx:6082
TList * GetListOfPackages()
Get from the master the list of names of the packages available.
Definition TProof.cxx:9098
TQueryResult * GetQueryResult(const char *ref=0)
Return pointer to the full TQueryResult instance owned by the player and referenced by 'ref'.
Definition TProof.cxx:2138
void ClearFeedback()
Clear feedback list.
Definition TProof.cxx:10002
void Browse(TBrowser *b)
Build the PROOF's structure in the browser.
Definition TProof.cxx:10169
Int_t GetPort() const
Definition TProof.h:912
Bool_t IsValid() const
Definition TProof.h:937
const char * GetConfFile() const
Definition TProof.h:905
Int_t GetRemoteProtocol() const
Definition TProof.h:913
Int_t SetParallel(Int_t nodes=-1, Bool_t random=kFALSE)
Tell PROOF how many slaves to use in parallel.
Definition TProof.cxx:7130
const char * GetImage() const
Definition TProof.h:910
Float_t GetCpuTime() const
Definition TProof.h:931
Int_t ClearPackage(const char *package)
Remove a specific package.
Definition TProof.cxx:7847
Int_t ClearPackages()
Remove all packages.
Definition TProof.cxx:7830
Int_t GetParallel() const
Returns number of slaves active in parallel mode.
Definition TProof.cxx:2294
Int_t Remove(Int_t query, Bool_t all=kFALSE)
Send remove request for the qry-th query in fQueries.
Definition TProof.cxx:6003
Bool_t SendingLogToWindow() const
Definition TProof.h:1016
Long64_t GetBytesRead() const
Definition TProof.h:929
virtual void SetAlias(const char *alias="")
Set an alias for this session.
Definition TProof.cxx:10573
void Detach(Option_t *opt="")
Detach this instance to its proofserv.
Definition TProof.cxx:10508
Int_t GetSeqNum() const
Definition TProof.h:918
const char * GetConfDir() const
Definition TProof.h:904
void cd(Int_t id=-1)
Set session with 'id' the default one.
Definition TProof.cxx:10486
Int_t Retrieve(Int_t query, const char *path=0)
Send retrieve request for the qry-th query in fQueries.
Definition TProof.cxx:5938
Int_t GetStatus() const
Definition TProof.h:915
virtual Int_t RemoveDataSet(const char *dataset, const char *optStr="")
Remove the specified dataset from the PROOF cluster.
Definition TProof.cxx:10981
void SetQueryMode(EQueryMode mode)
Change query running mode to the one specified by 'mode'.
Definition TProof.cxx:6097
@ kUsingSessionGui
Definition TProof.h:342
Long64_t Finalize(Int_t query=-1, Bool_t force=kFALSE)
Finalize the qry-th query in fQueries.
Definition TProof.cxx:5873
Bool_t IsLite() const
Definition TProof.h:933
void StopProcess(Bool_t abort, Int_t timeout=-1)
Send STOPPROCESS message to master and workers.
Definition TProof.cxx:6214
Float_t GetRealTime() const
Definition TProof.h:930
void ShowLog(Int_t qry=-1)
Display on screen the content of the temporary log file.
Definition TProof.cxx:10361
Int_t GetLogLevel() const
Definition TProof.h:916
const char * GetUser() const
Definition TProof.h:906
virtual TFileCollection * GetDataSet(const char *dataset, const char *optStr="")
Get a list of TFileInfo objects describing the files of the specified dataset.
Definition TProof.cxx:10927
TList * GetListOfEnabledPackages()
Get from the master the list of names of the packages enabled.
Definition TProof.cxx:9114
virtual TList * GetListOfQueries(Option_t *opt="")
Ask the master for the list of queries.
Definition TProof.cxx:2078
void SetLogLevel(Int_t level, UInt_t mask=TProofDebug::kAll)
Set server logging level.
Definition TProof.cxx:7069
Bool_t IsMaster() const
Definition TProof.h:936
void ShowEnabledPackages(Bool_t all=kFALSE)
List which packages are enabled.
Definition TProof.cxx:7808
@ kAsync
Definition TProof.h:351
@ kSync
Definition TProof.h:350
const char * GetMaster() const
Definition TProof.h:903
Int_t EnablePackage(const char *package, Bool_t notOnClient=kFALSE, TList *workers=0)
Enable specified package.
Definition TProof.cxx:8165
virtual Int_t VerifyDataSet(const char *dataset, const char *optStr="")
Verify if all files in the specified dataset are available.
Definition TProof.cxx:11120
This is the ROOT implementation of the Qt object communication mechanism (see also http://www....
Definition TQObject.h:48
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition TQObject.cxx:866
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
ESessionQueryStatus fStatus
TQueryResult * fResult
A container class for query results.
Long64_t GetEntries() const
Int_t GetSeqNum() const
TDatime GetEndTime() const
TMacro * GetSelecImp() const
TList * GetOutputList()
TDatime GetStartTime() const
TObject * GetInputObject(const char *classname) const
Return first instance of class 'classname' in the input list.
EQueryStatus GetStatus() const
const char * GetResultFile() const
const char * GetOptions() const
Long64_t GetFirst() const
Bool_t IsDraw() const
TList * GetInputList()
Float_t GetUsedCPU() const
const char * GetParList() const
Long64_t GetBytes() const
Bool_t IsArchived() const
Bool_t IsFinalized() const
static const TString & GetBinDir()
Get the binary directory in the installation. Static utility function.
Definition TROOT.cxx:2917
virtual UInt_t Integer(UInt_t imax)
Returns a random integer uniformly distributed on the interval [ 0, imax-1 ].
Definition TRandom.cxx:360
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:31
virtual TList * GetOutputList() const
Definition TSelector.h:69
virtual void Terminate()
Definition TSelector.h:71
Sequenceable collection abstract base class.
virtual TObject * First() const =0
const char * GetName() const
Returns name of object.
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.
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:136
Ssiz_t Length() const
Definition TString.h:410
TString & Insert(Ssiz_t pos, const char *s)
Definition TString.h:649
const char * Data() const
Definition TString.h:369
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Definition TString.h:615
Bool_t IsNull() const
Definition TString.h:407
TString & Remove(Ssiz_t pos)
Definition TString.h:673
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:2331
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition TString.cxx:2309
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:624
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition TString.h:639
virtual Int_t RedirectOutput(const char *name, const char *mode="a", RedirectHandle_t *h=nullptr)
Redirect standard output (stdout, stderr) to the specified file.
Definition TSystem.cxx:1711
virtual TTime Now()
Get current time in milliseconds since 0:00 Jan 1 1995.
Definition TSystem.cxx:464
virtual Int_t Exec(const char *shellcmd)
Execute a command.
Definition TSystem.cxx:654
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:2462
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:1294
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
Definition TSystem.cxx:1061
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition TSystem.cxx:933
virtual const char * HostName()
Return the system's host name.
Definition TSystem.cxx:304
virtual const char * WorkingDirectory()
Return working directory.
Definition TSystem.cxx:870
virtual const char * HomeDirectory(const char *userName=nullptr)
Return the user's home directory.
Definition TSystem.cxx:886
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Definition TSystem.cxx:417
virtual int Unlink(const char *name)
Unlink, i.e.
Definition TSystem.cxx:1379
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
Definition TSystem.cxx:1597
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
Definition TSystem.cxx:1480
Basic time type with millisecond precision.
Definition TTime.h:27
Handles synchronous and a-synchronous timer events.
Definition TTimer.h:51
virtual void TurnOff()
Remove timer from system timer list.
Definition TTimer.cxx:229
virtual void TurnOn()
Add the timer to the system timer list.
Definition TTimer.cxx:241
void Reset()
Reset the timer.
Definition TTimer.cxx:157
TVirtualTreePlayer * GetPlayer()
Load the TTreePlayer (if not already done).
Definition TTree.cxx:6286
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
Definition TUrl.cxx:389
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51
virtual void SetEditable(Bool_t mode=kTRUE)=0
virtual TVirtualPad * cd(Int_t subpadnumber=0)=0
virtual TSelector * GetSelectorFromFile() const =0
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Definition first.py:1
Event structure.
Definition GuiTypes.h:174
Int_t fCpus
Definition TSystem.h:154
TString fOS
Definition TSystem.h:151
const char * fPixmap
Definition TGToolBar.h:33
TString fRealName
Definition TSystem.h:144
TString fGroup
Definition TSystem.h:142
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