1 from __future__
import absolute_import
2 from builtins
import range
6 from PyQt4.QtGui import QToolButton,QIcon,QPixmap,QGridLayout,QLabel,QListWidget,QWidget
7 from PyQt4.QtSvg
import QSvgRenderer, QSvgWidget
11 from .
import Resources
16 BACKGROUND_SHAPE =
'ROUNDRECT' 17 SELECTABLE_FLAG =
False 19 AUTOSIZE_KEEP_ASPECT_RATIO =
False 21 PROTOTYPING_DESCRIPTION =
"""Prototyping""" 23 EXECUTING_DESCRIPTION =
"""Executing""" 25 VERIFYING_DESCRIPTION =
"""Verifying""" 30 VispaWidget.__init__(self, parent)
33 self.
setImage(QSvgRenderer(
":/resources/startup_development_cycle.svg"))
35 self.setMouseTracking(
True)
44 widget.enableAutosizing(
True,
False)
45 widget.setSelectable(
False)
46 widget.setArrowShape(arrowDirection)
48 widget.setDragable(
False)
49 self._descriptionWidgets.append(widget)
56 bodyWidget.setLayout(QGridLayout())
57 bodyWidget.layout().setContentsMargins(0, 0, 0, 0)
59 bodyWidget.layout().addWidget(QLabel(
"Design physics analysis:"), 0, 0)
60 analysisDesignerButton = QToolButton()
61 analysisDesignerButton.setText(
"Analysis Designer")
63 self.connect(analysisDesignerButton, SIGNAL(
"clicked(bool)"), self.parent().newAnalysisDesignerSlot)
64 bodyWidget.layout().addWidget(analysisDesignerButton, 0, 1)
65 bodyWidget.layout().addWidget(QLabel(
"Create physics event:"), 1, 0)
66 pxlButton = QToolButton()
67 pxlButton.setText(
"PXL Editor")
69 self.connect(pxlButton, SIGNAL(
"clicked(bool)"), self.parent().newPxlSlot)
70 bodyWidget.layout().addWidget(pxlButton, 1, 1)
72 self._prototypingDescriptionWidget.setBodyWidget(bodyWidget)
78 bodyWidget.setLayout(QGridLayout())
79 bodyWidget.layout().setContentsMargins(0, 0, 0, 0)
81 label=QLabel(
"Open and run existing analysis:")
82 bodyWidget.layout().addWidget(label, 0, 0)
83 analysisDesignerButton = QToolButton()
84 analysisDesignerButton.setText(
"Open analysis file")
86 self.connect(analysisDesignerButton, SIGNAL(
"clicked(bool)"), self.parent().openAnalysisFileSlot)
87 bodyWidget.layout().addWidget(analysisDesignerButton, 0, 1)
89 self._analysisDesignerRecentFilesList.setFixedSize(label.sizeHint().
width()+analysisDesignerButton.sizeHint().
width(),150)
93 self._executionDescriptionWidget.setBodyWidget(bodyWidget)
102 bodyWidget.setLayout(QGridLayout())
103 bodyWidget.layout().setContentsMargins(0, 0, 0, 0)
105 label=QLabel(
"Browse an existing PXL data file:")
106 bodyWidget.layout().addWidget(label, 0, 0)
107 analysisDesignerButton = QToolButton()
108 analysisDesignerButton.setText(
"Open PXL file")
110 self.connect(analysisDesignerButton, SIGNAL(
"clicked(bool)"), self.parent().openPxlFileSlot)
111 bodyWidget.layout().addWidget(analysisDesignerButton, 0, 1)
113 self._pxlEditorRecentFilesList.setFixedSize(label.sizeHint().
width()+analysisDesignerButton.sizeHint().
width(),150)
117 self._verifyingDescriptionWidget.setBodyWidget(bodyWidget)
123 if bool(event.buttons()):
124 VispaWidget.mouseMoveEvent(self, event)
130 VispaWidget.moveEvent(self, event)
134 VispaWidget.rearangeContent(self)
146 self._prototypingDescriptionWidget.move(self.mapToParent(self._prototypingRect.topLeft()) + QPoint((self._prototypingRect.width() - self._prototypingDescriptionWidget.width()) * 0.5, - self._prototypingDescriptionWidget.height()))
147 self._executionDescriptionWidget.move(self.mapToParent(self._executionRect.topLeft()) - QPoint(self._executionDescriptionWidget.width(), - 0.5 * (self._executionRect.height() - self._executionDescriptionWidget.height())))
148 self._verifyingDescriptionWidget.move(self.mapToParent(self._verifyingRect.topRight()) - QPoint(0, - 0.5 * (self._verifyingRect.height() - self._verifyingDescriptionWidget.height())))
151 br = VispaWidget.boundingRect(self)
153 br = br.united(w.boundingRect())
157 VispaWidget.setVisible(self, visible)
158 self._executionDescriptionWidget.setVisible(visible
and not self.
_hideDescriptions)
159 self._prototypingDescriptionWidget.setVisible(visible
and not self.
_hideDescriptions)
160 self._verifyingDescriptionWidget.setVisible(visible
and not self.
_hideDescriptions)
def createVerifyingWidget(self)
bool contains(EventRange const &lh, EventID const &rh)
_pxlEditorRecentFilesList
def moveEvent(self, event)
def mouseMoveEvent(self, event)
_analysisDesignerRecentFilesList
def setVisible(self, visible)
def rearangeDescriptionWidgets(self)
def pxlEditorRecentFilesList(self)
def rearangeContent(self)
def __init__(self, parent)
def analysisDesignerRecentFilesList(self)
_prototypingDescriptionWidget
def createDescriptionWidget(self, arrowDirection, description)
_executionDescriptionWidget
_verifyingDescriptionWidget
def createPrototypingWidget(self)
def createExecutionWidget(self)