ICAROUS
|
#include <PlanReader.h>
Public Member Functions | |
PlanReader () | |
virtual void | open (const std::string &filename) |
virtual void | open (std::istream *input) |
int | planSize () const |
int | polySize () const |
int | containmentSize () const |
int | size () const |
Plan | getPlan (int i) const |
PolyPath | getPolyPath (int i) const |
PolyPath | getContainmentPolygon (int i) const |
int | combinedSize () const |
Plan | getCombinedPlan (int i) const |
ParameterData | getParameters () const |
void | updateParameterData (ParameterData &p) const |
ParameterData & | getParametersRef () |
bool | hasError () const |
bool | hasMessage () const |
std::string | getMessage () |
std::string | getMessageNoClear () const |
Protected Attributes | |
ErrorLog | error |
SeparatedInput | input |
std::vector< Plan > | plans |
bool | clock |
std::vector< int > | head |
bool | OLD_COLUMN_HEADERS |
Private Member Functions | |
int | altHeadings5 (const std::string &s1, const std::string &s2, const std::string &s3, const std::string &s4, const std::string &s5) const |
virtual void | loadfile () |
Private Attributes | |
std::vector< PolyPath > | paths |
std::vector< PolyPath > | containment |
This reads in and stores both Plans and PolyPaths (and parameters) from a file. Plan files consist of comma or space-separated values, with one point per line. Required columns include either:
Aircraft name, x-position [nmi], y-position [nmi], z-position [ft], time [s]
or
Aircraft name, latitude [deg], longitude [deg], altitude [ft], time [s]
Polygon files also include a required second altitude column ft.
Any given line may contain either type of information, but all lines describing a single entity (either aircraft or polygon) must be located together, and without time decreasing – new entities are detected by a change in the name field or if (time of entry n) < (time of entry n+1). The type of the entry is defined by the presence or lack of a second altitude column value (polys have it, plans don't).
Optional columns include point mutability and point label, both with [unspecified] units. Even if these columns are defined, these two values are optional for any given line. Columns without values may be left blank (if comma-delimited) or indicated by a single dash (-).
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.<p> Any empty line or any line starting with a hash sign (#) is ignored.<p> Files may also include parameter definitions prior to other data. Parameter definitions are of the form <code>key</code> = <code>value</code>, one per line, where <code>key</code> is a case-insensitive alphanumeric word and <code>value</code> is either a numeral or string. The <code>value</code> may include a unit, such as "dist = 50 [m]". Note that parameters require a space on either side of the equals sign.<p> 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.<p> If the optional parameter "filetype" is specified, its value must be "plan", "trajectory", "poly", or "plan+poly" (no quotes) for this reader to accept the file without error.<p> Plan "note" information is to be stored with a parameter named ID_note, where ID is the name of the plan in question. Similarly for PolyPath "note" information.
larcfm::PlanReader::PlanReader | ( | ) |
Create a new PlanReader.
int larcfm::PlanReader::combinedSize | ( | ) | const |
Returns the total number of both plans and paths.
int larcfm::PlanReader::containmentSize | ( | ) | const |
Return the number of containment areas in the file
Plan larcfm::PlanReader::getCombinedPlan | ( | int | i | ) | const |
Returns a plan or the plan corresponding to a path. Real plans occur first in the list. This should only be used if approximating PolyPaths by variable-sized traffic.
i |
PolyPath larcfm::PlanReader::getContainmentPolygon | ( | int | i | ) | const |
|
inlinevirtual |
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.
|
inlinevirtual |
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 |
Implements larcfm::ParameterProvider.
|
virtual |
Implements larcfm::ParameterReader.
Plan larcfm::PlanReader::getPlan | ( | int | i | ) | const |
PolyPath larcfm::PlanReader::getPolyPath | ( | int | i | ) | const |
|
inlinevirtual |
|
inlinevirtual |
Does this object have an error or a warning?
Implements larcfm::ErrorReporter.
int larcfm::PlanReader::planSize | ( | ) | const |
Return the number of plans in the file
int larcfm::PlanReader::polySize | ( | ) | const |
Return the number of paths in the file
int larcfm::PlanReader::size | ( | ) | const |
Return the number of plans in the file
|
virtual |
Implements larcfm::ParameterProvider.