Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
refactor: print info on overshoot after processing all data
Browse files Browse the repository at this point in the history
It may happen (race-condition) that "Correcting overshoot" info
message appears in the middle of the records output. This is
missleading. Change the approach and only print info on overshoot
correction after all the data were processed. This way they will never
mix with the records output.
  • Loading branch information
reszelaz committed Oct 29, 2021
1 parent d9d79a7 commit ead90c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sardana/macroserver/scan/gscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -2674,7 +2674,6 @@ def on_waypoints_end(self, restore_positions=None):
if restore_positions is not None:
self._restore_motors() # first restore motors backup
self._setFastMotions() # then try to go even faster (limits)
self.macro.info("Correcting overshoot...")
self._physical_motion.move(restore_positions)
self.motion_end_event.set()
self.cleanup()
Expand All @@ -2683,6 +2682,10 @@ def on_waypoints_end(self, restore_positions=None):
self.join_thread_pool()
self.debug("All data events are processed")
self.data.endRecords()
if restore_positions is not None:
self.macro.info("Overshoot was corrected")
else:
self.macro.info("Overshoot was not corrected")

# Note: The commented out code below works, but due to an issue with
# output of the last measurement point, it should not be enabled yet.
Expand Down

0 comments on commit ead90c2

Please sign in to comment.