aircraftentry.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. *openPilotLog - A FOSS Pilot Logbook Application
  3. *Copyright (C) 2020-2023 Felix Turowsky
  4. *
  5. *This program is free software: you can redistribute it and/or modify
  6. *it under the terms of the GNU General Public License as published by
  7. *the Free Software Foundation, either version 3 of the License, or
  8. *(at your option) any later version.
  9. *
  10. *This program is distributed in the hope that it will be useful,
  11. *but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. *GNU General Public License for more details.
  14. *
  15. *You should have received a copy of the GNU General Public License
  16. *along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. */
  18. #ifndef AIRCRAFTENTRY_H
  19. #define AIRCRAFTENTRY_H
  20. #include "src/database/row.h"
  21. namespace OPL {
  22. /*!
  23. * \brief A Row representing an Aircraft entry.
  24. * \details
  25. * In this context an aircraft refers to the aircraft TYPE (Boeing 737, Airbus A320,...) and
  26. * could be seen as an analogy for a class. The aircraft 'instances' are called TAILS and are
  27. * stored in the tails database (A Boeing 737 with registration (tail) LN-ENL for example).
  28. *
  29. * Aircraft = All aircraft with a common type that share its traits
  30. * Tail - A specific aircraft of that type
  31. *
  32. * The aircraft table in the database contains templates of various aircraft types
  33. * and is used to provide auto-completion when the user adds a new tail to the logbook.
  34. */
  35. class AircraftEntry : public Row
  36. {
  37. const static inline QString TABLE_NAME = QStringLiteral("aircraft");
  38. public:
  39. AircraftEntry();
  40. AircraftEntry(const RowData_T &row_data);
  41. AircraftEntry(int row_id, const RowData_T &row_data);
  42. const QString getTableName() const override;
  43. /*!
  44. * \brief The aircrafts manufacturer (Airbus, Boeing,...)
  45. */
  46. static const inline QString MAKE = QStringLiteral("make");
  47. /*!
  48. * \brief The aircraft model (A320, B737,...)
  49. */
  50. static const inline QString MODEL = QStringLiteral("model");
  51. /*!
  52. * \brief The aircraft variant( A320-<b>200<\b>, B737-<b>800<\b>)
  53. */
  54. static const inline QString VARIANT = QStringLiteral("variant");
  55. /*!
  56. * \brief (optional) The aircraft common name ("Beluga",...)
  57. */
  58. static const inline QString NAME = QStringLiteral("name");
  59. /*!
  60. * \brief The aircraft types iata code
  61. */
  62. static const inline QString IATA = QStringLiteral("iata");
  63. /*!
  64. * \brief The aircraft types icao code
  65. */
  66. static const inline QString ICAO = QStringLiteral("icao");
  67. /*!
  68. * \brief Wether the aircraft requires more than one pilot (stored in the database as boolean)
  69. */
  70. static const inline QString MULTI_PILOT = QStringLiteral("multipilot");
  71. /*!
  72. * \brief Wether the aircraft has more than one engine (stored in the database as a boolean)
  73. */
  74. static const inline QString MULTI_ENGINE = QStringLiteral("multiengine");
  75. /*!
  76. * \brief The aircrafts engine type. Stored in the database as an integer
  77. * \details
  78. * <ul>
  79. * <li> 0 - Single Engine Piston <\li>
  80. * <li> 1 - Multi Engine Piston <\li>
  81. * <li> 2 - Turboprop <\li>
  82. * <li> 3 - Jet <\li>
  83. * <\ul>
  84. */
  85. static const inline QString ENGINE_TYPE = QStringLiteral("engineType");
  86. /*!
  87. * \brief The aircrafts weight class. Stored in the database as an integer
  88. * \details
  89. * <ul>
  90. * <li> 0 - Light <\li>
  91. * <li> 1 - Medium <\li>
  92. * <li> 2 - Heavy <\li>
  93. * <li> 3 - Super Heavy <\li>
  94. * <\ul>
  95. */
  96. static const inline QString WEIGHT_CLASS = QStringLiteral("weightClass");
  97. };
  98. } // namespace OPL
  99. #endif // AIRCRAFTENTRY_H