Browse Source

defines updated

master
caliskanbi 1 year ago
parent
commit
b70d445480

BIN
software/backend/backend_database.db View File


+ 5
- 5
software/backend/data_functions.py View File

@@ -71,23 +71,23 @@ def action_drive(client: mqtt.Client, userdata, message: mqtt.MQTTMessage, mydat
"ActionID": action_id
}

if robot.get_order_number() < 5 and robot.get_robot_status() is True:
if robot.get_order_number() < 6 and robot.get_robot_status() is True:
robot.add_order(drive_data)
client.publish(Topics['ROBOT_ACTION_DRIVE'], json.dumps(drive_data))
logging.info("BACKEND_ACTION_DRIVE Drive Command published: " + json.dumps(drive_data))
else:
if robot.get_order_number() < 5:
if robot.get_order_number() < 6:
robot.add_order(drive_data)
logging.info("BACKEND_ACTION_DRIVE New data added to order list: " + str(drive_data))
elif robot.get_order_number() >= 5:
elif robot.get_order_number() >= 6:
logging.error("Could not add Order to list. Order discarded")
client.publish(Topics['BACKEND_DATA_ERROR'], "Could not add Order to list. Order discarded")


def action_driveall(client: mqtt.Client, userdata, message: mqtt.MQTTMessage, mydatabase: PlantDataBase,
robot: Robot):
# TODO: Implement here
print("HELLO")
client.publish(Topics['ROBOT_ACTION_DRIVEALL'])


def action_getposition(client: mqtt.Client, userdata, message: mqtt.MQTTMessage, mydatabase: PlantDataBase):

BIN
software/backend/tests/test_database.db View File


+ 5
- 1
software/defines.py View File

@@ -72,9 +72,13 @@ BATTERY = {

DRIVE = {
"PlantID": 0,
"ActionID": 0
"ActionID": ""
}

DRIVEALL = {
"PlantID": [0, 0], # List containing PlantIDs sorted ascending
"ActionID": ""
}
# GETPOSITION -> no message needed

# GETBATTERY -> no message needed

Loading…
Cancel
Save