acalc_8h_source.html 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  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: src/functions/acalc.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.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('acalc_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">acalc.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-2021 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 ACALC_H</span></div>
  106. <div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="preprocessor">#define ACALC_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/alog.h&quot;</span></div>
  115. <div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="namespace_a_calc.html"> 34</a></span>&#160;<span class="keyword">namespace </span><a class="code" href="namespace_a_calc.html">ACalc</a> {</div>
  116. <div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; </div>
  117. <div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;QT_DEPRECATED</div>
  118. <div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="namespace_a_calc.html#a8ac68999097f2e28a3b4bd2709b5b19f"> 43</a></span>&#160;<span class="keyword">inline</span> QTime <a class="code" href="namespace_a_calc.html#a8ac68999097f2e28a3b4bd2709b5b19f">blocktime</a>(QTime tofb, QTime tonb)</div>
  119. <div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;{</div>
  120. <div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; QTime blocktime_out(0, 0); <span class="comment">// initialise return value at midnight</span></div>
  121. <div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; </div>
  122. <div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <span class="keywordflow">if</span> (tonb &gt; tofb) { <span class="comment">// landing same day</span></div>
  123. <div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; <span class="keywordtype">int</span> blockseconds = tofb.secsTo(tonb);</div>
  124. <div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; blocktime_out = blocktime_out.addSecs(blockseconds);</div>
  125. <div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; } <span class="keywordflow">else</span> { <span class="comment">// landing next day</span></div>
  126. <div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; QTime midnight(0, 0);</div>
  127. <div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <span class="keywordtype">int</span> blockseconds = tofb.secsTo(midnight);</div>
  128. <div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; blocktime_out = blocktime_out.addSecs(blockseconds);</div>
  129. <div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; blockseconds = midnight.secsTo(tonb);</div>
  130. <div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; blocktime_out = blocktime_out.addSecs(blockseconds);</div>
  131. <div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; }</div>
  132. <div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <span class="keywordflow">return</span> blocktime_out;</div>
  133. <div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;}</div>
  134. <div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;QT_DEPRECATED</div>
  135. <div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="namespace_a_calc.html#ac5e39b538ea3663556c820d237f242a2"> 65</a></span>&#160;<span class="keyword">inline</span> QString <a class="code" href="namespace_a_calc.html#ac5e39b538ea3663556c820d237f242a2">minutesToString</a>(QString block_minutes)</div>
  136. <div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;{</div>
  137. <div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <span class="keywordtype">int</span> minutes = block_minutes.toInt();</div>
  138. <div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; QString hour = QString::number(minutes / 60);</div>
  139. <div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="keywordflow">if</span> (hour.size() &lt; 2) {</div>
  140. <div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; hour.prepend(<span class="stringliteral">&quot;0&quot;</span>);</div>
  141. <div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; }</div>
  142. <div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; QString minute = QString::number(minutes % 60);</div>
  143. <div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keywordflow">if</span> (minute.size() &lt; 2) {</div>
  144. <div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; minute.prepend(<span class="stringliteral">&quot;0&quot;</span>);</div>
  145. <div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; }</div>
  146. <div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; QString block_time = hour + <span class="stringliteral">&quot;:&quot;</span> + minute;</div>
  147. <div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="keywordflow">return</span> block_time;</div>
  148. <div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;};</div>
  149. <div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; </div>
  150. <div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;QT_DEPRECATED</div>
  151. <div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;<span class="keyword">inline</span> QString <a class="code" href="namespace_a_calc.html#ac5e39b538ea3663556c820d237f242a2">minutesToString</a>(<span class="keywordtype">int</span> block_minutes)</div>
  152. <div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;{</div>
  153. <div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; QString hour = QString::number(block_minutes / 60);</div>
  154. <div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keywordflow">if</span> (hour.size() &lt; 2) {</div>
  155. <div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; hour.prepend(<span class="stringliteral">&quot;0&quot;</span>);</div>
  156. <div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; }</div>
  157. <div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; QString minute = QString::number(block_minutes % 60);</div>
  158. <div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <span class="keywordflow">if</span> (minute.size() &lt; 2) {</div>
  159. <div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; minute.prepend(<span class="stringliteral">&quot;0&quot;</span>);</div>
  160. <div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; }</div>
  161. <div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; QString <a class="code" href="namespace_a_calc.html#a8ac68999097f2e28a3b4bd2709b5b19f">blocktime</a> = hour + <span class="stringliteral">&quot;:&quot;</span> + minute;</div>
  162. <div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="keywordflow">return</span> <a class="code" href="namespace_a_calc.html#a8ac68999097f2e28a3b4bd2709b5b19f">blocktime</a>;</div>
  163. <div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160;};</div>
  164. <div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; </div>
  165. <div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;QT_DEPRECATED</div>
  166. <div class="line"><a name="l00101"></a><span class="lineno"><a class="line" href="namespace_a_calc.html#a9568b0d72cd6b0f91f686342bc624e1f"> 101</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="namespace_a_calc.html#a9568b0d72cd6b0f91f686342bc624e1f">QTimeToMinutes</a>(QTime time)</div>
  167. <div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;{</div>
  168. <div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; QString timestring = time.toString(<span class="stringliteral">&quot;hh:mm&quot;</span>);</div>
  169. <div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <span class="keywordtype">int</span> minutes = (timestring.left(2).toInt()) * 60;</div>
  170. <div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; minutes += timestring.right(2).toInt();</div>
  171. <div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; <span class="keywordflow">return</span> minutes;</div>
  172. <div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;}</div>
  173. <div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; </div>
  174. <div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160;QT_DEPRECATED</div>
  175. <div class="line"><a name="l00115"></a><span class="lineno"><a class="line" href="namespace_a_calc.html#a4c829bf747bcd84bf6b1efb3ab0201d1"> 115</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="namespace_a_calc.html#a4c829bf747bcd84bf6b1efb3ab0201d1">stringToMinutes</a>(QString timestring)</div>
  176. <div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;{</div>
  177. <div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="keywordtype">int</span> minutes = (timestring.left(2).toInt()) * 60;</div>
  178. <div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; minutes += timestring.right(2).toInt();</div>
  179. <div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; timestring = QString::number(minutes);</div>
  180. <div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <span class="keywordflow">return</span> minutes;</div>
  181. <div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;}</div>
  182. <div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; </div>
  183. <div class="line"><a name="l00128"></a><span class="lineno"><a class="line" href="namespace_a_calc.html#a2a540662e22840e4b58e8e760611b4f2"> 128</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="namespace_a_calc.html#a2a540662e22840e4b58e8e760611b4f2">radToDeg</a>(<span class="keywordtype">double</span> rad)</div>
  184. <div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;{</div>
  185. <div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="keywordtype">double</span> deg = rad * (180 / M_PI);</div>
  186. <div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="keywordflow">return</span> deg;</div>
  187. <div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;}</div>
  188. <div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; </div>
  189. <div class="line"><a name="l00139"></a><span class="lineno"><a class="line" href="namespace_a_calc.html#acafe6c0bede38e737937e2062fd93c71"> 139</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="namespace_a_calc.html#acafe6c0bede38e737937e2062fd93c71">degToRad</a>(<span class="keywordtype">double</span> deg)</div>
  190. <div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;{</div>
  191. <div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; <span class="keywordtype">double</span> rad = deg * (M_PI / 180);</div>
  192. <div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <span class="keywordflow">return</span> rad;</div>
  193. <div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160;}</div>
  194. <div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; </div>
  195. <div class="line"><a name="l00150"></a><span class="lineno"><a class="line" href="namespace_a_calc.html#a37c52e8b522b233087b8c4d94f30fca5"> 150</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="namespace_a_calc.html#a37c52e8b522b233087b8c4d94f30fca5">radToNauticalMiles</a>(<span class="keywordtype">double</span> rad)</div>
  196. <div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;{</div>
  197. <div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; <span class="keywordtype">double</span> nm = rad * 3440.06479482;</div>
  198. <div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <span class="keywordflow">return</span> nm;</div>
  199. <div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160;}</div>
  200. <div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; </div>
  201. <div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160;<span class="keywordtype">double</span> <a class="code" href="namespace_a_calc.html#a72c6fca35602a24ff8435f86abdc78d7">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>
  202. <div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; </div>
  203. <div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160;<span class="keywordtype">double</span> <a class="code" href="namespace_a_calc.html#a2d15bbb67e99d502e2fd730c47854a9f">greatCircleDistanceBetweenAirports</a>(<span class="keyword">const</span> QString &amp;dept, <span class="keyword">const</span> QString &amp;dest);</div>
  204. <div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; </div>
  205. <div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160;QVector&lt;QVector&lt;double&gt;&gt; <a class="code" href="namespace_a_calc.html#a4a071a5788f00c98834127f9c5721383">intermediatePointsOnGreatCircle</a>(<span class="keywordtype">double</span> lat1,</div>
  206. <div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <span class="keywordtype">double</span> lon1,</div>
  207. <div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; <span class="keywordtype">double</span> lat2,</div>
  208. <div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; <span class="keywordtype">double</span> lon2,</div>
  209. <div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <span class="keywordtype">int</span> tblk);</div>
  210. <div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160;<span class="keywordtype">double</span> <a class="code" href="namespace_a_calc.html#acfa830e821e2f9e20bebffda67d393b1">solarElevation</a>(QDateTime utc_time_point, <span class="keywordtype">double</span> lat, <span class="keywordtype">double</span> lon);</div>
  211. <div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; </div>
  212. <div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160;<span class="keywordtype">int</span> <a class="code" href="namespace_a_calc.html#a55ede99d0f9f6e8a2f3a467859c0f192">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>
  213. <div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; </div>
  214. <div class="line"><a name="l00220"></a><span class="lineno"> 220</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>
  215. <div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; </div>
  216. <div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160;QString <a class="code" href="namespace_a_calc.html#ad088e5dd93d1938ff97f88032dc0adec">formatTimeInput</a>(QString user_input);</div>
  217. <div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; </div>
  218. <div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespace_a_calc.html#a3f12e1f72eeb5cc1cfe9b7b6df47391c">updateAutoTimes</a>(<span class="keywordtype">int</span> acft_id);</div>
  219. <div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; </div>
  220. <div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespace_a_calc.html#adb7a8a84011affb4173bb59be4449b9d">updateNightTimes</a>();</div>
  221. <div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160;} <span class="comment">// namespace ACalc</span></div>
  222. <div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; </div>
  223. <div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160;<span class="preprocessor">#endif // ACALC_H</span></div>
  224. </div><!-- fragment --></div><!-- contents -->
  225. </div><!-- doc-content -->
  226. <div class="ttc" id="anamespace_a_calc_html_a4a071a5788f00c98834127f9c5721383"><div class="ttname"><a href="namespace_a_calc.html#a4a071a5788f00c98834127f9c5721383">ACalc::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> acalc.cpp:136</div></div>
  227. <div class="ttc" id="anamespace_a_calc_html_a9568b0d72cd6b0f91f686342bc624e1f"><div class="ttname"><a href="namespace_a_calc.html#a9568b0d72cd6b0f91f686342bc624e1f">ACalc::QTimeToMinutes</a></div><div class="ttdeci">QT_DEPRECATED int QTimeToMinutes(QTime time)</div><div class="ttdoc">ACalc::time_to_minutes converts QTime to int minutes.</div><div class="ttdef"><b>Definition:</b> acalc.h:101</div></div>
  228. <div class="ttc" id="anamespace_a_calc_html_a3f12e1f72eeb5cc1cfe9b7b6df47391c"><div class="ttname"><a href="namespace_a_calc.html#a3f12e1f72eeb5cc1cfe9b7b6df47391c">ACalc::updateAutoTimes</a></div><div class="ttdeci">void updateAutoTimes(int acft_id)</div><div class="ttdoc">ACalc::updateAutoTimes When the details of an aircraft are changed, this function recalculates deduct...</div><div class="ttdef"><b>Definition:</b> acalc.cpp:288</div></div>
  229. <div class="ttc" id="anamespace_a_calc_html_ac5e39b538ea3663556c820d237f242a2"><div class="ttname"><a href="namespace_a_calc.html#ac5e39b538ea3663556c820d237f242a2">ACalc::minutesToString</a></div><div class="ttdeci">QT_DEPRECATED QString minutesToString(QString block_minutes)</div><div class="ttdoc">ACalc::minutes_to_string Converts database time to String Time.</div><div class="ttdef"><b>Definition:</b> acalc.h:65</div></div>
  230. <div class="ttc" id="anamespace_a_calc_html_a37c52e8b522b233087b8c4d94f30fca5"><div class="ttname"><a href="namespace_a_calc.html#a37c52e8b522b233087b8c4d94f30fca5">ACalc::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> acalc.h:150</div></div>
  231. <div class="ttc" id="anamespace_a_calc_html"><div class="ttname"><a href="namespace_a_calc.html">ACalc</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> acalc.h:34</div></div>
  232. <div class="ttc" id="anamespace_a_calc_html_a8ac68999097f2e28a3b4bd2709b5b19f"><div class="ttname"><a href="namespace_a_calc.html#a8ac68999097f2e28a3b4bd2709b5b19f">ACalc::blocktime</a></div><div class="ttdeci">QT_DEPRECATED QTime blocktime(QTime tofb, QTime tonb)</div><div class="ttdoc">ACalc::blocktime Calculates Block Time for a given departure and arrival time.</div><div class="ttdef"><b>Definition:</b> acalc.h:43</div></div>
  233. <div class="ttc" id="anamespace_a_calc_html_ad088e5dd93d1938ff97f88032dc0adec"><div class="ttname"><a href="namespace_a_calc.html#ad088e5dd93d1938ff97f88032dc0adec">ACalc::formatTimeInput</a></div><div class="ttdeci">QString formatTimeInput(QString user_input)</div><div class="ttdoc">ACalc::formatTimeInput verifies user input and formats to hh:mm if the output is not a valid time,...</div><div class="ttdef"><b>Definition:</b> acalc.cpp:34</div></div>
  234. <div class="ttc" id="anamespace_a_calc_html_acafe6c0bede38e737937e2062fd93c71"><div class="ttname"><a href="namespace_a_calc.html#acafe6c0bede38e737937e2062fd93c71">ACalc::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> acalc.h:139</div></div>
  235. <div class="ttc" id="anamespace_a_calc_html_a2a540662e22840e4b58e8e760611b4f2"><div class="ttname"><a href="namespace_a_calc.html#a2a540662e22840e4b58e8e760611b4f2">ACalc::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> acalc.h:128</div></div>
  236. <div class="ttc" id="anamespace_a_calc_html_a2d15bbb67e99d502e2fd730c47854a9f"><div class="ttname"><a href="namespace_a_calc.html#a2d15bbb67e99d502e2fd730c47854a9f">ACalc::greatCircleDistanceBetweenAirports</a></div><div class="ttdeci">double greatCircleDistanceBetweenAirports(const QString &amp;dept, const QString &amp;dest)</div><div class="ttdoc">ACalc::greatCircleDistanceBetweenAirports Calculates Great Circle distance between two coordinates,...</div><div class="ttdef"><b>Definition:</b> acalc.cpp:106</div></div>
  237. <div class="ttc" id="anamespace_a_calc_html_acfa830e821e2f9e20bebffda67d393b1"><div class="ttname"><a href="namespace_a_calc.html#acfa830e821e2f9e20bebffda67d393b1">ACalc::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> acalc.cpp:167</div></div>
  238. <div class="ttc" id="anamespace_a_calc_html_a4c829bf747bcd84bf6b1efb3ab0201d1"><div class="ttname"><a href="namespace_a_calc.html#a4c829bf747bcd84bf6b1efb3ab0201d1">ACalc::stringToMinutes</a></div><div class="ttdeci">QT_DEPRECATED int stringToMinutes(QString timestring)</div><div class="ttdoc">ACalc::string_to_minutes Converts String Time to String Number of Minutes.</div><div class="ttdef"><b>Definition:</b> acalc.h:115</div></div>
  239. <div class="ttc" id="anamespace_a_calc_html_a72c6fca35602a24ff8435f86abdc78d7"><div class="ttname"><a href="namespace_a_calc.html#a72c6fca35602a24ff8435f86abdc78d7">ACalc::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> acalc.cpp:87</div></div>
  240. <div class="ttc" id="anamespace_a_calc_html_adb7a8a84011affb4173bb59be4449b9d"><div class="ttname"><a href="namespace_a_calc.html#adb7a8a84011affb4173bb59be4449b9d">ACalc::updateNightTimes</a></div><div class="ttdeci">void updateNightTimes()</div><div class="ttdoc">ACalc::updateNightTimes updates the night times in the database, used when changing night angle setti...</div><div class="ttdef"><b>Definition:</b> acalc.cpp:331</div></div>
  241. <div class="ttc" id="anamespace_a_calc_html_a55ede99d0f9f6e8a2f3a467859c0f192"><div class="ttname"><a href="namespace_a_calc.html#a55ede99d0f9f6e8a2f3a467859c0f192">ACalc::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> acalc.cpp:227</div></div>
  242. <!-- start footer part -->
  243. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  244. <ul>
  245. <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>acalc.h</b></li>
  246. <li class="footer">Generated by
  247. <a href="http://www.doxygen.org/index.html">
  248. <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.18 </li>
  249. </ul>
  250. </div>
  251. </body>
  252. </html>