Commit 8902e0eb authored by rpi2.0's avatar rpi2.0
Browse files

sets sequence through http interface bug fixing

Showing with 3 additions and 2 deletions
+3 -2
......@@ -16,7 +16,7 @@ OHMPI_CONFIG = {
'integer': 2, # Max value 10 # TODO: Explain what this is...
'version': 2,
'max_elec': 64,
'board_addresses': {'A': 0x70, 'B': 0x71, 'M': 0x72, 'N': 0x73}, # def. {'A': 0x76, 'B': 0x71, 'M': 0x74, 'N': 0x70}
'board_addresses': {'A': 0x73, 'B': 0x72, 'M': 0x71, 'N': 0x70}, # def. {'A': 0x76, 'B': 0x71, 'M': 0x74, 'N': 0x70}
'settings': 'ohmpi_settings.json'
} # TODO: add a dictionary with INA models and associated gain values
......
......@@ -120,10 +120,11 @@ class MyServer(SimpleHTTPRequestHandler):
os.mkdir('data')
elif dic['cmd'] == 'update_settings':
# ohmpi.stop()
if 'sequence' in dic['config'].keys and dic['config']['sequence'] is not None:
if 'sequence' in dic['config'].keys() and dic['config']['sequence'] is not None:
sequence = dic['config']['sequence']
dic['config'].pop('sequence', None)
payload = json.dumps({'cmd_id': cmd_id, 'cmd': 'set_sequence', 'args': sequence})
publish.single(payload=payload, **publisher_config)
payload = json.dumps({'cmd_id': cmd_id, 'cmd': 'update_settings', 'args': dic['config']})
cdic = dic['config']
publish.single(payload=payload, **publisher_config)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment