org.sump.analyzer
Class CapturedData

java.lang.Object
  extended by org.sump.analyzer.CapturedData

public class CapturedData
extends java.lang.Object

CapturedData encapsulates the data obtained by the analyzer during a single run. It also provides a method for saving the data to a file.

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 single logic level measurement of all channels at a particular time. This means a value is 32bits long. The value is encoded in hex and each value is followed by a new line.

In the java code each value is represented by an integer.

Version:
0.7
Author:
Michael "Mr. Sump" Poppitz

Field Summary
 int channels
          number of channels (1-32)
 int enabledChannels
          bit map of enabled channels
static int NOT_AVAILABLE
          indicates that rate or trigger position are not available
 int rate
          sampling rate in Hz
 int triggerPosition
          position of trigger as index of values
 int[] values
          captured values
 
Constructor Summary
CapturedData(java.io.File file)
          Constructs CapturedData based on the data read from the given file.
CapturedData(int[] values, int triggerPosition, int rate, int channels, int enabledChannels)
          Constructs CapturedData based on the given data.
 
Method Summary
 boolean hasTimingData()
          Returns wether or not the object contains timing data
 boolean hasTriggerData()
          Returns wether or not the object contains trigger data
 void writeToFile(java.io.File file)
          Writes device data to given file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOT_AVAILABLE

public static final int NOT_AVAILABLE
indicates that rate or trigger position are not available

See Also:
Constant Field Values

values

public final int[] values
captured values


triggerPosition

public final int triggerPosition
position of trigger as index of values


rate

public final int rate
sampling rate in Hz


channels

public final int channels
number of channels (1-32)


enabledChannels

public final int enabledChannels
bit map of enabled channels

Constructor Detail

CapturedData

public CapturedData(int[] values,
                    int triggerPosition,
                    int rate,
                    int channels,
                    int enabledChannels)
Constructs CapturedData based on the given data.

Parameters:
values - 32bit values as read from device
triggerPosition - position of trigger as index of values array
rate - sampling rate (may be set to NOT_AVAILABLE)
channels - number of used channels
enabledChannels - bit mask identifying used channels

CapturedData

public CapturedData(java.io.File file)
             throws java.io.IOException
Constructs CapturedData based on the data read from the given file.

Parameters:
file - file to read captured data from
Throws:
java.io.IOException - when reading from file failes
Method Detail

writeToFile

public void writeToFile(java.io.File file)
                 throws java.io.IOException
Writes device data to given file.

Parameters:
file - file to write to
Throws:
java.io.IOException - when writing to file failes

hasTimingData

public boolean hasTimingData()
Returns wether or not the object contains timing data

Returns:
true when timing data is available

hasTriggerData

public boolean hasTriggerData()
Returns wether or not the object contains trigger data

Returns:
true when trigger data is available