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

2482 problem with dragging slicer elements on plot #2515

Closed

Conversation

butlerpd
Copy link
Member

@butlerpd butlerpd commented May 8, 2023

Description

The main thing this does is to Fix #2482 by making sure the plot is updated first and then drawn on drag operations for all slicere. In the process 2 other commits were made to

  1. Make a first pass at cleaning up the class level docstrings of the slicers
  2. Fix the duplicate class nomenclature

Fixes #2482

How Has This Been Tested?

the functional changes were tested by following the steps described in the issue this fixes and verifying that the behavior is now as expected.

Review Checklist (please remove items if they don't apply):

  • Code has been reviewed
  • Functionality has been tested
  • Windows installer (GH artifact) has been tested (installed and worked)
  • MacOSX installer (GH artifact) has been tested (installed and worked)
  • User documentation is available and complete (if required)
  • Developers documentation is available and complete (if required)
  • The introduced changes comply with SasView license (BSD 3-Clause)

butlerpd added 3 commits May 7, 2023 21:16
This fixes the error due to the confusion between base and base.base which had all interactors redraw the plot first and updating from the move second. This was resolved in the "moveend" method but made using the mouse to set the interactor rather difficult to do precisely. This was also cleanded up in the three interactor/slicer modules not currently used but that probably will be for the needs of the magnetic/crystal scattering communities. Duplicate draws were removed when appropriate.
First pass at fixing the slicer classes docstrings.
There are three unused slicer modules that are set up for wedge type slicers. These were never implemented. I suspect that in fact it was orinally planed to use this for sector averaging where perhaps the wedge became a sector by making r1=0 and r2 = qmax. However as it stands it left two slicers classes called SectorInteractor.  This unused class is renamed to the more appropriate WedgeInteractor in preparation for being used for crystal type data.
@butlerpd butlerpd linked an issue May 8, 2023 that may be closed by this pull request
@wpotrzebowski wpotrzebowski added the Discuss At The Call Issues to be discussed at the fortnightly call label May 8, 2023
Copy link
Contributor

@krzywon krzywon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still seeing jumping in both the rectangular averaging and sector slicers. Also, for the sector slicer, the left line can no longer be consistently moved.

src/sas/qtgui/Plotting/Slicers/AnnulusSlicer.py Outdated Show resolved Hide resolved
src/sas/qtgui/Plotting/Slicers/Arc.py Show resolved Hide resolved
src/sas/qtgui/Plotting/Slicers/WedgeSlicer.py Outdated Show resolved Hide resolved
@wpotrzebowski
Copy link
Contributor

@butlerpd to look at it.

@wpotrzebowski wpotrzebowski removed the Discuss At The Call Issues to be discussed at the fortnightly call label May 9, 2023
@wpotrzebowski wpotrzebowski added the Discuss At The Call Issues to be discussed at the fortnightly call label May 23, 2023
@wpotrzebowski
Copy link
Contributor

@butlerpd to look at it

@wpotrzebowski wpotrzebowski removed the Discuss At The Call Issues to be discussed at the fortnightly call label May 23, 2023
@wpotrzebowski wpotrzebowski added the Discuss At The Call Issues to be discussed at the fortnightly call label Jun 5, 2023
@wpotrzebowski
Copy link
Contributor

@butlerpd will fix at least one issue

@wpotrzebowski wpotrzebowski removed the Discuss At The Call Issues to be discussed at the fortnightly call label Jun 6, 2023
butlerpd and others added 2 commits July 12, 2023 09:03
Copy link
Member

@rozyczko rozyczko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good.
The fix does indeed work - on mouse button release, the slicer line/circle no longer jumps.
This was especially visible when the final position of the cursor was not on the line itself.

# Check if the left side has moved and update the slicer accordingly
if self.left_line.has_move:
self.main_line.update()
self.left_line.update(phi=None, delta=None, mline=self.main_line,
side=True, left=True)
self.right_line.update(phi=self.left_line.phi, delta=None,
mline=self.main_line, side=True,
left=False, right=True)
mline=self.main_line, side=True, right=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary? The default value of left is False so you probably don't need to explicitly set it

# Check if the right side line has moved and update the slicer accordingly
if self.right_line.has_move:
self.main_line.update()
self.right_line.update(phi=None, delta=None, mline=self.main_line,
side=True, left=False, right=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above

@butlerpd butlerpd added the Discuss At The Call Issues to be discussed at the fortnightly call label Jul 16, 2023
…Also added back a superfluous self.update() call for consistency with the other slicers.
@butlerpd
Copy link
Member Author

I would like to review this a bit more closely as the fix suggests some possible deeper problems in the code. Since we are now working heavily on this bit, it is worth checking this out I think.

@butlerpd butlerpd removed the Discuss At The Call Issues to be discussed at the fortnightly call label Jul 31, 2023
@lucas-wilkins
Copy link
Contributor

Everything in this PR is in #2566 - I'm closing it.

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

Successfully merging this pull request may close these issues.

Problem with dragging slicer elements on plot
6 participants