forked from M-Labs/artiq
device_db: make target_name parameter optional for controllers
This commit is contained in:
parent
5947f54855
commit
a5606768ad
|
@ -9,7 +9,7 @@ import numpy
|
||||||
import h5py
|
import h5py
|
||||||
|
|
||||||
from artiq.protocols.sync_struct import Notifier
|
from artiq.protocols.sync_struct import Notifier
|
||||||
from artiq.protocols.pc_rpc import Client, BestEffortClient
|
from artiq.protocols.pc_rpc import AutoTarget, Client, BestEffortClient
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
@ -25,8 +25,13 @@ def _create_device(desc, device_mgr):
|
||||||
if desc["best_effort"]:
|
if desc["best_effort"]:
|
||||||
cl = BestEffortClient
|
cl = BestEffortClient
|
||||||
else:
|
else:
|
||||||
cl = Client
|
cls = Client
|
||||||
return cl(desc["host"], desc["port"], desc["target_name"])
|
# Automatic target can be specified either by the absence of
|
||||||
|
# the target_name parameter, or a None value.
|
||||||
|
target_name = desc.get("target_name", None)
|
||||||
|
if target_name is None:
|
||||||
|
target_name = AutoTarget
|
||||||
|
return cls(desc["host"], desc["port"], target_name)
|
||||||
else:
|
else:
|
||||||
raise ValueError("Unsupported type in device DB: " + ty)
|
raise ValueError("Unsupported type in device DB: " + ty)
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,6 @@
|
||||||
"best_effort": false,
|
"best_effort": false,
|
||||||
"host": "::1",
|
"host": "::1",
|
||||||
"port": 4000,
|
"port": 4000,
|
||||||
"target_name": "pdq2",
|
|
||||||
"command": "pdq2_controller -p {port} --bind {bind} --simulation --dump qc_q1_0.bin"
|
"command": "pdq2_controller -p {port} --bind {bind} --simulation --dump qc_q1_0.bin"
|
||||||
},
|
},
|
||||||
"qc_q1_1": {
|
"qc_q1_1": {
|
||||||
|
@ -103,7 +102,6 @@
|
||||||
"best_effort": false,
|
"best_effort": false,
|
||||||
"host": "::1",
|
"host": "::1",
|
||||||
"port": 4001,
|
"port": 4001,
|
||||||
"target_name": "pdq2",
|
|
||||||
"command": "pdq2_controller -p {port} --bind {bind} --simulation --dump qc_q1_1.bin"
|
"command": "pdq2_controller -p {port} --bind {bind} --simulation --dump qc_q1_1.bin"
|
||||||
},
|
},
|
||||||
"qc_q1_2": {
|
"qc_q1_2": {
|
||||||
|
@ -111,7 +109,6 @@
|
||||||
"best_effort": false,
|
"best_effort": false,
|
||||||
"host": "::1",
|
"host": "::1",
|
||||||
"port": 4002,
|
"port": 4002,
|
||||||
"target_name": "pdq2",
|
|
||||||
"command": "pdq2_controller -p {port} --bind {bind} --simulation --dump qc_q1_2.bin"
|
"command": "pdq2_controller -p {port} --bind {bind} --simulation --dump qc_q1_2.bin"
|
||||||
},
|
},
|
||||||
"qc_q1_3": {
|
"qc_q1_3": {
|
||||||
|
@ -119,7 +116,6 @@
|
||||||
"best_effort": false,
|
"best_effort": false,
|
||||||
"host": "::1",
|
"host": "::1",
|
||||||
"port": 4003,
|
"port": 4003,
|
||||||
"target_name": "pdq2",
|
|
||||||
"command": "pdq2_controller -p {port} --bind {bind} --simulation --dump qc_q1_3.bin"
|
"command": "pdq2_controller -p {port} --bind {bind} --simulation --dump qc_q1_3.bin"
|
||||||
},
|
},
|
||||||
"electrodes": {
|
"electrodes": {
|
||||||
|
@ -138,7 +134,6 @@
|
||||||
"best_effort": true,
|
"best_effort": true,
|
||||||
"host": "::1",
|
"host": "::1",
|
||||||
"port": 3253,
|
"port": 3253,
|
||||||
"target_name": "lda",
|
|
||||||
"command": "lda_controller -p {port} --bind {bind} --simulation"
|
"command": "lda_controller -p {port} --bind {bind} --simulation"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue