Skip to content

Commit

Permalink
Improve error message and tooltip
Browse files Browse the repository at this point in the history
Provide a clearer error message if no direction has been selected and
also provide better information in the tooltip.
  • Loading branch information
rbauststfc committed Sep 27, 2024
1 parent fadb590 commit b9d7a0f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/Interface/ui/sans_isis/beam_centre.ui
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
<item row="13" column="0" colspan="5">
<widget class="QGroupBox" name="groupBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Controls in which directions the algorithm will search for the beam centre.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Controls in which directions the algorithm will search for the beam centre. One or more options must be selected.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="title">
<string>Direction</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def find_beam_centre(self, state: AllStates, settings: BeamCentreFields) -> Opti
"""
centre_finder = SANSCentreFinder()
if not settings.find_direction:
self._logger.error("Have chosen no find direction exiting early")
self._logger.error("No direction has been selected - please select either one or both of the Direction checkboxes.")
raise ValueError("Unable to run beam centre finder as no direction settings have been provided.")

pos_1 = settings.lab_pos_1 if settings.component is DetectorType.LAB else settings.hab_pos_1
Expand Down

0 comments on commit b9d7a0f

Please sign in to comment.