ICAROUS
All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Modules Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
larcfm::PlanWriter Class Reference
Inheritance diagram for larcfm::PlanWriter:
larcfm::ErrorReporter

Public Member Functions

 PlanWriter ()
 
void open (const std::string &filename)
 
void open (std::ostream *writer)
 
void close ()
 
int getPrecision () const
 
void setPrecision (int precision)
 
int getLatLonExtraPrecision () const
 
void setLatLonExtraPrecision (int precision)
 
double getTimeOffset () const
 
void setTimeOffset (double offset)
 
void setPolyPathMode (PolyPath::PathMode m)
 
void setPolygons (bool b)
 
void clearPolyPathMode ()
 
void setContainmentParameter (const std::string &s)
 
void setPolyPathParameters (const std::vector< PolyPath > &list)
 
void setPlanParameters (const std::vector< Plan > &plans)
 
void setColumnDelimiterTab ()
 
void setColumnDelimiterComma ()
 
void setColumnDelimiterSpace ()
 
void addComment (const std::string &comment)
 
void setParameters (const ParameterData &pr)
 
void clearParameters ()
 
void writePlan (const Plan &p, bool tcpColumnsLocal)
 
void writePolyPath (const PolyPath &p, bool tcpColumnsLocal)
 
int size () const
 
bool isLatLon () const
 
void flush ()
 
bool hasError () const
 
bool hasMessage () const
 
std::string getMessage ()
 
std::string getMessageNoClear () const
 

Static Public Member Functions

static void write (const std::string &filename, const std::vector< Plan > &planlist, const std::vector< PolyPath > &polylist, bool tcpColumns)
 

Private Member Functions

void writeHeader (bool write_tcp, bool ll)
 

Private Attributes

ErrorLog error
 
SeparatedOutput output
 
bool latlon
 
bool first_line
 
bool display_units
 
bool tcpColumns
 
bool polyColumns
 
bool trkgsvs
 
int precision
 
int latLonExtraPrecision
 
int lines
 
std::string fname
 
std::ofstream fw
 
PolyPath::PathMode mode
 

Constructor & Destructor Documentation

◆ PlanWriter()

larcfm::PlanWriter::PlanWriter ( )

A new PlanWriter.

Member Function Documentation

◆ addComment()

void larcfm::PlanWriter::addComment ( const std::string &  comment)

Adds a comment line to the file.

Parameters
commentcomment string

◆ clearPolyPathMode()

void larcfm::PlanWriter::clearPolyPathMode ( )

Indicate that no polygons will be output (the default).

◆ getMessage()

std::string larcfm::PlanWriter::getMessage ( )
virtual

Return a string representation of any errors or warnings. Calling this method will clear any messages and reset both the error and warning status to none.

Returns
error and warning messages. If there are no messages, an empty string is returned.

Implements larcfm::ErrorReporter.

◆ getMessageNoClear()

std::string larcfm::PlanWriter::getMessageNoClear ( ) const
virtual

Return a string representation of any errors or warnings. Calling this method will not clear the error or warning status (i.e., hasError() will return the same value before and after this call.)

Returns
error and warning messages. If there are no messages, an empty string is returned.

Implements larcfm::ErrorReporter.

◆ hasError()

bool larcfm::PlanWriter::hasError ( ) const
virtual

Does this object have an error?

Returns
true if there is an error.

Implements larcfm::ErrorReporter.

◆ hasMessage()

bool larcfm::PlanWriter::hasMessage ( ) const
virtual

Does this object have an error or a warning?

Returns
true if there is an error or warning.

Implements larcfm::ErrorReporter.

◆ open()

void larcfm::PlanWriter::open ( const std::string &  filename)

A new StateReader based on the given file.

Parameters
filenamefilename

◆ setColumnDelimiterComma()

void larcfm::PlanWriter::setColumnDelimiterComma ( )

Sets the column delimiter to a comma. This method can only be used before the first "writeState" method.

◆ setColumnDelimiterSpace()

void larcfm::PlanWriter::setColumnDelimiterSpace ( )

Sets the column delimiter to a space. This method can only be used before the first "writeState" method.

◆ setColumnDelimiterTab()

void larcfm::PlanWriter::setColumnDelimiterTab ( )

Sets the column delimiter to a tab. This method can only be used before the first "writeState" method.

◆ setContainmentParameter()

void larcfm::PlanWriter::setContainmentParameter ( const std::string &  s)

Indicate which polygons are considered containment (geofences). This must be called before the first write command, which ignores stored containment information.

◆ setParameters()

void larcfm::PlanWriter::setParameters ( const ParameterData pr)

Additively set parameters. (This does not delete existing parameters, but will overwrite them.)

Parameters
prparameters

◆ setPlanParameters()

void larcfm::PlanWriter::setPlanParameters ( const std::vector< Plan > &  plans)

Sets parameters for the listed plans. Currently this consists of the "note" field for each plan, if present.

Parameters
plans

◆ setPolyPathMode()

void larcfm::PlanWriter::setPolyPathMode ( PolyPath::PathMode  m)

Indicate polygons will be output and set the path mode to be output. This must be called before the first write command, otherwise any attempts to write a polygon will result in a warning and no polygon written. The default mode is PolyPath.PathMode.AVG_VEL.

Parameters
mmode to write polygons.

◆ size()

int larcfm::PlanWriter::size ( ) const

Return the number of lines added to the file

Returns
size

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