def setUp(self): self.p = Process("proc") for c in detector_block("mri", config_dir="/tmp"): self.p.add_controller(c) self.p.start() self.b = self.p.block_view("mri") self.tmpdir = tempfile.mkdtemp()
def setUp(self): self.p = Process("proc") for c in (detector_block("DETECTOR", config_dir="/tmp") + motion_block("MOTION", config_dir="/tmp") + scan_1det_block("SCANMRI", config_dir="/tmp")): self.p.add_controller(c) self.pub = PublishController("PUB") self.p.add_controller(self.pub) self.p.start() self.b = self.p.block_view("SCANMRI") self.bd = self.p.block_view("DETECTOR") self.tmpdir = tempfile.mkdtemp()
def setUp(self): self.process = Process("proc") for controller in detector_block( mri="TESTDET", config_dir="/tmp") + pva_server_block(mri="PVA-SERVER"): self.process.add_controller(controller) self.process.start() self.process2 = Process("proc2") for controller in pva_client_block(mri="PVA-CLIENT") + proxy_block( mri="TESTDET", comms="PVA-CLIENT"): self.process2.add_controller(controller) self.process2.start() self.tmpdir = tempfile.mkdtemp()
def setUp(self): self.process = Process("Process") self.context = Context(self.process) # Create a fake PandA with a pulse block self.panda = ManagerController("PANDA", "/tmp") controller = BasicController("PANDA:PULSE3") self.pulse_part = PulsePart("part") controller.add_part(self.pulse_part) self.process.add_controller(controller) self.panda.add_part( ChildPart("PULSE3", "PANDA:PULSE3", initial_visibility=True, stateful=False)) self.process.add_controller(self.panda) # And the detector self.config_dir = tmp_dir("config_dir") for c in detector_block("DET", config_dir=self.config_dir.value): self.process.add_controller(c) # Make the child block holding panda and pmac mri self.child = self.create_child_block( panda_pulse_trigger_block, self.process, mri="SCAN:PULSE", panda="PANDA", detector="DET", ) # And our part under test self.o = PandAPulseTriggerPart("detTrigger", "SCAN:PULSE") # Add in a scan block self.scan = RunnableController("SCAN", "/tmp") self.scan.add_part(DetectorChildPart("det", "DET", True)) self.scan.add_part(self.o) self.process.add_controller(self.scan) # Now start the process off and tell the panda which sequencer tables # to use self.process.start() exports = ExportTable.from_rows([ ("PULSE3.width", "detTriggerWidth"), ("PULSE3.step", "detTriggerStep"), ("PULSE3.delay", "detTriggerDelay"), ("PULSE3.pulses", "detTriggerPulses"), ]) self.panda.set_exports(exports) self.tmpdir = tempfile.mkdtemp()