本文整理汇总了Python中gui.widgets.create_task_base.CreateTaskBase.approve_creation方法的典型用法代码示例。如果您正苦于以下问题:Python CreateTaskBase.approve_creation方法的具体用法?Python CreateTaskBase.approve_creation怎么用?Python CreateTaskBase.approve_creation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gui.widgets.create_task_base.CreateTaskBase
的用法示例。
在下文中一共展示了CreateTaskBase.approve_creation方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: approve_creation
# 需要导入模块: from gui.widgets.create_task_base import CreateTaskBase [as 别名]
# 或者: from gui.widgets.create_task_base.CreateTaskBase import approve_creation [as 别名]
def approve_creation(self):
"""
Descript. :
"""
result = CreateTaskBase.approve_creation(self)
selected_grid = self.get_selected_shapes()[0]
if not selected_grid:
msg = "No grid selected. Please select a grid to continue!"
logging.getLogger("GUI").warning(msg)
result = False
# selected_grid = api.graphics.get_auto_grid()
else:
grid_properties = selected_grid.get_properties()
exp_time = float(self._acq_widget.acq_widget_layout.exp_time_ledit.text())
speed = grid_properties["yOffset"] / exp_time
if speed >= 2.25:
logging.getLogger("GUI").error(
"Translation speed %.3f is above the limit 2.25" % speed
)
return False
osc_range_per_frame = float(
self._acq_widget.acq_widget_layout.osc_range_ledit.text()
)
speed = osc_range_per_frame / exp_time
if speed >= 300:
logging.getLogger("GUI").error(
"Rotation speed per frame %.3f is above the limit 300" % speed
)
return False
return result
示例2: approve_creation
# 需要导入模块: from gui.widgets.create_task_base import CreateTaskBase [as 别名]
# 或者: from gui.widgets.create_task_base.CreateTaskBase import approve_creation [as 别名]
def approve_creation(self):
result = CreateTaskBase.approve_creation(self)
selected_shapes = api.graphics.get_selected_shapes()
for shape in selected_shapes:
if isinstance(shape, GraphicsItemPoint):
result = True
return result
示例3: approve_creation
# 需要导入模块: from gui.widgets.create_task_base import CreateTaskBase [as 别名]
# 或者: from gui.widgets.create_task_base.CreateTaskBase import approve_creation [as 别名]
def approve_creation(self):
base_result = CreateTaskBase.approve_creation(self)
if len(self._lines_widget.lines_treewidget.selectedItems()) == 0:
logging.getLogger("GUI").warning(
"No lines selected, please select one or more lines."
)
return False
else:
return base_result
示例4: approve_creation
# 需要导入模块: from gui.widgets.create_task_base import CreateTaskBase [as 别名]
# 或者: from gui.widgets.create_task_base.CreateTaskBase import approve_creation [as 别名]
def approve_creation(self):
base_result = CreateTaskBase.approve_creation(self)
selected_element, selected_edge = (
self._periodic_table_widget.get_selected_element_edge()
)
if not selected_element:
logging.getLogger("GUI").warning(
"No element selected, please select an element."
)
return base_result and selected_element
示例5: approve_creation
# 需要导入模块: from gui.widgets.create_task_base import CreateTaskBase [as 别名]
# 或者: from gui.widgets.create_task_base.CreateTaskBase import approve_creation [as 别名]
def approve_creation(self):
result = CreateTaskBase.approve_creation(self)
return result