Udpated to include container id

This commit is contained in:
Artem30801
2020-12-02 14:53:52 +03:00
parent c64f16e48b
commit 61f783e963
2 changed files with 9 additions and 4 deletions

View File

@@ -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

View File

@@ -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")