LRAUV  revA
KmlLogWriter Class Reference

Defines a LogWriter that can convert Location and depth triples into write kml format text (see http://en.wikipedia.org/wiki/Kml ) More...

#include <KmlLogWriter.h>

Inheritance diagram for KmlLogWriter:
Collaboration diagram for KmlLogWriter:

Classes

class  SyslogItem
 

Public Member Functions

 KmlLogWriter (Str vehicleName, bool emitTimestamps=true, bool doDepth=true)
 Constructor. More...
 
virtual ~KmlLogWriter ()
 Destructor. More...
 
virtual unsigned int write (const LogEntry *entry, const Unit *unit=NULL)
 Write an entry to the text log. More...
 
virtual unsigned int writeHeader ()
 Write the log header, if any. More...
 
virtual unsigned int writeFooter ()
 Write the log footer, if any. More...
 
void setColor (const char *color)
 
- Public Member Functions inherited from LogWriter
virtual ~LogWriter ()
 Destructor. More...
 
virtual void setOutStream (OutStream &outStream)
 Sets the OutStream. More...
 
virtual bool isValid ()
 Return true if logStream_ is available. More...
 
virtual void endCycle ()
 Do what needs to be done at the end of the cycle. More...
 
virtual void config (Logger &logger)
 Configure from a config file. More...
 
virtual void resetInputs ()
 Reset cached input settings. More...
 
void addParent ()
 
void removeParent ()
 
int getParentCount ()
 
virtual void activate ()
 
virtual void deactivate ()
 
virtual bool isActive ()
 
virtual void lockWrites ()
 
virtual void unlockWrites ()
 

Static Public Member Functions

static char ** GetKmlArgs (bool doKmlSimple=false)
 
static char ** GetKmlUnits (bool doKmlSimple=false)
 
static float * GetKmlErrors (bool doKmlSimple=false)
 
- Static Public Member Functions inherited from LogWriter
static ServiceType Str2ServiceType (const char *const serviceTypeStr, int len=-1)
 
static const char * ServiceType2Str (LogWriter::ServiceType serviceType)
 
static size_t ServiceType2Strlen (LogWriter::ServiceType serviceType)
 

Protected Member Functions

unsigned int writeSyslogItems (const char *latestCoordinates)
 
- Protected Member Functions inherited from LogWriter
 LogWriter ()
 Protected constructor for pure virtual class. More...
 
 LogWriter (OutStream &outStream)
 Protected constructor for pure virtual class. More...
 

Protected Attributes

Str vehicleName_
 
FlexArray< SyslogItem * > syslogItems_
 
- Protected Attributes inherited from LogWriter
OutStreamlogStream_
 Stores an OutStream. More...
 
bool wroteHeader_
 
bool wroteFooter_
 
Mutex writeMutex_
 
int parentCount_
 
bool active_
 

Private Attributes

bool emitTimestamps_
 
bool doDepth_
 
bool haveFirstLocation_
 
bool haveFirstDepth_
 
bool haveNewLatitude_
 
bool haveNewLongitude_
 
bool haveNewDepth_
 
bool started_
 
Timestamp lastTimestamp_
 
Timestamp currentTimestamp_
 
unsigned int lineCount_
 
Location location_
 
double lastLatitude_
 
double lastLongitude_
 
double depth_
 
const char * color_
 

Static Private Attributes

static const char * KmlArgs_ [3] = {"depth", "latitude", "longitude"}
 
static const char * KmlUnits_ [3] = {Units::METER.getName(), Units::DEGREE.getName(), Units::DEGREE.getName()}
 
static float KmlErrors_ [3] = { 0.5, D2R( 0.000005 ), D2R( 0.000005 ) }
 
static const Location ZERO_LOCATION
 

Additional Inherited Members

- Public Types inherited from LogWriter
enum  ServiceType {
  NO_SERVICE = -1, SERVICE_COURIER, SERVICE_EXPRESS, SERVICE_PRIORITY,
  SERVICE_NORMAL, SERVICE_BULK, SERVICE_COUNT, SERVICE_MULTI
}
 
- Static Public Attributes inherited from LogWriter
static const char *const SERVICE_TYPE_STRS [SERVICE_COUNT]
 
static size_t const SERVICE_TYPE_STRLEN [SERVICE_COUNT]
 

Detailed Description

Defines a LogWriter that can convert Location and depth triples into write kml format text (see http://en.wikipedia.org/wiki/Kml )

See FileLogWriter for output to the filesystem.

Constructor & Destructor Documentation

KmlLogWriter::KmlLogWriter ( Str  vehicleName,
bool  emitTimestamps = true,
bool  doDepth = true 
)

Constructor.

KmlLogWriter::~KmlLogWriter ( )
virtual

Destructor.

Member Function Documentation

static char** KmlLogWriter::GetKmlArgs ( bool  doKmlSimple = false)
inlinestatic

References KmlArgs_.

Referenced by Supervisor::initialize(), and Unserialize::Run().

static float* KmlLogWriter::GetKmlErrors ( bool  doKmlSimple = false)
inlinestatic

References KmlErrors_.

Referenced by Supervisor::initialize(), and Unserialize::Run().

static char** KmlLogWriter::GetKmlUnits ( bool  doKmlSimple = false)
inlinestatic

References KmlUnits_.

Referenced by Supervisor::initialize(), and Unserialize::Run().

void KmlLogWriter::setColor ( const char *  color)
inline

References color_.

Referenced by Unserialize::Run().

unsigned int KmlLogWriter::writeHeader ( )
virtual

Member Data Documentation

const char* KmlLogWriter::color_
private

Referenced by setColor(), and writeHeader().

Timestamp KmlLogWriter::currentTimestamp_
private

Referenced by write(), and writeFooter().

double KmlLogWriter::depth_
private

Referenced by write(), and writeFooter().

bool KmlLogWriter::doDepth_
private
bool KmlLogWriter::emitTimestamps_
private
bool KmlLogWriter::haveFirstDepth_
private

Referenced by write().

bool KmlLogWriter::haveFirstLocation_
private

Referenced by write().

bool KmlLogWriter::haveNewDepth_
private

Referenced by write().

bool KmlLogWriter::haveNewLatitude_
private

Referenced by write().

bool KmlLogWriter::haveNewLongitude_
private

Referenced by write().

const char * KmlLogWriter::KmlArgs_ = {"depth", "latitude", "longitude"}
staticprivate

Referenced by GetKmlArgs().

float KmlLogWriter::KmlErrors_ = { 0.5, D2R( 0.000005 ), D2R( 0.000005 ) }
staticprivate

Referenced by GetKmlErrors().

const char * KmlLogWriter::KmlUnits_ = {Units::METER.getName(), Units::DEGREE.getName(), Units::DEGREE.getName()}
staticprivate

Referenced by GetKmlUnits().

double KmlLogWriter::lastLatitude_
private

Referenced by write(), and writeFooter().

double KmlLogWriter::lastLongitude_
private

Referenced by write(), and writeFooter().

Timestamp KmlLogWriter::lastTimestamp_
private

Referenced by write(), and writeFooter().

unsigned int KmlLogWriter::lineCount_
private

Referenced by write().

Location KmlLogWriter::location_
private

Referenced by write(), and writeFooter().

bool KmlLogWriter::started_
private

Referenced by write(), and writeFooter().

FlexArray<SyslogItem*> KmlLogWriter::syslogItems_
protected

Referenced by write(), and writeSyslogItems().

Str KmlLogWriter::vehicleName_
protected

Referenced by writeHeader().

const Location KmlLogWriter::ZERO_LOCATION
staticprivate

Referenced by write().


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