MCPcopy Create free account
hub / github.com/LabPy/lantz / Lambda103

Class Lambda103

lantz/drivers/sutter/lambda103.py:24–81  ·  view source on GitHub ↗

High performance, microprocessor-controlled multi-filter wheel system for imaging applications requiring up to 3 filter wheels.

Source from the content-addressed store, hash-verified

22
23
24class Lambda103(MessageBasedDriver):
25 """High performance, microprocessor-controlled multi-filter wheel system
26 for imaging applications requiring up to 3 filter wheels.
27 """
28
29 DEFAULTS = {'ASRL': {'write_termination': '',
30 'read_termination': '',
31 }}
32
33
34 def initialize(self):
35 super().initialize()
36 self.speed = 1
37
38 @Feat(None, values={True: chr(170), False: chr(172)})
39 def open_A(self, value):
40 """Open shutter A.
41 """
42 self.send(value)
43
44 @logged
45 def flush(self):
46 """Flush.
47 """
48 self.serial.flushInput()
49 self.serial.flushOutput()
50 self.serial.flush()
51
52 # TODO: WTF 2 values for the same wheel
53 @DictFeat(None, keys={'A': 0, 'B': 1})
54 def position(self, key, value):
55 """Set filter wheel position and speed.
56
57 w = 0 -> Filter wheels A and C
58 w = 1 -> Fliter wheel B
59 """
60 command = chr( key * 128 + self.speed * 14 + value)
61 self.send(command)
62
63 @Action()
64 def motorsON(self):
65 """Power on all motors."""
66 self.send(chr(206))
67 return "Motors ON"
68
69 @Action()
70 def status(self):
71 return "Status {}".format(self.query(chr(204)))
72
73 @Feat(None, values={True: chr(238), False: chr(239)})
74 def remote(self, value):
75 """Set Local-Mode."""
76 self.send(value)
77
78 @Action()
79 def reset(self):
80 """Reset the controller."""
81 self.send(chr(251))

Callers 1

lambda103.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected