@@ -36,6 +36,10 @@ discard block |
||
36 | 36 | /* the year 1999 assuming that two-digit years in the range 00-56 */ |
37 | 37 | /* correspond to 2000-2056. Until the two-line element set format */ |
38 | 38 | /* is changed, it is only valid for dates through 2056 December 31. */ |
39 | + |
|
40 | + /** |
|
41 | + * @param double $epoch |
|
42 | + */ |
|
39 | 43 | public static function Julian_Date_of_Epoch($epoch) |
40 | 44 | { |
41 | 45 | $year = 0; |
@@ -54,6 +58,11 @@ discard block |
||
54 | 58 | } |
55 | 59 | |
56 | 60 | /* Equivalent to the C modf function */ |
61 | + |
|
62 | + /** |
|
63 | + * @param double $x |
|
64 | + * @param integer $ipart |
|
65 | + */ |
|
57 | 66 | public static function modf($x, &$ipart) { |
58 | 67 | $ipart = (int)$x; |
59 | 68 | return $x - $ipart; |
@@ -63,6 +72,10 @@ discard block |
||
63 | 72 | /* of Day 0.0 of {year}. This function is used to calculate the */ |
64 | 73 | /* Julian Date of any date by using Julian_Date_of_Year, DOY, */ |
65 | 74 | /* and Fraction_of_Day. */ |
75 | + |
|
76 | + /** |
|
77 | + * @param integer $year |
|
78 | + */ |
|
66 | 79 | public static function Julian_Date_of_Year($year) |
67 | 80 | { |
68 | 81 | /* Astronomical Formulae for Calculators, Jean Meeus, */ |
@@ -85,6 +98,10 @@ discard block |
||
85 | 98 | /* 1999, as described above. The function ThetaG_JD provides the */ |
86 | 99 | /* same calculation except that it is based on an input in the */ |
87 | 100 | /* form of a Julian Date. */ |
101 | + |
|
102 | + /** |
|
103 | + * @param double $epoch |
|
104 | + */ |
|
88 | 105 | public static function ThetaG($epoch, Predict_DeepArg $deep_arg) |
89 | 106 | { |
90 | 107 | /* Reference: The 1992 Astronomical Almanac, page B6. */ |
@@ -157,6 +174,10 @@ discard block |
||
157 | 174 | /* (approximately the same as UTC) and ET (now referred to as TDT).*/ |
158 | 175 | /* This function is based on a least squares fit of data from 1950 */ |
159 | 176 | /* to 1991 and will need to be updated periodically. */ |
177 | + |
|
178 | + /** |
|
179 | + * @param double $year |
|
180 | + */ |
|
160 | 181 | public static function Delta_ET($year) |
161 | 182 | { |
162 | 183 | /* Values determined using data from 1950-1991 in the 1990 |
@@ -204,7 +225,7 @@ discard block |
||
204 | 225 | * |
205 | 226 | * @param Predict_TLE $tle The TLE object |
206 | 227 | * |
207 | - * @return int |
|
228 | + * @return double |
|
208 | 229 | */ |
209 | 230 | public static function getEpochTimeStamp(Predict_TLE $tle) |
210 | 231 | { |
@@ -1098,6 +1098,10 @@ discard block |
||
1098 | 1098 | else return array(); |
1099 | 1099 | } |
1100 | 1100 | |
1101 | + /** |
|
1102 | + * @param string $type |
|
1103 | + * @param string $rules |
|
1104 | + */ |
|
1101 | 1105 | public function addNOTAM($ref,$title,$type,$fir,$code,$rules,$scope,$lower_limit,$upper_limit,$center_latitude,$center_longitude,$radius,$date_begin,$date_end,$permanent,$text,$full_notam) { |
1102 | 1106 | $query = "INSERT INTO notam (ref,title,notam_type,fir,code,rules,scope,lower_limit,upper_limit,center_latitude,center_longitude,radius,date_begin,date_end,permanent,notam_text,full_notam) VALUES (:ref,:title,:type,:fir,:code,:rules,:scope,:lower_limit,:upper_limit,:center_latitude,:center_longitude,:radius,:date_begin,:date_end,:permanent,:text,:full_notam)"; |
1103 | 1107 | $query_values = array(':ref' => $ref,':title' => $title,':type' => $type,':fir' => $fir,':code' => $code,':rules' => $rules,':scope' => $scope,':lower_limit' => $lower_limit,':upper_limit' => $upper_limit,':center_latitude' => $center_latitude,':center_longitude' => $center_longitude,':radius' => $radius,':date_begin' => $date_begin,':date_end' => $date_end,':permanent' => $permanent,':text' => $text,':full_notam' => $full_notam); |
@@ -1179,6 +1183,10 @@ discard block |
||
1179 | 1183 | } |
1180 | 1184 | } |
1181 | 1185 | } |
1186 | + |
|
1187 | + /** |
|
1188 | + * @param string $filename |
|
1189 | + */ |
|
1182 | 1190 | public function updateNOTAMfromTextFile($filename) { |
1183 | 1191 | $alldata = $this->parseNOTAMtextFile($filename); |
1184 | 1192 | if (count($alldata) > 0) { |
@@ -1223,6 +1231,9 @@ discard block |
||
1223 | 1231 | } |
1224 | 1232 | } |
1225 | 1233 | |
1234 | + /** |
|
1235 | + * @param string $icao |
|
1236 | + */ |
|
1226 | 1237 | public function downloadNOTAM($icao) { |
1227 | 1238 | date_default_timezone_set("UTC"); |
1228 | 1239 | $Common = new Common(); |
@@ -1359,6 +1370,9 @@ discard block |
||
1359 | 1370 | return $result; |
1360 | 1371 | } |
1361 | 1372 | |
1373 | + /** |
|
1374 | + * @param string $code |
|
1375 | + */ |
|
1362 | 1376 | public function parse_code($code) { |
1363 | 1377 | $code = str_split($code); |
1364 | 1378 | $code_fp = $code[1].$code[2]; |
@@ -179,6 +179,10 @@ discard block |
||
179 | 179 | return 1; |
180 | 180 | } |
181 | 181 | |
182 | + /** |
|
183 | + * @param double $lat |
|
184 | + * @param integer $isodd |
|
185 | + */ |
|
182 | 186 | public function cprN($lat,$isodd) { |
183 | 187 | $nl = $this->cprNL($lat) - $isodd; |
184 | 188 | if ($nl > 1) return $nl; |
@@ -186,6 +190,10 @@ discard block |
||
186 | 190 | } |
187 | 191 | |
188 | 192 | |
193 | + /** |
|
194 | + * @param string $msg |
|
195 | + * @param string $bin |
|
196 | + */ |
|
189 | 197 | function parityCheck($msg, $bin) { |
190 | 198 | $modes_checksum_table = array( |
191 | 199 | 0x3935ea, 0x1c9af5, 0xf1b77e, 0x78dbbf, 0xc397db, 0x9e31e9, 0xb0e2f0, 0x587178, |
@@ -40,6 +40,10 @@ |
||
40 | 40 | } |
41 | 41 | } |
42 | 42 | |
43 | + /** |
|
44 | + * @param string $id |
|
45 | + * @param string $ident |
|
46 | + */ |
|
43 | 47 | public function get_Schedule($id,$ident) { |
44 | 48 | global $globalDebug, $globalFork, $globalSchedulesFetch; |
45 | 49 | // Get schedule here, so it's done only one time |
@@ -125,6 +125,9 @@ discard block |
||
125 | 125 | public $tag_start = 0; |
126 | 126 | private $dom = null; |
127 | 127 | |
128 | + /** |
|
129 | + * @param simple_html_dom $dom |
|
130 | + */ |
|
128 | 131 | function __construct($dom) |
129 | 132 | { |
130 | 133 | $this->dom = $dom; |
@@ -1501,6 +1504,11 @@ discard block |
||
1501 | 1504 | } |
1502 | 1505 | |
1503 | 1506 | // parse attributes |
1507 | + |
|
1508 | + /** |
|
1509 | + * @param simple_html_dom_node $node |
|
1510 | + * @param string[] $space |
|
1511 | + */ |
|
1504 | 1512 | protected function parse_attr($node, $name, &$space) |
1505 | 1513 | { |
1506 | 1514 | // Per sourceforge: http://sourceforge.net/tracker/?func=detail&aid=3061408&group_id=218559&atid=1044037 |
@@ -1538,6 +1546,11 @@ discard block |
||
1538 | 1546 | } |
1539 | 1547 | |
1540 | 1548 | // link node's parent |
1549 | + |
|
1550 | + /** |
|
1551 | + * @param simple_html_dom_node $node |
|
1552 | + * @param boolean $is_child |
|
1553 | + */ |
|
1541 | 1554 | protected function link_nodes(&$node, $is_child) |
1542 | 1555 | { |
1543 | 1556 | $node->parent = $this->parent; |
@@ -1549,6 +1562,10 @@ discard block |
||
1549 | 1562 | } |
1550 | 1563 | |
1551 | 1564 | // as a text node |
1565 | + |
|
1566 | + /** |
|
1567 | + * @param string $tag |
|
1568 | + */ |
|
1552 | 1569 | protected function as_text_node($tag) |
1553 | 1570 | { |
1554 | 1571 | $node = new simple_html_dom_node($this); |
@@ -1559,12 +1576,18 @@ discard block |
||
1559 | 1576 | return true; |
1560 | 1577 | } |
1561 | 1578 | |
1579 | + /** |
|
1580 | + * @param string $chars |
|
1581 | + */ |
|
1562 | 1582 | protected function skip($chars) |
1563 | 1583 | { |
1564 | 1584 | $this->pos += strspn($this->doc, $chars, $this->pos); |
1565 | 1585 | $this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next |
1566 | 1586 | } |
1567 | 1587 | |
1588 | + /** |
|
1589 | + * @param string $chars |
|
1590 | + */ |
|
1568 | 1591 | protected function copy_skip($chars) |
1569 | 1592 | { |
1570 | 1593 | $pos = $this->pos; |
@@ -1575,6 +1598,9 @@ discard block |
||
1575 | 1598 | return substr($this->doc, $pos, $len); |
1576 | 1599 | } |
1577 | 1600 | |
1601 | + /** |
|
1602 | + * @param string $chars |
|
1603 | + */ |
|
1578 | 1604 | protected function copy_until($chars) |
1579 | 1605 | { |
1580 | 1606 | $pos = $this->pos; |
@@ -1584,6 +1610,9 @@ discard block |
||
1584 | 1610 | return substr($this->doc, $pos, $len); |
1585 | 1611 | } |
1586 | 1612 | |
1613 | + /** |
|
1614 | + * @param string $char |
|
1615 | + */ |
|
1587 | 1616 | protected function copy_until_char($char) |
1588 | 1617 | { |
1589 | 1618 | if ($this->char===null) return ''; |
@@ -1602,6 +1631,9 @@ discard block |
||
1602 | 1631 | return substr($this->doc, $pos_old, $pos-$pos_old); |
1603 | 1632 | } |
1604 | 1633 | |
1634 | + /** |
|
1635 | + * @param string $char |
|
1636 | + */ |
|
1605 | 1637 | protected function copy_until_char_escape($char) |
1606 | 1638 | { |
1607 | 1639 | if ($this->char===null) return ''; |
@@ -1633,6 +1665,10 @@ discard block |
||
1633 | 1665 | |
1634 | 1666 | // remove noise from html content |
1635 | 1667 | // save the noise in the $this->noise array. |
1668 | + |
|
1669 | + /** |
|
1670 | + * @param string $pattern |
|
1671 | + */ |
|
1636 | 1672 | protected function remove_noise($pattern, $remove_tag=false) |
1637 | 1673 | { |
1638 | 1674 | global $debug_object; |
@@ -1658,6 +1694,10 @@ discard block |
||
1658 | 1694 | } |
1659 | 1695 | |
1660 | 1696 | // restore noise to html content |
1697 | + |
|
1698 | + /** |
|
1699 | + * @param string|null $text |
|
1700 | + */ |
|
1661 | 1701 | function restore_noise($text) |
1662 | 1702 | { |
1663 | 1703 | global $debug_object; |
@@ -14,7 +14,7 @@ |
||
14 | 14 | /** |
15 | 15 | * Get SQL query part for filter used |
16 | 16 | * @param Array $filter the filter |
17 | - * @return Array the SQL part |
|
17 | + * @return string the SQL part |
|
18 | 18 | */ |
19 | 19 | public function getFilter($filter = array(),$where = false,$and = false) { |
20 | 20 | global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver; |
@@ -11,7 +11,7 @@ |
||
11 | 11 | /** |
12 | 12 | * Get SQL query part for filter used |
13 | 13 | * @param Array $filter the filter |
14 | - * @return Array the SQL part |
|
14 | + * @return string the SQL part |
|
15 | 15 | */ |
16 | 16 | public function getFilter($filter = array(),$where = false,$and = false) { |
17 | 17 | global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver; |
@@ -18,6 +18,10 @@ discard block |
||
18 | 18 | $this->db = $Connection->db(); |
19 | 19 | } |
20 | 20 | |
21 | + /** |
|
22 | + * @param string $type |
|
23 | + * @param string $stats_date |
|
24 | + */ |
|
21 | 25 | public function addLastStatsUpdate($type,$stats_date) { |
22 | 26 | $query = "DELETE FROM config WHERE name = :type; |
23 | 27 | INSERT INTO config (name,value) VALUES (:type,:stats_date);"; |
@@ -961,6 +965,10 @@ discard block |
||
961 | 965 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
962 | 966 | return $all; |
963 | 967 | } |
968 | + |
|
969 | + /** |
|
970 | + * @param string $type |
|
971 | + */ |
|
964 | 972 | public function deleteStatsByType($type,$stats_airline = '', $filter_name = '') { |
965 | 973 | if ($filter_name == '') $filter_name = $this->filter_name; |
966 | 974 | $query = "DELETE FROM stats WHERE stats_type = :type AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
@@ -972,6 +980,11 @@ discard block |
||
972 | 980 | echo "error : ".$e->getMessage(); |
973 | 981 | } |
974 | 982 | } |
983 | + |
|
984 | + /** |
|
985 | + * @param string $type |
|
986 | + * @param string $year |
|
987 | + */ |
|
975 | 988 | public function getSumStats($type,$year,$stats_airline = '',$filter_name = '',$month = '') { |
976 | 989 | if ($filter_name == '') $filter_name = $this->filter_name; |
977 | 990 | global $globalArchiveMonths, $globalDBdriver; |
@@ -1116,6 +1129,10 @@ discard block |
||
1116 | 1129 | else return 0; |
1117 | 1130 | } |
1118 | 1131 | |
1132 | + /** |
|
1133 | + * @param string $type |
|
1134 | + * @param string $stats_date |
|
1135 | + */ |
|
1119 | 1136 | public function addStat($type,$cnt,$stats_date,$stats_airline = '',$filter_name = '') { |
1120 | 1137 | global $globalDBdriver; |
1121 | 1138 | if ($filter_name == '') $filter_name = $this->filter_name; |
@@ -1169,6 +1186,9 @@ discard block |
||
1169 | 1186 | } |
1170 | 1187 | */ |
1171 | 1188 | |
1189 | + /** |
|
1190 | + * @param string $stats_type |
|
1191 | + */ |
|
1172 | 1192 | public function getStatsSource($stats_type,$year = '',$month = '',$day = '') { |
1173 | 1193 | global $globalDBdriver; |
1174 | 1194 | $query = "SELECT * FROM stats_source WHERE stats_type = :stats_type"; |
@@ -1212,6 +1232,9 @@ discard block |
||
1212 | 1232 | return $all; |
1213 | 1233 | } |
1214 | 1234 | |
1235 | + /** |
|
1236 | + * @param string $stats_type |
|
1237 | + */ |
|
1215 | 1238 | public function addStatSource($data,$source_name,$stats_type,$date) { |
1216 | 1239 | global $globalDBdriver; |
1217 | 1240 | if ($globalDBdriver == 'mysql') { |
@@ -1227,6 +1250,10 @@ discard block |
||
1227 | 1250 | return "error : ".$e->getMessage(); |
1228 | 1251 | } |
1229 | 1252 | } |
1253 | + |
|
1254 | + /** |
|
1255 | + * @param string $type |
|
1256 | + */ |
|
1230 | 1257 | public function addStatFlight($type,$date_name,$cnt,$stats_airline = '',$filter_name = '') { |
1231 | 1258 | $query = "INSERT INTO stats_flight (stats_type,flight_date,cnt,stats_airline,filter_name) VALUES (:type,:flight_date,:cnt,:stats_airline,:filter_name)"; |
1232 | 1259 | $query_values = array(':type' => $type,':flight_date' => $date_name,':cnt' => $cnt, ':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
@@ -1493,6 +1520,10 @@ discard block |
||
1493 | 1520 | return "error : ".$e->getMessage(); |
1494 | 1521 | } |
1495 | 1522 | } |
1523 | + |
|
1524 | + /** |
|
1525 | + * @param string $type |
|
1526 | + */ |
|
1496 | 1527 | public function deleteStatFlight($type) { |
1497 | 1528 | $query = "DELETE FROM stats_flight WHERE stats_type = :type"; |
1498 | 1529 | $query_values = array(':type' => $type); |
@@ -1503,6 +1534,10 @@ discard block |
||
1503 | 1534 | return "error : ".$e->getMessage(); |
1504 | 1535 | } |
1505 | 1536 | } |
1537 | + |
|
1538 | + /** |
|
1539 | + * @param string $type |
|
1540 | + */ |
|
1506 | 1541 | public function deleteStatAirport($type) { |
1507 | 1542 | $query = "DELETE FROM stats_airport WHERE stats_type = :type"; |
1508 | 1543 | $query_values = array(':type' => $type); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | /** |
16 | 16 | * Get SQL query part for filter used |
17 | 17 | * @param Array $filter the filter |
18 | - * @return Array the SQL part |
|
18 | + * @return string the SQL part |
|
19 | 19 | */ |
20 | 20 | |
21 | 21 | public function getFilter($filter = array(),$where = false,$and = false) { |
@@ -486,9 +486,6 @@ discard block |
||
486 | 486 | /** |
487 | 487 | * Update ident spotter data |
488 | 488 | * |
489 | - * @param String $flightaware_id the ID from flightaware |
|
490 | - * @param String $ident the flight ident |
|
491 | - * @return String success or false |
|
492 | 489 | * |
493 | 490 | */ |
494 | 491 | public function updateIdentTrackerData($famtrackid = '', $ident = '',$fromsource = NULL) |
@@ -510,10 +507,6 @@ discard block |
||
510 | 507 | /** |
511 | 508 | * Update latest spotter data |
512 | 509 | * |
513 | - * @param String $flightaware_id the ID from flightaware |
|
514 | - * @param String $ident the flight ident |
|
515 | - * @param String $arrival_airport_icao the arrival airport |
|
516 | - * @return String success or false |
|
517 | 510 | * |
518 | 511 | */ |
519 | 512 | public function updateLatestTrackerData($famtrackid = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $groundspeed = NULL, $date = '') |
@@ -535,29 +528,6 @@ discard block |
||
535 | 528 | /** |
536 | 529 | * Adds a new spotter data |
537 | 530 | * |
538 | - * @param String $flightaware_id the ID from flightaware |
|
539 | - * @param String $ident the flight ident |
|
540 | - * @param String $aircraft_icao the aircraft type |
|
541 | - * @param String $departure_airport_icao the departure airport |
|
542 | - * @param String $arrival_airport_icao the arrival airport |
|
543 | - * @param String $latitude latitude of flight |
|
544 | - * @param String $longitude latitude of flight |
|
545 | - * @param String $waypoints waypoints of flight |
|
546 | - * @param String $altitude altitude of flight |
|
547 | - * @param String $heading heading of flight |
|
548 | - * @param String $groundspeed speed of flight |
|
549 | - * @param String $date date of flight |
|
550 | - * @param String $departure_airport_time departure time of flight |
|
551 | - * @param String $arrival_airport_time arrival time of flight |
|
552 | - * @param String $squawk squawk code of flight |
|
553 | - * @param String $route_stop route stop of flight |
|
554 | - * @param String $highlight highlight or not |
|
555 | - * @param String $ModeS ModesS code of flight |
|
556 | - * @param String $registration registration code of flight |
|
557 | - * @param String $pilot_id pilot id of flight (for virtual airlines) |
|
558 | - * @param String $pilot_name pilot name of flight (for virtual airlines) |
|
559 | - * @param String $verticalrate vertival rate of flight |
|
560 | - * @return String success or false |
|
561 | 531 | */ |
562 | 532 | public function addTrackerData($famtrackid = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $heading = '', $groundspeed = '', $date = '', $comment = '', $type = '',$format_source = '', $source_name = '') |
563 | 533 | { |
@@ -1428,7 +1398,7 @@ discard block |
||
1428 | 1398 | /** |
1429 | 1399 | * Parses the direction degrees to working |
1430 | 1400 | * |
1431 | - * @param Float $direction the direction in degrees |
|
1401 | + * @param integer $direction the direction in degrees |
|
1432 | 1402 | * @return Array the direction information |
1433 | 1403 | * |
1434 | 1404 | */ |