flight.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef FLIGHT_H
  2. #define FLIGHT_H
  3. #include <QCoreApplication>
  4. #include <QDateTime>
  5. #include <QDebug>
  6. /*!
  7. * \brief The flight class is a container for a logbook entry. It contains all the
  8. * entries relevant to a flight. There are 8 mandatory entries which are initalized
  9. * invalid and need to be set before the flight can be committed. The other entries
  10. * are optional.
  11. */
  12. class flight
  13. {
  14. public:
  15. bool isValid = false;
  16. QStringList invalidItems = {
  17. "doft", "dept", "dest", "tofb",
  18. "tonb", "pic", "acft", "tblk"
  19. };
  20. int id = -1; // Primary Key in Database, needed for retreival but not for commiting (sqlite autoincrement)
  21. QDate doft = QDate(); // Date of Flight
  22. QString dept = "INVA"; // Departure
  23. QString dest = "INVA"; // Destination
  24. QTime tofb = QTime(); // Time off blocks (UTC), initialised invalid
  25. QTime tonb = QTime(); // Time on blocks (UTC), initialised invalid
  26. QString pic = "INVA"; // Pilot in command (ID)
  27. QString acft = "INVA"; // Aircraft Registration (ID)
  28. QTime tblk = QTime(); // Total Blocktime, initialised invalid
  29. QTime tSPSE = QTime(0,0); // optional times initialised as 0
  30. QTime tSPME = QTime(0,0);
  31. QTime tMP = QTime(0,0);
  32. QTime tNIGHT = QTime(0,0);
  33. QTime tIFR = QTime(0,0);
  34. QTime tPIC = QTime(0,0);
  35. QTime tSIC = QTime(0,0);
  36. QTime tDUAL = QTime(0,0);
  37. QTime tFI = QTime(0,0);
  38. QTime tSIM = QTime(0,0);
  39. int pilotFlying;
  40. int toDay;
  41. int toNight;
  42. int ldgDay;
  43. int ldgNight;
  44. int autoland;
  45. QString secondPilot;
  46. QString thirdPilot;
  47. QString approachType;
  48. QString flightNumber;
  49. QString remarks;
  50. // Functions
  51. static flight fromVector(QVector<QString>);
  52. static QVector<QString> toVector(flight);
  53. // Debug functionality
  54. void printFlight();
  55. QString debug();
  56. operator QString() { return debug(); }
  57. };
  58. #endif // FLIGHT_H