OpenTracker

An Open Architecture for Reconfigurable Tracking based on XML | Contact

ot::MagicYModule Class Reference
[Device Input Classes]

The module and factory to drive the reception of MagicY event updates. More...

#include <MagicYModule.h>

Inheritance diagram for ot::MagicYModule:

Inheritance graph
[legend]
Collaboration diagram for ot::MagicYModule:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MagicYModule ()
virtual ~MagicYModule ()
virtual void init (StringTable &attributes, ConfigNode *localTree)
virtual NodecreateNode (const std::string &name, StringTable &attributes)
virtual void start ()
virtual void close ()
virtual void pushEvent ()

Protected Member Functions

int connect ()
void setSelect ()
int receive ()
int stillConnected ()
void disconnect ()
void run ()
int parseVector (const std::string &line, int *val)
int parseVector (const std::string &line, float *val)
int parseScreens (const std::string &line)
void initMappping (int *mapping)
void initInversion (int *inversion)
void initOrientation (float *orientation)
void calcInversion (int *inversion)
void calcMapping (int *mapping)
void correctData (std::vector< float > &d, int *mapping, int *inversion)

Protected Attributes

MagicYVector magicYs
PointVector points
ScreenVector screens
std::string hostname
ACE_SOCK_Connector connector
ACE_Handle_Set readHandles
int stop
int positionMapping [3]
int invertPosition [3]
float z_value
float orientation [4]

Detailed Description

The module and factory to drive the reception of MagicY event updates.

It builds MagicYSource nodes that insert data from the MagicY into the tracker tree. It uses the MagicY protocol and runs in a thread.

Author:
Christoph Traxler

Definition at line 154 of file MagicYModule.h.


Constructor & Destructor Documentation

ot::MagicYModule::MagicYModule (  ) 

basic constructor

Definition at line 65 of file MagicYModule.cxx.

ot::MagicYModule::~MagicYModule (  )  [virtual]

destructor

Definition at line 71 of file MagicYModule.cxx.

References magicYs, and screens.


Member Function Documentation

void ot::MagicYModule::calcInversion ( int *  inversion  )  [protected]

Definition at line 509 of file MagicYModule.cxx.

Referenced by init().

void ot::MagicYModule::calcMapping ( int *  mapping  )  [protected]

Definition at line 500 of file MagicYModule.cxx.

Referenced by init().

void ot::MagicYModule::close (  )  [virtual]

closes the module and closes any communication sockets and stops thread.

Reimplemented from ot::ThreadModule.

Definition at line 378 of file MagicYModule.cxx.

References ot::ThreadModule::lock(), ot::Module::stop(), and ot::ThreadModule::unlock().

int ot::MagicYModule::connect (  )  [protected]

The work method for this module's thread, i.e.

waiting for and processing data sent from the MagicY server

Definition at line 79 of file MagicYModule.cxx.

References connector, and screens.

Referenced by run().

void ot::MagicYModule::correctData ( std::vector< float > &  d,
int *  mapping,
int *  inversion 
) [protected]

Definition at line 471 of file MagicYModule.cxx.

Referenced by run().

Node * ot::MagicYModule::createNode ( const std::string &  name,
StringTable attributes 
) [virtual]

This method is called to construct a new Node.

It compares name to the MagicYSource element name, and if it matches creates a new MagicYSource node.

Parameters:
name reference to string containing element name refenrence to StringTable containing attribute values
Returns:
pointer to new node or NULL.

Implements ot::NodeFactory.

Definition at line 333 of file MagicYModule.cxx.

References ot::StringTable::get(), and magicYs.

void ot::MagicYModule::disconnect (  )  [protected]

Definition at line 217 of file MagicYModule.cxx.

References screens, and ot::OSUtils::sleep().

Referenced by run().

void ot::MagicYModule::init ( StringTable attributes,
ConfigNode localTree 
) [virtual]

initializes the MagicY module.

Parameters:
attributes refenrence to StringTable containing attribute values
localTree pointer to root of configuration nodes tree

Reimplemented from ot::Module.

Definition at line 516 of file MagicYModule.cxx.

References calcInversion(), calcMapping(), ot::StringTable::get(), hostname, ot::Module::init(), initInversion(), initMappping(), initOrientation(), invertPosition, orientation, parseScreens(), parseVector(), positionMapping, and z_value.

void ot::MagicYModule::initInversion ( int *  inversion  )  [protected]

Definition at line 486 of file MagicYModule.cxx.

Referenced by init().

void ot::MagicYModule::initMappping ( int *  mapping  )  [protected]

Definition at line 480 of file MagicYModule.cxx.

Referenced by init().

void ot::MagicYModule::initOrientation ( float *  orientation  )  [protected]

Definition at line 492 of file MagicYModule.cxx.

Referenced by init().

int ot::MagicYModule::parseScreens ( const std::string &  line  )  [protected]

Definition at line 448 of file MagicYModule.cxx.

References hostname, and screens.

Referenced by init().

int ot::MagicYModule::parseVector ( const std::string &  line,
float *  val 
) [protected]

Definition at line 427 of file MagicYModule.cxx.

int ot::MagicYModule::parseVector ( const std::string &  line,
int *  val 
) [protected]

Definition at line 410 of file MagicYModule.cxx.

Referenced by init().

void ot::MagicYModule::pushEvent (  )  [virtual]

pushes event information into the tree.

It checks whether there is new data for any MagicYSource node, copies it into the nodes and calls push on them.

Reimplemented from ot::Module.

Definition at line 387 of file MagicYModule.cxx.

References ot::ThreadModule::lock(), magicYs, and ot::ThreadModule::unlock().

int ot::MagicYModule::receive (  )  [protected]

Definition at line 119 of file MagicYModule.cxx.

References points, readHandles, screens, and ot::Module::stop().

Referenced by run().

void ot::MagicYModule::run (  )  [protected, virtual]

the work method for the module thread.

This is executed by the new module thread. In this class it does nothing but subclasses should override it to add their implementation.

Reimplemented from ot::ThreadModule.

Definition at line 228 of file MagicYModule.cxx.

References connect(), correctData(), disconnect(), invertPosition, ot::ThreadModule::lock(), magicYs, orientation, points, positionMapping, readHandles, receive(), setSelect(), stillConnected(), ot::Module::stop(), ot::ThreadModule::unlock(), and z_value.

void ot::MagicYModule::setSelect (  )  [protected]

Definition at line 110 of file MagicYModule.cxx.

References readHandles, and screens.

Referenced by run().

void ot::MagicYModule::start (  )  [virtual]

starts the receive thread.

It is called after initialisation is done.

Reimplemented from ot::ThreadModule.

Definition at line 371 of file MagicYModule.cxx.

References ot::Module::isInitialized(), magicYs, and ot::ThreadModule::start().

int ot::MagicYModule::stillConnected (  )  [protected]

Definition at line 197 of file MagicYModule.cxx.

References screens.

Referenced by run().


Member Data Documentation

ACE_SOCK_Connector ot::MagicYModule::connector [protected]

Definition at line 168 of file MagicYModule.h.

Referenced by connect().

std::string ot::MagicYModule::hostname [protected]

IP to listen for MagicY packages.

Definition at line 166 of file MagicYModule.h.

Referenced by init(), and parseScreens().

Definition at line 173 of file MagicYModule.h.

Referenced by init(), and run().

vector containing all MagicYs, which have an associated sourceNode

Definition at line 160 of file MagicYModule.h.

Referenced by createNode(), pushEvent(), run(), start(), and ~MagicYModule().

float ot::MagicYModule::orientation[4] [protected]

Definition at line 175 of file MagicYModule.h.

Referenced by init(), and run().

intermediate MagicY point array for preprocessing

Definition at line 162 of file MagicYModule.h.

Referenced by receive(), and run().

Definition at line 172 of file MagicYModule.h.

Referenced by init(), and run().

ACE_Handle_Set ot::MagicYModule::readHandles [protected]

Definition at line 169 of file MagicYModule.h.

Referenced by receive(), run(), and setSelect().

sockets and offsets for streams from multiple screens

Definition at line 164 of file MagicYModule.h.

Referenced by connect(), disconnect(), parseScreens(), receive(), setSelect(), stillConnected(), and ~MagicYModule().

int ot::MagicYModule::stop [protected]

Definition at line 171 of file MagicYModule.h.

float ot::MagicYModule::z_value [protected]

Definition at line 174 of file MagicYModule.h.

Referenced by init(), and run().


The documentation for this class was generated from the following files:

copyright (c) 2006 Graz University of Technology