Skip to content

Commit 01e919d

Browse files
committedMar 10, 2016
novatech409b: log sim commands, style
1 parent 878ab9a commit 01e919d

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed
 

Diff for: ‎artiq/devices/novatech409b/driver.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def _ser_send(self, cmd, get_response=True):
6565
# ser_send("F0 1.0") # sets the freq of channel 0 to 1.0 MHz
6666

6767
if self.simulation:
68-
print(cmd)
68+
logger.info("simulation _ser_send(\"%s\")", cmd)
6969
else:
7070
self.port.flushInput()
7171
self.port.write((cmd + "\r\n").encode())
@@ -81,7 +81,8 @@ def _ser_send(self, cmd, get_response=True):
8181
errstr = self.error_codes[result]
8282
except KeyError:
8383
errstr = "Unrecognized reply: '{}'".format(result)
84-
s = "Error Code = {ec}, {ecs}".format(ec=result, ecs=errstr)
84+
s = "Error Code = {ec}, {ecs}".format(
85+
ec=result, ecs=errstr)
8586
raise UnexpectedResponse(s)
8687
else:
8788
pass
@@ -144,7 +145,7 @@ def do_simultaneous_update(self):
144145
def set_freq(self, ch_no, freq):
145146
"""Set frequency of one channel."""
146147
# Novatech expects MHz
147-
self._ser_send("F{:d} {:f}".format(ch_no, freq/1e6))
148+
self._ser_send("F{:d} {:f}".format(ch_no, freq/1e6))
148149

149150
def set_phase(self, ch_no, phase):
150151
"""Set phase of one channel."""
@@ -171,10 +172,10 @@ def set_gain(self, ch_no, volts):
171172
def get_status(self):
172173
if self.simulation:
173174
return ["00989680 2000 01F5 0000 00000000 00000000 000301",
174-
"00989680 2000 01F5 0000 00000000 00000000 000301",
175-
"00989680 2000 01F5 0000 00000000 00000000 000301",
176-
"00989680 2000 01F5 0000 00000000 00000000 000301",
177-
"80 BC0000 0000 0102 21"]
175+
"00989680 2000 01F5 0000 00000000 00000000 000301",
176+
"00989680 2000 01F5 0000 00000000 00000000 000301",
177+
"00989680 2000 01F5 0000 00000000 00000000 000301",
178+
"80 BC0000 0000 0102 21"]
178179
else:
179180
# status message is multi-line
180181
self.port.flushInput()

0 commit comments

Comments
 (0)
Please sign in to comment.