Commit graph

2814 commits

Author SHA1 Message Date
Richard Bowman
a18ac90c24 Allow camera stage mapping calibration to be cancelled 2024-01-04 14:49:27 +00:00
Richard Bowman
bcc13475b6 Propagate logs from camera-stage-mapping 2024-01-04 13:19:00 +00:00
Richard Bowman
91cb514e08 Use blocking, non-cancellable moves in autofocus
Autofocus timing is pretty critical. I've introduced the ability
to abort moves, which introduces ~50ms timing jitter. This
commit reverts the tming-critical move in autofocus to the old behaviour.

I've only reverted the move that really matters - this means
that if you start a massive sweep by accident, you can still
abort it when it's moving down to the start of the sweep.
2024-01-04 10:46:27 +00:00
Richard Bowman
8e2402af18 Enable cancelling moves
This enables the cancel button - it will be necessary to update `labthings-sangaboard` for this to work.
2024-01-04 10:07:44 +00:00
Richard Bowman
2bc585fe33 Make failed modal actions stay on screen
There's not currently any way to view the log of a failed
action - an easy win is to keep the log on screen until it's
closed by the user.
2024-01-04 02:09:30 +00:00
Richard Bowman
c7f828e373 Add a button for smart scan 2024-01-04 02:08:39 +00:00
Richard Bowman
9f01a5ab29 WIP: logging and cancellability in smart_scan 2024-01-04 01:32:18 +00:00
Richard Bowman
09bec65b15 Add a Thing for API testing
This may not be in the codebase forever, but it's a very useful
sanity check to have during development.

The current implementation is clearly not a performance or
security risk.
2024-01-04 01:11:44 +00:00
Richard Bowman
62957e53e8 Merge branch 'v3-webapp-modal-action-progress' into 'v3'
Modal progress dialog for TaskSubmitter

See merge request openflexure/openflexure-microscope-server!164
2024-01-04 01:09:50 +00:00
Richard Bowman
2ce6ea4bc0 Working modal progress/cancel dialog for actions. 2024-01-04 01:05:24 +00:00
Richard Bowman
44a7a8c1ab Tidy up background detect pane 2024-01-04 00:33:39 +00:00
Richard Bowman
40580327c6 Linter fixes 2024-01-03 21:53:14 +00:00
Richard Bowman
5ca8070bc8 WIP: modal progress dialog for TaskSubmitter
Longer-running tasks would benefit hugely from showing the
operator a progress indicator. This branch will add a basic
log display allowing messages to be shown to the user.
This branch may also add an abort button to the above dialog.
2024-01-03 21:40:12 +00:00
Richard Bowman
778da73a70 Web app controls for background detection
There are now buttons to set, and check, the background
detect plugin.
2024-01-03 21:36:25 +00:00
Richard Bowman
0083231b85 Switch to matierial-symbols
material-design-icons was outdated and missing symbols. I've now switched, as recommended in the issue.

/closes #254
2024-01-03 20:51:32 +00:00
Richard Bowman
35db80121a Update build output location
This now places the static web app in the correct location for the v3 back-end code.
2024-01-03 20:50:33 +00:00
Richard Bowman
656e902198 Add a button to recentre the stage. 2024-01-03 17:15:29 +00:00
Richard Bowman
0e8340bb5b Relax dependency specifications and build on node v20
I've removed the patch version from the version specifiers (i.e.
I'm now only specifying the major version for most deps), and
it now builds OK using node v20 on WSL.
2024-01-03 17:15:29 +00:00
Richard Bowman
deeb2c7b9b Explicitly mention anyio as a dependency
This is already in via fastapi, but I just got caught out by a
v3 -> v4 change. I've added a dependency to make this explicit.
2024-01-03 17:12:15 +00:00
Richard Bowman
d561ff4484 Update blocking portal syntax
spawn_task should be replaced with start_task_soon as per the
anyio API for v4.
2024-01-03 17:09:36 +00:00
Richard Bowman
25552215f9 Refactored background detection into a Thing
The new background detect Thing (currently in smart_scan.py)
manages its own settings and exposes a few more actions.
2024-01-03 16:56:20 +00:00
Richard Bowman
04321cac96 Merge branch 'v3-webapp' into 'v3'
Web app compatibility with v3 API

See merge request openflexure/openflexure-microscope-server!163
2024-01-03 14:32:41 +00:00
Richard Bowman
37f6251d41 Eliminate references to old extensions API
Some of these will, in the future, be replaced by the new
API but, for now, the features in question are disabled anyway.
2024-01-03 14:28:31 +00:00
Richard Bowman
fc49ca7656 Restore cameraURI in calibration modal 2024-01-03 14:22:49 +00:00
jaknapper
0e32fd1e1f Added position log 2023-12-29 15:58:51 +00:00
Richard Bowman
c1ed5d0c87 Also log modal errors to the console 2023-12-15 02:39:03 +00:00
Richard Bowman
b23d6043c5 Remove IHI slidescan from features settings 2023-12-15 01:22:21 +00:00
Richard Bowman
c8906008ed Update zero coordinates button
This now uses a taskSubmitter and the new URL
2023-12-15 00:32:37 +00:00
Richard Bowman
93757c2103 Improve responsiveness and reliability of moves
Fixed a bug where incorrect values in the position control
caused incorrect relative moves.

Decreased the polling interval to make moves more responsive.
2023-12-15 00:15:23 +00:00
Richard Bowman
a9fdb6fd52 Update position controls to resemble propertyControl
I've simplified the HTML template and added a refresh button.
2023-12-15 00:00:02 +00:00
Richard Bowman
30deedde9e Route all moves through the Move taskSubmitter
I've consolidated move code (except moveinimagecoordinates)
so that it now all simulates clicking "submit" on the taskSubmitter.
2023-12-14 23:38:16 +00:00
Richard Bowman
968136e22e Add opencv as a dependency 2023-12-14 17:21:22 +00:00
Richard Bowman
1b6e2686be Format and linting of recentre and smart scan 2023-12-14 16:06:05 +00:00
Richard Bowman
a54c972891 Merge branch 'new_things' into 'v3'
Scanning and recentring

See merge request openflexure/openflexure-microscope-server!162
2023-12-14 15:19:02 +00:00
jaknapper
1d50dcb3f8 Scanning and centring things 2023-12-14 15:08:43 +00:00
Richard Bowman
d0eb9fa2c1 Format/comment improvements 2023-12-13 16:35:13 +00:00
Richard Bowman
3b2fd29fb0 Log to a file and make it visible via the API 2023-12-13 01:54:42 +00:00
Richard Bowman
77c43c824d Restore log viewer 2023-12-13 01:53:55 +00:00
Richard Bowman
3059683186 Enable logging
`logging.basicConfig` doesn't work when run via `uvicorn`.
I now explicitly get the root logger and set its level to INFO,
which means we now see logs on the terminal.
2023-12-13 00:51:41 +00:00
Richard Bowman
94e1619056 Use safer metadata dependency
Retrieving metadata pre-action risks stale metadata being
returned if DirectThingClients are used. I've switched to
the safer callable dependency, which is guaranteed to be fresh.
2023-12-12 23:40:12 +00:00
Richard Bowman
d9711522d5 Detect static directories
Simplified code and removed hard-coded list of static dirs.
2023-12-12 22:55:50 +00:00
Richard Bowman
753514c24b Added v2 API routes and hard-coded static files to support Connect
Connect looks for /routes and /api/v2/streams/snapshot
These are now present and working.

I've also hard coded the static files directory - fixing this
properly is a work in progress.
2023-12-11 23:59:11 +00:00
Richard Bowman
7c662b2787 Added capture buttons to navigate pane 2023-12-11 22:23:32 +00:00
Richard Bowman
60f854b7db Return None if calibration matrix is missing
Previously, we raised an exception (and thus HTTP error
code) if the CSM matrix was requested and not yet set.
Now, we just return None, and I've added a (not-network-exposed)
function that will raise an HTTPException if it's missing.
2023-12-01 21:29:14 +00:00
Richard Bowman
e3265b1dff await readThingProperty correctly 2023-12-01 21:27:38 +00:00
Richard Bowman
9817b4963a Handle missing Thing better in thingFormUrl
We now give a helpful error message if the Thing is not found,
rather than returning null. There's an argument to return
`undefined` instead of raising an error, returning undefined
is the default behaviour.
2023-12-01 21:14:24 +00:00
Richard Bowman
146fccfa80 comment out problematic fetch 2023-12-01 02:43:31 +00:00
Richard Bowman
0cd8ecd2d5 Add error checking to mixin thing functions
Now we'll get an error if undefined URLs are about to be fetched.
The error will contain thing and affordance, for debugging.
2023-12-01 02:43:17 +00:00
Richard Bowman
ee641f5cd2 Comment out 2 problematic tabs 2023-12-01 02:31:59 +00:00
Richard Bowman
f87594e7af Hide error from CSM if it's uncalibrated
The error still appears in the console - should be fixed
eventually.
2023-12-01 02:31:49 +00:00