ICAROUS
|
#include <GeneralPlanWriter.h>
Public Member Functions | |
GeneralPlanWriter () | |
void | open (const std::string &filename) |
void | open (std::ostream *writer) |
void | close () |
bool | isTrkGsVs () const |
void | setTrkGsVs (bool trkgsvs) |
bool | hasPolygons () const |
void | setPolygons (bool p) |
int | getPrecision () const |
void | setPrecision (int precision) |
int | getLatLonExtraPrecision () const |
void | setLatLonExtraPrecision (int precision) |
bool | isOutputTime () const |
void | setOutputTime (bool display_time) |
bool | isOutputUnits () const |
void | setOutputUnits (bool display_units) |
void | setColumnDelimiterTab () |
void | setColumnDelimiterComma () |
void | setColumnDelimiterSpace () |
void | addComment (const std::string &comment) |
void | setParameters (const ParameterData &pr) |
void | setPolyPathMode (PolyPath::PathMode m) |
void | clearPolyPathMode () |
void | setPolyPathParameters (const std::vector< GeneralPlan > &list) |
void | setContainmentParameter (const std::string &s) |
void | writePlan (const GeneralPlan &gp, double activation_time) |
void | writePlan (const GeneralPlan &gp) |
void | writePlan (const Plan &p, double t) |
void | writePlan (const PolyPath &p, double t) |
void | writePlan (const Plan &p) |
void | writePlan (const PolyPath &p) |
int | size () const |
int | lines () const |
bool | isLatLon () const |
bool | hasError () const |
bool | hasMessage () const |
std::string | getMessage () |
std::string | getMessageNoClear () const |
std::string | toString () const |
Static Public Member Functions | |
static void | write (const std::string &filename, const std::vector< GeneralPlan > plist, const std::vector< double > activeTimes) |
static void | write (const std::string &filename, const std::vector< GeneralPlan > plist) |
Private Attributes | |
ErrorLog | error |
SeparatedOutput | output |
bool | latlon |
bool | trkgsvs |
bool | display_time |
bool | first_line |
bool | display_units |
bool | polygons |
bool | source |
bool | time2 |
int | precision |
int | latLonExtraPrecision |
int | lines_i |
int | num |
std::string | fname |
PolyPath::PathMode | mode |
bool | modedefined |
std::ostream * | fw |
Additional Inherited Members |
This object writes a set of aircraft states, possibly over time, (and parameters) from a file The Aircraft states are stored in an ArrayList<AircraftState>.
State files consist of comma or space-separated values, with one point per line. Required columns include aircraft name, 3 position columns (either x[NM]/y[NM]/z[ft] or latitude[deg]/longitude[deg]/altitude[ft]) and 3 velocity columns (either vx[knot]/vy[knot]/vz[fpm] or track[deg]/gs[knot]/vs[fpm]).
An optional column is time [s]. If it is included, a "history" will be build if an aircraft has more than one entry. If it is not included, only the last entry for an aircraft will be stored.
It is necessary to include a header line that defines the column ordering. The column definitions are not case sensitive. There is also an optional header line, immediately following the column definition, that defines the unit type for each column (the defaults are listed above).
If points are consecutive for the same aircraft, subsequent name fields may be replaced with a double quotation mark ("). The aircraft name is case sensitive, so US54A != Us54a != us54a.
Any empty line or any line starting with a hash sign (#) is ignored.
Files may also include parameter definitions prior to other data. Parameter definitions are of the form <key> = <value>, one per line, where <key> is a case-insensitive alphanumeric word and <value> is either a numeral or string. The <value> may include a unit, such as "dist = 50 [m]". Note that parameters require a space on either side of the equals sign. Note that it is possible to also update the stored parameter values (or store additional ones) through API calls.
Parameters can be interpreted as double values, strings, or Boolean values, and the user is required to know which parameter is interpreted as which type.
If the optional parameter "filetype" is specified, its value must be "state" or "history" (no quotes) for this reader to accept the file without error.
larcfm::GeneralPlanWriter::GeneralPlanWriter | ( | ) |
A new GeneralStateWriter.
void larcfm::GeneralPlanWriter::addComment | ( | const std::string & | comment | ) |
Adds a comment line to the file.
comment | comment string |
void larcfm::GeneralPlanWriter::clearPolyPathMode | ( | ) |
Clear any set polygon PathMode. The PathMode will default to the first written item's path mode if it is a PolyPath or MORPHING if it is not. Whatever the stored PathMode, all polygons written will be converted to that type.
Clear any set polygon PathMode. The PathMode will default to the first written item's path mode if it is a PolyPath or MORPHING if it is not. Whatever the stored PathMode, all polygons written will be converted to that type.
m |
|
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.
Implements larcfm::ErrorReporter.
|
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.)
Implements larcfm::ErrorReporter.
|
virtual |
|
virtual |
Does this object have an error or a warning?
Implements larcfm::ErrorReporter.
bool larcfm::GeneralPlanWriter::isOutputTime | ( | ) | const |
Will the time be added to the file
bool larcfm::GeneralPlanWriter::isOutputUnits | ( | ) | const |
Will the units be displayed?
int larcfm::GeneralPlanWriter::lines | ( | ) | const |
Return number of lines added
void larcfm::GeneralPlanWriter::open | ( | const std::string & | filename | ) |
A new GeneralStateWriter based on the given file.
filename | name of file |
void larcfm::GeneralPlanWriter::setColumnDelimiterComma | ( | ) |
Sets the column delimiter to a comma. This method can only be used before the first "writeState" method.
void larcfm::GeneralPlanWriter::setColumnDelimiterSpace | ( | ) |
Sets the column delimiter to a space. This method can only be used before the first "writeState" method.
void larcfm::GeneralPlanWriter::setColumnDelimiterTab | ( | ) |
Sets the column delimiter to a tab. This method can only be used before the first "writeState" method.
void larcfm::GeneralPlanWriter::setOutputTime | ( | bool | display_time_ | ) |
Should the time be added to the file
display_time | true, if the time is to be output to the file |
void larcfm::GeneralPlanWriter::setOutputUnits | ( | bool | display_units_ | ) |
Should the units be displayed?
display_units | true, if the units are to be displayed in output |
void larcfm::GeneralPlanWriter::setParameters | ( | const ParameterData & | pr | ) |
Set parameters. Use all the parameters in the reader.
pr | parameters |
void larcfm::GeneralPlanWriter::setPolygons | ( | bool | p | ) |
Toggle extra polygon headers, true=include (default true)
p |
void larcfm::GeneralPlanWriter::setPolyPathMode | ( | PolyPath::PathMode | m | ) |
Specify a polygon PathMode. If this is not set ahead of time, this will default to the first written item's path mode if it is a PolyPath or MORPHING if it is not. Whatever the stored PathMode, all polygons written will be converted to that type.
m | path mode |
Specify a polygon PathMode. If this is not set ahead of time, this will default to the first written item's path mode if it is a PolyPath or MORPHING if it is not. Whatever the stored PathMode, all polygons written will be converted to that type.
m |
void larcfm::GeneralPlanWriter::setPolyPathParameters | ( | const std::vector< GeneralPlan > & | list | ) |
If necessary, this must be called before the first write call
int larcfm::GeneralPlanWriter::size | ( | ) | const |
Return the number of states added to the file