java.lang.Object
java.lang.Record
pl.polsl.rtsa.api.dto.SignalStatistics
- Record Components:
rmsVoltage- Root Mean Square voltage of the signal (V).peakToPeak- Peak-to-peak voltage (V).minVoltage- Minimum voltage in the sample window (V).maxVoltage- Maximum voltage in the sample window (V).dcOffset- DC offset (average voltage) (V).dominantFreq- Detected dominant frequency (Hz).dominantFreqMag- Magnitude of the dominant frequency component.
public record SignalStatistics(double rmsVoltage, double peakToPeak, double minVoltage, double maxVoltage, double dcOffset, double dominantFreq, double dominantFreqMag)
extends Record
Data Transfer Object containing pre-computed signal statistics.
Immutable record for thread-safe access.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classMutable builder for constructingSignalStatisticsinstances. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final doubleThe field for thedcOffsetrecord component.private final doubleThe field for thedominantFreqrecord component.private final doubleThe field for thedominantFreqMagrecord component.private final doubleThe field for themaxVoltagerecord component.private final doubleThe field for theminVoltagerecord component.private final doubleThe field for thepeakToPeakrecord component.private final doubleThe field for thermsVoltagerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSignalStatistics(double rmsVoltage, double peakToPeak, double minVoltage, double maxVoltage, double dcOffset, double dominantFreq, double dominantFreqMag) Creates an instance of aSignalStatisticsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic SignalStatistics.Builderbuilder()Builder for constructing SignalStatistics.doubledcOffset()Returns the value of thedcOffsetrecord component.doubleReturns the value of thedominantFreqrecord component.doubleReturns the value of thedominantFreqMagrecord component.static SignalStatisticsempty()Creates empty/zero statistics.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 themaxVoltagerecord component.doubleReturns the value of theminVoltagerecord component.doubleReturns the value of thepeakToPeakrecord component.doubleReturns the value of thermsVoltagerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
rmsVoltage
private final double rmsVoltageThe field for thermsVoltagerecord component. -
peakToPeak
private final double peakToPeakThe field for thepeakToPeakrecord component. -
minVoltage
private final double minVoltageThe field for theminVoltagerecord component. -
maxVoltage
private final double maxVoltageThe field for themaxVoltagerecord component. -
dcOffset
private final double dcOffsetThe field for thedcOffsetrecord component. -
dominantFreq
private final double dominantFreqThe field for thedominantFreqrecord component. -
dominantFreqMag
private final double dominantFreqMagThe field for thedominantFreqMagrecord component.
-
-
Constructor Details
-
SignalStatistics
public SignalStatistics(double rmsVoltage, double peakToPeak, double minVoltage, double maxVoltage, double dcOffset, double dominantFreq, double dominantFreqMag) Creates an instance of aSignalStatisticsrecord class.- Parameters:
rmsVoltage- the value for thermsVoltagerecord componentpeakToPeak- the value for thepeakToPeakrecord componentminVoltage- the value for theminVoltagerecord componentmaxVoltage- the value for themaxVoltagerecord componentdcOffset- the value for thedcOffsetrecord componentdominantFreq- the value for thedominantFreqrecord componentdominantFreqMag- the value for thedominantFreqMagrecord component
-
-
Method Details
-
empty
Creates empty/zero statistics. -
builder
Builder for constructing SignalStatistics. -
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 '=='. -
rmsVoltage
public double rmsVoltage()Returns the value of thermsVoltagerecord component.- Returns:
- the value of the
rmsVoltagerecord component
-
peakToPeak
public double peakToPeak()Returns the value of thepeakToPeakrecord component.- Returns:
- the value of the
peakToPeakrecord component
-
minVoltage
public double minVoltage()Returns the value of theminVoltagerecord component.- Returns:
- the value of the
minVoltagerecord component
-
maxVoltage
public double maxVoltage()Returns the value of themaxVoltagerecord component.- Returns:
- the value of the
maxVoltagerecord component
-
dcOffset
public double dcOffset()Returns the value of thedcOffsetrecord component.- Returns:
- the value of the
dcOffsetrecord component
-
dominantFreq
public double dominantFreq()Returns the value of thedominantFreqrecord component.- Returns:
- the value of the
dominantFreqrecord component
-
dominantFreqMag
public double dominantFreqMag()Returns the value of thedominantFreqMagrecord component.- Returns:
- the value of the
dominantFreqMagrecord component
-