4 #include "src/database/db.h"
5 #include "src/classes/aircraft.h"
6 #include "src/classes/flight.h"
7 #include "src/classes/asettings.h"
27 QTime blocktime_out(0, 0);
30 int blockseconds = tofb.secsTo(tonb);
31 blocktime_out = blocktime_out.addSecs(blockseconds);
34 int blockseconds = tofb.secsTo(midnight);
35 blocktime_out = blocktime_out.addSecs(blockseconds);
36 blockseconds = midnight.secsTo(tonb);
37 blocktime_out = blocktime_out.addSecs(blockseconds);
48 int minutes = block_minutes.toInt();
49 QString hour = QString::number(minutes / 60);
50 if (hour.size() < 2) {
53 QString minute = QString::number(minutes % 60);
54 if (minute.size() < 2) {
57 QString block_time = hour +
":" + minute;
63 QString hour = QString::number(block_minutes / 60);
64 if (hour.size() < 2) {
67 QString minute = QString::number(block_minutes % 60);
68 if (minute.size() < 2) {
82 QString timestring = time.toString(
"hh:mm");
83 int minutes = (timestring.left(2).toInt()) * 60;
84 minutes += timestring.right(2).toInt();
95 int minutes = (timestring.left(2).toInt()) * 60;
96 minutes += timestring.right(2).toInt();
97 timestring = QString::number(minutes);
108 double deg = rad * (180 / M_PI);
119 double rad = deg * (M_PI / 180);
130 double nm = rad * 3440.06479482;
184 double solarElevation(QDateTime utc_time_point,
double lat,
double lon);
196 int calculateNightTime(
const QString &dept,
const QString &dest, QDateTime departureTime,
int tblk,
int nightAngle);
198 bool isNight(
const QString &icao, QDateTime event_time,
int night_angle);
QTime blocktime(QTime tofb, QTime tonb)
ACalc::blocktime Calculates Block Time for a given departure and arrival time.
Definition: acalc.h:25
QVector< QVector< double > > intermediatePointsOnGreatCircle(double lat1, double lon1, double lat2, double lon2, int tblk)
Calculates a list of points (lat,lon) along the Great Circle between two points. The points are space...
Definition: acalc.cpp:114
void updateAutoTimes(int acft_id)
ACalc::updateAutoTimes When the details of an aircraft are changed, this function recalculates deduct...
Definition: acalc.cpp:262
int QTimeToMinutes(QTime time)
ACalc::time_to_minutes converts QTime to int minutes.
Definition: acalc.h:80
double radToNauticalMiles(double rad)
radToNauticalMiles Convert Radians to nautical miles
Definition: acalc.h:128
int stringToMinutes(QString timestring)
ACalc::string_to_minutes Converts String Time to String Number of Minutes.
Definition: acalc.h:93
The aircraft class.
Definition: aircraft.h:28
The ACalc namespace provides various functions for calculations that are performed outside of the dat...
Definition: acalc.h:17
QString minutesToString(QString block_minutes)
ACalc::minutes_to_string Converts database time to String Time.
Definition: acalc.h:46
double degToRad(double deg)
degToRad Converts degrees to radians
Definition: acalc.h:117
double radToDeg(double rad)
radToDeg Converts radians to degrees
Definition: acalc.h:106
double greatCircleDistanceBetweenAirports(const QString &dept, const QString &dest)
ACalc::greatCircleDistanceBetweenAirports Calculates Great Circle distance between two coordinates,...
Definition: acalc.cpp:87
double solarElevation(QDateTime utc_time_point, double lat, double lon)
Calculates solar elevation angle for a given point in time and latitude/longitude coordinates.
Definition: acalc.cpp:145
double greatCircleDistance(double lat1, double lon1, double lat2, double lon2)
greatCircleDistance Calculates Great Circle distance between two coordinates, return in Radians.
Definition: acalc.cpp:68
QString formatTimeInput(QString user_input)
ACalc::formatTimeInput verifies user input and formats to hh:mm if the output is not a valid time,...
Definition: acalc.cpp:15
void updateNightTimes()
ACalc::updateNightTimes updates the night times in the database, used when changing night angle setti...
Definition: acalc.cpp:308
int calculateNightTime(const QString &dept, const QString &dest, QDateTime departureTime, int tblk, int nightAngle)
Calculates which portion of a flight was conducted in night conditions.
Definition: acalc.cpp:205