當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。