java.lang.Object
java.lang.Record
pl.polsl.rtsa.api.dto.AcquisitionConfig
- Record Components:
sampleRate- Current sampling rate in Hz.bufferSize- Number of samples per buffer.acquisitionActive- Whether data acquisition is currently running.
public record AcquisitionConfig(double sampleRate, int bufferSize, boolean acquisitionActive)
extends Record
Data Transfer Object representing signal acquisition parameters.
Immutable record for thread-safe access.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanThe field for theacquisitionActiverecord component.private final intThe field for thebufferSizerecord component.static final doublePredefined sample rate: 10 kHzstatic final doublePredefined sample rate: 1 kHzstatic final doublePredefined sample rate: 20 kHz (Turbo Mode)private final doubleThe field for thesampleRaterecord component. -
Constructor Summary
ConstructorsConstructorDescriptionAcquisitionConfig(double sampleRate, int bufferSize, boolean acquisitionActive) Creates an instance of aAcquisitionConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theacquisitionActiverecord component.intReturns the value of thebufferSizerecord component.static AcquisitionConfigCreates default acquisition configuration.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleReturns the value of thesampleRaterecord component.final StringtoString()Returns a string representation of this record class.withAcquisitionActive(boolean active) Creates configuration with acquisition state changed.withSampleRate(double newSampleRate) Creates configuration with specified sample rate.
-
Field Details
-
sampleRate
private final double sampleRateThe field for thesampleRaterecord component. -
bufferSize
private final int bufferSizeThe field for thebufferSizerecord component. -
acquisitionActive
private final boolean acquisitionActiveThe field for theacquisitionActiverecord component. -
RATE_1KHZ
public static final double RATE_1KHZPredefined sample rate: 1 kHz- See Also:
-
RATE_10KHZ
public static final double RATE_10KHZPredefined sample rate: 10 kHz- See Also:
-
RATE_20KHZ
public static final double RATE_20KHZPredefined sample rate: 20 kHz (Turbo Mode)- See Also:
-
-
Constructor Details
-
AcquisitionConfig
public AcquisitionConfig(double sampleRate, int bufferSize, boolean acquisitionActive) Creates an instance of aAcquisitionConfigrecord class.- Parameters:
sampleRate- the value for thesampleRaterecord componentbufferSize- the value for thebufferSizerecord componentacquisitionActive- the value for theacquisitionActiverecord component
-
-
Method Details
-
defaultConfig
Creates default acquisition configuration. -
withSampleRate
Creates configuration with specified sample rate. -
withAcquisitionActive
Creates configuration with acquisition state changed. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
sampleRate
public double sampleRate()Returns the value of thesampleRaterecord component.- Returns:
- the value of the
sampleRaterecord component
-
bufferSize
public int bufferSize()Returns the value of thebufferSizerecord component.- Returns:
- the value of the
bufferSizerecord component
-
acquisitionActive
public boolean acquisitionActive()Returns the value of theacquisitionActiverecord component.- Returns:
- the value of the
acquisitionActiverecord component
-