calc_8h_source.html 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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: src/functions/calc.h Source File</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('calc_8h_source.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="headertitle">
  85. <div class="title">calc.h</div> </div>
  86. </div><!--header-->
  87. <div class="contents">
  88. <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div>
  89. <div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> *openPilotLog - A FOSS Pilot Logbook Application</span></div>
  90. <div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *Copyright (C) 2020-2022 Felix Turowsky</span></div>
  91. <div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> *</span></div>
  92. <div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *This program is free software: you can redistribute it and/or modify</span></div>
  93. <div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> *it under the terms of the GNU General Public License as published by</span></div>
  94. <div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *the Free Software Foundation, either version 3 of the License, or</span></div>
  95. <div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> *(at your option) any later version.</span></div>
  96. <div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> *</span></div>
  97. <div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> *This program is distributed in the hope that it will be useful,</span></div>
  98. <div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
  99. <div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></div>
  100. <div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *GNU General Public License for more details.</span></div>
  101. <div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> *</span></div>
  102. <div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> *You should have received a copy of the GNU General Public License</span></div>
  103. <div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> *along with this program. If not, see &lt;https://www.gnu.org/licenses/&gt;.</span></div>
  104. <div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> */</span></div>
  105. <div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="preprocessor">#ifndef CALC_H</span></div>
  106. <div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="preprocessor">#define CALC_H</span></div>
  107. <div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160; </div>
  108. <div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#ifdef _MSC_VER</span></div>
  109. <div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#define _USE_MATH_DEFINES</span></div>
  110. <div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#endif</span></div>
  111. <div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#include &lt;cmath&gt;</span></div>
  112. <div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &lt;QDateTime&gt;</span></div>
  113. <div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &lt;QDebug&gt;</span></div>
  114. <div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;src/functions/time.h&quot;</span></div>
  115. <div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="namespace_o_p_l_1_1_calc.html"> 34</a></span>&#160;<span class="keyword">namespace </span><a class="code" href="namespace_o_p_l_1_1_calc.html">OPL::Calc</a> {</div>
  116. <div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; </div>
  117. <div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="namespace_o_p_l_1_1_calc.html#ae4b929bd19437f7e9e5da48e484c3d78"> 41</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="namespace_o_p_l_1_1_calc.html#ae4b929bd19437f7e9e5da48e484c3d78">radToDeg</a>(<span class="keywordtype">double</span> rad)</div>
  118. <div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;{</div>
  119. <div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <span class="keywordtype">double</span> deg = rad * (180 / M_PI);</div>
  120. <div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; <span class="keywordflow">return</span> deg;</div>
  121. <div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;}</div>
  122. <div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; </div>
  123. <div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="namespace_o_p_l_1_1_calc.html#a19aa0f77d99530368d804fb5aac7095c"> 52</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="namespace_o_p_l_1_1_calc.html#a19aa0f77d99530368d804fb5aac7095c">degToRad</a>(<span class="keywordtype">double</span> deg)</div>
  124. <div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;{</div>
  125. <div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; <span class="keywordtype">double</span> rad = deg * (M_PI / 180);</div>
  126. <div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="keywordflow">return</span> rad;</div>
  127. <div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;}</div>
  128. <div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; </div>
  129. <div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="namespace_o_p_l_1_1_calc.html#a54af04cfc491c441e8f000c8a9c85a5d"> 63</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="namespace_o_p_l_1_1_calc.html#a54af04cfc491c441e8f000c8a9c85a5d">radToNauticalMiles</a>(<span class="keywordtype">double</span> rad)</div>
  130. <div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;{</div>
  131. <div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <span class="keywordtype">double</span> nm = rad * 3440.06479482;</div>
  132. <div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keywordflow">return</span> nm;</div>
  133. <div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;}</div>
  134. <div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; </div>
  135. <div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;<span class="keywordtype">double</span> <a class="code" href="namespace_o_p_l_1_1_calc.html#af98171551ab57f5a1857f84fa31cd64e">greatCircleDistance</a>(<span class="keywordtype">double</span> lat1, <span class="keywordtype">double</span> lon1, <span class="keywordtype">double</span> lat2, <span class="keywordtype">double</span> lon2);</div>
  136. <div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; </div>
  137. <div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;<span class="keywordtype">double</span> <a class="code" href="namespace_o_p_l_1_1_calc.html#a0d6ee1592d78a15f8a37fb5ba16b2840">greatCircleDistanceBetweenAirports</a>(<span class="keyword">const</span> QString &amp;dept, <span class="keyword">const</span> QString &amp;dest);</div>
  138. <div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; </div>
  139. <div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;QVector&lt;QVector&lt;double&gt;&gt; <a class="code" href="namespace_o_p_l_1_1_calc.html#a800630d9c6833c9707bdf3f8dfbdd63e">intermediatePointsOnGreatCircle</a>(<span class="keywordtype">double</span> lat1,</div>
  140. <div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="keywordtype">double</span> lon1,</div>
  141. <div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="keywordtype">double</span> lat2,</div>
  142. <div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; <span class="keywordtype">double</span> lon2,</div>
  143. <div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <span class="keywordtype">int</span> tblk);</div>
  144. <div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;<span class="keywordtype">double</span> <a class="code" href="namespace_o_p_l_1_1_calc.html#aad346a109dd40d2ce9363577386ec4e2">solarElevation</a>(QDateTime utc_time_point, <span class="keywordtype">double</span> lat, <span class="keywordtype">double</span> lon);</div>
  145. <div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; </div>
  146. <div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;<span class="keywordtype">int</span> <a class="code" href="namespace_o_p_l_1_1_calc.html#a12ab4061d7d8849b12bec02ada5cdcd7">calculateNightTime</a>(<span class="keyword">const</span> QString &amp;dept, <span class="keyword">const</span> QString &amp;dest, QDateTime departureTime, <span class="keywordtype">int</span> tblk, <span class="keywordtype">int</span> nightAngle);</div>
  147. <div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; </div>
  148. <div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;<span class="keywordtype">bool</span> isNight(<span class="keyword">const</span> QString &amp;icao, QDateTime event_time, <span class="keywordtype">int</span> night_angle);</div>
  149. <div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; </div>
  150. <div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;QString <a class="code" href="namespace_o_p_l_1_1_calc.html#a268b46842ac1389c26b1631da6bb18b0">formatTimeInput</a>(QString user_input);</div>
  151. <div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; </div>
  152. <div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespace_o_p_l_1_1_calc.html#a0b69f903cde75ff19eff54d880bb8c33">updateAutoTimes</a>(<span class="keywordtype">int</span> acft_id);</div>
  153. <div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; </div>
  154. <div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespace_o_p_l_1_1_calc.html#a1e7c96710acec446476bb110d24f8a43">updateNightTimes</a>();</div>
  155. <div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; </div>
  156. <div class="line"><a name="l00144"></a><span class="lineno"><a class="line" href="struct_o_p_l_1_1_calc_1_1_night_time_values.html"> 144</a></span>&#160;<span class="keyword">struct </span><a class="code" href="struct_o_p_l_1_1_calc_1_1_night_time_values.html">NightTimeValues</a>{</div>
  157. <div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; <a class="code" href="struct_o_p_l_1_1_calc_1_1_night_time_values.html">NightTimeValues</a>() = <span class="keyword">delete</span>;</div>
  158. <div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <a class="code" href="struct_o_p_l_1_1_calc_1_1_night_time_values.html">NightTimeValues</a>(<span class="keyword">const</span> QString&amp; dept, <span class="keyword">const</span> QString&amp; dest, <span class="keyword">const</span> QDateTime&amp; departure_time, <span class="keywordtype">int</span> block_minutes, <span class="keywordtype">int</span> night_angle)</div>
  159. <div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; {</div>
  160. <div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; nightMinutes = <a class="code" href="namespace_o_p_l_1_1_calc.html#a12ab4061d7d8849b12bec02ada5cdcd7">calculateNightTime</a>(dept, dest, departure_time, block_minutes, night_angle);</div>
  161. <div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; </div>
  162. <div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; nightTime = OPL::Time::qTimefromMinutes(nightMinutes);</div>
  163. <div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; totalTime = OPL::Time::qTimefromMinutes(block_minutes);</div>
  164. <div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; </div>
  165. <div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <span class="keywordflow">if</span> (nightMinutes == 0) { <span class="comment">// all day</span></div>
  166. <div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; takeOffNight = <span class="keyword">false</span>;</div>
  167. <div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; landingNight = <span class="keyword">false</span>;</div>
  168. <div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; }</div>
  169. <div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (nightMinutes == block_minutes) { <span class="comment">// all night</span></div>
  170. <div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; takeOffNight = <span class="keyword">true</span>;</div>
  171. <div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; landingNight = <span class="keyword">true</span>;</div>
  172. <div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; } <span class="keywordflow">else</span> {</div>
  173. <div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <span class="keywordflow">if</span>(isNight(dept, departure_time, night_angle))</div>
  174. <div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; takeOffNight = <span class="keyword">true</span>;</div>
  175. <div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <span class="keywordflow">else</span></div>
  176. <div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; takeOffNight = <span class="keyword">false</span>;</div>
  177. <div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; <span class="keywordflow">if</span>(isNight(dest, departure_time.addSecs(block_minutes * 60), night_angle))</div>
  178. <div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; landingNight = <span class="keyword">true</span>;</div>
  179. <div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <span class="keywordflow">else</span></div>
  180. <div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; landingNight = <span class="keyword">false</span>;</div>
  181. <div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; }</div>
  182. <div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; </div>
  183. <div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; };</div>
  184. <div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; <a class="code" href="struct_o_p_l_1_1_calc_1_1_night_time_values.html">NightTimeValues</a>(<span class="keywordtype">bool</span> to_night, <span class="keywordtype">bool</span> ldg_night, <span class="keywordtype">int</span> night_minutes, QTime night_time, QTime total_time)</div>
  185. <div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; : takeOffNight(to_night), landingNight(ldg_night), nightMinutes(night_minutes), nightTime(night_time), totalTime(total_time){};</div>
  186. <div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <span class="keywordtype">bool</span> takeOffNight;</div>
  187. <div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <span class="keywordtype">bool</span> landingNight;</div>
  188. <div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <span class="keywordtype">int</span> nightMinutes;</div>
  189. <div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; QTime nightTime;</div>
  190. <div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; QTime totalTime;</div>
  191. <div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; </div>
  192. <div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <span class="keyword">inline</span> <span class="keywordtype">bool</span> isAllDay() {<span class="keywordflow">return</span> (!takeOffNight &amp;&amp; !landingNight);}</div>
  193. <div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="keyword">inline</span> <span class="keywordtype">bool</span> isAllNight() {<span class="keywordflow">return</span> ( takeOffNight &amp;&amp; landingNight);}</div>
  194. <div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; <span class="keyword">inline</span> <span class="keywordtype">bool</span> isDayToNight() {<span class="keywordflow">return</span> (!takeOffNight &amp;&amp; landingNight);}</div>
  195. <div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="keyword">inline</span> <span class="keywordtype">bool</span> isNightToDay() {<span class="keywordflow">return</span> ( takeOffNight &amp;&amp; !landingNight);}</div>
  196. <div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160;};</div>
  197. <div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; </div>
  198. <div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; </div>
  199. <div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160;} <span class="comment">// namespace OPL::Calc</span></div>
  200. <div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; </div>
  201. <div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160;<span class="preprocessor">#endif </span><span class="comment">// CALC_H</span></div>
  202. <div class="ttc" id="anamespace_o_p_l_1_1_calc_html"><div class="ttname"><a href="namespace_o_p_l_1_1_calc.html">OPL::Calc</a></div><div class="ttdoc">The ACalc namespace provides various functions for calculations that are performed outside of the dat...</div><div class="ttdef"><b>Definition:</b> calc.h:34</div></div>
  203. <div class="ttc" id="anamespace_o_p_l_1_1_calc_html_a0b69f903cde75ff19eff54d880bb8c33"><div class="ttname"><a href="namespace_o_p_l_1_1_calc.html#a0b69f903cde75ff19eff54d880bb8c33">OPL::Calc::updateAutoTimes</a></div><div class="ttdeci">void updateAutoTimes(int acft_id)</div><div class="ttdoc">OPL::Calc::updateAutoTimes When the details of an aircraft are changed, this function recalculates de...</div><div class="ttdef"><b>Definition:</b> calc.cpp:301</div></div>
  204. <div class="ttc" id="anamespace_o_p_l_1_1_calc_html_a0d6ee1592d78a15f8a37fb5ba16b2840"><div class="ttname"><a href="namespace_o_p_l_1_1_calc.html#a0d6ee1592d78a15f8a37fb5ba16b2840">OPL::Calc::greatCircleDistanceBetweenAirports</a></div><div class="ttdeci">double greatCircleDistanceBetweenAirports(const QString &amp;dept, const QString &amp;dest)</div><div class="ttdoc">Opl::Calc::greatCircleDistanceBetweenAirports Calculates Great Circle distance between two coordinate...</div><div class="ttdef"><b>Definition:</b> calc.cpp:103</div></div>
  205. <div class="ttc" id="anamespace_o_p_l_1_1_calc_html_a12ab4061d7d8849b12bec02ada5cdcd7"><div class="ttname"><a href="namespace_o_p_l_1_1_calc.html#a12ab4061d7d8849b12bec02ada5cdcd7">OPL::Calc::calculateNightTime</a></div><div class="ttdeci">int calculateNightTime(const QString &amp;dept, const QString &amp;dest, QDateTime departureTime, int tblk, int nightAngle)</div><div class="ttdoc">Calculates which portion of a flight was conducted in night conditions.</div><div class="ttdef"><b>Definition:</b> calc.cpp:226</div></div>
  206. <div class="ttc" id="anamespace_o_p_l_1_1_calc_html_a19aa0f77d99530368d804fb5aac7095c"><div class="ttname"><a href="namespace_o_p_l_1_1_calc.html#a19aa0f77d99530368d804fb5aac7095c">OPL::Calc::degToRad</a></div><div class="ttdeci">double degToRad(double deg)</div><div class="ttdoc">degToRad Converts degrees to radians</div><div class="ttdef"><b>Definition:</b> calc.h:52</div></div>
  207. <div class="ttc" id="anamespace_o_p_l_1_1_calc_html_a1e7c96710acec446476bb110d24f8a43"><div class="ttname"><a href="namespace_o_p_l_1_1_calc.html#a1e7c96710acec446476bb110d24f8a43">OPL::Calc::updateNightTimes</a></div><div class="ttdeci">void updateNightTimes()</div><div class="ttdoc">OPL::Calc::updateNightTimes updates the night times in the database, used when changing night angle s...</div><div class="ttdef"><b>Definition:</b> calc.cpp:344</div></div>
  208. <div class="ttc" id="anamespace_o_p_l_1_1_calc_html_a268b46842ac1389c26b1631da6bb18b0"><div class="ttname"><a href="namespace_o_p_l_1_1_calc.html#a268b46842ac1389c26b1631da6bb18b0">OPL::Calc::formatTimeInput</a></div><div class="ttdeci">QString formatTimeInput(QString user_input)</div><div class="ttdoc">OPL::Calc::formatTimeInput verifies user input and formats to hh:mm if the output is not a valid time...</div><div class="ttdef"><b>Definition:</b> calc.cpp:31</div></div>
  209. <div class="ttc" id="anamespace_o_p_l_1_1_calc_html_a54af04cfc491c441e8f000c8a9c85a5d"><div class="ttname"><a href="namespace_o_p_l_1_1_calc.html#a54af04cfc491c441e8f000c8a9c85a5d">OPL::Calc::radToNauticalMiles</a></div><div class="ttdeci">double radToNauticalMiles(double rad)</div><div class="ttdoc">radToNauticalMiles Convert Radians to nautical miles</div><div class="ttdef"><b>Definition:</b> calc.h:63</div></div>
  210. <div class="ttc" id="anamespace_o_p_l_1_1_calc_html_a800630d9c6833c9707bdf3f8dfbdd63e"><div class="ttname"><a href="namespace_o_p_l_1_1_calc.html#a800630d9c6833c9707bdf3f8dfbdd63e">OPL::Calc::intermediatePointsOnGreatCircle</a></div><div class="ttdeci">QVector&lt; QVector&lt; double &gt; &gt; intermediatePointsOnGreatCircle(double lat1, double lon1, double lat2, double lon2, int tblk)</div><div class="ttdoc">Calculates a list of points (lat,lon) along the Great Circle between two points. The points are space...</div><div class="ttdef"><b>Definition:</b> calc.cpp:133</div></div>
  211. <div class="ttc" id="anamespace_o_p_l_1_1_calc_html_aad346a109dd40d2ce9363577386ec4e2"><div class="ttname"><a href="namespace_o_p_l_1_1_calc.html#aad346a109dd40d2ce9363577386ec4e2">OPL::Calc::solarElevation</a></div><div class="ttdeci">double solarElevation(QDateTime utc_time_point, double lat, double lon)</div><div class="ttdoc">Calculates solar elevation angle for a given point in time and latitude/longitude coordinates.</div><div class="ttdef"><b>Definition:</b> calc.cpp:167</div></div>
  212. <div class="ttc" id="anamespace_o_p_l_1_1_calc_html_ae4b929bd19437f7e9e5da48e484c3d78"><div class="ttname"><a href="namespace_o_p_l_1_1_calc.html#ae4b929bd19437f7e9e5da48e484c3d78">OPL::Calc::radToDeg</a></div><div class="ttdeci">double radToDeg(double rad)</div><div class="ttdoc">radToDeg Converts radians to degrees</div><div class="ttdef"><b>Definition:</b> calc.h:41</div></div>
  213. <div class="ttc" id="anamespace_o_p_l_1_1_calc_html_af98171551ab57f5a1857f84fa31cd64e"><div class="ttname"><a href="namespace_o_p_l_1_1_calc.html#af98171551ab57f5a1857f84fa31cd64e">OPL::Calc::greatCircleDistance</a></div><div class="ttdeci">double greatCircleDistance(double lat1, double lon1, double lat2, double lon2)</div><div class="ttdoc">greatCircleDistance Calculates Great Circle distance between two coordinates, return in Radians.</div><div class="ttdef"><b>Definition:</b> calc.cpp:84</div></div>
  214. <div class="ttc" id="astruct_o_p_l_1_1_calc_1_1_night_time_values_html"><div class="ttname"><a href="struct_o_p_l_1_1_calc_1_1_night_time_values.html">OPL::Calc::NightTimeValues</a></div><div class="ttdoc">The NightTimeValues struct encapsulates values relating to night time that are needed by the NewFligh...</div><div class="ttdef"><b>Definition:</b> calc.h:144</div></div>
  215. </div><!-- fragment --></div><!-- contents -->
  216. </div><!-- doc-content -->
  217. <!-- start footer part -->
  218. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  219. <ul>
  220. <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_e823141bb13a34caac0c96ccd0d33fcf.html">functions</a></li><li class="navelem"><b>calc.h</b></li>
  221. <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>
  222. </ul>
  223. </div>
  224. </body>
  225. </html>