functionalities

This commit is contained in:
2024-06-27 11:12:33 +02:00
parent 88aced27bf
commit 2e59700bfa
18 changed files with 84 additions and 27 deletions

View File

@@ -184,6 +184,21 @@ def release(obj):
PROCESS_BASE.cmd_q().put({'cmd': "release", "args": obj})
return "OK"
@app.route('/pause/<obj>')
def pause_simulation(obj):
if not PROCESS_BASE.known():
return "Unknown", 401
PROCESS_BASE.cmd_q.put({'cmd': "pause", "arg": obj})
return "Simulation paused"
@app.route('/resume/<obj>')
def resume_simulation(obj):
if not PROCESS_BASE.known():
return "Unknown", 401
PROCESS_BASE.cmd_q.put({'cmd': "resume", "arg": obj})
return "Simulation resumed"
def just_run():
"""

View File

@@ -3,7 +3,11 @@ import json
class State(object):
IGNORE = frozenset(['Coude', 'Noeud', 'P24', 'P0', 'Pulse'])
# these components do not have any states (value/ true or flase...)
Breakpoints = ['Relais']
#possibility to add other breakpoints in the future ;)
def __init__(self, cocosim_server):
self.cocosim_server = cocosim_server
self.conf = self.cocosim_server.conf["ui"]
@@ -38,4 +42,5 @@ class State(object):
self._exception = e
def reset_exception(self):
self._exception = None
self._exception = None