本文整理汇总了Python中vistrails.gui.paramexplore.pe_pipeline.QAnnotatedPipelineView.toolWindow方法的典型用法代码示例。如果您正苦于以下问题:Python QAnnotatedPipelineView.toolWindow方法的具体用法?Python QAnnotatedPipelineView.toolWindow怎么用?Python QAnnotatedPipelineView.toolWindow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vistrails.gui.paramexplore.pe_pipeline.QAnnotatedPipelineView
的用法示例。
在下文中一共展示了QAnnotatedPipelineView.toolWindow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: QParameterExplorationTab
# 需要导入模块: from vistrails.gui.paramexplore.pe_pipeline import QAnnotatedPipelineView [as 别名]
# 或者: from vistrails.gui.paramexplore.pe_pipeline.QAnnotatedPipelineView import toolWindow [as 别名]
class QParameterExplorationTab(QDockContainer, QToolWindowInterface):
"""
QParameterExplorationTab is a tab containing different widgets
related to parameter exploration
"""
explorationId = 0
def __init__(self, parent=None):
""" QParameterExplorationTab(parent: QWidget)
-> QParameterExplorationTab
Make it a main window with dockable area and a
QParameterExplorationTable
"""
QDockContainer.__init__(self, parent)
self.setWindowTitle('Parameter Exploration')
self.toolWindow().setFeatures(QtGui.QDockWidget.NoDockWidgetFeatures)
self.toolWindow().hide()
self.peWidget = QParameterExplorationWidget()
self.setCentralWidget(self.peWidget)
self.connect(self.peWidget.table,
QtCore.SIGNAL('exploreChange(bool)'),
self.exploreChange)
self.paramView = QParameterView(self)
self.addDockWidget(QtCore.Qt.RightDockWidgetArea,
self.paramView.toolWindow())
self.annotatedPipelineView = QAnnotatedPipelineView(self)
self.addDockWidget(QtCore.Qt.RightDockWidgetArea,
self.annotatedPipelineView.toolWindow())
self.virtualCell = QVirtualCellWindow(self)
self.addDockWidget(QtCore.Qt.RightDockWidgetArea,
self.virtualCell.toolWindow())
self.controller = None
self.currentVersion = -1
def addViewActionsToMenu(self, menu):
"""addViewActionsToMenu(menu: QMenu) -> None
Add toggle view actions to menu
"""
menu.addAction(self.paramView.toolWindow().toggleViewAction())
menu.addAction(self.annotatedPipelineView.toolWindow().toggleViewAction())
menu.addAction(self.virtualCell.toolWindow().toggleViewAction())
def removeViewActionsFromMenu(self, menu):
"""removeViewActionsFromMenu(menu: QMenu) -> None
Remove toggle view actions from menu
"""
menu.removeAction(self.paramView.toolWindow().toggleViewAction())
menu.removeAction(self.annotatedPipelineView.toolWindow().toggleViewAction())
menu.removeAction(self.virtualCell.toolWindow().toggleViewAction())
def setController(self, controller):
""" setController(controller: VistrailController) -> None
Assign a controller to the parameter exploration tab
"""
self.controller = controller
def getParameterExploration(self):
""" getParameterExploration() -> string
Generates an XML string that represents the current
parameter exploration, and which can be loaded with
setParameterExploration().
"""
# Construct xml for persisting parameter exploration
escape_dict = { "'":"'", '"':'"', '\n':'
' }
timestamp = strftime(current_time(), '%Y-%m-%d %H:%M:%S')
# TODO: For now, we use the timestamp as the 'name' - Later, we should set 'name' based on a UI input field
xml = '\t<paramexp dims="%s" layout="%s" date="%s" name="%s">' % (str(self.peWidget.table.label.getCounts()), str(self.virtualCell.getConfiguration()[2]), timestamp, timestamp)
for i in xrange(self.peWidget.table.layout().count()):
pEditor = self.peWidget.table.layout().itemAt(i).widget()
if pEditor and isinstance(pEditor, QParameterSetEditor):
firstParam = True
for paramWidget in pEditor.paramWidgets:
paramInfo = paramWidget.param
interpolator = paramWidget.editor.stackedEditors.currentWidget()
intType = interpolator.exploration_name
# Write function tag prior to the first parameter of the function
if firstParam:
xml += '\n\t\t<function id="%s" alias="%s" name="%s">' % (paramInfo.parent_id, paramInfo.is_alias, pEditor.info[0])
firstParam = False
# Write parameter tag
xml += '\n\t\t\t<param id="%s" dim="%s" interp="%s"' % (paramInfo.id, paramWidget.getDimension(), intType)
if intType == 'Linear Interpolation':
xml += ' min="%s" max="%s"' % (interpolator.fromEdit.get_value(), interpolator.toEdit.get_value())
elif intType == 'List':
xml += ' values="%s"' % escape(str(interpolator._str_values), escape_dict)
elif intType == 'User-defined Function':
xml += ' code="%s"' % escape(interpolator.function, escape_dict)
xml += '/>'
xml += '\n\t\t</function>'
#.........这里部分代码省略.........