Skip to content

Commit 32edfd5

Browse files
authored
Add acquire-driver-pvcam (#155)
- Adds `acquire-driver-pvcam` to the list of drivers - Adds a workflow and rudimentary test for pvcam driver - Updates readme
1 parent a00c83b commit 32edfd5

File tree

6 files changed

+83
-6
lines changed

6 files changed

+83
-6
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ jobs:
6161
"acquire-driver-zarr": "nightly",
6262
"acquire-driver-egrabber": "nightly",
6363
"acquire-driver-hdcam": "nightly",
64-
"acquire-driver-spinnaker": "nightly"
64+
"acquire-driver-spinnaker": "nightly",
65+
"acquire-driver-pvcam": "nightly"
6566
}
6667
EOF
6768
shell: bash

.github/workflows/test_pr.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,51 @@ jobs:
198198
run: |
199199
python -m pytest -k test_spinnaker
200200
201+
pvcam:
202+
name: Python ${{ matrix.python }} (PVCAM)
203+
runs-on:
204+
- self-hosted
205+
- pvcam
206+
- Prime-BSI
207+
timeout-minutes: 20
208+
strategy:
209+
fail-fast: false
210+
matrix:
211+
python: [ "3.8", "3.9", "3.10" ]
212+
213+
permissions:
214+
actions: write
215+
env:
216+
GH_TOKEN: ${{ github.token }}
217+
steps:
218+
- name: Cancel Previous Runs
219+
uses: styfle/[email protected]
220+
with:
221+
access_token: ${{ github.token }}
222+
223+
- uses: actions/checkout@v3
224+
with:
225+
submodules: true
226+
ref: ${{ github.event.pull_request.head.sha }}
227+
228+
- name: Get CMake 3.24
229+
uses: lukka/get-cmake@latest
230+
with:
231+
cmakeVersion: 3.24.3
232+
233+
- name: Set up Python ${{ matrix.python }}
234+
uses: actions/setup-python@v4
235+
with:
236+
python-version: ${{ matrix.python }}
237+
238+
- name: Install
239+
run: |
240+
pip install --upgrade pip
241+
pip install -e .[testing]
242+
243+
- name: Test
244+
run: |
245+
python -m pytest -k test_pvcam
201246
202247
typing:
203248
name: mypy typing
@@ -233,6 +278,8 @@ jobs:
233278
- platforms
234279
- dcam
235280
# - egrabber
281+
- spinnaker
282+
- pvcam
236283
- typing
237284
if: ${{ github.actor == 'dependabot[bot]' }}
238285
steps:

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Acquire supports the following cameras (currently only on Windows):
2020
- [Vieworks VC-151MX-M6H00](https://www.visionsystech.com/products/cameras/vieworks-vc-151mx-sony-imx411-sensor-ultra-high-resolution-cmos-camera-151-mp)
2121
- [FLIR Blackfly USB3 (BFLY-U3-23S6M-C)](https://www.flir.com/products/blackfly-usb3/?model=BFLY-U3-23S6M-C&vertical=machine+vision&segment=iis)
2222
- [FLIR Oryx 10GigE (ORX-10GS-51S5M-C)](https://www.flir.com/products/oryx-10gige/?model=ORX-10GS-51S5M-C&vertical=machine+vision&segment=iis)
23+
- [Photometrics Prime BSI](https://www.photometrics.com/products/prime-family/primebsi)
24+
- [Photometrics Prime BSI Express](https://www.photometrics.com/products/prime-family/primebsiexpress)
2325

2426
Acquire also supports the following output file formats:
2527

@@ -80,24 +82,24 @@ touch wrapper.h # will trigger a rebuild
8082
python -m build
8183
```
8284

83-
This package depends on a submodule ([acquire-video-runtime](https://github.com/acquire-project/acquire-video-runtime))
85+
This package depends on a submodule ([acquire-common](https://github.com/acquire-project/acquire-common))
8486
and binaries from the following Acquire drivers:
85-
- [acquire-driver-common](https://github.com/acquire-project/acquire-driver-common)
8687
- [acquire-driver-hdcam](https://github.com/acquire-project/acquire-driver-hdcam)
8788
- [acquire-driver-egrabber](https://github.com/acquire-project/acquire-driver-egrabber)
8889
- [acquire-driver-zarr](https://github.com/acquire-project/acquire-driver-zarr)
8990
- [acquire-driver-spinnaker](https://github.com/acquire-project/acquire-driver-spinnaker)
91+
- [acquire-driver-pvcam](https://github.com/acquire-project/acquire-driver-pvcam)
9092

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

9496
```json
9597
{
96-
"acquire-driver-common": "0.1.0",
9798
"acquire-driver-hdcam": "0.1.0",
9899
"acquire-driver-egrabber": "0.1.0",
99100
"acquire-driver-zarr": "0.1.0",
100-
"acquire-driver-spinnaker": "0.1.0"
101+
"acquire-driver-spinnaker": "0.1.0",
102+
"acquire-driver-pvcam": "0.1.0"
101103
}
102104
```
103105

build.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ struct DriverManifest {
99
acquire_driver_egrabber: String,
1010
acquire_driver_hdcam: String,
1111
acquire_driver_spinnaker: String,
12+
acquire_driver_pvcam: String,
1213
}
1314

1415
fn main() {
@@ -78,6 +79,11 @@ fn main() {
7879
"acquire-driver-spinnaker",
7980
tags.acquire_driver_spinnaker.as_str(),
8081
);
82+
fetch_acquire_driver(
83+
&drivers_dir,
84+
"acquire-driver-pvcam",
85+
tags.acquire_driver_pvcam.as_str(),
86+
);
8187
}
8288

8389
fn fetch_artifact(dst: &std::path::PathBuf, name: &str, tag: &str) {

drivers.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"acquire-driver-zarr": "0.1.8",
33
"acquire-driver-egrabber": "0.1.5",
44
"acquire-driver-hdcam": "0.1.7",
5-
"acquire-driver-spinnaker": "0.1.1"
5+
"acquire-driver-spinnaker": "0.1.1",
6+
"acquire-driver-pvcam": "0.1.0"
67
}

tests/test_pvcam.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import acquire
2+
import pytest
3+
from acquire import DeviceKind
4+
5+
6+
@pytest.fixture(scope="module")
7+
def _runtime():
8+
runtime = acquire.Runtime()
9+
yield runtime
10+
11+
12+
@pytest.fixture(scope="function")
13+
def runtime(_runtime: acquire.Runtime):
14+
yield _runtime
15+
_runtime.set_configuration(acquire.Properties())
16+
17+
18+
def test_prime_bsi_camera_is_present(runtime: acquire.Runtime):
19+
dm = runtime.device_manager()
20+
assert dm.select(DeviceKind.Camera, ".*BSI.*")

0 commit comments

Comments
 (0)