Skip to content

Commit

Permalink
Add acquire-driver-pvcam (#155)
Browse files Browse the repository at this point in the history
- Adds `acquire-driver-pvcam` to the list of drivers
- Adds a workflow and rudimentary test for pvcam driver
- Updates readme
  • Loading branch information
aliddell authored Jan 9, 2024
1 parent a00c83b commit 32edfd5
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ jobs:
"acquire-driver-zarr": "nightly",
"acquire-driver-egrabber": "nightly",
"acquire-driver-hdcam": "nightly",
"acquire-driver-spinnaker": "nightly"
"acquire-driver-spinnaker": "nightly",
"acquire-driver-pvcam": "nightly"
}
EOF
shell: bash
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/test_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,51 @@ jobs:
run: |
python -m pytest -k test_spinnaker
pvcam:
name: Python ${{ matrix.python }} (PVCAM)
runs-on:
- self-hosted
- pvcam
- Prime-BSI
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
python: [ "3.8", "3.9", "3.10" ]

permissions:
actions: write
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v3
with:
submodules: true
ref: ${{ github.event.pull_request.head.sha }}

- name: Get CMake 3.24
uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.24.3

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

- name: Install
run: |
pip install --upgrade pip
pip install -e .[testing]
- name: Test
run: |
python -m pytest -k test_pvcam
typing:
name: mypy typing
Expand Down Expand Up @@ -233,6 +278,8 @@ jobs:
- platforms
- dcam
# - egrabber
- spinnaker
- pvcam
- typing
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Acquire supports the following cameras (currently only on Windows):
- [Vieworks VC-151MX-M6H00](https://www.visionsystech.com/products/cameras/vieworks-vc-151mx-sony-imx411-sensor-ultra-high-resolution-cmos-camera-151-mp)
- [FLIR Blackfly USB3 (BFLY-U3-23S6M-C)](https://www.flir.com/products/blackfly-usb3/?model=BFLY-U3-23S6M-C&vertical=machine+vision&segment=iis)
- [FLIR Oryx 10GigE (ORX-10GS-51S5M-C)](https://www.flir.com/products/oryx-10gige/?model=ORX-10GS-51S5M-C&vertical=machine+vision&segment=iis)
- [Photometrics Prime BSI](https://www.photometrics.com/products/prime-family/primebsi)
- [Photometrics Prime BSI Express](https://www.photometrics.com/products/prime-family/primebsiexpress)

Acquire also supports the following output file formats:

Expand Down Expand Up @@ -80,24 +82,24 @@ touch wrapper.h # will trigger a rebuild
python -m build
```

This package depends on a submodule ([acquire-video-runtime](https://github.com/acquire-project/acquire-video-runtime))
This package depends on a submodule ([acquire-common](https://github.com/acquire-project/acquire-common))
and binaries from the following Acquire drivers:
- [acquire-driver-common](https://github.com/acquire-project/acquire-driver-common)
- [acquire-driver-hdcam](https://github.com/acquire-project/acquire-driver-hdcam)
- [acquire-driver-egrabber](https://github.com/acquire-project/acquire-driver-egrabber)
- [acquire-driver-zarr](https://github.com/acquire-project/acquire-driver-zarr)
- [acquire-driver-spinnaker](https://github.com/acquire-project/acquire-driver-spinnaker)
- [acquire-driver-pvcam](https://github.com/acquire-project/acquire-driver-pvcam)

The build script will automatically try to fetch the binaries from GitHub releases.
In order to configure which release of each driver to use, you can set the value in `drivers.json`:

```json
{
"acquire-driver-common": "0.1.0",
"acquire-driver-hdcam": "0.1.0",
"acquire-driver-egrabber": "0.1.0",
"acquire-driver-zarr": "0.1.0",
"acquire-driver-spinnaker": "0.1.0"
"acquire-driver-spinnaker": "0.1.0",
"acquire-driver-pvcam": "0.1.0"
}
```

Expand Down
6 changes: 6 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ struct DriverManifest {
acquire_driver_egrabber: String,
acquire_driver_hdcam: String,
acquire_driver_spinnaker: String,
acquire_driver_pvcam: String,
}

fn main() {
Expand Down Expand Up @@ -78,6 +79,11 @@ fn main() {
"acquire-driver-spinnaker",
tags.acquire_driver_spinnaker.as_str(),
);
fetch_acquire_driver(
&drivers_dir,
"acquire-driver-pvcam",
tags.acquire_driver_pvcam.as_str(),
);
}

fn fetch_artifact(dst: &std::path::PathBuf, name: &str, tag: &str) {
Expand Down
3 changes: 2 additions & 1 deletion drivers.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"acquire-driver-zarr": "0.1.8",
"acquire-driver-egrabber": "0.1.5",
"acquire-driver-hdcam": "0.1.7",
"acquire-driver-spinnaker": "0.1.1"
"acquire-driver-spinnaker": "0.1.1",
"acquire-driver-pvcam": "0.1.0"
}
20 changes: 20 additions & 0 deletions tests/test_pvcam.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import acquire
import pytest
from acquire import DeviceKind


@pytest.fixture(scope="module")
def _runtime():
runtime = acquire.Runtime()
yield runtime


@pytest.fixture(scope="function")
def runtime(_runtime: acquire.Runtime):
yield _runtime
_runtime.set_configuration(acquire.Properties())


def test_prime_bsi_camera_is_present(runtime: acquire.Runtime):
dm = runtime.device_manager()
assert dm.select(DeviceKind.Camera, ".*BSI.*")

0 comments on commit 32edfd5

Please sign in to comment.