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


Python DataPathWidget.setEnabled方法代码示例

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


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

示例1: CreateHelicalWidget

# 需要导入模块: from Qt4_data_path_widget import DataPathWidget [as 别名]
# 或者: from Qt4_data_path_widget.DataPathWidget import setEnabled [as 别名]
class CreateHelicalWidget(CreateTaskBase):
    def __init__(self, parent = None,name = None, fl = 0):
        CreateTaskBase.__init__(self, parent, name, fl, 'Helical')

        if not name:
            self.setObjectName("create_helical_widget")
        self.init_models() 
         
        # Hardware objects ----------------------------------------------------

        # Internal variables --------------------------------------------------
        self._lines_map = {}

        # Graphic elements ----------------------------------------------------
        self._lines_widget = loadUi(os.path.join(\
            os.path.dirname(__file__), "ui_files/Qt4_helical_line_widget_layout.ui"))

        self._acq_widget =  AcquisitionWidget(self, "acquisition_widget",
             layout='vertical', acq_params=self._acquisition_parameters,
             path_template=self._path_template)

        self._data_path_widget = DataPathWidget(self, 'create_dc_path_widget',
             data_model=self._path_template, layout='vertical')

        self._processing_widget = ProcessingWidget(self,
             data_model=self._processing_parameters)

        # Layout --------------------------------------------------------------
        _main_vlayout = QVBoxLayout(self)
        _main_vlayout.addWidget(self._lines_widget)
        _main_vlayout.addWidget(self._acq_widget)
        _main_vlayout.addWidget(self._data_path_widget)
        _main_vlayout.addWidget(self._processing_widget)
        _main_vlayout.addStretch(0)
        _main_vlayout.setSpacing(6)
        _main_vlayout.setContentsMargins(2, 2, 2, 2)

        # SizePolicies --------------------------------------------------------

        # Qt signal/slot connections ------------------------------------------
        self._lines_widget.lines_treewidget.itemSelectionChanged.connect(\
             self.lines_treewidget_selection_changed)
        self._lines_widget.create_line_button.clicked.connect(\
             self.create_line_button_clicked)
        self._lines_widget.create_auto_line_button.clicked.connect(\
             self.create_auto_line_button_clicked)
        self._lines_widget.remove_line_button.clicked.connect(\
             self.remove_line_button_clicked)  
        self._lines_widget.overlay_cbox.stateChanged.connect(\
             self.overlay_toggled)
        self._lines_widget.overlay_slider.valueChanged.connect(\
             self.overlay_alpha_changed)
        self._lines_widget.swap_points_button.clicked.connect(\
             self.swap_points_clicked)

        self._acq_widget.acqParametersChangedSignal.\
             connect(self.acq_parameters_changed)
        self._acq_widget.madEnergySelectedSignal.connect(\
             self.mad_energy_selected)
        self._data_path_widget.pathTemplateChangedSignal.\
             connect(self.path_template_changed)

        self._processing_widget.enableProcessingSignal.connect(\
             self._run_processing_toggled)

        # Other ---------------------------------------------------------------
        for col in range(self._lines_widget.lines_treewidget.columnCount()):
            self._lines_widget.lines_treewidget.resizeColumnToContents(col)
        #self._processing_widget.processing_widget.\
        #     run_processing_parallel_cbox.setChecked(False)

        self.enable_widgets(False)

    def enable_widgets(self, state):
        self._acq_widget.setEnabled(state)
        self._data_path_widget.setEnabled(state)
        self._processing_widget.setEnabled(state)

    def init_models(self):
        CreateTaskBase.init_models(self)
        self._energy_scan_result = queue_model_objects.EnergyScanResult()
        self._processing_parameters = queue_model_objects.ProcessingParameters()
  
        if self._beamline_setup_hwobj is not None:
            has_shutter_less = self._beamline_setup_hwobj.\
                               detector_has_shutterless()
            self._acquisition_parameters.shutterless = has_shutter_less

            self._acquisition_parameters = self._beamline_setup_hwobj.\
                get_default_acquisition_parameters("default_helical_values")
            self._processing_widget.processing_widget.run_processing_parallel_cbox.setChecked(\
                self._beamline_setup_hwobj._get_run_processing_parallel())

    def set_beamline_setup(self, bl_setup_hwobj):
        CreateTaskBase.set_beamline_setup(self, bl_setup_hwobj)
       
        # At startup, if scene loaded from file, then update listwidget
        shapes = self._graphics_manager_hwobj.get_shapes()
        for shape in shapes: 
            if isinstance(shape, GraphicsItemLine):
#.........这里部分代码省略.........
开发者ID:vrey01,项目名称:mxcube,代码行数:103,代码来源:Qt4_create_helical_widget.py


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