38 lines
875 B
Python
38 lines
875 B
Python
from abc import ABC, abstractmethod
|
|
|
|
|
|
class BaseCamera(ABC):
|
|
def __init__(self) -> None:
|
|
self.error_msg = None
|
|
|
|
@abstractmethod
|
|
def connect(self) -> bool:
|
|
raise NotImplementedError
|
|
|
|
@abstractmethod
|
|
def disconnect(self) -> None:
|
|
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_name(self, name: str) -> dict:
|
|
raise NotImplementedError
|
|
|
|
@abstractmethod
|
|
def set_config_by_id(self, id: int, value: str):
|
|
raise NotImplementedError
|
|
|
|
@abstractmethod
|
|
def set_config_by_name(self, name: str, value: str):
|
|
raise NotImplementedError
|
|
|
|
def get_error_msg(self):
|
|
return str(self.error_msg)
|