#ifndef GERMANAIRLINESVA_GACONNECTOR_LOGBOOKENTRY_H #define GERMANAIRLINESVA_GACONNECTOR_LOGBOOKENTRY_H #include #include #include #include #include namespace germanairlinesva_logbook { /* * Preamble (24) * CHAR[10] | CHAR[4] | CHAR[4] | CHAR[6] * ---------+---------------+----------+------------- * DATE | FLIGHT NUMBER | AIRCRAFT | REGISTRATION * Departure Airport Name (2...256) * UINT8 | CHAR[] * -------+------- * STRLEN | STRING * Departure Gate Name (2...256) * UINT8 | CHAR[] * -------+------- * STRLEN | STRING * Departure Runway Name (2...256) * UINT8 | CHAR[] * -------+------- * STRLEN | STRING * Arrival Airport Name (2...256) * UINT8 | CHAR[] * -------+------- * STRLEN | STRING * Arrival Gate Name (2...256) * UINT8 | CHAR[] * -------+------- * STRLEN | STRING * Arrival Runway Name (2...256) * UINT8 | CHAR[] * -------+------- * STRLEN | STRING * Times (24) * CHAR[5] | CHAR[5] | CHAR[5] | CHAR[4] | FLOAT * ----------+---------------+--------------+---------------+------ * OFF BLOCK | TAKEOFF (OUT) | LANDING (ON) | ON BLOCK (IN) | TOTAL * Fuels (16) * FLOAT | FLOAT | FLOAT | FLOAT * ---------+-----------+---------+------ * TAXI OUT | IN FLIGHT | TAXI IN | TOTAL * Distances (16) * FLOAT | FLOAT | FLOAT |FLOAT * ---------+-----------+---------+----- * TAXI OUT | IN FLIGHT | TAXI IN |TOTAL * Landing (9) * FLOAT | CHAR | FLOAT * ---------+---------- +------------ * MAX RATE | TOUCHDOWNS | MAX G-FORCE * Recording Filename (2...256) * UINT8 | CHAR[] * -------+------- * STRLEN | STRING * Postamble (5) * FLOAT | BITFIELD * -------+--------- * POINTS | FLAGS * Flags Bitfield * 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 * ----+-----+-----+-----+-----+-----+-----+------ * NIL | NIL | NIL | NIL | NIL | NIL | NIL | FILED */ class LogbookEntry { private: std::string date; std::string flightNumber; std::string aircraftType; std::string aircraftRegistration; std::string departureAirport; std::string departureGate; std::string departureRunway; std::string arrivalAirport; std::string arrivalGate; std::string arrivalRunway; std::string offBlockTime; std::string outTime; std::string inTime; std::string onBlockTime; float totalFlightTime; float taxiOutFuel; float inFlightFuel; float taxiInFuel; float totalFuel; float taxiOutDistance; float inFlightDistance; float taxiInDistance; float totalDistance; float maxLandingRate; std::uint8_t touchdowns; float maxLandingGees; std::string recordingFilename; float points; std::uint8_t flags; std::vector file; public: LogbookEntry(std::string date, std::string flightNumber, std::string aircraftType, std::string aircraftRegistration, std::string departureAirport, std::string departureGate, std::string departureRunway, std::string arrivalAirport, std::string arrivalGate, std::string arrivalRunway, std::string offBlockTime, std::string outTime, std::string inTime, std::string onBlockTime, float totalFlightTime, float taxiOutFuel, float inFlightFuel, float taxiInFuel, float totalFuel, float taxiOutDistance, float inFlightDistance, float taxiInDistance, float totalDistance, float maxLandingRate, std::uint8_t touchdowns, float maxLandingGees, std::string recordingFilename, float points, std::uint8_t flags); inline const std::uint8_t *getBinaryData() const { return file.data(); } inline std::size_t getBinaryLength() const { return file.size(); } }; } // namespace germanairlinesva_logbook #endif