From 68b2373b9ae724863d9214200e32ff260164abce Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 19 Dec 2016 09:49:44 +0100 Subject: [PATCH] korad_ka3005p: fix simulation mode --- artiq/devices/korad_ka3005p/driver.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/artiq/devices/korad_ka3005p/driver.py b/artiq/devices/korad_ka3005p/driver.py index 1702715da..b2546b183 100644 --- a/artiq/devices/korad_ka3005p/driver.py +++ b/artiq/devices/korad_ka3005p/driver.py @@ -47,9 +47,12 @@ class KoradKA3005P: return r async def _ser_write(self, cmd): - logger.debug("_write %s: ", cmd) - await asyncio.sleep(0.1) - await self.port.write(cmd.encode('ascii')) + if self.simulation: + logger.info("simulation _ser_write(\"%s\")", cmd) + else: + logger.debug("_ser_write(\"%s\")", cmd) + await asyncio.sleep(0.1) + await self.port.write(cmd.encode("ascii")) async def setup(self): """Configure in known state."""