namespace_a_calc.html 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.18"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>openPilotLog: ACalc Namespace Reference</title>
  9. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  10. <script type="text/javascript" src="jquery.js"></script>
  11. <script type="text/javascript" src="dynsections.js"></script>
  12. <link href="navtree.css" rel="stylesheet" type="text/css"/>
  13. <script type="text/javascript" src="resize.js"></script>
  14. <script type="text/javascript" src="navtreedata.js"></script>
  15. <script type="text/javascript" src="navtree.js"></script>
  16. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  17. <script type="text/javascript" src="search/searchdata.js"></script>
  18. <script type="text/javascript" src="search/search.js"></script>
  19. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  20. <link href="custom_dark_theme.css" rel="stylesheet" type="text/css"/>
  21. </head>
  22. <body>
  23. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  24. <div id="titlearea">
  25. <table cellspacing="0" cellpadding="0">
  26. <tbody>
  27. <tr style="height: 56px;">
  28. <td id="projectlogo"><img alt="Logo" src="icon_main.png"/></td>
  29. <td id="projectalign" style="padding-left: 0.5em;">
  30. <div id="projectname">openPilotLog
  31. </div>
  32. </td>
  33. </tr>
  34. </tbody>
  35. </table>
  36. </div>
  37. <!-- end header part -->
  38. <!-- Generated by Doxygen 1.8.18 -->
  39. <script type="text/javascript">
  40. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  41. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  42. /* @license-end */
  43. </script>
  44. <script type="text/javascript" src="menudata.js"></script>
  45. <script type="text/javascript" src="menu.js"></script>
  46. <script type="text/javascript">
  47. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  48. $(function() {
  49. initMenu('',true,false,'search.php','Search');
  50. $(document).ready(function() { init_search(); });
  51. });
  52. /* @license-end */</script>
  53. <div id="main-nav"></div>
  54. </div><!-- top -->
  55. <div id="side-nav" class="ui-resizable side-nav-resizable">
  56. <div id="nav-tree">
  57. <div id="nav-tree-contents">
  58. <div id="nav-sync" class="sync"></div>
  59. </div>
  60. </div>
  61. <div id="splitbar" style="-moz-user-select:none;"
  62. class="ui-resizable-handle">
  63. </div>
  64. </div>
  65. <script type="text/javascript">
  66. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  67. $(document).ready(function(){initNavTree('namespace_a_calc.html',''); initResizable(); });
  68. /* @license-end */
  69. </script>
  70. <div id="doc-content">
  71. <!-- window showing the filter options -->
  72. <div id="MSearchSelectWindow"
  73. onmouseover="return searchBox.OnSearchSelectShow()"
  74. onmouseout="return searchBox.OnSearchSelectHide()"
  75. onkeydown="return searchBox.OnSearchSelectKey(event)">
  76. </div>
  77. <!-- iframe showing the search results (closed by default) -->
  78. <div id="MSearchResultsWindow">
  79. <iframe src="javascript:void(0)" frameborder="0"
  80. name="MSearchResults" id="MSearchResults">
  81. </iframe>
  82. </div>
  83. <div class="header">
  84. <div class="summary">
  85. <a href="#func-members">Functions</a> </div>
  86. <div class="headertitle">
  87. <div class="title">ACalc Namespace Reference</div> </div>
  88. </div><!--header-->
  89. <div class="contents">
  90. <p>The <a class="el" href="namespace_a_calc.html" title="The ACalc namespace provides various functions for calculations that are performed outside of the dat...">ACalc</a> namespace provides various functions for calculations that are performed outside of the database. This includes tasks like converting different units and formats, or functions calculating block time or night time.
  91. <a href="namespace_a_calc.html#details">More...</a></p>
  92. <table class="memberdecls">
  93. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
  94. Functions</h2></td></tr>
  95. <tr class="memitem:a8ac68999097f2e28a3b4bd2709b5b19f"><td class="memItemLeft" align="right" valign="top">QT_DEPRECATED QTime&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_calc.html#a8ac68999097f2e28a3b4bd2709b5b19f">blocktime</a> (QTime tofb, QTime tonb)</td></tr>
  96. <tr class="memdesc:a8ac68999097f2e28a3b4bd2709b5b19f"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="namespace_a_calc.html#a8ac68999097f2e28a3b4bd2709b5b19f" title="ACalc::blocktime Calculates Block Time for a given departure and arrival time.">ACalc::blocktime</a> Calculates Block Time for a given departure and arrival time. <a href="namespace_a_calc.html#a8ac68999097f2e28a3b4bd2709b5b19f">More...</a><br /></td></tr>
  97. <tr class="separator:a8ac68999097f2e28a3b4bd2709b5b19f"><td class="memSeparator" colspan="2">&#160;</td></tr>
  98. <tr class="memitem:ac5e39b538ea3663556c820d237f242a2"><td class="memItemLeft" align="right" valign="top">QT_DEPRECATED QString&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_calc.html#ac5e39b538ea3663556c820d237f242a2">minutesToString</a> (QString block_minutes)</td></tr>
  99. <tr class="memdesc:ac5e39b538ea3663556c820d237f242a2"><td class="mdescLeft">&#160;</td><td class="mdescRight">ACalc::minutes_to_string Converts database time to String Time. <a href="namespace_a_calc.html#ac5e39b538ea3663556c820d237f242a2">More...</a><br /></td></tr>
  100. <tr class="separator:ac5e39b538ea3663556c820d237f242a2"><td class="memSeparator" colspan="2">&#160;</td></tr>
  101. <tr class="memitem:acb0ae408db34ef706443c8fb847cc893"><td class="memItemLeft" align="right" valign="top"><a id="acb0ae408db34ef706443c8fb847cc893"></a>
  102. QT_DEPRECATED QString&#160;</td><td class="memItemRight" valign="bottom"><b>minutesToString</b> (int block_minutes)</td></tr>
  103. <tr class="separator:acb0ae408db34ef706443c8fb847cc893"><td class="memSeparator" colspan="2">&#160;</td></tr>
  104. <tr class="memitem:a9568b0d72cd6b0f91f686342bc624e1f"><td class="memItemLeft" align="right" valign="top">QT_DEPRECATED int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_calc.html#a9568b0d72cd6b0f91f686342bc624e1f">QTimeToMinutes</a> (QTime time)</td></tr>
  105. <tr class="memdesc:a9568b0d72cd6b0f91f686342bc624e1f"><td class="mdescLeft">&#160;</td><td class="mdescRight">ACalc::time_to_minutes converts QTime to int minutes. <a href="namespace_a_calc.html#a9568b0d72cd6b0f91f686342bc624e1f">More...</a><br /></td></tr>
  106. <tr class="separator:a9568b0d72cd6b0f91f686342bc624e1f"><td class="memSeparator" colspan="2">&#160;</td></tr>
  107. <tr class="memitem:a4c829bf747bcd84bf6b1efb3ab0201d1"><td class="memItemLeft" align="right" valign="top">QT_DEPRECATED int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_calc.html#a4c829bf747bcd84bf6b1efb3ab0201d1">stringToMinutes</a> (QString timestring)</td></tr>
  108. <tr class="memdesc:a4c829bf747bcd84bf6b1efb3ab0201d1"><td class="mdescLeft">&#160;</td><td class="mdescRight">ACalc::string_to_minutes Converts String Time to String Number of Minutes. <a href="namespace_a_calc.html#a4c829bf747bcd84bf6b1efb3ab0201d1">More...</a><br /></td></tr>
  109. <tr class="separator:a4c829bf747bcd84bf6b1efb3ab0201d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
  110. <tr class="memitem:a2a540662e22840e4b58e8e760611b4f2"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_calc.html#a2a540662e22840e4b58e8e760611b4f2">radToDeg</a> (double rad)</td></tr>
  111. <tr class="memdesc:a2a540662e22840e4b58e8e760611b4f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">radToDeg Converts radians to degrees <a href="namespace_a_calc.html#a2a540662e22840e4b58e8e760611b4f2">More...</a><br /></td></tr>
  112. <tr class="separator:a2a540662e22840e4b58e8e760611b4f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
  113. <tr class="memitem:acafe6c0bede38e737937e2062fd93c71"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_calc.html#acafe6c0bede38e737937e2062fd93c71">degToRad</a> (double deg)</td></tr>
  114. <tr class="memdesc:acafe6c0bede38e737937e2062fd93c71"><td class="mdescLeft">&#160;</td><td class="mdescRight">degToRad Converts degrees to radians <a href="namespace_a_calc.html#acafe6c0bede38e737937e2062fd93c71">More...</a><br /></td></tr>
  115. <tr class="separator:acafe6c0bede38e737937e2062fd93c71"><td class="memSeparator" colspan="2">&#160;</td></tr>
  116. <tr class="memitem:a37c52e8b522b233087b8c4d94f30fca5"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_calc.html#a37c52e8b522b233087b8c4d94f30fca5">radToNauticalMiles</a> (double rad)</td></tr>
  117. <tr class="memdesc:a37c52e8b522b233087b8c4d94f30fca5"><td class="mdescLeft">&#160;</td><td class="mdescRight">radToNauticalMiles Convert Radians to nautical miles <a href="namespace_a_calc.html#a37c52e8b522b233087b8c4d94f30fca5">More...</a><br /></td></tr>
  118. <tr class="separator:a37c52e8b522b233087b8c4d94f30fca5"><td class="memSeparator" colspan="2">&#160;</td></tr>
  119. <tr class="memitem:a72c6fca35602a24ff8435f86abdc78d7"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_calc.html#a72c6fca35602a24ff8435f86abdc78d7">greatCircleDistance</a> (double lat1, double lon1, double lat2, double lon2)</td></tr>
  120. <tr class="memdesc:a72c6fca35602a24ff8435f86abdc78d7"><td class="mdescLeft">&#160;</td><td class="mdescRight">greatCircleDistance Calculates Great Circle distance between two coordinates, return in Radians. <a href="namespace_a_calc.html#a72c6fca35602a24ff8435f86abdc78d7">More...</a><br /></td></tr>
  121. <tr class="separator:a72c6fca35602a24ff8435f86abdc78d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  122. <tr class="memitem:a2d15bbb67e99d502e2fd730c47854a9f"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_calc.html#a2d15bbb67e99d502e2fd730c47854a9f">greatCircleDistanceBetweenAirports</a> (const QString &amp;dept, const QString &amp;dest)</td></tr>
  123. <tr class="memdesc:a2d15bbb67e99d502e2fd730c47854a9f"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="namespace_a_calc.html#a2d15bbb67e99d502e2fd730c47854a9f" title="ACalc::greatCircleDistanceBetweenAirports Calculates Great Circle distance between two coordinates,...">ACalc::greatCircleDistanceBetweenAirports</a> Calculates Great Circle distance between two coordinates, return in nautical miles. <a href="namespace_a_calc.html#a2d15bbb67e99d502e2fd730c47854a9f">More...</a><br /></td></tr>
  124. <tr class="separator:a2d15bbb67e99d502e2fd730c47854a9f"><td class="memSeparator" colspan="2">&#160;</td></tr>
  125. <tr class="memitem:a4a071a5788f00c98834127f9c5721383"><td class="memItemLeft" align="right" valign="top">QVector&lt; QVector&lt; double &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_calc.html#a4a071a5788f00c98834127f9c5721383">intermediatePointsOnGreatCircle</a> (double lat1, double lon1, double lat2, double lon2, int tblk)</td></tr>
  126. <tr class="memdesc:a4a071a5788f00c98834127f9c5721383"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates a list of points (lat,lon) along the Great Circle between two points. The points are spaced equally, one minute of block time apart. <a href="namespace_a_calc.html#a4a071a5788f00c98834127f9c5721383">More...</a><br /></td></tr>
  127. <tr class="separator:a4a071a5788f00c98834127f9c5721383"><td class="memSeparator" colspan="2">&#160;</td></tr>
  128. <tr class="memitem:acfa830e821e2f9e20bebffda67d393b1"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_calc.html#acfa830e821e2f9e20bebffda67d393b1">solarElevation</a> (QDateTime utc_time_point, double lat, double lon)</td></tr>
  129. <tr class="memdesc:acfa830e821e2f9e20bebffda67d393b1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates solar elevation angle for a given point in time and latitude/longitude coordinates. <a href="namespace_a_calc.html#acfa830e821e2f9e20bebffda67d393b1">More...</a><br /></td></tr>
  130. <tr class="separator:acfa830e821e2f9e20bebffda67d393b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
  131. <tr class="memitem:a55ede99d0f9f6e8a2f3a467859c0f192"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_calc.html#a55ede99d0f9f6e8a2f3a467859c0f192">calculateNightTime</a> (const QString &amp;dept, const QString &amp;dest, QDateTime departureTime, int tblk, int nightAngle)</td></tr>
  132. <tr class="memdesc:a55ede99d0f9f6e8a2f3a467859c0f192"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates which portion of a flight was conducted in night conditions. <a href="namespace_a_calc.html#a55ede99d0f9f6e8a2f3a467859c0f192">More...</a><br /></td></tr>
  133. <tr class="separator:a55ede99d0f9f6e8a2f3a467859c0f192"><td class="memSeparator" colspan="2">&#160;</td></tr>
  134. <tr class="memitem:a6f006acefa051b041112b74f04c5eaac"><td class="memItemLeft" align="right" valign="top"><a id="a6f006acefa051b041112b74f04c5eaac"></a>
  135. bool&#160;</td><td class="memItemRight" valign="bottom"><b>isNight</b> (const QString &amp;icao, QDateTime event_time, int night_angle)</td></tr>
  136. <tr class="separator:a6f006acefa051b041112b74f04c5eaac"><td class="memSeparator" colspan="2">&#160;</td></tr>
  137. <tr class="memitem:ad088e5dd93d1938ff97f88032dc0adec"><td class="memItemLeft" align="right" valign="top">QString&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_calc.html#ad088e5dd93d1938ff97f88032dc0adec">formatTimeInput</a> (QString user_input)</td></tr>
  138. <tr class="memdesc:ad088e5dd93d1938ff97f88032dc0adec"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="namespace_a_calc.html#ad088e5dd93d1938ff97f88032dc0adec" title="ACalc::formatTimeInput verifies user input and formats to hh:mm if the output is not a valid time,...">ACalc::formatTimeInput</a> verifies user input and formats to hh:mm if the output is not a valid time, an empty string is returned. Accepts input as hh:mm, h:mm, hhmm or hmm. <a href="namespace_a_calc.html#ad088e5dd93d1938ff97f88032dc0adec">More...</a><br /></td></tr>
  139. <tr class="separator:ad088e5dd93d1938ff97f88032dc0adec"><td class="memSeparator" colspan="2">&#160;</td></tr>
  140. <tr class="memitem:a3f12e1f72eeb5cc1cfe9b7b6df47391c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_calc.html#a3f12e1f72eeb5cc1cfe9b7b6df47391c">updateAutoTimes</a> (int acft_id)</td></tr>
  141. <tr class="memdesc:a3f12e1f72eeb5cc1cfe9b7b6df47391c"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="namespace_a_calc.html#a3f12e1f72eeb5cc1cfe9b7b6df47391c" title="ACalc::updateAutoTimes When the details of an aircraft are changed, this function recalculates deduct...">ACalc::updateAutoTimes</a> When the details of an aircraft are changed, this function recalculates deductable times for this aircraft and updates the database accordingly. <a href="namespace_a_calc.html#a3f12e1f72eeb5cc1cfe9b7b6df47391c">More...</a><br /></td></tr>
  142. <tr class="separator:a3f12e1f72eeb5cc1cfe9b7b6df47391c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  143. <tr class="memitem:adb7a8a84011affb4173bb59be4449b9d"><td class="memItemLeft" align="right" valign="top"><a id="adb7a8a84011affb4173bb59be4449b9d"></a>
  144. void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_calc.html#adb7a8a84011affb4173bb59be4449b9d">updateNightTimes</a> ()</td></tr>
  145. <tr class="memdesc:adb7a8a84011affb4173bb59be4449b9d"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="namespace_a_calc.html#adb7a8a84011affb4173bb59be4449b9d" title="ACalc::updateNightTimes updates the night times in the database, used when changing night angle setti...">ACalc::updateNightTimes</a> updates the night times in the database, used when changing night angle setting for example. <br /></td></tr>
  146. <tr class="separator:adb7a8a84011affb4173bb59be4449b9d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  147. </table>
  148. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  149. <div class="textblock"><p>The <a class="el" href="namespace_a_calc.html" title="The ACalc namespace provides various functions for calculations that are performed outside of the dat...">ACalc</a> namespace provides various functions for calculations that are performed outside of the database. This includes tasks like converting different units and formats, or functions calculating block time or night time. </p>
  150. </div><h2 class="groupheader">Function Documentation</h2>
  151. <a id="a8ac68999097f2e28a3b4bd2709b5b19f"></a>
  152. <h2 class="memtitle"><span class="permalink"><a href="#a8ac68999097f2e28a3b4bd2709b5b19f">&#9670;&nbsp;</a></span>blocktime()</h2>
  153. <div class="memitem">
  154. <div class="memproto">
  155. <table class="mlabels">
  156. <tr>
  157. <td class="mlabels-left">
  158. <table class="memname">
  159. <tr>
  160. <td class="memname">QT_DEPRECATED QTime ACalc::blocktime </td>
  161. <td>(</td>
  162. <td class="paramtype">QTime&#160;</td>
  163. <td class="paramname"><em>tofb</em>, </td>
  164. </tr>
  165. <tr>
  166. <td class="paramkey"></td>
  167. <td></td>
  168. <td class="paramtype">QTime&#160;</td>
  169. <td class="paramname"><em>tonb</em>&#160;</td>
  170. </tr>
  171. <tr>
  172. <td></td>
  173. <td>)</td>
  174. <td></td><td></td>
  175. </tr>
  176. </table>
  177. </td>
  178. <td class="mlabels-right">
  179. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  180. </tr>
  181. </table>
  182. </div><div class="memdoc">
  183. <p><a class="el" href="namespace_a_calc.html#a8ac68999097f2e28a3b4bd2709b5b19f" title="ACalc::blocktime Calculates Block Time for a given departure and arrival time.">ACalc::blocktime</a> Calculates Block Time for a given departure and arrival time. </p>
  184. <dl class="params"><dt>Parameters</dt><dd>
  185. <table class="params">
  186. <tr><td class="paramname">tofb</td><td>QTime Time Off Blocks </td></tr>
  187. <tr><td class="paramname">tonb</td><td>QTime Time On Blocks </td></tr>
  188. </table>
  189. </dd>
  190. </dl>
  191. <dl class="section return"><dt>Returns</dt><dd>Block Time in minutes </dd></dl>
  192. </div>
  193. </div>
  194. <a id="a55ede99d0f9f6e8a2f3a467859c0f192"></a>
  195. <h2 class="memtitle"><span class="permalink"><a href="#a55ede99d0f9f6e8a2f3a467859c0f192">&#9670;&nbsp;</a></span>calculateNightTime()</h2>
  196. <div class="memitem">
  197. <div class="memproto">
  198. <table class="memname">
  199. <tr>
  200. <td class="memname">int ACalc::calculateNightTime </td>
  201. <td>(</td>
  202. <td class="paramtype">const QString &amp;&#160;</td>
  203. <td class="paramname"><em>dept</em>, </td>
  204. </tr>
  205. <tr>
  206. <td class="paramkey"></td>
  207. <td></td>
  208. <td class="paramtype">const QString &amp;&#160;</td>
  209. <td class="paramname"><em>dest</em>, </td>
  210. </tr>
  211. <tr>
  212. <td class="paramkey"></td>
  213. <td></td>
  214. <td class="paramtype">QDateTime&#160;</td>
  215. <td class="paramname"><em>departureTime</em>, </td>
  216. </tr>
  217. <tr>
  218. <td class="paramkey"></td>
  219. <td></td>
  220. <td class="paramtype">int&#160;</td>
  221. <td class="paramname"><em>tblk</em>, </td>
  222. </tr>
  223. <tr>
  224. <td class="paramkey"></td>
  225. <td></td>
  226. <td class="paramtype">int&#160;</td>
  227. <td class="paramname"><em>nightAngle</em>&#160;</td>
  228. </tr>
  229. <tr>
  230. <td></td>
  231. <td>)</td>
  232. <td></td><td></td>
  233. </tr>
  234. </table>
  235. </div><div class="memdoc">
  236. <p>Calculates which portion of a flight was conducted in night conditions. </p>
  237. <dl class="params"><dt>Parameters</dt><dd>
  238. <table class="params">
  239. <tr><td class="paramname">dept</td><td>- ICAO 4-letter code of Departure Airport </td></tr>
  240. <tr><td class="paramname">dest</td><td>- ICAO 4-letter Code of Destination Airport </td></tr>
  241. <tr><td class="paramname">departureTime</td><td>- QDateTime of Departure (UTC) </td></tr>
  242. <tr><td class="paramname">tblk</td><td>- Total block time in minutes </td></tr>
  243. <tr><td class="paramname">nightAngle</td><td>- the solar elevation angle where night conditons exist. Default -6 (end of civil evening twilight) </td></tr>
  244. </table>
  245. </dd>
  246. </dl>
  247. <dl class="section return"><dt>Returns</dt><dd>Total number of minutes under night flying conditions </dd></dl>
  248. </div>
  249. </div>
  250. <a id="acafe6c0bede38e737937e2062fd93c71"></a>
  251. <h2 class="memtitle"><span class="permalink"><a href="#acafe6c0bede38e737937e2062fd93c71">&#9670;&nbsp;</a></span>degToRad()</h2>
  252. <div class="memitem">
  253. <div class="memproto">
  254. <table class="mlabels">
  255. <tr>
  256. <td class="mlabels-left">
  257. <table class="memname">
  258. <tr>
  259. <td class="memname">double ACalc::degToRad </td>
  260. <td>(</td>
  261. <td class="paramtype">double&#160;</td>
  262. <td class="paramname"><em>deg</em></td><td>)</td>
  263. <td></td>
  264. </tr>
  265. </table>
  266. </td>
  267. <td class="mlabels-right">
  268. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  269. </tr>
  270. </table>
  271. </div><div class="memdoc">
  272. <p>degToRad Converts degrees to radians </p>
  273. <dl class="params"><dt>Parameters</dt><dd>
  274. <table class="params">
  275. <tr><td class="paramname">deg</td><td></td></tr>
  276. </table>
  277. </dd>
  278. </dl>
  279. <dl class="section return"><dt>Returns</dt><dd>radians </dd></dl>
  280. </div>
  281. </div>
  282. <a id="ad088e5dd93d1938ff97f88032dc0adec"></a>
  283. <h2 class="memtitle"><span class="permalink"><a href="#ad088e5dd93d1938ff97f88032dc0adec">&#9670;&nbsp;</a></span>formatTimeInput()</h2>
  284. <div class="memitem">
  285. <div class="memproto">
  286. <table class="memname">
  287. <tr>
  288. <td class="memname">QT_DEPRECATED QString ACalc::formatTimeInput </td>
  289. <td>(</td>
  290. <td class="paramtype">QString&#160;</td>
  291. <td class="paramname"><em>user_input</em></td><td>)</td>
  292. <td></td>
  293. </tr>
  294. </table>
  295. </div><div class="memdoc">
  296. <p><a class="el" href="namespace_a_calc.html#ad088e5dd93d1938ff97f88032dc0adec" title="ACalc::formatTimeInput verifies user input and formats to hh:mm if the output is not a valid time,...">ACalc::formatTimeInput</a> verifies user input and formats to hh:mm if the output is not a valid time, an empty string is returned. Accepts input as hh:mm, h:mm, hhmm or hmm. </p>
  297. <dl class="params"><dt>Parameters</dt><dd>
  298. <table class="params">
  299. <tr><td class="paramname">userinput</td><td>from a QLineEdit </td></tr>
  300. </table>
  301. </dd>
  302. </dl>
  303. <dl class="section return"><dt>Returns</dt><dd>formatted QString "hh:mm" or Empty String </dd></dl>
  304. </div>
  305. </div>
  306. <a id="a72c6fca35602a24ff8435f86abdc78d7"></a>
  307. <h2 class="memtitle"><span class="permalink"><a href="#a72c6fca35602a24ff8435f86abdc78d7">&#9670;&nbsp;</a></span>greatCircleDistance()</h2>
  308. <div class="memitem">
  309. <div class="memproto">
  310. <table class="memname">
  311. <tr>
  312. <td class="memname">double ACalc::greatCircleDistance </td>
  313. <td>(</td>
  314. <td class="paramtype">double&#160;</td>
  315. <td class="paramname"><em>lat1</em>, </td>
  316. </tr>
  317. <tr>
  318. <td class="paramkey"></td>
  319. <td></td>
  320. <td class="paramtype">double&#160;</td>
  321. <td class="paramname"><em>lon1</em>, </td>
  322. </tr>
  323. <tr>
  324. <td class="paramkey"></td>
  325. <td></td>
  326. <td class="paramtype">double&#160;</td>
  327. <td class="paramname"><em>lat2</em>, </td>
  328. </tr>
  329. <tr>
  330. <td class="paramkey"></td>
  331. <td></td>
  332. <td class="paramtype">double&#160;</td>
  333. <td class="paramname"><em>lon2</em>&#160;</td>
  334. </tr>
  335. <tr>
  336. <td></td>
  337. <td>)</td>
  338. <td></td><td></td>
  339. </tr>
  340. </table>
  341. </div><div class="memdoc">
  342. <p>greatCircleDistance Calculates Great Circle distance between two coordinates, return in Radians. </p>
  343. <dl class="params"><dt>Parameters</dt><dd>
  344. <table class="params">
  345. <tr><td class="paramname">lat1</td><td>Location Latitude in degrees -90:90 ;S(-) N(+) </td></tr>
  346. <tr><td class="paramname">lon1</td><td>Location Longitude in degrees -180:180 W(-) E(+) </td></tr>
  347. <tr><td class="paramname">lat2</td><td>Location Latitude in degrees -90:90 ;S(-) N(+) </td></tr>
  348. <tr><td class="paramname">lon2</td><td>Location Longitude in degrees -180:180 W(-) E(+) </td></tr>
  349. </table>
  350. </dd>
  351. </dl>
  352. <dl class="section return"><dt>Returns</dt><dd></dd></dl>
  353. <p>The purpose of the following functions is to provide functionality enabling the Calculation of night flying time. EASA defines night as follows:</p>
  354. <p>‘Night’ means the period between the end of evening civil twilight and the beginning of morning civil twilight or such other period between sunset and sunrise as may be prescribed by the appropriate authority, as defined by the Member State.</p>
  355. <p>This is the proccess of Calculating night time in this program:</p>
  356. <p>1) A flight from A to B follows the Great Circle Track along these two points at an average cruising height of 11km. (~FL 360)</p>
  357. <p>2) Any time the Elevation of the Sun at the current position is less than -6 degrees, night conditions are present. 3) The Calculation is performed for every minute of flight time.</p>
  358. <p>In general, input and output for most functions is decimal degrees, like coordinates are stowed in the airports table. Calculations are normally done using Radians. </p>
  359. </div>
  360. </div>
  361. <a id="a2d15bbb67e99d502e2fd730c47854a9f"></a>
  362. <h2 class="memtitle"><span class="permalink"><a href="#a2d15bbb67e99d502e2fd730c47854a9f">&#9670;&nbsp;</a></span>greatCircleDistanceBetweenAirports()</h2>
  363. <div class="memitem">
  364. <div class="memproto">
  365. <table class="memname">
  366. <tr>
  367. <td class="memname">double ACalc::greatCircleDistanceBetweenAirports </td>
  368. <td>(</td>
  369. <td class="paramtype">const QString &amp;&#160;</td>
  370. <td class="paramname"><em>dept</em>, </td>
  371. </tr>
  372. <tr>
  373. <td class="paramkey"></td>
  374. <td></td>
  375. <td class="paramtype">const QString &amp;&#160;</td>
  376. <td class="paramname"><em>dest</em>&#160;</td>
  377. </tr>
  378. <tr>
  379. <td></td>
  380. <td>)</td>
  381. <td></td><td></td>
  382. </tr>
  383. </table>
  384. </div><div class="memdoc">
  385. <p><a class="el" href="namespace_a_calc.html#a2d15bbb67e99d502e2fd730c47854a9f" title="ACalc::greatCircleDistanceBetweenAirports Calculates Great Circle distance between two coordinates,...">ACalc::greatCircleDistanceBetweenAirports</a> Calculates Great Circle distance between two coordinates, return in nautical miles. </p>
  386. <dl class="params"><dt>Parameters</dt><dd>
  387. <table class="params">
  388. <tr><td class="paramname">dept</td><td>ICAO 4-letter Airport Identifier </td></tr>
  389. <tr><td class="paramname">dest</td><td>ICAO 4-letter Airport Identifier </td></tr>
  390. </table>
  391. </dd>
  392. </dl>
  393. <dl class="section return"><dt>Returns</dt><dd>Nautical Miles From Departure to Destination </dd></dl>
  394. </div>
  395. </div>
  396. <a id="a4a071a5788f00c98834127f9c5721383"></a>
  397. <h2 class="memtitle"><span class="permalink"><a href="#a4a071a5788f00c98834127f9c5721383">&#9670;&nbsp;</a></span>intermediatePointsOnGreatCircle()</h2>
  398. <div class="memitem">
  399. <div class="memproto">
  400. <table class="memname">
  401. <tr>
  402. <td class="memname">QVector&lt; QVector&lt; double &gt; &gt; ACalc::intermediatePointsOnGreatCircle </td>
  403. <td>(</td>
  404. <td class="paramtype">double&#160;</td>
  405. <td class="paramname"><em>lat1</em>, </td>
  406. </tr>
  407. <tr>
  408. <td class="paramkey"></td>
  409. <td></td>
  410. <td class="paramtype">double&#160;</td>
  411. <td class="paramname"><em>lon1</em>, </td>
  412. </tr>
  413. <tr>
  414. <td class="paramkey"></td>
  415. <td></td>
  416. <td class="paramtype">double&#160;</td>
  417. <td class="paramname"><em>lat2</em>, </td>
  418. </tr>
  419. <tr>
  420. <td class="paramkey"></td>
  421. <td></td>
  422. <td class="paramtype">double&#160;</td>
  423. <td class="paramname"><em>lon2</em>, </td>
  424. </tr>
  425. <tr>
  426. <td class="paramkey"></td>
  427. <td></td>
  428. <td class="paramtype">int&#160;</td>
  429. <td class="paramname"><em>tblk</em>&#160;</td>
  430. </tr>
  431. <tr>
  432. <td></td>
  433. <td>)</td>
  434. <td></td><td></td>
  435. </tr>
  436. </table>
  437. </div><div class="memdoc">
  438. <p>Calculates a list of points (lat,lon) along the Great Circle between two points. The points are spaced equally, one minute of block time apart. </p>
  439. <dl class="params"><dt>Parameters</dt><dd>
  440. <table class="params">
  441. <tr><td class="paramname">lat1</td><td>Location Latitude in degrees -90:90 ;S(-) N(+) </td></tr>
  442. <tr><td class="paramname">lon1</td><td>Location Longitude in degrees -180:180 W(-) E(+) </td></tr>
  443. <tr><td class="paramname">lat2</td><td>Location Latitude in degrees -90:90 ;S(-) N(+) </td></tr>
  444. <tr><td class="paramname">lon2</td><td>Location Longitude in degrees -180:180 W(-) E(+) </td></tr>
  445. <tr><td class="paramname">tblk</td><td>Total Blocktime in minutes </td></tr>
  446. </table>
  447. </dd>
  448. </dl>
  449. <dl class="section return"><dt>Returns</dt><dd>coordinates {lat,lon} along the Great Circle Track </dd></dl>
  450. </div>
  451. </div>
  452. <a id="ac5e39b538ea3663556c820d237f242a2"></a>
  453. <h2 class="memtitle"><span class="permalink"><a href="#ac5e39b538ea3663556c820d237f242a2">&#9670;&nbsp;</a></span>minutesToString()</h2>
  454. <div class="memitem">
  455. <div class="memproto">
  456. <table class="mlabels">
  457. <tr>
  458. <td class="mlabels-left">
  459. <table class="memname">
  460. <tr>
  461. <td class="memname">QT_DEPRECATED QString ACalc::minutesToString </td>
  462. <td>(</td>
  463. <td class="paramtype">QString&#160;</td>
  464. <td class="paramname"><em>block_minutes</em></td><td>)</td>
  465. <td></td>
  466. </tr>
  467. </table>
  468. </td>
  469. <td class="mlabels-right">
  470. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  471. </tr>
  472. </table>
  473. </div><div class="memdoc">
  474. <p>ACalc::minutes_to_string Converts database time to String Time. </p>
  475. <dl class="params"><dt>Parameters</dt><dd>
  476. <table class="params">
  477. <tr><td class="paramname">blockminutes</td><td>from database </td></tr>
  478. </table>
  479. </dd>
  480. </dl>
  481. <dl class="section return"><dt>Returns</dt><dd>String hh:mm </dd></dl>
  482. </div>
  483. </div>
  484. <a id="a9568b0d72cd6b0f91f686342bc624e1f"></a>
  485. <h2 class="memtitle"><span class="permalink"><a href="#a9568b0d72cd6b0f91f686342bc624e1f">&#9670;&nbsp;</a></span>QTimeToMinutes()</h2>
  486. <div class="memitem">
  487. <div class="memproto">
  488. <table class="mlabels">
  489. <tr>
  490. <td class="mlabels-left">
  491. <table class="memname">
  492. <tr>
  493. <td class="memname">QT_DEPRECATED int ACalc::QTimeToMinutes </td>
  494. <td>(</td>
  495. <td class="paramtype">QTime&#160;</td>
  496. <td class="paramname"><em>time</em></td><td>)</td>
  497. <td></td>
  498. </tr>
  499. </table>
  500. </td>
  501. <td class="mlabels-right">
  502. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  503. </tr>
  504. </table>
  505. </div><div class="memdoc">
  506. <p>ACalc::time_to_minutes converts QTime to int minutes. </p>
  507. <dl class="params"><dt>Parameters</dt><dd>
  508. <table class="params">
  509. <tr><td class="paramname">time</td><td>QTime </td></tr>
  510. </table>
  511. </dd>
  512. </dl>
  513. <dl class="section return"><dt>Returns</dt><dd>int time as number of minutes </dd></dl>
  514. </div>
  515. </div>
  516. <a id="a2a540662e22840e4b58e8e760611b4f2"></a>
  517. <h2 class="memtitle"><span class="permalink"><a href="#a2a540662e22840e4b58e8e760611b4f2">&#9670;&nbsp;</a></span>radToDeg()</h2>
  518. <div class="memitem">
  519. <div class="memproto">
  520. <table class="mlabels">
  521. <tr>
  522. <td class="mlabels-left">
  523. <table class="memname">
  524. <tr>
  525. <td class="memname">double ACalc::radToDeg </td>
  526. <td>(</td>
  527. <td class="paramtype">double&#160;</td>
  528. <td class="paramname"><em>rad</em></td><td>)</td>
  529. <td></td>
  530. </tr>
  531. </table>
  532. </td>
  533. <td class="mlabels-right">
  534. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  535. </tr>
  536. </table>
  537. </div><div class="memdoc">
  538. <p>radToDeg Converts radians to degrees </p>
  539. <dl class="params"><dt>Parameters</dt><dd>
  540. <table class="params">
  541. <tr><td class="paramname">rad</td><td></td></tr>
  542. </table>
  543. </dd>
  544. </dl>
  545. <dl class="section return"><dt>Returns</dt><dd>degrees </dd></dl>
  546. </div>
  547. </div>
  548. <a id="a37c52e8b522b233087b8c4d94f30fca5"></a>
  549. <h2 class="memtitle"><span class="permalink"><a href="#a37c52e8b522b233087b8c4d94f30fca5">&#9670;&nbsp;</a></span>radToNauticalMiles()</h2>
  550. <div class="memitem">
  551. <div class="memproto">
  552. <table class="mlabels">
  553. <tr>
  554. <td class="mlabels-left">
  555. <table class="memname">
  556. <tr>
  557. <td class="memname">double ACalc::radToNauticalMiles </td>
  558. <td>(</td>
  559. <td class="paramtype">double&#160;</td>
  560. <td class="paramname"><em>rad</em></td><td>)</td>
  561. <td></td>
  562. </tr>
  563. </table>
  564. </td>
  565. <td class="mlabels-right">
  566. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  567. </tr>
  568. </table>
  569. </div><div class="memdoc">
  570. <p>radToNauticalMiles Convert Radians to nautical miles </p>
  571. <dl class="params"><dt>Parameters</dt><dd>
  572. <table class="params">
  573. <tr><td class="paramname">rad</td><td></td></tr>
  574. </table>
  575. </dd>
  576. </dl>
  577. <dl class="section return"><dt>Returns</dt><dd>nautical miles </dd></dl>
  578. </div>
  579. </div>
  580. <a id="acfa830e821e2f9e20bebffda67d393b1"></a>
  581. <h2 class="memtitle"><span class="permalink"><a href="#acfa830e821e2f9e20bebffda67d393b1">&#9670;&nbsp;</a></span>solarElevation()</h2>
  582. <div class="memitem">
  583. <div class="memproto">
  584. <table class="memname">
  585. <tr>
  586. <td class="memname">double ACalc::solarElevation </td>
  587. <td>(</td>
  588. <td class="paramtype">QDateTime&#160;</td>
  589. <td class="paramname"><em>utc_time_point</em>, </td>
  590. </tr>
  591. <tr>
  592. <td class="paramkey"></td>
  593. <td></td>
  594. <td class="paramtype">double&#160;</td>
  595. <td class="paramname"><em>lat</em>, </td>
  596. </tr>
  597. <tr>
  598. <td class="paramkey"></td>
  599. <td></td>
  600. <td class="paramtype">double&#160;</td>
  601. <td class="paramname"><em>lon</em>&#160;</td>
  602. </tr>
  603. <tr>
  604. <td></td>
  605. <td>)</td>
  606. <td></td><td></td>
  607. </tr>
  608. </table>
  609. </div><div class="memdoc">
  610. <p>Calculates solar elevation angle for a given point in time and latitude/longitude coordinates. </p>
  611. <p>It is based on the formulas found here: <a href="http://stjarnhimlen.se/comp/tutorial.html#5">http://stjarnhimlen.se/comp/tutorial.html#5</a></p>
  612. <p>Credit also goes to Darin C. Koblick for his matlab implementation of various of these formulas and to Kevin Godden for porting it to C++.</p>
  613. <p>Darin C. Koblock: <a href="https://www.mathworks.com/matlabcentral/profile/authors/1284781">https://www.mathworks.com/matlabcentral/profile/authors/1284781</a> Kevin Godden: <a href="https://www.ridgesolutions.ie/index.php/about-us/">https://www.ridgesolutions.ie/index.php/about-us/</a></p>
  614. <dl class="params"><dt>Parameters</dt><dd>
  615. <table class="params">
  616. <tr><td class="paramname">utc_time_point</td><td>- QDateTime (UTC) for which the elevation is Calculated </td></tr>
  617. <tr><td class="paramname">lat</td><td>- Location Latitude in degrees -90:90 ;S(-) N(+) </td></tr>
  618. <tr><td class="paramname">lon</td><td>- Location Longitude in degrees -180:180 W(-) E(+) </td></tr>
  619. </table>
  620. </dd>
  621. </dl>
  622. <dl class="section return"><dt>Returns</dt><dd>elevation - double of solar elevation in degrees. </dd></dl>
  623. </div>
  624. </div>
  625. <a id="a4c829bf747bcd84bf6b1efb3ab0201d1"></a>
  626. <h2 class="memtitle"><span class="permalink"><a href="#a4c829bf747bcd84bf6b1efb3ab0201d1">&#9670;&nbsp;</a></span>stringToMinutes()</h2>
  627. <div class="memitem">
  628. <div class="memproto">
  629. <table class="mlabels">
  630. <tr>
  631. <td class="mlabels-left">
  632. <table class="memname">
  633. <tr>
  634. <td class="memname">QT_DEPRECATED int ACalc::stringToMinutes </td>
  635. <td>(</td>
  636. <td class="paramtype">QString&#160;</td>
  637. <td class="paramname"><em>timestring</em></td><td>)</td>
  638. <td></td>
  639. </tr>
  640. </table>
  641. </td>
  642. <td class="mlabels-right">
  643. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  644. </tr>
  645. </table>
  646. </div><div class="memdoc">
  647. <p>ACalc::string_to_minutes Converts String Time to String Number of Minutes. </p>
  648. <dl class="params"><dt>Parameters</dt><dd>
  649. <table class="params">
  650. <tr><td class="paramname">timestring</td><td>"hh:mm" </td></tr>
  651. </table>
  652. </dd>
  653. </dl>
  654. <dl class="section return"><dt>Returns</dt><dd>String number of minutes </dd></dl>
  655. </div>
  656. </div>
  657. <a id="a3f12e1f72eeb5cc1cfe9b7b6df47391c"></a>
  658. <h2 class="memtitle"><span class="permalink"><a href="#a3f12e1f72eeb5cc1cfe9b7b6df47391c">&#9670;&nbsp;</a></span>updateAutoTimes()</h2>
  659. <div class="memitem">
  660. <div class="memproto">
  661. <table class="memname">
  662. <tr>
  663. <td class="memname">void ACalc::updateAutoTimes </td>
  664. <td>(</td>
  665. <td class="paramtype">int&#160;</td>
  666. <td class="paramname"><em>acft_id</em></td><td>)</td>
  667. <td></td>
  668. </tr>
  669. </table>
  670. </div><div class="memdoc">
  671. <p><a class="el" href="namespace_a_calc.html#a3f12e1f72eeb5cc1cfe9b7b6df47391c" title="ACalc::updateAutoTimes When the details of an aircraft are changed, this function recalculates deduct...">ACalc::updateAutoTimes</a> When the details of an aircraft are changed, this function recalculates deductable times for this aircraft and updates the database accordingly. </p>
  672. <dl class="params"><dt>Parameters</dt><dd>
  673. <table class="params">
  674. <tr><td class="paramname">acft</td><td>An aircraft object. </td></tr>
  675. </table>
  676. </dd>
  677. </dl>
  678. <dl class="section return"><dt>Returns</dt><dd></dd></dl>
  679. </div>
  680. </div>
  681. </div><!-- contents -->
  682. </div><!-- doc-content -->
  683. <!-- start footer part -->
  684. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  685. <ul>
  686. <li class="navelem"><a class="el" href="namespace_a_calc.html">ACalc</a></li>
  687. <li class="footer">Generated by
  688. <a href="http://www.doxygen.org/index.html">
  689. <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.18 </li>
  690. </ul>
  691. </div>
  692. </body>
  693. </html>