refactor: update GPhotoCamera configuration methods for consistency
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from PySide6.QtCore import Signal
|
||||
|
||||
|
||||
class BaseCamera(ABC):
|
||||
@@ -18,5 +17,21 @@ class BaseCamera(ABC):
|
||||
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)
|
||||
|
||||
@@ -88,10 +88,10 @@ class GPhotoCamera(BaseCamera):
|
||||
|
||||
self.set_config(config, value)
|
||||
|
||||
def set_config_by_name(self, name: str):
|
||||
def set_config_by_name(self, name: str, value: str):
|
||||
config = self.get_config_by_name(name)
|
||||
|
||||
self.set_config(config, name)
|
||||
self.set_config(config, value)
|
||||
|
||||
def _save_config(self, config):
|
||||
if not self.camera:
|
||||
|
||||
Reference in New Issue
Block a user