1 from __future__
import absolute_import
5 from PyQt4.QtGui import QToolButton,QIcon,QPixmap,QGridLayout,QLabel,QListWidget,QWidget
6 from PyQt4.QtSvg
import QSvgRenderer, QSvgWidget
10 from .
import Resources
15 BACKGROUND_SHAPE =
'ROUNDRECT' 16 SELECTABLE_FLAG =
False 18 AUTOSIZE_KEEP_ASPECT_RATIO =
False 20 PROTOTYPING_DESCRIPTION =
"""Prototyping""" 22 EXECUTING_DESCRIPTION =
"""Executing""" 24 VERIFYING_DESCRIPTION =
"""Verifying""" 29 VispaWidget.__init__(self, parent)
32 self.
setImage(QSvgRenderer(
":/resources/startup_development_cycle.svg"))
34 self.setMouseTracking(
True)
43 widget.enableAutosizing(
True,
False)
44 widget.setSelectable(
False)
45 widget.setArrowShape(arrowDirection)
47 widget.setDragable(
False)
48 self._descriptionWidgets.append(widget)
55 bodyWidget.setLayout(QGridLayout())
56 bodyWidget.layout().setContentsMargins(0, 0, 0, 0)
58 bodyWidget.layout().addWidget(QLabel(
"Design physics analysis:"), 0, 0)
59 analysisDesignerButton = QToolButton()
60 analysisDesignerButton.setText(
"Analysis Designer")
62 self.connect(analysisDesignerButton, SIGNAL(
"clicked(bool)"), self.parent().newAnalysisDesignerSlot)
63 bodyWidget.layout().addWidget(analysisDesignerButton, 0, 1)
64 bodyWidget.layout().addWidget(QLabel(
"Create physics event:"), 1, 0)
65 pxlButton = QToolButton()
66 pxlButton.setText(
"PXL Editor")
68 self.connect(pxlButton, SIGNAL(
"clicked(bool)"), self.parent().newPxlSlot)
69 bodyWidget.layout().addWidget(pxlButton, 1, 1)
71 self._prototypingDescriptionWidget.setBodyWidget(bodyWidget)
77 bodyWidget.setLayout(QGridLayout())
78 bodyWidget.layout().setContentsMargins(0, 0, 0, 0)
80 label=QLabel(
"Open and run existing analysis:")
81 bodyWidget.layout().addWidget(label, 0, 0)
82 analysisDesignerButton = QToolButton()
83 analysisDesignerButton.setText(
"Open analysis file")
85 self.connect(analysisDesignerButton, SIGNAL(
"clicked(bool)"), self.parent().openAnalysisFileSlot)
86 bodyWidget.layout().addWidget(analysisDesignerButton, 0, 1)
88 self._analysisDesignerRecentFilesList.setFixedSize(label.sizeHint().
width()+analysisDesignerButton.sizeHint().
width(),150)
92 self._executionDescriptionWidget.setBodyWidget(bodyWidget)
101 bodyWidget.setLayout(QGridLayout())
102 bodyWidget.layout().setContentsMargins(0, 0, 0, 0)
104 label=QLabel(
"Browse an existing PXL data file:")
105 bodyWidget.layout().addWidget(label, 0, 0)
106 analysisDesignerButton = QToolButton()
107 analysisDesignerButton.setText(
"Open PXL file")
109 self.connect(analysisDesignerButton, SIGNAL(
"clicked(bool)"), self.parent().openPxlFileSlot)
110 bodyWidget.layout().addWidget(analysisDesignerButton, 0, 1)
112 self._pxlEditorRecentFilesList.setFixedSize(label.sizeHint().
width()+analysisDesignerButton.sizeHint().
width(),150)
116 self._verifyingDescriptionWidget.setBodyWidget(bodyWidget)
122 if bool(event.buttons()):
123 VispaWidget.mouseMoveEvent(self, event)
129 VispaWidget.moveEvent(self, event)
133 VispaWidget.rearangeContent(self)
145 self._prototypingDescriptionWidget.move(self.mapToParent(self._prototypingRect.topLeft()) + QPoint((self._prototypingRect.width() - self._prototypingDescriptionWidget.width()) * 0.5, - self._prototypingDescriptionWidget.height()))
146 self._executionDescriptionWidget.move(self.mapToParent(self._executionRect.topLeft()) - QPoint(self._executionDescriptionWidget.width(), - 0.5 * (self._executionRect.height() - self._executionDescriptionWidget.height())))
147 self._verifyingDescriptionWidget.move(self.mapToParent(self._verifyingRect.topRight()) - QPoint(0, - 0.5 * (self._verifyingRect.height() - self._verifyingDescriptionWidget.height())))
150 br = VispaWidget.boundingRect(self)
152 br = br.united(w.boundingRect())
156 VispaWidget.setVisible(self, visible)
157 self._executionDescriptionWidget.setVisible(visible
and not self.
_hideDescriptions)
158 self._prototypingDescriptionWidget.setVisible(visible
and not self.
_hideDescriptions)
159 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)