Commit 0a785033 authored by rpi2.0's avatar rpi2.0
Browse files

Fixes issue on play and stop buttons on http interface

Showing with 10 additions and 9 deletions
+10 -9
...@@ -21,10 +21,10 @@ OHMPI_CONFIG = { ...@@ -21,10 +21,10 @@ OHMPI_CONFIG = {
'board_version': '22.10' 'board_version': '22.10'
} # TODO: add a dictionary with INA models and associated gain values } # TODO: add a dictionary with INA models and associated gain values
# CONTROL_CONFIG = { CONTROL_CONFIG = {
# 'tcp_port': 5555, 'tcp_port': 5555,
# 'interface': 'mqtt_interface.py' # 'http_interface' 'interface': 'mqtt_interface.py' # 'http_interface'
# } }
# Execution logging configuration # Execution logging configuration
EXEC_LOGGING_CONFIG = { EXEC_LOGGING_CONFIG = {
'logging_level': logging.DEBUG, 'logging_level': logging.DEBUG,
......
...@@ -16,8 +16,10 @@ k.sequence = np.array([[1,2,3,4]]) # set numpy array of shape (n,4) ...@@ -16,8 +16,10 @@ k.sequence = np.array([[1,2,3,4]]) # set numpy array of shape (n,4)
# k.load_sequence('ABMN.txt') # load sequence from a local file # k.load_sequence('ABMN.txt') # load sequence from a local file
### Run contact resistance check ### Run contact resistance check
k.rs_check() # k.rs_check()
### Run sequence ### Run sequence
k.run_sequence() k.run_sequence()
# k.interrupt() # k.run_sequence_async()
\ No newline at end of file # time.sleep(2)
# k.interrupt()
\ No newline at end of file
...@@ -95,7 +95,6 @@ class MyServer(SimpleHTTPRequestHandler): ...@@ -95,7 +95,6 @@ class MyServer(SimpleHTTPRequestHandler):
payload = json.dumps({'cmd_id': cmd_id, 'cmd': 'run_sequence'}) payload = json.dumps({'cmd_id': cmd_id, 'cmd': 'run_sequence'})
publish.single(payload=payload, **publisher_config) publish.single(payload=payload, **publisher_config)
elif dic['cmd'] == 'interrupt': elif dic['cmd'] == 'interrupt':
# ohmpi.stop()
payload = json.dumps({'cmd_id': cmd_id, 'cmd': 'interrupt'}) payload = json.dumps({'cmd_id': cmd_id, 'cmd': 'interrupt'})
publish.single(payload=payload, **publisher_config) publish.single(payload=payload, **publisher_config)
elif dic['cmd'] == 'getData': elif dic['cmd'] == 'getData':
......
...@@ -1013,7 +1013,7 @@ class OhmPi(object): ...@@ -1013,7 +1013,7 @@ class OhmPi(object):
self.exec_logger.warning(f'Unable to set sequence: {e}') self.exec_logger.warning(f'Unable to set sequence: {e}')
status = False status = False
elif cmd == 'run_sequence': elif cmd == 'run_sequence':
self.run_sequence(cmd_id) self.run_sequence_async(cmd_id)
while not self.status == 'idle': while not self.status == 'idle':
time.sleep(0.1) time.sleep(0.1)
status = True status = True
......
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