Skip to content

Commit

Permalink
Update typing and dcam tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aliddell committed May 4, 2023
1 parent d68d40f commit 5fcd566
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
13 changes: 3 additions & 10 deletions python/acquire/acquire.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -112,20 +112,18 @@ class Direction:
def __lt__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...

@final
class InputTriggers:
acquisition_start: Trigger
exposure: Trigger
frame_start: Trigger
@classmethod
def __init__(cls, *args: None, **kwargs: Any) -> None: ...
def dict(self) -> Dict[str, Any]: ...

@final
class OutputTriggers:
exposure: Trigger
frame_start: Trigger
trigger_wait: Trigger
@classmethod
def __init__(cls, *args: None, **kwargs: Any) -> None: ...
def dict(self) -> Dict[str, Any]: ...

@final
Expand All @@ -146,7 +144,7 @@ class Properties:
class Runtime:
def __init__(self, *args: None, **kwargs: Any) -> None: ...
def device_manager(self) -> DeviceManager: ...
def get_available_data(self, stream_id: int) -> AvailableData: ...
def get_available_data(self, istream: int) -> AvailableData: ...
def get_configuration(self) -> Properties: ...
def get_state(self) -> DeviceState: ...
def set_configuration(self, properties: Properties) -> Properties: ...
Expand Down Expand Up @@ -179,11 +177,6 @@ class SampleType:
def __lt__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...

@final
class Signals:
identifier: Optional[DeviceIdentifier]
settings: SignalProperties
def dict(self) -> Dict[str, Any]: ...

@final
class SignalIOKind:
Expand Down
11 changes: 4 additions & 7 deletions tests/test_dcam.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import acquire
import pytest
from acquire import DeviceKind, SampleType, TriggerEvent
from acquire import DeviceKind, SampleType, Trigger


@pytest.fixture(scope="module")
Expand Down Expand Up @@ -35,12 +35,9 @@ def test_ext_triggering(runtime: acquire.Runtime):
# This comes in the form of the returned properties.
p = runtime.set_configuration(p)

p.video[0].camera.settings.triggers[1].enable = True
p.video[0].camera.settings.triggers[1].event = TriggerEvent.FrameStart
p.video[0].camera.settings.input_triggers.frame_start = Trigger(enable=True, line=1)
# Call set_configuration() again to apply the trigger properties
p = runtime.set_configuration(p)

assert p.video[0].camera.settings.triggers[1].enable is True
assert (
p.video[0].camera.settings.triggers[1].event == TriggerEvent.FrameStart
)
assert p.video[0].camera.settings.input_triggers.frame_start.enable is True
assert p.video[0].camera.settings.input_triggers.frame_start.line == 1

0 comments on commit 5fcd566

Please sign in to comment.