#!/usr/bin/env python3
"""
Global singleton instances for the VNA system.

This module centralizes all singleton instances to avoid global variables
scattered throughout the codebase.
"""
from pathlib import Path
from vna_system.core.acquisition.data_acquisition import VNADataAcquisition
from vna_system.core.processors.storage.data_storage import DataStorage
from vna_system.core.settings.settings_manager import VNASettingsManager
from vna_system.core.processors.manager import ProcessorManager
from vna_system.core.processors.websocket_handler import ProcessorWebSocketHandler
from vna_system.core.laser.laser_controller import LaserController
from vna_system.core.config import PROCESSORS_CONFIG_DIR_PATH

# Global singleton instances
vna_data_acquisition_instance: VNADataAcquisition = VNADataAcquisition()
settings_manager: VNASettingsManager = VNASettingsManager()

# Processor system
processor_manager: ProcessorManager = ProcessorManager(vna_data_acquisition_instance.sweep_buffer, settings_manager,  Path(PROCESSORS_CONFIG_DIR_PATH))
data_storage = DataStorage()
processor_websocket_handler: ProcessorWebSocketHandler = ProcessorWebSocketHandler(
    processor_manager, data_storage
)

# Laser control system
laser_controller_instance: LaserController = LaserController()