16 #include <TCollection.h>
17 #include <TApplication.h>
18 #include <TEveWindow.h>
26 #include <TGStatusBar.h>
27 #include <KeySymbols.h>
66 FWPack(
const TGWindow*
w) : TGPack(w, 100, 100) {}
84 const unsigned int backgroundColor=0x2f2f2f;
85 const unsigned int textColor= 0xb3b3b3;
149 previousEvent->
setToolTip(
"Goto previous event");
152 playEventsBack->
setToolTip(
"Play events backwards");
154 TGCompositeFrame *menuTopFrame =
new TGCompositeFrame(
this, 1, 1, kHorizontalFrame, backgroundColor);
156 TGMenuBar *menuBar =
new TGMenuBar(menuTopFrame, this->GetWidth(), 28, kHorizontalFrame);
158 TGPopupMenu *fileMenu =
new TGPopupMenu(gClient->GetRoot());
159 menuBar->AddPopup(
"File", fileMenu,
new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 2, 0));
166 fileMenu->AddSeparator();
172 TGPopupMenu* partialSaveMenu =
new TGPopupMenu(gClient->GetRoot());
173 fileMenu->AddPopup(
"Advanced Configuration", partialSaveMenu);
178 fileMenu->AddSeparator();
182 fileMenu->AddSeparator();
197 savePartialConfigAs->
createShortcut(kKey_Y,
"CTRL+SHIFT", GetId());
199 TGPopupMenu *editMenu =
new TGPopupMenu(gClient->GetRoot());
200 menuBar->AddPopup(
"Edit", editMenu,
new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 2, 0));
206 editMenu->AddSeparator();
212 editMenu->AddSeparator();
221 TGPopupMenu *viewMenu =
new TGPopupMenu(gClient->GetRoot());
222 menuBar->AddPopup(
"View", viewMenu,
new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 2, 0));
227 viewMenu->AddSeparator();
238 playEventsBack->
createShortcut(kKey_Space,
"CTRL+SHIFT", GetId());
241 TGPopupMenu* windowMenu =
new TGPopupMenu(gClient->GetRoot());
242 menuBar->AddPopup(
"Window", windowMenu,
new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 2, 0));
252 TGPopupMenu *helpMenu =
new TGPopupMenu(gClient->GetRoot());
253 menuBar->AddPopup(
"Help", helpMenu,
new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 2, 0));
256 helpMenu->AddSeparator();
260 menuBar->SetBackgroundColor(backgroundColor);
261 TIter
next(menuBar->GetTitles());
263 while ((title = (TGMenuTitle *)
next()))
264 title->SetTextColor(textColor);
266 menuTopFrame->AddFrame(menuBar,
new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
267 AddFrame(menuTopFrame,
new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
271 AddFrame(
new TGFrame(
this, 1, 1, kChildFrame, 0x503020),
272 new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
274 m_statBar =
new TGStatusBar(
this, this->GetWidth(), 12);
275 AddFrame(
m_statBar,
new TGLayoutHints(kLHintsBottom | kLHintsExpandX));
277 TGHorizontalFrame *fullbar =
new TGHorizontalFrame(
this, this->GetWidth(), 30,0, backgroundColor);
282 TGCompositeFrame* controlFrame =
new TGVerticalFrame(fullbar, 10, 20, 0, backgroundColor);
284 TGCompositeFrame* buttonFrame =
new TGHorizontalFrame(controlFrame, 10, 10, 0, backgroundColor);
286 buttonFrame->SetBackgroundPixmap(imgBtn->GetPixmap());
293 new TGLayoutHints(kLHintsCenterY| kLHintsLeft, 4, 3, 10, 0));
301 new TGLayoutHints(kLHintsCenterY| kLHintsLeft, 2, 3, 10, 0));
307 new TGLayoutHints(kLHintsCenterY| kLHintsLeft, 2, 3, 10, 0));
313 new TGLayoutHints(kLHintsCenterY| kLHintsLeft, 2, 3, 10, 0));
322 new TGLayoutHints(kLHintsCenterY| kLHintsLeft, 2, 3, 10, 0));
328 new TGLayoutHints(kLHintsCenterY| kLHintsLeft, 2, 3, 10, 0));
330 controlFrame->AddFrame(buttonFrame,
new TGLayoutHints(kLHintsTop, 10, 0, 0, 0));
334 TGHorizontalFrame* sliderFrame =
new TGHorizontalFrame(controlFrame, 10, 10, 0, backgroundColor);
336 sliderFrame->SetBackgroundPixmap(imgSld->GetPixmap());
339 m_delaySlider =
new TGHSlider(sliderFrame, 109, kSlider1 | kScaleNo);
340 sliderFrame->AddFrame(
m_delaySlider,
new TGLayoutHints(kLHintsTop | kLHintsLeft, 39, 8, 1, 3));
346 controlFrame->AddFrame(sliderFrame,
new TGLayoutHints(kLHintsTop, 10, 0, 0, 0));
348 fullbar->AddFrame(controlFrame,
new TGLayoutHints(kLHintsLeft, 2, 2, 5, 8));
357 TGVerticalFrame* delayFrame =
new TGVerticalFrame(fullbar, 60, 10, 0, backgroundColor);
359 TGLabel *
label =
new TGLabel(delayFrame,
"Delay");
360 label->SetTextJustify(kTextCenterX);
361 label->SetTextColor(0xb3b3b3);
362 label->SetBackgroundColor(backgroundColor);
363 delayFrame->AddFrame(label,
new TGLayoutHints(kLHintsTop | kLHintsCenterX, 0, 0, 22, 0));
365 TGHorizontalFrame *labFixed =
new TGHorizontalFrame(delayFrame, 70, 20, kFixedSize, backgroundColor);
370 labFixed->AddFrame(
m_delayLabel,
new TGLayoutHints(kLHintsTop | kLHintsCenterX | kLHintsExpandX, 0, 0, 0, 0));
371 delayFrame->AddFrame(labFixed,
new TGLayoutHints(kLHintsLeft, 0, 4, 0, 0));
373 fullbar->AddFrame(delayFrame,
new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
380 Int_t entryHeight = 22;
381 TGVerticalFrame *texts =
new TGVerticalFrame(fullbar, 400, 10, 0, backgroundColor);
385 TGPack *runInfo =
new TGPack(texts, 400, entryHeight, kFixedHeight);
386 runInfo->SetVertical(kFALSE);
387 runInfo->SetUseSplitters(kFALSE);
388 runInfo->SetBackgroundColor(backgroundColor);
390 TGHorizontalFrame *rLeft =
new TGHorizontalFrame(runInfo, 1, entryHeight);
393 rLeft->AddFrame(
m_runEntry,
new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 0,8,0,0));
394 runInfo->AddFrameWithWeight(rLeft, 0, 0.28);
396 TGHorizontalFrame *rMid =
new TGHorizontalFrame(runInfo, 1, entryHeight);
399 rMid->AddFrame(
m_lumiEntry,
new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 0,8,0,0));
400 runInfo->AddFrameWithWeight(rMid, 0, 0.32);
402 TGHorizontalFrame *rRight =
new TGHorizontalFrame(runInfo, 1, entryHeight);
405 rRight->AddFrame(
m_eventEntry,
new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 0,0,0,0));
406 runInfo->AddFrameWithWeight(rRight, 0, 0.4);
408 texts->AddFrame(runInfo,
new TGLayoutHints(kLHintsTop | kLHintsExpandX, 0,0,0,4));
413 TGHorizontalFrame *filterFrame =
new TGHorizontalFrame(texts, 400, entryHeight, 0, backgroundColor);
418 m_filterIcons[2] = fClient->GetPicture(
"unchecked_dis_t.xpm");
433 filterFrame->AddFrame(
m_filterEnableBtn,
new TGLayoutHints(kLHintsLeft, 4,0,3,0));
440 filterFrame->AddFrame(
m_filterShowGUIBtn,
new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 6,7,0,0));
442 texts->AddFrame(filterFrame,
new TGLayoutHints(kLHintsTop | kLHintsExpandX, 0,0,4,0));
445 fullbar->AddFrame(texts,
new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 5, 5, 12, 0));
449 TGVerticalFrame *texts2 =
new TGVerticalFrame(fullbar, 200, 44, kFixedSize, backgroundColor);
455 m_timeText->SetBackgroundColor(backgroundColor);
456 texts2->AddFrame(
m_timeText,
new TGLayoutHints(kLHintsTop | kLHintsExpandX, 0,0,0,1));
458 fullbar->AddFrame(texts2,
new TGLayoutHints(kLHintsLeft, 5, 5, 16, 5));
464 TGVerticalFrame* parentLogoFrame =
new TGVerticalFrame(fullbar, 70, 53, kFixedSize);
465 parentLogoFrame->SetBackgroundColor(backgroundColor);
466 fullbar->AddFrame(parentLogoFrame,
new TGLayoutHints(kLHintsRight | kLHintsCenterY));
468 TGVerticalFrame* logoFrame =
new TGVerticalFrame(parentLogoFrame, 53, 53, kFixedSize);
470 logoFrame->SetBackgroundPixmap(logoImg->GetPixmap());
471 parentLogoFrame->AddFrame(logoFrame,
new TGLayoutHints(kLHintsRight | kLHintsCenterY, 0, 14, 0, 0));
474 TGCompositeFrame *logoFrame =
new TGCompositeFrame(
this, 61, 23, kFixedSize | kHorizontalFrame, backgroundColor);
480 logoFrame->AddFrame(infoBut);
481 infoBut->Connect(
"Clicked()",
"CmsShowMainFrame",
this,
"showFWorksInfo()");
484 menuTopFrame->AddFrame(logoFrame,
new TGLayoutHints(kLHintsRight | kLHintsBottom, 0, 13, 3, 1));
489 AddFrame(fullbar,
new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
512 csArea->SetVertical(kFALSE);
515 csArea->AddFrameWithWeight(cf, 0, 20);
517 TEveCompositeFrameInPack *slot =
new TEveCompositeFrameInPack(csArea, 0, csArea);
518 csArea->AddFrameWithWeight(slot, 0, 80);
519 TEveWindowSlot *ew_slot = TEveWindow::CreateDefaultWindowSlot();
520 ew_slot->PopulateEmptyFrame(slot);
523 AddFrame(csArea,
new TGLayoutHints(kLHintsTop | kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 2));
524 csArea->MapSubwindows();
526 SetWindowName(
"cmsShow");
679 gApplication->Terminate(0);
690 if (event->fType == kGKeyPress) {
692 std::vector<CSGAction*>::const_iterator it_act;
695 for (it_act = alist.begin(); it_act != alist.end(); ++it_act) {
696 keycode = (*it_act)->getKeycode();
697 modcode = (*it_act)->getModcode();
698 if ((event->fCode == (UInt_t)keycode) &&
699 ((event->fState == (UInt_t)modcode) ||
700 (event->fState == (UInt_t)(modcode | kKeyMod2Mask)) ||
701 (event->fState == (UInt_t)(modcode | kKeyLockMask)) ||
702 (event->fState == (UInt_t)(modcode | kKeyMod2Mask | kKeyLockMask)))) {
703 (*it_act)->activated.emit();
710 static UInt_t spacecode = gVirtualX->KeysymToKeycode((
int)kKey_Space);
711 if (event->fCode == spacecode && event->fState == 0 ) {
731 UInt_t bgCol, UInt_t txtCol,
732 Int_t
width, Int_t height)
737 p->SetBackgroundColor(bgCol);
738 TGCompositeFrame *lframe =
new TGHorizontalFrame(p, width, height, kFixedSize, bgCol);
739 TGLabel*
label =
new TGLabel(lframe, txt);
740 label->SetBackgroundColor(bgCol);
741 label->SetTextColor(txtCol);
742 lframe->AddFrame(label,
new TGLayoutHints(kLHintsRight | kLHintsTop, 0, 4));
743 p->AddFrame(lframe,
new TGLayoutHints(kLHintsLeft, 0, 0, 3, 0));
748 InfoFrame(
const TGWindow*
p, UInt_t
w, UInt_t
h, UInt_t
opts) : TGMainFrame(p, w, h, opts) {}
762 UInt_t ww = 280, hh = 190;
763 int number_of_lines = 0;
766 if (gSystem->Getenv(
"CMSSW_VERSION"))
768 infoText =
"Version ";
769 infoText += gSystem->Getenv(
"CMSSW_VERSION");
771 number_of_lines += 1;
775 TString infoFileName(
"/data/version.txt");
778 std::ifstream infoFile(infoFileName);
779 while (std::getline(infoFile, line))
782 infoText += line.c_str();
787 infoText +=
"\nIt works or we fix it for free!\nhn-cms-visualization@cern.ch\n";
789 hh = 130 + 2* fontSize*(number_of_lines + 1);
792 m_fworksAbout->SetWMSizeHints(ww, hh, ww, hh, 0, 0);
793 m_fworksAbout->SetBackgroundColor(0x2f2f2f);
795 TGFrame* logoFrame =
new TGFrame(m_fworksAbout, 140, 48, kFixedSize);
797 logoFrame->SetBackgroundPixmap(logoImg->GetPixmap());
798 m_fworksAbout->AddFrame(logoFrame,
new TGLayoutHints(kLHintsTop | kLHintsCenterX, 0, 0, 16, 0));
800 TGLabel*
label =
new TGLabel(m_fworksAbout, infoText);
801 label->SetBackgroundColor(0x2f2f2f);
802 label->SetForegroundColor(0xffffff);
804 FontStruct_t defaultFontStruct = label->GetDefaultFontStruct();
807 TGFontPool *
pool = gClient->GetFontPool();
808 TGFont* defaultFont = pool->GetFont(defaultFontStruct);
809 FontAttributes_t
attributes = defaultFont->GetFontAttributes();
810 label->SetTextFont(pool->GetFont(attributes.fFamily, fontSize,
811 attributes.fWeight, attributes.fSlant));
817 m_fworksAbout->AddFrame(label,
new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 0, 0, 12, 0));
819 TGTextButton* btn =
new TGTextButton(m_fworksAbout,
" OK ");
820 btn->SetBackgroundColor(0x2f2f2f);
821 btn->SetForegroundColor(0xffffff);
822 m_fworksAbout->AddFrame(btn,
new TGLayoutHints(kLHintsBottom | kLHintsCenterX, 0, 0, 0, 12));
823 btn->Connect(
"Clicked()",
"TGMainFrame", m_fworksAbout,
"CloseWindow()");
825 m_fworksAbout->MapSubwindows();
826 m_fworksAbout->Layout();
838 if ((*i)-> getKeycode())
839 f->BindKey(
this, (*i)->getKeycode(), (*i)->getModcode());
847 TGFrameElement* fe = (TGFrameElement*) GetList()->Last();
850 TGFrameElementPack* fep;
851 fep = (TGFrameElementPack*)pack->GetList()->At(1);
854 fep = (TGFrameElementPack*)pack->GetList()->At(3);
855 fep->fWeight = 100 -
x;
857 pack->ResizeExistingFrames();
864 TGFrameElement* fe = (TGFrameElement*)GetList()->Last();
865 TGPack*
pack = (TGPack*)(fe->fFrame);
867 TGFrameElementPack* fep = (TGFrameElementPack*)pack->GetList()->At(1);
const std::string sKeyboardShort
TGVerticalFrame * createList(TGCompositeFrame *p)
static const TString & coreIcondir()
const std::string sSavePartialConfig
FWNumberEntryField * m_lumiEntry
EventNumber_t event() const
void bindCSGActionKeys(const TGMainFrame *f) const
const std::string sShowCommonInsp
virtual void SetUIntNumber(UInt_t n)
FWPack(const TGWindow *w)
InfoFrame(const TGWindow *p, UInt_t w, UInt_t h, UInt_t opts)
const std::string sSavePartialConfigAs
void loadEvent(const edm::EventBase &event)
CSGContinuousAction * playEventsBackwardsAction() const
void createViews(TEveWindowSlot *slot)
virtual void enableActions(bool enable=true)
const std::string sBackgroundColor
const std::string sPlayEvents
sigc::signal< void > activated
FWCustomIconsButton * m_filterEnableBtn
void enableNext(bool enable=true)
const std::string sOpenData
virtual void CloseWindow() override
FWIntValueListener * m_delaySliderListener
void enableNavigatorControls()
LuminosityBlockNumber_t luminosityBlock() const
const std::string sSaveConfigAs
CSGContinuousAction * m_playEventsBack
const std::string sNextEvent
const std::string sSaveConfig
const TGPicture * m_filterIcons[9]
void createCustomIconsButton(TGCompositeFrame *p, const TGPicture *upPic, const TGPicture *downPic, const TGPicture *disabledPic, const TGPicture *upRunningPic, const TGPicture *downRunningPic, TGLayoutHints *l=0, Int_t id=-1, GContext_t norm=TGButton::GetDefaultGC()(), UInt_t option=0)
std::vector< CSGAction * > m_actionList
virtual void SetULong64Number(ULong64_t n)
const std::string sAppendData
void setToolTip(const std::string &tip)
virtual Bool_t isEnabled() const
CSGContinuousAction * m_loopAction
TGMainFrame * m_fworksAbout
CSGAction * createNewViewerAction(const std::string &iActionName, bool seaprator)
FWNumberEntryField * m_eventEntry
virtual ~CmsShowMainFrame()
void updateStatusBar(const char *status)
const std::string sShowAddCollection
const std::string sGotoLastEvent
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
TGPopupMenu * m_newViewerMenu
const std::string sExportImage
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
const std::string sAutoRewind
void createMenuEntry(TGPopupMenu *menu)
Bool_t HandleKey(Event_t *event)
const std::string sShowMainViewCtl
FWNumberEntryField * m_runEntry
const std::string sPlayEventsBack
CSGAction * getAction(const std::string &name)
virtual void enableActions(bool enable=true)
const std::string sShowObjInsp
FWCustomIconsButton * createCustomIconsButton(TGCompositeFrame *p, const TGPicture *upPic, const TGPicture *downPic, const TGPicture *disabledPic, TGLayoutHints *l=0, Int_t id=-1, GContext_t norm=TGButton::GetDefaultGC()(), UInt_t option=0)
CSGAction * m_previousEvent
const std::string sGotoFirstEvent
virtual void CloseWindow()
const std::string sShowInvMassDialog
void setSummaryViewWeight(float)
const std::string sShowEventDisplayInsp
void enablePrevious(bool enable=true)
const std::string sPreviousEvent
CSGContinuousAction * m_playEvents
std::string getLocalTime(const edm::EventBase &event)
float getSummaryViewWeight() const
const std::vector< CSGAction * > & getListOfActions() const
const std::string sLoadConfig
virtual void HandleMenu(Int_t id)
void makeFixedSizeLabel(TGHorizontalFrame *p, const char *txt, UInt_t bgCol, UInt_t txtCol, Int_t width, Int_t height)
void createShortcut(UInt_t key, const char *mod, int windowID)
const std::string sExportAllImages
void enableComplexNavigation(bool enable=true)
TGTextButton * m_filterShowGUIBtn
CmsShowMainFrame(const TGWindow *p=0, UInt_t w=1, UInt_t h=1, FWGUIManager *m=0)
const std::string sHelpGL
void setPlayDelayGUI(Float_t val, Bool_t sliderChanged)
const std::string sLoadPartialConfig
CSGContinuousAction * playEventsAction() const
const std::string sSearchFiles