|
| 1 | +##################################################################### |
| 2 | +# # |
| 3 | +# /labscript_devices/PrawnDO/blacs_tabs.py # |
| 4 | +# # |
| 5 | +# Copyright 2023, Philip Starkey, Carter Turnbaugh, Patrick Miller # |
| 6 | +# # |
| 7 | +# This file is part of labscript_devices, in the labscript suite # |
| 8 | +# (see http://labscriptsuite.org), and is licensed under the # |
| 9 | +# Simplified BSD License. See the license.txt file in the root of # |
| 10 | +# the project for the full license. # |
| 11 | +# # |
| 12 | +##################################################################### |
| 13 | +from blacs.device_base_class import DeviceTab |
| 14 | + |
| 15 | +class PrawnDOTab(DeviceTab): |
| 16 | + def initialise_GUI(self): |
| 17 | + do_prop = {} |
| 18 | + for i in range(0, 16): |
| 19 | + do_prop['0x{:01X}'.format(i)] = {} |
| 20 | + self.create_digital_outputs(do_prop) |
| 21 | + |
| 22 | + _, _, do_widgets = self.auto_create_widgets() |
| 23 | + self.auto_place_widgets(do_widgets) |
| 24 | + |
| 25 | + device = self.settings['connection_table'].find_by_name(self.device_name) |
| 26 | + |
| 27 | + self.com_port = device.properties['com_port'] |
| 28 | + |
| 29 | + self.supports_remote_value_check(True) |
| 30 | + self.supports_smart_programming(True) |
| 31 | + |
| 32 | + |
| 33 | + def initialise_workers(self): |
| 34 | + self.create_worker( |
| 35 | + "main_worker", |
| 36 | + "naqslab_devices.prawn_digital_output_labscript.blacs_workers.PrawnDOWorker", |
| 37 | + { |
| 38 | + 'com_port': self.com_port, |
| 39 | + }, |
| 40 | + ) |
| 41 | + self.primary_worker = "main_worker" |
0 commit comments