Record Class AcquisitionConfig

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 Details

    • sampleRate

      private final double sampleRate
      The field for the sampleRate record component.
    • bufferSize

      private final int bufferSize
      The field for the bufferSize record component.
    • acquisitionActive

      private final boolean acquisitionActive
      The field for the acquisitionActive record component.
    • RATE_1KHZ

      public static final double RATE_1KHZ
      Predefined sample rate: 1 kHz
      See Also:
    • RATE_10KHZ

      public static final double RATE_10KHZ
      Predefined sample rate: 10 kHz
      See Also:
    • RATE_20KHZ

      public static final double RATE_20KHZ
      Predefined sample rate: 20 kHz (Turbo Mode)
      See Also:
  • Constructor Details

    • AcquisitionConfig

      public AcquisitionConfig(double sampleRate, int bufferSize, boolean acquisitionActive)
      Creates an instance of a AcquisitionConfig record class.
      Parameters:
      sampleRate - the value for the sampleRate record component
      bufferSize - the value for the bufferSize record component
      acquisitionActive - the value for the acquisitionActive record component
  • Method Details

    • defaultConfig

      public static AcquisitionConfig defaultConfig()
      Creates default acquisition configuration.
    • withSampleRate

      public AcquisitionConfig withSampleRate(double newSampleRate)
      Creates configuration with specified sample rate.
    • withAcquisitionActive

      public AcquisitionConfig withAcquisitionActive(boolean active)
      Creates configuration with acquisition state changed.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • sampleRate

      public double sampleRate()
      Returns the value of the sampleRate record component.
      Returns:
      the value of the sampleRate record component
    • bufferSize

      public int bufferSize()
      Returns the value of the bufferSize record component.
      Returns:
      the value of the bufferSize record component
    • acquisitionActive

      public boolean acquisitionActive()
      Returns the value of the acquisitionActive record component.
      Returns:
      the value of the acquisitionActive record component