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