Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change handle mesages from client to gui #71

Merged
merged 1 commit into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions manager/libs/applications/compatibility/exercise_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ def send_pick(self, pick):
self.gui_connection.send("#pick" + json.dumps(pick))
print("#pick" + json.dumps(pick))

def handle_client_gui(self, msg):
if msg['msg'] == "#pick":
self.pick = msg['data']
else:
self.gui_connection.send(msg['msg'])


def start_send_freq_thread(self):
"""Start a thread to send the frequency of the brain and gui to the exercise server"""
self.running = True
Expand Down
4 changes: 2 additions & 2 deletions manager/manager/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ def signal_handler(sign, frame):
self.process_messsage(message)
except Exception as e:
if message is not None:
if message.command == "#pick":
self.application.save_pick(message.data)
if message.command == "#gui":
self.application.handle_client_gui(message.data)
ex = ManagerConsumerMessageException(
id=message.id, message=str(e))
else:
Expand Down