Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugs to be fixed, need a little roll back of "confocalgui.py" and "poimangui.py" #510

Closed
1 task
diamond2nv opened this issue May 5, 2019 · 2 comments
Closed
1 task

Comments

@diamond2nv
Copy link

diamond2nv commented May 5, 2019

What is affected by this bug?

Win10 64bit
branch: master
modules: gui

When does this occur?

  1. When moving crosshair in Confocal GUI xy scan, the crosshair in depth xz is not moving accordingly( x-axis).
  2. When using the tool "Add POIs" in POI Manager GUI, will ocur an error.

Where on the platform does it happen?

  • will be solved by a little roll back.

How to solve the issue?

  1. "confocalgui.py" -- roll back from line: 1089
    below is from the same file with a few commits roll back:
 #FIXME: little roll back
        if self._scanning_logic.depth_img_is_xz:
            self.update_roi_depth(h=h_pos)
        else:
            self.update_roi_depth(h=v_pos)
  1. "poimangui.py" -- roll back from line: 559
    below is from the same file with a few commits roll back:
    @QtCore.Slot(bool)
    def toggle_poi_selector(self, is_active):
        if is_active != self._mw.poi_selector_Action.isChecked():
            self._mw.poi_selector_Action.blockSignals(True)
            self._mw.poi_selector_Action.setChecked(is_active)
            self._mw.poi_selector_Action.blockSignals(False)
        if is_active != self.__poi_selector_active:
            if is_active:
                self.roi_image.scene().sigMouseClicked.connect(self.create_poi_from_click)
                self.roi_image.setCursor(QtCore.Qt.CrossCursor)
            else:
                self.roi_image.scene().sigMouseClicked.disconnect()
                self.roi_image.setCursor(QtCore.Qt.ArrowCursor)
        self.__poi_selector_active = is_active
        return

    @QtCore.Slot(object)
    def create_poi_from_click(self, event):
        # Only create new POI if the mouse click event has not been accepted by some other means
        # In our case this is most likely the POI marker to select the active POI from.
        if not event.accepted:
            # Z position from ROI origin, X and Y positions from click event
            new_pos = self.poimanagerlogic().roi_origin
            cursor_pos = self.roi_image.getViewBox().mapSceneToView(event.scenePos())
            new_pos[0] = cursor_pos.x()
            new_pos[1] = cursor_pos.y()
            # Check if position lies within axis boundaries.
            x_axis_box = self._mw.roi_map_ViewWidget.getAxis('bottom').sceneBoundingRect()
            y_axis_box = self._mw.roi_map_ViewWidget.getAxis('left').sceneBoundingRect()
            min_x = self.roi_image.getViewBox().mapSceneToView(y_axis_box.bottomRight()).x()
            min_y = self.roi_image.getViewBox().mapSceneToView(x_axis_box.topLeft()).y()
            if new_pos[0] <= min_x or new_pos[1] <= min_y:
                return
            # Check if position is within scan image boundaries
            image_extent = self.poimanagerlogic().roi_scan_image_extent
            if image_extent is None:
                return
            if image_extent[0][0] > new_pos[0] or image_extent[0][1] < new_pos[0]:
                return
            if image_extent[1][0] > new_pos[1] or image_extent[1][1] < new_pos[1]:
                return
            event.accept()
            self.sigAddPoiByClick.emit(new_pos)
        return

Expected behavior (i.e. solution)

  • just like normal

Other Comments

  • Also have a NoneTypeError (in save_logic.py), when adding POI in it's manager GUI, turns out changing codes as below can be a quic fix, but seems to change the function's behaver.

  • "logic/save_logic.py" line 568:

            #param_dict = args[0].update(kwargs)
            #FIXME
            param_dict = args[0]
@diamond2nv diamond2nv changed the title Bugs to be fix, need a little roll back of "confocalgui.py" and "poimangui.py" Bugs to be fixed, need a little roll back of "confocalgui.py" and "poimangui.py" May 5, 2019
@Neverhorst
Copy link
Member

Again complete disregard of issue template and no structured description of a single problem.
Worst thing is you never describe how to replicate the issue (as the template suggests).
You also mix 3 different unrelated issues.

Nonetheless, the only issue I can reproduce is the one mentioned in "Other Comments". Will be fixed with PR #511

@diamond2nv
Copy link
Author

diamond2nv commented May 7, 2019

Sorry about "replicate the issue", just forgot. I was thinking about a quick solution (by roll back) when writing into this section.

  • Here it is:
  1. Qudi -- scanimage_plotwidget_improvement (merged into master 2019-04-15)
  2. example/default.cfg
  3. Open confocal gui, when moving crosshair in Confocal GUI xy scan by mousce draging, the crosshair in depth xz scan would not moving accordingly( x-axis).
  4. Open poi manager gui, when using the tool "Add POIs" in POI Manager GUI, would ocur an error, and cannot add poi by mousce clicked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants