lejos.pc.charting
Interface LoggerListener


public interface LoggerListener

Change listener to notify of events when log data has been recieved, a data stream EOF has occurred, a comment has been received, and header defs have been changed by the NXT-side lejos.util.NXTDataLogger.

Author:
Kirk P. Thompson
See Also:
LoggerProtocolManager.addLoggerListener(lejos.pc.charting.LoggerListener)

Method Summary
 void dataInputStreamEOF()
          Invoked when an EOFException (or other IOException) occurs from the LoggerComms instance.
 void logCommentReceived(int timestamp, java.lang.String comment)
          Invoked when a comment is logged.
 void logFieldNamesChanged(java.lang.String[] logFields)
          Invoked when the log field headers are initially set or changed.
 void logLineAvailable(DataItem[] logDataItems)
          Invoked when a log line [whose fields are defined in NXTDataLogger.setColumns()] is logged and NXTDataLogger.finishLine() is invoked.
 

Method Detail

logLineAvailable

void logLineAvailable(DataItem[] logDataItems)
Invoked when a log line [whose fields are defined in NXTDataLogger.setColumns()] is logged and NXTDataLogger.finishLine() is invoked.

Each logged data field/column is represented by a DataItem instance which provides the datatype and value in a wrapper class.

Parameters:
logDataItems - The array of DataItem instances representing a line of logged data.
See Also:
DataItem, lejos.util.NXTDataLogger

dataInputStreamEOF

void dataInputStreamEOF()
Invoked when an EOFException (or other IOException) occurs from the LoggerComms instance.

See Also:
LoggerComms

logFieldNamesChanged

void logFieldNamesChanged(java.lang.String[] logFields)
Invoked when the log field headers are initially set or changed. This is important because the number of headers determines the column count (which affects cycling).

The string format/structure of each string field passed by NXTDataLogger is:
[name]![y or n to indicate if charted]![axis ID 1-4]
i.e.

"MySeries!y!1"

Parameters:
logFields - The array of header values
See Also:
lejos.util.LogColumn

logCommentReceived

void logCommentReceived(int timestamp,
                        java.lang.String comment)
Invoked when a comment is logged. Comments are sent after the finishLine() method completes. In NXTChartingLogger, comments are displayed on the chart as an event marker on the domain axis with the comment text as a label and the timestamp as the domain (X) value of the marker.

Parameters:
timestamp - The timestamp when the comment was generated on the NXT
comment - The text comment