Class AppConfig

java.lang.Object
pl.polsl.rtsa.config.AppConfig

public class AppConfig extends Object
Singleton configuration manager for the application.

Loads settings from 'config.properties' on the classpath. All values have sensible defaults if the file is missing.

Configuration Categories:

  • serial.* - UART communication settings
  • dsp.* - Digital signal processing settings
  • app.* - Application-level settings
  • Field Details

    • logger

      private static final org.slf4j.Logger logger
    • CONFIG_FILE

      private static final String CONFIG_FILE
      See Also:
    • properties

      private static final Properties properties
    • INSTANCE

      private static final AppConfig INSTANCE
  • Constructor Details

    • AppConfig

      private AppConfig()
  • Method Details

    • getInstance

      public static AppConfig getInstance()
      Gets the singleton configuration instance.
      Returns:
      The AppConfig instance.
    • loadProperties

      private void loadProperties()
    • getBaudRate

      public int getBaudRate()
      Gets the UART baud rate. Default: 2,000,000 (2 Mbps)
    • getReadTimeout

      public int getReadTimeout()
      Gets the serial read timeout in milliseconds. Default: 2000ms
    • getAutoResetDelay

      public int getAutoResetDelay()
      Gets the delay after connection for Arduino auto-reset. Default: 2000ms
    • getSampleRate

      public int getSampleRate()
      Gets the default sample rate in Hz. Default: 1000 Hz
    • getBufferSize

      public int getBufferSize()
      Gets the ring buffer size in samples. Default: 32768
    • getVRef

      public double getVRef()
      Gets the ADC reference voltage. Default: 5.0V
    • getAdcResolution

      public int getAdcResolution()
      Gets the ADC resolution (max value + 1). Default: 1024 (10-bit ADC)
    • getMinFftSize

      public int getMinFftSize()
      Gets the minimum FFT size. Default: 65536
    • getTargetFps

      public int getTargetFps()
      Gets the target UI refresh rate. Default: 30 FPS
    • isUseMock

      public boolean isUseMock()
      Gets whether to use mock device for testing. Default: false
    • getLogLevel

      public String getLogLevel()
      Gets the configured log level. Default: INFO
    • getIntProperty

      public int getIntProperty(String key, int defaultValue)
      Gets an integer property with a default value.
    • getDoubleProperty

      public double getDoubleProperty(String key, double defaultValue)
      Gets a double property with a default value.
    • getBooleanProperty

      public boolean getBooleanProperty(String key, boolean defaultValue)
      Gets a boolean property with a default value.
    • getStringProperty

      public String getStringProperty(String key, String defaultValue)
      Gets a string property with a default value.
    • getAllProperties

      public Properties getAllProperties()
      Gets all loaded properties for debugging.
    • toString

      public String toString()
      Overrides:
      toString in class Object