当前位置: 首页>>代码示例>>Python>>正文


Python QAnnotatedPipelineView.updateAnnotatedIds方法代码示例

本文整理汇总了Python中vistrails.gui.paramexplore.pe_pipeline.QAnnotatedPipelineView.updateAnnotatedIds方法的典型用法代码示例。如果您正苦于以下问题:Python QAnnotatedPipelineView.updateAnnotatedIds方法的具体用法?Python QAnnotatedPipelineView.updateAnnotatedIds怎么用?Python QAnnotatedPipelineView.updateAnnotatedIds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vistrails.gui.paramexplore.pe_pipeline.QAnnotatedPipelineView的用法示例。


在下文中一共展示了QAnnotatedPipelineView.updateAnnotatedIds方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: QParameterView

# 需要导入模块: from vistrails.gui.paramexplore.pe_pipeline import QAnnotatedPipelineView [as 别名]
# 或者: from vistrails.gui.paramexplore.pe_pipeline.QAnnotatedPipelineView import updateAnnotatedIds [as 别名]
class QParameterView(QtGui.QWidget, QVistrailsPaletteInterface):
    """
    QParameterView contains the parameter exploration properties and the
    parameter palette
    
    """
    def __init__(self, controller=None, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.set_title('Pipeline Methods')
        
        self.controller = None
        vLayout = QtGui.QVBoxLayout()
        vLayout.setMargin(0)
        vLayout.setSpacing(5)
        self.setLayout(vLayout)

        self.toggleUnsetParameters = QtGui.QCheckBox('Show Unset Parameters')
        vLayout.addWidget(self.toggleUnsetParameters, 0, QtCore.Qt.AlignRight)

        self.parameterWidget = QParameterWidget()
        vLayout.addWidget(self.parameterWidget)
        self.treeWidget = self.parameterWidget.treeWidget

        self.pipeline_view = QAnnotatedPipelineView()
        self.pipeline_view.setReadOnlyMode(True)
        vLayout.addWidget(self.pipeline_view)

        vLayout.setStretch(0,0)
        vLayout.setStretch(1,1)
        vLayout.setStretch(2,0)

        self.connect(self.toggleUnsetParameters, QtCore.SIGNAL("toggled(bool)"),
                     self.parameterWidget.treeWidget.toggleUnsetParameters)
        self.set_controller(controller)

    def set_controller(self, controller):
        if self.controller == controller:
            return
        self.controller = controller
        self.pipeline_view.set_controller(controller)
        if self.controller is not None:
            self.set_pipeline(controller.current_pipeline)
        else:
            self.set_pipeline(None)

    def set_pipeline(self, pipeline):
        if self.controller is None:
            return
        self.pipeline = pipeline
        self.parameterWidget.set_pipeline(pipeline, self.controller)
        if pipeline:
            self.pipeline_view.scene().setupScene(pipeline)
        else:
            self.pipeline_view.scene().clear()
        self.pipeline_view.updateAnnotatedIds(pipeline)
开发者ID:Nikea,项目名称:VisTrails,代码行数:57,代码来源:param_view.py

示例2: QParameterExplorationTab

# 需要导入模块: from vistrails.gui.paramexplore.pe_pipeline import QAnnotatedPipelineView [as 别名]
# 或者: from vistrails.gui.paramexplore.pe_pipeline.QAnnotatedPipelineView import updateAnnotatedIds [as 别名]

#.........这里部分代码省略.........
                                p_max = str(p.attributes['max'].value)
                                interpolator.fromEdit.setText(p_min)
                                interpolator.toEdit.setText(p_max)
                            elif p_intType == 'List':
                                p_values = str(p.attributes['values'].value)
                                # Set internal list structure
                                interpolator._str_values = \
                                        literal_eval(p_values)
                                # Update UI list
                                if interpolator.type == 'String':
                                    interpolator.listValues.setText(p_values)
                                else:
                                    interpolator.listValues.setText(p_values.replace("'", "").replace('"', ''))
                            elif p_intType == 'User-defined Function':
                                # Set function code
                                p_code = str(p.attributes['code'].value)
                                interpolator.function = p_code

    def showEvent(self, event):
        """ showEvent(event: QShowEvent) -> None
        Update the tab when it is shown
        
        """
        if self.currentVersion!=self.controller.current_version:
            self.currentVersion = self.controller.current_version
            # Update the virtual cell
            pipeline = self.controller.current_pipeline
            self.virtualCell.updateVirtualCell(pipeline)

            # Now we need to inspect the parameter list
            self.paramView.treeWidget.updateFromPipeline(pipeline)

            # Update the annotated ids
            self.annotatedPipelineView.updateAnnotatedIds(pipeline)

            # Update the parameter exploration table
            self.peWidget.updatePipeline(pipeline)

            # Update the UI with the most recent parameter exploration
            # TODO: For now, we just strip the root tags since there's only one
            #       exploration - Later we should parse the root tree and select
            #       the active exploration based on date, or user choice
            xmlString = self.controller.vistrail.get_paramexp(self.currentVersion)
            if xmlString is not None:
                striplen = len("<paramexps>")
                xmlString = xmlString[striplen:-(striplen+1)].strip()
                self.setParameterExploration(xmlString)

    def performParameterExploration(self):
        """ performParameterExploration() -> None        
        Perform the exploration by collecting a list of actions
        corresponding to each dimension
        
        """
        registry = get_module_registry()
        actions = self.peWidget.table.collectParameterActions()
        spreadsheet_pkg = '%s.spreadsheet' % get_vistrails_default_pkg_prefix()
        # Set the annotation to persist the parameter exploration
        # TODO: For now, we just replace the existing exploration - Later we should append them.
        xmlString = "<paramexps>\n" + self.getParameterExploration() + "\n</paramexps>"
        self.controller.vistrail.set_paramexp(self.currentVersion, xmlString)
        self.controller.set_changed(True)

        if self.controller.current_pipeline and actions:
            explorer = ActionBasedParameterExploration()
            (pipelines, performedActions) = explorer.explore(
开发者ID:Nikea,项目名称:VisTrails,代码行数:70,代码来源:pe_tab.py

示例3: QAliasParameterView

# 需要导入模块: from vistrails.gui.paramexplore.pe_pipeline import QAnnotatedPipelineView [as 别名]
# 或者: from vistrails.gui.paramexplore.pe_pipeline.QAnnotatedPipelineView import updateAnnotatedIds [as 别名]
class QAliasParameterView(QtGui.QWidget, QVistrailsPaletteInterface):
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.set_title("Mashup Pipeline")
        layout = QtGui.QVBoxLayout()
        self.parameter_panel = QAliasParameterPanel()
        font = QtGui.QFont("Arial", 11, QtGui.QFont.Normal)
        font.setItalic(True)
        label = QtGui.QLabel("Double-click a parameter to change alias")
        label.setFont(font)
        param_group = QtGui.QGroupBox(self.parameter_panel.windowTitle())
        g_layout = QtGui.QVBoxLayout()
        g_layout.setMargin(0)
        g_layout.setSpacing(2)
        g_layout.addWidget(label)
        g_layout.addWidget(self.parameter_panel)
        param_group.setLayout(g_layout)
        layout.addWidget(param_group)

        self.pipeline_view = QAnnotatedPipelineView()
        self.pipeline_view.setReadOnlyMode(True)
        p_view_group = QtGui.QGroupBox(self.pipeline_view.windowTitle())
        g_layout = QtGui.QVBoxLayout()
        g_layout.setMargin(0)
        g_layout.setSpacing(0)
        g_layout.addWidget(self.pipeline_view)
        p_view_group.setLayout(g_layout)
        layout.addWidget(p_view_group)
        self.setLayout(layout)

        self.parameter_panel.treeWidget.aliasChanged.connect(self.aliasChanged)

    def updateMshpController(self, mshpController):
        from vistrails.gui.vistrails_window import _app

        self.mshpController = mshpController
        self.parameter_panel.set_pipeline(self.mshpController.vtPipeline)
        self.pipeline_view.set_controller(self.mshpController.vtController)
        self.mshpController.vtController.current_pipeline_view = self.pipeline_view
        self.pipeline_view.scene().current_pipeline = self.mshpController.vtPipeline
        self.mshpController.vtController.current_pipeline = self.mshpController.vtPipeline

        # print "**** should update mashup pipeline view "

        # self.pipeline_view.scene().setupScene(self.mshpController.vtPipeline)
        self.pipeline_view.scene().clear()
        self.pipeline_view.version_changed()
        self.pipeline_view.updateAnnotatedIds(self.mshpController.vtPipeline)
        # _app.notify('mashup_pipeline_view_set')

    def updateMshpVersion(self, version):
        # print "will update alias param view"
        self.parameter_panel.set_pipeline(self.mshpController.vtPipeline)
        self.pipeline_view.version_changed()

    def zoomToFit(self):
        if self.pipeline_view:
            self.pipeline_view.zoomToFit()

    def aliasChanged(self, param):
        from vistrails.gui.vistrails_window import _app

        _app.notify("alias_changed", param)
开发者ID:,项目名称:,代码行数:65,代码来源:


注:本文中的vistrails.gui.paramexplore.pe_pipeline.QAnnotatedPipelineView.updateAnnotatedIds方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。