This blog is the first in a series on how to integrate equipment and tasks into GradientOne's API. These blog posts will use the hypothetical example of robots making shape sandwiches.
TestPlans are recipes for equipment tasks. Like recipes, they have a list of steps, and each tesp may require different combinations of equipment. For example, testing the odometer might consist of the steps:
BASE_URL and HEADERS need to be specified by you, they can come from your /etc/gradient_one.cfg file, if you're running a gateway client. Upon successful completion of the post, it will respond with a generated id associated with that TestPlan. With this id, we can add it to the queue of commands to be executed by making a post to commands:
This command has been tagged with testplanDemo so that we can easily filter the commands related to the sandwich factory. If you have multiple gateways pointing to the same web instance, you can route commands using the gateway argument. We can pull all pending commands using a get request to commands:
The client controlling the robots and setting task allocations can get the TestPlan by querying the id that comes with the command:
Once the client has found a set of equipment IDs that can perform the task, we can set the command to in progress, so that it will no longer show up in the command queue and won't be assigned twice.
Once the command is completed, you can use the same post to set the status to complete. In our demo, after creating the TestPlans and adding them to the command queue, we generate this table by querying the pending command queue and then querying the individual testplans to get the steps:
In the next post, we will cover how to create TestRigs and record their utilization.