本文整理汇总了PHP中Spotter::setHighlightFlight方法的典型用法代码示例。如果您正苦于以下问题:PHP Spotter::setHighlightFlight方法的具体用法?PHP Spotter::setHighlightFlight怎么用?PHP Spotter::setHighlightFlight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spotter
的用法示例。
在下文中一共展示了Spotter::setHighlightFlight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
//.........这里部分代码省略.........
} elseif (isset(self::$all_flights[$id]['longitude'])) {
if ($globalDebug) {
echo '!!! Strange longitude value - diff : ' . abs(self::$all_flights[$id]['longitude'] - $line['longitude']) . '- previous lat : ' . self::$all_flights[$id]['longitude'] . '- new lat : ' . $line['longitude'] . "\n";
}
}
}
if (isset($line['verticalrate']) && $line['verticalrate'] != '') {
self::$all_flights[$id] = array_merge(self::$all_flights[$id], array('verticalrate' => $line['verticalrate']));
//$dataFound = true;
}
if (isset($line['emergency']) && $line['emergency'] != '') {
self::$all_flights[$id] = array_merge(self::$all_flights[$id], array('emergency' => $line['emergency']));
//$dataFound = true;
}
if (isset($line['speed']) && $line['speed'] != '') {
// self::$all_flights[$id] = array_merge(self::$all_flights[$id],array('speed' => $line[12]));
self::$all_flights[$id] = array_merge(self::$all_flights[$id], array('speed' => round($line['speed'])));
//$dataFound = true;
}
if (isset($line['squawk']) && $line['squawk'] != '') {
if (isset(self::$all_flights[$id]['squawk']) && self::$all_flights[$id]['squawk'] != '7500' && self::$all_flights[$id]['squawk'] != '7600' && self::$all_flights[$id]['squawk'] != '7700' && isset(self::$all_flights[$id]['id'])) {
self::$all_flights[$id] = array_merge(self::$all_flights[$id], array('squawk' => $line['squawk']));
$highlight = '';
if (self::$all_flights[$id]['squawk'] == '7500') {
$highlight = 'Squawk 7500 : Hijack at ' . date('G:i') . ' UTC';
}
if (self::$all_flights[$id]['squawk'] == '7600') {
$highlight = 'Squawk 7600 : Lost Comm (radio failure) at ' . date('G:i') . ' UTC';
}
if (self::$all_flights[$id]['squawk'] == '7700') {
$highlight = 'Squawk 7700 : Emergency at ' . date('G:i') . ' UTC';
}
if ($highlight != '') {
Spotter::setHighlightFlight(self::$all_flights[$id]['id'], $highlight);
$putinarchive = true;
$highlight = '';
}
} else {
self::$all_flights[$id] = array_merge(self::$all_flights[$id], array('squawk' => $line['squawk']));
}
//$dataFound = true;
}
if (isset($line['altitude']) && $line['altitude'] != '') {
//if (!isset(self::$all_flights[$id]['altitude']) || self::$all_flights[$id]['altitude'] == '' || (self::$all_flights[$id]['altitude'] > 0 && $line['altitude'] != 0)) {
if (abs(round($line['altitude'] / 100) - self::$all_flights[$id]['altitude']) > 2) {
$putinarchive = true;
}
self::$all_flights[$id] = array_merge(self::$all_flights[$id], array('altitude' => round($line['altitude'] / 100)));
//$dataFound = true;
//} elseif ($globalDebug) echo "!!! Strange altitude data... not added.\n";
}
if (isset($line['heading']) && $line['heading'] != '') {
if (abs(self::$all_flights[$id]['heading'] - round($line['heading'])) > 2) {
$putinarchive = true;
}
self::$all_flights[$id] = array_merge(self::$all_flights[$id], array('heading' => round($line['heading'])));
//$dataFound = true;
}
if (isset($globalSBS1update) && $globalSBS1update != '' && isset(self::$all_flights[$id]['lastupdate']) && time() - self::$all_flights[$id]['lastupdate'] < $globalSBS1update) {
$dataFound = false;
}
// print_r(self::$all_flights[$id]);
//gets the callsign from the last hour
//if (time()-self::$all_flights[$id]['lastupdate'] > 30 && $dataFound == true && self::$all_flights[$id]['ident'] != '' && self::$all_flights[$id]['latitude'] != '' && self::$all_flights[$id]['longitude'] != '') {
if ($dataFound == true && isset(self::$all_flights[$id]['hex']) && self::$all_flights[$id]['ident'] != '' && self::$all_flights[$id]['latitude'] != '' && self::$all_flights[$id]['longitude'] != '') {
if (!isset($globalDistanceIgnore['latitude']) || isset($globalDistanceIgnore['latitude']) && Common::distance(self::$all_flights[$id]['latitude'], self::$all_flights[$id]['longitude'], $globalDistanceIgnore['latitude'], $globalDistanceIgnore['longitude']) < $globalDistanceIgnore['distance']) {
示例2: add
//.........这里部分代码省略.........
//$dataFound = true;
}
if (isset($line['ground']) && $line['ground'] != '') {
if (isset($this->all_flights[$id]['ground']) && $this->all_flights[$id]['ground'] == 1 && $line['ground'] == 0) {
// Here we force archive of flight because after ground it's a new one (or should be)
$this->all_flights[$id] = array_merge($this->all_flights[$id], array('addedSpotter' => 0));
$this->all_flights[$id] = array_merge($this->all_flights[$id], array('forcenew' => 1));
if (isset($line['format_source']) && ($line['format_source'] === 'sbs' || $line['format_source'] === 'tsv' || $line['format_source'] === 'raw') && $globalDaemon) {
$this->all_flights[$id] = array_merge($this->all_flights[$id], array('id' => $this->all_flights[$id]['hex'] . '-' . date('YmdGi')));
} elseif (isset($line['id'])) {
$this->all_flights[$id] = array_merge($this->all_flights[$id], array('id' => $line['id']));
} elseif (isset($this->all_flights[$id]['ident'])) {
$this->all_flights[$id] = array_merge($this->all_flights[$id], array('id' => $this->all_flights[$id]['hex'] . '-' . $this->all_flights[$id]['ident']));
}
}
$this->all_flights[$id] = array_merge($this->all_flights[$id], array('ground' => $line['ground']));
//$dataFound = true;
}
if (isset($line['squawk']) && $line['squawk'] != '') {
if (isset($this->all_flights[$id]['squawk']) && $this->all_flights[$id]['squawk'] != '7500' && $this->all_flights[$id]['squawk'] != '7600' && $this->all_flights[$id]['squawk'] != '7700' && isset($this->all_flights[$id]['id'])) {
$this->all_flights[$id] = array_merge($this->all_flights[$id], array('squawk' => $line['squawk']));
$highlight = '';
if ($this->all_flights[$id]['squawk'] == '7500') {
$highlight = 'Squawk 7500 : Hijack at ' . date('Y-m-d G:i') . ' UTC';
}
if ($this->all_flights[$id]['squawk'] == '7600') {
$highlight = 'Squawk 7600 : Lost Comm (radio failure) at ' . date('Y-m-d G:i') . ' UTC';
}
if ($this->all_flights[$id]['squawk'] == '7700') {
$highlight = 'Squawk 7700 : Emergency at ' . date('Y-m-d G:i') . ' UTC';
}
if ($highlight != '') {
$Spotter = new Spotter();
$Spotter->setHighlightFlight($this->all_flights[$id]['id'], $highlight);
$Spotter->db = null;
$putinarchive = true;
$highlight = '';
}
} else {
$this->all_flights[$id] = array_merge($this->all_flights[$id], array('squawk' => $line['squawk']));
}
//$dataFound = true;
}
if (isset($line['altitude']) && $line['altitude'] != '') {
//if (!isset($this->all_flights[$id]['altitude']) || $this->all_flights[$id]['altitude'] == '' || ($this->all_flights[$id]['altitude'] > 0 && $line['altitude'] != 0)) {
if (abs(round($line['altitude'] / 100) - $this->all_flights[$id]['altitude']) > 2) {
$putinarchive = true;
}
$this->all_flights[$id] = array_merge($this->all_flights[$id], array('altitude' => round($line['altitude'] / 100)));
//$dataFound = true;
//} elseif ($globalDebug) echo "!!! Strange altitude data... not added.\n";
}
if (isset($line['noarchive']) && $line['noarchive'] == true) {
$this->all_flights[$id] = array_merge($this->all_flights[$id], array('noarchive' => true));
}
if (isset($line['heading']) && $line['heading'] != '') {
if (abs($this->all_flights[$id]['heading'] - round($line['heading'])) > 2) {
$putinarchive = true;
}
$this->all_flights[$id] = array_merge($this->all_flights[$id], array('heading' => round($line['heading'])));
$this->all_flights[$id] = array_merge($this->all_flights[$id], array('heading_fromsrc' => true));
//$dataFound = true;
} elseif (!isset($this->all_flights[$id]['heading_fromsrc']) && isset($this->all_flights[$id]['archive_latitude']) && $this->all_flights[$id]['archive_latitude'] != $this->all_flights[$id]['latitude'] && isset($this->all_flights[$id]['archive_longitude']) && $this->all_flights[$id]['archive_longitude'] != $this->all_flights[$id]['longitude']) {
$heading = $Common->getHeading($this->all_flights[$id]['archive_latitude'], $this->all_flights[$id]['archive_longitude'], $this->all_flights[$id]['latitude'], $this->all_flights[$id]['longitude']);
$this->all_flights[$id] = array_merge($this->all_flights[$id], array('heading' => round($heading)));
if (abs($this->all_flights[$id]['heading'] - round($heading)) > 2) {