kopia lustrzana https://github.com/cyoung/stratux
fixed traffic extrapolation to accidentally calculate with feet/s instead of feet/min
rodzic
e4cebe8a6a
commit
b0988f98e0
|
@ -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)
|
||||||
|
|
Ładowanie…
Reference in New Issue