Skip to content

Commit

Permalink
Merge pull request #239 from spacetelescope/CATKIT-99-MCLS1-emulator-…
Browse files Browse the repository at this point in the history
…floating-point

CATKIT-99: MCLS1 emulator floating point casting
  • Loading branch information
jamienoss committed Jul 6, 2021
2 parents 65a1abe + 9516efa commit fefdf08
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions catkit/emulators/thorlabs/MCLS1.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,15 @@ def fnUART_LIBRARY_Set(self, handle, command, size, *args, **kwargs):
raise RuntimeError(f"Expected SET command ('=') but got '{command}'")

command, value = command.replace(self.Command.TERM_CHAR.value, '').split("=")
value = int(value)
command += "="
command = self.Command(command)

if command is self.Command.SET_SYSTEM:
self.system_enabled = bool(value)
self.system_enabled = bool(int(value))
elif command is self.Command.SET_CHANNEL:
self.active_channel = int(value)
elif command is self.Command.SET_ENABLE:
self.channel_enabled[self.active_channel-1] = bool(value)
self.channel_enabled[self.active_channel-1] = bool(int(value))
elif command is self.Command.SET_CURRENT:
self.current[self.active_channel-1] = float(value)
else:
Expand Down

0 comments on commit fefdf08

Please sign in to comment.