Skip to content
Snippets Groups Projects
Commit 30a9837c authored by Sander Snoo's avatar Sander Snoo
Browse files

Improved creation of instruments

parent a063a5d3
No related branches found
No related tags found
No related merge requests found
......@@ -24,9 +24,9 @@ else:
def station_get_or_create(func):
def wrapper(name, *args, **kwargs):
try:
if name in station.components:
return station[name]
except:
else:
component = func(name, *args, **kwargs)
station.add_component(component)
return component
......
......@@ -11,9 +11,9 @@ else:
_use_dummy=True
def add_awg(name, slot_nr):
try:
if name in station.components:
awg = station[name]
except:
else:
awg = MockM3202A_QS(name, 0, slot_nr)
station.add_component(awg)
return awg
......@@ -27,4 +27,5 @@ def add_dig(name, slot_nr):
return dig
awg1 = add_awg('AWG1', 2)
dig1 = add_dig('Dig1', 5)
awg2 = add_awg('AWG2', 5)
dig1 = add_dig('Dig1', 7)
......@@ -12,13 +12,14 @@ except:
def add_module(module_type, name, ip_addr):
try:
if name in station.components:
pulsar = station[name]
except:
else:
if _use_simulator:
if not _q1simulator_found:
raise Exception('q1simulator not found')
pulsar = Q1Simulator(name, sim_type=module_type)
# pulsar.config('trace', True)
elif _use_dummy:
print(f'Starting {module_type} {name} dummy')
pulsar = Pulsar(name, ip_addr, dummy_type='Pulsar '+module_type)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment