OpenTracker

An Open Architecture for Reconfigurable Tracking based on XML | Contact

ot::GPSModule Class Reference
[Device Input Classes]

This module supports a GPS receiver with optional DGPS correction data from an DGPSIP server. More...

#include <GPSModule.h>

Inheritance diagram for ot::GPSModule:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GPSModule ()
virtual ~GPSModule ()
virtual void init (StringTable &attributes, ConfigNode *localTree)
virtual NodecreateNode (const std::string &name, StringTable &attributes)
virtual void pushEvent ()
virtual void start ()
virtual void close ()
virtual void newData (const GPResult *point, const char *line, void *userData)

Protected Member Functions

virtual void run ()
template<class T>
void updateSource (T *source)

Protected Attributes

bool debug
std::string device
int baudRate
std::string dgpsServer
int dgpsPort
int dgpsmirror
std::string rtcmdev
GPSSourcesource
GPSDirectionSourcedirSource
GPSGarminCompasscompassSource
GPSGarminAltitudealtitudeSource
GPSInfoSourceinfoSource
GPSDriverdriver
ACE_FILE_IO * logFile

Friends

class GPSSource
class GPSDirectionSource
class GPSGarminCompass
class GPSGarminAltitude
class GPSInfoSource

Detailed Description

This module supports a GPS receiver with optional DGPS correction data from an DGPSIP server.

It drives all the different GPS source nodes associated with it, but only one instance per type. Currently it only supports one device.

It uses the GPSDriver class to operate the GPS device and any DGPSIP servers. Any required transformations are implemented in the individual GPS source nodes.

See also:
GPSSource, GPSDirectionSource, GPSGarminCompass, GPSGarminAltitude for more information on the individual source nodes.
Author:
Gerhard Reitmayr

Definition at line 116 of file GPSModule.h.


Constructor & Destructor Documentation

ot::GPSModule::GPSModule (  ) 

Definition at line 74 of file GPSModule.cxx.

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

Definition at line 85 of file GPSModule.cxx.

References altitudeSource, compassSource, dirSource, infoSource, logFile, and source.


Member Function Documentation

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

closes the module.

In this implementation it stops the thread. Be sure to call this method from your subclasses close method to stop the thread !

Reimplemented from ot::ThreadModule.

Definition at line 246 of file GPSModule.cxx.

References ot::ThreadModule::close(), driver, ot::GPSDriver::getReactor(), and logFile.

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

This method tries to create a new Node based on a given element type and the attributes of the element.

If it can not create a new Node ( because it doesn't know about the element type for example ), it returns NULL. This method has to be implemented by real NodeFactories.

Parameters:
name reference to string containing element name
attributes refenrence to StringTable containing attribute values
Returns:
pointer to new Node or NULL. The new Node must be allocated with new !

Implements ot::NodeFactory.

Definition at line 141 of file GPSModule.cxx.

References altitudeSource, compassSource, dirSource, infoSource, ot::Module::isInitialized(), and source.

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

initializes the tracker module.

This class provides an implementation that sets the initialization flag to true. Subclasses should call this method, if they override it, before doing anything else. It takes the attributes of the element configuring this module and a local tree consisting of the children of the element. This tree must be build of Nodes.

Parameters:
attributes StringTable of elements attribute values. Should be possibly , but is not for convenience.
localTree pointer to root of configuration nodes tree

Reimplemented from ot::Module.

Definition at line 101 of file GPSModule.cxx.

References baudRate, ot::StringTable::containsKey(), debug, device, dgpsmirror, dgpsPort, dgpsServer, ot::StringTable::get(), ot::Module::init(), LOG_ACE_ERROR(), LOG_ACE_INFO(), logFile, and rtcmdev.

void ot::GPSModule::newData ( const GPResult point,
const char *  line,
void *  userData 
) [virtual]

This is the callback method called by the GPSDriver class, whenever new data arrives.

Any subclasses of GPSListener must override it to receive the data.

Parameters:
point pointer to the GPResult object that represents the parsed data.
line the corresponding string received from the GPS receiver.
uderData a pointer to user data stored when registering the listener.

Implements ot::GPSListener.

Definition at line 292 of file GPSModule.cxx.

References logFile.

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

pushes event information into the tracker tree.

It enables the module to push new data into the tree by updating EventGenerator nodes and thereby triggering an event.

Reimplemented from ot::Module.

Definition at line 226 of file GPSModule.cxx.

References altitudeSource, compassSource, dirSource, infoSource, source, and updateSource().

void ot::GPSModule::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 260 of file GPSModule.cxx.

References ot::GPSDriver::addListener(), altitudeSource, baudRate, ot::GPSDriver::close(), compassSource, debug, device, dgpsmirror, dgpsPort, dgpsServer, dirSource, driver, ot::GPSDriver::getReactor(), ot::gps_reactor, infoSource, logFile, ot::GPSDriver::open(), rtcmdev, ot::GPSDriver::setDebug(), and source.

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

This method is called after initialisation is finished and before the main loop is started.

In this implementation it starts the thread. Be sure to call this method from your subclasses start method to start the thread !

Reimplemented from ot::ThreadModule.

Definition at line 238 of file GPSModule.cxx.

References altitudeSource, compassSource, dirSource, infoSource, ot::Module::isInitialized(), source, and ot::ThreadModule::start().

template<class T>
void ot::GPSModule::updateSource ( T *  source  )  [inline, protected]

Definition at line 138 of file GPSModule.h.

Referenced by pushEvent().


Friends And Related Function Documentation

friend class GPSDirectionSource [friend]

Definition at line 172 of file GPSModule.h.

friend class GPSGarminAltitude [friend]

Definition at line 174 of file GPSModule.h.

friend class GPSGarminCompass [friend]

Definition at line 173 of file GPSModule.h.

friend class GPSInfoSource [friend]

Definition at line 175 of file GPSModule.h.

friend class GPSSource [friend]

Definition at line 171 of file GPSModule.h.


Member Data Documentation

Definition at line 165 of file GPSModule.h.

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

int ot::GPSModule::baudRate [protected]

Definition at line 156 of file GPSModule.h.

Referenced by init(), and run().

Definition at line 164 of file GPSModule.h.

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

bool ot::GPSModule::debug [protected]

Definition at line 152 of file GPSModule.h.

Referenced by init(), and run().

std::string ot::GPSModule::device [protected]

Definition at line 155 of file GPSModule.h.

Referenced by init(), and run().

int ot::GPSModule::dgpsmirror [protected]

Definition at line 159 of file GPSModule.h.

Referenced by init(), and run().

int ot::GPSModule::dgpsPort [protected]

Definition at line 158 of file GPSModule.h.

Referenced by init(), and run().

std::string ot::GPSModule::dgpsServer [protected]

Definition at line 157 of file GPSModule.h.

Referenced by init(), and run().

Definition at line 163 of file GPSModule.h.

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

Definition at line 166 of file GPSModule.h.

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

ACE_FILE_IO* ot::GPSModule::logFile [protected]

Definition at line 169 of file GPSModule.h.

Referenced by close(), init(), newData(), run(), and ~GPSModule().

std::string ot::GPSModule::rtcmdev [protected]

Definition at line 160 of file GPSModule.h.

Referenced by init(), and run().

Definition at line 162 of file GPSModule.h.

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


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

copyright (c) 2006 Graz University of Technology