If missing=None, we need to specify allow_None=False
in order to generate valid OpenAPI.
This may also be fixed by an upstream change in LabThings.
Also, OneOf was being used incorrectly in StageTypeProperty.
Given that it changes the "capture" button from
single image acquisition to a long running scan,
I think it's less confusing if the "scan capture" setting
is not remembered across page refreshes.
Saving default to local storage has a problem:
if you have ticked "scan", the section is not
visible by default so it's easy to start a scan
by accident. I've now forced it to be open if
the scanCapture checkbox is true.
The code checks for the camera-stage mapper matrix by looking at its truth value.
However, this is ambiguous because the matrix has many elements. That means that
if it's missing, we get the expected result, but if it's present
we get an error.
I have avoided dict.get() and instead look it up with [] notation.
This will raise a KeyError if it's missing, which I
handle helpfully.
If the key is present but the value is not castable to an array, we'll
get an exception anyway.
adjust_shutter_and_gain_from_raw now uses a simpler algorithm.
The code is longer overall but hides some details in fuctions.
I've also split the loop into one for shutter speed and one for gain.
This isn't the algorithm that I originally wrote, but it seems to
work and is more readable.
GPU preview and MJPEG stream settings are now persisted
using localStorage. The old code that disabled
the stream for local connections now
just sets the initial/default value.
The initialisation of stream settings is now done
in the created() method of streamContent.vue.
I've eliminated the "globalsafetogglepreview" event
in favour of watching the store.
I've changed the default values in MoveStageAPI
so that it correctly handles absolute moves with missing axes.
I've also simplified it so it isn't using axes_to_array as that
resulted in a confusing code path.
I don't know why these didn't fail before - possibly because of
incomplete type information from old numpy...
I removed a few annotations because they were failing (e.g.
np.sum can return a scalar or an array), but I don't think
this should be a problem - the function inputs and return values
are still typed.
numpy 1.20 deprecates np.float, which was only ever an alias for
``float``. I've replaced all occurrences of np.float with float, as
recommended. There should be no change in functionality.