tailentry.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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 TAILENTRY_H
  19. #define TAILENTRY_H
  20. #include "src/database/row.h"
  21. namespace OPL {
  22. /*!
  23. * \brief A Row representing a Tail (Registration) entry.
  24. * \details
  25. * The tails table holds the various tails the user has added to his logbook.
  26. * Within the program the term aircraft refers to an aircraft type and is stored
  27. * in the aircraft database and is used as a template. A tail is a specific instance
  28. * of an aircraft which is identified by its registration (tail).
  29. */
  30. class TailEntry : public Row
  31. {
  32. const static inline QString TABLE_NAME = QStringLiteral("tails");
  33. public:
  34. TailEntry();
  35. TailEntry(const RowData_T &row_data);
  36. TailEntry(int row_id, const RowData_T &row_data);
  37. const QString getTableName() const override;
  38. /*!
  39. * \brief Return the aircrafts registration
  40. * \return
  41. */
  42. const QString registration() const;
  43. /*!
  44. * \brief Return the aircraft type
  45. */
  46. const QString type() const; //TODO - Create String for make-model-variant
  47. /*!
  48. * \brief The entries row id in the database
  49. */
  50. const static inline QString ROWID = QStringLiteral("tail_id");
  51. /*!
  52. * \brief The aircrafts registration ("LN-ENL", "D-ABCD")
  53. */
  54. const static inline QString REGISTRATION = QStringLiteral("registration");
  55. /*!
  56. * \brief The company the aircraft is operated by
  57. */
  58. const static inline QString COMPANY = QStringLiteral("company");
  59. /*!
  60. * \brief The aircrafts manufacturer
  61. */
  62. const static inline QString MAKE = QStringLiteral("make");
  63. /*!
  64. * \brief The aircraft model
  65. */
  66. const static inline QString MODEL = QStringLiteral("model");
  67. /*!
  68. * \brief The aircraft model variant
  69. */
  70. const static inline QString VARIANT = QStringLiteral("variant");
  71. /*!
  72. * \brief Wether the aircraft requires more than one pilot (stored in the database as boolean)
  73. */
  74. static const inline QString MULTI_PILOT = QStringLiteral("multipilot");
  75. /*!
  76. * \brief Wether the aircraft has more than one engine (stored in the database as a boolean)
  77. */
  78. static const inline QString MULTI_ENGINE = QStringLiteral("multiengine");
  79. /*!
  80. * \brief The aircrafts engine type. Stored in the database as an integer
  81. * \details
  82. * <ul>
  83. * <li> 0 - Single Engine Piston <\li>
  84. * <li> 1 - Multi Engine Piston <\li>
  85. * <li> 2 - Turboprop <\li>
  86. * <li> 3 - Jet <\li>
  87. * <\ul>
  88. */
  89. static const inline QString ENGINE_TYPE = QStringLiteral("engineType");
  90. /*!
  91. * \brief The aircrafts weight class. Stored in the database as an integer
  92. * \details
  93. * <ul>
  94. * <li> 0 - Light <\li>
  95. * <li> 1 - Medium <\li>
  96. * <li> 2 - Heavy <\li>
  97. * <li> 3 - Super Heavy <\li>
  98. * <\ul>
  99. */
  100. static const inline QString WEIGHT_CLASS = QStringLiteral("weightClass");
  101. };
  102. } // namespace OPL
  103. #endif // TAILENTRY_H