OpenTracker

An Open Architecture for Reconfigurable Tracking based on XML | Contact

ot::UltraTrakModule Class Reference

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

#include <UltraTrakModule.h>

Inheritance diagram for ot::UltraTrakModule:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 UltraTrakModule ()
virtual ~UltraTrakModule ()
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

void run ()
int parseVector (const std::string &line, int *val)
void initMappping (int *mapping)
void initInversion (int *inversion)
void calcInversion (int *inversion)
void correctData (std::vector< float > &d, int *mapping, int *inversion)

Static Protected Member Functions

static void convertFloatsNToHl (float *floats, float *result, int num)

Protected Attributes

StationVector stations
UltraTrakFrameData buffer
int port
int stop
int positionMapping [3]
int invertPosition [3]
int orientationMapping [3]
int invertOrientation [3]

Detailed Description

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

It builds UltraTrakSource nodes that insert data from the UltraTrak into the tracker tree. It uses the UltraTrak Protocol and runs in a thread.

Author:
Rainer Splechtna

Definition at line 136 of file UltraTrakModule.h.


Constructor & Destructor Documentation

ot::UltraTrakModule::UltraTrakModule (  ) 

basic constructor

Definition at line 67 of file UltraTrakModule.cxx.

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

destructor

Definition at line 73 of file UltraTrakModule.cxx.

References stations.


Member Function Documentation

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

Definition at line 308 of file UltraTrakModule.cxx.

Referenced by init().

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

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

Reimplemented from ot::ThreadModule.

Definition at line 232 of file UltraTrakModule.cxx.

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

void ot::UltraTrakModule::convertFloatsNToHl ( float *  floats,
float *  result,
int  num 
) [static, protected]

Converts num floats from Network byte order.

Parameters:
floats pointer to source data
result pointer to result array
num number of floats to convert

Definition at line 79 of file UltraTrakModule.cxx.

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

Definition at line 287 of file UltraTrakModule.cxx.

Referenced by run().

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

This method is called to construct a new Node.

It compares name to the UltraTrakSource element name, and if it matches creates a new UltraTrakSource 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 187 of file UltraTrakModule.cxx.

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

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

initializes the UltraTrak module.

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

Reimplemented from ot::Module.

Definition at line 315 of file UltraTrakModule.cxx.

References calcInversion(), ot::StringTable::get(), ot::Module::init(), initInversion(), initMappping(), invertOrientation, invertPosition, orientationMapping, parseVector(), port, and positionMapping.

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

Definition at line 302 of file UltraTrakModule.cxx.

Referenced by init().

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

Definition at line 296 of file UltraTrakModule.cxx.

Referenced by init().

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

Definition at line 267 of file UltraTrakModule.cxx.

Referenced by init().

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

pushes event information into the tree.

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

Reimplemented from ot::Module.

Definition at line 241 of file UltraTrakModule.cxx.

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

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

starts the receive thread.

It is called after initialisation is done.

Reimplemented from ot::ThreadModule.

Definition at line 225 of file UltraTrakModule.cxx.

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


Member Data Documentation

buffer for incoming package

Definition at line 144 of file UltraTrakModule.h.

Referenced by run().

Definition at line 152 of file UltraTrakModule.h.

Referenced by init(), and run().

Definition at line 150 of file UltraTrakModule.h.

Referenced by init(), and run().

Definition at line 151 of file UltraTrakModule.h.

Referenced by init(), and run().

int ot::UltraTrakModule::port [protected]

port to listen for ultratrak packages

Definition at line 146 of file UltraTrakModule.h.

Referenced by init(), and run().

Definition at line 149 of file UltraTrakModule.h.

Referenced by init(), and run().

vector containing all stations, which have an associated sourceNode

Definition at line 142 of file UltraTrakModule.h.

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

int ot::UltraTrakModule::stop [protected]

Definition at line 147 of file UltraTrakModule.h.


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

copyright (c) 2006 Graz University of Technology