nl.lxtreme.ols.api.data
Class DataContainer

java.lang.Object
  extended by nl.lxtreme.ols.api.data.DataContainer
All Implemented Interfaces:
AcquisitionResult

Deprecated.

@Deprecated
public final class DataContainer
extends Object
implements AcquisitionResult

Provides a container for captured data in which the data can be annotated with "any" kind of information, such as cursors, protocol decoding information, and so on.

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 Summary
DataContainer(ProjectManager aProjectManager)
          Deprecated. Creates a new DataContainer instance.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataContainer

public DataContainer(ProjectManager aProjectManager)
Deprecated. 
Creates a new DataContainer instance.

Parameters:
aProjectManager - the project manager to use for this container, cannot be null.
Method Detail

addChannelAnnotation

public void addChannelAnnotation(int aChannelIdx,
                                 long aStartTimestamp,
                                 long aEndTimestamp,
                                 Object aData)
Deprecated. 
Adds a channel annotation for the channel with the given index.

Parameters:
aChannelIdx - the index of channel to remove all annotations for, >=0 && < 32.
aStartIdx - the start index;
aEndIdx - the end index;
aData - the data.

calculateTime

public double calculateTime(int aSampleIndex)
Deprecated. 
Calculates the time value corresponding to the given sample index.

Parameters:
aSampleIndex - the sample index to get the time value for, >= 0.
Returns:
the time value, in seconds.

clearChannelAnnotations

public void clearChannelAnnotations(int aChannelIdx)
Deprecated. 
Clears all channel annotations for the channel with the given index.

Parameters:
aChannelIdx - the index of channel to remove all annotations for, >=0 && < 32.

getAbsoluteLength

public long getAbsoluteLength()
Deprecated. 
Description copied from interface: AcquisitionResult
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.

Specified by:
getAbsoluteLength in interface AcquisitionResult
Returns:
the absolute length, >= 0.
See Also:
CapturedData.getAbsoluteLength()

getAllChannels

public Channel[] getAllChannels()
Deprecated. 
Returns all channel labels.

Returns:
an array of all channel's label, never null.

getBlockCount

public int getBlockCount()
Deprecated. 
Returns the number of channel blocks that are available in the data.

Returns:
a block count, >= 0 && < 4 .

getChannelAnnotation

public ChannelAnnotation getChannelAnnotation(int aChannelIdx,
                                              int aTimeIndex)
Deprecated. 
Returns the channel annotations.

Parameters:
aChannelIdx - the index of the channel to retrieve the annotations for, >= 0 && < 32.
aTimeIndex - the time index to get the channel annotation for, >= 0.
Returns:
the channel annotations, can be null.

getChannelAnnotations

public Iterator<ChannelAnnotation> getChannelAnnotations(int aChannelIdx,
                                                         int aStartIdx,
                                                         int aEndIdx)
Deprecated. 
Returns the channel annotations.

Parameters:
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.
Returns:
the channel annotations, can be null.

getChannelLabel

public String getChannelLabel(int aChannelIdx)
Deprecated. 
Returns the channel label.

Parameters:
aChannelIdx - the index of the channel to retrieve the label for, >= 0 && < 32.
Returns:
the channel's label, can be null.

getChannels

public int getChannels()
Deprecated. 
Description copied from interface: AcquisitionResult
Returns the number of channels in the sample data.

Specified by:
getChannels in interface AcquisitionResult
Returns:
the channel count, >= 0.
See Also:
CapturedData.getChannels()

getChannelsForBlock

public int getChannelsForBlock(int aBlockNr)
Deprecated. 
Returns the number of channels available in the block with the given block number.

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.

Parameters:
aBlockNr - the block number, >= 0 && < 4.
Returns:
the number of channels for the given block, >= 0 && < getBlockCount().
Throws:
IllegalArgumentException - in case the given block number was invalid.

getCursorPosition

public Long getCursorPosition(int aCursorIdx)
                       throws IllegalArgumentException
Deprecated. 
Get position of a cursor.

Parameters:
aCursorIdx - the index of the cursor to set, should be >= 0 and < 10.
Returns:
a cursor position, or Long.MIN_VALUE if not set.
Throws:
IllegalArgumentException - in case an invalid cursor index was given.

getCursorTimeValue

public Double getCursorTimeValue(int aCursorIdx)
Deprecated. 
Returns the (absolute) time value for the cursor indicated by the given index.

Parameters:
aCursorIdx - the index of the cursor to return as time, should be >= 0 and < 10.
Returns:
the time value (in seconds), or -1.0 if the cursor is not available.

getEnabledChannels

public int getEnabledChannels()
Deprecated. 
Description copied from interface: AcquisitionResult
Returns a bitmask of enabled channels in the sample data.

Specified by:
getEnabledChannels in interface AcquisitionResult
Returns:
a bitmask of enabled channels, for example, 0xFF for the first 8 channels.
See Also:
CapturedData.getEnabledChannels()

getSampleIndex

public int getSampleIndex(long aAbs)
Deprecated. 
Description copied from interface: AcquisitionResult
Returns the sample index from the given absolute time value.

Specified by:
getSampleIndex in interface AcquisitionResult
Parameters:
aAbs - the (absolute) time value to convert to a sample index.
Returns:
the sample number before the selected absolute time.
See Also:
CapturedData.getSampleIndex(long)

getSampleRate

public int getSampleRate()
Deprecated. 
Description copied from interface: AcquisitionResult
Returns the sample rate in which this data was captured.

Specified by:
getSampleRate in interface AcquisitionResult
Returns:
a sample rate in hertz (Hz).
See Also:
CapturedData.getSampleRate()

getTimestamps

public long[] getTimestamps()
Deprecated. 
Description copied from interface: AcquisitionResult
Returns the time stamps of the individual samples.

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()!

Specified by:
getTimestamps in interface AcquisitionResult
Returns:
the time stamps, as array of long values.
See Also:
CapturedData.getTimestamps()

getTriggerPosition

public long getTriggerPosition()
Deprecated. 
Description copied from interface: AcquisitionResult
Returns the trigger position, as (absolute) time-value.

Specified by:
getTriggerPosition in interface AcquisitionResult
Returns:
a value representing the trigger position in time.
See Also:
CapturedData.getTriggerPosition()

getValues

public int[] getValues()
Deprecated. 
Description copied from interface: AcquisitionResult
Returns the actual sample values.

NOTE: the length of this array must be equal to the length of the array returned by AcquisitionResult.getTimestamps()!

Specified by:
getValues in interface AcquisitionResult
Returns:
the sample values, as array of integers.
See Also:
CapturedData.getValues()

hasCapturedData

public boolean hasCapturedData()
Deprecated. 
Returns whether any captured data is available.

Returns:
true if there is captured data, false otherwise.

hasTimingData

public boolean hasTimingData()
Deprecated. 
Description copied from interface: AcquisitionResult
Returns wether or not the object contains timing data

Specified by:
hasTimingData in interface AcquisitionResult
Returns:
true when timing data is available
See Also:
CapturedData.hasTimingData()

hasTriggerData

public boolean hasTriggerData()
Deprecated. 
Description copied from interface: AcquisitionResult
Returns whether or not the object contains trigger data

Specified by:
hasTriggerData in interface AcquisitionResult
Returns:
true when trigger data is available
See Also:
CapturedData.hasTriggerData()

isChannelLabelSet

public boolean isChannelLabelSet(int aChannelIdx)
Deprecated. 
Returns whether a channel label is set or not.

Parameters:
aChannelIdx - the channel index to check whether its label is set, >= 0 && < 32.
Returns:
true if there a non-empty label set for the given channel index, false otherwise.

isCursorPositionSet

public boolean isCursorPositionSet(int aCursorIdx)
Deprecated. 
Returns whether or not the cursor with the given index is set.

Parameters:
aCursorIdx - the index of the cursor to check, should be >= 0 and < 10.
Returns:
true if the cursor with the given index is set, false otherwise.

setCapturedData

public void setCapturedData(AcquisitionResult aData)
Deprecated. 
Sets the captured data.

Parameters:
aData - the captured data to set, may be null.

setChannelAnnotations

public void setChannelAnnotations(int aChannelIdx,
                                  ChannelAnnotations aAnnotations)
Deprecated. 
Parameters:
aChannelIdx - the index of the channel to set the label for, >= 0 && < 32;
aAnnotations - the annotation for the given channel, cannot be null.

setChannelLabel

public void setChannelLabel(int aChannelIdx,
                            String aLabel)
Deprecated. 
Sets the channel label.

Parameters:
aChannelIdx - the index of the channel to set the label for, >= 0 && < 32;
aLabel - the label to set, may be null.

setChannelLabels

public void setChannelLabels(String[] aLabels)
Deprecated. 
Sets all channel labels directly.

Parameters:
aLabels - the array of labels to set, cannot be null.

setCursorPosition

public void setCursorPosition(int aCursorIdx,
                              Long aCursorPosition)
                       throws IllegalArgumentException
Deprecated. 
Sets a cursor position.

Parameters:
aCursorIdx - the index of the cursor to set, should be >= 0 and < 10;
aCursorPosition - the actual cursor position to set.
Throws:
IllegalArgumentException - in case an invalid cursor index was given.

calculateTimeOffset

protected long calculateTimeOffset(long aTime)
Deprecated. 
Calculates the time offset

Parameters:
aTime - the absolute sample number, >= 0.
Returns:
time relative to data


Copyright © 2012 L'Xtreme IT consultancy. All Rights Reserved.