Skip to content

Incorrect settings file loaded when switching configurations. #290

@julianstirling

Description

@julianstirling

Describe the bug
When we switch camera thing on the OpenFlexure Microscope (either between different camera boards on the PiCamera, or switching from OpenCV to Simulation on a dev machine) it will load the settings from the other camera.

To Reproduce

  1. Run a microscope so it saves settings.
  2. Update configuration file so the same name points to a different thing
  3. The new thing tries to load the old settings.

Expected behaviour

Ideally we could switch back and forth without and still keep our settings.

Note that currently the way we switch from PiCamera v2 to PiCamera HQ is to to change a kwarg. I think keying settings to kwargs isn't going to work well. So I think that it would make sense for the settings folder made for each thing to save a different file for each class. We could change . to - and : to --

So if your configuration for the camera is:

{
  "things": {
    "camera": "openflexure_microscope_server.things.camera:Picamera2Thing"
}

Could have it settings save to camera/openflexure_microscope_server-things-camera--Picamera2Thing.json rather than camera/settings.json.

System:

  • OS: OpenFlexure Raspbian and Kubuntu 22.04
  • Python version: 3.11
  • Version: 0.0.17

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions