namespace_o_p_l_1_1_calc.html 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577
  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.9.1"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>openPilotLog: OPL::Calc 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.9.1 -->
  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','.html');
  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_o_p_l_1_1_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="#nested-classes">Classes</a> &#124;
  86. <a href="#func-members">Functions</a> </div>
  87. <div class="headertitle">
  88. <div class="title">OPL::Calc Namespace Reference</div> </div>
  89. </div><!--header-->
  90. <div class="contents">
  91. <p>The ACalc 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.
  92. <a href="namespace_o_p_l_1_1_calc.html#details">More...</a></p>
  93. <table class="memberdecls">
  94. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
  95. Classes</h2></td></tr>
  96. <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_o_p_l_1_1_calc_1_1_night_time_values.html">NightTimeValues</a></td></tr>
  97. <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">The <a class="el" href="struct_o_p_l_1_1_calc_1_1_night_time_values.html" title="The NightTimeValues struct encapsulates values relating to night time that are needed by the NewFligh...">NightTimeValues</a> struct encapsulates values relating to night time that are needed by the <a class="el" href="class_new_flight_dialog.html" title="The NewFlightDialog is used to add or edit entries from the flights table in the database.">NewFlightDialog</a>. <a href="struct_o_p_l_1_1_calc_1_1_night_time_values.html#details">More...</a><br /></td></tr>
  98. <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
  99. </table><table class="memberdecls">
  100. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
  101. Functions</h2></td></tr>
  102. <tr class="memitem:ae4b929bd19437f7e9e5da48e484c3d78"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_o_p_l_1_1_calc.html#ae4b929bd19437f7e9e5da48e484c3d78">radToDeg</a> (double rad)</td></tr>
  103. <tr class="memdesc:ae4b929bd19437f7e9e5da48e484c3d78"><td class="mdescLeft">&#160;</td><td class="mdescRight">radToDeg Converts radians to degrees <a href="namespace_o_p_l_1_1_calc.html#ae4b929bd19437f7e9e5da48e484c3d78">More...</a><br /></td></tr>
  104. <tr class="separator:ae4b929bd19437f7e9e5da48e484c3d78"><td class="memSeparator" colspan="2">&#160;</td></tr>
  105. <tr class="memitem:a19aa0f77d99530368d804fb5aac7095c"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_o_p_l_1_1_calc.html#a19aa0f77d99530368d804fb5aac7095c">degToRad</a> (double deg)</td></tr>
  106. <tr class="memdesc:a19aa0f77d99530368d804fb5aac7095c"><td class="mdescLeft">&#160;</td><td class="mdescRight">degToRad Converts degrees to radians <a href="namespace_o_p_l_1_1_calc.html#a19aa0f77d99530368d804fb5aac7095c">More...</a><br /></td></tr>
  107. <tr class="separator:a19aa0f77d99530368d804fb5aac7095c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  108. <tr class="memitem:a54af04cfc491c441e8f000c8a9c85a5d"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_o_p_l_1_1_calc.html#a54af04cfc491c441e8f000c8a9c85a5d">radToNauticalMiles</a> (double rad)</td></tr>
  109. <tr class="memdesc:a54af04cfc491c441e8f000c8a9c85a5d"><td class="mdescLeft">&#160;</td><td class="mdescRight">radToNauticalMiles Convert Radians to nautical miles <a href="namespace_o_p_l_1_1_calc.html#a54af04cfc491c441e8f000c8a9c85a5d">More...</a><br /></td></tr>
  110. <tr class="separator:a54af04cfc491c441e8f000c8a9c85a5d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  111. <tr class="memitem:af98171551ab57f5a1857f84fa31cd64e"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_o_p_l_1_1_calc.html#af98171551ab57f5a1857f84fa31cd64e">greatCircleDistance</a> (double lat1, double lon1, double lat2, double lon2)</td></tr>
  112. <tr class="memdesc:af98171551ab57f5a1857f84fa31cd64e"><td class="mdescLeft">&#160;</td><td class="mdescRight">greatCircleDistance Calculates Great Circle distance between two coordinates, return in Radians. <a href="namespace_o_p_l_1_1_calc.html#af98171551ab57f5a1857f84fa31cd64e">More...</a><br /></td></tr>
  113. <tr class="separator:af98171551ab57f5a1857f84fa31cd64e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  114. <tr class="memitem:a0d6ee1592d78a15f8a37fb5ba16b2840"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_o_p_l_1_1_calc.html#a0d6ee1592d78a15f8a37fb5ba16b2840">greatCircleDistanceBetweenAirports</a> (const QString &amp;dept, const QString &amp;dest)</td></tr>
  115. <tr class="memdesc:a0d6ee1592d78a15f8a37fb5ba16b2840"><td class="mdescLeft">&#160;</td><td class="mdescRight">Opl::Calc::greatCircleDistanceBetweenAirports Calculates Great Circle distance between two coordinates, return in nautical miles. <a href="namespace_o_p_l_1_1_calc.html#a0d6ee1592d78a15f8a37fb5ba16b2840">More...</a><br /></td></tr>
  116. <tr class="separator:a0d6ee1592d78a15f8a37fb5ba16b2840"><td class="memSeparator" colspan="2">&#160;</td></tr>
  117. <tr class="memitem:a800630d9c6833c9707bdf3f8dfbdd63e"><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_o_p_l_1_1_calc.html#a800630d9c6833c9707bdf3f8dfbdd63e">intermediatePointsOnGreatCircle</a> (double lat1, double lon1, double lat2, double lon2, int tblk)</td></tr>
  118. <tr class="memdesc:a800630d9c6833c9707bdf3f8dfbdd63e"><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_o_p_l_1_1_calc.html#a800630d9c6833c9707bdf3f8dfbdd63e">More...</a><br /></td></tr>
  119. <tr class="separator:a800630d9c6833c9707bdf3f8dfbdd63e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  120. <tr class="memitem:aad346a109dd40d2ce9363577386ec4e2"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_o_p_l_1_1_calc.html#aad346a109dd40d2ce9363577386ec4e2">solarElevation</a> (QDateTime utc_time_point, double lat, double lon)</td></tr>
  121. <tr class="memdesc:aad346a109dd40d2ce9363577386ec4e2"><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_o_p_l_1_1_calc.html#aad346a109dd40d2ce9363577386ec4e2">More...</a><br /></td></tr>
  122. <tr class="separator:aad346a109dd40d2ce9363577386ec4e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
  123. <tr class="memitem:a12ab4061d7d8849b12bec02ada5cdcd7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_o_p_l_1_1_calc.html#a12ab4061d7d8849b12bec02ada5cdcd7">calculateNightTime</a> (const QString &amp;dept, const QString &amp;dest, QDateTime departureTime, int tblk, int nightAngle)</td></tr>
  124. <tr class="memdesc:a12ab4061d7d8849b12bec02ada5cdcd7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates which portion of a flight was conducted in night conditions. <a href="namespace_o_p_l_1_1_calc.html#a12ab4061d7d8849b12bec02ada5cdcd7">More...</a><br /></td></tr>
  125. <tr class="separator:a12ab4061d7d8849b12bec02ada5cdcd7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  126. <tr class="memitem:ad8796e08642fb3e3021bd96630070523"><td class="memItemLeft" align="right" valign="top"><a id="ad8796e08642fb3e3021bd96630070523"></a>
  127. bool&#160;</td><td class="memItemRight" valign="bottom"><b>isNight</b> (const QString &amp;icao, QDateTime event_time, int night_angle)</td></tr>
  128. <tr class="separator:ad8796e08642fb3e3021bd96630070523"><td class="memSeparator" colspan="2">&#160;</td></tr>
  129. <tr class="memitem:a268b46842ac1389c26b1631da6bb18b0"><td class="memItemLeft" align="right" valign="top">QString&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_o_p_l_1_1_calc.html#a268b46842ac1389c26b1631da6bb18b0">formatTimeInput</a> (QString user_input)</td></tr>
  130. <tr class="memdesc:a268b46842ac1389c26b1631da6bb18b0"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="namespace_o_p_l_1_1_calc.html#a268b46842ac1389c26b1631da6bb18b0" title="OPL::Calc::formatTimeInput verifies user input and formats to hh:mm if the output is not a valid time...">OPL::Calc::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_o_p_l_1_1_calc.html#a268b46842ac1389c26b1631da6bb18b0">More...</a><br /></td></tr>
  131. <tr class="separator:a268b46842ac1389c26b1631da6bb18b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  132. <tr class="memitem:a0b69f903cde75ff19eff54d880bb8c33"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_o_p_l_1_1_calc.html#a0b69f903cde75ff19eff54d880bb8c33">updateAutoTimes</a> (int acft_id)</td></tr>
  133. <tr class="memdesc:a0b69f903cde75ff19eff54d880bb8c33"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="namespace_o_p_l_1_1_calc.html#a0b69f903cde75ff19eff54d880bb8c33" title="OPL::Calc::updateAutoTimes When the details of an aircraft are changed, this function recalculates de...">OPL::Calc::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_o_p_l_1_1_calc.html#a0b69f903cde75ff19eff54d880bb8c33">More...</a><br /></td></tr>
  134. <tr class="separator:a0b69f903cde75ff19eff54d880bb8c33"><td class="memSeparator" colspan="2">&#160;</td></tr>
  135. <tr class="memitem:a1e7c96710acec446476bb110d24f8a43"><td class="memItemLeft" align="right" valign="top"><a id="a1e7c96710acec446476bb110d24f8a43"></a>
  136. void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_o_p_l_1_1_calc.html#a1e7c96710acec446476bb110d24f8a43">updateNightTimes</a> ()</td></tr>
  137. <tr class="memdesc:a1e7c96710acec446476bb110d24f8a43"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="namespace_o_p_l_1_1_calc.html#a1e7c96710acec446476bb110d24f8a43" title="OPL::Calc::updateNightTimes updates the night times in the database, used when changing night angle s...">OPL::Calc::updateNightTimes</a> updates the night times in the database, used when changing night angle setting for example. <br /></td></tr>
  138. <tr class="separator:a1e7c96710acec446476bb110d24f8a43"><td class="memSeparator" colspan="2">&#160;</td></tr>
  139. </table>
  140. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  141. <div class="textblock"><p>The ACalc 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>
  142. </div><h2 class="groupheader">Function Documentation</h2>
  143. <a id="a12ab4061d7d8849b12bec02ada5cdcd7"></a>
  144. <h2 class="memtitle"><span class="permalink"><a href="#a12ab4061d7d8849b12bec02ada5cdcd7">&#9670;&nbsp;</a></span>calculateNightTime()</h2>
  145. <div class="memitem">
  146. <div class="memproto">
  147. <table class="memname">
  148. <tr>
  149. <td class="memname">int OPL::Calc::calculateNightTime </td>
  150. <td>(</td>
  151. <td class="paramtype">const QString &amp;&#160;</td>
  152. <td class="paramname"><em>dept</em>, </td>
  153. </tr>
  154. <tr>
  155. <td class="paramkey"></td>
  156. <td></td>
  157. <td class="paramtype">const QString &amp;&#160;</td>
  158. <td class="paramname"><em>dest</em>, </td>
  159. </tr>
  160. <tr>
  161. <td class="paramkey"></td>
  162. <td></td>
  163. <td class="paramtype">QDateTime&#160;</td>
  164. <td class="paramname"><em>departureTime</em>, </td>
  165. </tr>
  166. <tr>
  167. <td class="paramkey"></td>
  168. <td></td>
  169. <td class="paramtype">int&#160;</td>
  170. <td class="paramname"><em>tblk</em>, </td>
  171. </tr>
  172. <tr>
  173. <td class="paramkey"></td>
  174. <td></td>
  175. <td class="paramtype">int&#160;</td>
  176. <td class="paramname"><em>nightAngle</em>&#160;</td>
  177. </tr>
  178. <tr>
  179. <td></td>
  180. <td>)</td>
  181. <td></td><td></td>
  182. </tr>
  183. </table>
  184. </div><div class="memdoc">
  185. <p>Calculates which portion of a flight was conducted in night conditions. </p>
  186. <dl class="params"><dt>Parameters</dt><dd>
  187. <table class="params">
  188. <tr><td class="paramname">dept</td><td>- ICAO 4-letter code of Departure Airport </td></tr>
  189. <tr><td class="paramname">dest</td><td>- ICAO 4-letter Code of Destination Airport </td></tr>
  190. <tr><td class="paramname">departureTime</td><td>- QDateTime of Departure (UTC) </td></tr>
  191. <tr><td class="paramname">tblk</td><td>- Total block time in minutes </td></tr>
  192. <tr><td class="paramname">nightAngle</td><td>- the solar elevation angle where night conditons exist. Default -6 (end of civil evening twilight) </td></tr>
  193. </table>
  194. </dd>
  195. </dl>
  196. <dl class="section return"><dt>Returns</dt><dd>Total number of minutes under night flying conditions </dd></dl>
  197. </div>
  198. </div>
  199. <a id="a19aa0f77d99530368d804fb5aac7095c"></a>
  200. <h2 class="memtitle"><span class="permalink"><a href="#a19aa0f77d99530368d804fb5aac7095c">&#9670;&nbsp;</a></span>degToRad()</h2>
  201. <div class="memitem">
  202. <div class="memproto">
  203. <table class="mlabels">
  204. <tr>
  205. <td class="mlabels-left">
  206. <table class="memname">
  207. <tr>
  208. <td class="memname">double OPL::Calc::degToRad </td>
  209. <td>(</td>
  210. <td class="paramtype">double&#160;</td>
  211. <td class="paramname"><em>deg</em></td><td>)</td>
  212. <td></td>
  213. </tr>
  214. </table>
  215. </td>
  216. <td class="mlabels-right">
  217. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  218. </tr>
  219. </table>
  220. </div><div class="memdoc">
  221. <p>degToRad Converts degrees to radians </p>
  222. <dl class="params"><dt>Parameters</dt><dd>
  223. <table class="params">
  224. <tr><td class="paramname">deg</td><td></td></tr>
  225. </table>
  226. </dd>
  227. </dl>
  228. <dl class="section return"><dt>Returns</dt><dd>radians </dd></dl>
  229. </div>
  230. </div>
  231. <a id="a268b46842ac1389c26b1631da6bb18b0"></a>
  232. <h2 class="memtitle"><span class="permalink"><a href="#a268b46842ac1389c26b1631da6bb18b0">&#9670;&nbsp;</a></span>formatTimeInput()</h2>
  233. <div class="memitem">
  234. <div class="memproto">
  235. <table class="memname">
  236. <tr>
  237. <td class="memname">QT_DEPRECATED QString OPL::Calc::formatTimeInput </td>
  238. <td>(</td>
  239. <td class="paramtype">QString&#160;</td>
  240. <td class="paramname"><em>user_input</em></td><td>)</td>
  241. <td></td>
  242. </tr>
  243. </table>
  244. </div><div class="memdoc">
  245. <p><a class="el" href="namespace_o_p_l_1_1_calc.html#a268b46842ac1389c26b1631da6bb18b0" title="OPL::Calc::formatTimeInput verifies user input and formats to hh:mm if the output is not a valid time...">OPL::Calc::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>
  246. <dl class="params"><dt>Parameters</dt><dd>
  247. <table class="params">
  248. <tr><td class="paramname">userinput</td><td>from a QLineEdit </td></tr>
  249. </table>
  250. </dd>
  251. </dl>
  252. <dl class="section return"><dt>Returns</dt><dd>formatted QString "hh:mm" or Empty String </dd></dl>
  253. </div>
  254. </div>
  255. <a id="af98171551ab57f5a1857f84fa31cd64e"></a>
  256. <h2 class="memtitle"><span class="permalink"><a href="#af98171551ab57f5a1857f84fa31cd64e">&#9670;&nbsp;</a></span>greatCircleDistance()</h2>
  257. <div class="memitem">
  258. <div class="memproto">
  259. <table class="memname">
  260. <tr>
  261. <td class="memname">double OPL::Calc::greatCircleDistance </td>
  262. <td>(</td>
  263. <td class="paramtype">double&#160;</td>
  264. <td class="paramname"><em>lat1</em>, </td>
  265. </tr>
  266. <tr>
  267. <td class="paramkey"></td>
  268. <td></td>
  269. <td class="paramtype">double&#160;</td>
  270. <td class="paramname"><em>lon1</em>, </td>
  271. </tr>
  272. <tr>
  273. <td class="paramkey"></td>
  274. <td></td>
  275. <td class="paramtype">double&#160;</td>
  276. <td class="paramname"><em>lat2</em>, </td>
  277. </tr>
  278. <tr>
  279. <td class="paramkey"></td>
  280. <td></td>
  281. <td class="paramtype">double&#160;</td>
  282. <td class="paramname"><em>lon2</em>&#160;</td>
  283. </tr>
  284. <tr>
  285. <td></td>
  286. <td>)</td>
  287. <td></td><td></td>
  288. </tr>
  289. </table>
  290. </div><div class="memdoc">
  291. <p>greatCircleDistance Calculates Great Circle distance between two coordinates, return in Radians. </p>
  292. <dl class="params"><dt>Parameters</dt><dd>
  293. <table class="params">
  294. <tr><td class="paramname">lat1</td><td>Location Latitude in degrees -90:90 ;S(-) N(+) </td></tr>
  295. <tr><td class="paramname">lon1</td><td>Location Longitude in degrees -180:180 W(-) E(+) </td></tr>
  296. <tr><td class="paramname">lat2</td><td>Location Latitude in degrees -90:90 ;S(-) N(+) </td></tr>
  297. <tr><td class="paramname">lon2</td><td>Location Longitude in degrees -180:180 W(-) E(+) </td></tr>
  298. </table>
  299. </dd>
  300. </dl>
  301. <dl class="section return"><dt>Returns</dt><dd></dd></dl>
  302. <p>The purpose of the following functions is to provide functionality enabling the Calculation of night flying time. EASA defines night as follows:</p>
  303. <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>
  304. <p>This is the proccess of Calculating night time in this program:</p>
  305. <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>
  306. <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>
  307. <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>
  308. </div>
  309. </div>
  310. <a id="a0d6ee1592d78a15f8a37fb5ba16b2840"></a>
  311. <h2 class="memtitle"><span class="permalink"><a href="#a0d6ee1592d78a15f8a37fb5ba16b2840">&#9670;&nbsp;</a></span>greatCircleDistanceBetweenAirports()</h2>
  312. <div class="memitem">
  313. <div class="memproto">
  314. <table class="memname">
  315. <tr>
  316. <td class="memname">double OPL::Calc::greatCircleDistanceBetweenAirports </td>
  317. <td>(</td>
  318. <td class="paramtype">const QString &amp;&#160;</td>
  319. <td class="paramname"><em>dept</em>, </td>
  320. </tr>
  321. <tr>
  322. <td class="paramkey"></td>
  323. <td></td>
  324. <td class="paramtype">const QString &amp;&#160;</td>
  325. <td class="paramname"><em>dest</em>&#160;</td>
  326. </tr>
  327. <tr>
  328. <td></td>
  329. <td>)</td>
  330. <td></td><td></td>
  331. </tr>
  332. </table>
  333. </div><div class="memdoc">
  334. <p>Opl::Calc::greatCircleDistanceBetweenAirports Calculates Great Circle distance between two coordinates, return in nautical miles. </p>
  335. <dl class="params"><dt>Parameters</dt><dd>
  336. <table class="params">
  337. <tr><td class="paramname">dept</td><td>ICAO 4-letter Airport Identifier </td></tr>
  338. <tr><td class="paramname">dest</td><td>ICAO 4-letter Airport Identifier </td></tr>
  339. </table>
  340. </dd>
  341. </dl>
  342. <dl class="section return"><dt>Returns</dt><dd>Nautical Miles From Departure to Destination </dd></dl>
  343. </div>
  344. </div>
  345. <a id="a800630d9c6833c9707bdf3f8dfbdd63e"></a>
  346. <h2 class="memtitle"><span class="permalink"><a href="#a800630d9c6833c9707bdf3f8dfbdd63e">&#9670;&nbsp;</a></span>intermediatePointsOnGreatCircle()</h2>
  347. <div class="memitem">
  348. <div class="memproto">
  349. <table class="memname">
  350. <tr>
  351. <td class="memname">QVector&lt; QVector&lt; double &gt; &gt; OPL::Calc::intermediatePointsOnGreatCircle </td>
  352. <td>(</td>
  353. <td class="paramtype">double&#160;</td>
  354. <td class="paramname"><em>lat1</em>, </td>
  355. </tr>
  356. <tr>
  357. <td class="paramkey"></td>
  358. <td></td>
  359. <td class="paramtype">double&#160;</td>
  360. <td class="paramname"><em>lon1</em>, </td>
  361. </tr>
  362. <tr>
  363. <td class="paramkey"></td>
  364. <td></td>
  365. <td class="paramtype">double&#160;</td>
  366. <td class="paramname"><em>lat2</em>, </td>
  367. </tr>
  368. <tr>
  369. <td class="paramkey"></td>
  370. <td></td>
  371. <td class="paramtype">double&#160;</td>
  372. <td class="paramname"><em>lon2</em>, </td>
  373. </tr>
  374. <tr>
  375. <td class="paramkey"></td>
  376. <td></td>
  377. <td class="paramtype">int&#160;</td>
  378. <td class="paramname"><em>tblk</em>&#160;</td>
  379. </tr>
  380. <tr>
  381. <td></td>
  382. <td>)</td>
  383. <td></td><td></td>
  384. </tr>
  385. </table>
  386. </div><div class="memdoc">
  387. <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>
  388. <dl class="params"><dt>Parameters</dt><dd>
  389. <table class="params">
  390. <tr><td class="paramname">lat1</td><td>Location Latitude in degrees -90:90 ;S(-) N(+) </td></tr>
  391. <tr><td class="paramname">lon1</td><td>Location Longitude in degrees -180:180 W(-) E(+) </td></tr>
  392. <tr><td class="paramname">lat2</td><td>Location Latitude in degrees -90:90 ;S(-) N(+) </td></tr>
  393. <tr><td class="paramname">lon2</td><td>Location Longitude in degrees -180:180 W(-) E(+) </td></tr>
  394. <tr><td class="paramname">tblk</td><td>Total Blocktime in minutes </td></tr>
  395. </table>
  396. </dd>
  397. </dl>
  398. <dl class="section return"><dt>Returns</dt><dd>coordinates {lat,lon} along the Great Circle Track </dd></dl>
  399. </div>
  400. </div>
  401. <a id="ae4b929bd19437f7e9e5da48e484c3d78"></a>
  402. <h2 class="memtitle"><span class="permalink"><a href="#ae4b929bd19437f7e9e5da48e484c3d78">&#9670;&nbsp;</a></span>radToDeg()</h2>
  403. <div class="memitem">
  404. <div class="memproto">
  405. <table class="mlabels">
  406. <tr>
  407. <td class="mlabels-left">
  408. <table class="memname">
  409. <tr>
  410. <td class="memname">double OPL::Calc::radToDeg </td>
  411. <td>(</td>
  412. <td class="paramtype">double&#160;</td>
  413. <td class="paramname"><em>rad</em></td><td>)</td>
  414. <td></td>
  415. </tr>
  416. </table>
  417. </td>
  418. <td class="mlabels-right">
  419. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  420. </tr>
  421. </table>
  422. </div><div class="memdoc">
  423. <p>radToDeg Converts radians to degrees </p>
  424. <dl class="params"><dt>Parameters</dt><dd>
  425. <table class="params">
  426. <tr><td class="paramname">rad</td><td></td></tr>
  427. </table>
  428. </dd>
  429. </dl>
  430. <dl class="section return"><dt>Returns</dt><dd>degrees </dd></dl>
  431. </div>
  432. </div>
  433. <a id="a54af04cfc491c441e8f000c8a9c85a5d"></a>
  434. <h2 class="memtitle"><span class="permalink"><a href="#a54af04cfc491c441e8f000c8a9c85a5d">&#9670;&nbsp;</a></span>radToNauticalMiles()</h2>
  435. <div class="memitem">
  436. <div class="memproto">
  437. <table class="mlabels">
  438. <tr>
  439. <td class="mlabels-left">
  440. <table class="memname">
  441. <tr>
  442. <td class="memname">double OPL::Calc::radToNauticalMiles </td>
  443. <td>(</td>
  444. <td class="paramtype">double&#160;</td>
  445. <td class="paramname"><em>rad</em></td><td>)</td>
  446. <td></td>
  447. </tr>
  448. </table>
  449. </td>
  450. <td class="mlabels-right">
  451. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  452. </tr>
  453. </table>
  454. </div><div class="memdoc">
  455. <p>radToNauticalMiles Convert Radians to nautical miles </p>
  456. <dl class="params"><dt>Parameters</dt><dd>
  457. <table class="params">
  458. <tr><td class="paramname">rad</td><td></td></tr>
  459. </table>
  460. </dd>
  461. </dl>
  462. <dl class="section return"><dt>Returns</dt><dd>nautical miles </dd></dl>
  463. </div>
  464. </div>
  465. <a id="aad346a109dd40d2ce9363577386ec4e2"></a>
  466. <h2 class="memtitle"><span class="permalink"><a href="#aad346a109dd40d2ce9363577386ec4e2">&#9670;&nbsp;</a></span>solarElevation()</h2>
  467. <div class="memitem">
  468. <div class="memproto">
  469. <table class="memname">
  470. <tr>
  471. <td class="memname">double OPL::Calc::solarElevation </td>
  472. <td>(</td>
  473. <td class="paramtype">QDateTime&#160;</td>
  474. <td class="paramname"><em>utc_time_point</em>, </td>
  475. </tr>
  476. <tr>
  477. <td class="paramkey"></td>
  478. <td></td>
  479. <td class="paramtype">double&#160;</td>
  480. <td class="paramname"><em>lat</em>, </td>
  481. </tr>
  482. <tr>
  483. <td class="paramkey"></td>
  484. <td></td>
  485. <td class="paramtype">double&#160;</td>
  486. <td class="paramname"><em>lon</em>&#160;</td>
  487. </tr>
  488. <tr>
  489. <td></td>
  490. <td>)</td>
  491. <td></td><td></td>
  492. </tr>
  493. </table>
  494. </div><div class="memdoc">
  495. <p>Calculates solar elevation angle for a given point in time and latitude/longitude coordinates. </p>
  496. <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>
  497. <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>
  498. <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>
  499. <dl class="params"><dt>Parameters</dt><dd>
  500. <table class="params">
  501. <tr><td class="paramname">utc_time_point</td><td>- QDateTime (UTC) for which the elevation is Calculated </td></tr>
  502. <tr><td class="paramname">lat</td><td>- Location Latitude in degrees -90:90 ;S(-) N(+) </td></tr>
  503. <tr><td class="paramname">lon</td><td>- Location Longitude in degrees -180:180 W(-) E(+) </td></tr>
  504. </table>
  505. </dd>
  506. </dl>
  507. <dl class="section return"><dt>Returns</dt><dd>elevation - double of solar elevation in degrees. </dd></dl>
  508. </div>
  509. </div>
  510. <a id="a0b69f903cde75ff19eff54d880bb8c33"></a>
  511. <h2 class="memtitle"><span class="permalink"><a href="#a0b69f903cde75ff19eff54d880bb8c33">&#9670;&nbsp;</a></span>updateAutoTimes()</h2>
  512. <div class="memitem">
  513. <div class="memproto">
  514. <table class="memname">
  515. <tr>
  516. <td class="memname">void OPL::Calc::updateAutoTimes </td>
  517. <td>(</td>
  518. <td class="paramtype">int&#160;</td>
  519. <td class="paramname"><em>acft_id</em></td><td>)</td>
  520. <td></td>
  521. </tr>
  522. </table>
  523. </div><div class="memdoc">
  524. <p><a class="el" href="namespace_o_p_l_1_1_calc.html#a0b69f903cde75ff19eff54d880bb8c33" title="OPL::Calc::updateAutoTimes When the details of an aircraft are changed, this function recalculates de...">OPL::Calc::updateAutoTimes</a> When the details of an aircraft are changed, this function recalculates deductable times for this aircraft and updates the database accordingly. </p>
  525. <dl class="params"><dt>Parameters</dt><dd>
  526. <table class="params">
  527. <tr><td class="paramname">acft</td><td>An aircraft object. </td></tr>
  528. </table>
  529. </dd>
  530. </dl>
  531. <dl class="section return"><dt>Returns</dt><dd></dd></dl>
  532. </div>
  533. </div>
  534. </div><!-- contents -->
  535. </div><!-- doc-content -->
  536. <!-- start footer part -->
  537. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  538. <ul>
  539. <li class="navelem"><a class="el" href="namespace_o_p_l.html">OPL</a></li><li class="navelem"><a class="el" href="namespace_o_p_l_1_1_calc.html">Calc</a></li>
  540. <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  541. </ul>
  542. </div>
  543. </body>
  544. </html>