Add reset buttons to sliders in new Instrument View#40830
Add reset buttons to sliders in new Instrument View#40830jclarkeSTFC wants to merge 8 commits intomantidproject:mainfrom
Conversation
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
📝 WalkthroughWalkthroughThis pull request implements reset button functionality for the Instrument View sliders. The release notes documentation was updated to reflect the new feature. The view model now stores full limit values for integration and counts ranges. The presenter introduces two new methods to handle integration and contour range reset actions. The window class extends the min/max group box UI component to include reset buttons, adds helper methods to update edit boxes with new limit values, and establishes signal connections between the reset buttons and presenter methods. Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@qt/python/instrumentview/instrumentview/FullInstrumentViewPresenter.py`:
- Around line 144-148: The reset handler on_integration_limits_reset_clicked
calls update_integration_range(...) which recalculates counts but does not
assign the model's integration_limits, leaving _integration_limits stale; after
calling update_integration_range(self._model.full_integration_limits,
entire_range=True) explicitly set the model's integration_limits to the
full_integration_limits (e.g. self._model.integration_limits =
self._model.full_integration_limits or via the model's setter if one exists)
before updating the view with set_integration_range_limits,
set_integration_min_max_boxes and set_view_integration_limits so downstream
save/export reads the updated limits.
|
Note Unit test generation is a public access feature. Expect some limitations and changes as we gather feedback and continue to improve it. Generating unit tests... This may take up to 20 minutes. |
This comment was marked as resolved.
This comment was marked as resolved.
andy-bridger
left a comment
There was a problem hiding this comment.
I have played around with it and am happy that it functions as described, I have a few questions as to things that may well be intentional choices and/or targets of future work, so just say the word and I am happy to approve this for what it is.
My main question is for the contour range limits. By having the fixed max and min limits based on the integration of the entire spectrum, if I have cropped to a small subset of my data with the integration limit slider, I can't obtain meaningful contours as all the integrated counts in this new integration range are below the global lower limit - could the contour range limits be dynamic and depend on the integration limits?
Follow up is about the integration limits, and this one is I'm guessing something that has already been discussed/ decided upon. I would have found it useful for testing this if the integration limits chosen were reflected in the plotted spectra as well as in the instrument render, is this going to be done in future?
When changing the integration limits, the count range needs to be updated, otherwise the contour will be showing a range that is not useful.
When setting the x limits on the line plot, we need to handle any unit conversion from the workspace unit to the currentl selected unit for the line plot.
Thanks, I think I've implemented both of the things you mentioned, should be more usable now. |


Instead of dragging the contour and integration limit sliders in the new Instrument View, one can now click a reset button to return to the maximum range.
Closes #40776.
To test:
Play around with both sliders and min/max edit boxes, check that the button works and the image updates correctly
Reviewer
Your comments will be used as part of the gatekeeper process. Comment clearly on what you have checked and tested during your review. Provide an audit trail for any changes requested.
As per the review guidelines:
mantid-developersormantid-contributorsteams, add a review commentrerun cito authorize/rerun the CIGatekeeper
As per the gatekeeping guidelines: