Commit 8a282db1 authored by Joel Collins's avatar Joel Collins
Browse files

Moved to collision-robust device name

parent cf199393
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ app, labthing = create_app(
app.json_encoder = JSONEncoder

# Attach lab devices
labthing.register_device(api_microscope, "openflexure_microscope")
labthing.register_device(api_microscope, "org.openflexure.microscope")

# Attach extensions
if not os.path.isfile(USER_EXTENSIONS_PATH):
+3 −3
Original line number Diff line number Diff line
@@ -290,7 +290,7 @@ def fast_up_down_up_autofocus(

class MeasureSharpnessAPI(Resource):
    def post(self):
        microscope = find_device("openflexure_microscope")
        microscope = find_device("org.openflexure.microscope")

        if not microscope:
            abort(503, "No microscope connected. Unable to measure sharpness.")
@@ -305,7 +305,7 @@ class AutofocusAPI(Resource):

    def post(self):
        payload = JsonResponse(request)
        microscope = find_device("openflexure_microscope")
        microscope = find_device("org.openflexure.microscope")

        if not microscope:
            abort(503, "No microscope connected. Unable to autofocus.")
@@ -331,7 +331,7 @@ class FastAutofocusAPI(Resource):

    def post(self):
        payload = JsonResponse(request)
        microscope = find_device("openflexure_microscope")
        microscope = find_device("org.openflexure.microscope")

        if not microscope:
            abort(503, "No microscope connected. Unable to autofocus.")
+1 −1
Original line number Diff line number Diff line
@@ -359,7 +359,7 @@ class TileScanAPI(Resource):
    )
    @marshal_task
    def post(self, args):
        microscope = find_device("openflexure_microscope")
        microscope = find_device("org.openflexure.microscope")

        if not microscope:
            abort(503, "No microscope connected. Unable to autofocus.")
+1 −1
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ class ZipBuilderAPIView(Resource):
    def post(self):

        ids = list(JsonResponse(request).json)
        microscope = find_device("openflexure_microscope")
        microscope = find_device("org.openflexure.microscope")

        task = taskify(default_zip_manager.build_zip_from_capture_ids)(microscope, ids)

+3 −3
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ class CaptureAPI(Resource):
        """
        Create a new capture
        """
        microscope = find_device("openflexure_microscope")
        microscope = find_device("org.openflexure.microscope")

        resize = args.get("resize", None)
        if resize:
@@ -97,7 +97,7 @@ class GPUPreviewStartAPI(Resource):
        """
        Start the onboard GPU preview.
        """
        microscope = find_device("openflexure_microscope")
        microscope = find_device("org.openflexure.microscope")
        payload = JsonResponse(request)

        window = payload.param("window", default=[])
@@ -120,6 +120,6 @@ class GPUPreviewStopAPI(Resource):
        """
        Stop the onboard GPU preview.
        """
        microscope = find_device("openflexure_microscope")
        microscope = find_device("org.openflexure.microscope")
        microscope.camera.stop_preview()
        return jsonify(microscope.state)
Loading