Skip to content

Commit

Permalink
Merge pull request #9 from NSLS-II-IOS/fix_escan
Browse files Browse the repository at this point in the history
FIX: deal with type change in value from enum callbacks
  • Loading branch information
irawaluyo authored Jan 29, 2021
2 parents a9def40 + 014e8e4 commit ff7ae5d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions startup/98-ramp.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,14 @@ def go_plan():
st = StatusBase()
enum_map = pgm.fly.scan_status.describe()[pgm.fly.scan_status.name]['enum_strs']
def _done_cb(value, old_value, **kwargs):
old_value = enum_map[int(old_value)]
value = enum_map[int(value)]
try:
old_value = enum_map[int(old_value)]
except (TypeError, ValueError):
...
try:
value = enum_map[int(value)]
except (TypeError, ValueError):
...
if old_value != value and value == 'Ready':
st._finished()
pgm.fly.scan_status.clear_sub(_done_cb)
Expand Down

0 comments on commit ff7ae5d

Please sign in to comment.