本文整理汇总了Python中gui.widgets.create_task_base.CreateTaskBase.single_item_selection方法的典型用法代码示例。如果您正苦于以下问题:Python CreateTaskBase.single_item_selection方法的具体用法?Python CreateTaskBase.single_item_selection怎么用?Python CreateTaskBase.single_item_selection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gui.widgets.create_task_base.CreateTaskBase
的用法示例。
在下文中一共展示了CreateTaskBase.single_item_selection方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: single_item_selection
# 需要导入模块: from gui.widgets.create_task_base import CreateTaskBase [as 别名]
# 或者: from gui.widgets.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.is_helical():
self.setDisabled(tree_item.get_model().is_executed())
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
num_images = data_collection.acquisitions[
0
].acquisition_parameters.num_images
self.select_line_with_cpos(start_cpos, end_cpos, num_images)
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
)
示例2: single_item_selection
# 需要导入模块: from gui.widgets.create_task_base import CreateTaskBase [as 别名]
# 或者: from gui.widgets.create_task_base.CreateTaskBase import single_item_selection [as 别名]
def single_item_selection(self, tree_item):
"""
Method called when a queue item in the tree is selected
:param tree_item: queue_item
:return: None
"""
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)
elif isinstance(tree_item, queue_item.BasketQueueItem):
self.setDisabled(False)
elif isinstance(tree_item, queue_item.DataCollectionQueueItem):
dc_model = tree_item.get_model()
self._acq_widget.use_kappa(False)
if not dc_model.is_helical():
if dc_model.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_model.get_path_template()
self._data_path_widget.update_data_model(self._path_template)
self._acquisition_parameters = dc_model.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_model.acquisitions) == 1:
self.select_shape_with_cpos(
self._acquisition_parameters.centred_position
)
self._processing_parameters = dc_model.processing_parameters
self._processing_widget.update_data_model(self._processing_parameters)
else:
self.setDisabled(True)
else:
self.setDisabled(True)
示例3: single_item_selection
# 需要导入模块: from gui.widgets.create_task_base import CreateTaskBase [as 别名]
# 或者: from gui.widgets.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, queue_item.SampleQueueItem):
pass
elif isinstance(tree_item, queue_item.BasketQueueItem):
pass
# self.setDisabled(False)
elif isinstance(tree_item, queue_item.DataCollectionQueueItem) or isinstance(
tree_item, queue_item.XrayCenteringQueueItem
):
if isinstance(tree_item, 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)
# api.graphics.de_select_all()
api.graphics.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()
示例4: single_item_selection
# 需要导入模块: from gui.widgets.create_task_base import CreateTaskBase [as 别名]
# 或者: from gui.widgets.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()
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, 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)
示例5: single_item_selection
# 需要导入模块: from gui.widgets.create_task_base import CreateTaskBase [as 别名]
# 或者: from gui.widgets.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, 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, queue_item.SampleQueueItem)
or isinstance(tree_item, queue_item.DataCollectionGroupQueueItem)
):
self.setDisabled(True)
示例6: single_item_selection
# 需要导入模块: from gui.widgets.create_task_base import CreateTaskBase [as 别名]
# 或者: from gui.widgets.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.SampleQueueItem):
self.init_models()
else:
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)
示例7: single_item_selection
# 需要导入模块: from gui.widgets.create_task_base import CreateTaskBase [as 别名]
# 或者: from gui.widgets.create_task_base.CreateTaskBase import single_item_selection [as 别名]
def single_item_selection(self, tree_item):
CreateTaskBase.single_item_selection(self, tree_item)
self.setDisabled(True)
if isinstance(tree_item, queue_item.SampleQueueItem):
self._xray_imaging_parameters = copy.deepcopy(self._xray_imaging_parameters)
self._xray_imaging_parameters_widget.update_data_model(
self._xray_imaging_parameters
)
self._xray_imaging_parameters_widget.set_detector_distance(
api.detector_distance.get_position()
)
self.setDisabled(False)
self._xray_imaging_parameters_widget.enable_distance_tools(True)
elif isinstance(tree_item, queue_item.BasketQueueItem):
self.setDisabled(False)
self._xray_imaging_parameters_widget.enable_distance_tools(True)
elif isinstance(tree_item, 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.acquisitions[0].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(
self._xray_imaging_parameters
)
self.setDisabled(False)
self._xray_imaging_parameters_widget.enable_distance_tools(False)