javaclient
Class LogInterface

java.lang.Object
  extended by javaclient.PlayerDevice
      extended by javaclient.LogInterface

public class LogInterface
extends PlayerDevice

The log interface provides start/stop control of data logging/playback.

The log interface produces no data and accepts no commands.

Version:
Author:
Radu Bogdan Rusu

Field Summary
protected static short PLAYER_LOG_GET_STATE_REQ
           
protected static short PLAYER_LOG_SET_FILENAME
           
protected static short PLAYER_LOG_SET_READ_REWIND_REQ
           
protected static short PLAYER_LOG_SET_READ_STATE_REQ
           
protected static short PLAYER_LOG_SET_WRITE_STATE_REQ
           
protected static short PLAYER_LOG_TYPE_READ
           
protected static short PLAYER_LOG_TYPE_WRITE
           
 
Fields inherited from class javaclient.PlayerDevice
device, DIFFERENCE_SYNCH_FACTOR, index, is, os, pc, PLAYER_MAX_REQREP_SIZE, PLAYER_STXX, reserved, size, t_sec, t_usec, ts_sec, ts_usec
 
Constructor Summary
LogInterface(PlayerClient pc, short indexOfDevice)
          Constructor for LogInterface.
 
Method Summary
 byte getState()
          Get the logging/playback state.
 byte getType()
          Get the type of log device.
 void handleResponse(int size)
          Handle acknowledgement response messages (threaded mode).
 boolean isStateReady()
          Check if state data is available.
 void readState()
          Configuration request: Get state.
 void rewindPlayback()
          Configuration request: Rewind playback.
 void setFileName(java.lang.String fileName)
          Configuration request: Set filename.
 void setLoggingState(int state)
          Configuration request: Set logging state.
 void setPlaybackState(int state)
          Configuration request: Set playback state.
 
Methods inherited from class javaclient.PlayerDevice
getTimeForDataSampled_sec, getTimeForDataSampled_usec, getTimeForDataSampled, getTimeForDataSent_sec, getTimeForDataSent_usec, getTimeForDataSent, handleEARMessage, handleNARMessage, readData, readHeader, sendHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLAYER_LOG_SET_WRITE_STATE_REQ

protected static final short PLAYER_LOG_SET_WRITE_STATE_REQ
See Also:
Constant Field Values

PLAYER_LOG_SET_READ_STATE_REQ

protected static final short PLAYER_LOG_SET_READ_STATE_REQ
See Also:
Constant Field Values

PLAYER_LOG_GET_STATE_REQ

protected static final short PLAYER_LOG_GET_STATE_REQ
See Also:
Constant Field Values

PLAYER_LOG_SET_READ_REWIND_REQ

protected static final short PLAYER_LOG_SET_READ_REWIND_REQ
See Also:
Constant Field Values

PLAYER_LOG_SET_FILENAME

protected static final short PLAYER_LOG_SET_FILENAME
See Also:
Constant Field Values

PLAYER_LOG_TYPE_READ

protected static final short PLAYER_LOG_TYPE_READ
See Also:
Constant Field Values

PLAYER_LOG_TYPE_WRITE

protected static final short PLAYER_LOG_TYPE_WRITE
See Also:
Constant Field Values
Constructor Detail

LogInterface

public LogInterface(PlayerClient pc,
                    short indexOfDevice)
Constructor for LogInterface.

Parameters:
pc - a reference to the PlayerClient object
indexOfDevice - the index of the device
Method Detail

setLoggingState

public void setLoggingState(int state)
Configuration request: Set logging state.

Start/stop data logging.

See the player_log_set_write_state structure from player.h

Parameters:
state - 0=disabled, 1=enabled

setPlaybackState

public void setPlaybackState(int state)
Configuration request: Set playback state.

Start/stop data playback.

See the player_log_set_read_state structure from player.h

Parameters:
state - 0=disabled, 1=enabled

rewindPlayback

public void rewindPlayback()
Configuration request: Rewind playback.

Rewind log playback to beginning of logfile; does not affect playback state (i.e., whether it is started or stopped).

See the player_log_set_read_rewind structure from player.h


readState

public void readState()
Configuration request: Get state.

Find out whether logging/playback is enabled or disabled.

See the player_log_get_state structure from player.h


setFileName

public void setFileName(java.lang.String fileName)
Configuration request: Set filename.

Set the name of the file to write to when logging.

See the player_log_set_filename structure from player.h

Parameters:
fileName - the name of the file (max 255 chars + terminating NULL)

handleResponse

public void handleResponse(int size)
Handle acknowledgement response messages (threaded mode).

Overrides:
handleResponse in class PlayerDevice
Parameters:
size - size of the payload

getType

public byte getType()
Get the type of log device.

Returns:
the type of log device, either PLAYER_LOG_TYPE_READ or PLAYER_LOG_TYPE_WRITE

getState

public byte getState()
Get the logging/playback state.

Returns:
the logging/playback state, 0=disabled, 1=enabled

isStateReady

public boolean isStateReady()
Check if state data is available.

Returns:
true if ready, false if not ready