mirror of
https://github.com/CopterExpress/clever-show.git
synced 2026-05-26 07:07:58 +00:00
Udpated to include container id
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user