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


Python CreateTaskBase.approve_creation方法代码示例

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


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

示例1: approve_creation

# 需要导入模块: from Qt4_create_task_base import CreateTaskBase [as 别名]
# 或者: from Qt4_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 = self._graphics_manager_hwobj.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
开发者ID:vrey01,项目名称:mxcube,代码行数:27,代码来源:Qt4_create_advanced_widget.py

示例2: approve_creation

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

        try:
            #This is very EMBL specific and soon will be removed
            if self._beamline_setup_hwobj.detector_hwobj.get_roi_mode_name() == "16M":
                file_size = 18.
                total_num_of_images = 14400
            else:
                file_size = 18. / 4
                total_num_of_images = 14400 * 4

            num_images = float(self._acq_widget.acq_widget_layout.num_images_ledit.text())
            total, free, perc = self._beamline_setup_hwobj.machine_info_hwobj.get_ramdisk_size()
            free_mb = free / (2 ** 20)

            if num_images > total_num_of_images * free_mb / (125.8 * 1024):
                msg = "Ramdisk size (%d GB) is not enough to run the collection with " % (free_mb / 1024)
                msg += "%d frames." % num_images
                logging.getLogger("GUI").error(msg)
                result = False
        except:
            pass    

        return result
开发者ID:vrey01,项目名称:mxcube,代码行数:30,代码来源:Qt4_create_discrete_widget.py

示例3: approve_creation

# 需要导入模块: from Qt4_create_task_base import CreateTaskBase [as 别名]
# 或者: from Qt4_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("user_level_log").warning("No lines selected, please select one or more lines.")
            return False
        else:
            return base_result
开发者ID:hzb-mx,项目名称:mxcube,代码行数:10,代码来源:Qt4_create_helical_widget.py

示例4: approve_creation

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

        if len(self._advanced_methods_widget.grid_treewidget.selectedItems()) == 0:
            msg = "No grid selected. Automatic grid will be used."
            logging.getLogger("user_level_log").info(msg)
        return result
开发者ID:JieNanMAXIV,项目名称:mxcube,代码行数:12,代码来源:Qt4_create_advanced_widget.py

示例5: approve_creation

# 需要导入模块: from Qt4_create_task_base import CreateTaskBase [as 别名]
# 或者: from Qt4_create_task_base.CreateTaskBase import approve_creation [as 别名]
    def approve_creation(self):
        """
        Descript. :
        """
        base_result = CreateTaskBase.approve_creation(self)
        selected_element, selected_edge = self._periodic_table_widget.get_selected_element_edge()
        if not selected_element:
            logging.getLogger("user_level_log").info("No element selected, please select an element.")

        return base_result and selected_element
开发者ID:hzb-mx,项目名称:mxcube,代码行数:12,代码来源:Qt4_create_energy_scan_widget.py

示例6: approve_creation

# 需要导入模块: from Qt4_create_task_base import CreateTaskBase [as 别名]
# 或者: from Qt4_create_task_base.CreateTaskBase import approve_creation [as 别名]
    def approve_creation(self):
        """
        Descript. :
        """
        result = CreateTaskBase.approve_creation(self)
        selected_shapes = self._graphics_manager_hwobj.get_selected_shapes()

        for shape in selected_shapes:
            if isinstance(shape, GraphicsItemPoint):
                result = True
        return result
开发者ID:vrey01,项目名称:mxcube,代码行数:13,代码来源:Qt4_create_char_widget.py

示例7: approve_creation

# 需要导入模块: from Qt4_create_task_base import CreateTaskBase [as 别名]
# 或者: from Qt4_create_task_base.CreateTaskBase import approve_creation [as 别名]
    def approve_creation(self):
        base_result = CreateTaskBase.approve_creation(self)

        self.count_time = None

        try:
            self.count_time = float(str(self.count_time_ledit.text()))
        except:
            logging.getLogger("user_level_log").info("Incorrect count time value.")

        return base_result and self.count_time
开发者ID:folf,项目名称:mxcube,代码行数:13,代码来源:Qt4_create_xrf_scan_widget.py

示例8: approve_creation

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

        if len(self._advanced_methods_widget.\
           grid_treewidget.selectedItems()) == 0:
            msg = "No grid selected. Continuing with automatic grid."
            logging.getLogger("GUI").info(msg)
        return result
开发者ID:jordiandreu,项目名称:mxcube,代码行数:13,代码来源:Qt4_create_advanced_widget.py

示例9: approve_creation

# 需要导入模块: from Qt4_create_task_base import CreateTaskBase [as 别名]
# 或者: from Qt4_create_task_base.CreateTaskBase import approve_creation [as 别名]
    def approve_creation(self):
        base_result = CreateTaskBase.approve_creation(self)
    
        selected_lines = False
        
        if self.selected_items():
            selected_lines = True
        else:
            logging.getLogger("user_level_log").\
                warning("No lines selected, please select one or more lines.")

        return base_result and selected_lines 
开发者ID:olofsvensson,项目名称:mxcube,代码行数:14,代码来源:Qt4_create_helical_widget.py

示例10: approve_creation

# 需要导入模块: from Qt4_create_task_base import CreateTaskBase [as 别名]
# 或者: from Qt4_create_task_base.CreateTaskBase import approve_creation [as 别名]
    def approve_creation(self):
        """
        Descript. :
        """
        result = CreateTaskBase.approve_creation(self)
        selected_shapes = self._graphics_manager_hwobj.get_selected_shapes()

        for shape in selected_shapes:
            if isinstance(shape, graphics_manager.GraphicsItemCentringLines):
                result = False

        return result
开发者ID:olofsvensson,项目名称:mxcube,代码行数:14,代码来源:Qt4_create_discrete_widget.py

示例11: approve_creation

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

        method_name = str(self._advanced_methods_widget.method_combo.\
                currentText()).title().replace(' ', '')
        if len(self._advanced_methods_widget.grid_treewidget.selectedItems()) == 0:
            logging.getLogger("user_level_log").error("No grid selected")
            result = False 

        return result
开发者ID:hzb-mx,项目名称:mxcube,代码行数:15,代码来源:Qt4_create_advanced_widget.py

示例12: approve_creation

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

        treewidget_item = self.mesh_widget.mesh_treewidget.currentItem()
        if treewidget_item is not None:
            drawing_mgr = self.__list_items[treewidget_item]
            key = str(treewidget_item.text(0))
            selected_grid = drawing_mgr._get_grid(key)[0]
        else:
            logging.getLogger("user_level_log").\
                warning("No grid selected, please select a grid.")
            selected_grid = None
        return result and selected_grid
开发者ID:folf,项目名称:mxcube,代码行数:18,代码来源:Qt4_create_advanced_scan_widget.py

示例13: approve_creation

# 需要导入模块: from Qt4_create_task_base import CreateTaskBase [as 别名]
# 或者: from Qt4_create_task_base.CreateTaskBase import approve_creation [as 别名]
 def approve_creation(self):
     """
     Descript. :
     """
     result = CreateTaskBase.approve_creation(self)
     return result
开发者ID:milanprica,项目名称:mxcube,代码行数:8,代码来源:Qt4_create_discrete_widget.py


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