Skip to content

do not plot missleding plot - #1240

Open
sergey-yaroslavtsev wants to merge 2 commits into
masterfrom
diff_motors
Open

do not plot missleding plot#1240
sergey-yaroslavtsev wants to merge 2 commits into
masterfrom
diff_motors

Conversation

@sergey-yaroslavtsev

Copy link
Copy Markdown
Collaborator

Fix bug reported in #1227

It respects the feature of selecting more than 4 scans at a time.

To be clear the bug reported in #1227 was happening ONLY in "AUTO" tab for counters/motors

@sergey-yaroslavtsev

Copy link
Copy Markdown
Collaborator Author
Screen.Recording.2026-08-05.132846.mp4

self.mainLayout.setContentsMargins(0, 0, 0, 0)
self.mainLayout.setSpacing(0)
self.sourceList = []
self.compatibility = True

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

compatibility with what?

@sergey-yaroslavtsev sergey-yaroslavtsev Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Of selected scans to be plotted or motor names in scans (depending from which perspective to look on it).
rename into coincide_motors_names? or plots_compatibility?

traceback.format_exc())
msg.exec()
continue
# see QNexusWidget

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

See what?

elif len(sel_list) > 1:
self._addSelectionSlot([sel_list[0]], event="replaceSelection")
self._addSelectionSlot(sel_list[1:], event="addSelection")
if self.compatibility == True:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if self.compatibility == True:
if self.compatibility:

compatibility does not need to be public and needs a better name.

Judging from it usage _canBeAdded?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm worried about self.compatibility (apart from the name and its public nature).

It seems that the idea is

  • the first _addSelectionSlot call resets self.compatibility=True/False
  • if _addSelectionSlot we do the second call
  • the first _addSelectionSlot call resets self.compatibility=True/False

What happens with self.compatibility=True/False from the second call? Could it be different than the first call?

To me it seems like we don't need self.compatibility and instead _addSelectionSlot should return something.

@sergey-yaroslavtsev

Copy link
Copy Markdown
Collaborator Author

I did it through return.
To be honest i tried it on the first place but failed... probably just did the mistake, because now it seems to work the same way.

@sergey-yaroslavtsev

sergey-yaroslavtsev commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

The remain misleading thing is that selection in the HDF5 tree remain, but it is probably OK...
Cleaning selection could lead to undesired behavior, smthg like: user select few things, then one thing which is incompatible with others - and whole selection is gone; clean only last selection is not possible because it could be from Shift+Click (it will be very hard to track it properly).

@sergey-yaroslavtsev

Copy link
Copy Markdown
Collaborator Author

selection misleading:

Screen.Recording.2026-08-06.165731.mp4

@sergey-yaroslavtsev

sergey-yaroslavtsev commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

Suggestion/idea for another PR would be to do the following:
If multiple things are selected then on the moment of plotting (if it is accepted to be plotted)- deselect things which are actually not plotted and pop up the info message about 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.

2 participants