|
openPilotLog
|
22 #define _USE_MATH_DEFINES
27 #include "src/functions/alog.h"
45 QTime blocktime_out(0, 0);
48 int blockseconds = tofb.secsTo(tonb);
49 blocktime_out = blocktime_out.addSecs(blockseconds);
52 int blockseconds = tofb.secsTo(midnight);
53 blocktime_out = blocktime_out.addSecs(blockseconds);
54 blockseconds = midnight.secsTo(tonb);
55 blocktime_out = blocktime_out.addSecs(blockseconds);
67 int minutes = block_minutes.toInt();
68 QString hour = QString::number(minutes / 60);
69 if (hour.size() < 2) {
72 QString minute = QString::number(minutes % 60);
73 if (minute.size() < 2) {
76 QString block_time = hour +
":" + minute;
83 QString hour = QString::number(block_minutes / 60);
84 if (hour.size() < 2) {
87 QString minute = QString::number(block_minutes % 60);
88 if (minute.size() < 2) {
103 QString timestring = time.toString(
"hh:mm");
104 int minutes = (timestring.left(2).toInt()) * 60;
105 minutes += timestring.right(2).toInt();
117 int minutes = (timestring.left(2).toInt()) * 60;
118 minutes += timestring.right(2).toInt();
119 timestring = QString::number(minutes);
130 double deg = rad * (180 / M_PI);
141 double rad = deg * (M_PI / 180);
152 double nm = rad * 3440.06479482;
206 double solarElevation(QDateTime utc_time_point,
double lat,
double lon);
218 int calculateNightTime(
const QString &dept,
const QString &dest, QDateTime departureTime,
int tblk,
int nightAngle);
220 bool isNight(
const QString &icao, QDateTime event_time,
int night_angle);
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:136
QT_DEPRECATED int QTimeToMinutes(QTime time)
ACalc::time_to_minutes converts QTime to int minutes.
Definition: acalc.h:101
void updateAutoTimes(int acft_id)
ACalc::updateAutoTimes When the details of an aircraft are changed, this function recalculates deduct...
Definition: acalc.cpp:288
QT_DEPRECATED QString minutesToString(QString block_minutes)
ACalc::minutes_to_string Converts database time to String Time.
Definition: acalc.h:65
double radToNauticalMiles(double rad)
radToNauticalMiles Convert Radians to nautical miles
Definition: acalc.h:150
The ACalc namespace provides various functions for calculations that are performed outside of the dat...
Definition: acalc.h:34
QT_DEPRECATED QTime blocktime(QTime tofb, QTime tonb)
ACalc::blocktime Calculates Block Time for a given departure and arrival time.
Definition: acalc.h:43
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:34
double degToRad(double deg)
degToRad Converts degrees to radians
Definition: acalc.h:139
double radToDeg(double rad)
radToDeg Converts radians to degrees
Definition: acalc.h:128
double greatCircleDistanceBetweenAirports(const QString &dept, const QString &dest)
ACalc::greatCircleDistanceBetweenAirports Calculates Great Circle distance between two coordinates,...
Definition: acalc.cpp:106
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:167
QT_DEPRECATED int stringToMinutes(QString timestring)
ACalc::string_to_minutes Converts String Time to String Number of Minutes.
Definition: acalc.h:115
double greatCircleDistance(double lat1, double lon1, double lat2, double lon2)
greatCircleDistance Calculates Great Circle distance between two coordinates, return in Radians.
Definition: acalc.cpp:87
void updateNightTimes()
ACalc::updateNightTimes updates the night times in the database, used when changing night angle setti...
Definition: acalc.cpp:331
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:227