Skip to content

Commit

Permalink
(DiamondLightSource/hyperion#808) Run pin tip callback on trigger and…
Browse files Browse the repository at this point in the history
… ensure no race condition
  • Loading branch information
DominicOram committed Jul 17, 2023
1 parent 77d9ee6 commit 521239e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dodal/devices/areadetector/plugins/MXSC.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ class PinTipDetect(Device):
def update_tip_if_valid(self, value, **_):
current_value = (value, self.tip_y.get())
if current_value != self.INVALID_POSITION:
self.triggered_tip.set(current_value)
self.triggered_tip.put(current_value)
return True

def trigger(self) -> Status:
subscription_status = SubscriptionStatus(
self.tip_x, self.update_tip_if_valid, run=False
) # Do not run on creation as the PV updates often and can cause race conditions
self.tip_x, self.update_tip_if_valid, run=True
)

def set_to_default_and_finish(timeout_status: Status):
try:
Expand Down

0 comments on commit 521239e

Please sign in to comment.