java.lang.Object
pl.polsl.rtsa.config.AppConfig
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 Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final AppConfigprivate static final org.slf4j.Loggerprivate static final Properties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGets the ADC resolution (max value + 1).Gets all loaded properties for debugging.intGets the delay after connection for Arduino auto-reset.intGets the UART baud rate.booleangetBooleanProperty(String key, boolean defaultValue) Gets a boolean property with a default value.intGets the ring buffer size in samples.doublegetDoubleProperty(String key, double defaultValue) Gets a double property with a default value.static AppConfigGets the singleton configuration instance.intgetIntProperty(String key, int defaultValue) Gets an integer property with a default value.Gets the configured log level.intGets the minimum FFT size.intGets the serial read timeout in milliseconds.intGets the default sample rate in Hz.getStringProperty(String key, String defaultValue) Gets a string property with a default value.intGets the target UI refresh rate.doublegetVRef()Gets the ADC reference voltage.booleanGets whether to use mock device for testing.private voidtoString()
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
CONFIG_FILE
- See Also:
-
properties
-
INSTANCE
-
-
Constructor Details
-
AppConfig
private AppConfig()
-
-
Method Details
-
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
Gets the configured log level. Default: INFO -
getIntProperty
Gets an integer property with a default value. -
getDoubleProperty
Gets a double property with a default value. -
getBooleanProperty
Gets a boolean property with a default value. -
getStringProperty
Gets a string property with a default value. -
getAllProperties
Gets all loaded properties for debugging. -
toString
-