diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3411dbf..ae33017 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/.github/workflows/test_pr.yml b/.github/workflows/test_pr.yml index e713dce..c25aac9 100644 --- a/.github/workflows/test_pr.yml +++ b/.github/workflows/test_pr.yml @@ -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 @@ -233,6 +278,8 @@ jobs: - platforms - dcam # - egrabber + - spinnaker + - pvcam - typing if: ${{ github.actor == 'dependabot[bot]' }} steps: diff --git a/README.md b/README.md index d451d29..0d5a83d 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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" } ``` diff --git a/build.rs b/build.rs index e6ce5b5..894e7d6 100644 --- a/build.rs +++ b/build.rs @@ -9,6 +9,7 @@ struct DriverManifest { acquire_driver_egrabber: String, acquire_driver_hdcam: String, acquire_driver_spinnaker: String, + acquire_driver_pvcam: String, } fn main() { @@ -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) { diff --git a/drivers.json b/drivers.json index 7a08cb0..77f8558 100644 --- a/drivers.json +++ b/drivers.json @@ -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" } diff --git a/tests/test_pvcam.py b/tests/test_pvcam.py new file mode 100644 index 0000000..46b7f4a --- /dev/null +++ b/tests/test_pvcam.py @@ -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.*")