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 = HWR.beamline.sample_view.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
Beispiel #2
0
    def approve_creation(self):
        result = CreateTaskBase.approve_creation(self)
        selected_shapes = HWR.beamline.sample_view.get_selected_shapes()

        for shape in selected_shapes:
            if isinstance(shape, GraphicsItemPoint):
                result = True
        return result
    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
Beispiel #4
0
    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
Beispiel #5
0
 def approve_creation(self):
     result = CreateTaskBase.approve_creation(self)
     return result