refactor: update camera classes to improve initialization and connection handling
This commit is contained in:
@@ -2,36 +2,36 @@ from abc import ABC, abstractmethod
|
||||
|
||||
|
||||
class BaseCamera(ABC):
|
||||
def __init__(self) -> None:
|
||||
self.error_msg = None
|
||||
def __init__(self) -> None:
|
||||
self.error_msg = None
|
||||
|
||||
@abstractmethod
|
||||
def connect(self) -> bool:
|
||||
raise NotImplementedError
|
||||
@abstractmethod
|
||||
def connect(self, index: int | None = None) -> bool:
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
def disconnect(self) -> None:
|
||||
raise NotImplementedError
|
||||
@abstractmethod
|
||||
def disconnect(self) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
def get_frame(self):
|
||||
raise NotImplementedError
|
||||
@abstractmethod
|
||||
def get_frame(self):
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
def get_config_by_id(self, id: int) -> dict:
|
||||
raise NotImplementedError
|
||||
@abstractmethod
|
||||
def get_config_by_id(self, id: int) -> dict:
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
def get_config_by_name(self, name: str) -> dict:
|
||||
raise NotImplementedError
|
||||
@abstractmethod
|
||||
def get_config_by_name(self, name: str) -> dict:
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
def set_config_by_id(self, id: int, value) -> None:
|
||||
raise NotImplementedError
|
||||
@abstractmethod
|
||||
def set_config_by_id(self, id: int, value) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
def set_config_by_name(self, name: str, value) -> None:
|
||||
raise NotImplementedError
|
||||
@abstractmethod
|
||||
def set_config_by_name(self, name: str, value) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
def get_error_msg(self):
|
||||
return str(self.error_msg)
|
||||
def get_error_msg(self):
|
||||
return str(self.error_msg)
|
||||
|
||||
Reference in New Issue
Block a user