public class CapturedData extends Object implements AcquisitionResult
In the java code each transition is represented by an integer together with a timestamp represented by a long value.
Constructor and Description |
---|
CapturedData(int[] aValues,
long[] aTimestamps,
long aTriggerPosition,
int aRate,
int aChannels,
int aEnabledChannels,
long aAbsLen)
Constructs CapturedData based on the given compressed sampling data.
|
CapturedData(int[] values,
long triggerPosition,
int rate,
int channels,
int enabledChannels)
Constructs CapturedData based on the given absolute sampling data.
|
CapturedData(List<Integer> aValues,
List<Long> aTimestamps,
long aTriggerPosition,
int aRate,
int aChannels,
int aEnabledChannels,
long aAbsoluteLength)
Constructs CapturedData based on the given compressed sampling data.
|
Modifier and Type | Method and Description |
---|---|
long |
getAbsoluteLength()
Returns the absolute length of the captured data, or, in other words, the
largest available timestamp plus some padding to make the last sample
visible.
|
int |
getChannels()
Returns the number of channels in the sample data.
|
int |
getEnabledChannels()
Returns a bitmask of enabled channels in the sample data.
|
int |
getSampleIndex(long abs)
Returns the sample index from the given absolute time value.
|
int |
getSampleRate()
Returns the sample rate in which this data was captured.
|
long[] |
getTimestamps()
Returns the time stamps of the individual samples.
|
long |
getTriggerPosition()
Returns the trigger position, as (absolute) time-value.
|
int[] |
getValues()
Returns the actual sample values.
|
boolean |
hasTimingData()
Returns wether or not the object contains timing data
|
boolean |
hasTriggerData()
Returns whether or not the object contains trigger data
|
public CapturedData(int[] values, long triggerPosition, int rate, int channels, int enabledChannels)
values
- 32bit values as read from devicetriggerPosition
- position of trigger as time valuerate
- sampling rate (may be set to NOT_AVAILABLE
)channels
- number of used channelsenabledChannels
- bit mask identifying used channelspublic CapturedData(int[] aValues, long[] aTimestamps, long aTriggerPosition, int aRate, int aChannels, int aEnabledChannels, long aAbsLen)
aValues
- 32bit values as read from deviceaTimestamps
- timstamps in number of samples since sample startaTriggerPosition
- position of trigger as time valueaRate
- sampling rate (may be set to NOT_AVAILABLE
)aChannels
- number of used channelsaEnabledChannels
- bit mask identifying used channelsaAbsLen
- absolute number of samplespublic CapturedData(List<Integer> aValues, List<Long> aTimestamps, long aTriggerPosition, int aRate, int aChannels, int aEnabledChannels, long aAbsoluteLength)
aValues
- 32bit values as read from deviceaTimestamps
- timstamps in number of samples since sample startaTriggerPosition
- position of trigger as time valueaRate
- sampling rate (may be set to NOT_AVAILABLE
)aChannels
- number of used channelsaEnabledChannels
- bit mask identifying used channelsaAbsoluteLength
- absolute number of samplespublic final long getAbsoluteLength()
AcquisitionResult
getAbsoluteLength
in interface AcquisitionResult
getAbsoluteLength()
public final int getChannels()
AcquisitionResult
getChannels
in interface AcquisitionResult
getChannels()
public final int getEnabledChannels()
AcquisitionResult
getEnabledChannels
in interface AcquisitionResult
getEnabledChannels()
public final int getSampleIndex(long abs)
AcquisitionResult
getSampleIndex
in interface AcquisitionResult
abs
- the (absolute) time value to convert to a sample index.getSampleIndex(long)
public final int getSampleRate()
AcquisitionResult
getSampleRate
in interface AcquisitionResult
getSampleRate()
public final long[] getTimestamps()
AcquisitionResult
The time values returned should represent an ever increasing time line. So, timestamp[n-1] < timestamp[n] < timestamp[n+1] for all elements of the returned array.
NOTE: the length of this array must be equal to the length of the
array returned by AcquisitionResult.getValues()
!
getTimestamps
in interface AcquisitionResult
getTimestamps()
public final long getTriggerPosition()
AcquisitionResult
getTriggerPosition
in interface AcquisitionResult
getTriggerPosition()
public final int[] getValues()
AcquisitionResult
NOTE: the length of this array must be equal to the length of the
array returned by AcquisitionResult.getTimestamps()
!
getValues
in interface AcquisitionResult
getValues()
public final boolean hasTimingData()
AcquisitionResult
hasTimingData
in interface AcquisitionResult
true
when timing data is availablehasTimingData()
public final boolean hasTriggerData()
AcquisitionResult
hasTriggerData
in interface AcquisitionResult
true
when trigger data is availablehasTriggerData()
Copyright © 2015 L'Xtreme IT consultancy. All rights reserved.