Commit graph

204 commits

Author SHA1 Message Date
Joe Knapper
a1be3e518f Apply 2 suggestion(s) to 1 file(s)
Co-authored-by: Julian Stirling <julian@julianstirling.co.uk>
2025-05-01 14:14:34 +00:00
jaknapper
fbbb3decdc Ruff formatting 2025-05-01 13:16:48 +00:00
jaknapper
b8ddab1ed8 Remove correlation only stitching, now covered by preview stitch 2025-05-01 13:16:48 +00:00
jaknapper
5ca4c824aa Remove producing thumbnail (to be added to stitching repo) 2025-04-23 14:28:41 +01:00
Julian Stirling
3adc34c30b Merge branch 'dont-test-focus-change' into 'v3'
Remove focus_change_acceptable test

Closes #342

See merge request openflexure/openflexure-microscope-server!249
2025-04-23 11:28:05 +00:00
Joe Knapper
c4dc357cf3 Apply 1 suggestion(s) to 1 file(s)
Co-authored-by: Julian Stirling <julian@julianstirling.co.uk>
2025-04-23 10:57:56 +00:00
Joe Knapper
283a10c560 Always move back to expected focus after failed autofocus 2025-04-23 09:15:54 +00:00
jaknapper
91057f164a Thumbnails and accurate durations in scan-list tab 2025-04-22 19:02:29 +01:00
jaknapper
3bcc71304e Fixed focused path tracking, move to estimated focus before autofocus 2025-04-22 14:33:27 +01:00
jaknapper
7cb1a3980e Remove focus_change_acceptable test, autofocus from centre 2025-04-17 17:20:40 +01:00
jaknapper
5d8a1073b2 Remove focus_change_acceptable 2025-04-17 17:02:39 +01:00
jaknapper
2741123cf9 Looping autofocus at the start of the scan 2025-04-16 18:47:47 +01:00
Julian Stirling
06632f195e Spelling corrections and docstring improvements
Co-authored by Joe Knapper <jaknapper@hotmail.com>
2025-04-14 15:46:27 +00:00
Julian Stirling
7f46bc2d9b Fixing capture_thread variable and autofocus logic 2025-04-14 11:27:25 +01:00
Julian Stirling
1f66e8bc7a Enormous refactor of the scan code, was hard to find an intermediate working place to commit 2025-04-14 11:27:25 +01:00
Julian Stirling
cddb49c9f7 Clean up code as I remove bare excepts 2025-04-14 11:27:25 +01:00
Julian Stirling
2c171026be Still tidying the start end end of the scan code 2025-04-14 11:27:25 +01:00
Julian Stirling
797f3bcb60 Collecting scan parameters into dictionary that will become a dataclass 2025-04-14 11:27:25 +01:00
Julian Stirling
4eeff35e2d Fixes to naming to make basic lint checks pass 2025-04-11 12:29:14 +01:00
Julian Stirling
b7c472bb24 fix comment on number of zeros padding the scan name 2025-04-10 22:39:22 +01:00
Julian Stirling
31c768c12a Move @_scan_running decorator out of class and tidy as suggested in review 2025-04-10 22:14:56 +01:00
Julian Stirling
e030eb576b Add @scan_running decorator for scans to try to access to the scan logger for methods not called by the scan 2025-04-10 17:52:12 +01:00
Julian Stirling
26e265f026 Fixes from review (mostly spellings)
Co authored by:

* Joe Knapper <jaknapper@hotmail.com>
* Beth Probert <beth_probert@outlook.com>
2025-04-10 16:35:49 +00:00
Julian Stirling
a5d55c95b8 Further tidying of scan directory variables 2025-04-10 13:24:11 +01:00
Julian Stirling
90cfce146d Fix default scan name 2025-04-10 11:46:16 +01:00
Julian Stirling
040373ef88 Run check background aonly fter scan variables are stored 2025-04-10 11:45:57 +01:00
Julian Stirling
83d2930d1f Fix capture error handing
The error handling for capture needs to still send the aquired event
or it will lock forever. On getting the errors to work there
were some other minor issues in how the errors were called.
2025-04-09 23:52:47 +01:00
Julian Stirling
70e7a21a29 Starting to refactor smart scan to rely on class variables 2025-04-09 22:55:35 +01:00
Julian Stirling
ff1184d453 Handle errors in capture thread 2025-04-09 22:45:18 +01:00
Joe Knapper
1d5d67f35a Split out background detect into a new file 2025-04-09 17:25:19 +01:00
Joe Knapper
f4db9b6e52 Removed commented out code and unused functions 2025-04-09 15:32:13 +01:00
jaknapper
a5d1f1e965 Removed commented out code 2025-04-09 15:11:26 +01:00
jaknapper
e28a160b22 Ruff formatting adding commas 2025-04-09 14:59:20 +01:00
jaknapper
8d14aee27c Breaking out capture and save code into three seperate methods 2025-04-09 13:20:06 +01:00
jaknapper
9c2ab977c5 Removed imports and variable to pass Ruff linting 2025-04-08 19:07:23 +01:00
jaknapper
574aa1c6c0 Only grab a JPEG from the stream to get scanning working 2025-04-08 17:52:55 +01:00
jaknapper
b340da488e Use the UV channels only to determine if an area is background or sample 2025-04-08 11:14:17 +01:00
Julian Stirling
1493f51212 Purge all windows line endings and add check to formatter.
Also changes python version in pyproject.toml as it is incorrect
2025-04-08 10:51:26 +01:00
Julian Stirling
32f2a7ce70 Fix spurious line endings, don't allow ruff-format to fail anymore 2025-04-02 14:25:22 +01:00
Richard Bowman
9fd8fc37f1 Formatted with Ruff 2024-12-03 06:46:08 +00:00
Richard Bowman
27aec769a2 Linter fixes
NB I have permitted bare except: blocks in smart_scan. This should be reverted.
2024-12-03 06:43:45 +00:00
Richard Bowman
a0fbbc3e40 Convert Stage to a Protocol
The Stage is now implemented as a runtime-checkable Protocol.

Part of this led to the realisation that we can't create a DirectThingClient
based on a Protocol, only on a concrete Thing. While it might be
a good idea to address that in LabThings in due course, for now
we work around it by creating both a Protocol and a stub class. The stub class implements the protocol, and
can be used to declare a dependency.
2024-11-29 12:53:04 +00:00
Richard Bowman
adbb805556 Formal Protocol for camera interface
I've now split the base camera code into a runtime-checkable Protocol
and a concrete base class (which is optional). This removes the requirement
for cameras to subclass `openflexure_microscope.things.camera.Camera`
and instead uses duck typing that should
work both statically and dynamically.

As part of this, I've moved the commonly-used dependencies
on the camera inside `openflexure_microscope.things.camera` for consistency, and to make it easy to update them if it changes in the future.
2024-11-29 11:26:38 +00:00
Richard Bowman
1ba799de22 Migrate to new Blob type and update imports
This now uses the latest version of labthings-fastapi.
2024-11-28 17:35:56 +00:00
Richard Bowman
2268425bf3 Depend only on generic Camera and Stage
I've now defined parent classes for camera and stage, and depend only on those. This allows
proper typing while enabling the actual hardware
classes to be swapped.

The interfaces definitely aren't final - this is a first
draft, largely to enable me to test out the concept
of a configuration server.
2024-08-09 02:41:39 +01:00
Joe Knapper
4ea3b5b623 Increase minimum fraction coverage - makes stitching much more reliable 2024-05-30 11:42:25 +00:00
jaknapper
f08840f0e8 Zip a stitched image with the scan name in the filename 2024-03-05 13:38:24 +00:00
jaknapper
43cf7e837a Produce tiff as property 2024-02-21 14:42:52 +00:00
jaknapper
169df15fd1 More restricted range 2024-02-21 14:04:07 +00:00
Joe Knapper
6031280a19 Merge branch 'changes-into-saturation-fix' into verify-focus 2024-02-20 14:17:25 +00:00