From 1eb447ee1ed7fdf99fa7c848bbc4ed65dea5cd8e Mon Sep 17 00:00:00 2001 From: caseystone Date: Wed, 21 Aug 2024 15:51:24 -0500 Subject: [PATCH] Update to wei v0.6.0 --- Dockerfile | 2 +- pyproject.toml | 4 ++-- src/platecrane_rest_node.py | 12 ++++++------ src/sciclops_rest_node.py | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7cf5dc7..6192491 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/ad-sdl/wei:v0.5.9 +FROM ghcr.io/ad-sdl/wei:v0.6.0 LABEL org.opencontainers.image.source=https://github.com/AD-SDL/hudson_platecrane_module LABEL org.opencontainers.image.description="Drivers and REST API's for the Hudson Platecrane and Sciclops robots" diff --git a/pyproject.toml b/pyproject.toml index 636d562..ae72996 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "hudson_platecrane_module" -version = "1.4.1" +version = "1.5.0" description = "Driver for the Platecrane and Sciclops" authors = [ {name = "Ryan D. Lewis", email="ryan.lewis@anl.gov"}, @@ -16,7 +16,7 @@ dependencies = [ "pyusb", "libusb", "pyserial", - "ad_sdl.wei", + "ad_sdl.wei>=0.6.0", "pydantic>=2.7", "pytest" ] diff --git a/src/platecrane_rest_node.py b/src/platecrane_rest_node.py index 0905208..90c99c0 100644 --- a/src/platecrane_rest_node.py +++ b/src/platecrane_rest_node.py @@ -8,7 +8,7 @@ from platecrane_driver.platecrane_driver import PlateCrane from typing_extensions import Annotated from wei.modules.rest_module import RESTModule -from wei.types.step_types import StepResponse +from wei.types.step_types import StepResponse, StepSucceeded from wei.utils import extract_version rest_module = RESTModule( @@ -57,7 +57,7 @@ def transfer( height_offset=int(height_offset), has_lid=has_lid, ) - return StepResponse.step_succeeded("Transfer complete") + return StepSucceeded() @rest_module.action() @@ -82,7 +82,7 @@ def remove_lid( plate_type=plate_type, height_offset=height_offset, ) - return StepResponse.step_succeeded("Removed lid") + return StepSucceeded() @rest_module.action() @@ -107,7 +107,7 @@ def replace_lid( plate_type=plate_type, height_offset=height_offset, ) - return StepResponse.step_succeeded("Replaced lid") + return StepSucceeded() @rest_module.action() @@ -117,7 +117,7 @@ def move_safe( """This action moves the arm to a safe location (the location named "Safe").""" platecrane: PlateCrane = state.platecrane platecrane.move_location("Safe") - return StepResponse.step_succeeded("Moved to the Safe position") + return StepSucceeded() @rest_module.action() @@ -128,7 +128,7 @@ def set_speed( """This action sets the speed at which the plate crane arm moves (as a percentage)""" platecrane: PlateCrane = state.platecrane platecrane.set_speed(speed=speed) - return StepResponse.step_succeeded(f"Set speed to {speed}") + return StepSucceeded() if __name__ == "__main__": diff --git a/src/sciclops_rest_node.py b/src/sciclops_rest_node.py index 5f7f47e..99667a4 100644 --- a/src/sciclops_rest_node.py +++ b/src/sciclops_rest_node.py @@ -8,7 +8,7 @@ from typing_extensions import Annotated from wei.modules.rest_module import RESTModule from wei.types.module_types import ModuleStatus -from wei.types.step_types import StepResponse +from wei.types.step_types import StepSucceeded from wei.utils import extract_version rest_module = RESTModule( @@ -48,14 +48,14 @@ def status(state: State): """Action that forces the sciclops to check its status.""" sciclops: SCICLOPS = state.sciclops sciclops.get_status() - return StepResponse.step_succeeded(action_msg="Succesfully got status") + return StepSucceeded() @rest_module.action() def home(state: State): """Homes the sciclops""" state.sciclops.home() - return StepResponse.step_succeeded() + return StepSucceeded() @rest_module.action(name="get_plate") @@ -67,7 +67,7 @@ def get_plate( ): """Get a plate from a stack position and move it to transfer point (or trash)""" state.sciclops.get_plate(pos, lid, trash) - return StepResponse.step_succeeded() + return StepSucceeded() rest_module.start()