Class PlaybackServer

java.lang.Object
  |
  +--PlaybackServer
All Implemented Interfaces:
java.lang.Runnable

public class PlaybackServer
extends java.lang.Object
implements java.lang.Runnable

Does one thing which is to read a file and send it to the client.

Things to fix: o make the file to read from modifiable.


Field Summary
private  int animationFrameLength
          The length of time between frames that we want to send.
private  boolean debug
           
private  int defaultAnimationFrameLength
          The default length of time between frames in ms
private static java.lang.String defaultFilename
          The file the animation is read from.
private  int duration
          The number of seconds of data
private  java.lang.String filename
           
private  int gestureFrameLength
          The length of time between frames given in the file
private  int gestureTime
          A time index into the gesture.
private  int measurements
          The number of measurements each sensor made
private  AnimProtocol net
           
private  int njoints
          The number of sensors providing data
private  Quat q
           
private  int rate
          The measurement rate the birds report
private  java.io.StreamTokenizer tokReader
           
private  int triggerTime
          Keeps track of the next time that we want to sent a frame out
 
Constructor Summary
(package private) PlaybackServer()
           
(package private) PlaybackServer(java.lang.String filename)
          Sends untransformed sensor data to the vrml file.
 
Method Summary
 void finalize()
           
static void main(java.lang.String[] args)
           
(package private)  void printOrientation(int bird, float x, float y, float z, float ax)
           
(package private)  void printOrientation(java.lang.String joint, float x, float y, float z, float ax)
           
(package private)  void printTimeStamp()
           
 void readHeader()
          Read the header of an animation file.
 void run()
          Read each line from the file and send information over the network.
 void setFrameRate(int fr)
          Sets the framerate of the animation.
 
Methods inherited from class java.lang.Object
, clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

defaultFilename

private static java.lang.String defaultFilename
The file the animation is read from.

filename

private java.lang.String filename

net

private AnimProtocol net

tokReader

private java.io.StreamTokenizer tokReader

q

private Quat q

njoints

private int njoints
The number of sensors providing data

rate

private int rate
The measurement rate the birds report

gestureFrameLength

private int gestureFrameLength
The length of time between frames given in the file

measurements

private int measurements
The number of measurements each sensor made

duration

private int duration
The number of seconds of data

gestureTime

private int gestureTime
A time index into the gesture. Used to generate timestamps

animationFrameLength

private int animationFrameLength
The length of time between frames that we want to send. This doesn't necessarily correspond to the measurement rate in the gesture file

defaultAnimationFrameLength

private final int defaultAnimationFrameLength
The default length of time between frames in ms

triggerTime

private int triggerTime
Keeps track of the next time that we want to sent a frame out

debug

private boolean debug
Constructor Detail

PlaybackServer

PlaybackServer()
         throws java.io.FileNotFoundException

PlaybackServer

PlaybackServer(java.lang.String filename)
         throws java.io.FileNotFoundException
Sends untransformed sensor data to the vrml file. Should reflect the actual orientations of the sensors.
Parameters:
The - name of the file to read from.
Method Detail

setFrameRate

public void setFrameRate(int fr)
Sets the framerate of the animation.
Parameters:
fr - The new framerate in Hz.

readHeader

public void readHeader()
                throws java.io.IOException
Read the header of an animation file.

finalize

public void finalize()
Overrides:
finalize in class java.lang.Object

run

public void run()
Read each line from the file and send information over the network.
Specified by:
run in interface java.lang.Runnable

printOrientation

void printOrientation(int bird,
                      float x,
                      float y,
                      float z,
                      float ax)

printOrientation

void printOrientation(java.lang.String joint,
                      float x,
                      float y,
                      float z,
                      float ax)

printTimeStamp

void printTimeStamp()

main

public static void main(java.lang.String[] args)