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


Python CreateTaskBase.single_item_selection方法代码示例

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


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

示例1: single_item_selection

# 需要导入模块: from create_task_base import CreateTaskBase [as 别名]
# 或者: from create_task_base.CreateTaskBase import single_item_selection [as 别名]
    def single_item_selection(self, tree_item):
        CreateTaskBase.single_item_selection(self, tree_item)
        if isinstance(tree_item, queue_item.SampleQueueItem) or \
               isinstance(tree_item, queue_item.DataCollectionGroupQueueItem):
            self._processing_parameters = copy.deepcopy(self._processing_parameters)
            self._processing_widget.update_data_model(self._processing_parameters)
            self._acq_widget.disable_inverse_beam(False)

        elif isinstance(tree_item, queue_item.DataCollectionQueueItem):
            dc = tree_item.get_model()

            if dc.experiment_type != queue_model_enumerables.EXPERIMENT_TYPE.HELICAL:
                self.setDisabled(False)
                self._acq_widget.disable_inverse_beam(True)
                
                self._path_template = dc.get_path_template()
                self._data_path_widget.update_data_model(self._path_template)

                self._acquisition_parameters = dc.acquisitions[0].acquisition_parameters
                self._acq_widget.update_data_model(self._acquisition_parameters,
                                                       self._path_template)
                
                if len(dc.acquisitions) == 1:
                    self.select_shape_with_cpos(self._acquisition_parameters.\
                                                centred_position)

                self._processing_parameters = dc.processing_parameters
                self._processing_widget.update_data_model(self._processing_parameters)
            else:
                self.setDisabled(True)
        else:
            self.setDisabled(True)
开发者ID:SOLEILPX,项目名称:mxcube,代码行数:34,代码来源:create_discrete_widget.py

示例2: single_item_selection

# 需要导入模块: from create_task_base import CreateTaskBase [as 别名]
# 或者: from create_task_base.CreateTaskBase import single_item_selection [as 别名]
    def single_item_selection(self, tree_item):
        CreateTaskBase.single_item_selection(self, tree_item)

        if isinstance(tree_item, queue_item.SampleQueueItem):
            sample_model = tree_item.get_model()
            self._processing_parameters = sample_model.processing_parameters
            # self._processing_parameters = copy.deepcopy(self._processing_parameters)
            self._processing_widget.update_data_model(self._processing_parameters)
        elif isinstance(tree_item, queue_item.BasketQueueItem):
            self.setDisabled(False)
        elif isinstance(tree_item, queue_item.DataCollectionQueueItem):
            data_collection = tree_item.get_model()

            if data_collection.experiment_type == EXPERIMENT_TYPE.HELICAL:
                if tree_item.get_model().is_executed():
                    self.setDisabled(True)
                else:
                    self.setDisabled(False)

                self._path_template = data_collection.get_path_template()
                self._data_path_widget.update_data_model(self._path_template)

                self._acquisition_parameters = data_collection.acquisitions[
                    0
                ].acquisition_parameters

                if len(data_collection.acquisitions) == 2:
                    start_cpos = data_collection.acquisitions[
                        0
                    ].acquisition_parameters.centred_position
                    end_cpos = data_collection.acquisitions[
                        1
                    ].acquisition_parameters.centred_position

                    self.select_shape_with_cpos(start_cpos, end_cpos)

                self._acq_widget.update_data_model(
                    self._acquisition_parameters, self._path_template
                )
                self.get_acquisition_widget().use_osc_start(True)

                self._processing_parameters = data_collection.processing_parameters
                self._processing_widget.update_data_model(self._processing_parameters)
            else:
                self.setDisabled(True)
        else:
            self.setDisabled(True)

        if (
            isinstance(tree_item, queue_item.SampleQueueItem)
            or isinstance(tree_item, queue_item.DataCollectionGroupQueueItem)
            or isinstance(tree_item, queue_item.DataCollectionQueueItem)
        ):

            self._processing_widget.update_data_model(self._processing_parameters)
            self._acq_widget.update_data_model(
                self._acquisition_parameters, self._path_template
            )
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:60,代码来源:create_helical_widget.py

示例3: single_item_selection

# 需要导入模块: from create_task_base import CreateTaskBase [as 别名]
# 或者: from create_task_base.CreateTaskBase import single_item_selection [as 别名]
    def single_item_selection(self, tree_item):
        CreateTaskBase.single_item_selection(self, tree_item)
        escan_model = tree_item.get_model()

        if isinstance(tree_item, queue_item.EnergyScanQueueItem):
            self.setDisabled(False)

            if escan_model.get_path_template():
                self._path_template = escan_model.get_path_template()

            self._data_path_widget.update_data_model(self._path_template)
        elif not(isinstance(tree_item, queue_item.SampleQueueItem) or \
                     isinstance(tree_item, queue_item.DataCollectionGroupQueueItem)):
            self.setDisabled(True)
开发者ID:alexgobbo,项目名称:mxcube,代码行数:16,代码来源:create_energy_scan_widget.py

示例4: single_item_selection

# 需要导入模块: from create_task_base import CreateTaskBase [as 别名]
# 或者: from create_task_base.CreateTaskBase import single_item_selection [as 别名]
    def single_item_selection(self, tree_item):
        CreateTaskBase.single_item_selection(self, tree_item)
        
        if isinstance(tree_item, queue_item.SampleQueueItem):
            logging.info("no update, sample level")
            """JN 20140829, keep the values user set up
            self._init_models()
            self._set_space_group(self._char_params.space_group)

            self._acq_widget.update_data_model(self._acquisition_parameters,
                                                self._path_template)
            self._char_params_mib.set_model(self._char_params)
            """ 

            #self._char_params = copy.deepcopy(self._char_params)
            #self._acquisition_parameters = copy.deepcopy(self._acquisition_parameters)

        elif isinstance(tree_item, queue_item.CharacterisationQueueItem):
            if tree_item.get_model().is_executed():
                self.setDisabled(True)
            else:
                self.setDisabled(False)

            self._char = tree_item.get_model()

            if self._char.get_path_template():
                self._path_template = self._char.get_path_template()

            self._data_path_widget.update_data_model(self._path_template)
            
            data_collection = self._char.reference_image_collection

            self._char_params = self._char.characterisation_parameters
            self._char_params_mib.set_model(self._char_params)

            self._acquisition_parameters = data_collection.acquisitions[0].\
                                           acquisition_parameters
            logging.info("resolution is set to %s", str(self._acquisition_parameters.resolution))

            self._acq_widget.update_data_model(self._acquisition_parameters,
                                               self._path_template)
            self.get_acquisition_widget().use_osc_start(True)

            if len(data_collection.acquisitions) == 1:
                self.select_shape_with_cpos(self._acquisition_parameters.\
                                            centred_position)

            self._processing_parameters = data_collection.processing_parameters
        else:
            self.setDisabled(True)
开发者ID:MAXLABMX,项目名称:mxcube,代码行数:52,代码来源:create_char_widget.py

示例5: single_item_selection

# 需要导入模块: from create_task_base import CreateTaskBase [as 别名]
# 或者: from create_task_base.CreateTaskBase import single_item_selection [as 别名]
    def single_item_selection(self, tree_item):
        CreateTaskBase.single_item_selection(self, tree_item)

        if isinstance(tree_item, queue_item.SampleQueueItem):
            self._init_models()
            self._set_space_group(self._char_params.space_group)
            self._acq_widget.update_data_model(
                self._acquisition_parameters, self._path_template
            )
            self._char_params_mib.set_model(self._char_params)
            # self._char_params = copy.deepcopy(self._char_params)
            # self._acquisition_parameters = copy.deepcopy(self._acquisition_parameters)
        elif isinstance(tree_item, queue_item.BasketQueueItem):
            self.setDisabled(False)
        elif isinstance(tree_item, queue_item.CharacterisationQueueItem):
            if tree_item.get_model().is_executed():
                self.setDisabled(True)
            else:
                self.setDisabled(False)

            self._char = tree_item.get_model()

            if self._char.get_path_template():
                self._path_template = self._char.get_path_template()

            self._data_path_widget.update_data_model(self._path_template)

            data_collection = self._char.reference_image_collection

            self._char_params = self._char.characterisation_parameters
            self._char_params_mib.set_model(self._char_params)

            self._acquisition_parameters = data_collection.acquisitions[
                0
            ].acquisition_parameters

            self._acq_widget.update_data_model(
                self._acquisition_parameters, self._path_template
            )
            self.get_acquisition_widget().use_osc_start(True)

            if len(data_collection.acquisitions) == 1:
                self.select_shape_with_cpos(
                    self._acquisition_parameters.centred_position
                )

            self._processing_parameters = data_collection.processing_parameters
        else:
            self.setDisabled(True)
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:51,代码来源:create_char_widget.py

示例6: single_item_selection

# 需要导入模块: from create_task_base import CreateTaskBase [as 别名]
# 或者: from create_task_base.CreateTaskBase import single_item_selection [as 别名]
    def single_item_selection(self, tree_item):
        CreateTaskBase.single_item_selection(self, tree_item)
        wf_model = tree_item.get_model()

        if isinstance(tree_item, queue_item.GenericWorkflowQueueItem):
            if tree_item.get_model().is_executed():
                self.setDisabled(True)
            else:
                self.setDisabled(False)
            
            if wf_model.get_path_template():
                self._path_template = wf_model.get_path_template()

            self._data_path_widget.update_data_model(self._path_template)
            
        elif not(isinstance(tree_item, queue_item.SampleQueueItem) or \
                     isinstance(tree_item, queue_item.DataCollectionGroupQueueItem)):
            self.setDisabled(True)
开发者ID:MAXLABMX,项目名称:mxcube,代码行数:20,代码来源:create_workflow_widget.py

示例7: single_item_selection

# 需要导入模块: from create_task_base import CreateTaskBase [as 别名]
# 或者: from create_task_base.CreateTaskBase import single_item_selection [as 别名]
    def single_item_selection(self, tree_item):
        CreateTaskBase.single_item_selection(self, tree_item)
        if isinstance(tree_item, queue_item.SampleQueueItem):
            sample_model = tree_item.get_model()
            # self._processing_parameters = copy.deepcopy(self._processing_parameters)
            self._processing_parameters = sample_model.processing_parameters
            self._processing_widget.update_data_model(self._processing_parameters)
            self._acq_widget.disable_inverse_beam(False)
        elif isinstance(tree_item, queue_item.BasketQueueItem):
            self.setDisabled(False)
        elif isinstance(tree_item, queue_item.DataCollectionQueueItem):
            dc = tree_item.get_model()

            if dc.experiment_type != queue_model_enumerables.EXPERIMENT_TYPE.HELICAL:
                if dc.is_executed():
                    self.setDisabled(True)
                else:
                    self.setDisabled(False)

                sample_data_model = self.get_sample_item(tree_item).get_model()
                energy_scan_result = sample_data_model.crystals[0].energy_scan_result
                self._acq_widget.set_energies(energy_scan_result)

                self._acq_widget.disable_inverse_beam(True)

                self._path_template = dc.get_path_template()
                self._data_path_widget.update_data_model(self._path_template)

                self._acquisition_parameters = dc.acquisitions[0].acquisition_parameters
                self._acq_widget.update_data_model(
                    self._acquisition_parameters, self._path_template
                )
                self.get_acquisition_widget().use_osc_start(True)
                if len(dc.acquisitions) == 1:
                    self.select_shape_with_cpos(
                        self._acquisition_parameters.centred_position
                    )

                self._processing_parameters = dc.processing_parameters
                self._processing_widget.update_data_model(self._processing_parameters)
            else:
                self.setDisabled(True)
        else:
            self.setDisabled(True)
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:46,代码来源:create_discrete_widget.py

示例8: single_item_selection

# 需要导入模块: from create_task_base import CreateTaskBase [as 别名]
# 或者: from create_task_base.CreateTaskBase import single_item_selection [as 别名]
    def single_item_selection(self, tree_item):
        CreateTaskBase.single_item_selection(self, tree_item)
                                                             
        if isinstance(tree_item, queue_item.SampleQueueItem) or \
               isinstance(tree_item, queue_item.DataCollectionGroupQueueItem):
            self._acquisition_parameters = copy.deepcopy(self._acquisition_parameters)
            self._processing_parameters = copy.deepcopy(self._processing_parameters)

        elif isinstance(tree_item, queue_item.DataCollectionQueueItem):
            data_collection = tree_item.get_model()

            if data_collection.experiment_type == EXPERIMENT_TYPE.HELICAL:
                self.setDisabled(False)
                self._path_template = data_collection.acquisitions[0].path_template
                self._acquisition_parameters = data_collection.acquisitions[0].\
                                               acquisition_parameters

                if len(data_collection.acquisitions) == 2:
                    start_cpos = data_collection.acquisitions[0].acquisition_parameters.\
                                 centred_position
                    end_cpos = data_collection.acquisitions[1].acquisition_parameters.\
                               centred_position

                    self.select_shape_with_cpos(start_cpos, end_cpos)

                self._energy_scan_result = qmo.EnergyScanResult()
                self._processing_parameters = data_collection.processing_parameters
                self._energy_scan_result = data_collection.crystal.energy_scan_result
                self._acq_widget.set_energies(self._energy_scan_result)
                self._processing_widget.update_data_model(self._processing_parameters)
                self._acq_widget.update_data_model(self._acquisition_parameters,
                                                   self._path_template)
            else:
                self.setDisabled(True)
        else:
            self.setDisabled(True)

        if isinstance(tree_item, queue_item.SampleQueueItem) or \
           isinstance(tree_item, queue_item.DataCollectionGroupQueueItem) or \
           isinstance(tree_item, queue_item.DataCollectionQueueItem):

            self._processing_widget.update_data_model(self._processing_parameters)
            self._acq_widget.update_data_model(self._acquisition_parameters,
                                               self._path_template)
开发者ID:alexgobbo,项目名称:mxcube,代码行数:46,代码来源:create_helical_widget.py

示例9: single_item_selection

# 需要导入模块: from create_task_base import CreateTaskBase [as 别名]
# 或者: from create_task_base.CreateTaskBase import single_item_selection [as 别名]
    def single_item_selection(self, tree_item):
        CreateTaskBase.single_item_selection(self, tree_item)
        escan_model = tree_item.get_model()

        if isinstance(tree_item, queue_item.EnergyScanQueueItem):
            if tree_item.get_model().is_executed():
                self.setDisabled(True)
            else:
                self.setDisabled(False)    

            if escan_model.get_path_template():
                self._path_template = escan_model.get_path_template()

            # JN,20140829, fix the bug-periodicTable not updated when selecting task
            self._data_path_widget.update_data_model(self._path_template)
            self.periodic_table.periodicTable.tableElementChanged(escan_model.element_symbol) 

        elif not(isinstance(tree_item, queue_item.SampleQueueItem) or \
                     isinstance(tree_item, queue_item.DataCollectionGroupQueueItem)):
            self.setDisabled(True)
开发者ID:MAXLABMX,项目名称:mxcube,代码行数:22,代码来源:create_energy_scan_widget.py

示例10: single_item_selection

# 需要导入模块: from create_task_base import CreateTaskBase [as 别名]
# 或者: from create_task_base.CreateTaskBase import single_item_selection [as 别名]
    def single_item_selection(self, tree_item):
        CreateTaskBase.single_item_selection(self, tree_item)

        if isinstance(tree_item, queue_item.XRFSpectrumQueueItem):
            xrfspectrum_model = tree_item.get_model()
            self.xrfspectrum_mib.set_model(xrfspectrum_model)

            if xrfspectrum_model.is_executed():
                self.setDisabled(True)
            else:
                self.setDisabled(False)    

            if xrfspectrum_model.get_path_template():
                self._path_template = xrfspectrum_model.get_path_template()

            self._data_path_widget.update_data_model(self._path_template)
        elif isinstance(tree_item, queue_item.BasketQueueItem):
            self.setDisabled(False)
        elif not(isinstance(tree_item, queue_item.SampleQueueItem) or \
                 isinstance(tree_item, queue_item.DataCollectionGroupQueueItem)):
            self.setDisabled(True)
开发者ID:MartinSavko,项目名称:mxcube,代码行数:23,代码来源:create_xrf_spectrum_widget.py

示例11: single_item_selection

# 需要导入模块: from create_task_base import CreateTaskBase [as 别名]
# 或者: from create_task_base.CreateTaskBase import single_item_selection [as 别名]
    def single_item_selection(self, tree_item):
        CreateTaskBase.single_item_selection(self, tree_item)
        escan_model = tree_item.get_model()

        if isinstance(tree_item, queue_item.EnergyScanQueueItem):
            if tree_item.get_model().is_executed():
                self.setDisabled(True)
            else:
                self.setDisabled(False)    

            if escan_model.get_path_template():
                self._path_template = escan_model.get_path_template()

            symbol, edge = escan_model.element_symbol, escan_model.edge
            self.periodic_table.setTableElement(symbol, edge)
            
            self._data_path_widget.update_data_model(self._path_template)
        elif isinstance(tree_item, queue_item.BasketQueueItem):
            self.setDisabled(False)
        elif not(isinstance(tree_item, queue_item.SampleQueueItem) or \
                     isinstance(tree_item, queue_item.DataCollectionGroupQueueItem)):
            self.setDisabled(True)
开发者ID:MartinSavko,项目名称:mxcube,代码行数:24,代码来源:create_energy_scan_widget.py


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