Phase 6: strip signature-restating docstrings; correct README/SETUP
- Collapsed Args:/Returns:/Raises: blocks that only restated the signature (364 lines): tektronix_base 48% -> ~20% doc density, helios_laser and uc480_camera likewise. Only docstrings whose entire body was those sections were touched. - Preserved verbatim the comments that carry hardware knowledge the code can't express: uc480's USB split-transaction contention note (with its measured fps), the IS_ALLOW_STARTER_FW_UPLOAD segfault explanation, the QImage-copy rationale, and tektronix's NUMFRAMESACQuired warning. - README: project structure, quick start, and every usage example now describe code that exists (they referenced hardware/bbd202.py, CoherentHOPSLaser, get_curve_binary, and 'python -m scanengine.app', none of which do). Added a headless-scan example and a read-a-scan-file example, since reuse without the GUI is the point of the refactor. - SETUP: structure section defers to README instead of keeping a second stale copy; documents the vendored uEye SDK and the Genesis quarantine. - ruff is now clean repo-wide: fixed the remaining raise-from, unused loop variables, placeholder f-strings, and a non-strict zip; the widget-layout semicolon idiom is an explicit config ignore rather than 22 standing warnings. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -91,11 +91,10 @@ lsusb | grep -i thorlabs
|
||||
**First-time setup:**
|
||||
```bash
|
||||
# Run the stage test application
|
||||
python stage_test_app.py
|
||||
python bbd202_test_app.py
|
||||
|
||||
# Enter your BBD203 serial number
|
||||
# Click "Connect" to test the connection
|
||||
# Use "Home All Axes" to verify operation
|
||||
# Set the serial port, click Connect (it now fails loudly if no bay
|
||||
# responds), then Home to verify operation.
|
||||
```
|
||||
|
||||
### Helios Laser System
|
||||
@@ -132,10 +131,15 @@ python -c "from pyftdi.ftdi import Ftdi; Ftdi.show_devices()"
|
||||
|
||||
**First-time setup:**
|
||||
```bash
|
||||
# Test laser connection
|
||||
python -c "from hardware.coherent_hops_laser import CoherentHOPSLaser; laser = CoherentHOPSLaser(); print('Connected:', laser.connect())"
|
||||
# Test the Genesis laser connection
|
||||
python tools/genesis_laser_control.py
|
||||
```
|
||||
|
||||
> Before changing any Genesis code, read
|
||||
> [docs/genesis_verification.md](docs/genesis_verification.md) — the two
|
||||
> implementations in the repo disagree on ADC scaling, LDD polarity, and
|
||||
> shutter behaviour, and only the bench can settle it.
|
||||
|
||||
### Tektronix Oscilloscope
|
||||
|
||||
**Connection:**
|
||||
@@ -228,65 +232,21 @@ Main window settings (geometry, last used values) are stored in Qt settings:
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
scanengine-3/
|
||||
│
|
||||
├── scanengine/ # Main application package
|
||||
│ ├── __init__.py
|
||||
│ ├── app.py # Main application entry point
|
||||
│ ├── main_launcher.ui # Main launcher UI
|
||||
│ ├── new_scan_wizard.ui # Scan wizard UI
|
||||
│ └── options.ui # Options dialog UI
|
||||
│
|
||||
├── hardware/ # Hardware driver package
|
||||
│ ├── __init__.py
|
||||
│ ├── bbd202.py # ThorLabs stage controller
|
||||
│ ├── uc480_camera.py # IDS/ThorLabs camera
|
||||
│ ├── tektronix_base.py # Tektronix oscilloscope
|
||||
│ ├── coherent_hops_laser.py # Coherent HOPS laser
|
||||
│ └── genesis_core.py # Genesis laser core logic
|
||||
│
|
||||
├── scanning/ # Scan planning package
|
||||
│ ├── __init__.py
|
||||
│ ├── sc3_scan_model.py # Scan model
|
||||
│ └── stage_scan_plan_generator.py # Scan path planning
|
||||
│
|
||||
├── tools/ # Standalone executable tools
|
||||
│ ├── genesis_laser_control.py # Standalone Genesis app
|
||||
│ └── genesis_laser_gui.py # Alternative Genesis GUI
|
||||
│
|
||||
├── tests/ # Test files
|
||||
│ ├── __init__.py
|
||||
│ ├── test_camera_integration.py
|
||||
│ ├── test_genesis_connection.py
|
||||
│ ├── test_genesis_protocol.py
|
||||
│ ├── test_rotated_aoi.py
|
||||
│ └── test_temperature_scaling.py
|
||||
│
|
||||
├── docs/ # Documentation
|
||||
│ ├── hardware/ # Hardware documentation
|
||||
│ │ ├── BBD203_CONNECTION_GUIDE.md
|
||||
│ │ ├── BBD203_Communications_Protocol.md
|
||||
│ │ ├── BBD203_DRIVER_README.md
|
||||
│ │ ├── HELIOS_DRIVER_README.md
|
||||
│ │ ├── GENESIS_LASER_README.md
|
||||
│ │ └── laser_control_implementation_guide.md
|
||||
│ └── protocols/ # Protocol specifications
|
||||
│ ├── apt_communications_protocol.pdf
|
||||
│ ├── helios_comms_protocol.pdf
|
||||
│ └── thorlabs_mls_protocol.pdf
|
||||
│
|
||||
├── lib/ # Binary libraries (not in git)
|
||||
│ ├── libueye_api64.so.3.82
|
||||
│ ├── ueye_loader.c
|
||||
│ └── ueye_loader.so
|
||||
│
|
||||
├── config.json # System configuration
|
||||
├── requirements.txt # Python dependencies
|
||||
├── README.md # Project overview
|
||||
├── SETUP.md # This file
|
||||
└── LICENSE # License file
|
||||
```
|
||||
See the tree in [README.md](README.md#project-structure). In short: `core/`
|
||||
is the headless scan engine and file format (no PyQt6, no vendor SDKs),
|
||||
`hardware/` holds the Qt-free device drivers, `gui/` the shared PyQt6
|
||||
adapters and widgets, and the root `*.py` files are the runnable apps.
|
||||
|
||||
## Vendored camera SDK (`lib/`)
|
||||
|
||||
`lib/` is gitignored, so a fresh clone does not have it. The IDS uEye
|
||||
runtime (`libueye_api64.so.3.82`) must come from the IDS SDK installation
|
||||
matching the camera firmware on this rig.
|
||||
|
||||
`lib/ueye_loader.{c,so}` is an `LD_PRELOAD` shim that dlopens
|
||||
`/usr/lib/libueye_api.so` before Python starts. Nothing in the repo
|
||||
references it and no launcher sets `LD_PRELOAD`, so whether it is still
|
||||
needed is an open question — see [KNOWN_ISSUES.md](KNOWN_ISSUES.md).
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
|
||||
Reference in New Issue
Block a user