fixed traffic extrapolation to accidentally calculate with feet/s instead of feet/min

pull/827/merge^2
Adrian Batzill 2020-05-31 10:47:10 +02:00
rodzic e4cebe8a6a
commit b0988f98e0
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -13,11 +13,11 @@ import (
"bufio" "bufio"
"encoding/hex" "encoding/hex"
"encoding/json" "encoding/json"
"strconv"
"fmt" "fmt"
"log" "log"
"math" "math"
"net" "net"
"strconv"
"strings" "strings"
"sync" "sync"
"time" "time"
@ -1350,7 +1350,7 @@ func extrapolateTraffic(ti *TrafficInfo) {
travelDist := float64(ti.Speed) * (seconds / 60 / 60) // speed is knots=nm per hour. /60/60 = nm per second travelDist := float64(ti.Speed) * (seconds / 60 / 60) // speed is knots=nm per hour. /60/60 = nm per second
// Estimate alt // Estimate alt
ti.Alt = int32(float64(ti.Alt) + (float64(ti.Vvel) * seconds)) ti.Alt = int32(float64(ti.Alt) + (float64(ti.Vvel) * (seconds / 60)))
// Estimate position // Estimate position
lat, lng := calcLocationForBearingDistance(float64(ti.Lat), float64(ti.Lng), float64(ti.Track), travelDist) lat, lng := calcLocationForBearingDistance(float64(ti.Lat), float64(ti.Lng), float64(ti.Track), travelDist)
ti.Lat = float32(lat) ti.Lat = float32(lat)