sec_interp.core.config module

Configuration Service module.

class sec_interp.core.config.ConfigService(store: SettingsStore | None = None)

Bases: object

Service to handle plugin configuration and persistent settings.

DEFAULT_BUFFER_DIST = 100.0
DEFAULT_DEM_BAND = 1
DEFAULT_DPI = 300
DEFAULT_EXPORT_QUALITY = 95
DEFAULT_MAX_POINTS = 10000
DEFAULT_PREVIEW_HEIGHT = 600
DEFAULT_PREVIEW_WIDTH = 800
DEFAULT_SAMPLING_INTERVAL = 10.0
DEFAULT_SCALE = 50000.0
DEFAULT_VERT_EXAG = 1.0
PREFIX = 'SecInterp/'
SUPPORTED_DOCUMENT_FORMATS = ['.pdf', '.svg']
SUPPORTED_IMAGE_FORMATS = ['.png', '.jpg', '.jpeg']
SUPPORTED_VECTOR_FORMATS = ['.shp']
__init__(store: SettingsStore | None = None) → None

Initialize the Configuration Service with a settings store.

The plugin injects QgsSettingsStore; headless/core callers get an in-memory store that is immediately usable and never touches QGIS.

get(key: str, default: Any = None) → Any

Retrieve a configuration value by key.

Parameters:
  • key – The configuration key (without prefix).

  • default – Optional default value if not found in settings or defaults.

Returns:

The configuration value from settings or its default value.

get_all_settings(reload: bool = False) → PluginSettings

Load and return all settings as a validated PluginSettings object.

reset_defaults() → None

Reset all known persistent settings to their default values.

set(key: str, value: Any) → None

Store a configuration value.

Parameters:
  • key – The configuration key (without prefix).

  • value – The value to persist in settings.

tr(message: str) → str

Translate a message using the injected translator.