-
Notifications
You must be signed in to change notification settings - Fork 88
Expand file tree
/
Copy pathblacs_tabs.py
More file actions
60 lines (51 loc) 路 2.86 KB
/
Copy pathblacs_tabs.py
File metadata and controls
60 lines (51 loc) 路 2.86 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
#####################################################################
# #
# /labscript_devices/AD9959DDSSweeper/blacs_tabs.py #
# #
# Copyright 2025, Carter Turnbaugh #
# #
# This file is part of the module 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 AD9959DDSSweeperTab(DeviceTab):
def initialise_GUI(self):
device = self.settings['connection_table'].find_by_name(self.device_name)
ref_clk_freq = device.properties['ref_clock_frequency']
pll_mult = device.properties['pll_mult']
self.com_port = device.properties['com_port']
max_freq = 0.5 * (ref_clk_freq * pll_mult)
# Capabilities
self.base_units = {'freq':'Hz', 'amp':'Arb', 'phase':'Degrees'}
self.base_min = {'freq':0.0, 'amp':0, 'phase':0}
self.base_max = {'freq':max_freq, 'amp':1, 'phase':360}
self.base_step = {'freq':10**6, 'amp':1/1023., 'phase':1}
self.base_decimals = {'freq':1, 'amp':4, 'phase':3}
self.num_DDS = 4
dds_prop = {}
for i in range(self.num_DDS):
dds_prop['channel %d' % i] = {}
for subchnl in ['freq', 'amp', 'phase']:
dds_prop['channel %d' % i][subchnl] = {'base_unit':self.base_units[subchnl],
'min':self.base_min[subchnl],
'max':self.base_max[subchnl],
'step':self.base_step[subchnl],
'decimals':self.base_decimals[subchnl]
}
self.create_dds_outputs(dds_prop)
dds_widgets, _, _ = self.auto_create_widgets()
self.auto_place_widgets(('DDS Outputs', dds_widgets))
self.supports_remote_value_check(False)
self.supports_smart_programming(True)
def initialise_workers(self):
self.create_worker(
"main_worker",
"labscript_devices.AD9959DDSSweeper.blacs_workers.AD9959DDSSweeperWorker",
{
'com_port': self.com_port,
},
)
self.primary_worker = "main_worker"