-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
107 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import uuid | ||
from dataclasses import dataclass, field | ||
|
||
|
||
@dataclass | ||
class CameraPoolJobRequest: | ||
sequential: bool = False # sync or sequential each tick next node? | ||
number_captures: int = 1 | ||
|
||
|
||
@dataclass | ||
class CameraPoolJobItem: | ||
request: CameraPoolJobRequest | ||
id: uuid.UUID = field(default_factory=uuid.uuid4) | ||
node_ids: list[uuid.UUID] = field(default_factory=list) | ||
|
||
|
||
@dataclass | ||
class NodeStatus: | ||
description: str = None | ||
can_connect: bool = None | ||
is_healthy: bool = None | ||
is_primary: bool = None | ||
status: str = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from dataclasses import dataclass | ||
|
||
|
||
@dataclass | ||
class BackendCameraMetadata: | ||
iso: int | ||
shutter: object | ||
capture_time: str | ||
|
||
|
||
@dataclass | ||
class BackendCameraCapture: | ||
timestamp_ns: int | ||
frame: object | ||
metadata: BackendCameraMetadata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import uuid | ||
from dataclasses import dataclass, field | ||
from pathlib import Path | ||
|
||
from .backends.cameras.dto import BackendCameraCapture | ||
|
||
|
||
@dataclass | ||
class JobRequest: | ||
number_captures: int = 1 | ||
# TODO: maybe captures:list[bool]=[True] # True=capture, False=skip | ||
|
||
|
||
@dataclass | ||
class JobItem: | ||
request: JobRequest | ||
|
||
id: uuid.UUID = field(default_factory=uuid.uuid4) | ||
# urls: list[str] = field(default_factory=list) | ||
filepaths: list[Path] = field(default_factory=list) | ||
|
||
# @property | ||
# def is_finished(self) -> bool: | ||
# return self.request.number_captures == len(self.filepaths) # if more this is also considered as error! | ||
|
||
# def asdict(self) -> dict: | ||
# out = { | ||
# prop: getattr(self, prop) | ||
# for prop in dir(self) | ||
# if ( | ||
# not prop.startswith("_") # no privates | ||
# and not callable(getattr(__class__, prop, None)) # no callables | ||
# and not isinstance(getattr(self, prop), Path) # no path instances (not json.serializable) | ||
# ) | ||
# } | ||
# return out | ||
|
||
|
||
@dataclass | ||
class AcquisitionCapture: | ||
seq: int | ||
backendcapture: BackendCameraCapture | ||
|
||
|
||
@dataclass | ||
class AcquisitionCameraParameters: | ||
iso: int | None = None | ||
shutter: int | None = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters