refactor: update GPhotoCamera configuration methods for consistency

This commit is contained in:
2025-09-21 22:01:46 +02:00
parent abc07fd08d
commit 373e01310e
2 changed files with 19 additions and 4 deletions

View File

@@ -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)

View File

@@ -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: