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


Python PipelineDevelopperView.add_embedded_subpipeline方法代码示例

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


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

示例1: write_state

# 需要导入模块: from capsul.qt_gui.widgets import PipelineDevelopperView [as 别名]
# 或者: from capsul.qt_gui.widgets.PipelineDevelopperView import add_embedded_subpipeline [as 别名]
    if 0:
        def write_state():
            state_file_name = '/tmp/state.json'
            json.dump(pipeline.pipeline_state(), open(state_file_name,'w'))
            print 'Wrote', state_file_name

        import sys
        #from PySide import QtGui
        from soma.qt_gui import qt_backend
        qt_backend.set_qt_backend('PyQt4')
        from soma.qt_gui.qt_backend import QtGui
        from capsul.qt_gui.widgets import PipelineDevelopperView
        #from capsul.qt_gui.widgets import PipelineUserView
        from capsul.process import get_process_instance

        app = QtGui.QApplication(sys.argv)
        pipeline = get_process_instance(MainTestPipeline)
        pipeline.on_trait_change(write_state,'selection_changed')
        view1 = PipelineDevelopperView(pipeline, show_sub_pipelines=True, allow_open_controller=True)
        view1.add_embedded_subpipeline('switch_pipeline', scale=0.7)
        view1.add_embedded_subpipeline('way1_1', scale=0.4)
        view1.add_embedded_subpipeline('way2_1', scale=0.4)
        view1.show()
        #view2 = PipelineUserView(pipeline)
        #view2.show()
        app.exec_()
        del view1
        #del view2

开发者ID:VincentFrouin,项目名称:capsul,代码行数:30,代码来源:test_switch_subpipeline.py

示例2: test

# 需要导入模块: from capsul.qt_gui.widgets import PipelineDevelopperView [as 别名]
# 或者: from capsul.qt_gui.widgets.PipelineDevelopperView import add_embedded_subpipeline [as 别名]
    suite = unittest.TestLoader().loadTestsFromTestCase(TestPipeline)
    runtime = unittest.TextTestRunner(verbosity=2).run(suite)
    return runtime.wasSuccessful()


if __name__ == "__main__":
    test()

    if 1:
        from PySide import QtGui
        from capsul.qt_gui.widgets import PipelineDevelopperView

        app = QtGui.QApplication(sys.argv)
        pipeline = MyPipeline()
        pipeline.input_image = ["toto", "tutu", "titi"]
        pipeline.dynamic_parameter = [3, 1, 4]
        pipeline.other_input = 0
        pipeline2 = pipeline.nodes["iterative"].process
        pipeline2.scene_scale_factor = 0.5
        pipeline.node_position = {'inputs': (50.0, 50.0),
                                  'iterative': (267.0, 56.0),
                                  'outputs': (1124.0, 96.0)}

        view1 = PipelineDevelopperView(pipeline, show_sub_pipelines=True,
                                       allow_open_controller=True)
        view1.add_embedded_subpipeline('iterative')

        view1.show()
        app.exec_()
        del view1
开发者ID:nsouedet,项目名称:capsul,代码行数:32,代码来源:test_iterative_process.py


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