Skip to content

Commit

Permalink
fix wind unit error
Browse files Browse the repository at this point in the history
  • Loading branch information
evogelsa committed Jan 7, 2021
1 parent c355403 commit c959452
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions miz/miz.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func Update(data weather.WeatherData) {
for i, line := range weatherLines {
if strings.Contains(line, `["at8000"]`) && !strings.Contains(line, "end of") {
// use ground speed to estimate speed at 8000 feet
speed := int(data.Data[0].Wind.SpeedKTS)
speed := int(data.Data[0].Wind.SpeedMPS)
speed = int(windSpeed(8000, 100, float64(speed), 0.04))
lines[i+startWeather+2] = "\t\t\t\t[\"speed\"] = " + strconv.Itoa(speed) + ","
fmt.Println("speed at 8000:", speed)
Expand All @@ -64,7 +64,7 @@ func Update(data weather.WeatherData) {
fmt.Println("dir at 8000", dir)
} else if strings.Contains(line, `["at2000"]`) && !strings.Contains(line, "end of") {
// estimate speed at 2000 feet
speed := int(data.Data[0].Wind.SpeedKTS)
speed := int(data.Data[0].Wind.SpeedMPS)
speed = int(windSpeed(2000, 100, float64(speed), 0.04))
lines[i+startWeather+2] = "\t\t\t\t[\"speed\"] = " + strconv.Itoa(speed) + ","
fmt.Println("speed at 2000", speed)
Expand All @@ -76,7 +76,7 @@ func Update(data weather.WeatherData) {
fmt.Println("dir at 2000", dir)
} else if strings.Contains(line, `["atGround"]`) && !strings.Contains(line, "end of") {
// use metar reported data for ground conditions
speed := int(data.Data[0].Wind.SpeedKTS)
speed := int(data.Data[0].Wind.SpeedMPS)
lines[i+startWeather+2] = "\t\t\t\t[\"speed\"] = " + strconv.Itoa(speed) + ","
fmt.Println("speed at ground:", speed)

Expand Down

0 comments on commit c959452

Please sign in to comment.