Merge pull request #1 from cyoung/master

Merge to update
pull/503/head
peepsnet 2016-10-06 17:17:13 -04:00 zatwierdzone przez GitHub
commit 883e8fd36c
2 zmienionych plików z 19 dodań i 16 usunięć

Wyświetl plik

@ -442,24 +442,12 @@ func makeStratuxStatus() []byte {
// Number of satellites tracked
msg[17] = byte(globalStatus.GPS_satellites_tracked)
// Summarize number of UAT and 1090ES traffic targets for reports that follow.
var uat_traffic_targets uint16
var es_traffic_targets uint16
for _, traf := range traffic {
switch traf.Last_source {
case TRAFFIC_SOURCE_1090ES:
es_traffic_targets++
case TRAFFIC_SOURCE_UAT:
uat_traffic_targets++
}
}
// Number of UAT traffic targets.
msg[18] = byte((uat_traffic_targets & 0xFF00) >> 8)
msg[19] = byte(uat_traffic_targets & 0xFF)
msg[18] = byte((globalStatus.UAT_traffic_targets_tracking & 0xFF00) >> 8)
msg[19] = byte(globalStatus.UAT_traffic_targets_tracking & 0xFF)
// Number of 1090ES traffic targets.
msg[20] = byte((es_traffic_targets & 0xFF00) >> 8)
msg[21] = byte(es_traffic_targets & 0xFF)
msg[20] = byte((globalStatus.ES_traffic_targets_tracking & 0xFF00) >> 8)
msg[21] = byte(globalStatus.ES_traffic_targets_tracking & 0xFF)
// Number of UAT messages per minute.
msg[22] = byte((globalStatus.UAT_messages_last_minute & 0xFF00) >> 8)
@ -1020,6 +1008,8 @@ type status struct {
UAT_messages_max uint
ES_messages_last_minute uint
ES_messages_max uint
UAT_traffic_targets_tracking uint16
ES_traffic_targets_tracking uint16
Ping_connected bool
GPS_satellites_locked uint16
GPS_satellites_seen uint16

Wyświetl plik

@ -165,6 +165,19 @@ func sendTrafficUpdates() {
trafficMutex.Lock()
defer trafficMutex.Unlock()
cleanupOldEntries()
// Summarize number of UAT and 1090ES traffic targets for reports that follow.
globalStatus.UAT_traffic_targets_tracking = 0
globalStatus.ES_traffic_targets_tracking = 0
for _, traf := range traffic {
switch traf.Last_source {
case TRAFFIC_SOURCE_1090ES:
globalStatus.ES_traffic_targets_tracking++
case TRAFFIC_SOURCE_UAT:
globalStatus.UAT_traffic_targets_tracking++
}
}
var msg []byte
if globalSettings.DEBUG && (stratuxClock.Time.Second()%15) == 0 {
log.Printf("List of all aircraft being tracked:\n")