@Deprecated public final class DataContainer extends Object implements AcquisitionResult
Data files will start with a header containing meta data marked by lines starting with ";". The actual readout values will follow after the header. A value is a logic level transition of one channel. The associated timestamp since sample start (start has timestamp 0) is stored, too after a @ character. This is called compressed format. The handling of the data within the class is the same. A value is 32bits long. The value is encoded in hex and each value is followed by a new line.
Constructor and Description |
---|
DataContainer(ProjectManager aProjectManager)
Deprecated.
Creates a new DataContainer instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addChannelAnnotation(int aChannelIdx,
long aStartTimestamp,
long aEndTimestamp,
Object aData)
Deprecated.
Adds a channel annotation for the channel with the given index.
|
double |
calculateTime(int aSampleIndex)
Deprecated.
Calculates the time value corresponding to the given sample index.
|
protected long |
calculateTimeOffset(long aTime)
Deprecated.
Calculates the time offset
|
void |
clearChannelAnnotations(int aChannelIdx)
Deprecated.
Clears all channel annotations for the channel with the given
index.
|
long |
getAbsoluteLength()
Deprecated.
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.
|
Channel[] |
getAllChannels()
Deprecated.
Returns all channel labels.
|
int |
getBlockCount()
Deprecated.
Returns the number of channel blocks that are available in the data.
|
ChannelAnnotation |
getChannelAnnotation(int aChannelIdx,
int aTimeIndex)
Deprecated.
Returns the channel annotations.
|
Iterator<ChannelAnnotation> |
getChannelAnnotations(int aChannelIdx,
int aStartIdx,
int aEndIdx)
Deprecated.
Returns the channel annotations.
|
String |
getChannelLabel(int aChannelIdx)
Deprecated.
Returns the channel label.
|
int |
getChannels()
Deprecated.
Returns the number of channels in the sample data.
|
int |
getChannelsForBlock(int aBlockNr)
Deprecated.
Returns the number of channels available in the block with the given block
number.
|
Long |
getCursorPosition(int aCursorIdx)
Deprecated.
Get position of a cursor.
|
Double |
getCursorTimeValue(int aCursorIdx)
Deprecated.
Returns the (absolute) time value for the cursor indicated by the given
index.
|
int |
getEnabledChannels()
Deprecated.
Returns a bitmask of enabled channels in the sample data.
|
int |
getSampleIndex(long aAbs)
Deprecated.
Returns the sample index from the given absolute time value.
|
int |
getSampleRate()
Deprecated.
Returns the sample rate in which this data was captured.
|
long[] |
getTimestamps()
Deprecated.
Returns the time stamps of the individual samples.
|
long |
getTriggerPosition()
Deprecated.
Returns the trigger position, as (absolute) time-value.
|
int[] |
getValues()
Deprecated.
Returns the actual sample values.
|
boolean |
hasCapturedData()
Deprecated.
Returns whether any captured data is available.
|
boolean |
hasTimingData()
Deprecated.
Returns wether or not the object contains timing data
|
boolean |
hasTriggerData()
Deprecated.
Returns whether or not the object contains trigger data
|
boolean |
isChannelLabelSet(int aChannelIdx)
Deprecated.
Returns whether a channel label is set or not.
|
boolean |
isCursorPositionSet(int aCursorIdx)
Deprecated.
Returns whether or not the cursor with the given index is set.
|
void |
setCapturedData(AcquisitionResult aData)
Deprecated.
Sets the captured data.
|
void |
setChannelAnnotations(int aChannelIdx,
ChannelAnnotations aAnnotations)
Deprecated.
|
void |
setChannelLabel(int aChannelIdx,
String aLabel)
Deprecated.
Sets the channel label.
|
void |
setChannelLabels(String[] aLabels)
Deprecated.
Sets all channel labels directly.
|
void |
setCursorPosition(int aCursorIdx,
Long aCursorPosition)
Deprecated.
Sets a cursor position.
|
public DataContainer(ProjectManager aProjectManager)
aProjectManager
- the project manager to use for this container, cannot be
null
.public void addChannelAnnotation(int aChannelIdx, long aStartTimestamp, long aEndTimestamp, Object aData)
aChannelIdx
- the index of channel to remove all annotations for, >=0 && < 32.aStartIdx
- the start index;aEndIdx
- the end index;aData
- the data.public double calculateTime(int aSampleIndex)
aSampleIndex
- the sample index to get the time value for, >= 0.public void clearChannelAnnotations(int aChannelIdx)
aChannelIdx
- the index of channel to remove all annotations for, >=0 && < 32.public long getAbsoluteLength()
AcquisitionResult
getAbsoluteLength
in interface AcquisitionResult
CapturedData.getAbsoluteLength()
public Channel[] getAllChannels()
null
.public int getBlockCount()
public ChannelAnnotation getChannelAnnotation(int aChannelIdx, int aTimeIndex)
aChannelIdx
- the index of the channel to retrieve the annotations for, >= 0 &&
< 32.aTimeIndex
- the time index to get the channel annotation for, >= 0.null
.public Iterator<ChannelAnnotation> getChannelAnnotations(int aChannelIdx, int aStartIdx, int aEndIdx)
aChannelIdx
- the index of the channel to retrieve the annotations for, >= 0 &&
< 32.aStartIdx
- the start time/sample index to retrieve the channel annotations
for, >= 0;aEndIdx
- the end time/sample index to retrieve the channel annotations for,
>= 0.null
.public String getChannelLabel(int aChannelIdx)
aChannelIdx
- the index of the channel to retrieve the label for, >= 0 && <
32.null
.public int getChannels()
AcquisitionResult
getChannels
in interface AcquisitionResult
CapturedData.getChannels()
public int getChannelsForBlock(int aBlockNr)
It is assumed that only the last block can contain less than 8 channels. All preceeding blocks (if available) are considered to be "complete" blocks.
aBlockNr
- the block number, >= 0 && <
4.getBlockCount()
.IllegalArgumentException
- in case the given block number was invalid.public Long getCursorPosition(int aCursorIdx) throws IllegalArgumentException
aCursorIdx
- the index of the cursor to set, should be >= 0 and < 10.IllegalArgumentException
- in case an invalid cursor index was given.public Double getCursorTimeValue(int aCursorIdx)
aCursorIdx
- the index of the cursor to return as time, should be >= 0 and <
10.public int getEnabledChannels()
AcquisitionResult
getEnabledChannels
in interface AcquisitionResult
CapturedData.getEnabledChannels()
public int getSampleIndex(long aAbs)
AcquisitionResult
getSampleIndex
in interface AcquisitionResult
aAbs
- the (absolute) time value to convert to a sample index.CapturedData.getSampleIndex(long)
public int getSampleRate()
AcquisitionResult
getSampleRate
in interface AcquisitionResult
CapturedData.getSampleRate()
public 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
CapturedData.getTimestamps()
public long getTriggerPosition()
AcquisitionResult
getTriggerPosition
in interface AcquisitionResult
CapturedData.getTriggerPosition()
public 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
CapturedData.getValues()
public boolean hasCapturedData()
true
if there is captured data, false
otherwise.public boolean hasTimingData()
AcquisitionResult
hasTimingData
in interface AcquisitionResult
true
when timing data is availableCapturedData.hasTimingData()
public boolean hasTriggerData()
AcquisitionResult
hasTriggerData
in interface AcquisitionResult
true
when trigger data is availableCapturedData.hasTriggerData()
public boolean isChannelLabelSet(int aChannelIdx)
aChannelIdx
- the channel index to check whether its label is set, >= 0 && < 32.true
if there a non-empty label set for the given
channel index, false
otherwise.public boolean isCursorPositionSet(int aCursorIdx)
aCursorIdx
- the index of the cursor to check, should be >= 0 and < 10.true
if the cursor with the given index is set,
false
otherwise.public void setCapturedData(AcquisitionResult aData)
aData
- the captured data to set, may be null
.public void setChannelAnnotations(int aChannelIdx, ChannelAnnotations aAnnotations)
aChannelIdx
- the index of the channel to set the label for, >= 0 && < 32;aAnnotations
- the annotation for the given channel, cannot be null
.public void setChannelLabel(int aChannelIdx, String aLabel)
aChannelIdx
- the index of the channel to set the label for, >= 0 && < 32;aLabel
- the label to set, may be null
.public void setChannelLabels(String[] aLabels)
aLabels
- the array of labels to set, cannot be null
.public void setCursorPosition(int aCursorIdx, Long aCursorPosition) throws IllegalArgumentException
aCursorIdx
- the index of the cursor to set, should be >= 0 and < 10;aCursorPosition
- the actual cursor position to set.IllegalArgumentException
- in case an invalid cursor index was given.protected long calculateTimeOffset(long aTime)
aTime
- the absolute sample number, >= 0.Copyright © 2015 L'Xtreme IT consultancy. All rights reserved.