2
0

flight.h 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 class 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 and can be empty, null or any other value.
  11. * All time entries in a flight object shall be UTC.
  12. */
  13. class flight
  14. {
  15. public:
  16. bool isValid;
  17. QStringList invalidItems;/* = { // Upon verification, verified entries are removed from the list
  18. "doft", "dept", "dest", "tofb",
  19. "tonb", "pic", "acft", "tblk"
  20. };*/
  21. int id;// = -1; //[1] Primary Key in Database, needed for retreival but not for commiting (sqlite autoincrement)
  22. QDate doft;// = QDate(); //[2] Date of Flight, initialised invalid
  23. QString dept;// = "INVA"; //[3] Departure, initialised invalid
  24. QString dest;// = "INVA"; //[4] Destination, initialised invalid
  25. QTime tofb;// = QTime(); //[5] Time off blocks (UTC), initialised invalid
  26. QTime tonb;// = QTime(); //[6] Time on blocks (UTC), initialised invalid
  27. QString pic;// = "INVA"; //[7] Pilot in command (ID), initialised invalid
  28. QString acft;// = "INVA"; //[8] Aircraft Registration (ID), initialised invalid
  29. QTime tblk;// = QTime(); //[9] Total Blocktime, initialised invalid
  30. QTime tSPSE;// = QTime(0,0); //[10] optional times initialised as 0
  31. QTime tSPME;// = QTime(0,0); //[11]
  32. QTime tMP;// = QTime(0,0); //[12]
  33. QTime tNIGHT;// = QTime(0,0); //[13]
  34. QTime tIFR;// = QTime(0,0); //[14]
  35. QTime tPIC;// = QTime(0,0); //[15]
  36. QTime tPICUS;// = QTime(0,0); //[16]
  37. QTime tSIC;// = QTime(0,0); //[17]
  38. QTime tDUAL;// = QTime(0,0); //[18]
  39. QTime tFI;// = QTime(0,0); //[19]
  40. QTime tSIM;// = QTime(0,0); //[20]
  41. int pilotFlying; //[21]
  42. int toDay; //[22]
  43. int toNight; //[23]
  44. int ldgDay; //[24]
  45. int ldgNight; //[25]
  46. int autoland; //[26]
  47. QString secondPilot; //[27]
  48. QString thirdPilot; //[28]
  49. QString approachType; //[29]
  50. QString flightNumber; //[30]
  51. QString remarks; //[31]
  52. flight();
  53. flight(QVector<QString>);
  54. // Functions
  55. static flight fromVector(QVector<QString>);
  56. static QVector<QString> toVector(flight);
  57. // Debug functionality
  58. void print();
  59. QString debug();
  60. operator QString() { return debug(); }
  61. };
  62. #endif // FLIGHT_H