Commit graph

2593 commits

Author SHA1 Message Date
Richard Bowman
54df1faeeb Linter fixes 2023-11-30 23:21:45 +00:00
Richard Bowman
f1f6ed5f80 Provide centralised readproperty, writeproperty, and action URLs 2023-11-30 22:51:10 +00:00
Richard Bowman
6c48444126 Removed vestigial code from CSMSettings 2023-11-30 09:14:04 +00:00
Richard Bowman
b47ac8b828 Remove unused URL computed props 2023-11-30 00:20:26 +00:00
Richard Bowman
8de79ad7e8 Delete unused print statements 2023-11-30 00:20:10 +00:00
Richard Bowman
24bfb4c253 Remove vestigial stage settings 2023-11-30 00:02:53 +00:00
Richard Bowman
488493385f Combine the various property controls into one component
propertyControl now handles several different property types,
based on the thing description. This reduces duplication and
should keep the code cleaner.

In the future this will become a part of a labthings-vue package,
I hope!
2023-11-29 23:54:00 +00:00
Richard Bowman
595101248e Removed node-wot but kept centralised TD store
I had intended to store a ConsumedThing for each Thing, in
a module in the store. Until that is possible (will require some
more attention to dependency management) I will just store
the TDs instead.

This commit includes a lot of the code I wrote for node-wot use,
but without any dependence on node-wot.
2023-11-29 22:43:55 +00:00
Richard Bowman
45d2884159 Merge remote-tracking branch 'origin/v3' into v3-webapp 2023-11-15 22:00:37 +00:00
Richard Bowman
1d24701dfd Fix shutdown/restart buttons 2023-11-02 21:33:42 +00:00
Richard Bowman
27c74bff6e Add shutdown/restart actions 2023-11-02 21:18:59 +00:00
Richard Bowman
65f467af64 Fix "About" page 2023-11-02 21:17:31 +00:00
Richard Bowman
4e7fa44a73 Remove microscope settings
microscope name should be defined in config, by a
separate program/service
2023-11-02 20:34:42 +00:00
Richard Bowman
27b1f42935 Updated camera stage mapping settings 2023-11-02 20:32:15 +00:00
Richard Bowman
c5c02eb029 Linted 2023-11-02 20:30:54 +00:00
Richard Bowman
7bbc105fc6 Expose last calibration and thing_state 2023-11-02 20:29:22 +00:00
Richard Bowman
79752a2a4c Camera settings for labthings-picamera2
I've updated URLs and tidied things a bit, so that we can
now adjust the key camera settings with the new camera
drivers.
2023-11-02 16:54:22 +00:00
Richard Bowman
13229d9b99 Command to run the server interactively
It's sometimes helpful to run the server as openflexure-ws,
there's now a command in the readme that matches (for
now) the service definition.
2023-11-02 10:39:37 +00:00
Richard Bowman
92ba79ef7a Improved docstrings 2023-11-02 10:27:27 +00:00
Richard Bowman
6eefa4f25b Add image resolution to CSM metadata
The camera stage mapper should now note the resolution
used when it was last calibrated - this is helpful for tiling,
because we may need to scale it if the images recorded are
a different resolution from the images used for calibration.

This addresses https://gitlab.com/openflexure/microscope-extensions/camera-stage-mapping/-/issues/11
2023-11-02 10:05:54 +00:00
Richard Bowman
4caba58d6c Revert to Sangaboard, rather than proscan 2023-11-01 18:02:16 +00:00
Richard Bowman
796622b802 Relax scipy version 2023-10-31 22:28:47 +00:00
Richard Bowman
b9804cdc2d Serve static web app at / 2023-09-06 11:56:20 +01:00
Richard Bowman
da711a7d8c linter fixes 2023-09-04 22:08:27 +01:00
Richard Bowman
799dc7f522 WIP: update webapp to use new backend
This is still very much WIP, but I now have fast
autofocus, stage moves, image streaming, and click-to-move.
2023-09-04 22:00:56 +01:00
Richard Bowman
e82acf2941 Add thing_state metadata 2023-09-04 11:43:32 +01:00
Richard Bowman
63d7a6eb4d WIP: camera stage mapping
This still has some bugs, mostly related to numpy and serialisation.
2023-08-31 19:37:09 +01:00
Richard Bowman
6e04618051 Autofocus module!
Currently only has fast_autofocus, and there
may be some work to do on timing, but it works :)

Getting timestamps from the camera rather than
time.time() would be ideal, but it would take some thought to tie that up with
the encoder.

I'm using a low-res stream, as it seems impossible to
turn the bitrate control of the MJPEG stream off,
at least within the picamera2 API.
2023-08-30 21:34:06 +01:00
Richard Bowman
081654533f First images on labthings-fastapi
We now have very basic camera and stage support.
2023-08-29 17:02:16 +01:00
Richard Bowman
ac45423739 Merge branch 'sangaboard-v4' into 'master'
Support latest sangaboard firmware

See merge request openflexure/openflexure-microscope-server!154
2023-04-12 07:23:15 +00:00
Richard Bowman
7abdbdde4a Add full list of server prerequisites
The server needs various packages installed on
the system. This list is lifted from the SD card
builder repository.
2023-04-06 21:27:51 +01:00
Richard Bowman
a95baee25f Fix lxml and update README
lxml requires an apt-installed package to work.
I've also mentioned in README that Pipfile
is now pi-specific.
2023-04-06 16:03:20 +01:00
Richard Bowman
d0aad6633c Redo CI to run on armv6
I've refactored the CI substantially, using the
new `extends` keyword to tidy it up a lot.
I have also changed from running the Python
tests on Python:3.7 to using a Raspberry Pi
OS from the Balena project.

This means we are now ONLY locking
dependencies for the Pi, and we are no longer
expecting the Pipfile to work on non-arm
systems.
2023-04-06 15:20:48 +01:00
Richard Bowman
fdafeca446 Only consider piwheels in Pipfile
Including both piwheels and pypi in Pipfile caused hash mismatches,
which caused installation to fail. I've removed pypi, but this may
break installation on other platforms.

I may need to duplicate Pipfile and Pipfile.lock, one for Pi and
one for non-Pi platforms.

I can confim this commit installed successfully on a Pi.
2023-04-03 22:03:57 +01:00
Richard Bowman
12fd9a5f4a Mention dependencies in readme 2023-04-03 20:38:57 +01:00
Richard Bowman
62eef8f8e1 Re-lock dependencies on a Raspberry Pi
I couldn't install this on a Pi, because it incorrectly chose
versions of e.g. numpy that did not exist in binary form for the
pi. I re-locked dependencies with:

`PIP_ONLY_BINARY=":all:" pipenv lock --dev`

This forced the use of wheels, and not only completed but did so
in ~10 minutes.
2023-04-03 20:32:52 +01:00
Richard Bowman
3f9c3447de Fixed typos in comments spotted in code review 2023-03-23 13:31:25 +00:00
Richard Bowman
d948d3f04d Merge branch 'Update-WoT-links' into 'sangaboard-v4'
Update swagger with links to WoT documentation

See merge request openflexure/openflexure-microscope-server!155
2023-03-22 10:37:47 +00:00
Richard Bowman
1f558bbeb7 OpenAPI Validation Fixes
OpenAPI validation seems to have become stricter about checking for None defaults
in parameters that don't allow None. I have
modified two things as a result:

1. StageTypeProperty (used to pick between SangaStage and SangaDeltaStage)
now defaults to SangaStage (which is the
original behaviour anyway)
2. It is now allowed to pass x,y,z=None when making a move - this is the same as
not passing the respective argument, so the
function already correctly handled this case.
2023-03-22 08:58:04 +00:00
Richard Bowman
4b73fd82f6 Format fix 2023-03-21 15:11:24 +00:00
Richard Bowman
824248583d Add !154 to changelog 2023-03-21 15:05:22 +00:00
Joe Knapper
f6691cbc11 Update openapi.py with live links to WoT documentation 2023-03-21 15:05:21 +00:00
Richard Bowman
8e50a90fb2 Explicitly mark arguments as optional
mypy now considers implicitly Optional arguments
to be errors - I have made them now explicitly
Optional, which passes.
2023-03-21 15:04:49 +00:00
Richard Bowman
ba62bdf867 Update pysangaboard to 0.3.3 2023-03-21 12:51:03 +00:00
Richard Bowman
f2f00b0d11 Update w3c schema to 2020 format
The `thing-context` definition used a 2019 draft of how to specify a
tuple (where `items` set the mandatory items and `additionalItems`
set the rest).  These have been renamed to `prefixItems` and `items`
respectively, and I have applied this change.  Schema now validates
again :)
2022-08-09 13:33:10 +01:00
Richard Bowman
80d026d778 Downgrade markupsafe so jinja2 still works 2022-08-09 13:18:07 +01:00
Richard Bowman
106b50d333 Format fixes from black 2022-08-09 13:17:45 +01:00
Richard Bowman
9dbb083ee7 More Marshmallow argument updates 2022-08-09 13:16:10 +01:00
Richard Bowman
e22f36b308 Start explicit metadata argument for marshmallow
A side effect of re-locking dependencies is having a newer marshmallow.
This deprecates having `description=` as a keyword, and puts it in a
separate metadata arg instead.

This commit is the start of my search-and-replaceing to update to the new
format.
2022-08-09 12:52:57 +01:00
Richard Bowman
78ef9c531b Format fixes from black 2022-08-09 09:37:03 +01:00