From 61f783e963285155bd4093630081cf1aa75f0f97 Mon Sep 17 00:00:00 2001 From: Artem30801 Date: Wed, 2 Dec 2020 14:53:52 +0300 Subject: [PATCH] Udpated to include container id --- drone/dronepoint_flight.py | 5 +++-- server/server.py | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drone/dronepoint_flight.py b/drone/dronepoint_flight.py index 7786f87..9db6401 100644 --- a/drone/dronepoint_flight.py +++ b/drone/dronepoint_flight.py @@ -21,9 +21,10 @@ logging.basicConfig( @messaging.message_callback("dronepoint") -def dronepoint_callback(connection, dronepoint_id=None): +def dronepoint_callback(connection, dronepoint_id=None, container_id=None): # this function only called after receiving "dronepoint" message from the server - logging.info("Dronepoint_id: {}".format(dronepoint_id)) # dronepoint_id - int + # dronepoint_id and container_id are ints + logging.info("Dronepoint_id: {}; Container_id: {}".format(dronepoint_id, container_id)) # your code goes here diff --git a/server/server.py b/server/server.py index 87f4ebf..12e53d3 100644 --- a/server/server.py +++ b/server/server.py @@ -642,8 +642,12 @@ class MainWindow(QtWidgets.QMainWindow): @pyqtSlot() def dronepoint_command(self): dronepoint_id = random.randint(1, 2) - logging.info(f"Dronepoint_id: {dronepoint_id}") - self.send_to_selected("dronepoint", command_kwargs={"dronepoint_id": dronepoint_id}) + container_id = random.randint(1, 3) + logging.info(f"Dronepoint_id: {dronepoint_id}; Container_id: {container_id}") + self.send_to_selected("dronepoint", command_kwargs={ + "dronepoint_id": dronepoint_id, + "container_id": container_id, + }) def register_callbacks(self): @messaging.message_callback("telemetry")