HistoDisplay Class Reference

#include <HistoDisplay.h>

List of all members.

Public Member Functions

 HistoDisplay (const TGWindow *p, UInt_t w, UInt_t h, const char *socketserver, Int_t port)
virtual ~HistoDisplay ()
virtual Bool_t ProcessMessage (Long_t msg, Long_t parm1, Long_t parm2)

Private Types

enum  EInputTypes { kTMapFile, kTFile, kTSocket }

Private Member Functions

void MakeMenuBar ()
void CloseMenuBar ()
void MakeTitleFrame (const char *)
void CloseTitleFrame ()
void MakeInputFrame ()
void CloseInputFrame ()
void MakeTGListTreeFrame ()
void CloseTGListTreeFrame ()
void MakeStatusBar ()
void CloseStatusBar ()
TObject * OpenFile (const char *filename, EInputTypes inputtype=kTFile, Option_t *option="READ")
TObject * CloseFile (const char *filename, EInputTypes inputtype=kTFile)
TObject * CloseFile (TObject *inputobj)
void CloseConnection ()
const char * FileDialogWindow ()
void FileNameClear ()
void MessageBox (const char *msg)
void HistoDisplayMain (Int_t autoOpen=0)
void MakeHistoList (TObject *inpuobj)
void MakeHistoListM (TMapFile *MFile)
void MakeHistoListR (TFile *RFile)
void MakeHistoListS (TSocket *sock)
TConsumerInfoMakeConsumerInfo (TObject *inputobj)
TConsumerInfoMakeConsumerInfo (const char *consumername, const char *filename)
void AddToDisplayedList (const TObject *inputobj)
void AddToTree (TObject *inputobj)
TString GetDirPath (const TString &)
void MakeTGListTree (const TString &, TObject *, const char *tip=0)
void RemoveTGListTree ()
void SortTGListTree ()
void DelTreeItemsOfInput (TObject *inputobj)
void AddTreeItemsOfInput (TObject *inputobj)
void RefreshTreeItem (TGListTreeItem *item)
void DrawHisto (TObject *obj)
void DrawHisto (TList *list)
CObjectUpdateHistoList (const char *objName, const TObject *inputobj)
TObject * GetNewObj (const char *objName, const TObject *inputobj)
CObjectGetCObjFromListItem (TGListTreeItem *item)
void UpdateTimerOn ()
void UpdateCanvas (TVirtualPad *currentpad=0)
void UpdatePad (TVirtualPad *pad)
void DrawUpdatedPad (TVirtualPad *currentPad)
void ReplacePad (TVirtualPad *newpad, TVirtualPad *oldpad)
void AddPadHistosToHistoList (TPad *pad)
void AddSubtractHisto (TVirtualPad *currentPad, int option)
void ClearCurrentPad ()
void RecursivePadClear (TVirtualPad *pad, Option_t *option="")
void DrawTH1 (TH1 *histo, Option_t *option, TVirtualPad *backpad)
void DrawTPad (TPad *pad1, TVirtualPad *pad2)
void CycleSlides (const TGListTreeItem *item, TVirtualPad *currentpad)
void SlideTimerOn (TGListTreeItem *item)
void StartSlides (TGListTreeItem *item)
void PopUpSlides (TGListTreeItem *item, const char *canvasname, const char *canvastitle)
void SearchWarningErrorFolder (TGListTreeItem *item, TObject *socket)
TH1F * ContentHisto (TH1 *histo)
void DrawOnTheCanvas (const char *canvasname, const char *canvastitle, int padx, int pady, TObject *obj)
void DrawContentHisto (TH1 *histo)
TH1 * HistoInPad (TVirtualPad *pad, Int_t &counthisto)
void PrintCanvas (TPad *canvas)
void ChangeCanvasNameTitle (TCanvas *canvas)
void DuplicateCanvasSize (TCanvas *guicanvas, TCanvas *consumercanvas)
void CloseWindow ()
void ResetObjects ()
void MenuConnectStatus ()
void MenuHelp (const char *s, const char *helpText)

Private Attributes

const char * fsocketserver
Int_t fport
TGMenuBar * fMenuBar
TGLayoutHints * fMenuBarLayout
TGLayoutHints * fMenuBarItemLayout
TGLayoutHints * fMenuBarHelpLayout
TGPopupMenu * fFileMenu
TGPopupMenu * fNewCascadeMenu
TGPopupMenu * fListTreeMenu
TGPopupMenu * fSortCascadeMenu
TGPopupMenu * fConnectMenu
TGPopupMenu * fHelpMenu
TGHorizontal3DLine * fMenuBarSeparator
TGLayoutHints * fMenuBarSeparatorLayout
TGCompositeFrame * fMainFrame
TGLayoutHints * fMainFrameLayout
ULong_t LightYellow
ULong_t Red
ULong_t Green
TGCompositeFrame * fTitleFrame
TGLayoutHints * fTitleFrameLayout
TGLabel * fTitleLabel
TGLayoutHints * fTitleLabelLayout
GContext_t fTextGC
TGPictureButton * fPicBut
TGLayoutHints * fPictLayout
TGGroupFrame * fFileNameFrame
TGLayoutHints * fFileNameFrameLayout
TGRadioButton * fRaButMFile
TGRadioButton * fRaButRFile
TGRadioButton * fRaButSocket
TGLayoutHints * fRaButLayout
TGLayoutHints * fFileNameLayout
TGLabel * fFileNameLabel
TGCompositeFrame * fFileOpenFrame
TGLayoutHints * fFileOpenFrameLayout
TGTextEntry * fFileNameTextEntry
TGTextBuffer * fFileNameBuffer
TGTextButton * fReadFileButton
TGCompositeFrame * fFileNameButtonFrame
TGLayoutHints * fFileNameButtonFrameLayout
TGLayoutHints * fFileNameButtonLayout
TGTextButton * fChooseFileButton
TGTextButton * fClearFileNameButton
TGCompositeFrame * fListTreeMainFrame
TGLayoutHints * fListTreeMainFrameLayout
TGLayoutHints * fMonitorNameLayout
TGLabel * fMonitorNameLabel
TGTextEntry * fMonitorNameTextEntry
TGTextBuffer * fMonitorNameBuffer
TGCompositeFrame * fHistoListFrame
TGLayoutHints * fHistoListFrameLayout
TGCanvas * fTGCanvas
TGLayoutHints * fTGCanvasLayout
TGListTree * fHistoListTree
TGCompositeFrame * fListButtonFrame
TGLayoutHints * fListButtonFrameLayout
TGCheckButton * fChButtonAutoUpdate
TGLayoutHints * fChButtonAutoUpdateLayout
Bool_t AutoUpdate
TGCompositeFrame * fFrequencyFrame
TGLayoutHints * fFrequencyFrameLayout
TGLabel * fFrequencyLabel
TGTextEntry * fFrequencyTextEntry
TGTextBuffer * fFrequencyTextBuffer
TGCompositeFrame * fControlButtonFrame
TGLayoutHints * fControlButtonFrameLayout
TGCompositeFrame * fButtonFrame
TGLayoutHints * fButtonFrameLayout
TGLayoutHints * fButtonLayout
TGTextButton * fStartHistoButton
TGTextButton * fPauseHistoButton
TGTextButton * fRestartHistoButton
TGTextButton * fClearHistoButton
TGTextButton * fStopHistoButton
TGTextButton * fNewCanvasButton
TGGroupFrame * fHistoButtonGFrame
TGLayoutHints * fHistoButtonGFrameLayout
TGCompositeFrame * fHistoButtonFrame
TGLayoutHints * fHistoButtonFrameLayout
TGLayoutHints * fHistoButtonLayout
TGTextButton * fZeroHistoButton
TGTextButton * fUnZeroHistoButton
TGTextButton * fContentHistoButton
TGStatusBar * fStatusBar
TString MonitorName
TString FileName
ConsumerListconsumerlist
TList * fHistoList
TList * fDisplayedList
TGListTreeItem * fSelectedItem
Bool_t Running
TList * fSlideCanvasList
TGCheckButton * fChButtonSlideUpdate
Bool_t SlideShowUpdate
TString CanvasName
TString CanvasTitle
Int_t CanvasNumber
HistoDisplayUpdateTimerfUpdateTimer
HistoDisplaySlideTimerfSlideTimer
char * fPrinter
char * fPrinterCommand
TGTextButton * fPrintHistoButton

Friends

class HistoDisplayUpdateTimer
class HistoDisplaySlideTimer

Detailed Description

Definition at line 76 of file HistoDisplay.h.


Member Enumeration Documentation

enum HistoDisplay::EInputTypes [private]
Enumerator:
kTMapFile 
kTFile 
kTSocket 

Definition at line 248 of file HistoDisplay.h.

00248                    {
00249     kTMapFile,
00250     kTFile,
00251     kTSocket
00252   };


Constructor & Destructor Documentation

HistoDisplay::HistoDisplay ( const TGWindow *  p,
UInt_t  w,
UInt_t  h,
const char *  socketserver,
Int_t  port 
)

Definition at line 395 of file HistoDisplay.cxx.

References port.

Referenced by ProcessMessage().

00397 : TGMainFrame(p, w, h)
00398 , consumerlist(new ConsumerList("http://www-b0.fnal.gov:8000/consumer/consumer_status.html"))
00399 {
00400   //
00401   // hjw
00402   // first check if the enevironment is set correctly:
00403   //
00404   char *c_ptr;
00405   c_ptr = getenv("CONSUMER_ICONS");
00406     if(c_ptr==NULL){
00407       cout<<"Unix logical CONSUMER_ICONS is not set, will not be able to load all icons"<<endl;
00408     }
00409 
00410     gStyle->SetPalette(1); //By Greg.
00411 
00412   gClient->GetColorByName("LightYellow",LightYellow);
00413   gClient->GetColorByName("Red",Red);
00414   gClient->GetColorByName("Green",Green);
00415 
00416 
00417 
00418 
00419 
00420 
00421   fsocketserver=socketserver;
00422   fport=port;
00423 
00424 
00425   MakeMenuBar();
00426 
00427   fMainFrame =
00428     new TGCompositeFrame(this, 200, 400, kVerticalFrame); 
00429 
00430   fMainFrameLayout =
00431     //new TGLayoutHints( kLHintsCenterX | kLHintsCenterY, 1, 1, 1, 1); 
00432     new TGLayoutHints( kLHintsCenterX | kLHintsCenterY |
00433                        kLHintsExpandX | kLHintsExpandY, 1, 1, 1, 1); 
00434 
00435   char fTitle[] = "MINOS Online Monitoring Display ";
00436   MakeTitleFrame(fTitle);
00437 
00438   MakeInputFrame();
00439 
00440   MakeTGListTreeFrame();
00441 
00442   MakeStatusBar();
00443 
00444   AddFrame(fMainFrame,fMainFrameLayout); 
00445 
00446   SetWindowName(" MINOS Online Monitoring Main Frame");
00447   Resize(GetDefaultSize());
00448   Layout();
00449 
00450   MapSubwindows();
00451   MapWindow();
00452 
00453 
00454   fSelectedItem = 0; // to prevent segmentation fault
00455   //InputObj = 0;
00456 
00457   fHistoList = new TList();
00458   fDisplayedList = new TList();
00459   //fDisplayedList = new CList();
00460 
00461 
00462   SlideShowUpdate = kFALSE;
00463   fSlideCanvasList = new TList();
00464 
00465   CanvasName = "MINOSDisplayCanvas"; 
00466   CanvasTitle = "MINOS Online Monitoring Display Canvas ";
00467   CanvasNumber = 0;
00468 
00469 
00470   //fUpdateTimer = new TTimer( this, 100, kTRUE );
00471   fUpdateTimer = new HistoDisplayUpdateTimer( this, 100, kTRUE );
00472   fSlideTimer = new HistoDisplaySlideTimer( this, 2000, kTRUE );
00473 
00474   Running = kFALSE;
00475 
00476   fPrinter = 0;
00477   fPrinterCommand = 0;
00478 
00479 
00480 }

HistoDisplay::~HistoDisplay (  )  [virtual]

Definition at line 4435 of file HistoDisplay.cxx.

References CloseInputFrame(), CloseMenuBar(), CloseStatusBar(), CloseTGListTreeFrame(), CloseTitleFrame(), fDisplayedList, fHistoList, fMainFrame, fMainFrameLayout, fSlideCanvasList, fSlideTimer, fUpdateTimer, and ResetObjects().

04436 {
04437 
04438   ResetObjects();
04439 
04440   delete fHistoList;
04441   delete fDisplayedList;
04442   delete fSlideCanvasList;
04443 
04444   delete fUpdateTimer;
04445   delete fSlideTimer;
04446 
04447   CloseMenuBar();
04448   CloseTitleFrame();
04449   CloseTGListTreeFrame();
04450   CloseInputFrame();
04451   CloseStatusBar();
04452 
04453   delete fMainFrame;
04454   delete fMainFrameLayout;
04455 }


Member Function Documentation

void HistoDisplay::AddPadHistosToHistoList ( TPad *  pad  )  [private]

Definition at line 3960 of file HistoDisplay.cxx.

References fDisplayedList, and CObject::SetTObject().

Referenced by UpdateHistoList().

03961 {
03962   //cout << " In AddPadHistosToHistoList " << endl; 
03963 
03964   if ( !pad ) return;
03965 
03966   TObjLink *link = pad->GetListOfPrimitives()->FirstLink();
03967 
03968   while ( link ) {
03969 
03970     TObject *obj = link->GetObject();
03971 
03972     if ( obj ) {
03973 
03974       if ( obj->InheritsFrom( TPad::Class() ) ) 
03975         AddPadHistosToHistoList( (TPad*)obj ); 
03976 
03977       else if ( obj->InheritsFrom( TH1::Class() ) ) {
03978 
03979         TObject *objold = fDisplayedList->FindObject( obj->GetName() );
03980 
03981         if ( objold && objold->InheritsFrom( CObject::Class())  ) {
03982 
03983           CObject *cobj = (CObject*)objold;
03984           //cobj->SetTObject( obj );
03985           cobj->SetTObject( obj->Clone() );
03986 
03987         } //if ( objold && objold->InheritsFrom( CObject::Class()) )
03988         else {
03989 
03990           CHistogram *cobjnew =
03991             //new CHistogram( (TH1*)obj, 0, 0, 0 );
03992             new CHistogram( (TH1*)obj->Clone(), 0, 0, 0 );
03993 
03994                   fDisplayedList->Add( cobjnew );
03995 
03996         } //else //if ( objold && objold->InheritsFrom( CObject::Class()) ) )
03997 
03998       } //else if ( obj->InheritsFrom( TH1::Class() ) )
03999 
04000     } //if ( obj ) 
04001 
04002     link = link->Next();
04003 
04004   } //while ( link )
04005 
04006   //cout << " End of AddPadHistosToHistoList " << endl; 
04007 
04008 }

void HistoDisplay::AddSubtractHisto ( TVirtualPad *  currentPad,
int  option 
) [private]

Definition at line 4178 of file HistoDisplay.cxx.

References fDisplayedList, CObject::GetTObject(), and CHistogram::SetSubtractHisto().

Referenced by ProcessMessage().

04179 {
04180   // Zero or Restore all histos on the currentPad.
04181   // int option = 0    ; unzero
04182   //            = else ;   zero 
04183 
04184   // cout << " In AddSubtractHisto" << endl;
04185 
04186   if (!currentPad) return;
04187 
04188   TList *primitiveList = currentPad->GetListOfPrimitives();
04189   TIter next(primitiveList);
04190   TObject *obj = 0;
04191 
04192   while ( ( obj = next() ) ) {
04193     if ( obj->InheritsFrom(TPad::Class()) ) {
04194 
04195       AddSubtractHisto( (TPad*)obj , option);
04196 
04197     } //if ( obj->InheritsFrom(TPad::Class()) )
04198     else {
04199 
04200       if ( obj->InheritsFrom(TH1::Class()) ) {
04201 
04202         TObject *obj2 = 
04203           fDisplayedList->FindObject(obj->GetName());
04204 
04205         if( obj2 && obj2->InheritsFrom(CHistogram::Class()) ) {
04206 
04207           CHistogram *chisto = (CHistogram*)obj2;
04208           TH1 *histo = (TH1*) chisto->GetTObject();
04209 
04210           if (option) {
04211             if (histo) chisto->SetSubtractHisto( histo );
04212           } //if (option)
04213           else {
04214             chisto->SetSubtractHisto(0);
04215           } //else //if (option)
04216 
04217 
04218         }//if( obj2 && obj2->InheritsFrom(CHistogram::Class()) )
04219 
04220 
04221       } //if ( obj->InheritsFrom(TH1::Class()) )
04222 
04223 
04224     } //else//if ( obj->InheritsFrom(TPad::Class()) )
04225 
04226 
04227   } //while ( obj = next() )
04228 
04229 }

void HistoDisplay::AddToDisplayedList ( const TObject *  inputobj  )  [private]

Definition at line 1987 of file HistoDisplay.cxx.

References fHistoList.

Referenced by AddTreeItemsOfInput().

01988 {
01989   // cout << " In AddToDisplayedList " << endl;
01990 
01991   if ( !inputobj ) return ;
01992 
01993 
01994   if ( fHistoList && !fHistoList->IsEmpty() ) {
01995 
01996     TIter nextList(fHistoList);
01997     TObject *obj = 0;
01998     while ( ( obj = nextList() ) ) {
01999 
02000       //unused:     CObject *coj = UpdateHistoList( obj->GetName(), inputobj );
02001 
02002     }//while ( (obj = nextList()) )
02003 
02004   }//if ( fHistoList && !fHistoList->IsEmpty() )
02005 
02006   //tmp
02007   //fDisplayedList->ls();
02008 
02009 }

void HistoDisplay::AddToTree ( TObject *  inputobj  )  [private]

Definition at line 2014 of file HistoDisplay.cxx.

References fHistoList, fHistoListTree, GetDirPath(), and MakeTGListTree().

Referenced by AddTreeItemsOfInput().

02015 {
02016   if ( fHistoList && !fHistoList->IsEmpty() ) {
02017 
02018     TIter nextHisto(fHistoList);
02019     TObject *obj = 0;
02020 
02021     while ( (obj = nextHisto()) ) {
02022       TString PathName;
02023       //TString DirPath;
02024 
02025       PathName = GetDirPath( TString(obj->GetName()) ) 
02026         //PathName = "/" + TString( inputobj->GetName() ) 
02027         + "/" + TString(obj->GetName());
02028  
02029       //MakeTGListTree( PathName, inputobj );
02030       MakeTGListTree( PathName, inputobj, obj->GetTitle() );
02031     } //while ( (obj = nextHisto()) )
02032 
02033     fClient->NeedRedraw(fHistoListTree);
02034 
02035   } //if ( fHistoList && !fHistoList->IsEmpty() )
02036 
02037 }

void HistoDisplay::AddTreeItemsOfInput ( TObject *  inputobj  )  [private]

Definition at line 2330 of file HistoDisplay.cxx.

References AddToDisplayedList(), AddToTree(), TConsumerInfo::getPath(), info, MakeConsumerInfo(), MakeHistoList(), and MakeTGListTree().

Referenced by GetNewObj(), and ProcessMessage().

02331 {
02332   //cout << " In AddTreeItemsOfInput " << endl;
02333 
02334   if ( !inputobj ) {
02335     cout << " No input is specified. " << endl;
02336     return;
02337   } //if ( !inputobj )
02338 
02339 
02340   TPad *padsav = 0;
02341   if ( gPad && !( gROOT->GetListOfCanvases()->IsEmpty() ) )
02342     padsav = (TPad*) gPad;
02343 
02344 
02345   TConsumerInfo *info = MakeConsumerInfo( inputobj );
02346 
02347   if ( info ) {
02348     TIterConsumerInfo nextObjName( info );
02349 
02350     TString objName;
02351     Int_t countAdded = 0;
02352 
02353     while ( ( objName = nextObjName() ) ) {
02354       if ( objName.IsNull() ) break;
02355 
02356       TString pathname = 
02357         "/" + info->getPath( objName.Data() ) + "/" + objName;
02358 
02359       MakeTGListTree( pathname, inputobj );
02360       countAdded++;
02361 
02362     } //while ( objName = nextObjName() )
02363 
02364     if ( countAdded ) {
02365       //fClient->NeedRedraw( fHistoListTree );
02366       //fDisplayedList->ls();
02367     } //if ( cout2 )
02368     else
02369       cout << " No object"
02370            << " is found in the input: " 
02371            << inputobj->GetName()
02372            << endl;
02373 
02374     delete info;
02375 
02376   } //if( info )
02377   else {
02378 
02379     //if ( !inputobj ) return;
02380 
02381     MakeHistoList(inputobj);
02382     AddToTree(inputobj);
02383     AddToDisplayedList(inputobj);
02384 
02385   } //else //if( info )
02386 
02387   if ( padsav ) padsav->cd();
02388 
02389 }

void HistoDisplay::ChangeCanvasNameTitle ( TCanvas *  canvas  )  [private]

Definition at line 2948 of file HistoDisplay.cxx.

References count, fDisplayedList, and fSlideCanvasList.

Referenced by DrawHisto().

02949 {
02950   //cout << " In ChangeCanvasNameTitle " << endl;
02951 
02952   if ( !canvas ) return;
02953 
02954   TList *list = canvas->GetListOfPrimitives();
02955 
02956   Int_t count = 0;
02957   TObject *obj = 0;
02958 
02959 
02960   TString canvasname = "";
02961   TString canvastitle = "";
02962 
02963   /*
02964   const char *name = 0;
02965   name = canvas->GetName();
02966   if ( name && fDisplayedList->FindObject( name ) ) {
02967     count++;
02968     canvasname = name;
02969     canvastitle = canvas->GetTitle();
02970   } //if ( name && fDisplayedList->FindObject( obj ) ) 
02971   */
02972 
02973 
02974   TIter next( list );
02975 
02976   while ( ( obj = next() ) ) {
02977 
02978     const char *name = 0;
02979     name = obj->GetName();
02980 
02981     if ( strstr( name, "Pad_of_" ) )
02982       name = &( name[ strlen( "Pad_of_" ) ] );
02983 
02984     //cout << " name " <<  name << endl;
02985 
02986     if ( name && fDisplayedList->FindObject( name ) ) {
02987       count++;
02988       if ( count == 1 ) {
02989           canvasname = TString( name );
02990           canvastitle = TString( obj->GetTitle() );
02991       } // if ( count == 1 )
02992       else if ( count == 2 ) {
02993         canvasname = canvasname + "__" + TString( name );
02994         canvastitle = canvastitle + ", " + TString( obj->GetTitle() );
02995       } //else if ( count == 2 )
02996       else if ( count == 3 ) {
02997         canvasname = canvasname + "__etc";
02998         canvastitle = canvastitle + ", etc.";
02999       } //else if ( count == 3 )
03000     } //if ( name && fDisplayedList->FindObject( obj ) ) 
03001 
03002   } //while ( obj = next() )
03003 
03004   if ( count ) {
03005     if ( fSlideCanvasList->FindObject( canvas->GetName() ) )
03006       //canvastitle =  "<Slide Canvas>" + canvastitle; 
03007       canvastitle =  "<Auto Update>" + canvastitle; 
03008 
03009     canvas->SetName( canvasname.Data() );
03010     canvas->SetTitle( canvastitle.Data() );
03011   } //if ( count )
03012 
03013 }

void HistoDisplay::ClearCurrentPad (  )  [private]

Definition at line 3787 of file HistoDisplay.cxx.

References RecursivePadClear().

Referenced by ProcessMessage().

03787                                    {
03788 
03789   //cout << " In ClearCurrentPad " << endl; 
03790 
03791   //TPad *padsav = (TPad*) gPad;
03792   TPad *pad = (TPad*)gROOT->GetSelectedPad();
03793 
03794   if ( !pad ) return;
03795 
03796   //pad->Clear();
03797   RecursivePadClear( pad );
03798   pad->cd();
03799 
03800   
03801   /*
03802     if ( pad != pad->GetCanvas() ) {
03803     pad->SetName("VOID");
03804     }
03805   */
03806   pad->SetName("VOID");
03807 
03808   pad->SetTitle("Cleared");
03809 
03810   pad->Modified();
03811   pad->Update();
03812   //padsav->cd();
03813 
03814   //cout << "Cleared " << endl;
03815 
03816 }

void HistoDisplay::CloseConnection (  )  [private]

Definition at line 1394 of file HistoDisplay.cxx.

References DspEndConnection.

Referenced by ResetObjects().

01395 {
01396 
01397   //if (MFileOpen) {
01398   if ( gROOT->GetListOfMappedFiles() ) {
01399     //delete MFile;
01400     //gROOT->GetListOfMappedFiles()->Delete();
01401     // To avoid Error in <TMapFile::Close>: 
01402     //  shadow map == 0, should never happen!
01403     TIter next( gROOT->GetListOfMappedFiles() );
01404     TMapFile* mfile = 0; 
01405     while ( ( mfile = (TMapFile*)next() ) ) {
01406       mfile->Close();
01407       //gROOT->GetListOfMappedFiles()->Remove(mfile);
01408       // is called by close
01409     }
01410     //MFile = 0;
01411     //MFileOpen = kFALSE;
01412   }
01413 
01414   //if (RFileOpen) {
01415   if ( gROOT->GetListOfFiles() ) {
01416     //delete RFile;
01417     //gROOT->GetListOfFiles()->Delete();
01418     TIter next( gROOT->GetListOfFiles() );
01419     TFile* file = 0; 
01420     while ( ( file = (TFile*)next() ) ) {
01421       file->Close();
01422       //gROOT->GetListOfFiles()->Remove(file);
01423       // is called by close
01424     }
01425     //RFile = 0;
01426     //RFileOpen = kFALSE;
01427   }
01428 
01429   //if (sockOpen) {
01430 
01431   if ( gROOT->GetListOfSockets() ) {
01432     //gROOT->GetListOfSockets()->Delete();
01433     gROOT->GetListOfSockets()->ls();
01434     TIter next( gROOT->GetListOfSockets() );
01435     TSocket* socktmp = 0;
01436     while ( ( socktmp = (TSocket*)next() ) ) {
01437       //socktmp->Send("END CONNECTION");
01438       socktmp->Send( DspEndConnection.c_str() );
01439       socktmp->Close();
01440       //gROOT->GetListOfFiles()->Remove(socktmp);
01441       // is called by close
01442     }
01443     //sockOpen = kFALSE;
01444   }
01445 
01446   //InputOpen = kFALSE;
01447 
01448 }

TObject * HistoDisplay::CloseFile ( TObject *  inputobj  )  [private]

Definition at line 1372 of file HistoDisplay.cxx.

01373 {
01374   //cout << " In CloseFile ( obj )" << endl;
01375 
01376   if ( obj ) { 
01377 
01378     if ( obj->InheritsFrom( TMapFile::Class() ) ) 
01379       ( (TMapFile*)obj )->Close();
01380 
01381     else if ( obj->InheritsFrom( TMapFile::Class() ) ) 
01382       ( (TFile*)obj )->Close();
01383 
01384     else if ( obj->InheritsFrom( TSocket::Class() ) ) 
01385       ( (TSocket*)obj )->Close();
01386  
01387   } //if ( obj ) 
01388 
01389   return obj;
01390 
01391 }

TObject * HistoDisplay::CloseFile ( const char *  filename,
EInputTypes  inputtype = kTFile 
) [private]

Definition at line 1342 of file HistoDisplay.cxx.

References kTFile, kTMapFile, and kTSocket.

01344 {
01345   //cout << " In CloseFile " << endl;
01346 
01347   TObject *obj = 0;
01348 
01349   if ( inputtype == kTMapFile ) {
01350 
01351     while( ( obj = gROOT->GetListOfMappedFiles()->FindObject(filename) ) )
01352       ( (TMapFile*)obj )->Close();
01353 
01354   } //if ( inputtype == kTMapFile )
01355   else if ( inputtype == kTFile ) {
01356 
01357     while( ( obj = gROOT->GetListOfFiles()->FindObject(filename) ) )
01358       ( (TFile*)obj )->Close();
01359 
01360   } //else if ( inputtype == kTFile )
01361   else if ( inputtype == kTSocket ) {
01362 
01363     while( ( obj =gROOT->GetListOfSockets()->FindObject(filename) ) )
01364       ( (TSocket*)obj )->Close();
01365 
01366   } //else if ( inputtype == kTSocket ) 
01367  
01368   return obj;
01369 
01370 }

void HistoDisplay::CloseInputFrame (  )  [private]
void HistoDisplay::CloseMenuBar (  )  [private]

Definition at line 569 of file HistoDisplay.cxx.

References consumerlist, fConnectMenu, fFileMenu, fHelpMenu, fListTreeMenu, fMenuBar, fMenuBarHelpLayout, fMenuBarItemLayout, fMenuBarLayout, fMenuBarSeparator, fMenuBarSeparatorLayout, fNewCascadeMenu, and fSortCascadeMenu.

Referenced by ~HistoDisplay().

00570 {
00571   delete fNewCascadeMenu;
00572   delete fFileMenu;
00573   delete fSortCascadeMenu;
00574   delete fListTreeMenu;
00575   delete fConnectMenu;
00576   delete fHelpMenu;
00577   delete fMenuBarItemLayout;
00578   delete fMenuBarHelpLayout;
00579   delete fMenuBar;
00580   delete fMenuBarLayout;
00581 
00582   delete fMenuBarSeparator;
00583   delete fMenuBarSeparatorLayout;
00584   delete consumerlist;
00585 }

void HistoDisplay::CloseStatusBar (  )  [private]

Definition at line 1230 of file HistoDisplay.cxx.

References fStatusBar.

Referenced by ~HistoDisplay().

01231 {
01232   delete fStatusBar;
01233 }

void HistoDisplay::CloseTGListTreeFrame (  )  [private]

Definition at line 1159 of file HistoDisplay.cxx.

References fButtonFrame, fButtonFrameLayout, fButtonLayout, fChButtonAutoUpdate, fChButtonAutoUpdateLayout, fChButtonSlideUpdate, fClearHistoButton, fContentHistoButton, fControlButtonFrame, fControlButtonFrameLayout, fFrequencyFrame, fFrequencyFrameLayout, fFrequencyLabel, fFrequencyTextBuffer, fFrequencyTextEntry, fHistoButtonFrame, fHistoButtonFrameLayout, fHistoButtonGFrame, fHistoButtonGFrameLayout, fHistoButtonLayout, fHistoListFrame, fHistoListFrameLayout, fHistoListTree, fListButtonFrame, fListButtonFrameLayout, fListTreeMainFrame, fListTreeMainFrameLayout, fMonitorNameBuffer, fMonitorNameLabel, fMonitorNameLayout, fMonitorNameTextEntry, fPauseHistoButton, fPrintHistoButton, fRestartHistoButton, fStopHistoButton, fTGCanvas, fTGCanvasLayout, fUnZeroHistoButton, and fZeroHistoButton.

Referenced by ~HistoDisplay().

01160 {
01161   delete fMonitorNameLayout;
01162   delete fMonitorNameLabel;
01163   delete fMonitorNameBuffer;
01164   delete fMonitorNameTextEntry;
01165 
01166   delete fHistoListTree;
01167   delete fTGCanvas;
01168   delete fTGCanvasLayout;
01169 
01170   delete fChButtonAutoUpdate;
01171   delete fChButtonSlideUpdate;
01172   delete fChButtonAutoUpdateLayout;
01173 
01174 
01175   delete fFrequencyLabel;
01176   delete fFrequencyTextBuffer;
01177   delete fFrequencyTextEntry;
01178   delete fFrequencyFrame;
01179   delete fFrequencyFrameLayout;
01180 
01181   //delete fStartHistoButton;
01182   delete fPauseHistoButton;
01183   delete fRestartHistoButton;
01184   delete fClearHistoButton;
01185   delete fPrintHistoButton;
01186   delete fStopHistoButton;
01187   //delete fExitButton;
01188 
01189   delete fButtonLayout;
01190 
01191   delete fButtonFrame;
01192   delete fButtonFrameLayout;
01193 
01194 
01195 
01196   delete fZeroHistoButton;
01197   delete fUnZeroHistoButton;
01198   delete fContentHistoButton;
01199 
01200   delete fHistoButtonLayout;
01201 
01202   delete fHistoButtonFrame;
01203   delete fHistoButtonFrameLayout;
01204   delete fHistoButtonGFrame;
01205   delete fHistoButtonGFrameLayout;
01206 
01207 
01208   delete fControlButtonFrame;
01209   delete fControlButtonFrameLayout;
01210 
01211 
01212   delete fListButtonFrame;
01213   delete fListButtonFrameLayout;
01214 
01215   delete fHistoListFrame;
01216   delete fHistoListFrameLayout;
01217 
01218   delete fListTreeMainFrame;
01219   delete fListTreeMainFrameLayout;
01220 }

void HistoDisplay::CloseTitleFrame (  )  [private]

Definition at line 625 of file HistoDisplay.cxx.

References fPicBut, fPictLayout, fTextGC, fTitleFrame, fTitleFrameLayout, fTitleLabel, and fTitleLabelLayout.

Referenced by ~HistoDisplay().

00626 {
00627   gVirtualX->DeleteGC(fTextGC);
00628   delete fTitleLabel;
00629   delete fTitleLabelLayout;
00630   delete fPicBut;
00631   delete fPictLayout;
00632   delete fTitleFrame;
00633   delete fTitleFrameLayout;
00634 }

void HistoDisplay::CloseWindow (  )  [private]

Definition at line 4417 of file HistoDisplay.cxx.

Referenced by ProcessMessage().

04418 {
04419   gApplication->Terminate(0);
04420 
04421 }

TH1F * HistoDisplay::ContentHisto ( TH1 *  histo  )  [private]

Definition at line 4278 of file HistoDisplay.cxx.

References max, and min.

Referenced by DrawContentHisto().

04279 {
04280   //cout << " In ContentHisto" << endl;
04281   if (!histo) return 0;
04282 
04283   float min, max;
04284   min = histo->GetMinimum();
04285   max = histo->GetMaximum();
04286 
04287   if ( min == max ) return 0;
04288 
04289   int nbin;
04290   nbin = 50;
04291   float binsize;
04292   binsize = (max - min)/nbin;
04293 
04294   TH1F* contenthisto = 
04295     new TH1F("BinContenHisto", histo->GetTitle(), nbin,
04296             min - 2*binsize, max + 2*binsize );
04297   // oldone is removed by canvas->Clear() in DrawOntheCanvas.
04298 
04299   contenthisto->SetXTitle("Hits in a bin");
04300   contenthisto->SetYTitle("Number of bins");
04301 
04302   Int_t nbinsx = histo->GetNbinsX();
04303   Int_t nbinsy = histo->GetNbinsY();
04304   Int_t nbinsz = histo->GetNbinsZ();
04305 
04306 
04307    Int_t bin, binx, biny, binz;
04308    double content;
04309    for (binz=0;binz<=nbinsz+1;binz++) {
04310      for (biny=0;biny<=nbinsy+1;biny++) {
04311        for (binx=0;binx<=nbinsx+1;binx++) {
04312             bin = binx +(nbinsx+2)*(biny + (nbinsy+2)*binz);
04313             content = histo->GetBinContent(bin);
04314             if (content) contenthisto->Fill(content);
04315        }
04316      }
04317    }
04318 
04319    return contenthisto;
04320 }

void HistoDisplay::CycleSlides ( const TGListTreeItem *  item,
TVirtualPad *  currentpad 
) [private]

Definition at line 3439 of file HistoDisplay.cxx.

Referenced by HistoDisplaySlideTimer::Notify().

03441 {
03442   //  cout << " In CycleSlides " << endl;
03443 
03444   /*
03445   static TGListTreeItem *item = 0;
03446 
03447   TVirtualPad *padsav = 0;
03448 
03449   if ( !currentitem ) {
03450     Running = kFALSE;
03451     //    fReadFileButton->ChangeBackground(Red);
03452     return;
03453   } //if ( !currentitem ) 
03454 
03455   if ( !item || ( item && ( item->GetParent() != currentitem ) ) ) 
03456     item = currentitem->GetFirstChild();
03457 
03458   if ( item ) {
03459 
03460     //if ( !gROOT->GetListOfCanvases()->IsEmpty() && gPad )
03461     if ( gROOT->GetListOfCanvases()->IsEmpty() ) gPad = 0;
03462     padsav =  gPad;
03463 
03464     //TObject *obj = fDisplayedList->FindObject( item->GetText() );
03465     TObject *obj = GetCObjFromListItem( item );
03466 
03467     if( obj ) {
03468       if ( obj->InheritsFrom( CObject::Class() ) ) {
03469 
03470         const TObject *inputobj = 
03471           ( (CObject*)obj )->GetInputSource();
03472         TObject *cobj = 
03473           UpdateHistoList( item->GetText(), inputobj );
03474 
03475         fHistoListTree->HighlightItem( item );
03476         fClient->NeedRedraw( fHistoListTree );
03477 
03478         if ( currentpad &&
03479              gROOT->GetListOfCanvases()->FindObject( currentpad ) )
03480           currentpad->cd();
03481         else if ( padsav ) {
03482           padsav->cd();
03483           fSlideTimer->SetCurrentPad( padsav );
03484         }
03485 
03486         DrawHisto( cobj );
03487 
03488         if ( padsav ) padsav->cd();
03489 
03490       } //if ( obj->InheritsFrom( CObject::Class() ) )
03491     }//if( obj )
03492 
03493 
03494 
03495     item = item->GetNextSibling();
03496 
03497     if ( !item ) 
03498       if ( AutoUpdate ) item = fSelectedItem->GetFirstChild();
03499       else
03500         Running = kFALSE;
03501     //    fReadFileButton->ChangeBackground(Red);
03502 
03503   } // if ( item )
03504   else {
03505     Running = kFALSE;
03506     // fReadFileButton->ChangeBackground(Red);
03507   } //else //if ( item )
03508 
03509   */
03510 }

void HistoDisplay::DelTreeItemsOfInput ( TObject *  inputobj  )  [private]

Definition at line 2242 of file HistoDisplay.cxx.

References fHistoListTree.

02243 {
02244   //cout << " In DelTreeItemsOfInput " << endl;
02245   TGListTreeItem *item = fHistoListTree->GetFirstItem();
02246 
02247   while( item ) {
02248     fHistoListTree->RecursiveDeleteItem( item, inputobj );
02249     item = item->GetNextSibling();
02250   }//while( item )
02251 
02252 }

void HistoDisplay::DrawContentHisto ( TH1 *  histo  )  [private]

Definition at line 4266 of file HistoDisplay.cxx.

References ContentHisto(), and DrawOnTheCanvas().

Referenced by ProcessMessage().

04267 {
04268   //cout << " In DrawContentHisto" << endl;
04269   if ( !histo ) return;
04270 
04271   DrawOnTheCanvas( "ContentHistoCanvas", "Bin-Content Histogram Canvas",
04272                    300, 300,
04273                    ContentHisto(histo) ) ;
04274 }

void HistoDisplay::DrawHisto ( TList *  list  )  [private]

Definition at line 2808 of file HistoDisplay.cxx.

References CanvasName, CanvasNumber, CanvasTitle, ChangeCanvasNameTitle(), DrawTH1(), DrawTPad(), CObject::GetTObject(), option, RecursivePadClear(), and CHistogram::SubtractedHisto().

02809 {
02810   //cout << " In DrawHisto list " << endl;
02811 
02812   // For older version of ROOT, this is needed.
02813   //static int icount = 0;
02814   if ( gROOT->GetListOfCanvases()->IsEmpty() ) gPad = 0;
02815 
02816     if ( fSelectedList && !fSelectedList->IsEmpty() ) {
02817       int nPad = fSelectedList->GetSize();
02818       int nPadX = (int) sqrt( (float)nPad );
02819       int nPadY = nPadX;
02820 
02821       if ( nPadX*nPadY < nPad ) {
02822         nPadX++;
02823         if ( nPadX * nPadY < nPad ) nPadY++;
02824       } //if ( nPadX*nPadY < nPad ) 
02825 
02826 
02827       // pad size ww,wh--
02828       int ww, wh;
02829       ww = wh = 300;
02830 
02831       TCanvas *CurrentCanvas = 0;
02832 
02833       if ( !gPad ){
02834         CanvasNumber++;
02835         char *num = new char[3];
02836         sprintf( num, "%d", CanvasNumber);
02837         CurrentCanvas =
02838           new TCanvas( CanvasName + TString( num ),
02839                        CanvasTitle + TString( num) , ww * nPadX, wh * nPadY );
02840         delete num;
02841         CurrentCanvas->cd();
02842       }//if (!gPad)
02843       else {
02844         CurrentCanvas = (TCanvas*)gPad->GetCanvas();
02845 
02846         //CurrentCanvas->Clear();
02847         RecursivePadClear( CurrentCanvas );
02848         CurrentCanvas->cd();
02849 
02850         //tmp
02851         /*
02852         CurrentCanvas->SetWindowSize( ww * nPadX, wh * nPadY );
02853         CurrentCanvas->Resize();
02854         */
02855 
02856       }//if (!gPad) else
02857 
02858 
02859       CurrentCanvas->Divide( nPadX, nPadY );
02860 
02861 
02862       int iPad = 0;
02863 
02864       TIter nextList(fSelectedList);
02865 
02866       TObject *obj = 0;
02867       while ( ( obj = nextList() ) ) {
02868         iPad++;
02869 
02870         if ( obj->InheritsFrom( CHistogram::Class() ) ) {
02871 
02872           CurrentCanvas->cd(iPad);
02873 
02874           CHistogram *chisto = (CHistogram*)obj;
02875 
02876           TH1 *histo = chisto->SubtractedHisto();
02877           //TH1 *histo = chisto->GetHistoDrawn();
02878 
02879           if ( histo ) {
02880  
02881             Option_t *option;
02882             option = chisto->GetTObject()->GetOption();
02883 
02884             TPad *gpad = (TPad*)gPad;
02885 
02886             TString padname = "Pad_of_" +  TString( histo->GetName() ) ;
02887             TString padtitle = TString( histo->GetTitle() ) ;
02888 
02889             gpad->SetName( padname.Data() );
02890             gpad->SetTitle( padtitle.Data() );
02891 
02892             DrawTH1(histo, option, gpad);
02893 
02894             gpad->Modified();
02895             gpad->Update();
02896 
02897           } //if( histo )
02898 
02899         } //if ( obj->InheritsFrom( CHistogram::Class() ) )
02900             
02901         else if ( obj->InheritsFrom( CObject::Class() ) ) {
02902 
02903           CObject *cobj = (CObject*)obj;
02904           TObject *tobj = cobj->GetTObject();
02905 
02906           if ( tobj && tobj->InheritsFrom( TPad::Class() ) ) {
02907 
02908             CurrentCanvas->cd(iPad);
02909 
02910             TPad *gpad = (TPad*)gPad;
02911             TPad *c2 = (TPad*)tobj;
02912 
02913             if (c2) {
02914               gpad->SetName( c2->GetName() );
02915               gpad->SetTitle( c2->GetTitle() );
02916 
02917               DrawTPad(c2, gpad);
02918               //gpad->Modified();
02919               gpad->Update();
02920 
02921             } //if (c2)
02922 
02923           } //if ( tobj && tobj->InheritsFrom( TPad::Class() ) )
02924 
02925         } //else if ( obj->InheritsFrom( CObject::Class() ) )
02926 
02927       } // while ( obj = nextList() )
02928 
02929 
02930       ChangeCanvasNameTitle( CurrentCanvas );
02931 
02932 
02933       CurrentCanvas->cd();
02934       CurrentCanvas->Modified();
02935       CurrentCanvas->Update();
02936 
02937       //cout << "Drawing done" << endl << endl;
02938 
02939     } // if ( fSelectedList && !fSelectedList->IsEmpty() )
02940       
02941 
02942 }

void HistoDisplay::DrawHisto ( TObject *  obj  )  [private]

Definition at line 2625 of file HistoDisplay.cxx.

References CanvasName, CanvasNumber, CanvasTitle, ChangeCanvasNameTitle(), DrawTH1(), DrawTPad(), fSlideCanvasList, CObject::GetTObject(), kWarningErrorCanvasName, option, RecursivePadClear(), and CHistogram::SubtractedHisto().

Referenced by ProcessMessage().

02626 {
02627   //cout << " In DrawHisto obj " << endl;
02628 
02629   /*
02630   // For older version of ROOT, this is needed.
02631   static int icount = 0;
02632   if ( !(icount++) || gROOT->GetListOfCanvases()->IsEmpty() ) gPad = 0;
02633   */
02634 
02635   if ( gROOT->GetListOfCanvases()->IsEmpty() ) gPad = 0;
02636 
02637   if ( obj ) {
02638 
02639     //obj->ls();
02640 
02641     TCanvas *CurrentCanvas = 0;
02642 
02643     if ( !gPad ) {
02644       CanvasNumber++;
02645       char *num= new char[3];
02646       sprintf( num, "%d", CanvasNumber );
02647       CurrentCanvas =
02648         new TCanvas( CanvasName + TString( num ),
02649                      CanvasTitle + TString( num ) , 500, 500 );
02650       delete[] num;
02651       CurrentCanvas->cd();
02652     }
02653 
02654 
02655 
02656     TPad *gPadSav = (TPad*)gPad;
02657     CurrentCanvas = gPadSav->GetCanvas();
02658 
02659 
02660     if ( obj->InheritsFrom( CHistogram::Class() ) ) {
02661 
02662       CHistogram *chisto = (CHistogram*) obj;
02663       TH1 *histo = chisto->SubtractedHisto();
02664       //TH1 *histo =  chisto->GetHistoDrawn();
02665 
02666       if ( histo ) {
02667 
02668         TObject *hobj = chisto->GetTObject();
02669 
02670         Option_t *option = 0;
02671         if ( hobj ) option = hobj->GetOption();
02672 
02673         //gPadSav->Clear();
02674         RecursivePadClear( gPadSav );
02675         gPadSav->cd();
02676 
02677 
02678 
02679         TString padname;
02680         TString padtitle;
02681 
02682         if ( gPadSav == CurrentCanvas ) {
02683 
02684           //tmp
02685           /*
02686           CurrentCanvas->SetWindowSize( 500, 500 );
02687           CurrentCanvas->Resize();
02688           */
02689 
02690           if ( strcmp( CurrentCanvas->GetName(),
02691                        kWarningErrorCanvasName ) ) {
02692 
02693           padname = "Canvas_of_" +  TString( histo->GetName() ) ;
02694           if ( fSlideCanvasList->FindObject( CurrentCanvas ) )
02695             //padtitle = "<Slide Canvas>" + TString( histo->GetTitle() );
02696             padtitle = "<Auto Update>" + TString( histo->GetTitle() );
02697           else
02698             padtitle = TString( histo->GetTitle() );
02699           CurrentCanvas->SetName( padname.Data() );
02700           CurrentCanvas->SetTitle( padtitle.Data() );
02701 
02702           } // if ( strcmp( CurrentCanvas->GetName(),
02703 
02704 
02705           //gPadSav->cd();
02706           //DrawTH1( histo, option, gPadSav );
02707           DrawTH1( histo, option, CurrentCanvas );
02708         } //if ( gPadSav == gPadSav->GetCanvas() )
02709         else { 
02710 
02711           padname = "Pad_of_" + TString( histo->GetName() );
02712           padtitle = TString( histo->GetTitle() );
02713 
02714           gPadSav->SetName( padname.Data() );
02715           gPadSav->SetTitle( padtitle.Data() );
02716           //gPadSav->cd();
02717           DrawTH1( histo, option, gPadSav );
02718 
02719           ChangeCanvasNameTitle( CurrentCanvas );
02720 
02721         } // else //if ( gPadSav == gPadSav->GetCanvas() )
02722 
02723 
02724       } //if ( histo )
02725 
02726     } //if ( obj->InheritsFrom( CHistogram::Class() ) ) 
02727 
02728     else if ( obj->InheritsFrom( CObject::Class() ) ) {
02729       CObject *cobj = (CObject*)obj;
02730       TObject *tobj = cobj->GetTObject();
02731 
02732       if ( tobj->InheritsFrom( TPad::Class() ) ) {
02733 
02734         TPad *c2 = (TPad*)tobj;
02735 
02736         //tmp
02737         //cout << " gPadSav->GetName() = " << gPadSav->GetName() << endl;
02738 
02739         gPadSav->cd(); // necessary to prevent bad x window allocation.
02740 
02741         if ( c2 ) {
02742 
02743 
02744           if ( gPadSav == CurrentCanvas ) {
02745             //gPadSav->Clear();
02746             //RecursivePadClear( gPadSav );
02747             gPadSav->cd();
02748 
02749           //tmp
02750           /*
02751             if ( c2->InheritsFrom( TCanvas::Class() ) )
02752               DuplicateCanvasSize( CurrentCanvas, (TCanvas*)c2 );
02753           */
02754 
02755           if ( strcmp( CurrentCanvas->GetName(),
02756                        kWarningErrorCanvasName ) ) {
02757 
02758             CurrentCanvas->SetName( c2->GetName() );
02759             TString padtitle;
02760             if ( fSlideCanvasList->FindObject( CurrentCanvas ) )
02761               //padtitle = "<Slide Canvas>" + TString( c2->GetTitle() );
02762               padtitle = "<Auto Update>" + TString( c2->GetTitle() );
02763             else
02764               padtitle = TString( c2->GetTitle() );
02765             CurrentCanvas->SetTitle( padtitle );
02766 
02767           } // if ( strcmp( CurrentCanvas->GetName(),
02768 
02769 
02770             DrawTPad( c2, gPadSav );
02771 
02772           } //if ( gPadSav == gPadSav->GetCanvas() )
02773           else {
02774             gPadSav->SetName( c2->GetName() );
02775             gPadSav->SetTitle( c2->GetTitle() );
02776             DrawTPad( c2, gPadSav );
02777             ChangeCanvasNameTitle( CurrentCanvas );
02778 
02779           } //else //if ( gPadSav == gPadSav->GetCanvas() ) 
02780 
02781         } //if (c2)
02782 
02783       } //if ( tobj->InheritsFrom( TPad::Class() ) )
02784 
02785     } //else if ( obj->InheritsFrom( CObject::Class() ) ) 
02786 
02787 
02788     //ChangeCanvasNameTitle( CurrentCanvas );
02789 
02790     gPadSav->cd();
02791     /*
02792     gPadSav->Modified();
02793     gPadSav->Update();
02794     */
02795     CurrentCanvas->Modified();
02796     CurrentCanvas->Update();
02797 
02798 
02799     //cout << "Drawing done" << endl << endl;
02800       
02801   } //if (obj)
02802 
02803 
02804 }

void HistoDisplay::DrawOnTheCanvas ( const char *  canvasname,
const char *  canvastitle,
int  padx,
int  pady,
TObject *  obj 
) [private]

Definition at line 4323 of file HistoDisplay.cxx.

Referenced by DrawContentHisto().

04326 {
04327   //cout << " In DrawOnTheCanvas" << endl;
04328   if (!obj) return;
04329 
04330   TPad *padsav  = (TPad*)gPad;
04331 
04332   TCanvas *canvas;
04333 
04334   canvas = 
04335     (TCanvas*) ( gROOT->GetListOfCanvases()->FindObject( canvasname ) );
04336 
04337   if (!canvas) {
04338     canvas = new TCanvas( canvasname, canvastitle, padx, pady);
04339   }
04340   else {
04341     //canvas->SetWindowSize( padx, pady);
04342     canvas->cd();
04343     canvas->Clear();
04344   } //if (!canvas)
04345 
04346   obj->Draw();
04347 
04348   canvas->Modified();
04349   canvas->Update();
04350 
04351   padsav->cd();
04352 
04353 }

void HistoDisplay::DrawTH1 ( TH1 *  histo,
Option_t *  option,
TVirtualPad *  backpad 
) [private]

Definition at line 3046 of file HistoDisplay.cxx.

Referenced by DrawHisto().

03048 {
03049   //cout << " In DrawTH1" << endl;
03050 
03051   if ( !histo || !BackPad ) return;
03052   //BackPad->Clear(); // Done by TH1::Draw()
03053   //RecursivePadClear( BackPad );
03054 
03055   BackPad->cd();
03056 
03057   //histo->Draw(option);
03058 
03059   histo->Draw();
03060   histo->SetDrawOption( option );
03061 
03062   //cout << " End of DrawTH1 " << endl;
03063 
03064 }

void HistoDisplay::DrawTPad ( TPad *  pad1,
TVirtualPad *  pad2 
) [private]

Definition at line 3070 of file HistoDisplay.cxx.

References RecursivePadClear().

Referenced by DrawHisto(), and DrawUpdatedPad().

03071 {
03072   //  cout << " In DrawTPad  " << endl;
03073 
03074   if ( !DrawnPad || !BackPad ) return;
03075 
03076   //copy pad attributes
03077   BackPad->Range( DrawnPad->GetX1(), DrawnPad->GetY1(),
03078                   DrawnPad->GetX2(), DrawnPad->GetY2() );
03079   BackPad->SetTickx( DrawnPad->GetTickx() );
03080   BackPad->SetTicky( DrawnPad->GetTicky() );
03081   BackPad->SetGridx( DrawnPad->GetGridx() );
03082   BackPad->SetGridy( DrawnPad->GetGridy() );
03083   BackPad->SetLogx( DrawnPad->GetLogx() );
03084   BackPad->SetLogy( DrawnPad->GetLogy() );
03085   BackPad->SetLogz( DrawnPad->GetLogz() );
03086   BackPad->SetBorderSize( DrawnPad->GetBorderSize() );
03087   BackPad->SetBorderMode( DrawnPad->GetBorderMode() );
03088   DrawnPad->TAttLine::Copy( (TAttLine&)*BackPad );
03089   DrawnPad->TAttFill::Copy( (TAttFill&)*BackPad );
03090   DrawnPad->TAttPad::Copy( (TAttPad&)*BackPad );
03091 
03092 
03093   TList *list = DrawnPad->GetListOfPrimitives();
03094   TIter next( list );
03095   TObject *objInPad;
03096 
03097   //  BackPad->Clear();
03098      RecursivePadClear( BackPad );
03099 
03100 
03101   //  BackPad->cd();
03102 
03103 
03104   while( ( objInPad = next() ) ) {
03105     BackPad->cd(); // this is absolutely necessary in compiled mode.
03106     // and just before Draw(). Learned hard way.
03107     // Seemed not true for newer ROOT version.
03108 
03109     //    objInPad->Print();
03110     gROOT->SetSelectedPad( BackPad ); 
03111     // not BackPad->cd() but this for primitiveList->Add
03112 
03113     // objInPad->DrawClone(); // Best choise to draw all in DrawnPad.
03114     // But does not draw them on additional pad made here.
03115     // Not allowed to change pad size. 
03116 
03117     //  objInPad->Clone()->Draw();
03118 
03119         BackPad->GetListOfPrimitives()
03120       //->Add( objInPad->Clone(), objInPad->GetDrawOption() );
03121         ->Add( objInPad->Clone(), next.GetOption() );
03122 
03123   } // while( objInPad = next() )
03124 
03125   BackPad->Modified();
03126   delete objInPad;
03127 
03128 }

void HistoDisplay::DrawUpdatedPad ( TVirtualPad *  currentPad  )  [private]

Definition at line 3532 of file HistoDisplay.cxx.

References DrawTPad(), fDisplayedList, CObject::GetTObject(), and UpdateHistoList().

Referenced by UpdatePad().

03533 {
03534   //  cout << " In DrawUpdatedPad " << endl;
03535 
03536   if ( ! currentPad ) return;
03537 
03538   //if ( currentPad != currentPad->GetCanvas() ) {
03539 
03540     const char *name = currentPad->GetName();
03541 
03542     TObject *objP = fDisplayedList->FindObject( name );
03543  
03544     if ( objP && objP->InheritsFrom( CObject::Class() ) ) {
03545 
03546       const TObject *inputObj = ( (CObject*)objP )->GetInputSource();
03547       CObject *objNew = UpdateHistoList( name, inputObj );
03548 
03549       if ( objNew ) {
03550         TObject *tobj =  objNew->GetTObject();
03551         
03552         if ( tobj->InheritsFrom( TPad::Class() ) ) {
03553            DrawTPad( (TPad*)tobj, currentPad );
03554           //      ReplacePad( (TPad*)tobj, currentPad );
03555            //     cout << "In here - replace pad\n";
03556           //      delete name;
03557          
03558                   return;
03559         } //if ( tobj->InheritsFrom( TPad::Class() ) )
03560        
03561       } //if ( objNew )
03562 
03563     } //if ( objP && objP->InheritsFrom( CObject::Class() ) )
03564 
03565     //} //if ( currentPad != currentPad->GetCanvas() )
03566 
03567 
03568   //TFrame *frame = currentPad->GetFrame();
03569 
03570   TObjOptLink *lnk = (TObjOptLink*)currentPad
03571     ->GetListOfPrimitives()
03572     ->FirstLink();
03573 
03574   while( lnk ) {
03575 
03576     TObject *obj = lnk->GetObject();
03577 
03578     if ( obj->InheritsFrom(TPad::Class()) ) {
03579 
03580       DrawUpdatedPad( (TPad*)obj );
03581         
03582     } //if ( obj->InheritsFrom(TPad::Class()) )
03583 
03584     else {
03585 
03586       if ( obj->InheritsFrom(TH1::Class()) ) {
03587 
03588         TObject *obj2 = fDisplayedList->FindObject(obj->GetName());
03589         
03590         if ( obj2 && obj2->InheritsFrom(CObject::Class()) ) {
03591 
03592           const TObject *inputObj = ((CObject*)obj2)->GetInputSource();
03593 
03594           CObject *objNew = UpdateHistoList(obj2->GetName(), inputObj);
03595 
03596           //objNew->ls();
03597 
03598           if (objNew && objNew->InheritsFrom(CHistogram::Class()) ) {
03599 
03600             //gROOT->SetSelectedPad( currentPad );
03601 
03602             TH1 *histo = (TH1*) (((CHistogram*)objNew)->SubtractedHisto());
03603             //TH1 *histo =  ( (CHistogram*)objNew )->GetHistoDrawn();
03604 
03605             if ( histo ) {
03606 
03607               //tmp
03608               if ( ! currentPad->GetPadPaint() ) {
03609 
03610                 TH1 *histoOld = (TH1*)obj;
03611                 histoOld->Reset();
03612                 histoOld->Add(histo);
03613 
03614                 TAxis *xaxis = histo->GetXaxis();
03615                 if ( xaxis ) {
03616                   char *title = new char[ strlen( xaxis->GetTitle() ) + 1 ];
03617                   strcpy( title, xaxis->GetTitle() ); 
03618                   histoOld->SetXTitle( title );
03619                   delete [] title;
03620                 } //if ( xaxis )
03621                 TAxis *yaxis = histo->GetYaxis();
03622                 if ( yaxis ) {
03623                   char *title = new char[ strlen( yaxis->GetTitle() ) + 1 ];
03624                   strcpy( title, yaxis->GetTitle() ); 
03625                   histoOld->SetYTitle( title );
03626                   delete [] title;
03627                 } //if ( yaxis )
03628                 TAxis *zaxis = histo->GetZaxis();
03629                 if ( zaxis ) {
03630                   char *title = new char[ strlen( zaxis->GetTitle() ) + 1 ];
03631                   strcpy( title, zaxis->GetTitle() ); 
03632                   histoOld->SetZTitle( title );
03633                   delete [] title;
03634                 } //if ( zaxis ) 
03635 
03636                 delete histo;
03637 
03638                 currentPad->Modified();
03639 
03640               } //if ( ! currentPad->GetPadPaint() )
03641               else
03642                 cout << " Pad is being paianted. Not updated. " << endl;
03643 
03644             } //if ( histo ) 
03645 
03646           } //if (objNew && objNew->InheritsFrom(CHistogram::Class()) )
03647 
03648         } //if ( obj2 && obj2->InheritsFrom(CObject::Class()) )
03649 
03650       } //if ( obj->InheritsFrom(TH1::Class()) )
03651 
03652       /*
03653       else if ( !( frame->IsEqual( obj ) ) ) {
03654 
03655       } //else if ( !( frame->IsEqual( obj ) ) )
03656       */
03657 
03658     } //else //if ( obj->InheritsFrom(TPad::Class()) )
03659 
03660    lnk = (TObjOptLink*) ( lnk->Next() );
03661 
03662   } //  while( lnk ) 
03663 
03664   // delete name;
03665 
03666   //  cout << " End of DrawUpdatedPad " << endl;
03667 }

void HistoDisplay::DuplicateCanvasSize ( TCanvas *  guicanvas,
TCanvas *  consumercanvas 
) [private]

Definition at line 3017 of file HistoDisplay.cxx.

03019 {
03020   //cout << " In DuplicateCanvasSize " << endl;
03021 
03022   if ( !guicanvas || !consumercanvas ) return;
03023   Int_t ww, wh;
03024 
03025   ww = consumercanvas->GetWindowWidth();
03026   wh = consumercanvas->GetWindowHeight();
03027 
03028   if ( !ww || !wh ) {
03029     ww = consumercanvas->GetWw() + 4;
03030     wh = consumercanvas->GetWh() + 28;
03031   } //if ( !ww || !wh )
03032 
03033   if ( ww && wh ) {
03034     guicanvas->SetWindowSize( ww, wh );
03035     guicanvas->Resize();
03036   } //if ( ww && wh )
03037 
03038 }

const char * HistoDisplay::FileDialogWindow (  )  [private]

Definition at line 4528 of file HistoDisplay.cxx.

References fRaButMFile, fRaButRFile, and fRaButSocket.

Referenced by ProcessMessage().

04529 { 
04530 
04531   //const char *filetypes[] = { "All files",     "*",
04532   //                  "ROOT files",    "*.root",
04533   //                  "MAP files",     "*.map",
04534   //                  0,               0 };
04535 
04536 
04537   static TGFileInfo fi;
04538   //fi.fFileTypes = (char **)filetypes;
04539 
04540 
04541   //EInputTypes inputtype;
04542 
04543   if ( fRaButMFile->GetState() == kButtonDown ) {
04544     //inputtype = kTMapFile;
04545     const char* filetypes[] = { "MAP files",     "*.map",
04546                     "All files",     "*",
04547                     "ROOT files",    "*.root",
04548                     0,               0 };
04549     fi.fFileTypes = (const char **)filetypes;
04550   }
04551   else if ( fRaButRFile->GetState() == kButtonDown ) {
04552     //inputtype = kTFile;
04553     const char* filetypes[] = {"ROOT files",    "*.root",
04554                    "All files",     "*",
04555                    "MAP files",     "*.map",
04556                    0,               0 };
04557     fi.fFileTypes = (const char **)filetypes;
04558   }
04559   else if ( fRaButSocket->GetState() == kButtonDown ) {
04560     //inputtype = kTSocket;
04561     const char* filetypes[] = { "All files",     "*",
04562                     "ROOT files",    "*.root",
04563                     "MAP files",     "*.map",
04564                     0,               0 };
04565     fi.fFileTypes = (const char **)filetypes;
04566   }
04567 
04568 
04569 
04570   new TGFileDialog(gClient->GetRoot(), gClient->GetRoot(), kFDOpen, &fi);
04571 
04572   return fi.fFilename;
04573 }

void HistoDisplay::FileNameClear (  )  [private]

Definition at line 4575 of file HistoDisplay.cxx.

References fFileNameBuffer, and fFileNameTextEntry.

Referenced by ProcessMessage().

04576 {
04577   //cout << " In File Name Clear " << endl;
04578   fFileNameBuffer->Clear();
04579   fFileNameTextEntry->SetState(kTRUE);
04580 }

CObject * HistoDisplay::GetCObjFromListItem ( TGListTreeItem *  item  )  [private]

Definition at line 2561 of file HistoDisplay.cxx.

References fDisplayedList, fHistoListTree, CObject::GetInputSource(), CObject::GetTitle(), CObject::SetInputSource(), and UpdateHistoList().

Referenced by ProcessMessage().

02562 {
02563   //cout << " In GetCObjFromListItem " << endl;
02564 
02565   if ( !item ) return 0;
02566 
02567   CObject *cobj = 0;
02568 
02569   //TVirtualPad *padsav = 0;
02570   //if ( gPad && !gROOT->GetListOfCanvases()->IsEmpty() ) padsav = gPad;
02571 
02572 
02573   TObject *obj = fDisplayedList->FindObject( item->GetText() );
02574 
02575   if ( !obj ) {
02576     if ( !item->GetFirstChild() ) {
02577       TObject *inputobj = (TObject*)item->GetUserData();
02578       if ( inputobj ) 
02579         cobj =  UpdateHistoList( item->GetText(), inputobj );
02580 
02581         if ( !cobj ) 
02582           //fHistoListTree->DeleteItem( item );
02583           cout <<  item->GetText() << " is not found." << endl;
02584         else
02585           fHistoListTree->SetToolTipItem( item, cobj->GetTitle() );
02586 
02587     } //if ( !item->GetFirstChild() )
02588   } //if ( !obj ) 
02589   else 
02590     if ( obj->InheritsFrom( CObject::Class() ) ) {
02591       cobj = ( CObject* )obj;
02592       const TObject *inputobj = (TObject*)item->GetUserData();
02593 
02594       if ( cobj->GetInputSource() != inputobj ) {
02595         //tmp
02596         //cout << " inputobj is changed " << endl;
02597         cobj->SetInputSource( inputobj );
02598 
02599       } //if ( cobj->GetInputSource() != inputobj ) 
02600         
02601     } //if ( obj->InheritsFrom( CObject::Class() ) )
02602 
02603 
02604 
02605   //if ( padsav ) padsav->cd();
02606 
02607 
02608   return cobj;
02609 
02610 }

TString HistoDisplay::GetDirPath ( const TString &   )  [private]

Definition at line 5440 of file HistoDisplay.cxx.

References MonitorName.

Referenced by AddToTree().

05441 {
05442   //cout << " GetDirPath " << endl;
05443 
05444   TString DirPath;
05445 
05446   DirPath = "/" + MonitorName ;
05447   //DirPath = "/";
05448 
05449   /*
05450   char *dirpath = new char[DirPath.Length()];
05451 
05452   cout << " DirPath in DirName" << DirPath.Data() << endl;
05453   strcpy(dirpath, DirPath.Data());
05454   cout << " dirpath in DirName" << dirpath << endl;
05455   return dirpath;
05456   */
05457 
05458   return DirPath;
05459 
05460 }

TObject * HistoDisplay::GetNewObj ( const char *  objName,
const TObject *  inputobj 
) [private]

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 4013 of file HistoDisplay.cxx.

References AddTreeItemsOfInput(), count, DspEndConnection, DspObjectNotFound, DspRequestNewInfo, fChButtonSlideUpdate, fHistoListTree, fReadFileButton, Red, RefreshTreeItem(), Running, SearchWarningErrorFolder(), and SlideShowUpdate.

Referenced by MakeConsumerInfo(), and UpdateHistoList().

04014 {
04015   //cout << " In GetNewObj" << endl;
04016 
04017   TObject *obj = 0;
04018 
04019   if (inputobj) {
04020 
04021     if ( inputobj->IsA() == TMapFile::Class() )   {
04022       TMapFile *mfile = (TMapFile*)inputobj;
04023       if (mfile) obj = (TObject*)mfile->Get( objName );
04024     }
04025     else if ( inputobj->IsA() == TFile::Class() )   {
04026       TFile *rfile = (TFile*)inputobj;
04027       if (rfile) obj = (TObject*)rfile->Get( objName );
04028     }
04029     else if ( inputobj->IsA() == TSocket::Class() )   {
04030       TSocket *socket = (TSocket*)inputobj;
04031 
04032       if ( socket && socket->IsValid() ) {
04033 
04034         Int_t count = 0;
04035         Int_t maxcount = 8; 
04036 
04037         while ( !obj && count < maxcount ) {
04038 
04039           socket->Send( objName );
04040           TMessage *message = NULL;
04041 
04042           Int_t resRecv;
04043           resRecv = socket->Recv(message);
04044           //cout << "resRecv: " << resRecv << endl;
04045           if (resRecv == -1) {
04046             cerr << " HistoDisplay: ERROR:"
04047                  << " Socket->Receive failed. resRecv = " << resRecv << ".\n" 
04048                  << "    ==> Closing the socket connection." << ".\n"
04049                  << "    ==> Please open again. "
04050                  << endl;
04051             socket->Close();
04052             Running = kFALSE;
04053             fReadFileButton->ChangeBackground(Red);  
04054             //  cout << "Button changed to red\n";
04055             gClient->NeedRedraw(fReadFileButton);
04056             count = maxcount;      // Stop the request loop
04057           } //if (resRecv == -1)
04058           else {
04059             if (message) {
04060               if (message->What() == kMESS_OBJECT) {
04061                 obj = (TObject*)message->ReadObject(message->GetClass());
04063                 // The following was added: //2001/01/16 Wolfgang Wagner
04064                 if (obj) {
04065                   if (TString(obj->GetName()) != TString(objName))
04066                     cerr << "ERROR: Got object: " << obj->GetName()
04067                           << " but requested " << objName << "." << endl;
04068                 }
04070               }
04071               else {
04072                 if (message->What() == kMESS_STRING) {          
04073                   int messLength = message->BufferSize() + 10; 
04074                   char* keyString = new char[messLength];
04075                   message->ReadString(keyString,messLength);                  
04076                   string serverString(keyString);
04077                   delete keyString;
04078                   keyString = 0;
04079                   // We got a message string from Display Server 
04080                   // indicating a special request.
04081                   // Now we need to decode the string.
04082                   // The key strings are defined in ServerProtocol.hh
04083                   //
04084                   bool localDebug = false;
04085                   if (localDebug) {
04086                     cout << "HistoDisplay: got string: " << serverString
04087                          << "." << endl;
04088                   } 
04089                   if (serverString == DspEndConnection) {
04090                     cout << "HistoDisplay: The Display Server ended the "
04091                          << "connection." << endl;
04092                     count = maxcount;
04093                     socket->Close();
04094                     Running = kFALSE;
04095                     fReadFileButton->ChangeBackground(Red); 
04096                     // cout << "Button changed to red\n";            
04097                     gClient->NeedRedraw(fReadFileButton);
04098                     fChButtonSlideUpdate->SetState(kButtonUp);
04099                     SlideShowUpdate = kFALSE;
04100                   }
04101                   if (serverString == DspObjectNotFound) {
04102                     cerr << "HistoDisplay: The requested object '"
04103                          << objName << "' is not available from the "
04104                          << endl;
04105                     cerr << "Display Server." << endl;
04106                     count = maxcount;                      
04107                   }
04108                   if (serverString == DspRequestNewInfo) {
04109                     if (localDebug) {
04110                       cout << "HistoDisplay: The Display Server suggests "
04111                            << "to request the TConsumerInfo." << endl;
04112                     }  
04113                     //TConsumerInfo* locInfo = MakeConsumerInfo(socket); 
04114                     //DelTreeItemsOfInput( socket );
04115                     AddTreeItemsOfInput( socket );
04116                     RefreshTreeItem( fHistoListTree->GetFirstItem() );
04117                     SearchWarningErrorFolder
04118                       ( fHistoListTree->GetFirstItem(), socket );
04119                     fClient->NeedRedraw( fHistoListTree );
04120                   }
04121                 } 
04122               }
04123             }
04124           } //else //if (resRecv == -1)
04125 
04126           delete message;
04127           count++;
04128         } //while ( !obj && count < maxcount )
04129 
04130         if ( ! obj ) {
04131           cout << " Failed to get " << objName << endl;
04132         fReadFileButton->ChangeBackground(Red);
04133         gClient->NeedRedraw(fReadFileButton);
04134         fChButtonSlideUpdate->SetState(kButtonUp);
04135         SlideShowUpdate = kFALSE;
04136         //      cout << "Button changed to red\n";
04137         } //if ( ! obj )
04138         else {
04139           if ( count > 1 ) cout << " The object " << objName 
04140                                 << " is sent from the socket by " << count
04141                                 << " tries." << endl;
04142         } //else of if ( ! obj )
04143 
04144       } //if ( socket && socket->IsValid() )
04145       else {
04146         cout << "no connection to socket..."
04147              << socket->GetName() << endl;
04148         Running = kFALSE;
04149         fReadFileButton->ChangeBackground(Red);
04150         gClient->NeedRedraw(fReadFileButton);
04151         fChButtonSlideUpdate->SetState(kButtonUp);
04152         SlideShowUpdate = kFALSE;
04153         //   cout << "Button changed to red\n";
04154       } //else //if ( socket && socket->IsValid() )
04155 
04156     } // TMapFile,TFile, TSocket 
04157     else {
04158 
04159       cout << " No inputobj " << endl;
04160 
04161     } //else // TMapFile,TFile, TSocket
04162 
04163   } // if(inputobj)
04164 
04165   //tmp
04166   //if ( !obj ) cout << " No object found " << endl;
04167 
04168   return obj;
04169 
04170 }

void HistoDisplay::HistoDisplayMain ( Int_t  autoOpen = 0  )  [private]
TH1 * HistoDisplay::HistoInPad ( TVirtualPad *  pad,
Int_t &  counthisto 
) [private]

Definition at line 4233 of file HistoDisplay.cxx.

Referenced by ProcessMessage().

04234 {
04235   //cout << " In HistoInPad " << endl;
04236 
04237   if ( !pad ) return 0;
04238 
04239   TList *primitiveList = pad->GetListOfPrimitives();
04240   TIter next( primitiveList );
04241 
04242   TH1 *histo = 0;
04243 
04244   TObject *obj;
04245   while ( ( obj = next() ) && ( counthisto <= 1 ) ) {
04246 
04247     if ( obj->InheritsFrom( TH1::Class() ) ) {
04248       counthisto++ ;
04249       if ( counthisto == 1 ) histo = (TH1*)obj;
04250     } //if ( obj->InheritsFrom( TH1::Class() ) )
04251 
04252     if ( obj->InheritsFrom( TPad::Class() ) )
04253       histo = HistoInPad( (TPad*)obj , counthisto );
04254 
04255   } //while ( ( obj = next() ) && ( counthisto <= 1 ) )
04256 
04257   if ( counthisto >= 2 ) return 0;
04258 
04259   return histo;
04260 
04261 }

TConsumerInfo * HistoDisplay::MakeConsumerInfo ( const char *  consumername,
const char *  filename 
) [private]

Definition at line 1574 of file HistoDisplay.cxx.

References TConsumerInfo::addObject(), getword(), infile, info, TConsumerInfo::setInputName(), TConsumerInfo::setNevents(), TConsumerInfo::setRunNumber(), and strdelete().

01575 {
01576   //cout << " In Make ConsumerInfo( file ) " << endl;
01577   //cout << TheConsumerName << " " << filename << endl;
01578 
01579   //if ( !TheConsumerName || !filename ) return 0;
01580   if ( ( strlen( TheConsumerName ) == 0 ) || !filename ) return 0;
01581 
01582   TConsumerInfo *info = 0;
01583 
01584   const int maxsize = 256;
01585   std::ifstream infile( filename );
01586 
01587   if ( infile ) {
01588 
01589     do {
01590       char str[ maxsize ];
01591       infile.getline( str, maxsize - 1 );
01592 
01593       // ConsumerInfo --
01594       if ( char *pos = const_cast<char*>(strstr( str, "ConsumerInfo ")) ) {
01595 
01596         char *ConsumerName = 0;
01597         ConsumerName =  getword( pos + strlen( "ConsumerInfo " ) ); 
01598 
01599         if ( !strcmp( ConsumerName, TheConsumerName ) ) {
01600 
01601           //tmp
01602           //cout << " ConsumerName = " << ConsumerName << endl;
01603 
01604           info = new TConsumerInfo( "ConsumerInfo" );
01605 
01606           do {
01607             char str1[ maxsize ];
01608             infile.getline( str1, maxsize - 1 );
01609             // run: --
01610             if ( strstr( str1, "run:" ) ) {
01611               char *runstr = 0;
01612               runstr = getword( str1 + strlen( "run:" ) );
01613 
01614               int runnumber = 0;
01615               if ( runstr ) {
01616                 runnumber = atoi( runstr );
01617                 delete [] runstr;
01618               } //if ( runstr )
01619 
01620               //cout << " runnumber = " << runnumber << endl;
01621               info->setRunNumber( runnumber );
01622 
01623               if ( char *pos = const_cast<char*>(strstr( str1, "number of events:" )) ) {
01624                 char *nevstr = 0;
01625 
01626                 nevstr = getword( pos + strlen( "number of events:" ) );
01627 
01628                 int eventnumber = 0;
01629                 if ( nevstr ) {
01630                   eventnumber = atoi( nevstr );
01631                   delete [] nevstr;
01632                 } //if ( nevstr )
01633 
01634                 //cout << " eventnumber = " << eventnumber << endl;
01635                 info->setNevents( eventnumber );
01636 
01637 
01638               } //if ( char *pos = strstr( str1, "number of events:" ) ) 
01639 
01640             }// if ( strstr( str1, "run:" ) )
01641 
01642             //--
01643             // TMapFile, TFile, TSocket -- 
01644             char *inputname = 0;
01645 
01646             if ( strstr( str1, "TMapFile:" ) ) {
01647 
01648               inputname = getword( str1 + strlen( "TMapFile:" ) ); 
01649               info->setInputName( TString( "TMapFile:" ) +
01650                                   TString( inputname ) );
01651 
01652             }// if ( strstr( str1, "TMapFile:" ) )
01653             else if  ( strstr( str1, "TFile:" ) ) {
01654 
01655               inputname = getword( str1 + strlen( "TFile:" ) ); 
01656               info->setInputName( TString( "TFile:" ) +
01657                                   TString( inputname ) );
01658 
01659             }// else if ( strstr( str1, "TFile:" ) )
01660             else if  ( strstr( str1, "TSocket:" ) ) {
01661 
01662               inputname = getword( str1 + strlen( "TSocket:" ) ); 
01663               info->setInputName( TString( "TSocket:" ) +
01664                                   TString( inputname ) );
01665 
01666             } //else if  ( strstr( str1, "TSocket:" ) ) 
01667 
01668             if ( inputname ) {
01669 
01670               //cout << " InputName = " << inputname << endl;
01671               //info->setInputName( TString( inputname ) );
01672 
01673 
01674               delete [] inputname;
01675             } //if ( inputname )
01676 
01677             //--
01678             // objects: --
01679             if ( strstr( str1, "objects:" ) ) {
01680 
01681               do {
01682                 char str2[ maxsize ];
01683                 infile.getline( str2, maxsize - 1 );
01684 
01685                 if ( str2 && ( strlen( str2 ) > 0 ) 
01686                      && !strstr( str2, "ConsumerInfo" ) ) {
01687 
01688                   char *path = 0;
01689                   char *name = 0;
01690 
01691                   char *pathname = getword( str2 );
01692 
01693                   //if ( pathname && ( *pathname != commentchar ) ) {
01694                   if ( pathname ) {
01695 
01696                     char *begin = str2 + strlen( pathname ) + 1;
01697 
01698                     char *pos = 0;
01699                     while ( ( pos = const_cast<char*>(strchr( pathname, '\"' ) )) && 
01700                             ( strchr( pos + 1, '\"' ) ) ) {
01701                       char *tmp = 0;
01702                       tmp = const_cast<char*>(strdelete( pathname, "\"" ));
01703                       delete [] pathname;
01704                       pathname = strdelete( tmp, "\"" );
01705                       delete [] tmp;
01706                     } // while ( strchr( pathname, '\"') )
01707 
01708 
01709                     if ( char *pos = const_cast<char*>( strrchr( pathname, '/')) ) {
01710                       pos++;
01711 
01712                       name = new char[ strlen( pos ) + 1 ];
01713                       strcpy( name, pos );
01714 
01715                       char tmpchr = *pos;
01716                       *pos = '\0';
01717 
01718                       path = new char[ strlen( pathname ) + 1 ];
01719                       strcpy( path, pathname );
01720 
01721                       *pos = tmpchr;
01722         
01723                     } //if ( path = strrchr( pathname, '/') )
01724                     else {
01725                       path = new char;
01726                       *path = '\0'; // was: path="" < mem leak
01727 
01728                       name = new char[ strlen( pathname ) + 1 ];
01729                       strcpy( name, pathname );
01730 
01731                     } //else //if ( path = strrchr( pathname, '/') )
01732 
01733 
01734                     int status = 999;
01735                     char *statusstr = getword( begin );
01736                     if ( statusstr ) {
01737                       delete [] statusstr;
01738                       status = atoi( statusstr );
01739                     } //if ( statusstr )
01740 
01741                     /*
01742                     cout << " path = " << path 
01743                          << " name = " << name 
01744                          << " status = " << status << endl;
01745                     */
01746                     info->addObject( TString( name ), TString( path ), status );
01747 
01748                     if ( pathname ) {
01749                       delete [] pathname;
01750                       pathname = 0;
01751                     }
01752                     if ( path ) {
01753                       delete [] path;
01754                       path = 0;
01755                     }
01756                     if ( name ) {
01757                       delete [] name;
01758                       name = 0;
01759                     }
01760 
01761 
01762                   } //if ( pathname && ( *pathname != commentchar ) )
01763                 } // if ( str2 && ( strlen( str2 ) > 0 ) )
01764                 else break;
01765 
01766               } while( !infile.eof() ); //str2
01767 
01768 
01769               break;
01770 
01771             } //if ( strstr( str1, "objects:" ) )
01772 
01773             //--
01774 
01775 
01776           } while ( !infile.eof() ); //str1
01777 
01778 
01779           if ( ConsumerName ) delete [] ConsumerName;
01780           break;
01781 
01782         }//if ( !strcmp( ConsumerName, TheConsumerName ) )
01783 
01784       } //if ( strstr( str, "ConsumerInfo") ) 
01785 
01786 
01787     } while ( !infile.eof() ); //str
01788 
01789     infile.close();
01790 
01791     if ( !info ) cout << " No info of " << TheConsumerName 
01792                       << " in " << filename << endl;
01793 
01794   } //if ( infile )
01795   else
01796     cout << " Failed to open file " << filename << endl;
01797 
01798   return info;
01799 
01800 }

TConsumerInfo * HistoDisplay::MakeConsumerInfo ( TObject *  inputobj  )  [private]

Definition at line 1516 of file HistoDisplay.cxx.

References GetNewObj(), and info.

Referenced by AddTreeItemsOfInput().

01517 {
01518   //cout << " In Make ConsumerInfo( inputobj ) " << endl;
01519 
01520   if ( !inputobj ) return 0;
01521 
01522   TConsumerInfo *info = 0;
01523   TObject *obj = 0;
01524 
01525   /*
01526   if ( inputobj->InheritsFrom( TMapFile::Class() ) ) {
01527     TMapFile *file = (TMapFile*) inputobj;
01528     obj =  file->Get("ConsumerInfo");
01529   } //if ( inputobj->InheritsFrom( TMapFile::Class() )
01530 
01531   else if ( inputobj->InheritsFrom( TFile::Class() ) ) {
01532     TFile *file = (TFile*) inputobj;
01533     obj =  file->Get("ConsumerInfo");
01534   } //if ( inputobj->InheritsFrom( TFile::Class() ) 
01535 
01536   else if ( inputobj->InheritsFrom( TSocket::Class() ) ) {
01537     TSocket *sock = (TSocket*) inputobj;
01538     if ( sock->IsValid() ) {
01539       //request TConsumerInfo
01540       TMessage *mess;
01541       sock->Send("ConsumerInfo");
01542       sock->Recv(mess);
01543       if ( mess ) {
01544         if ( mess->What() == kMESS_OBJECT) {
01545           obj = mess->ReadObject(mess->GetClass());
01546         } //if ( mess->What() == kMESS_OBJECT)
01547         delete mess;
01548       } //if ( mess )
01549     } //if ( sock->IsValid() )
01550   } //else if ( inputobj->InheritsFrom( TSocket::Class() ) )
01551 
01552   if ( obj && obj->InheritsFrom( TConsumerInfo::Class() ) ) {
01553     info = (TConsumerInfo*)obj;
01554     //info->print();
01555   } //if ( obj && obj->InheritsFrom( TConsumerInfo::Class() ) )
01556   */
01557 
01558 
01559   obj = GetNewObj( "ConsumerInfo", inputobj );
01560 
01561   if ( obj && obj->InheritsFrom( TConsumerInfo::Class() ) ) {
01562     info = (TConsumerInfo*)obj;
01563     //info->print();
01564   } //if ( obj && obj->InheritsFrom( TConsumerInfo::Class() ) )
01565 
01566 
01567 
01568   return info;
01569 }

void HistoDisplay::MakeHistoList ( TObject *  inpuobj  )  [private]

Definition at line 1901 of file HistoDisplay.cxx.

References fHistoList, MakeHistoListM(), MakeHistoListR(), and MakeHistoListS().

Referenced by AddTreeItemsOfInput().

01902 {
01903   //cout << " In MakeHistoList " << endl;
01904 
01905   if ( ! inputobj ) return ;
01906 
01907   if ( fHistoList && !( fHistoList->IsEmpty( )) ) fHistoList->Clear();
01908 
01909   if ( inputobj->IsA() == TMapFile::Class() ) {
01910     MakeHistoListM( (TMapFile*) inputobj );
01911   }
01912   else if ( inputobj->IsA() == TFile::Class() ) {
01913     MakeHistoListR( (TFile*) inputobj );
01914   }
01915   else if ( inputobj->IsA() == TSocket::Class() ) {
01916     MakeHistoListS( (TSocket*) inputobj );
01917   }
01918 
01919 }

void HistoDisplay::MakeHistoListM ( TMapFile *  MFile  )  [private]

Definition at line 1921 of file HistoDisplay.cxx.

References fHistoList.

Referenced by MakeHistoList().

01922 {
01923   if ( ! MFile ) return ;
01924 
01925   TMapRec *mr = MFile->GetFirst();
01926   while( MFile->OrgAddress(mr) ) {
01927     TString name = mr->GetName();
01928     TObject * obj = 0;
01929     obj = (TObject*)MFile->Get(name.Data(),obj);
01930     if ( obj && obj->InheritsFrom(TH1::Class()) ||
01931          //obj->InheritsFrom(TPad::Class()) ) {
01932          obj->InheritsFrom(TCanvas::Class()) ) {
01933       fHistoList->Add(obj);
01934     }
01935     mr = mr->GetNext();
01936   }
01937 }

void HistoDisplay::MakeHistoListR ( TFile *  RFile  )  [private]

Definition at line 1939 of file HistoDisplay.cxx.

References fHistoList.

Referenced by MakeHistoList().

01940 {
01941   if ( ! RFile ) return ;
01942 
01943   TIter next(RFile->GetListOfKeys());
01944   TKey *key;
01945   TObject *obj=0;
01946   while ( ( key = (TKey*)next() )  ) {
01947     obj = (TObject*)RFile->Get(key->GetName());
01948     if ( obj &&  obj->InheritsFrom(TH1::Class()) ||
01949          //obj->InheritsFrom(TPad::Class()) ) {
01950          obj->InheritsFrom(TCanvas::Class()) ) {
01951       fHistoList->Add(obj);
01952     }
01953   }
01954 }

void HistoDisplay::MakeHistoListS ( TSocket *  sock  )  [private]

Definition at line 1956 of file HistoDisplay.cxx.

References fHistoList, info, and TConsumerInfo::updateList().

Referenced by MakeHistoList().

01957 {
01958   if ( ! sock ) return ;
01959 
01960   if ( sock->IsValid() ) {
01961       //request TConsumerInfo
01962       TMessage *mess;
01963       TConsumerInfo *info;
01964       sock->Send("ConsumerInfo");
01965       sock->Recv(mess);
01966       if ( mess ) {
01967       if ( mess->What() == kMESS_OBJECT)
01968         {
01969           info = (TConsumerInfo*)mess->ReadObject(mess->GetClass());
01970           if (!info) {
01971               cerr << "Null info from ReadObject!!!\n";
01972               return;
01973           }
01974           //info->print();
01975           info->updateList(fHistoList,sock);
01976           delete info;
01977         }
01978       delete mess;
01979       }
01980   }
01981 
01982 }

void HistoDisplay::MakeInputFrame (  )  [private]

Definition at line 638 of file HistoDisplay.cxx.

References fChooseFileButton, fClearFileNameButton, fFileNameBuffer, fFileNameButtonFrame, fFileNameButtonFrameLayout, fFileNameButtonLayout, fFileNameFrame, fFileNameFrameLayout, fFileNameLabel, fFileNameLayout, fFileNameTextEntry, fFileOpenFrame, fFileOpenFrameLayout, fMainFrame, fport, fRaButLayout, fRaButMFile, fRaButRFile, fRaButSocket, fReadFileButton, fsocketserver, kM_BUTTON_CHOOSEFILE, kM_BUTTON_CLEARFILENAME, kM_BUTTON_FILENAME, kM_RABUTTON_MFILE, kM_RABUTTON_RFILE, kM_RABUTTON_SOCKET, kM_TEXTENTRY_FILENAME, LightYellow, and Red.

00639 {
00640   // Input stream Frame --
00641 
00642   fFileNameFrame =
00643     //new TGGroupFrame(fMainFrame, "Input Stream", kVerticalFrame);
00644     new TGGroupFrame(fMainFrame, "Add Input Stream", kVerticalFrame);
00645   fFileNameFrameLayout =
00646     //new TGLayoutHints( kLHintsTop | kLHintsLeft, 2, 2, 2, 2);
00647     new TGLayoutHints( kLHintsTop | kLHintsLeft | kLHintsExpandX
00648                        , 4, 4, 2, 2);
00649 
00650   // Radio Buttons --
00651   fRaButMFile =
00652     new TGRadioButton(fFileNameFrame,
00653                        "Memory Map File", kM_RABUTTON_MFILE);
00654   fRaButRFile =
00655     new TGRadioButton(fFileNameFrame, 
00656                        "Other ROOT File", kM_RABUTTON_RFILE);
00657   fRaButSocket =
00658     new TGRadioButton(fFileNameFrame,
00659                        "Socket Connection", kM_RABUTTON_SOCKET);
00660   fRaButLayout =
00661     new TGLayoutHints(kLHintsTop | kLHintsLeft, 2,2,2,2);
00662 
00663   fRaButMFile->Associate(this);
00664   fRaButRFile->Associate(this);
00665   fRaButSocket->Associate(this);
00666 
00667   fFileNameFrame->AddFrame(fRaButMFile, fRaButLayout);
00668   fFileNameFrame->AddFrame(fRaButRFile, fRaButLayout);
00669   fFileNameFrame->AddFrame(fRaButSocket, fRaButLayout);
00670 
00671   fRaButMFile->SetState(kButtonUp);
00672   //fRaButRFile->SetState(kButtonDown);
00673   fRaButRFile->SetState(kButtonUp);
00674   //fRaButSocket->SetState(kButtonUp);
00675   fRaButSocket->SetState(kButtonDown);
00676 
00677   /*
00678   RaButMFileOn = kFALSE;
00679   RaButRFileOn = kTRUE;
00680   RaButSocketOn = kFALSE;
00681 
00682   MFileOpen = kFALSE;
00683   RFileOpen = kFALSE;
00684   sockOpen = kFALSE;
00685   */
00686   //InputOpen = kFALSE;
00687   //--
00688 
00689 
00690   // File Name --
00691   fFileNameLayout =
00692     new TGLayoutHints( kLHintsTop | kLHintsLeft, 3,3,2,2);
00693 
00694   // Label --
00695   fFileNameLabel = 
00696     new TGLabel( fFileNameFrame, "Name of File / Socket Server:Port" );
00697   fFileNameFrame->
00698     AddFrame( fFileNameLabel, fFileNameLayout );
00699 
00700   //--
00701 
00702   // File Name Text Buffer --
00703   fFileOpenFrame =
00704     new TGCompositeFrame(fFileNameFrame, 60, 20, kHorizontalFrame);
00705   fFileOpenFrameLayout =
00706     new TGLayoutHints( kLHintsTop | kLHintsLeft, 2,2,2,2);
00707 
00708   fFileNameTextEntry =
00709     new TGTextEntry( fFileOpenFrame, 
00710                      fFileNameBuffer = new TGTextBuffer(320),
00711                      kM_TEXTENTRY_FILENAME );
00712   char sstext[80];
00713  
00714 
00715   sprintf(sstext,"%s:%d",fsocketserver,fport);
00716  
00717 
00718   fFileNameBuffer->AddText(0,sstext);
00719   fFileNameTextEntry->
00720     Resize(340,fFileNameTextEntry->GetDefaultHeight());
00721   fFileOpenFrame->
00722     AddFrame( fFileNameTextEntry, fFileNameLayout );
00723 
00724   fReadFileButton =
00725     new TGTextButton(fFileOpenFrame,"Open", kM_BUTTON_FILENAME);
00726   fReadFileButton->Associate(this);
00727 
00728   fReadFileButton->SetToolTipText("Open local/remote file or socket.");
00729 
00730   //gClient->GetColorByName("LightYellow",LightYellow);
00731   fReadFileButton->ChangeBackground(Red);
00732   //  cout << "Button changed to red\n";
00733   fFileOpenFrame->
00734     AddFrame( fReadFileButton, fFileNameLayout );
00735 
00736   fFileNameFrame->
00737     AddFrame( fFileOpenFrame, fFileOpenFrameLayout );
00738   //--
00739 
00740 
00741   // Choose File, Clear buttons. --
00742   fFileNameButtonFrame =
00743     new TGCompositeFrame(fFileNameFrame, 60, 70, kHorizontalFrame);
00744 
00745   fFileNameButtonFrameLayout =
00746     //new TGLayoutHints( kLHintsTop | kLHintsLeft, 2,2,2,2);
00747     new TGLayoutHints( kLHintsTop | kLHintsLeft, 2,2,2,0);
00748 
00749   fFileNameButtonLayout =
00750     new TGLayoutHints( kLHintsLeft, 3,3,2,2);
00751 
00752 
00753   fChooseFileButton =
00754     new TGTextButton(fFileNameButtonFrame,"Choose File",
00755                      kM_BUTTON_CHOOSEFILE);
00756   fChooseFileButton->SetToolTipText("Choose Local file");
00757 
00758   fChooseFileButton->Associate(this);
00759 
00760   fFileNameButtonFrame->
00761     AddFrame( fChooseFileButton,
00762               //new TGLayoutHints(kLHintsTop | kLHintsCenterX, 3,5,2,2));
00763               new TGLayoutHints(kLHintsTop | kLHintsCenterX, 3,5,2,0));
00764 
00765   fChooseFileButton->ChangeBackground(LightYellow);
00766 
00767 
00768   fClearFileNameButton =
00769     new TGTextButton(fFileNameButtonFrame,"     Clear    ",
00770                      kM_BUTTON_CLEARFILENAME);
00771 
00772   fClearFileNameButton->SetToolTipText("Clear Input Source Name");
00773 
00774   fClearFileNameButton->Associate(this);
00775 
00776   fFileNameButtonFrame->
00777     AddFrame( fClearFileNameButton, 
00778               //new TGLayoutHints(kLHintsTop | kLHintsRight, 3,5,2,2));
00779               new TGLayoutHints(kLHintsTop | kLHintsRight, 3,5,2,0));
00780 
00781   fClearFileNameButton->ChangeBackground(LightYellow);
00782 
00783 
00784   fFileNameFrame->
00785     AddFrame( fFileNameButtonFrame, fFileNameButtonFrameLayout );
00786   //--
00787 
00788 
00789 
00790   fMainFrame->
00791     AddFrame( fFileNameFrame, fFileNameFrameLayout  );
00792   //--
00793 }

void HistoDisplay::MakeMenuBar (  )  [private]

Definition at line 483 of file HistoDisplay.cxx.

References fConnectMenu, fFileMenu, fHelpMenu, fListTreeMenu, fMenuBar, fMenuBarHelpLayout, fMenuBarItemLayout, fMenuBarLayout, fMenuBarSeparator, fMenuBarSeparatorLayout, fNewCascadeMenu, fSortCascadeMenu, kM_MENU_CONNECT_STATUS, kM_MENU_FILE_CLOSE, kM_MENU_FILE_EXIT, kM_MENU_FILE_NEWCANVAS, kM_MENU_FILE_NEWGUI, kM_MENU_FILE_NEWSLIDE, kM_MENU_HELP_CANVAS, kM_MENU_HELP_GUI, kM_MENU_HELP_ROOT, kM_MENU_LISTTREE_CLEAR, kM_MENU_LISTTREE_DELETE, kM_MENU_LISTTREE_REFRESH, kM_MENU_LISTTREE_SORTFOLDER, and kM_MENU_LISTTREE_SORTTREE.

00484 {
00485   // File Menu --
00486   fFileMenu = new TGPopupMenu( fClient->GetRoot() );
00487   fNewCascadeMenu = new TGPopupMenu( fClient->GetRoot() );
00488   fNewCascadeMenu->AddEntry( "&GUI", kM_MENU_FILE_NEWGUI );
00489   fNewCascadeMenu->AddEntry( "&Canvas", kM_MENU_FILE_NEWCANVAS );
00490   //fNewCascadeMenu->AddEntry( "&Slide Show Canvas", kM_MENU_FILE_NEWSLIDE );
00491   fNewCascadeMenu->AddEntry( "&Auto-Update Canvas", kM_MENU_FILE_NEWSLIDE );
00492   fFileMenu->AddPopup( "&New", fNewCascadeMenu );
00493   fFileMenu->AddSeparator();
00494   fFileMenu->AddEntry( "&Close", kM_MENU_FILE_CLOSE );
00495   fFileMenu->AddEntry( "&Exit", kM_MENU_FILE_EXIT );
00496   //--
00497 
00498   // List Tree --
00499   fListTreeMenu = new TGPopupMenu( fClient->GetRoot() );
00500   fSortCascadeMenu = new TGPopupMenu( fClient->GetRoot() );
00501   fSortCascadeMenu->AddEntry( "&Tree", kM_MENU_LISTTREE_SORTTREE );
00502   fSortCascadeMenu->AddEntry( "In &Folder", kM_MENU_LISTTREE_SORTFOLDER );
00503   fListTreeMenu->AddPopup( "&Sort", fSortCascadeMenu );
00504   fListTreeMenu->AddSeparator();
00505   fListTreeMenu->AddEntry( "&Delete", kM_MENU_LISTTREE_DELETE );
00506   fListTreeMenu->AddEntry( "&Clear", kM_MENU_LISTTREE_CLEAR );
00507   fListTreeMenu->AddEntry( "&Refresh", kM_MENU_LISTTREE_REFRESH );
00508   //--
00509 
00510   // Connection Menu --
00511   fConnectMenu = new TGPopupMenu( fClient->GetRoot() );
00512   fConnectMenu->AddLabel( "CDF Monitors");
00513   fConnectMenu->AddSeparator();
00514   /*
00515   fConnectMenu->AddEntry( "&YMON", kM_MENU_CONNECT_MON1 );
00516   fConnectMenu->AddEntry( "&TRIGMON", kM_MENU_CONNECT_MON2 );
00517   fConnectMenu->AddEntry( "&LUMMON", kM_MENU_CONNECT_MON3 );
00518   fConnectMenu->AddEntry( "&PHYSMON", kM_MENU_CONNECT_MON4 );
00519   fConnectMenu->AddEntry( "&SPY", kM_MENU_CONNECT_MON5 );
00520   */
00521   fConnectMenu->AddSeparator();
00522   fConnectMenu->AddEntry( "&Status", kM_MENU_CONNECT_STATUS );
00523   //--
00524 
00525   // Help Menu --
00526   fHelpMenu = new TGPopupMenu( fClient->GetRoot() );
00527   fHelpMenu->AddEntry( "&About This GUI", kM_MENU_HELP_GUI );
00528   fHelpMenu->AddSeparator();
00529   fHelpMenu->AddEntry( "&About ROOT", kM_MENU_HELP_ROOT );
00530   fHelpMenu->AddEntry( "&About Canvas", kM_MENU_HELP_CANVAS );
00531   //--
00532 
00533   // Associate Menu Commands --
00534   fFileMenu->Associate(this);
00535   fNewCascadeMenu->Associate(this);
00536   fListTreeMenu->Associate(this);
00537   fSortCascadeMenu->Associate(this);
00538   fConnectMenu->Associate(this);
00539   fHelpMenu->Associate(this);
00540   //--
00541 
00542   // Create Menu Bar --
00543   fMenuBar = new TGMenuBar( this, 1, 1, kHorizontalFrame );
00544   fMenuBarLayout = 
00545     new TGLayoutHints( kLHintsTop | kLHintsLeft | kLHintsExpandX,
00546                        0, 0, 1, 1);
00547   fMenuBarItemLayout =
00548     new TGLayoutHints( kLHintsTop | kLHintsLeft, 0, 4, 0, 0 );
00549   fMenuBarHelpLayout =
00550     new TGLayoutHints( kLHintsTop | kLHintsRight );
00551 
00552   fMenuBar->AddPopup( "&File", fFileMenu, fMenuBarItemLayout );
00553   fMenuBar->AddPopup( "&List Tree", fListTreeMenu, fMenuBarItemLayout );
00554   fMenuBar->AddPopup( "&Connection", fConnectMenu, fMenuBarItemLayout );
00555   fMenuBar->AddPopup( "&Help", fHelpMenu, fMenuBarHelpLayout );
00556 
00557   AddFrame( fMenuBar, fMenuBarLayout );
00558   //--
00559 
00560   // Separator --
00561   fMenuBarSeparator = new TGHorizontal3DLine( this );
00562   fMenuBarSeparatorLayout =
00563     new TGLayoutHints( kLHintsTop | kLHintsExpandX );
00564   AddFrame( fMenuBarSeparator, fMenuBarSeparatorLayout );
00565   //--
00566 }

void HistoDisplay::MakeStatusBar (  )  [private]

Definition at line 1222 of file HistoDisplay.cxx.

References fMainFrame, and fStatusBar.

01223 {
01224   Int_t parts[] = {20, 80};
01225   fStatusBar = new TGStatusBar(fMainFrame, 50, 10, kHorizontalFrame);
01226   fStatusBar->SetParts(parts, 2);
01227   fMainFrame->AddFrame(fStatusBar, new TGLayoutHints(kLHintsBottom| kLHintsExpandX));
01228 }

void HistoDisplay::MakeTGListTree ( const TString &  PathName,
TObject *  inputobj,
const char *  tip = 0 
) [private]

Definition at line 2041 of file HistoDisplay.cxx.

References fHistoListTree.

Referenced by AddToTree(), and AddTreeItemsOfInput().

02045 {
02046   //cout << " In MakeTGListTree " << endl;
02047 
02048 
02049   while ( PathName.Contains("//") ) {
02050     TRegexp re("//+");
02051     PathName(re) = "/";
02052   }
02053 
02054   //cout << " PathName = " << PathName.Data() << endl;
02055 
02056   const int treemax = 10;
02057 
02058   int index[treemax];
02059 
02060   int PathLength = PathName.Length();
02061 
02062   int ii;
02063   int ind;
02064   for ( ii=0, ind = PathName.Index("/",1,0,TString::kExact) ;
02065         0 <= ind && ind <= PathLength ; ++ii ) {
02066     index[ii] = ind;
02067     ind = PathName.Index("/",1,ind+1,TString::kExact);
02068   }
02069 
02070   int nindex = ii;
02071   index[nindex] = PathLength;
02072 
02073   TString DirName;
02074   TString HistoName;
02075 
02076   TString CurPathName;
02077   TString CurParentName;
02078   TString CurItemName;
02079 
02080 
02081   TGListTreeItem *itemOrg= 0;
02082   itemOrg = fHistoListTree->FindItemByPathname( PathName.Data() );
02083 
02084   //if ( !fHistoListTree
02085   //->FindItemByPathname( PathName.Data() ) ) {
02086 
02087   if ( !itemOrg ) {
02088 
02089     if ( 1 < nindex ) {
02090 
02091       DirName = PathName( 0, index[nindex-1] );
02092       HistoName = PathName( index[nindex-1]+1, index[nindex] );
02093 
02094 
02095       if ( !fHistoListTree
02096           ->FindItemByPathname( DirName.Data() ) ) {
02097 
02098         for ( int i=0 ; i < nindex-1 ; ++i ) {
02099           CurPathName = DirName(0,index[i+1]);
02100 
02101           if ( !fHistoListTree
02102               ->FindItemByPathname( CurPathName.Data() ) ) {
02103 
02104             if ( i==0 ) { 
02105               CurItemName = DirName(index[i]+1,index[i+1]-index[i]-1);
02106               TGListTreeItem *item = 0;
02107               /*              
02108               fHistoListTree
02109                 ->AddItem( 0, CurItemName.Data() )
02110                 ->SetUserData(inputobj);
02111               */
02112               item = fHistoListTree
02113                 ->AddItem( 0, CurItemName.Data() );
02114               if ( item ) {
02115                 item->SetUserData(inputobj);
02116                 //if ( tip ) fHistoListTree->SetToolTipItem( item, tip );
02117               } // if ( item )
02118             } //if ( i==0 )
02119             else {
02120               CurParentName = DirName( 0, index[i]);
02121               CurItemName = DirName(index[i]+1,index[i+1]-index[i]-1);
02122               /*
02123               fHistoListTree
02124                 ->AddItem( fHistoListTree
02125                            ->FindItemByPathname( CurParentName.Data() ),
02126                            CurItemName.Data() )
02127                 ->SetUserData(inputobj);
02128               */
02129               TGListTreeItem *item = 0;
02130               item = fHistoListTree
02131                 ->AddItem( fHistoListTree
02132                            ->FindItemByPathname( CurParentName.Data() ),
02133                            CurItemName.Data() );
02134               if ( item ) {
02135                 item->SetUserData(inputobj);
02136                 //if ( tip ) fHistoListTree->SetToolTipItem( item, tip );
02137               } // if ( item )
02138 
02139             } // else //if ( i==0 )
02140           } // if ( !fHistoListTree...
02141         } //for ( int i=0 ; i < nindex-1 ; ++i )
02142       }//if ( !fHistoListTree...
02143 
02144       /*
02145       fHistoListTree
02146         ->AddItem( fHistoListTree->FindItemByPathname(DirName.Data()),
02147                    HistoName.Data() )
02148         ->SetUserData(inputobj);
02149       */
02150       TGListTreeItem *item = 0;
02151       item = fHistoListTree
02152         ->AddItem( fHistoListTree->FindItemByPathname(DirName.Data()),
02153                    HistoName.Data() );
02154       if ( item ) {
02155         item->SetUserData(inputobj);
02156         if ( tip ) fHistoListTree->SetToolTipItem( item, tip );
02157       } // if ( item )
02158 
02159     } //if ( 1 < nindex ) 
02160     else {
02161 
02162       HistoName = PathName( index[nindex-1]+1, index[nindex] );
02163       /*
02164       fHistoListTree
02165         ->AddItem( 0, HistoName.Data() )
02166         ->SetUserData(inputobj);
02167       */
02168       TGListTreeItem *item = 0;
02169       item = fHistoListTree
02170         ->AddItem( 0, HistoName.Data() );
02171       if ( item ) {
02172         item->SetUserData(inputobj);
02173         if ( tip ) fHistoListTree->SetToolTipItem( item, tip );
02174       } // if ( item )
02175 
02176 
02177     } //else // if ( 1 < nindex )
02178 
02179   } //  if ( !itemOrg ) 
02180   else {
02181     TObject *inputobjOrg = (TObject*) ( itemOrg->GetUserData() );
02182     if ( !inputobj->IsEqual( inputobjOrg ) ) {
02183       itemOrg->SetUserData(inputobj);
02184       if ( tip ) fHistoListTree->SetToolTipItem( itemOrg, tip );
02185     } //if ( !inputobj->IsEqual( inputobjOrg ) ) 
02186 
02187   } //else // if ( !itemOrg )
02188 }

void HistoDisplay::MakeTGListTreeFrame (  )  [private]

Definition at line 822 of file HistoDisplay.cxx.

References AutoUpdate, fButtonFrame, fButtonFrameLayout, fButtonLayout, fChButtonAutoUpdate, fChButtonAutoUpdateLayout, fChButtonSlideUpdate, fClearHistoButton, fContentHistoButton, fControlButtonFrame, fControlButtonFrameLayout, fFrequencyFrame, fFrequencyFrameLayout, fFrequencyLabel, fFrequencyTextBuffer, fFrequencyTextEntry, fHistoButtonFrame, fHistoButtonFrameLayout, fHistoButtonGFrame, fHistoButtonGFrameLayout, fHistoButtonLayout, fHistoListFrame, fHistoListFrameLayout, fHistoListTree, fListButtonFrame, fListButtonFrameLayout, fListTreeMainFrame, fListTreeMainFrameLayout, fMainFrame, fMonitorNameBuffer, fMonitorNameLabel, fMonitorNameLayout, fMonitorNameTextEntry, fNewCanvasButton, fPauseHistoButton, fPrintHistoButton, fRestartHistoButton, fStopHistoButton, fTGCanvas, fTGCanvasLayout, fUnZeroHistoButton, fZeroHistoButton, kM_BUTTON_CANVAS, kM_BUTTON_CLEAR, kM_BUTTON_CONTENT, kM_BUTTON_PAUSE, kM_BUTTON_PRINT, kM_BUTTON_RESTART, kM_BUTTON_STOP, kM_BUTTON_UNZERO, kM_BUTTON_ZERO, kM_CHBUTTON_AUTOUPDATE, kM_CHBUTTON_SLIDEUPDATE, kM_TEXTENTRY_FREQUENCY, kM_TEXTENTRY_MONITORNAME, LightYellow, and SlideShowUpdate.

00823 {
00824   fListTreeMainFrame =
00825     new TGCompositeFrame(fMainFrame,200,300,kVerticalFrame);
00826   fListTreeMainFrameLayout =
00827     //new TGLayoutHints( kLHintsTop | kLHintsExpandX, 5, 5, 5, 5);
00828     new TGLayoutHints( kLHintsTop | kLHintsLeft |
00829                        kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5);
00830 
00831 
00832   // MonitorName --
00833   fMonitorNameLayout =
00834     new TGLayoutHints( kLHintsTop | kLHintsLeft, 2,2,2,2);
00835   //new TGLayoutHints( kLHintsTop | kLHintsLeft | kLHintsExpandX,
00836   //           2, 200, 2, 2);
00837 
00838   fMonitorNameLabel =
00839     new TGLabel( fListTreeMainFrame,
00840                  // " Location in List Tree " );
00841          " Consumer Name in \"ConsumerInfo.txt\" ( Optional User Control )" );
00842   fListTreeMainFrame->
00843     AddFrame( fMonitorNameLabel, fMonitorNameLayout );
00844 
00845   fMonitorNameTextEntry = 
00846     new TGTextEntry( fListTreeMainFrame,
00847                      fMonitorNameBuffer = new TGTextBuffer(256),
00848                      kM_TEXTENTRY_MONITORNAME );
00849   fMonitorNameTextEntry->
00850     Resize(260, fMonitorNameTextEntry->GetDefaultHeight());
00851 
00852   fListTreeMainFrame->
00853     AddFrame( fMonitorNameTextEntry, fMonitorNameLayout );
00854   //--
00855 
00856 
00857 
00858   // Make List Tree Frame --
00859 
00860   fHistoListFrame =
00861     new TGCompositeFrame(fListTreeMainFrame, 220, 300, kHorizontalFrame);
00862   fHistoListFrameLayout =
00863     new TGLayoutHints( kLHintsTop | kLHintsLeft |
00864                        kLHintsExpandX | kLHintsExpandY,
00865     //new TGLayoutHints( kLHintsTop | kLHintsCenterX,
00866                        1, 1, 1, 1); 
00867 
00868 
00869   // Make List Tree --
00870   fTGCanvas =
00871     new TGCanvas(fHistoListFrame, 210, 300, kSunkenFrame | kDoubleBorder);
00872   fTGCanvasLayout =
00873     //new TGLayoutHints( kLHintsTop | kLHintsLeft | kLHintsExpandY);
00874     new TGLayoutHints( kLHintsTop | kLHintsLeft |
00875                        kLHintsExpandX | kLHintsExpandY );
00876   // , 2, 2, 2, 2); 
00877 
00878   fHistoListTree = new TGListTree(fTGCanvas->GetViewPort()
00879                                   , 210, 300, kHorizontalFrame);
00880   fHistoListTree->Associate(this);
00881   fTGCanvas->SetContainer(fHistoListTree);
00882 
00883   //tmp 2000/12/08
00884   fHistoListTree->SetAutoTips();
00885 
00886 
00887   fHistoListFrame->AddFrame(fTGCanvas,fTGCanvasLayout);
00888   //--
00889 
00890 
00891   // Button Frame of List Tree --
00892   fListButtonFrame =
00893     new TGCompositeFrame(fHistoListFrame, 100, 300,
00894                          kVerticalFrame );
00895   fListButtonFrameLayout = 
00896     //    new TGLayoutHints(kLHintsRight | kLHintsCenterY, 10, 10, 10, 10);
00897     //new TGLayoutHints( kLHintsCenterY, 2, 2, 5, 5);
00898     new TGLayoutHints( kLHintsRight | kLHintsCenterY |
00899                        kLHintsExpandX , 2, 2, 5, 5);
00900 
00901 
00902 
00903   // AutoUpdate Check Button --
00904   fChButtonAutoUpdate = 
00905     new TGCheckButton(fListButtonFrame, "Update Automatically",
00906               kM_CHBUTTON_AUTOUPDATE);
00907   //fChButtonAutoUpdateLayout =
00908   //new TGLayoutHints( kLHintsTop | kLHintsCenterX,5,5,15,25);
00909   fChButtonAutoUpdateLayout =
00910     new TGLayoutHints( kLHintsTop | kLHintsLeft,5,2,2,2);
00911   fChButtonAutoUpdate->Associate(this);
00912   fListButtonFrame->
00913     AddFrame( fChButtonAutoUpdate, fChButtonAutoUpdateLayout );
00914   fChButtonAutoUpdate->SetState(kButtonDown);
00915   AutoUpdate = kTRUE;
00916   //--
00917 
00918 
00919   // Slide Show Check Button --
00920   fChButtonSlideUpdate = 
00921     //new TGCheckButton(fListButtonFrame, "Update Slide Show Canvases",
00922     new TGCheckButton(fListButtonFrame, "Update Multi Canvases",
00923               kM_CHBUTTON_SLIDEUPDATE);
00924   fChButtonSlideUpdate->Associate(this);
00925   fListButtonFrame->
00926     AddFrame( fChButtonSlideUpdate, fChButtonAutoUpdateLayout );
00927   fChButtonSlideUpdate->SetState(kButtonUp);
00928   SlideShowUpdate = kFALSE;
00929   //--
00930 
00931 
00932   // Update Frequency --
00933   fFrequencyFrame = 
00934     new TGCompositeFrame(fListButtonFrame, 100, 50,
00935                          kHorizontalFrame );
00936   fFrequencyFrameLayout = 
00937     //    new TGLayoutHints(kLHintsRight | kLHintsCenterY, 10, 10, 10, 10);
00938     new TGLayoutHints( kLHintsTop | kLHintsLeft );
00939 
00940   fFrequencyLabel =
00941     //new TGLabel( fListButtonFrame, "Update Delay (msec)" );
00942     new TGLabel( fFrequencyFrame, "Update Delay (msec)" );
00943   //fListButtonFrame->
00944   fFrequencyFrame->
00945     AddFrame( fFrequencyLabel, fChButtonAutoUpdateLayout);
00946 
00947 
00948 
00949   fFrequencyTextEntry =
00950     //new TGTextEntry( fListButtonFrame,
00951     new TGTextEntry( fFrequencyFrame,
00952                      fFrequencyTextBuffer = new TGTextBuffer(40),
00953                      kM_TEXTENTRY_FREQUENCY );
00954   //fFrequencyTextBuffer->AddText(0,  "0");
00955   fFrequencyTextBuffer->AddText(0,  "3000");
00956 
00957   fFrequencyTextEntry->
00958     Resize( 50, fFrequencyTextEntry->GetDefaultHeight() );
00959 
00960   //fListButtonFrame->
00961   fFrequencyFrame->
00962     AddFrame( fFrequencyTextEntry, fChButtonAutoUpdateLayout);
00963 
00964   fListButtonFrame->
00965     AddFrame(fFrequencyFrame, fFrequencyFrameLayout);
00966 
00967   //--
00968 
00969 
00970   // Control Buttons --
00971 
00972   fControlButtonFrame =
00973     new TGCompositeFrame( fListButtonFrame, 200, 300,
00974                           kHorizontalFrame );
00975   fControlButtonFrameLayout =
00976     new TGLayoutHints( kLHintsCenterX | kLHintsCenterY, 5,5,5,5);
00977 
00978 
00979 
00980   // List Tree Control Buttons --
00981   fButtonFrame =
00982     new TGCompositeFrame(fControlButtonFrame, 90, 300,
00983                          kVerticalFrame | kFixedWidth );
00984   fButtonFrameLayout = 
00985     new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 10, 10, 10, 10);
00986 
00987   fButtonLayout =
00988     new TGLayoutHints(kLHintsTop | kLHintsCenterX | kLHintsExpandX,
00989                       //5, 5, 5, 5);
00990                       5, 5, 2, 2);
00991   /*
00992   fStartHistoButton =
00993     new TGTextButton(fButtonFrame, "&Start", kM_BUTTON_START);
00994   fStartHistoButton->Associate(this);
00995   fStartHistoButton->SetToolTipText("Start Monitoring");
00996   */
00997 
00998   fRestartHistoButton =
00999     new TGTextButton(fButtonFrame, "&Update", kM_BUTTON_RESTART);
01000   fRestartHistoButton->Associate(this);
01001   fRestartHistoButton->SetToolTipText("Update Current Pad");
01002 
01003   fPauseHistoButton = 
01004     new TGTextButton(fButtonFrame, "&Pause", kM_BUTTON_PAUSE); 
01005   fPauseHistoButton->Associate(this);
01006   fPauseHistoButton->SetToolTipText("Pause Updating Current Pad");
01007 
01008   fClearHistoButton = 
01009     new TGTextButton(fButtonFrame, "&Clear", kM_BUTTON_CLEAR); 
01010   fClearHistoButton->Associate(this);
01011   fClearHistoButton->SetToolTipText("Clear Current Pad");
01012 
01013   fPrintHistoButton = 
01014     new TGTextButton(fButtonFrame, "&Print", kM_BUTTON_PRINT); 
01015   fPrintHistoButton->Associate(this);
01016   //fPrintHistoButton->SetToolTipText("Print Current Canvas");
01017   fPrintHistoButton->SetToolTipText("Print Current Pad");
01018 
01019   fStopHistoButton = 
01020     new TGTextButton(fButtonFrame, "&Reset", kM_BUTTON_STOP);
01021   fStopHistoButton->Associate(this);
01022   fStopHistoButton->SetToolTipText("Reset All");
01023 
01024   fNewCanvasButton = 
01025     new TGTextButton(fButtonFrame, "&New Canvas", kM_BUTTON_CANVAS);
01026   fNewCanvasButton->Associate(this);
01027   fNewCanvasButton->SetToolTipText("Draw new canvas");
01028 
01029   /*
01030   fExitButton =
01031     new TGTextButton(fButtonFrame, "&Exit", kM_BUTTON_EXIT); 
01032   fExitButton->Associate(this);
01033   fExitButton->SetToolTipText("Exit from this GUI");
01034   */
01035 
01036   //fButtonFrame->AddFrame(fStartHistoButton, fButtonLayout);
01037   fButtonFrame->AddFrame(fRestartHistoButton, fButtonLayout);
01038   fButtonFrame->AddFrame(fPauseHistoButton, fButtonLayout);
01039   fButtonFrame->AddFrame(fClearHistoButton, fButtonLayout);
01040   fButtonFrame->AddFrame(fPrintHistoButton, fButtonLayout);
01041   fButtonFrame->AddFrame(fStopHistoButton, fButtonLayout);
01042   fButtonFrame->AddFrame(fNewCanvasButton, fButtonLayout);
01043   //fButtonFrame->AddFrame(fExitButton, fButtonLayout);
01044 
01045   //tmp
01046   //fStartHistoButton->SetState(kButtonDisabled);
01047   fPauseHistoButton->SetState(kButtonDisabled);
01048   //fClearHistoButton->SetState(kButtonDisabled);
01049   //fPrintHistoButton->SetState(kButtonDisabled);
01050   //fRestartHistoButton->SetState(kButtonDisabled);
01051   //fStopHistoButton->SetState(kButtonDisabled);
01052 
01053   //Pausing = kFALSE;
01054 
01055   //gClient->GetColorByName("LightYellow",LightYellow);
01056 
01057   //fStartHistoButton->ChangeBackground(LightYellow);
01058   fPauseHistoButton->ChangeBackground(LightYellow);
01059   fClearHistoButton->ChangeBackground(LightYellow);
01060   fPrintHistoButton->ChangeBackground(LightYellow);
01061   fRestartHistoButton->ChangeBackground(LightYellow);
01062   fStopHistoButton->ChangeBackground(LightYellow);
01063   fNewCanvasButton->ChangeBackground(LightYellow);
01064   //fExitButton->ChangeBackground(LightYellow);
01065 
01066 
01067   fControlButtonFrame->
01068     AddFrame(fButtonFrame, fButtonFrameLayout);
01069   //--
01070 
01071 
01072   // Histogram Control Buttons --
01073   fHistoButtonGFrame
01074     = new TGGroupFrame(fControlButtonFrame, "Histogram",
01075                        kVerticalFrame );
01076 
01077   fHistoButtonGFrameLayout = 
01078     //    new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 2, 2, 2, 2);
01079     new TGLayoutHints(kLHintsRight | kLHintsCenterY, 10, 10, 10, 10);
01080 
01081 
01082   fHistoButtonFrame =
01083     new TGCompositeFrame(fHistoButtonGFrame, 50, 30,
01084                          kVerticalFrame | kFixedWidth );
01085 
01086 
01087   fHistoButtonFrameLayout = 
01088     //new TGLayoutHints(kLHintsCenterX | kLHintsCenterY | kLHintsExpandX,
01089     new TGLayoutHints(kLHintsRight | kLHintsCenterY); 
01090   //                 , 1, 1, 1, 1);
01091 
01092   fHistoButtonLayout =
01093     new TGLayoutHints(kLHintsTop | kLHintsCenterX | kLHintsExpandX,
01094                       1, 1, 5, 5);
01095 
01096   fZeroHistoButton = 
01097     new TGTextButton(fHistoButtonFrame, "&Zero", kM_BUTTON_ZERO);
01098   fZeroHistoButton->Associate(this);
01099   fZeroHistoButton->SetToolTipText("Reset selected Histograms");
01100 
01101   fUnZeroHistoButton = 
01102     new TGTextButton(fHistoButtonFrame, "&Restore", kM_BUTTON_UNZERO);
01103   fUnZeroHistoButton->Associate(this);
01104   fUnZeroHistoButton
01105     ->SetToolTipText("Back before reseting selected Histograms");
01106 
01107 
01108   fContentHistoButton = 
01109     new TGTextButton(fHistoButtonFrame, "&Content", kM_BUTTON_CONTENT);
01110   fContentHistoButton->Associate(this);
01111   fContentHistoButton
01112     ->SetToolTipText("Draw Bin-Content Histo of a Selected Item");
01113 
01114 
01115   fHistoButtonFrame->AddFrame(fZeroHistoButton, fHistoButtonLayout);
01116   fHistoButtonFrame->AddFrame(fUnZeroHistoButton, fHistoButtonLayout);
01117   fHistoButtonFrame->AddFrame(fContentHistoButton, fHistoButtonLayout);
01118 
01119   //fZeroHistoButton->SetState(kButtonDisabled);
01120   //fUnZeroHistoButton->SetState(kButtonDisabled);
01121   //fContentHistoButton->SetState(kButtonDisabled);
01122 
01123   fZeroHistoButton->ChangeBackground(LightYellow);
01124   fUnZeroHistoButton->ChangeBackground(LightYellow);
01125   fContentHistoButton->ChangeBackground(LightYellow);
01126 
01127 
01128   fHistoButtonGFrame->
01129     AddFrame(fHistoButtonFrame, fHistoButtonFrameLayout);
01130 
01131   fControlButtonFrame->
01132     AddFrame(fHistoButtonGFrame, fHistoButtonGFrameLayout);
01133 
01134   //--
01135 
01136 
01137   fListButtonFrame->
01138     AddFrame(fControlButtonFrame, fControlButtonFrameLayout);
01139 
01140 
01141   fHistoListFrame->
01142     AddFrame(fListButtonFrame, fListButtonFrameLayout);
01143 
01144 
01145   fListTreeMainFrame->
01146     AddFrame(fHistoListFrame,fHistoListFrameLayout);
01147 
01148   //--
01149 
01150   fMainFrame->
01151     AddFrame(fListTreeMainFrame,fListTreeMainFrameLayout);
01152 
01153   //--
01154 
01155 }

void HistoDisplay::MakeTitleFrame ( const char *  fTitle  )  [private]

Definition at line 589 of file HistoDisplay.cxx.

References fMainFrame, fPicBut, fPictLayout, fTextGC, fTitleFrame, fTitleFrameLayout, fTitleLabel, fTitleLabelLayout, and kM_PICTBUTTON.

00590 {
00591    // Title Frame with logo picture --
00592 
00593    fTitleFrame = new TGCompositeFrame(fMainFrame,200,40,kHorizontalFrame);
00594    fTitleFrameLayout = new TGLayoutHints(kLHintsTop | kLHintsExpandX,
00595                                          0, 0, 0, 0);
00596    FontStruct_t labelfont;
00597    labelfont = gClient->GetFontByName(
00598               "-*-times-bold-r-*-*-24-*-*-*-*-*-*-*");
00599    GCValues_t   gval;
00600    gval.fMask = kGCForeground | kGCFont;
00601    gval.fFont = gVirtualX->GetFontHandle(labelfont);
00602    gClient->GetColorByName("red", gval.fForeground);
00603    fTextGC = gVirtualX->CreateGC(gClient->GetRoot()->GetId(), &gval);
00604 
00605    fTitleLabel       = new TGLabel(fTitleFrame, fTitle , fTextGC, labelfont);
00606    fTitleLabelLayout = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 40, 10, 20, 20);
00607    fTitleFrame->AddFrame(fTitleLabel, fTitleLabelLayout);
00608 
00609    fPicBut = 
00610      new TGPictureButton( fTitleFrame,
00611                           gClient-> GetPicture("${CONSUMER_ICONS}/minos.xpm"),
00612                           kM_PICTBUTTON);
00613    fPictLayout = new TGLayoutHints(kLHintsTop | kLHintsRight
00614                                    //,0,0,0,0);
00615                                    ,0,4,4,0);
00616    fPicBut->Associate(this);
00617    fTitleFrame->AddFrame(fPicBut, fPictLayout);
00618 
00619    fMainFrame->
00620      AddFrame(fTitleFrame,fTitleFrameLayout);
00621    //--
00622 }

void HistoDisplay::MenuConnectStatus (  )  [private]

Definition at line 4458 of file HistoDisplay.cxx.

References consumerlist, ConsumerList::print(), and ConsumerList::readWebPage().

Referenced by ProcessMessage().

04459 {
04460 
04461         TGTransientFrame *fTransientFrame;
04462         fTransientFrame =
04463           new TGTransientFrame(gClient->GetRoot(), this, 500, 200);
04464         TGLayoutHints *fLayout;
04465         fLayout =
04466           new TGLayoutHints( kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0);
04467 
04468         TGTextView *fTextView;
04469         fTextView =
04470           new TGTextView( fTransientFrame, 600, 200);
04471                           //,kSunkenFrame | kDoubleBorder );
04472 
04473         TString StatusTxt = "\n";
04474         consumerlist->readWebPage();
04475         ostrstream ostr;
04476         consumerlist->print(ostr);
04477         ostr << ends;
04478         StatusTxt.Append(ostr.str());
04479 
04480 
04481         if ( fTextView->LoadBuffer( StatusTxt.Data() ) ) {
04482           fTextView->MapWindow();
04483         }
04484         else {
04485           cout << " Failed to load Socket status text info."  << endl;
04486         }
04487 
04488         fTransientFrame->AddFrame(fTextView,fLayout);
04489         fTransientFrame->SetWindowName("Connection Status");
04490         fTransientFrame->MapSubwindows();
04491         fTransientFrame->MapWindow();
04492 
04493 }

void HistoDisplay::MenuHelp ( const char *  s,
const char *  helpText 
) [private]

Definition at line 4498 of file HistoDisplay.cxx.

Referenced by ProcessMessage().

04499 {
04500   //cout << " In MenuHelp " << endl;
04501 
04502   TRootHelpDialog  *fHelpDialog;
04503   fHelpDialog =
04504     new TRootHelpDialog( this, s, 500, 400);
04505   {
04506     fHelpDialog->SetText(helpText);
04507     fHelpDialog->Popup();
04508   }
04509 }

void HistoDisplay::MessageBox ( const char *  msg  )  [private]

Definition at line 4511 of file HistoDisplay.cxx.

Referenced by ProcessMessage().

04512 {
04513   //cout << " In MessageBox " << endl;
04514 
04515         int retval;
04516 
04517         EMsgBoxIcon icontype = kMBIconExclamation;
04518         //Int_t buttons = kMBOk;
04519         int buttons = kMBOk;
04520 
04521         new TGMsgBox(fClient->GetRoot(), this, "WARNING", msg, 
04522                      icontype, buttons, &retval);
04523 }

TObject * HistoDisplay::OpenFile ( const char *  filename,
EInputTypes  inputtype = kTFile,
Option_t *  option = "READ" 
) [private]

Definition at line 1240 of file HistoDisplay.cxx.

References kTFile, kTMapFile, and kTSocket.

Referenced by ProcessMessage().

01243 {
01244   //cout << " In OpenFile " << endl;
01245 
01246   TObject *InputObj = 0;
01247 
01248   if ( inputtype == kTMapFile ) {
01249     TObject *obj =gROOT->GetListOfMappedFiles()->FindObject(filename) ;
01250     TMapFile *MFile = 0;
01251     if ( obj ) {
01252       MFile = (TMapFile*)obj;
01253     }
01254     else {
01255       //TMapFile::SetMapAddress(0x40c0000);
01256       MFile = TMapFile::Create(filename, option);
01257     }
01258 
01259     if ( MFile &&
01260          MFile->IsFolder() &&
01261          (MFile->IsA() == TMapFile::Class())  ) {
01262       //MFile->ls();
01263       //InputOpen = kTRUE;
01264       InputObj = MFile;
01265     }
01266     else {
01267       cout << " Error Opening " << filename << endl;
01268       if ( MFile ) MFile->Close();
01269       //InputOpen = kFALSE;
01270     }
01271   } //if ( inputtype == kTMapFile )
01272 
01273   else if ( inputtype == kTFile ) {
01274     TObject *obj = gROOT->GetListOfFiles()->FindObject(filename);
01275     TFile *RFile = 0;
01276     if ( obj ) {
01277       RFile = (TFile*)obj;
01278     }
01279     else {
01280       RFile = TFile::Open(filename, option);
01281     }
01282     if ( RFile &&
01283          RFile->IsOpen()  &&
01284          RFile->IsFolder() &&
01285          !(RFile->IsZombie()) &&
01286          (RFile->IsA() == TFile::Class()) &&
01287          (RFile->IsA() != TMapFile::Class())  ) {
01288       //RFile->ls();
01289       //InputOpen = kTRUE;
01290       InputObj = RFile;
01291     }
01292     else {
01293       cout << " Error Opening " << filename << endl;
01294       if ( RFile ) RFile->Close();
01295       //InputOpen = kFALSE;
01296     }
01297   } //else if ( inputtype == kTFile ) 
01298 
01299 
01300   else if ( inputtype == kTSocket ) {
01301 
01302     TSocket *sock = 0;
01303     //TObject *obj =gROOT->GetListOfSockets()->FindObject(filename);
01304     //if ( obj ) sock = (TSocket*)obj;
01305     //else {
01306 
01307     sock = (TSocket*)gROOT->GetListOfSockets()->FindObject(filename);
01308     //while ( sock && !sock->IsValid() ) {
01309     while ( sock ) {
01310       sock->Close();
01311       sock = (TSocket*)gROOT->GetListOfSockets()->FindObject(filename);
01312     }//while ( sock && !sock->IsValid() ) 
01313 
01314     if ( !sock ) {
01315       TUrl url(filename);
01316       sock = new TSocket(url.GetHost(),url.GetPort());
01317       //cout << " Socket Server Name = " << url.GetHost() << endl;
01318       //cout << " port = " << url.GetPort() << endl;
01319     } //if ( !sock ) 
01320 
01321     sock->SetName( filename );
01322 
01323     if ( sock && sock->IsValid() ) {
01324       cout << " Socket Server = " << filename << endl;
01325       //InputOpen = kTRUE;
01326       InputObj = sock;
01327     }
01328     else {
01329       cout << " Error Opening " << filename << endl;
01330       if ( sock ) sock->Close();
01331       //InputOpen = kFALSE;
01332     }
01333   } //else if ( inputtype == kTSocket ) {
01334 
01335 
01336   return InputObj;
01337 
01338 }

void HistoDisplay::PopUpSlides ( TGListTreeItem *  item,
const char *  canvasname,
const char *  canvastitle 
) [private]

Definition at line 2513 of file HistoDisplay.cxx.

References fSlideTimer, and StartSlides().

Referenced by SearchWarningErrorFolder().

02515 {
02516   //cout << " In PopUpWarningSlides " << endl;
02517 
02518   TVirtualPad *padsav = 0;
02519   if ( gPad ) padsav = gPad;
02520 
02521   TCanvas *canvas = 0;
02522 
02523   canvas =
02524     (TCanvas*) 
02525     ( gROOT->GetListOfCanvases()->FindObject( canvasname ) );
02526             
02527   if ( !canvas ) {
02528     canvas = 
02529       new TCanvas( canvasname, canvastitle, 400, 400 );
02530   } //if ( !canvas )
02531 
02532   if ( canvas ) {
02533 
02534     TCanvasImp *canvasimp = canvas->GetCanvasImp();
02535     if ( canvasimp ) canvasimp->Show();
02536 
02537     canvas->Clear();
02538     canvas->cd();
02539 
02540     //if ( fSlideTimer )
02541     if ( fSlideTimer && !fSlideTimer->HasTimedOut() )
02542       fSlideTimer->TurnOff();
02543 
02544     StartSlides( item );
02545 
02546   } // if ( canvas ) 
02547 
02548   if ( padsav ) padsav->cd();
02549 
02550 
02551 }

void HistoDisplay::PrintCanvas ( TPad *  canvas  )  [private]

Definition at line 4357 of file HistoDisplay.cxx.

References gSystem().

Referenced by ProcessMessage().

04358 {
04359   //cout << " In PrintCanvas " << endl;
04360   // From TGTextEdit.cxx
04361     Int_t ret;
04362     static char *gPrinter = 0;
04363     static char *gPrintCommand = 0;
04364 
04365     if (!gPrinter) {
04366       //gPrinter = StrDup(""); // use gEnv
04367       //gPrintCommand = StrDup("lpr");
04368       gPrinter = StrDup("157-ept7-hp"); // use gEnv
04369       gPrintCommand = StrDup("xprint -h -P");
04370     } //if (!gPrinter)
04371 
04372     //unused    TGPrintDialog *printdialog =
04373     //      new TGPrintDialog( fClient->GetRoot(), this, 400, 150,
04374     //          &gPrinter, &gPrintCommand, &ret );
04375 
04376     if ( ret ) {
04377       if ( canvas ) {
04378 
04379         const char *canvasname = canvas->GetName();
04380 
04381         char *msg = 0;
04382         if ( strlen( gPrinter ) ) {
04383           /*
04384           msg = new char[ strlen( gPrintCommand ) + 3 + strlen( gPrinter ) 
04385                         + 1 + strlen( canvasname ) + 4 + 1 ];
04386           sprintf( msg, "%s -P%s %s.ps\n", gPrintCommand,
04387                    gPrinter, canvasname );
04388           */
04389           msg = new char[ strlen( gPrintCommand ) + 1 + strlen( gPrinter ) 
04390                         + 1 + strlen( canvasname ) + 6 + 1 ];
04391           sprintf( msg, "%s %s \"%s.ps\"\n", gPrintCommand,
04392                    gPrinter, canvasname );
04393 
04394         } //if ( gPrinter )
04395         else {
04396           msg = new char[ strlen( gPrintCommand )
04397                         + 1 + strlen( canvasname ) + 6 + 1 ];
04398           sprintf( msg, "%s \"%s.ps\"\n", gPrintCommand, canvasname );  
04399         } //else //if ( gPrinter ) 
04400 
04401 
04402         canvas->Print( 0, "ps" );
04403 
04404         cout << msg << endl;
04405         gSystem->Exec( msg );
04406 
04407         if ( msg ) delete [] msg;
04408 
04409       } //if ( canvas )
04410     } //if (ret)
04411 
04412     // do not need delete printdialog
04413     // because done by closing the windown.
04414 }

Bool_t HistoDisplay::ProcessMessage ( Long_t  msg,
Long_t  parm1,
Long_t  parm2 
) [virtual]

Definition at line 4586 of file HistoDisplay.cxx.

References AddSubtractHisto(), AddTreeItemsOfInput(), AutoUpdate, CanvasName, CanvasNumber, CanvasTitle, ClearCurrentPad(), CloseWindow(), DrawContentHisto(), DrawHisto(), fChButtonAutoUpdate, fChButtonSlideUpdate, fDisplayedList, fFileNameBuffer, fFileNameTextEntry, fHistoListTree, FileDialogWindow(), FileName, FileNameClear(), fPauseHistoButton, fport, fRaButMFile, fRaButRFile, fRaButSocket, fReadFileButton, fRestartHistoButton, fSelectedItem, fSlideCanvasList, fSlideTimer, fsocketserver, fStatusBar, fUpdateTimer, GetCObjFromListItem(), HistoDisplaySlideTimer::GetCurrentPad(), gHelpHistoDisplay, Green, HistoDisplay(), HistoInPad(), kM_BUTTON_CANVAS, kM_BUTTON_CHOOSEFILE, kM_BUTTON_CLEAR, kM_BUTTON_CLEARFILENAME, kM_BUTTON_CONTENT, kM_BUTTON_FILENAME, kM_BUTTON_PAUSE, kM_BUTTON_PRINT, kM_BUTTON_RESTART, kM_BUTTON_STOP, kM_BUTTON_UNZERO, kM_BUTTON_ZERO, kM_CHBUTTON_AUTOUPDATE, kM_CHBUTTON_SLIDEUPDATE, kM_MENU_CONNECT_STATUS, kM_MENU_FILE_CLOSE, kM_MENU_FILE_EXIT, kM_MENU_FILE_NEWCANVAS, kM_MENU_FILE_NEWGUI, kM_MENU_FILE_NEWSLIDE, kM_MENU_HELP_CANVAS, kM_MENU_HELP_GUI, kM_MENU_HELP_ROOT, kM_MENU_LISTTREE_CLEAR, kM_MENU_LISTTREE_DELETE, kM_MENU_LISTTREE_REFRESH, kM_MENU_LISTTREE_SORTFOLDER, kM_MENU_LISTTREE_SORTTREE, kM_PICTBUTTON, kM_RABUTTON_MFILE, kM_RABUTTON_RFILE, kM_RABUTTON_SOCKET, kM_TEXTENTRY_FILENAME, kSlideShowFolder, kTFile, kTMapFile, kTSocket, MenuConnectStatus(), MenuHelp(), MessageBox(), OpenFile(), PrintCanvas(), RecursivePadClear(), Red, RefreshTreeItem(), RemoveTGListTree(), ResetObjects(), Running, SlideShowUpdate, SortTGListTree(), StartSlides(), strstrn(), UpdateCanvas(), and UpdateTimerOn().

04587 {
04588 
04589   //cout << " In ProcessMessage " << endl;
04590 
04591   //static TObject *inputobj = 0;
04592   //TObject *inputobj2 =0;
04593   TPad *gpad = 0;
04594 
04595   switch ( GET_MSG(msg) ) {
04596   case kC_COMMAND:
04597     switch ( GET_SUBMSG(msg) ) {
04598     case kCM_MENU:
04599       switch ( parm1 ) {
04600       case kM_MENU_FILE_NEWGUI:
04601         new HistoDisplay(gClient->GetRoot(), 200, 400, fsocketserver, fport);
04602         break;
04603       case kM_MENU_FILE_NEWCANVAS:
04604         //gROOT->GetMakeDefCanvas()();
04605         {
04606           CanvasNumber++;
04607           char *num = new char[3];
04608           sprintf( num, "%d", CanvasNumber);
04609           TCanvas *CurrentCanvas =
04610             new TCanvas( CanvasName + TString( num ),
04611                          CanvasTitle + TString( num) , 500, 500 );
04612           delete num;
04613           CurrentCanvas->cd();
04614         }
04615         break;
04616       case kM_MENU_FILE_NEWSLIDE:
04617         {
04618           static int i = 0;
04619           i++;
04620           //TString name = "MINOSSlideShowCanvas";
04621           //TString title = "MINOS Slide Show Canvas ";
04622           TString name = "AutoUpdateCanvas";
04623           TString title = "Auto Update Canvas ";
04624           char *num = 0;
04625           num = new char[ 3 ];
04626           sprintf( num, "%d", i );
04627           name = name + TString( num );
04628           title = title + TString( num );
04629           delete num;
04630           //tmp
04631           //cout << name << " " << title << endl; 
04632           TCanvas *slideCanvas = new TCanvas( name, title, 500, 500 );
04633           slideCanvas->cd();
04634           if ( fSlideCanvasList ) {
04635             if ( !( fSlideCanvasList->IsEmpty() ) )  {
04636               TObjLink *link = fSlideCanvasList->FirstLink();
04637               while ( link ) {
04638                 TObject *obj = 0;
04639                 obj = link->GetObject();
04640                 link = link->Next();
04641                 if ( !obj ||
04642                      !( gROOT->GetListOfCanvases()->FindObject( obj ) ) )
04643                   fSlideCanvasList->Remove( obj );
04644               } //while ( link )
04645             } //if ( !( fSlideCanvasList->IsEmpty() )
04646             fSlideCanvasList->Add( slideCanvas );
04647           } //if ( fSlideCanvasList )
04648         } //{
04649         break;
04650       case kM_MENU_FILE_CLOSE:
04651         // Do not know how to close one window.
04652         DestroyWindow(); // in TGWindow
04653         //cout << " Sorry. Not yet. " << endl;
04654         break;
04655       case kM_MENU_FILE_EXIT:
04656         Running = kFALSE;
04657         fReadFileButton->ChangeBackground(Red);
04658         //  cout << "Button changed to red\n";
04659         fChButtonSlideUpdate->SetState(kButtonUp);
04660         SlideShowUpdate = kFALSE;         
04661         gClient->NeedRedraw(fReadFileButton);
04662 
04663         ResetObjects();
04664 
04665         CloseWindow();
04666         break;
04667       case kM_MENU_LISTTREE_SORTTREE:
04668         SortTGListTree();
04669         break;
04670       case kM_MENU_LISTTREE_SORTFOLDER:
04671         if ( fSelectedItem ) {
04672           fHistoListTree->SortChildren(fSelectedItem);
04673           fClient->NeedRedraw(fHistoListTree);
04674         }
04675         break;
04676       case kM_MENU_LISTTREE_DELETE:
04677         if ( fSelectedItem ) {
04678           CObject *cobj = 
04679             (CObject*) fDisplayedList
04680             ->FindObject(fSelectedItem->GetText()); 
04681 
04682           if ( fDisplayedList->Remove( cobj ) ) delete cobj;
04683 
04684           fHistoListTree->DeleteItem(fSelectedItem);
04685           fClient->NeedRedraw(fHistoListTree);
04686         }
04687         fSelectedItem = 0;
04688         break;
04689       case kM_MENU_LISTTREE_CLEAR:
04690 
04691         if ( fDisplayedList ) fDisplayedList->Clear();
04692         RemoveTGListTree();
04693         break;
04694       case kM_MENU_LISTTREE_REFRESH:
04695 
04696         if ( fSelectedItem )
04697           RefreshTreeItem( fSelectedItem );
04698         else
04699           RefreshTreeItem( fHistoListTree->GetFirstItem() );
04700 
04701         break;
04702         /*
04703       case kM_MENU_CONNECT_MON1:
04704         cout << " Sorry. Not yet implemented. " << endl;
04705         break;
04706       case kM_MENU_CONNECT_MON2:
04707         cout << " Sorry. Not yet implemented. " << endl;
04708         break;
04709       case kM_MENU_CONNECT_MON3:
04710         cout << " Sorry. Not yet implemented. " << endl;
04711         break;
04712       case kM_MENU_CONNECT_MON4:
04713         cout << " Sorry. Not yet implemented. " << endl;
04714         break;
04715       case kM_MENU_CONNECT_MON5:
04716         cout << " Sorry. Not yet implemented. " << endl;
04717         break;
04718         */
04719 
04720       case kM_MENU_CONNECT_STATUS:
04721         MenuConnectStatus();
04722         break;
04723 
04724       case kM_MENU_HELP_GUI:
04725         MenuHelp("Help on this GUI...", gHelpHistoDisplay);
04726         break;
04727 
04728       case kM_MENU_HELP_ROOT:
04729         MenuHelp("Help on ROOT...", gHelpAbout);
04730         break;
04731 
04732       case kM_MENU_HELP_CANVAS:
04733         MenuHelp("Help on Canvas...", gHelpCanvas);
04734         break;
04735       } // switch( parm1 )
04736       break; //kCM_MENU
04737 
04738 
04739     case kCM_BUTTON:
04740       switch ( parm1 ) {
04741 
04742       case kM_PICTBUTTON:
04743         //PopupWindow();
04744         new PhotoWindow(fClient->GetRoot(), this, 400, 500);
04745         break;
04746 
04747 
04748       case kM_BUTTON_FILENAME:
04749         {
04750 
04751           // dp : reset first
04752 
04753           fReadFileButton->SetState(kButtonUp);
04754           fReadFileButton->ChangeBackground(Red);
04755           fChButtonSlideUpdate->SetState(kButtonUp);
04756           SlideShowUpdate = kFALSE;
04757           // cout << "Button changed to red\n";   
04758             gClient->NeedRedraw(fReadFileButton);
04759           Running = kFALSE;
04760 
04761           fSelectedItem = 0;
04762 
04763           ResetObjects();
04764 
04765           // Delete and Remove files, socket, and lists, ListTrees --
04766           if ( gPad && !( gROOT->GetListOfCanvases()->IsEmpty() ) ) {
04767             TCanvas *CurrentCanvas = 0;
04768             CurrentCanvas = gPad->GetCanvas();
04769             if ( CurrentCanvas ) {
04770               //CurrentCanvas->Clear();
04771               RecursivePadClear( CurrentCanvas );
04772               CurrentCanvas->cd();
04773               CurrentCanvas->Modified();
04774               CurrentCanvas->Update();
04775             } //if ( CurrentCanvas )
04776           } //if ( gPad && !( gROOT->GetCanvasList()->IsEmpty() ) )
04777 
04778 
04779 
04780 
04781 
04782           FileName = TString( fFileNameBuffer->GetString() );
04783 
04784           EInputTypes inputtype;
04785 
04786           if ( fRaButMFile->GetState() == kButtonDown )
04787             inputtype = kTMapFile;
04788           else if ( fRaButRFile->GetState() == kButtonDown )
04789             inputtype = kTFile;
04790           else if ( fRaButSocket->GetState() == kButtonDown )
04791             inputtype = kTSocket;
04792 
04793           //InputObj = OpenFile( FileName.Data(), inputtype, "READ" );
04794           TObject *InputObj = OpenFile( FileName.Data(), inputtype, "READ" );
04795 
04796 
04797           //if ( InputOpen ) {
04798           if ( InputObj ) {
04799 
04800             AddTreeItemsOfInput( InputObj );
04801             //RefreshTreeItem( fHistoListTree->GetFirstItem() );
04802             fClient->NeedRedraw( fHistoListTree );
04803             fReadFileButton->ChangeBackground(Green);
04804             // cout << "Button changed to green\n";
04805             // cout << "Opened file\n";
04806             gClient->NeedRedraw(fReadFileButton);
04807             //    fMainFrame->Update();
04808 
04809             char* str = new char[ 9 + FileName.Length() ];
04810             strcpy(str, " Opened ");
04811             fStatusBar
04812               ->SetText( strcat(str, FileName.Data()), 1);
04813             delete [] str;
04814           } //if ( InputObj ) 
04815           else {
04816 
04817             //if ( inputtype == kTMapFile && !InputOpen ) {
04818             if ( inputtype == kTMapFile ) {
04819               const char *sg = "Failed to open memory map file.";
04820               MessageBox(sg);
04821             }
04822             //else if ( inputtype == kTFile && !InputOpen ) {
04823             else if ( inputtype == kTFile ) {
04824               const char *sg = "Failed to open ROOT file.";
04825               MessageBox(sg);
04826             }
04827             //else if ( inputtype == kTSocket && !InputOpen ) {
04828             else if ( inputtype == kTSocket ) {
04829               const char *sg = "Failed to open the socket connection.";
04830               MessageBox(sg);
04831             }
04832 
04833             char* str = new char[16+FileName.Length()];
04834             str = strcpy(str," Error Opening ");
04835             fStatusBar
04836               ->SetText( strcat(str, FileName.Data()), 1);
04837             delete [] str;
04838           }
04839         }
04840 
04841         break;
04842 
04843 
04844       case kM_BUTTON_CHOOSEFILE:
04845         if( (fRaButMFile->GetState() == kButtonDown) ||
04846             (fRaButRFile->GetState() == kButtonDown) ) {
04847 
04848           const char *file = FileDialogWindow(); 
04849           if ( file ){ 
04850 
04851             fFileNameBuffer->Clear();
04852 
04853             // Older version of  ROOT.
04854             /*
04855             char s[80] = "";
04856             strcat(s, gSystem->WorkingDirectory()); 
04857             strcat(s, "/"); 
04858             strcat(s, file); 
04859 
04860             fFileNameBuffer->AddText(0, s);
04861             */
04862 
04863             fFileNameBuffer->AddText(0, file);
04864 
04865             gClient->NeedRedraw(fFileNameTextEntry);
04866 
04867             //T.A
04868             delete [] file;
04869           }
04870 
04871         }
04872 
04873         break;
04874             
04875       case kM_BUTTON_CLEARFILENAME:
04876 
04877         FileNameClear();
04878 
04879         break;
04880 
04881         /*
04882       case kM_BUTTON_START:
04883 
04884         MonitorName = TString( fMonitorNameBuffer->GetString() );
04885 
04886         HistoDisplayMain();
04887         //inputobj2 = inputobj;
04888         //HistoDisplayMain( inputobj2 );
04889 
04890         //tmp
04891         //fReadFileButton->SetState(kButtonUp);
04892 
04893         //tmp
04894         //fStartHistoButton->SetState(kButtonDisabled);
04895         fStopHistoButton->SetState(kButtonUp);
04896 
04897         fClearHistoButton->SetState(kButtonUp);
04898 
04899         fPrintHistoButton->SetState(kButtonUp);
04900 
04901         fZeroHistoButton->SetState(kButtonUp);
04902         fUnZeroHistoButton->SetState(kButtonUp);
04903         fContentHistoButton->SetState(kButtonUp);
04904 
04905 
04906         break;
04907         */
04908 
04909       case kM_BUTTON_PAUSE:
04910 
04911         if ( Running ) {
04912           fPauseHistoButton->SetState( kButtonDisabled );
04913           fRestartHistoButton->SetState( kButtonUp );
04914           Running = kFALSE;
04915         } //if ( Running )
04916 
04917 
04918 
04919         break;
04920       case kM_BUTTON_CLEAR:
04921 
04922         ClearCurrentPad();
04923         break;
04924 
04925       case kM_BUTTON_PRINT:
04926 
04927         if ( gPad || !( gROOT->GetListOfCanvases()->IsEmpty() ) ) {
04928           //PrintCanvas( gPad->GetCanvas() );
04929           PrintCanvas( (TPad*)gPad );
04930         }//if ( gPad || !( gROOT->GetListOfCanvases()->IsEmpty() ) ) 
04931           
04932         break;
04933 
04934       case kM_BUTTON_RESTART:
04935 
04936         if ( fSelectedItem ) {
04937           /*
04938           if ( strstr( fSelectedItem->GetText(), "slide" ) ||
04939                strstr( fSelectedItem->GetText(), "Slide" ) ||
04940                strstr( fSelectedItem->GetText(), "SLIDE" ) ) {
04941           */
04942           if ( strstrn( fSelectedItem->GetText(), kSlideShowFolder ) ) {
04943 
04944             StartSlides( fSelectedItem );
04945 
04946           } //if ( strstr( fSelectedItem->GetText() ) ||
04947 
04948           else {
04949 
04950             if ( AutoUpdate ) {
04951               fPauseHistoButton->SetState( kButtonUp );
04952               fRestartHistoButton->SetState( kButtonDisabled );
04953               UpdateTimerOn();
04954             } // if ( AutoUpdate ) {
04955             else {
04956               UpdateCanvas();
04957             } //else //if ( AutoUpdate ) {
04958 
04959           } //else // if ( strstr( fSelectedItem->GetText(), "slide" ) ||
04960 
04961         } //if( fSelectedItem )  
04962 
04963         break;
04964       case kM_BUTTON_ZERO:
04965 
04966         gpad = (TPad*)gPad;
04967         AddSubtractHisto(gpad, 1);
04968 
04969         UpdateCanvas();
04970 
04971 
04972 
04973         break;
04974       case kM_BUTTON_UNZERO:
04975 
04976         gpad = (TPad*)gPad;
04977         AddSubtractHisto(gpad, 0);
04978         UpdateCanvas();
04979 
04980         break;
04981       case kM_BUTTON_CONTENT:
04982         /*
04983         if ( fSelectedItem ) {
04984           TObject *obj = 
04985             fDisplayedList->FindObject( fSelectedItem->GetText() );
04986           if ( obj && obj->InheritsFrom(CHistogram::Class()) ) {
04987             TH1 *histo =
04988               (TH1*) ( ((CHistogram*)obj)->SubtractedHisto() );
04989             //TH1 *histo =  ( (CHistogram*)obj )->GetHistoDrawn();
04990 
04991             DrawContentHisto( histo );
04992             delete histo;
04993           }
04994         }
04995         */
04996 
04997         gpad = (TPad*)gPad;
04998         if ( gpad ) {
04999 
05000           Int_t counthisto = 0;
05001           TH1 *histo = HistoInPad( gpad , counthisto );
05002           if ( counthisto == 1 ) DrawContentHisto( histo ); 
05003           else if ( counthisto >= 2 )
05004             cout << " Select one histo on canvas. " << endl;
05005 
05006         } //if ( gpad )
05007 
05008 
05009         break;
05010 
05011       case kM_BUTTON_CANVAS:
05012         {
05013           static int i = 0;
05014           i++;
05015           //TString name = "MINOSSlideShowCanvas";
05016           //TString title = "MINOS Slide Show Canvas ";
05017           TString name = "AutoUpdateCanvas";
05018           TString title = "Auto Update Canvas ";
05019           char *num = 0;
05020           num = new char[ 3 ];
05021           sprintf( num, "%d", i );
05022           name = name + TString( num );
05023           title = title + TString( num );
05024           delete num;
05025           //tmp
05026           //cout << name << " " << title << endl; 
05027           TCanvas *slideCanvas = new TCanvas( name, title, 500, 500 );
05028           slideCanvas->cd();
05029           if ( fSlideCanvasList ) {
05030             if ( !( fSlideCanvasList->IsEmpty() ) )  {
05031               TObjLink *link = fSlideCanvasList->FirstLink();
05032               while ( link ) {
05033                 TObject *obj = 0;
05034                 obj = link->GetObject();
05035                 link = link->Next();
05036                 if ( !obj ||
05037                      !( gROOT->GetListOfCanvases()->FindObject( obj ) ) )
05038                   fSlideCanvasList->Remove( obj );
05039               } //while ( link )
05040             } //if ( !( fSlideCanvasList->IsEmpty() )
05041             fSlideCanvasList->Add( slideCanvas );
05042           } //if ( fSlideCanvasList )
05043         } //{
05044         break;
05045 
05046       case kM_BUTTON_STOP:
05047 
05048         cout << "Pressed RESET\n";
05049         /*
05050         fPauseHistoButton->SetState(kButtonDisabled);
05051         fRestartHistoButton->SetState(kButtonDisabled);
05052         fZeroHistoButton->SetState(kButtonDisabled);
05053         fUnZeroHistoButton->SetState(kButtonDisabled);
05054         fContentHistoButton->SetState(kButtonDisabled);
05055         fStopHistoButton->SetState(kButtonDisabled);
05056         */
05057 
05058         if (fUpdateTimer) {fUpdateTimer->TurnOff();}
05059         if (fSlideTimer) {fSlideTimer->TurnOff();}
05060 
05061         if ( Running ) {
05062           fPauseHistoButton->SetState( kButtonDisabled );
05063           fRestartHistoButton->SetState( kButtonUp );
05064           Running = kFALSE;
05065         }
05066 
05067 ;
05068 
05069         fReadFileButton->SetState(kButtonUp);
05070           fReadFileButton->ChangeBackground(Red);
05071           // cout << "Button changed to red\n";  
05072             gClient->NeedRedraw(fReadFileButton);
05073             fChButtonSlideUpdate->SetState(kButtonUp);
05074             SlideShowUpdate = kFALSE;
05075         Running = kFALSE;
05076 
05077         fSelectedItem = 0;
05078 
05079         ResetObjects();
05080 
05081         fHistoListTree->Clear(); //dp
05082 
05083         // Delete and Remove files, socket, and lists, ListTrees --
05084         if ( gPad && !( gROOT->GetListOfCanvases()->IsEmpty() ) ) {
05085           TCanvas *CurrentCanvas = 0;
05086           CurrentCanvas = gPad->GetCanvas();
05087           if ( CurrentCanvas ) {
05088             //CurrentCanvas->Clear();
05089             RecursivePadClear( CurrentCanvas );
05090             CurrentCanvas->cd();
05091             CurrentCanvas->Modified();
05092             CurrentCanvas->Update();
05093           } //if ( CurrentCanvas )
05094         } //if ( gPad && !( gROOT->GetCanvasList()->IsEmpty() ) )
05095 
05096 
05097         //--
05098 
05099         break;
05100         /*
05101       case kM_BUTTON_EXIT:
05102         Running = kFALSE;
05103 
05104         ResetObjects();
05105 
05106         CloseWindow();
05107         break;
05108         */
05109 
05110       } //switch parm1
05111       break; //kCM_BUTTON
05112 
05113     case kCM_CHECKBUTTON:
05114       switch ( parm1 ) {
05115       case kM_CHBUTTON_AUTOUPDATE:
05116         if ( fChButtonAutoUpdate->GetState() == kButtonDown ) {
05117           AutoUpdate = kTRUE;
05118 
05119           fChButtonSlideUpdate->SetState(kButtonUp);
05120         }
05121         else {
05122           AutoUpdate = kFALSE;
05123           fPauseHistoButton->SetState(kButtonDisabled);
05124           fRestartHistoButton->SetState(kButtonUp);
05125           Running = kFALSE;
05126 
05127           fChButtonSlideUpdate->SetState(kButtonUp);
05128           fChButtonSlideUpdate->SetState(kButtonDisabled);
05129           SlideShowUpdate = kFALSE;
05130         }
05131         break;
05132 
05133       case kM_CHBUTTON_SLIDEUPDATE:
05134         if ( fChButtonSlideUpdate->GetState() == kButtonDown ) 
05135           SlideShowUpdate = kTRUE;
05136         else 
05137           SlideShowUpdate = kFALSE;
05138 
05139         break;
05140       } // switch parm1 of Check Button
05141 
05142       break; //kCM_CHECKBUTTON
05143 
05144     case kCM_RADIOBUTTON:
05145       switch ( parm1 ) {
05146       case kM_RABUTTON_MFILE:
05147         fRaButMFile->SetState(kButtonDown);
05148         fRaButRFile->SetState(kButtonUp);
05149         fRaButSocket->SetState(kButtonUp);
05150         break; // kM_RABUTTON_MFILE
05151       case kM_RABUTTON_RFILE:
05152         fRaButMFile->SetState(kButtonUp);
05153         fRaButRFile->SetState(kButtonDown);
05154         fRaButSocket->SetState(kButtonUp);
05155         break; // kM_RABUTTON_RFILE
05156       case kM_RABUTTON_SOCKET:
05157         fRaButMFile->SetState(kButtonUp);
05158         fRaButRFile->SetState(kButtonUp);
05159         fRaButSocket->SetState(kButtonDown);
05160         break; // kM_RABUTTON_SOCKET
05161       } // switch parm1 of Radio Button
05162 
05163       break; //kCM_RADIOBUTTON
05164 
05165 
05166     } //switch submsg of kC_COMMAND
05167     break; // kC_COMMAND
05168 
05169   case kC_LISTTREE:
05170     switch ( GET_SUBMSG(msg) ) {
05171 
05172     case kCT_ITEMCLICK:
05173       if ( parm1 == kButton1 || parm1 == kButton2 ) {
05174         TGListTreeItem *item;
05175         if ( (item = fHistoListTree->GetSelected()) !=0 &&
05176             item != fSelectedItem) {
05177           fClient->NeedRedraw(fHistoListTree);
05178           fSelectedItem = item;
05179         }
05180       } //if parm1 of kCT_ITEMCLICK
05181 
05182       else if ( parm1 == kButton3 ) {
05183         TGListTreeItem *item;
05184         if ( (item = fHistoListTree->GetSelected()) !=0 ) {
05185           fClient->NeedRedraw(fHistoListTree);
05186           fSelectedItem = item;
05187 
05188 
05189           if ( fSelectedItem ) {
05190 
05191             /*
05192             if ( strstr( fSelectedItem->GetText(), "slide" ) ||
05193                  strstr( fSelectedItem->GetText(), "Slide" ) ||
05194                  strstr( fSelectedItem->GetText(), "SLIDE" ) ) {
05195             */
05196             if ( strstrn( fSelectedItem->GetText(), kSlideShowFolder ) ) {
05197 
05198               //dp            StartSlides( fSelectedItem );
05199 
05200             } //if ( strstr( fSelectedItem->GetText() ) ||
05201 
05202 
05203             else {
05204 
05205               if ( fSlideTimer && 
05206                    ( fSlideTimer->GetCurrentPad() == gPad ) &&
05207                    !fSlideTimer->HasTimedOut() )
05208                 //if ( fSlideTimer )
05209                 fSlideTimer->TurnOff();
05210 
05211 
05212               if ( fSelectedItem->GetFirstChild() &&
05213                    fSelectedItem->GetFirstChild()->GetNextSibling() &&
05214                    fSelectedItem->IsOpen() ) {
05215 
05216                 TList *selectedList = new TList();
05217 
05218                 TGListTreeItem *item2;
05219                 item2 = fSelectedItem->GetFirstChild();
05220 
05221                 while ( item2 ) {
05222                   //TObject *obj2 = 0;
05223                   //obj2 = fDisplayedList->FindObject( item2->GetText() );
05224 
05225                   TObject *obj2 = GetCObjFromListItem( item2 );
05226 
05227                   if( obj2 ) {
05228                     selectedList->Add( obj2 );
05229                     //obj2->ls();
05230                   }//if( obj2 )
05231                   item2 = item2->GetNextSibling();
05232                 }// while( item2 )
05233 
05234                 DrawHisto( selectedList );
05235                 delete selectedList;
05236 
05237               } //if ( selectedItem->GetFirstChild() &&
05238               else {
05239 
05240                 //TObject *obj =
05241                 //fDisplayedList->FindObject( fSelectedItem->GetText() );
05242 
05243                 TObject *obj = GetCObjFromListItem( item );
05244 
05245                 DrawHisto( obj );
05246 
05247               } //else //if ( selectedItem->GetFirstChild() &&
05248 
05249 
05250               if ( AutoUpdate ) {
05251                 fPauseHistoButton->SetState( kButtonUp );
05252                 fRestartHistoButton->SetState( kButtonDisabled );
05253               
05254                 UpdateTimerOn();
05255 
05256               } //if (AutoUpdate)
05257               else {
05258 
05259                 //if ( !Running ) {
05260                   fPauseHistoButton->SetState( kButtonDisabled );
05261                   fRestartHistoButton->SetState( kButtonUp );
05262                   //} //if ( !Running ) {
05263 
05264               } //else //if (AutoUpdate)
05265 
05266 
05267 
05268             } //else //if ( strstr( fSelectedItem->GetText() ) ||
05269 
05270           } //if ( fSelectedItem )
05271 
05272 
05273         } //if ( (item = fHistoListTree->GetSelected()) !=0 )
05274       } // else if parm1 == kButton3 of kCT_ITEMCLICK
05275       break; // kCT_ITEMCLICK
05276 
05277 
05278     case kCT_ITEMDBLCLICK:
05279       //if ( parm1 == kButton1 ) {
05280       if ( parm1 ) {
05281         TGListTreeItem *item;
05282         if ( (item = fHistoListTree->GetSelected()) !=0 ) {
05283           fClient->NeedRedraw(fHistoListTree);
05284           fSelectedItem = item;
05285 
05286           if ( fSelectedItem ) {
05287 
05288             //TObject *obj =
05289             //fDisplayedList->FindObject( fSelectedItem->GetText() );
05290 
05291             TObject *obj = GetCObjFromListItem( item );
05292 
05293             if ( !obj ) {
05294  
05295               /*
05296               if ( ( strstr( fSelectedItem->GetText(), "slide" ) ||
05297                      strstr( fSelectedItem->GetText(), "Slide" ) ||
05298                      strstr( fSelectedItem->GetText(), "SLIDE" ) ) ) {
05299               */
05300               if ( strstrn( fSelectedItem->GetText(), kSlideShowFolder ) ) {
05301 
05302                 //dp            StartSlides( fSelectedItem );
05303 
05304               } // if ( ( strstr( fSelectedItem->GetText(), "slide" ) ||
05305 
05306             } //if ( !obj )  
05307 
05308             else {
05309 
05310               if ( fSlideTimer &&
05311                    ( fSlideTimer->GetCurrentPad() == gPad ) &&
05312                    !fSlideTimer->HasTimedOut() )
05313                 //if ( fSlideTimer )
05314                 fSlideTimer->TurnOff();
05315 
05316               DrawHisto( obj );
05317 
05318               if ( AutoUpdate ) {
05319                 fPauseHistoButton->SetState( kButtonUp );
05320                 fRestartHistoButton->SetState( kButtonDisabled );
05321 
05322                 UpdateTimerOn();
05323 
05324               } //if ( AutoUpdate )
05325               else {
05326 
05327                 //if ( !Running ) {
05328                   fPauseHistoButton->SetState( kButtonDisabled );
05329                   fRestartHistoButton->SetState( kButtonUp );
05330                   //} //if ( !Running ) {
05331 
05332               } //else //if (AutoUpdate)
05333 
05334 
05335             } //else //if ( !obj )
05336 
05337 
05338           } //if ( fSelectedItem )
05339 
05340 
05341         } //if ( (item = fHistoListTree->GetSelected()) !=0 )
05342       } //if ( parm1 == kButton1 ) of kCT_ITEMDBLCLICK
05343       break; // kCT_ITEMDBLCLICK
05344 
05345     } // switch submsg of kC_LISTTREE
05346     break; //case kC_LISTTREE
05347 
05348   case kC_TEXTENTRY:
05349     switch (GET_SUBMSG(msg)) {
05350 
05351     case kTE_ENTER:
05352 
05353       switch ( parm1 ) {
05354 
05355       case kM_TEXTENTRY_FILENAME:
05356 
05357         {
05358           FileName = TString( fFileNameBuffer->GetString() );
05359 
05360           EInputTypes inputtype;
05361 
05362           if ( fRaButMFile->GetState() == kButtonDown )
05363             inputtype = kTMapFile;
05364           else if ( fRaButRFile->GetState() == kButtonDown )
05365             inputtype = kTFile;
05366           else if ( fRaButSocket->GetState() == kButtonDown )
05367             inputtype = kTSocket;
05368 
05369           //InputObj = OpenFile( FileName.Data(), inputtype, "READ" );
05370           TObject *InputObj = OpenFile( FileName.Data(), inputtype, "READ" );
05371 
05372 
05373           //if ( InputOpen ) {
05374           if ( InputObj ) {
05375 
05376             AddTreeItemsOfInput( InputObj );
05377             //RefreshTreeItem( fHistoListTree->GetFirstItem() );
05378             fClient->NeedRedraw( fHistoListTree );
05379 
05380 
05381             char* str = new char[ 9 + FileName.Length() ];
05382             strcpy(str, " Opened ");
05383             fStatusBar
05384               ->SetText( strcat(str, FileName.Data()), 1);
05385             delete [] str;
05386           } //if ( InputObj ) 
05387           else {
05388 
05389             //if ( inputtype == kTMapFile && !InputOpen ) {
05390             if ( inputtype == kTMapFile ) {
05391               const char *sg = "Failed to open memory map file.";
05392               MessageBox(sg);
05393             }
05394             //else if ( inputtype == kTFile && !InputOpen ) {
05395             else if ( inputtype == kTFile ) {
05396               const char *sg = "Failed to open ROOT file.";
05397               MessageBox(sg);
05398             }
05399             //else if ( inputtype == kTSocket && !InputOpen ) {
05400             else if ( inputtype == kTSocket ) {
05401               const char *sg = "Failed to open the socket connection.";
05402               MessageBox(sg);
05403             }
05404 
05405             char* str = new char[16+FileName.Length()];
05406             strcpy(str," Error Opening ");
05407             fStatusBar
05408               ->SetText( strcat(str, FileName.Data()), 1);
05409             delete [] str;
05410 
05411           } // else //if ( InputObj )
05412 
05413         }
05414         break;//  kM_TEXTENTRY_FILENAME
05415     
05416       }//switch ( parm1 )
05417 
05418       break; //case kTE_ENTER:
05419 
05420     default:
05421       break;
05422 
05423     }//switch (GET_SUBMSG(msg)) 
05424 
05425     break; //case kC_TEXTENTRY:
05426 
05427   default:
05428     break;
05429 
05430   } //switch ( GET_MSG(msg) )
05431 
05432   return kTRUE;
05433 
05434 }

void HistoDisplay::RecursivePadClear ( TVirtualPad *  pad,
Option_t *  option = "" 
) [private]

Definition at line 3131 of file HistoDisplay.cxx.

Referenced by ClearCurrentPad(), DrawHisto(), DrawTPad(), and ProcessMessage().

03132 {
03133   //cout << " In RecursivePadClear " << endl;
03134   if ( !pad ) return;
03135   //cout << pad->GetName() << endl;
03136 
03137 
03138   TList *primitivelist = pad->GetListOfPrimitives();
03139   TFrame *frame = pad->GetFrame();
03140 
03141   TIter next( primitivelist );
03142 
03143   TObject *obj;
03144   while ( ( obj = next() ) ) {
03145 
03146       if ( !( obj->TestBit( kCanDelete ) ) &&
03147            !( frame && frame->IsEqual( obj ) ) ) obj->SetBit( kCanDelete );
03148 
03149       if ( obj->InheritsFrom( TPad::Class() )  ) {
03150         TPad *padInside = (TPad*) obj;
03151         RecursivePadClear( padInside, option );
03152       } // if ( obj->InheritsFrom( TPad::Class() )  )
03153 
03154   } //while ( obj = next() )
03155 
03156   pad->Clear( option );
03157 
03158 }

void HistoDisplay::RefreshTreeItem ( TGListTreeItem *  item  )  [private]

Definition at line 2393 of file HistoDisplay.cxx.

References fHistoListTree, CObject::GetTitle(), and UpdateHistoList().

Referenced by GetNewObj(), and ProcessMessage().

02394 {
02395   //cout << " In RefreshTreeItem " << endl;
02396 
02397 
02398   while ( item ) {
02399 
02400     //tmp
02401     //cout << " item = " << item->GetText() <<endl;
02402 
02403     TGListTreeItem *sibling = item->GetNextSibling();
02404 
02405     TGListTreeItem *parent = item->GetParent();
02406 
02407     TGListTreeItem *firstchild = item->GetFirstChild();
02408 
02409     if ( firstchild ) {
02410 
02411       RefreshTreeItem( firstchild );
02412 
02413     } //if ( firstchild ) 
02414     else {
02415 
02416       TObject *inputobj =
02417         (TObject*)item->GetUserData();
02418 
02419       if ( inputobj ) {
02420 
02421         TPad *padsav = 0;
02422         if ( gPad && !( gROOT->GetListOfCanvases()->IsEmpty() ) )
02423           padsav = (TPad*) gPad;
02424       
02425         CObject *cobj = UpdateHistoList( item->GetText(), inputobj );
02426         if ( !cobj ) 
02427           fHistoListTree->DeleteItem( item );
02428         else
02429           fHistoListTree->SetToolTipItem( item, cobj->GetTitle() );
02430 
02431         if ( padsav ) padsav->cd();
02432 
02433       } //if ( inputobj )
02434 
02435     } //else //if ( firstchild )
02436 
02437     item = sibling;
02438 
02439     if ( !item &&
02440          parent && !( parent->GetFirstChild() ) )
02441       fHistoListTree->DeleteItem( parent );
02442 
02443   }  //while ( item ) 
02444 
02445   //fClient->NeedRedraw( fHistoListTree );
02446 
02447 }

void HistoDisplay::RemoveTGListTree (  )  [private]

Definition at line 2228 of file HistoDisplay.cxx.

References fHistoListTree, and fSelectedItem.

Referenced by ProcessMessage(), and ResetObjects().

02229 {
02230   TGListTreeItem *item;
02231   if ( fHistoListTree ) {
02232     while ( (item = fHistoListTree->GetFirstItem()) ) {
02233       fHistoListTree->DeleteItem( item );
02234     } //while ( (item = fHistoListTree->GetFirstItem()) )
02235     fClient->NeedRedraw(fHistoListTree);
02236     fSelectedItem = 0;
02237   }//if ( fHistoListTree ) 
02238 }

void HistoDisplay::ReplacePad ( TVirtualPad *  newpad,
TVirtualPad *  oldpad 
) [private]

Definition at line 3671 of file HistoDisplay.cxx.

References fDisplayedList, and CHistogram::SubtractedHisto().

03672 {
03673   // cout << " In ReplacePad " << endl;
03674 
03675   if ( !newpad || !oldpad ) return;
03676 
03677   TFrame *frame = newpad->GetFrame();
03678 
03679   TList *oldPrimitiveList = oldpad->GetListOfPrimitives();
03680   TList *newPrimitiveList = newpad->GetListOfPrimitives(); 
03681 
03682   TIter next( newPrimitiveList );
03683 
03684   TObject *obj;
03685   while( ( obj = next() ) ) {
03686 
03687       TObject *objOld = 
03688         oldPrimitiveList->FindObject( obj->GetName() );
03689       TObject *cobj =
03690         fDisplayedList->FindObject( obj->GetName() );
03691 
03692       if ( obj->InheritsFrom( TPad::Class() ) &&
03693            objOld &&
03694            objOld->InheritsFrom( TPad::Class() ) )
03695 
03696         ReplacePad( (TPad*)obj, (TPad*)objOld );
03697 
03698       else if ( obj->InheritsFrom( TH1::Class() ) 
03699                 && objOld
03700                 && objOld->InheritsFrom( TH1::Class() ) ) {
03701 
03702         TH1 *histo;
03703         TH1 *histoOld = (TH1*)objOld;
03704 
03705         if ( cobj && cobj->InheritsFrom( CHistogram::Class() ) ) {
03706           CHistogram *chisto = (CHistogram*)cobj;
03707           //chisto->SetTObject( obj );
03708           histo = chisto->SubtractedHisto();
03709         } //if ( cobj && cobj->InheritsFrom( CHistogram::Class() ) )
03710         else {
03711           histo = (TH1*)( obj->Clone() );
03712         } //else //if ( cobj && cobj->InheritsFrom( CHistogram::Class() ) )
03713 
03714         if ( histo && histoOld
03715              && ! obj->IsEqual( objOld )  ) {
03716           //tmp
03717           if ( ! oldpad->GetPadPaint() ) {
03718 
03719             histoOld->Reset();
03720             histoOld->Add( histo );
03721 
03722             TAxis *xaxis = histo->GetXaxis();
03723             if ( xaxis ) {
03724               char *title = new char[ strlen( xaxis->GetTitle() ) + 1 ];
03725               strcpy( title, xaxis->GetTitle() ); 
03726               histoOld->SetXTitle( title );
03727               delete [] title;
03728             } //if ( xaxis )
03729             TAxis *yaxis = histo->GetYaxis();
03730             if ( yaxis ) {
03731               char *title = new char[ strlen( yaxis->GetTitle() ) + 1 ];
03732               strcpy( title, yaxis->GetTitle() ); 
03733               histoOld->SetYTitle( title );
03734               delete [] title;
03735             } //if ( yaxis )
03736             TAxis *zaxis = histo->GetZaxis();
03737             if ( zaxis ) {
03738               char *title = new char[ strlen( zaxis->GetTitle() ) + 1 ];
03739               strcpy( title, zaxis->GetTitle() ); 
03740               histoOld->SetZTitle( title );
03741               delete [] title;
03742             } //if ( zaxis ) 
03743 
03744             delete histo;
03745             oldpad->Modified();
03746 
03747           } //if ( ! oldpad->GetPadPaint() )
03748           else
03749             cout << " Pad is being painted. Not updated. " << endl;
03750 
03751         } //if ( histo && histoOld )
03752 
03753       }  //else if ( obj->InheritsFrom( TH1::Class() ) && 
03754 
03755       //tmp
03756       // Should be comment out the following to avoid double TFrames.
03757       else {
03758 
03759         if ( !( frame->IsEqual( obj ) ) ) {
03760 
03761           //tmp
03762           if ( objOld ) {
03763                //&& !obj->IsEqual(objOld) ) {
03764             TObject *objtmp = oldPrimitiveList->Remove( objOld );
03765             if ( objtmp ) delete objOld;
03766           } //if ( objOld ) 
03767 
03768           oldpad->cd();
03769           obj->Clone()->Draw();
03770           oldpad->Modified();
03771 
03772         } //if ( !( frame->IsEqual( obj ) ) )
03773 
03774       } //else //if ( obj->InheritsFrom( TPad::Class() ) &&
03775 
03776   } //while ( obj = next() )
03777 
03778 
03779 }

void HistoDisplay::ResetObjects (  )  [private]

Definition at line 4423 of file HistoDisplay.cxx.

References CloseConnection(), fDisplayedList, and RemoveTGListTree().

Referenced by ProcessMessage(), and ~HistoDisplay().

04424 {
04425   //cout << " In ResetObjects " << endl;
04426 
04427   RemoveTGListTree();
04428 
04429   if ( fDisplayedList ) fDisplayedList->Delete();
04430 
04431   CloseConnection();
04432 }

void HistoDisplay::SearchWarningErrorFolder ( TGListTreeItem *  item,
TObject *  socket 
) [private]

Definition at line 2453 of file HistoDisplay.cxx.

References fHistoListTree, Nav::GetName(), kErrorFolder, kWarningErrorCanvasName, kWarningErrorCanvasTitle, kWarningFolder, PopUpSlides(), and strstrn().

Referenced by GetNewObj().

02454 {
02455   //cout << " In SearchWarningErrorFolder " << endl;
02456 
02457   while ( item ) {
02458 
02459     /*
02460       if ( ( strstr( item->GetText(), "warning" ) ||
02461              strstr( item->GetText(), "Warning" ) ||
02462              strstr( item->GetText(), "WARNING" ) ||
02463              strstr( item->GetText(), "error" ) ||
02464              strstr( item->GetText(), "Error" ) ||
02465              strstr( item->GetText(), "ERROR" )  ) &&
02466            ( socket->IsEqual( (TObject*) item->GetUserData() )  )  ) {
02467     */
02468 
02469     if ( ( ( strstrn( item->GetText(), kWarningFolder ) ) ||
02470            ( strstrn( item->GetText(), kErrorFolder ) ) ) &&
02471          //( socket->IsEqual( (TObject*) item->GetUserData() ) ) ) {
02472          ( !strcmp( socket->GetName(), 
02473                     ( (TObject*)item->GetUserData())->GetName() ) ) ) {
02474 
02475         //tmp
02476       //cout << "item->GetText()" << item->GetText() << endl;
02477 
02478 
02479         fHistoListTree->OpenItem( item );
02480 
02481         /*
02482         PopUpSlides( item,
02483                      "WarningErrorCanvas",
02484                      "Warning/Error Canvas" );
02485         */
02486 
02487 
02488         PopUpSlides( item,
02489                      kWarningErrorCanvasName,
02490                      kWarningErrorCanvasTitle );
02491 
02492       } //if ( strstr( item->GetText(), "warning" ) ||
02493 
02494 
02495     TGListTreeItem *sibling = item->GetNextSibling();
02496     TGListTreeItem *firstchild = item->GetFirstChild();
02497 
02498     if ( firstchild ) {
02499 
02500       SearchWarningErrorFolder( firstchild, socket );
02501 
02502     } //if ( firstchild ) 
02503 
02504     item = sibling;
02505 
02506   }  //while ( item ) 
02507 
02508 
02509 
02510 }

void HistoDisplay::SlideTimerOn ( TGListTreeItem *  item  )  [private]

Definition at line 3352 of file HistoDisplay.cxx.

03353 {
03354   //  cout << " In SlideTimerOn " << endl;
03355 
03356   //if ( !gPad || ( gROOT->GetListOfCanvases()->IsEmpty() ) ) return;
03357 
03358   /*
03359   Int_t sleeptime  = 0;
03360 
03361   sleeptime =  atoi( fFrequencyTextBuffer->GetString() );
03362 
03363   if ( fSlideTimer ) {
03364 
03365     fSlideTimer->SetTime( max( sleeptime, 2000 ) );
03366     //cout << " Timer Time = " << fSlideTimer->GetTime() << endl;
03367 
03368     //fSlideTimer->SetCurrentItem( fSelectedItem ); 
03369     fSlideTimer->SetCurrentItem( item ); 
03370 
03371     TVirtualPad *pad = 0;
03372     //if ( gPad && !gROOT->GetListOfCanvases()->IsEmpty() ) pad = gPad;
03373     if ( gROOT->GetListOfCanvases()->IsEmpty() ) gPad = 0;
03374     pad = gPad;
03375     fSlideTimer->SetCurrentPad( pad );
03376 
03377 
03378     if ( fUpdateTimer
03379          && ( fUpdateTimer->GetCurrentPad() == gPad )
03380          && !fUpdateTimer->HasTimedOut() )
03381       //if ( fUpdateTimer )
03382       fUpdateTimer->TurnOff();
03383 
03384 
03385 
03386     Running = kTRUE;
03387     fReadFileButton->ChangeBackground(Green);
03388     //  cout << "Button changed to green\n"; 
03389     gClient->NeedRedraw(fReadFileButton);
03390    fSlideTimer->TurnOn();
03391 
03392   } // if ( fSlideTimer ) {
03393 
03394   */
03395 }

void HistoDisplay::SortTGListTree (  )  [private]

Definition at line 2192 of file HistoDisplay.cxx.

References fHistoListTree.

Referenced by ProcessMessage().

02193 {
02194 
02195   if ( fHistoListTree->GetFirstItem() ) {
02196 
02197   TGListTreeItem *item;
02198   TGListTreeItem **list;
02199   int ichild = 0;
02200   int iparent = 0;
02201 
02202   const int itemmax = 200;
02203   list = new TGListTreeItem* [itemmax];
02204   list[ichild] = fHistoListTree->GetFirstItem();
02205 
02206   do
02207   {
02208     if ( fHistoListTree->SortChildren( list[iparent] ) ) {
02209       if ( (item = list[iparent]->GetFirstChild()) ) {
02210         list[++ichild] = item;
02211         while ( ( item =  list[ichild]->GetNextSibling() )
02212                 && ichild < itemmax ) list[++ichild] = item;
02213       }
02214     }
02215     iparent++;
02216 
02217   } while ( iparent <= ichild && ichild < itemmax );
02218   
02219   delete [] list;
02220 
02221   } //if ( fHistoListTree->GetFirstItem() )
02222 
02223   fClient->NeedRedraw(fHistoListTree);
02224 
02225 }

void HistoDisplay::StartSlides ( TGListTreeItem *  item  )  [private]

Definition at line 3321 of file HistoDisplay.cxx.

Referenced by PopUpSlides(), and ProcessMessage().

03322 {
03323   // cout << " In StartSlides " << endl;
03324   /*
03325   if ( selectedItem &&
03326        selectedItem->GetFirstChild() &&
03327        selectedItem->GetFirstChild()->GetNextSibling() &&
03328        selectedItem->IsOpen() ) {
03329 
03330     //Running = kTRUE;
03331 
03332     fPauseHistoButton->SetState( kButtonUp );
03333     fRestartHistoButton->SetState( kButtonDisabled );
03334   */
03335     /*
03336     //if ( fUpdateTimer && !fUpdateTimer->HasTimedOut() )
03337     if ( fUpdateTimer )
03338       fUpdateTimer->TurnOff();
03339     */
03340   /*
03341     //SlideTimerOn();
03342     SlideTimerOn( selectedItem );
03343 
03344   } //if ( selectedItem &&
03345   */
03346 
03347 }

void HistoDisplay::UpdateCanvas ( TVirtualPad *  currentpad = 0  )  [private]

Definition at line 3237 of file HistoDisplay.cxx.

References AutoUpdate, fSlideCanvasList, SlideShowUpdate, and UpdatePad().

Referenced by HistoDisplayUpdateTimer::Notify(), and ProcessMessage().

03237                                                          {
03238 
03239   //  cout << " In UpdateCanvas " << endl;
03240 
03241   if ( gPad && !( gROOT->GetListOfCanvases()->IsEmpty() ) ) {
03242 
03243     TCanvas *canvas = 0;
03244     static TObjLink *link = 0;
03245 
03246     TPad *gPadSav = (TPad*) gPad;
03247 
03248     if ( AutoUpdate &&
03249         SlideShowUpdate &&
03250         fSlideCanvasList &&
03251         !( fSlideCanvasList->IsEmpty() ) ) {
03252 
03253       if ( !link ) link = fSlideCanvasList->FirstLink();
03254 
03255       if ( link ) {
03256 
03257         TObject *ocanv = 0;
03258         if ( ( ocanv = link->GetObject() ) &&
03259              ( gROOT->GetListOfCanvases()->FindObject( ocanv ) ) &&
03260              ( ocanv->InheritsFrom( TCanvas::Class() ) ) ) {
03261           canvas = (TCanvas*) ocanv;
03262 
03263           //canvas->cd();
03264           UpdatePad( canvas );
03265 
03266           link = link->Next();
03267         } //if ( ( ocanv = link->GetObject() ) &&
03268         else {
03269           TObjLink *linktmp = link;
03270           link = link->Next();
03271           fSlideCanvasList->Remove( linktmp );
03272           return;
03273         } // else //if ( ( ocanv = link->GetObject() ) &&
03274 
03275       } //if ( link ) 
03276 
03277 
03278     } //if ( AutoUpdate &&
03279     else {
03280 
03281       link = 0;
03282       //canvas = gPad->GetCanvas();
03283 
03284       if ( !currentpad ||
03285            !gROOT->GetListOfCanvases()->FindObject( currentpad ) )
03286         currentpad = gPadSav;
03287 
03288       UpdatePad( currentpad );
03289 
03290       //      canvas = currentpad->GetCanvas();  DP
03291 
03292     } //else //if ( AutoUpdate && 
03293 
03294     /*
03295     if ( canvas ) {
03296       TCanvasImp *canvasimp = canvas->GetCanvasImp();
03297       if ( canvasimp ) canvasimp->Show();
03298     } // if ( canvas ) 
03299     */
03300 
03301     //TPad *gpad = (TPad*) gPad;
03302     //UpdatePad( gpad );
03303 
03304 
03305     delete canvas;
03306     delete link;
03307     //    cout << gROOT->GetListOfCanvases()->GetSize();
03308   
03309 
03310      gPadSav->cd();
03311      // delete gPadSav;
03312   } //if( gPad && !( gROOT->GetListOfCanvases()->IsEmpty() ) ) 
03313 
03314 
03315 }

CObject * HistoDisplay::UpdateHistoList ( const char *  objName,
const TObject *  inputobj 
) [private]

Definition at line 3824 of file HistoDisplay.cxx.

References AddPadHistosToHistoList(), fDisplayedList, CObject::GetInputSource(), GetNewObj(), CObject::SetInputSource(), and CObject::SetTObject().

Referenced by DrawUpdatedPad(), GetCObjFromListItem(), and RefreshTreeItem().

03825 {
03826   //cout << " In UpdateHistoList " << endl;
03827   //cout << " updating " << objName << endl;
03828 
03829   /*
03830   if ( !inputobj ) {
03831     cout << " Input Object is not set. " << endl; 
03832     return 0;
03833   }
03834   */
03835 
03836   //const char *path = gROOT->GetPath(); 
03837   TVirtualPad *padsav = 0;
03838   if ( gPad && !gROOT->GetListOfCanvases()->IsEmpty() ) padsav = gPad;
03839 
03840 
03841 
03842   TObject *obj = GetNewObj( objName, inputobj );
03843   CObject *cobj = 0; 
03844 
03845   if ( obj ) {
03846 
03847     TObject *objold = fDisplayedList->FindObject( objName );
03848 
03849     /*
03850     TObjLink *lnk = fDisplayedList->FirstLink();
03851     while (lnk) {
03852       TObject *objtmp = lnk->GetObject();
03853       if (objtmp && 
03854           objtmp->GetName() && !strcmp(objName, objtmp->GetName())) {
03855 
03856         if ( objtmp->InheritsFrom( CObject::Class() ) ) {
03857           CObject *cobjtmp = (CObject*)objtmp;
03858           TObject *inputtmp = cobjtmp->GetInputSource();
03859           if ( ( inputtmp && inputtmp->GetName() ) &&
03860                ( inputobj && inputobj->GetName() ) &&
03861                ( !strcmp( inputtmp->GetName(),
03862                           inputobj->GetName() ) ) ) {
03863             //objold = objtmp;
03864             cobj = cobjtmp;
03865             cobj->SetTObject( obj );
03866             if ( cobj->GetInputSource() != inputobj )
03867               cobj->SetInputSource( inputobj );
03868               
03869           } //if ( ( inputtmp && inputtmp->GetName() ) &&
03870 
03871 
03872         }//if ( objtmp->InheritsFrom( CObject::Class() ) ) 
03873 
03874 
03875       } //if ( objtmp && objtmp->GetName() && ... )
03876 
03877       lnk = lnk->Next();
03878     } //while (lnk) 
03879 
03880     */
03881 
03882 
03883     if ( objold && objold->InheritsFrom( CObject::Class() ) ) {
03884 
03885       cobj = (CObject*) objold;
03886 
03887       if ( cobj ) {
03888         cobj->SetTObject( obj );
03889         //if ( cobj->GetInputSource() != inputobj )
03890         if ( inputobj != cobj->GetInputSource()  ) {
03891           cobj->SetInputSource( inputobj );
03892           //tmp
03893           //cout << " InputObj is updated. " << endl;
03894         } // if ( inputobj != cobj->GetInputSource()  )  
03895       } // if ( cobj )
03896 
03897     } //if ( objold && objold->InheritsFrom( CObject::Class() ) )
03898 
03899     else {
03900 
03901       //if ( !cobj ) {
03902 
03903       if ( obj->InheritsFrom(TH1::Class()) ) {
03904 
03905         CHistogram *cobjnew =
03906           new CHistogram( (TH1*)obj, inputobj, 0, 0 );
03907 
03908                         fDisplayedList->Add( cobjnew );
03909 
03910         cobj = cobjnew;
03911 
03912       } //if ( obj->InheritsFrom(TH1::Class()) )
03913       else {
03914 
03915         CObject *cobjnew =
03916           new CObject( obj, inputobj );
03917 
03918                         fDisplayedList->Add( cobjnew );
03919 
03920         cobj = cobjnew;
03921 
03922       } // else //if ( obj->InheritsFrom(TH1::Class()) )
03923 
03924       //} // if ( !cobj ) 
03925 
03926 
03927     } //else //if ( objold && objold->InheritsFrom( CObject::Class() ) )
03928 
03929         if ( obj->InheritsFrom( TPad::Class() ) )
03930         AddPadHistosToHistoList( (TPad*)obj );
03931 
03932   } //if ( obj )
03933 
03934   else {
03935 
03936     //tmp
03937     /*
03938     if ( objold && objold->InheritsFrom( CObject::Class() ) ) 
03939       cobj = (CObject*) objold;
03940     */
03941     //tmp
03942     //cout << " obj is not got from the input stream. " << endl;
03943 
03944   } //else //if(obj)
03945 
03946   //tmp
03947   if ( !cobj ) cout << " Not updated. " << endl;
03948 
03949 
03950   //gROOT->Cd( path );
03951   if ( padsav ) padsav->cd(); 
03952 
03953 
03954   return cobj;
03955 
03956 }

void HistoDisplay::UpdatePad ( TVirtualPad *  pad  )  [private]

Definition at line 3517 of file HistoDisplay.cxx.

References DrawUpdatedPad().

Referenced by UpdateCanvas().

03518 {
03519   //cout << " In UpdatePad " << endl;
03520 
03521   if ( !pad ) return;
03522 
03523   DrawUpdatedPad( pad );
03524   pad->cd();
03525   pad->Modified();
03526   pad->Update();
03527 
03528 }

void HistoDisplay::UpdateTimerOn (  )  [private]

Definition at line 3163 of file HistoDisplay.cxx.

References AutoUpdate, fFrequencyTextBuffer, fUpdateTimer, max, Running, and HistoDisplayUpdateTimer::SetCurrentPad().

Referenced by ProcessMessage().

03164 {
03165   //cout << " In UpdateTimerOn " << endl;
03166 
03167   TVirtualPad *currentPad;
03168 
03169   if ( !gPad || ( gROOT->GetListOfCanvases()->IsEmpty() ) )
03170     return;
03171   else
03172     currentPad = gPad;
03173 
03174 
03175   Int_t sleeptime  = 0;
03176 
03177   if ( AutoUpdate ) {
03178 
03179     sleeptime =  atoi( fFrequencyTextBuffer->GetString() );
03180 
03181     if ( fUpdateTimer ) {
03182       fUpdateTimer->SetTime( max( sleeptime, 800 ) );
03183       //cout << " Timer Time = " << fUpdateTimer->GetTime() << endl;
03184 
03185       fUpdateTimer->SetCurrentPad( currentPad );
03186 
03187       Running = kTRUE;
03188 //      fReadFileButton->ChangeBackground(Green);
03189       fUpdateTimer->TurnOn();
03190 
03191       //return;
03192     } //if ( fUpdateTimer )
03193 
03194   } //if ( AutoUpdate )
03195 
03196 
03197   //cout << "Update done" << endl << endl;
03198 
03199 }


Friends And Related Function Documentation

friend class HistoDisplaySlideTimer [friend]

Definition at line 80 of file HistoDisplay.h.

friend class HistoDisplayUpdateTimer [friend]

Definition at line 79 of file HistoDisplay.h.


Member Data Documentation

Bool_t HistoDisplay::AutoUpdate [private]
TString HistoDisplay::CanvasName [private]

Definition at line 396 of file HistoDisplay.h.

Referenced by DrawHisto(), and ProcessMessage().

Int_t HistoDisplay::CanvasNumber [private]

Definition at line 398 of file HistoDisplay.h.

Referenced by DrawHisto(), and ProcessMessage().

TString HistoDisplay::CanvasTitle [private]

Definition at line 397 of file HistoDisplay.h.

Referenced by DrawHisto(), and ProcessMessage().

Definition at line 275 of file HistoDisplay.h.

Referenced by CloseMenuBar(), and MenuConnectStatus().

TGCompositeFrame* HistoDisplay::fButtonFrame [private]

Definition at line 215 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGLayoutHints* HistoDisplay::fButtonFrameLayout [private]

Definition at line 216 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGLayoutHints* HistoDisplay::fButtonLayout [private]

Definition at line 217 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGCheckButton* HistoDisplay::fChButtonAutoUpdate [private]

Definition at line 198 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), MakeTGListTreeFrame(), and ProcessMessage().

TGLayoutHints* HistoDisplay::fChButtonAutoUpdateLayout [private]

Definition at line 199 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGCheckButton* HistoDisplay::fChButtonSlideUpdate [private]
TGTextButton* HistoDisplay::fChooseFileButton [private]

Definition at line 170 of file HistoDisplay.h.

Referenced by CloseInputFrame(), and MakeInputFrame().

TGTextButton* HistoDisplay::fClearFileNameButton [private]

Definition at line 171 of file HistoDisplay.h.

Referenced by CloseInputFrame(), and MakeInputFrame().

TGTextButton* HistoDisplay::fClearHistoButton [private]

Definition at line 222 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGPopupMenu* HistoDisplay::fConnectMenu [private]

Definition at line 100 of file HistoDisplay.h.

Referenced by CloseMenuBar(), and MakeMenuBar().

TGTextButton* HistoDisplay::fContentHistoButton [private]

Definition at line 236 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGCompositeFrame* HistoDisplay::fControlButtonFrame [private]

Definition at line 211 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGLayoutHints* HistoDisplay::fControlButtonFrameLayout [private]

Definition at line 212 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TList* HistoDisplay::fDisplayedList [private]
TGPopupMenu* HistoDisplay::fFileMenu [private]

Definition at line 96 of file HistoDisplay.h.

Referenced by CloseMenuBar(), and MakeMenuBar().

TGTextBuffer* HistoDisplay::fFileNameBuffer [private]

Definition at line 163 of file HistoDisplay.h.

Referenced by FileNameClear(), MakeInputFrame(), and ProcessMessage().

TGCompositeFrame* HistoDisplay::fFileNameButtonFrame [private]

Definition at line 167 of file HistoDisplay.h.

Referenced by CloseInputFrame(), and MakeInputFrame().

TGLayoutHints* HistoDisplay::fFileNameButtonFrameLayout [private]

Definition at line 168 of file HistoDisplay.h.

Referenced by CloseInputFrame(), and MakeInputFrame().

TGLayoutHints* HistoDisplay::fFileNameButtonLayout [private]

Definition at line 169 of file HistoDisplay.h.

Referenced by CloseInputFrame(), and MakeInputFrame().

TGGroupFrame* HistoDisplay::fFileNameFrame [private]

Definition at line 142 of file HistoDisplay.h.

Referenced by CloseInputFrame(), and MakeInputFrame().

TGLayoutHints* HistoDisplay::fFileNameFrameLayout [private]

Definition at line 143 of file HistoDisplay.h.

Referenced by CloseInputFrame(), and MakeInputFrame().

TGLabel* HistoDisplay::fFileNameLabel [private]

Definition at line 157 of file HistoDisplay.h.

Referenced by CloseInputFrame(), and MakeInputFrame().

TGLayoutHints* HistoDisplay::fFileNameLayout [private]

Definition at line 156 of file HistoDisplay.h.

Referenced by CloseInputFrame(), and MakeInputFrame().

TGTextEntry* HistoDisplay::fFileNameTextEntry [private]

Definition at line 162 of file HistoDisplay.h.

Referenced by CloseInputFrame(), FileNameClear(), MakeInputFrame(), and ProcessMessage().

TGCompositeFrame* HistoDisplay::fFileOpenFrame [private]

Definition at line 159 of file HistoDisplay.h.

Referenced by CloseInputFrame(), and MakeInputFrame().

TGLayoutHints* HistoDisplay::fFileOpenFrameLayout [private]

Definition at line 160 of file HistoDisplay.h.

Referenced by CloseInputFrame(), and MakeInputFrame().

TGCompositeFrame* HistoDisplay::fFrequencyFrame [private]

Definition at line 203 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGLayoutHints* HistoDisplay::fFrequencyFrameLayout [private]

Definition at line 204 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGLabel* HistoDisplay::fFrequencyLabel [private]

Definition at line 206 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGTextBuffer* HistoDisplay::fFrequencyTextBuffer [private]

Definition at line 208 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), MakeTGListTreeFrame(), and UpdateTimerOn().

TGTextEntry* HistoDisplay::fFrequencyTextEntry [private]

Definition at line 207 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGPopupMenu* HistoDisplay::fHelpMenu [private]

Definition at line 101 of file HistoDisplay.h.

Referenced by CloseMenuBar(), and MakeMenuBar().

TGCompositeFrame* HistoDisplay::fHistoButtonFrame [private]

Definition at line 230 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGLayoutHints* HistoDisplay::fHistoButtonFrameLayout [private]

Definition at line 231 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGGroupFrame* HistoDisplay::fHistoButtonGFrame [private]

Definition at line 228 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGLayoutHints* HistoDisplay::fHistoButtonGFrameLayout [private]

Definition at line 229 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGLayoutHints* HistoDisplay::fHistoButtonLayout [private]

Definition at line 232 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TList* HistoDisplay::fHistoList [private]
TGCompositeFrame* HistoDisplay::fHistoListFrame [private]

Definition at line 188 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGLayoutHints* HistoDisplay::fHistoListFrameLayout [private]

Definition at line 189 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGListTree* HistoDisplay::fHistoListTree [private]
TString HistoDisplay::FileName [private]

Definition at line 272 of file HistoDisplay.h.

Referenced by ProcessMessage().

TGCompositeFrame* HistoDisplay::fListButtonFrame [private]

Definition at line 195 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGLayoutHints* HistoDisplay::fListButtonFrameLayout [private]

Definition at line 196 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGCompositeFrame* HistoDisplay::fListTreeMainFrame [private]

Definition at line 179 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGLayoutHints* HistoDisplay::fListTreeMainFrameLayout [private]

Definition at line 180 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGPopupMenu* HistoDisplay::fListTreeMenu [private]

Definition at line 98 of file HistoDisplay.h.

Referenced by CloseMenuBar(), and MakeMenuBar().

TGCompositeFrame* HistoDisplay::fMainFrame [private]
TGLayoutHints* HistoDisplay::fMainFrameLayout [private]

Definition at line 111 of file HistoDisplay.h.

Referenced by ~HistoDisplay().

TGMenuBar* HistoDisplay::fMenuBar [private]

Definition at line 92 of file HistoDisplay.h.

Referenced by CloseMenuBar(), and MakeMenuBar().

TGLayoutHints* HistoDisplay::fMenuBarHelpLayout [private]

Definition at line 95 of file HistoDisplay.h.

Referenced by CloseMenuBar(), and MakeMenuBar().

TGLayoutHints* HistoDisplay::fMenuBarItemLayout [private]

Definition at line 94 of file HistoDisplay.h.

Referenced by CloseMenuBar(), and MakeMenuBar().

TGLayoutHints* HistoDisplay::fMenuBarLayout [private]

Definition at line 93 of file HistoDisplay.h.

Referenced by CloseMenuBar(), and MakeMenuBar().

TGHorizontal3DLine* HistoDisplay::fMenuBarSeparator [private]

Definition at line 103 of file HistoDisplay.h.

Referenced by CloseMenuBar(), and MakeMenuBar().

TGLayoutHints* HistoDisplay::fMenuBarSeparatorLayout [private]

Definition at line 104 of file HistoDisplay.h.

Referenced by CloseMenuBar(), and MakeMenuBar().

TGTextBuffer* HistoDisplay::fMonitorNameBuffer [private]

Definition at line 185 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGLabel* HistoDisplay::fMonitorNameLabel [private]

Definition at line 183 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGLayoutHints* HistoDisplay::fMonitorNameLayout [private]

Definition at line 182 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGTextEntry* HistoDisplay::fMonitorNameTextEntry [private]

Definition at line 184 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGTextButton* HistoDisplay::fNewCanvasButton [private]

Definition at line 224 of file HistoDisplay.h.

Referenced by MakeTGListTreeFrame().

TGPopupMenu* HistoDisplay::fNewCascadeMenu [private]

Definition at line 97 of file HistoDisplay.h.

Referenced by CloseMenuBar(), and MakeMenuBar().

TGTextButton* HistoDisplay::fPauseHistoButton [private]
TGPictureButton* HistoDisplay::fPicBut [private]

Definition at line 132 of file HistoDisplay.h.

Referenced by CloseTitleFrame(), and MakeTitleFrame().

TGLayoutHints* HistoDisplay::fPictLayout [private]

Definition at line 133 of file HistoDisplay.h.

Referenced by CloseTitleFrame(), and MakeTitleFrame().

Int_t HistoDisplay::fport [private]

Definition at line 86 of file HistoDisplay.h.

Referenced by MakeInputFrame(), and ProcessMessage().

char* HistoDisplay::fPrinter [private]

Definition at line 444 of file HistoDisplay.h.

Definition at line 445 of file HistoDisplay.h.

TGTextButton* HistoDisplay::fPrintHistoButton [private]

Definition at line 448 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGLayoutHints* HistoDisplay::fRaButLayout [private]

Definition at line 148 of file HistoDisplay.h.

Referenced by CloseInputFrame(), and MakeInputFrame().

TGRadioButton* HistoDisplay::fRaButMFile [private]

Definition at line 145 of file HistoDisplay.h.

Referenced by CloseInputFrame(), FileDialogWindow(), MakeInputFrame(), and ProcessMessage().

TGRadioButton* HistoDisplay::fRaButRFile [private]

Definition at line 146 of file HistoDisplay.h.

Referenced by CloseInputFrame(), FileDialogWindow(), MakeInputFrame(), and ProcessMessage().

TGRadioButton* HistoDisplay::fRaButSocket [private]

Definition at line 147 of file HistoDisplay.h.

Referenced by CloseInputFrame(), FileDialogWindow(), MakeInputFrame(), and ProcessMessage().

TGTextButton* HistoDisplay::fReadFileButton [private]
TGTextButton* HistoDisplay::fRestartHistoButton [private]
TGListTreeItem* HistoDisplay::fSelectedItem [private]

Definition at line 420 of file HistoDisplay.h.

Referenced by PopUpSlides(), ProcessMessage(), and ~HistoDisplay().

const char* HistoDisplay::fsocketserver [private]

Definition at line 85 of file HistoDisplay.h.

Referenced by MakeInputFrame(), and ProcessMessage().

TGPopupMenu* HistoDisplay::fSortCascadeMenu [private]

Definition at line 99 of file HistoDisplay.h.

Referenced by CloseMenuBar(), and MakeMenuBar().

TGTextButton* HistoDisplay::fStartHistoButton [private]

Definition at line 219 of file HistoDisplay.h.

TGStatusBar* HistoDisplay::fStatusBar [private]

Definition at line 242 of file HistoDisplay.h.

Referenced by CloseStatusBar(), MakeStatusBar(), and ProcessMessage().

TGTextButton* HistoDisplay::fStopHistoButton [private]

Definition at line 223 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

GContext_t HistoDisplay::fTextGC [private]

Definition at line 131 of file HistoDisplay.h.

Referenced by CloseTitleFrame(), and MakeTitleFrame().

TGCanvas* HistoDisplay::fTGCanvas [private]

Definition at line 191 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGLayoutHints* HistoDisplay::fTGCanvasLayout [private]

Definition at line 192 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

TGCompositeFrame* HistoDisplay::fTitleFrame [private]

Definition at line 127 of file HistoDisplay.h.

Referenced by CloseTitleFrame(), and MakeTitleFrame().

TGLayoutHints* HistoDisplay::fTitleFrameLayout [private]

Definition at line 128 of file HistoDisplay.h.

Referenced by CloseTitleFrame(), and MakeTitleFrame().

TGLabel* HistoDisplay::fTitleLabel [private]

Definition at line 129 of file HistoDisplay.h.

Referenced by CloseTitleFrame(), and MakeTitleFrame().

TGLayoutHints* HistoDisplay::fTitleLabelLayout [private]

Definition at line 130 of file HistoDisplay.h.

Referenced by CloseTitleFrame(), and MakeTitleFrame().

TGTextButton* HistoDisplay::fUnZeroHistoButton [private]

Definition at line 235 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

Definition at line 404 of file HistoDisplay.h.

Referenced by ProcessMessage(), UpdateTimerOn(), and ~HistoDisplay().

TGTextButton* HistoDisplay::fZeroHistoButton [private]

Definition at line 234 of file HistoDisplay.h.

Referenced by CloseTGListTreeFrame(), and MakeTGListTreeFrame().

ULong_t HistoDisplay::Green [private]

Definition at line 119 of file HistoDisplay.h.

Referenced by HistoDisplaySlideTimer::Notify(), and ProcessMessage().

ULong_t HistoDisplay::LightYellow [private]

Definition at line 117 of file HistoDisplay.h.

Referenced by MakeInputFrame(), and MakeTGListTreeFrame().

TString HistoDisplay::MonitorName [private]

Definition at line 271 of file HistoDisplay.h.

Referenced by GetDirPath().

ULong_t HistoDisplay::Red [private]

Definition at line 118 of file HistoDisplay.h.

Referenced by GetNewObj(), MakeInputFrame(), and ProcessMessage().

Bool_t HistoDisplay::Running [private]

Definition at line 390 of file HistoDisplay.h.

Referenced by GetNewObj(), MakeTGListTreeFrame(), ProcessMessage(), and UpdateCanvas().


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1