Class RecorderTriggerData
- All Implemented Interfaces:
Serializable
,Cloneable
,ManagedParameters
- Direct Known Subclasses:
ClickRecorderTriggerData
,WMRecorderTriggerData
If a recording is already running when a RecorderTrigger is sent, then the recording will continue, ending at the later of the existing stop time (if recoring on a timer or on a different trigger) or the time indicated in RecorderTriggerData. If a continuous recording is being made, then that recording will simply continue.
If no recording is being made, then the recorder will take data from the buffer for secondsBeforeTrigger seconds to add to the start of the recording. Note that recordings NEVER overlap, so if secondsBeforeTrigger were set to say, 30s, and the previous recoridng had only ended 10 seconds earlier, then only 10s of data will be taken from the buffer.
Each recorder will ensure that adequate raw audio data is stored in the source data block to satisfy secondsBeforeTrigger in every trigger. Therefore, if secondsBeforeTrigger is set to a large value, excessive amounts of memory may be required to store the data, particularly at high frequencies.
Information from RecorderTriggerData is read when the recording is made, so it is possible to update the fields secondsBeforeTrigger and secondsAfterTrigger after the RecorderTrigger has been registered with the recorders, although time may be required for the buffer to fill if secondsBeforeTrigger is increased.
- Author:
- Doug Gillespie
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
time period for minDetectionCountprotected int
Daily budget in megabytes.protected boolean
Trigger state.protected long
protected long
protected int
max total length in seconds of a recording when multiple trigs run together.protected int
min number of detections in time period countSecondsprotected int
minimum gap between triggersprotected double
Number of seconds of data to record after the trigger event.protected double
Number of seconds of data to add to the start of the recording prior to the trigger event.static final long
protected String
Name used to identify the triggerprotected long
Used day budget is recorded in bytes to deal with low frequency data. -
Constructor Summary
ConstructorsConstructorDescriptionRecorderTriggerData
(String triggerName, double secondsBeforeTrigger, double secondsAfterTrigger) -
Method Summary
Modifier and TypeMethodDescriptionclone()
int
int
int
int
int
Get the auto-generated parameter set, and then add in the fields that are not included because they are not public and do not have getters.double
double
boolean
void
setCountSeconds
(int countSeconds) void
setDayBudgetMB
(int dayBudgetMB) void
setEnabled
(boolean enabled) void
setMaxTotalTriggerLength
(int maxTotalTriggerLength) void
setMinDetectionCount
(int minDetectionCount) void
setMinGapBetweenTriggers
(int minGapBetweenTriggers) void
setSecondsAfterTrigger
(double secondsAfterTrigger) void
setSecondsBeforeTrigger
(double secondsBeforeTrigger)
-
Field Details
-
serialVersionUID
public static final long serialVersionUID- See Also:
-
triggerName
Name used to identify the trigger -
enabled
protected boolean enabledTrigger state. -
secondsBeforeTrigger
protected double secondsBeforeTriggerNumber of seconds of data to add to the start of the recording prior to the trigger event. -
secondsAfterTrigger
protected double secondsAfterTriggerNumber of seconds of data to record after the trigger event. -
minDetectionCount
protected int minDetectionCountmin number of detections in time period countSeconds -
countSeconds
protected int countSecondstime period for minDetectionCount -
minGapBetweenTriggers
protected int minGapBetweenTriggersminimum gap between triggers -
maxTotalTriggerLength
protected int maxTotalTriggerLengthmax total length in seconds of a recording when multiple trigs run together. -
dayBudgetMB
protected int dayBudgetMBDaily budget in megabytes. -
lastTriggerStart
protected long lastTriggerStart -
lastTriggerEnd
protected long lastTriggerEnd -
usedDayBudget
protected long usedDayBudgetUsed day budget is recorded in bytes to deal with low frequency data.
-
-
Constructor Details
-
RecorderTriggerData
public RecorderTriggerData(String triggerName, double secondsBeforeTrigger, double secondsAfterTrigger)
-
-
Method Details
-
getDecisionMaker
-
clone
-
getSecondsBeforeTrigger
public double getSecondsBeforeTrigger()- Returns:
- the secondsBeforeTrigger
-
setSecondsBeforeTrigger
public void setSecondsBeforeTrigger(double secondsBeforeTrigger) - Parameters:
secondsBeforeTrigger
- the secondsBeforeTrigger to set
-
getSecondsAfterTrigger
public double getSecondsAfterTrigger()- Returns:
- the secondsAfterTrigger
-
setSecondsAfterTrigger
public void setSecondsAfterTrigger(double secondsAfterTrigger) - Parameters:
secondsAfterTrigger
- the secondsAfterTrigger to set
-
getMinDetectionCount
public int getMinDetectionCount()- Returns:
- the minDetectionCount
-
setMinDetectionCount
public void setMinDetectionCount(int minDetectionCount) - Parameters:
minDetectionCount
- the minDetectionCount to set
-
getCountSeconds
public int getCountSeconds()- Returns:
- the countSeconds
-
setCountSeconds
public void setCountSeconds(int countSeconds) - Parameters:
countSeconds
- the countSeconds to set
-
getMinGapBetweenTriggers
public int getMinGapBetweenTriggers()- Returns:
- the minGapBetweenTriggers
-
setMinGapBetweenTriggers
public void setMinGapBetweenTriggers(int minGapBetweenTriggers) - Parameters:
minGapBetweenTriggers
- the minGapBetweenTriggers to set
-
getMaxTotalTriggerLength
public int getMaxTotalTriggerLength()- Returns:
- the maxTotalTriggerLength
-
setMaxTotalTriggerLength
public void setMaxTotalTriggerLength(int maxTotalTriggerLength) - Parameters:
maxTotalTriggerLength
- the maxTotalTriggerLength to set
-
getTriggerName
- Returns:
- the triggerName
-
setEnabled
public void setEnabled(boolean enabled) - Parameters:
enabled
- the enabled to set
-
isEnabled
public boolean isEnabled()- Returns:
- the enabled
-
setDayBudgetMB
public void setDayBudgetMB(int dayBudgetMB) - Parameters:
dayBudgetMB
- the dayBudgetMB to set
-
getDayBudgetMB
public int getDayBudgetMB()- Returns:
- the dayBudgetMB
-
getSummaryString
-
getParameterSet
Get the auto-generated parameter set, and then add in the fields that are not included because they are not public and do not have getters. Note: for each field, we search the current class and (if that fails) the superclass. It's done this way because RecorderTriggerData might be used directly (and thus the field would be found in the class) and it also might be used as a superclass to something else (e.g. WMRecorderTriggerData) in which case the field would only be found in the superclass.- Specified by:
getParameterSet
in interfaceManagedParameters
- Returns:
- description of the parameters in a class.
-