18 #ifndef OPLCONSTANTS_H
19 #define OPLCONSTANTS_H
22 #include <QMessageBox>
23 #include "src/database/adatabasetypes.h"
41 #if defined(__GNUC__) || defined(__clang__)
42 #define FUNC_IDENT __PRETTY_FUNCTION__
43 #elif defined(_MSC_VER)
44 #define FUNC_IDENT __FUNCSIG__
46 #define FUNC_IDENT __func__
49 #define DEB qDebug() // Use for debugging
50 #define LOG qInfo() // Use for logging milestones (silently, will be written to log file and console out only)
51 #define TODO qCritical() << "TO DO:\t"
53 #define INFO(msg) Opl::ANotificationHandler::info(msg, this) // Use for messages of interest to the user (will be displayed in GUI)
54 #define WARN(msg) Opl::ANotificationHandler::warn(msg, this) // Use for warnings (will be displayed in GUI)
55 #define CRIT(msg) Opl::ANotificationHandler::crit(msg, this) // Use for critical warnings (will be displayed in GUI)
64 static inline void info(
const QString msg, QWidget *parent =
nullptr){
66 QMessageBox mb(parent);
68 mb.setIcon(QMessageBox::Information);
71 static inline void warn(
const QString msg, QWidget *parent =
nullptr){
73 QMessageBox mb(parent);
75 mb.setIcon(QMessageBox::Warning);
78 static inline void crit(
const QString msg, QWidget *parent =
nullptr){
80 QMessageBox mb(parent);
82 mb.setIcon(QMessageBox::Critical);
87 enum class Translations {English, German, Spanish};
88 static const QMap<Translations, QString> Translations_Strings {
89 {Translations::English, QStringLiteral(
"English")},
90 {Translations::German, QStringLiteral(
"Deutsch")},
91 {Translations::Spanish, QStringLiteral(
"EspaƱol")},
95 static const auto ApproachTypes = QStringList{
96 QLatin1String(
"VISUAL"),
97 QLatin1String(
"ILS CAT I"),
98 QLatin1String(
"ILS CAT II"),
99 QLatin1String(
"ILS CAT III"),
100 QLatin1String(
"GLS"),
101 QLatin1String(
"MLS"),
102 QLatin1String(
"LOC"),
103 QLatin1String(
"LOC/DME"),
104 QLatin1String(
"RNAV"),
105 QLatin1String(
"RNAV (LNAV)"),
106 QLatin1String(
"RNAV (LNAV/VNAV)"),
107 QLatin1String(
"RNAV (LPV)"),
108 QLatin1String(
"RNAV (RNP)"),
109 QLatin1String(
"RNAV (RNP-AR)"),
110 QLatin1String(
"VOR"),
111 QLatin1String(
"VOR/DME"),
112 QLatin1String(
"NDB"),
113 QLatin1String(
"NDB/DME"),
114 QLatin1String(
"TACAN"),
115 QLatin1String(
"SRA"),
116 QLatin1String(
"PAR"),
117 QLatin1String(
"OTHER")
125 enum class ADateFormat {ISODate, DE, EN };
131 enum FlightTimeFormat {Default, Decimal};
137 enum DateTimeFormat {Default, Backup};
160 static const auto TABLE_FLIGHTS = QLatin1String(
"flights");
161 static const auto TABLE_PILOTS = QLatin1String(
"pilots");
162 static const auto TABLE_TAILS = QLatin1String(
"tails");
163 static const auto TABLE_AIRCRAFT = QLatin1String(
"aircraft");
164 static const auto TABLE_AIRPORTS = QLatin1String(
"airports");
165 static const auto TABLE_CURRENCIES = QLatin1String(
"currencies");
168 static const auto FLIGHTS_DOFT = QLatin1String(
"doft");
169 static const auto FLIGHTS_DEPT = QLatin1String(
"dept");
170 static const auto FLIGHTS_DEST = QLatin1String(
"dest");
171 static const auto FLIGHTS_TOFB = QLatin1String(
"tofb");
172 static const auto FLIGHTS_TONB = QLatin1String(
"tonb");
173 static const auto FLIGHTS_PIC = QLatin1String(
"pic");
174 static const auto FLIGHTS_ACFT = QLatin1String(
"acft");
175 static const auto FLIGHTS_TBLK = QLatin1String(
"tblk");
176 static const auto FLIGHTS_TSPSE = QLatin1String(
"tSPSE");
177 static const auto FLIGHTS_TSPME = QLatin1String(
"tSPME");
178 static const auto FLIGHTS_TMP = QLatin1String(
"tMP");
179 static const auto FLIGHTS_TNIGHT = QLatin1String(
"tNIGHT");
180 static const auto FLIGHTS_TIFR = QLatin1String(
"tIFR");
181 static const auto FLIGHTS_TPIC = QLatin1String(
"tPIC");
182 static const auto FLIGHTS_TPICUS = QLatin1String(
"tPICUS");
183 static const auto FLIGHTS_TSIC = QLatin1String(
"tSIC");
184 static const auto FLIGHTS_TDUAL = QLatin1String(
"tDUAL");
185 static const auto FLIGHTS_TFI = QLatin1String(
"tFI");
186 static const auto FLIGHTS_TSIM = QLatin1String(
"tSIM");
187 static const auto FLIGHTS_PILOTFLYING = QLatin1String(
"pilotFlying");
188 static const auto FLIGHTS_TODAY = QLatin1String(
"toDay");
189 static const auto FLIGHTS_TONIGHT = QLatin1String(
"toNight");
190 static const auto FLIGHTS_LDGDAY = QLatin1String(
"ldgDay");
191 static const auto FLIGHTS_LDGNIGHT = QLatin1String(
"ldgNight");
192 static const auto FLIGHTS_AUTOLAND = QLatin1String(
"autoland");
193 static const auto FLIGHTS_SECONDPILOT = QLatin1String(
"secondPilot");
194 static const auto FLIGHTS_THIRDPILOT = QLatin1String(
"thirdPilot");
195 static const auto FLIGHTS_APPROACHTYPE = QLatin1String(
"approachType");
196 static const auto FLIGHTS_FLIGHTNUMBER = QLatin1String(
"flightNumber");
197 static const auto FLIGHTS_REMARKS = QLatin1String(
"remarks");
201 static const auto TAILS_REGISTRATION = QLatin1String(
"registration");
202 static const auto TAILS_COMPANY = QLatin1String(
"company");
203 static const auto TAILS_MAKE = QLatin1String(
"make");
204 static const auto TAILS_MODEL = QLatin1String(
"model");
205 static const auto TAILS_VARIANT = QLatin1String(
"variant");
206 static const auto TAILS_MULTIPILOT = QLatin1String(
"multipilot");
207 static const auto TAILS_MULTIENGINE = QLatin1String(
"multiengine");
208 static const auto TAILS_ENGINETYPE = QLatin1String(
"engineType");
209 static const auto TAILS_WEIGHTCLASS = QLatin1String(
"weightClass");
213 static const auto PILOTS_LASTNAME = QLatin1String(
"lastname");
214 static const auto PILOTS_FIRSTNAME = QLatin1String(
"firstname");
215 static const auto PILOTS_ALIAS = QLatin1String(
"alias");
216 static const auto PILOTS_COMPANY = QLatin1String(
"company");
217 static const auto PILOTS_EMPLOYEEID = QLatin1String(
"employeeid");
218 static const auto PILOTS_PHONE = QLatin1String(
"phone");
219 static const auto PILOTS_EMAIL = QLatin1String(
"email");
222 static const auto CURRENCIES_EXPIRYDATE = QLatin1String(
"expiryDate");
223 static const auto CURRENCIES_DESCRIPTION = QLatin1String(
"description");
226 static const auto ROWID = QLatin1String(
"ROWID");
227 static const auto NULL_TIME_hhmm = QLatin1String(
"00:00");
229 static const auto DEFAULT_FLIGHT_POSITION =
DataPosition(TABLE_FLIGHTS, 0);
230 static const auto DEFAULT_PILOT_POSITION =
DataPosition(TABLE_PILOTS, 0);
231 static const auto DEFAULT_TAIL_POSITION =
DataPosition(TABLE_TAILS, 0);
232 static const auto DEFAULT_AIRCRAFT_POSITION =
DataPosition(TABLE_AIRCRAFT, 0);
238 static const auto LOGO = QLatin1String(
":/icons/opl-icons/logos/logo_text.png");
239 static const auto ICON_MAIN = QLatin1String(
":/icons/opl-icons/app/icon_main.png");
240 static const auto ICON_APPICON_LINUX = QLatin1String(
":/icons/opl-icons/app/icon_linux.svg");
241 static const auto ICON_APPICON_IOS = QLatin1String(
":/icons/opl-icons/app/icon_ios.svg");
242 static const auto ICON_APPICON_WIN = QLatin1String(
":/icons/opl-icons/app/icon_windows.ico");
244 static const auto ICON_TOOLBAR_HOME = QLatin1String(
":/icons/opl-icons/toolbar/thick/light/icon_home.svg");
245 static const auto ICON_TOOLBAR_NEW_FLIGHT = QLatin1String(
":/icons/opl-icons/toolbar/thick/light/icon_new_flight.svg");
246 static const auto ICON_TOOLBAR_LOGBOOK = QLatin1String(
":/icons/opl-icons/toolbar/thick/light/icon_logbook.svg");
247 static const auto ICON_TOOLBAR_AIRCRAFT = QLatin1String(
":/icons/opl-icons/toolbar/thick/light/icon_airplane.svg");
248 static const auto ICON_TOOLBAR_PILOT = QLatin1String(
":/icons/opl-icons/toolbar/thick/light/icon_pilot.svg");
249 static const auto ICON_TOOLBAR_SETTINGS = QLatin1String(
":/icons/opl-icons/toolbar/thick/light/icon_settings.svg");
250 static const auto ICON_TOOLBAR_QUIT = QLatin1String(
":/icons/opl-icons/toolbar/thick/light/icon_exit.svg");
252 static const auto ICON_TOOLBAR_BACKUP = QLatin1String(
":/icons/opl-icons/toolbar/thick/light/icon_backup.svg");
254 static const auto ICON_TOOLBAR_HOME_DARK = QLatin1String(
":/icons/opl-icons/toolbar/thick/dark/icon_home_dm.svg");
255 static const auto ICON_TOOLBAR_NEW_FLIGHT_DARK = QLatin1String(
":/icons/opl-icons/toolbar/thick/dark/icon_new_flight_dm.svg");
256 static const auto ICON_TOOLBAR_LOGBOOK_DARK = QLatin1String(
":/icons/opl-icons/toolbar/thick/dark/icon_logbook_dm.svg");
257 static const auto ICON_TOOLBAR_AIRCRAFT_DARK = QLatin1String(
":/icons/opl-icons/toolbar/thick/dark/icon_airplane_dm.svg");
258 static const auto ICON_TOOLBAR_PILOT_DARK = QLatin1String(
":/icons/opl-icons/toolbar/thick/dark/icon_pilot_dm.svg");
259 static const auto ICON_TOOLBAR_SETTINGS_DARK = QLatin1String(
":/icons/opl-icons/toolbar/thick/dark/icon_settings_dm.svg");
260 static const auto ICON_TOOLBAR_QUIT_DARK = QLatin1String(
":/icons/opl-icons/toolbar/thick/dark/icon_exit_dm.svg");
262 static const auto ICON_TOOLBAR_BACKUP_DARK = QLatin1String(
":/icons/opl-icons/toolbar/thick/dark/icon_backup_dm.svg");
268 #endif // OPLCONSTANTS_H