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


Python CreateTaskBase.single_item_selection方法代码示例

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


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

示例1: single_item_selection

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

        if isinstance(tree_item, Qt4_queue_item.SampleQueueItem):
            self.setDisabled(False)
        elif isinstance(tree_item, Qt4_queue_item.BasketQueueItem):
            self.setDisabled(False)
        elif isinstance(tree_item, Qt4_queue_item.XrayImagingQueueItem):
            data_model= tree_item.get_model()

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

            self._acquisition_parameters = data_model.acquisition.acquisition_parameters
            self._acq_widget.update_data_model(self._acquisition_parameters,
                                               self._path_template)

            self._xray_imaging_parameters = data_model.xray_imaging_parameters
            self._xray_imaging_parameters_widget.update_data_model(data_model)
    

            self.setDisabled(False)
开发者ID:vrey01,项目名称:mxcube,代码行数:28,代码来源:Qt4_create_xray_imaging_widget.py

示例2: single_item_selection

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

        if isinstance(tree_item, Qt4_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()

            self._data_path_widget.update_data_model(self._path_template)

            # -----------------------------------------------------------------
            # LNLS
            self._periodic_table_widget.set_current_element_edge(\
                 tree_item.get_model().element_symbol,
                 tree_item.get_model().edge)
            # -----------------------------------------------------------------
        elif not(isinstance(tree_item, Qt4_queue_item.SampleQueueItem) or \
                     isinstance(tree_item, Qt4_queue_item.DataCollectionGroupQueueItem)):
            self.setDisabled(True)
开发者ID:douglasbeniz,项目名称:mxcube,代码行数:29,代码来源:Qt4_create_energy_scan_widget.py

示例3: single_item_selection

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

        CreateTaskBase.single_item_selection(self, tree_item)
        if isinstance(tree_item, Qt4_queue_item.SampleQueueItem):
            self._init_models()
            self._acq_widget.update_data_model(self._acquisition_parameters, self._path_template)
        elif isinstance(tree_item, Qt4_queue_item.BasketQueueItem):
            self.setDisabled(False)
        elif isinstance(tree_item, Qt4_queue_item.AdvancedQueueItem):
            advanced = tree_item.get_model()
            if tree_item.get_model().is_executed():
                self.setDisabled(True)
            else:
                self.setDisabled(False)

            # sample_data_model = self.get_sample_item(tree_item).get_model()
            # self._acq_widget.disable_inverse_beam(True)

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

            data_collection = advanced.reference_image_collection

            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)
        else:
            self.setDisabled(True)
开发者ID:JieNanMAXIV,项目名称:mxcube,代码行数:33,代码来源:Qt4_create_advanced_widget.py

示例4: single_item_selection

# 需要导入模块: from Qt4_create_task_base import CreateTaskBase [as 别名]
# 或者: from Qt4_create_task_base.CreateTaskBase import single_item_selection [as 别名]
    def single_item_selection(self, tree_item):
        """
        Descript. :
        """
        CreateTaskBase.single_item_selection(self, tree_item)
        if isinstance(tree_item, Qt4_queue_item.SampleQueueItem):
            self._init_models()
            self._acq_widget.update_data_model(self._acquisition_parameters,
                                                self._path_template)            
        elif isinstance(tree_item, Qt4_queue_item.BasketQueueItem):
            self.setDisabled(False)
        elif isinstance(tree_item, Qt4_queue_item.DataCollectionQueueItem):
            data_collection = tree_item.get_model()
            if tree_item.get_model().is_executed():
                self.setDisabled(True)
            else:
                self.setDisabled(False)

            # sample_data_model = self.get_sample_item(tree_item).get_model()
            #self._acq_widget.disable_inverse_beam(True)
            #self._graphics_manager_hwobj.de_select_all()
            self._graphics_manager_hwobj.select_shape(data_collection.grid)

            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
            self._acq_widget.update_data_model(self._acquisition_parameters,
                                               self._path_template)
            self.get_acquisition_widget().use_osc_start(True)
        else:
            self.setDisabled(True)
开发者ID:jordiandreu,项目名称:mxcube,代码行数:35,代码来源:Qt4_create_advanced_widget.py

示例5: single_item_selection

# 需要导入模块: from Qt4_create_task_base import CreateTaskBase [as 别名]
# 或者: from Qt4_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, Qt4_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, Qt4_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, Qt4_queue_item.SampleQueueItem) or \
           isinstance(tree_item, Qt4_queue_item.DataCollectionGroupQueueItem) or \
           isinstance(tree_item, Qt4_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:olofsvensson,项目名称:mxcube,代码行数:52,代码来源:Qt4_create_helical_widget.py

示例6: single_item_selection

# 需要导入模块: from Qt4_create_task_base import CreateTaskBase [as 别名]
# 或者: from Qt4_create_task_base.CreateTaskBase import single_item_selection [as 别名]
    def single_item_selection(self, tree_item):
        """
        Descript. :
        """
        CreateTaskBase.single_item_selection(self, tree_item)
        
        if isinstance(tree_item, Qt4_queue_item.SampleQueueItem):
            #self._init_models() 
            if self._char_params.space_group == "":
                sample_model = tree_item.get_model()
                self._set_space_group(sample_model.processing_parameters.space_group)
            #self._acq_widget.update_data_model(self._acquisition_parameters,
            #                                   self._path_template)
            #self._char_params_mib.set_model(self._char_params)
        elif isinstance(tree_item, Qt4_queue_item.BasketQueueItem):
            self.setDisabled(False)
        elif isinstance(tree_item, Qt4_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:vrey01,项目名称:mxcube,代码行数:50,代码来源:Qt4_create_char_widget.py

示例7: single_item_selection

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

        if isinstance(tree_item, Qt4_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)
        elif isinstance(tree_item, Qt4_queue_item.BasketQueueItem):
            self.setDisabled(False)
        elif isinstance(tree_item, Qt4_queue_item.DataCollectionQueueItem):
            dc = tree_item.get_model()
            self._acq_widget.use_kappa(False)

            if not dc.is_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:vrey01,项目名称:mxcube,代码行数:48,代码来源:Qt4_create_discrete_widget.py

示例8: single_item_selection

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

        if isinstance(tree_item, Qt4_queue_item.XRFSpectrumQueueItem):
            if self.xrf_spectrum_model.is_executed():
                self.setDisabled(True)
            else:
                self.setDisabled(False)    

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

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

示例9: single_item_selection

# 需要导入模块: from Qt4_create_task_base import CreateTaskBase [as 别名]
# 或者: from Qt4_create_task_base.CreateTaskBase import single_item_selection [as 别名]
    def single_item_selection(self, tree_item):
        """
        Descript. :
        """
        CreateTaskBase.single_item_selection(self, tree_item)
        self.dc_selected = False

        if isinstance(tree_item, Qt4_queue_item.SampleQueueItem):
            pass
        elif isinstance(tree_item, Qt4_queue_item.BasketQueueItem):
            pass
            #self.setDisabled(False)
        elif isinstance(tree_item, Qt4_queue_item.DataCollectionQueueItem) or \
             isinstance(tree_item, Qt4_queue_item.XrayCenteringQueueItem):

            if isinstance(tree_item, Qt4_queue_item.XrayCenteringQueueItem):
                data_collection = tree_item.get_model().reference_image_collection                 
            else:
                data_collection = tree_item.get_model()

            if tree_item.get_model().is_executed():
                self.setDisabled(True)
            else:
                self.setDisabled(False)

            if data_collection.is_mesh():
                # sample_data_model = self.get_sample_item(tree_item).get_model()
                #self._acq_widget.disable_inverse_beam(True)
                #self._graphics_manager_hwobj.de_select_all()
                self._graphics_manager_hwobj.select_shape(data_collection.grid)
                self._advanced_methods_widget.grid_treewidget.setCurrentItem(\
                     self._grid_map[data_collection.grid])

                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
                self._acq_widget.update_data_model(self._acquisition_parameters,
                                                   self._path_template)
                #self.get_acquisition_widget().use_osc_start(True)
            self.dc_selected = True
        else:
            self.setDisabled(True)
        self.grid_treewidget_item_selection_changed()
开发者ID:vrey01,项目名称:mxcube,代码行数:47,代码来源:Qt4_create_advanced_widget.py

示例10: single_item_selection

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

        if isinstance(tree_item, Qt4_queue_item.SampleQueueItem):
            sample_model = tree_item.get_model()
            #self._processing_parameters = sample_model.processing_parameters
            #self._processing_widget.update_data_model(self._processing_parameters)
        elif isinstance(tree_item, Qt4_queue_item.DataCollectionQueueItem):
            data_collection = tree_item.get_model()

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

                sample_data_model = self.get_sample_item(tree_item).get_model()
                self._acq_widget.disable_inverse_beam(True)

                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
                self._acq_widget.update_data_model(self._acquisition_parameters,
                                                    self._path_template)
                self.get_acquisition_widget().use_osc_start(True)
            else:
                self.setDisabled(True)
        else:
            self.setDisabled(True)

        if isinstance(tree_item, Qt4_queue_item.SampleQueueItem) or \
           isinstance(tree_item, Qt4_queue_item.DataCollectionGroupQueueItem) or \
           isinstance(tree_item, Qt4_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:folf,项目名称:mxcube,代码行数:43,代码来源:Qt4_create_advanced_scan_widget.py

示例11: single_item_selection

# 需要导入模块: from Qt4_create_task_base import CreateTaskBase [as 别名]
# 或者: from Qt4_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 not isinstance(tree_item, queue_item.SampleQueueItem):

            if isinstance(tree_item, queue_item.GphlWorkflowQueueItem):
                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 isinstance(tree_item, queue_item.BasketQueueItem):
                self.setDisabled(False)
            elif not isinstance(tree_item, queue_item.DataCollectionGroupQueueItem):
                self.setDisabled(True)
开发者ID:MartinSavko,项目名称:mxcube,代码行数:23,代码来源:Qt4_create_gphl_workflow_widget.py


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