15 using namespace RdAirplane;
16 using namespace boost;
17 namespace fs = filesystem;
19 RdTransformAds_bLogFile::RdTransformAds_bLogFile() :
21 _ads_bDataBase_(NULL) {}
28 string outputDirectory;
49 INFO(
"Data conversion started.");
51 ofstream outputFileHandle;
54 if(!outputFileHandle.is_open()) {
55 ERROR(
"Could not write data.");
60 <<
"Time (Unix-Timestamp)| "
61 <<
"Latitude (UTM) (degree)| "
62 <<
"Longitude (UTM) (degree)| "
63 <<
"Pressure Altitude (UTM) (m)| "
64 <<
"Corrected Pressure Altitude (m)| "
65 <<
"GPS Altitude (m)| "
67 << setprecision(numeric_limits<long double>::digits10 + 1);
70 for(Ads_bDataBase::AirplaneMap::const_iterator airplaneIter = airplanes.begin();
71 airplaneIter != airplanes.end();
73 const Airplane* airplane = airplaneIter->second;
75 for(Airplane::FlightList::const_iterator flightIter = flights.begin();
76 flightIter != flights.end();
78 const Flight* flight = *flightIter;
81 for(Flight::Ads_bEventSet::iterator ads_bEventIter = ads_bEvents.begin();
82 ads_bEventIter != ads_bEvents.end();
84 const Ads_bEvent* ads_bEvent = *ads_bEventIter;
91 double latitude = geodeticCoordinates.get<0>();
92 double longitude = geodeticCoordinates.get<1>();
95 << flight->
getId() <<
" "
99 << pressureAltitude/
m <<
" "
100 << correctedPressureAltitude/
m <<
" "
108 outputFileHandle.close();
111 outputFileHandle.close();
112 INFO(
"Data conversion finished. (Aaaaand Offline might have killed itself. If so hit Ctr+C)");
Ads_bDataBase * _ads_bDataBase_
utl::CoordinateSystemPtr _globalCoordinateSystem_
fwk::VModule::ResultFlag Run(evt::Event &event)
Run: invoked once per event.
Report success to RunController.
Class to hold and convert a point in geodetic coordinates.
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
const utl::TimeInterval & getTimeShift() const
#define INFO(message)
Macro for logging informational messages.
boost::filesystem::path _outputFile_
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
const Ads_bEventSet & getAdsbEvents(Ads_bEvent::AltitudeType pAltitudeType) const
Class representing a document branch.
const utl::UTMPoint & getCoordinates() const
AltitudeType getAltitudeType() const
void GetData(bool &b) const
Overloads of the GetData member template function.
double GetInterval() const
Get the time interval as a double (in Auger base units)
std::map< std::string, Airplane * > AirplaneMap
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
ResultFlag
Flag returned by module methods to the RunController.
const utl::TimeStamp & getCaptureTime() const
double getAltitude(AltitudeType pAltitudeType) const
const AirplaneMap & getAirplanes()
static Ads_bDataBase * getSharedDataBase()
Report failure to RunController, causing RunController to terminate execution.
const FlightList & getFlights() const
std::set< Ads_bEvent *, Ads_bEventComparator > Ads_bEventSet
Main configuration utility.
std::list< Flight * > FlightList
const std::string & getId() const
virtual ~RdTransformAds_bLogFile()
#define ERROR(message)
Macro for logging error messages.
boost::tuple< double, double, double > GetGeodeticCoordinates() const
Get geodetic latitude, longitude, height.
utl::Branch GetTopBranch(const std::string &id)
Get top branch for moduleConfigLink with given id (XML files)