Exemplo n.º 1
0
    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
Exemplo n.º 2
0
    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
Exemplo n.º 3
0
    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
Exemplo n.º 4
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
Exemplo n.º 5
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
Exemplo n.º 6
0
    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
Exemplo n.º 7
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
Exemplo n.º 8
0
    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
Exemplo n.º 9
0
 def approve_creation(self):
     result = CreateTaskBase.approve_creation(self)
     return result
Exemplo n.º 10
0
 def approve_creation(self):
     result = CreateTaskBase.approve_creation(self)
     return result