-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathblacs_tabs.py
More file actions
80 lines (64 loc) · 3.79 KB
/
blacs_tabs.py
File metadata and controls
80 lines (64 loc) · 3.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#####################################################################
# #
# /labscript_devices/Windfreak/blacs_tabs.py #
# #
# Copyright 2022, Monash University and contributors #
# #
# This file is part of labscript_devices, in the labscript suite #
# (see http://labscriptsuite.org), and is licensed under the #
# Simplified BSD License. See the license.txt file in the root of #
# the project for the full license. #
# #
#####################################################################
from blacs.device_base_class import DeviceTab
class WindfreakSynthHDTab(DeviceTab):
def __init__(self, *args, **kwargs):
if not hasattr(self,'device_worker_class'):
self.device_worker_class = 'labscript_devices.Windfreak.blacs_workers.WindfreakSynthHDWorker'
DeviceTab.__init__(self, *args, **kwargs)
def initialise_GUI(self):
conn_obj = self.settings['connection_table'].find_by_name(self.device_name).properties
self.allowed_chans = conn_obj.get('allowed_chans',None)
# finish populating these from device properties
chan_prop = {'freq':{},'amp':{},'phase':{},'gate':{}}
freq_limits = conn_obj.get('freq_limits',None)
chan_prop['freq']['min'] = freq_limits[0]
chan_prop['freq']['max'] = freq_limits[1]
chan_prop['freq']['decimals'] = conn_obj.get('freq_res',None)
chan_prop['freq']['base_unit'] = 'Hz'
chan_prop['freq']['step'] = 100
amp_limits = conn_obj.get('amp_limits',None)
chan_prop['amp']['min'] = amp_limits[0]
chan_prop['amp']['max'] = amp_limits[1]
chan_prop['amp']['decimals'] = conn_obj.get('amp_res',None)
chan_prop['amp']['base_unit'] = 'dBm'
chan_prop['amp']['step'] = 1
phase_limits = conn_obj.get('phase_limits',None)
chan_prop['phase']['min'] = phase_limits[0]
chan_prop['phase']['max'] = phase_limits[1]
chan_prop['phase']['decimals'] = conn_obj.get('phase_res',None)
chan_prop['phase']['base_unit'] = 'deg'
chan_prop['phase']['step'] = 1
dds_prop = {}
for chan in self.allowed_chans:
dds_prop[f'channel {chan:d}'] = chan_prop
self.create_dds_outputs(dds_prop)
dds_widgets,ao_widgets,do_widgets = self.auto_create_widgets()
self.auto_place_widgets(('Synth Outputs',dds_widgets))
DeviceTab.initialise_GUI(self)
# set capabilities
self.supports_remote_value_check(True)
self.supports_smart_programming(True)
#self.statemachine_timeout_add(5000,self.status_monitor)
def initialise_workers(self):
conn_obj = self.settings['connection_table'].find_by_name(self.device_name).properties
self.com_port = conn_obj.get('com_port',None)
self.trigger_mode = conn_obj.get('trigger_mode','disabled')
self.reference_mode = conn_obj['reference_mode']
self.reference_frequency = conn_obj['reference_frequency']
self.create_worker('main_worker',self.device_worker_class,{'com_port':self.com_port,
'allowed_chans':self.allowed_chans,
'trigger_mode':self.trigger_mode,
'reference_mode':self.reference_mode,
'reference_frequency':self.reference_frequency})
self.primary_worker = 'main_worker'