pdq2/mediator: get pdq devices from pdb

This commit is contained in:
Sebastien Bourdeauducq 2015-03-22 00:24:42 +01:00
parent 494c670cd2
commit 7e61f66493
2 changed files with 43 additions and 6 deletions

View File

@ -114,15 +114,20 @@ class _Frame:
class CompoundPDQ2(AutoDB): class CompoundPDQ2(AutoDB):
class DBKeys: class DBKeys:
core = Device() core = Device()
ids = Argument() pdq2_devices = Argument()
rtio_trigger = Argument() rtio_trigger = Argument()
rtio_frame = Argument() rtio_frame = Argument()
def build(self): def build(self):
self.trigger = rtio.LLRTIOOut(core=self.core, channel=self.rtio_trigger) self.pdq2s = [self.dbh.get_device(d) for d in self.pdq2_devices]
self.frame0 = rtio.LLRTIOOut(core=self.core, channel=self.rtio_frame[0]) self.trigger = rtio.LLRTIOOut(
self.frame1 = rtio.LLRTIOOut(core=self.core, channel=self.rtio_frame[1]) core=self.core, channel=self.rtio_trigger)
self.frame2 = rtio.LLRTIOOut(core=self.core, channel=self.rtio_frame[2]) self.frame0 = rtio.LLRTIOOut(
core=self.core, channel=self.rtio_frame[0])
self.frame1 = rtio.LLRTIOOut(
core=self.core, channel=self.rtio_frame[1])
self.frame2 = rtio.LLRTIOOut(
core=self.core, channel=self.rtio_frame[2])
self.frames = [] self.frames = []
self.current_frame = -1 self.current_frame = -1

View File

@ -70,12 +70,44 @@
"arguments": {"reg_channel": 2, "rtio_switch": 7} "arguments": {"reg_channel": 2, "rtio_switch": 7}
}, },
"qc_q1_0": {
"type": "controller",
"best_effort": false,
"host": "::1",
"port": 4000,
"target_name": "pdq2",
"command": "pdq2_controller -p {port} --bind {bind} --dump qc_q1_0.bin"
},
"qc_q1_1": {
"type": "controller",
"best_effort": false,
"host": "::1",
"port": 4001,
"target_name": "pdq2",
"command": "pdq2_controller -p {port} --bind {bind} --dump qc_q1_1.bin"
},
"qc_q1_2": {
"type": "controller",
"best_effort": false,
"host": "::1",
"port": 4002,
"target_name": "pdq2",
"command": "pdq2_controller -p {port} --bind {bind} --dump qc_q1_2.bin"
},
"qc_q1_3": {
"type": "controller",
"best_effort": false,
"host": "::1",
"port": 4003,
"target_name": "pdq2",
"command": "pdq2_controller -p {port} --bind {bind} --dump qc_q1_3.bin"
},
"electrodes": { "electrodes": {
"type": "local", "type": "local",
"module": "artiq.devices.pdq2", "module": "artiq.devices.pdq2",
"class": "CompoundPDQ2", "class": "CompoundPDQ2",
"arguments": { "arguments": {
"ids": ["qc_q1_0", "qc_q1_1", "qc_q1_2", "qc_q1_3"], "pdq2_devices": ["qc_q1_0", "qc_q1_1", "qc_q1_2", "qc_q1_3"],
"rtio_trigger": 7, "rtio_trigger": 7,
"rtio_frame": (2, 3, 4) "rtio_frame": (2, 3, 4)
}, },