Skip to content

Commit

Permalink
Fix monitor for channel parameters (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshnielsen committed Sep 11, 2017
1 parent 570fddb commit dc52646
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions qcodes/monitor/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

def _get_metadata(*parameters) -> Dict[float, list]:
"""
Return a dict that contains the paraemter metadata grouped by the
Return a dict that contains the parameter metadata grouped by the
instrument it belongs to.
"""
ts = time.time()
Expand All @@ -45,16 +45,20 @@ def _get_metadata(*parameters) -> Dict[float, list]:
if _meta:
meta = _meta()
else:
raise ValueError("Input is not a paraemter; Refusing to proceed")
raise ValueError("Input is not a parameter; Refusing to proceed")
# convert to string
meta['value'] = str(meta['value'])
if meta["ts"] is not None:
meta["ts"] = time.mktime(meta["ts"].timetuple())
meta["name"] = parameter.label or parameter.name
meta["unit"] = parameter.unit
accumulator = metas.get(str(parameter._instrument), [])
# find the base instrument in case this is a channel parameter
baseinst = parameter._instrument
while hasattr(baseinst, '_parent'):
baseinst = baseinst._parent
accumulator = metas.get(str(baseinst), [])
accumulator.append(meta)
metas[str(parameter._instrument)] = accumulator
metas[str(baseinst)] = accumulator
parameters = []
for instrument in metas:
temp = {"instrument": instrument, "parameters": metas[instrument]}
Expand Down Expand Up @@ -117,7 +121,7 @@ def run(self):

def stop(self):
"""
Shutodwn the server, close the event loop and join the thread
Shutdown the server, close the event loop and join the thread
"""
# this contains the server
# or any exception
Expand Down

0 comments on commit dc52646

Please sign in to comment.