equip.city
Class CityProxy.TCPHandlerDub

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--equip.city.CityProxy.TCPHandlerAna
              |
              +--equip.city.CityProxy.TCPHandlerDub
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
CityProxy.TCPHandlerVee
Enclosing class:
CityProxy

protected class CityProxy.TCPHandlerDub
extends CityProxy.TCPHandlerAna

handler for TCP connection to WWW visitor client (dub)

receives position ($P), orientation ($C) and user ($U) messages and sends optional visitor ($V) and refresh ($R) messages and EOM message ($S)

maintains list of visitors by listening for Object3D events with name ending in "wand"

See Also:
City protocol, Dub

Inner Class Summary
protected  class CityProxy.TCPHandlerDub.VisitorCallback
          callback handler for Visitor add and delete events (including wand hack)
 
Field Summary
protected  boolean compass
          this clients orientation preference (compass/magnetic versus map/cartesian)
protected  int degrees
          this client's orientation (due to split $P $C messages) in equip terms
protected  equip.data.GUID handID
          GUID of this client's hand object
protected  equip.data.GUID headID
          GUID of this client's head object
protected  float lastX
          this client's last X (due to split $P $C messages)
protected  float lastY
          this client's last Y (due to split $P $C messages)
protected  float lastZ
          this client's last Z (due to split $P $C messages)
protected  equip.data.GUID positionID
          GUID of position of this client
protected  int roffset
          this client's heading offset (for ultrasonic-model $C and $V)
protected  equip.data.GUID targetID
          GUID of this client's target sensor
protected  equip.data.DataItemListener visitorListener
          listener for visitor events (for $V)
protected  java.util.Vector visitors
          all known visitors
protected  float xoffset
          this client's X offset (for ultrasonic-model $P and $V)
protected  float yoffset
          this client's Y offset (for ultrasonic-model $P and $V)
 
Fields inherited from class equip.city.CityProxy.TCPHandlerAna
config, connectTime, device, dirty, ec, equipDS, expnListener, in, lastLocn, name, out, socket
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
protected  void handleCompass(java.lang.String s)
          handles compass message from client
protected  void handlePosition(java.lang.String s)
          handles position message from client
 void run()
          read and handle $C $U $P messages and reply to $U with $V $R $S
protected  void sendVisitor(java.io.PrintWriter out, equip.data.GUID guid)
          sends visitor message ($Vana,+00.00,-00.00,+00.00,000;)
protected  void sendVisitors(java.io.PrintWriter out)
          sends visitor list to client
protected  void update3D(float x, float y, float z, float heading)
          updates 3D cartesian coordinates and orientation
protected  void updatePos(float x, float y, float z, float heading)
          updates position3D cartesian coordinates and orientation
 
Methods inherited from class equip.city.CityProxy.TCPHandlerAna
elapsedTime, handleDevice, handleEquipDS, handleUser, sendRefresh, sendStop
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

visitors

protected java.util.Vector visitors
all known visitors

positionID

protected equip.data.GUID positionID
GUID of position of this client

handID

protected equip.data.GUID handID
GUID of this client's hand object

headID

protected equip.data.GUID headID
GUID of this client's head object

targetID

protected equip.data.GUID targetID
GUID of this client's target sensor

visitorListener

protected equip.data.DataItemListener visitorListener
listener for visitor events (for $V)

lastX

protected float lastX
this client's last X (due to split $P $C messages)

lastY

protected float lastY
this client's last Y (due to split $P $C messages)

lastZ

protected float lastZ
this client's last Z (due to split $P $C messages)

xoffset

protected float xoffset
this client's X offset (for ultrasonic-model $P and $V)

values:


yoffset

protected float yoffset
this client's Y offset (for ultrasonic-model $P and $V)

values:


roffset

protected int roffset
this client's heading offset (for ultrasonic-model $C and $V)

values:


degrees

protected int degrees
this client's orientation (due to split $P $C messages) in equip terms

compass

protected boolean compass
this clients orientation preference (compass/magnetic versus map/cartesian)
Method Detail

run

public void run()
read and handle $C $U $P messages and reply to $U with $V $R $S
Overrides:
run in class CityProxy.TCPHandlerAna

handlePosition

protected void handlePosition(java.lang.String s)
handles position message from client
Parameters:
s - position x y z accuracy ($C+01.00,-01.00,+01.50,00.50; without marker)

handleCompass

protected void handleCompass(java.lang.String s)
handles compass message from client
Parameters:
s - compass heading in degrees ($C000; without marker)

update3D

protected void update3D(float x,
                        float y,
                        float z,
                        float heading)
updates 3D cartesian coordinates and orientation
Parameters:
x - x coordinate value
y - y coordinate value
z - z coordinate value
heading - orientation (radians)

updatePos

protected void updatePos(float x,
                         float y,
                         float z,
                         float heading)
updates position3D cartesian coordinates and orientation
Parameters:
x - x coordinate value
y - y coordinate value
z - z coordinate value
heading - orientation (radians)

sendVisitor

protected void sendVisitor(java.io.PrintWriter out,
                           equip.data.GUID guid)
sends visitor message ($Vana,+00.00,-00.00,+00.00,000;)
Parameters:
out - stream to write reply to client
guid - ID of visitor

sendVisitors

protected void sendVisitors(java.io.PrintWriter out)
sends visitor list to client
Parameters:
out - stream to write reply to