Update traffic UI to support ti.age

pull/259/head
AvSquirrel 2016-02-18 02:12:50 +00:00
rodzic a224db0ba4
commit a900a8942d
3 zmienionych plików z 8 dodań i 6 usunięć

Wyświetl plik

@ -620,7 +620,7 @@ func updateDemoTraffic(icao uint32, tail string, relAlt float32, gs float64, off
ti.Alt = int32(mySituation.Alt + relAlt)
ti.Track = uint16(hdg)
ti.Speed = uint16(gs)
if hdg > 180 && hdg < 195 {
if hdg > 100 && hdg < 150 {
ti.Speed_valid = false
} else {
ti.Speed_valid = true
@ -629,7 +629,7 @@ func updateDemoTraffic(icao uint32, tail string, relAlt float32, gs float64, off
ti.Tail = tail // "DEMO1234"
ti.Timestamp = time.Now()
ti.Last_seen = stratuxClock.Time
ti.Age = 0
ti.Age = hdg / 1000
ti.Last_source = 1
if icao%7 == 1 { // make some of the traffic UAT sourced
ti.Last_source = 2

Wyświetl plik

@ -50,8 +50,9 @@ function TrafficCtrl($rootScope, $scope, $state, $http, $interval) {
new_traffic.heading = "---";
}
new_traffic.vspeed = Math.round(obj.Vvel / 100) * 100
new_traffic.age = Date.parse(obj.Timestamp);
new_traffic.time = utcTimeString(new_traffic.age);
var timestamp = Date.parse(obj.Timestamp);
new_traffic.time = utcTimeString(timestamp);
new_traffic.age = obj.Age;
new_traffic.src = obj.Last_source; // 1=ES, 2=UAT
// return new_aircraft;
}

Wyświetl plik

@ -16,7 +16,7 @@
<div class="col-sm-6">
<span class="col-xs-2">&nbsp;</span>
<span class="col-xs-7">Location</span>
<span class="col-xs-3 text-right">Time Last Seen</span>
<span class="col-xs-3 text-right">Age [sec]</span>
</div>
</div>
@ -39,7 +39,8 @@
<div class="col-sm-6">
<span class="col-xs-2">&nbsp;</span>
<span class="col-xs-7">{{aircraft.lat}} {{aircraft.lon}}</span>
<span class="col-xs-3 text-right">{{aircraft.time}}</span>
<!--<span class="col-xs-3 text-right">{{aircraft.time}}</span>-->
<span class="col-xs-3 text-right">{{aircraft.age}}</span>
</div>
</div>
</div>