sec_interp.core.controller module
Controller for SecInterp profile data generation.
This module handles the orchestration of various data generation services (topography, geology, structures, drillholes) and manages result caching.
- class sec_interp.core.controller.ProfileController(data_fetcher: Any | None = None, structure_extractor: Any | None = None, geology_extractor: Any | None = None, profile_extractor: Any | None = None, drillhole_extractor: Any | None = None, config_service: ConfigService | None = None)
Bases:
TranslatableMixinOrchestrates data generation services for SecInterp profile creation.
- __init__(data_fetcher: Any | None = None, structure_extractor: Any | None = None, geology_extractor: Any | None = None, profile_extractor: Any | None = None, drillhole_extractor: Any | None = None, config_service: ConfigService | None = None) None
Initialize services and the data cache using Dependency Injection.
- Parameters:
data_fetcher – Optional feature fetcher (Extract adapter), provided by the GUI composition root.
structure_extractor – Optional structure extractor (Extract adapter), provided by the GUI composition root.
geology_extractor – Optional geology extractor (Extract adapter), provided by the GUI composition root.
profile_extractor – Optional profile extractor (Extract adapter), provided by the GUI composition root.
drillhole_extractor – Optional drillhole extractor (Extract adapter), provided by the GUI composition root.
config_service – Optional settings service; core defaults to an in-memory store, the plugin injects the QgsSettings adapter.
- cache_data(inputs: dict[str, Any], data: dict[str, Any]) None
Cache the generated data resulting from the given inputs.
- Parameters:
inputs – Dictionary of input parameters to generate cache key.
data – Data dictionary to cache.
- generate_profile_data(params: PreviewParams) tuple[list[tuple[float, float]], list[Any] | None, list[Any] | None, Any | None, list[str]]
Unified method to generate all profile data components with granular caching.
- get_cached_data(inputs: dict[str, Any]) dict[str, Any] | None
Retrieve data from cache if available for the given inputs.
- Parameters:
inputs – Dictionary of input parameters to generate cache key.
- Returns:
Cached data dictionary if found, else None.
- reload_settings() None
Force reload of settings from ConfigService.