Class SensorServer

java.lang.Object
  |
  +--SensorServer
All Implemented Interfaces:
NetListener, java.lang.Runnable

public class SensorServer
extends java.lang.Object
implements NetListener, java.lang.Runnable

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

Things to fix, calculate the correct time increment.


Field Summary
private  int currentTime
          A time index into the gesture.
private static int dataSize
           
private static boolean debug
           
private static java.lang.String defaultFilename
           
private  int duration
          The number of seconds of data
private  java.lang.String filename
           
private  int frameSkip
          If the timeIncr rate is greater than the rate that the measurements were made at, then this is the number of frames to skip
private  int measurements
          The number of measurements each sensor made
private  Net net
           
private  boolean netReady
           
private  int nsensors
          The number of sensors providing data
private static int packetSize
           
private static int PORT
           
private  Quat q
           
private  int rate
          The measurement rate of the data in this file
private  int timeIncr
          The length of time between frames that we want to send.
private  java.io.StreamTokenizer tokReader
           
 
Constructor Summary
(package private) SensorServer()
           
(package private) SensorServer(java.lang.String filename)
          Sends untransformed sensor data to the Sensor.wrl vrml file.
 
Method Summary
static void main(java.lang.String[] args)
           
 void NetReadData(java.io.DataInputStream in_stream)
          Just part of interface...doesn't do anything
(package private)  void printOrientation(int bird, float x, float y, float z, float ax)
           
(package private)  void printTimeStamp()
           
 void readHeader()
          Read the header of an animation file.
 boolean ready()
          Says whether connected to the network.
 void run()
          Read each line from the file and send information over the network.
(package private)  void sendOrientation(short id, float[] v)
          Send orientation over the socket in angle/axis representation
(package private)  void sendOrientation(short id, float x, float y, float z, float a)
           
(package private)  void sendTimeStamp()
          The identifier for a timestamp is 10.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

defaultFilename

private static java.lang.String defaultFilename

filename

private java.lang.String filename

net

private Net net

tokReader

private java.io.StreamTokenizer tokReader

netReady

private boolean netReady

PORT

private static int PORT

packetSize

private static int packetSize

dataSize

private static int dataSize

q

private Quat q

debug

private static boolean debug

nsensors

private int nsensors
The number of sensors providing data

rate

private int rate
The measurement rate of the data in this file

measurements

private int measurements
The number of measurements each sensor made

duration

private int duration
The number of seconds of data

currentTime

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

timeIncr

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

frameSkip

private int frameSkip
If the timeIncr rate is greater than the rate that the measurements were made at, then this is the number of frames to skip
Constructor Detail

SensorServer

SensorServer()
       throws java.io.FileNotFoundException

SensorServer

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

main

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

ready

public boolean ready()
Says whether connected to the network.

readHeader

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

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)

printTimeStamp

void printTimeStamp()

sendOrientation

void sendOrientation(short id,
                     float x,
                     float y,
                     float z,
                     float a)

sendTimeStamp

void sendTimeStamp()
The identifier for a timestamp is 10.

sendOrientation

void sendOrientation(short id,
                     float[] v)
Send orientation over the socket in angle/axis representation

NetReadData

public void NetReadData(java.io.DataInputStream in_stream)
Just part of interface...doesn't do anything
Specified by:
NetReadData in interface NetListener