Structure
FlowParameters
public struct FlowParameters: Codable, Equatable
Configuration parameters for the FlowManager object
Relationships
Conforms To
Codable
Equatable
Initializers
init(expectedTimeInterval:acceptedDelay:ignoreFirstSamples:device:enableLogging:immediateAlarm:normalRange:lightSleepRange:deepSleepRange:anomalyMaxLenghtSeconds:bpmSpeedAlarm:hrvBufferSize:averageSpeedBufferSize:)
public init(expectedTimeInterval: TimeInterval = 0.0, acceptedDelay: TimeInterval = 0.0, ignoreFirstSamples: Int = 0, device: Device = .appleWatch, enableLogging: Bool = false, immediateAlarm: ParamsRange = ParamsRange(), normalRange: ParamsRange = ParamsRange(), lightSleepRange: ParamsRange = ParamsRange(), deepSleepRange: ParamsRange = ParamsRange(), anomalyMaxLenghtSeconds: Int = 0, bpmSpeedAlarm: Double = 0.0, hrvBufferSize: Int = 50, averageSpeedBufferSize: Int = 5)
Initialize the FlowParameters
Properties
expectedTimeInterval
var expectedTimeInterval: TimeInterval
Expected frequency of the sample stream expressed in terms of seconds between each samples.
acceptedDelay
var acceptedDelay: TimeInterval
Maximum delay accepted between two samples in a stream expressed in seconds. If the new sample has a time difference from the previous sample greater then this value a noData event is fired.
ignoreFirstSamples
var ignoreFirstSamples: Int
Number of initial samples to be ignored at the beginning of a stream.
enableLogging
var enableLogging: Bool
Enable logging on console output the processing of each sample in the stream.
immediateAlarm
var immediateAlarm: ParamsRange
The min max range values for immediate alarm condition. The FlowManager immediatly fire an alarm event if the input sample BPM value is lower then the min or greater then the max. If a flow of contiguous sample data generating alarm condition is interrupted with other events such as a normal BMP value or missing values then the alarm condition is reset and the FlowManager fire a backToNormal event.
normalRange
var normalRange: ParamsRange
The min max range values for warning condition. The FlowManager immediatly fire a warning event if the input sample BPM value is lower then the min or greater then the max and at the same time the BPM value is not outside the immediateAlarm range parameter. It the stream of sample data continue to feed samples with a BML value generating a warning event for a period of time greater then the anomalyMaxLenghtSeconds parameter then the FlowManager will fire a alarm event. If a flow of contiguous sample data generating warning condition is interrupted with other events such as a normal BMP value or missing values then the warning condition is reset.
lightSleepRange
var lightSleepRange: ParamsRange
The min max range values for a light sleep condition withing the normalRange of values.
deepSleepRange
var deepSleepRange: ParamsRange
The min max range values for a deep sleep condition withing the normalRange of values.
anomalyMaxLenghtSeconds
var anomalyMaxLenghtSeconds: Int
The number of seconds after a continuous and persistant warning condition fire an alarm event.
bpmSpeedAlarm
var bpmSpeedAlarm: Double
The anomaly accelleration detection value. If the input sample BPM value is greater then this value then a alarm notification is fired. 0.0 to disable this check.
hrvBufferSize
var hrvBufferSize: Int
Size of the circular buffer used for calcolating the HRV value.
Expressed as number of historic sample to consider for calculating the average.
averageSpeedBufferSize
var averageSpeedBufferSize: Int
Size of the circular buffer used for calcolating the average speed value.
Expressed as number of historic sample to consider for calculating the average.
Methods
==(lhs:rhs:)
public static func ==(lhs: FlowParameters, rhs: FlowParameters) -> Bool
Implement Equatable protocol to confront two FlowParameters object