4 from PyQt4.QtGui import QToolButton,QIcon,QPixmap,QGridLayout,QLabel,QListWidget,QWidget
5 from PyQt4.QtSvg
import QSvgRenderer, QSvgWidget
14 BACKGROUND_SHAPE =
'ROUNDRECT'
15 SELECTABLE_FLAG =
False
17 AUTOSIZE_KEEP_ASPECT_RATIO =
False
19 PROTOTYPING_DESCRIPTION =
"""Prototyping"""
21 EXECUTING_DESCRIPTION =
"""Executing"""
23 VERIFYING_DESCRIPTION =
"""Verifying"""
28 VispaWidget.__init__(self, parent)
31 self.
setImage(QSvgRenderer(
":/resources/startup_development_cycle.svg"))
33 self.setMouseTracking(
True)
42 widget.enableAutosizing(
True,
False)
43 widget.setSelectable(
False)
44 widget.setArrowShape(arrowDirection)
46 widget.setDragable(
False)
47 self._descriptionWidgets.append(widget)
54 bodyWidget.setLayout(QGridLayout())
55 bodyWidget.layout().setContentsMargins(0, 0, 0, 0)
57 bodyWidget.layout().addWidget(QLabel(
"Design physics analysis:"), 0, 0)
58 analysisDesignerButton = QToolButton()
59 analysisDesignerButton.setText(
"Analysis Designer")
61 self.connect(analysisDesignerButton, SIGNAL(
"clicked(bool)"), self.parent().newAnalysisDesignerSlot)
62 bodyWidget.layout().addWidget(analysisDesignerButton, 0, 1)
63 bodyWidget.layout().addWidget(QLabel(
"Create physics event:"), 1, 0)
64 pxlButton = QToolButton()
65 pxlButton.setText(
"PXL Editor")
67 self.connect(pxlButton, SIGNAL(
"clicked(bool)"), self.parent().newPxlSlot)
68 bodyWidget.layout().addWidget(pxlButton, 1, 1)
70 self._prototypingDescriptionWidget.setBodyWidget(bodyWidget)
76 bodyWidget.setLayout(QGridLayout())
77 bodyWidget.layout().setContentsMargins(0, 0, 0, 0)
79 label=QLabel(
"Open and run existing analysis:")
80 bodyWidget.layout().addWidget(label, 0, 0)
81 analysisDesignerButton = QToolButton()
82 analysisDesignerButton.setText(
"Open analysis file")
84 self.connect(analysisDesignerButton, SIGNAL(
"clicked(bool)"), self.parent().openAnalysisFileSlot)
85 bodyWidget.layout().addWidget(analysisDesignerButton, 0, 1)
87 self._analysisDesignerRecentFilesList.setFixedSize(label.sizeHint().
width()+analysisDesignerButton.sizeHint().
width(),150)
91 self._executionDescriptionWidget.setBodyWidget(bodyWidget)
100 bodyWidget.setLayout(QGridLayout())
101 bodyWidget.layout().setContentsMargins(0, 0, 0, 0)
103 label=QLabel(
"Browse an existing PXL data file:")
104 bodyWidget.layout().addWidget(label, 0, 0)
105 analysisDesignerButton = QToolButton()
106 analysisDesignerButton.setText(
"Open PXL file")
108 self.connect(analysisDesignerButton, SIGNAL(
"clicked(bool)"), self.parent().openPxlFileSlot)
109 bodyWidget.layout().addWidget(analysisDesignerButton, 0, 1)
111 self._pxlEditorRecentFilesList.setFixedSize(label.sizeHint().
width()+analysisDesignerButton.sizeHint().
width(),150)
115 self._verifyingDescriptionWidget.setBodyWidget(bodyWidget)
121 if bool(event.buttons()):
122 VispaWidget.mouseMoveEvent(self, event)
128 VispaWidget.moveEvent(self, event)
132 VispaWidget.rearangeContent(self)
144 self._prototypingDescriptionWidget.move(self.mapToParent(self._prototypingRect.topLeft()) + QPoint((self._prototypingRect.width() - self._prototypingDescriptionWidget.width()) * 0.5, - self._prototypingDescriptionWidget.height()))
145 self._executionDescriptionWidget.move(self.mapToParent(self._executionRect.topLeft()) - QPoint(self._executionDescriptionWidget.width(), - 0.5 * (self._executionRect.height() - self._executionDescriptionWidget.height())))
146 self._verifyingDescriptionWidget.move(self.mapToParent(self._verifyingRect.topRight()) - QPoint(0, - 0.5 * (self._verifyingRect.height() - self._verifyingDescriptionWidget.height())))
149 br = VispaWidget.boundingRect(self)
151 br = br.united(w.boundingRect())
155 VispaWidget.setVisible(self, visible)
156 self._executionDescriptionWidget.setVisible(visible
and not self.
_hideDescriptions)
157 self._prototypingDescriptionWidget.setVisible(visible
and not self.
_hideDescriptions)
158 self._verifyingDescriptionWidget.setVisible(visible
and not self.
_hideDescriptions)
bool contains(EventRange const &lh, EventID const &rh)
_pxlEditorRecentFilesList
string VERIFYING_DESCRIPTION
_analysisDesignerRecentFilesList
def createVerifyingWidget
def analysisDesignerRecentFilesList
def createExecutionWidget
string EXECUTING_DESCRIPTION
string PROTOTYPING_DESCRIPTION
def pxlEditorRecentFilesList
def createDescriptionWidget
def rearangeDescriptionWidgets
_prototypingDescriptionWidget
_executionDescriptionWidget
_verifyingDescriptionWidget
def createPrototypingWidget