The primary change here is that there's now an option
to skip autofocus if the background detect plugin says
the current image is background.
I have also overhauled the way it picks the next Z position
based on Joe's code; instead of just using the last point, it will
pick the closest point where we have a successful autofocus
recorded. This will usually be the last point, except for raster
scans where it neatly reproduces the behaviour of the old code
but without needing to treat it as a special case (when we jump
back to the start of a line, it will use the z position of the start
of the previous line, rather than the end of the previous line).
This does represent a minor change to previous behaviour, but
it should not break anything that isn't already broken, i.e. it might
cause slightly odd behaviour if autofocus gives random results -
but probably indistinguishable from the current behaviour.
taskSubmitter ended up in a confused state if the initial POST request
encountered an error.
I've updated `startPolling` to return a Promise, and moved the
error handling code to the top level.
This doesn't change anything for the case where we get a non-error
response to the POST request, but means that e.g. 400 errors
get caught and displayed properly.
The action wrapper was using an unbound function - it
now passes the extension object as self.
We were incorrectly passing endpoint names as positional arguments -
this is fixed and I now use a keyword argument.
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.