Documentation ¶
Index ¶
- Constants
- Variables
- func CelsiusToFahrenheit(c float64) float64
- func GenerateMETAR(wx WeatherData) (string, error)
- type Barometer
- type Ceiling
- type Cloud
- type CloudPreset
- type Clouds
- type Conditions
- type Data
- type Dewpoint
- type Elevation
- type FlightCategory
- type Humidity
- type Location
- type Station
- type Temperature
- type Visibility
- type WeatherData
- type Wind
Constants ¶
View Source
const ( MPSToKT = 1.944 MetersToFeet = 3.281 )
Variables ¶
View Source
var CloudPresets map[string][]CloudPreset = map[string][]CloudPreset{
"FEW": {
{`"Preset1"`, 840, 4200},
{`"Preset2"`, 1260, 2520},
},
"SCT": {
{`"Preset3"`, 840, 2520},
{`"Preset4"`, 1260, 2520},
{`"Preset5"`, 1260, 4620},
{`"Preset6"`, 1260, 4200},
{`"Preset7"`, 1680, 5040},
{`"Preset8"`, 3780, 5460},
{`"Preset9"`, 1680, 3780},
{`"Preset10"`, 1260, 4200},
{`"Preset11"`, 2520, 5460},
{`"Preset12"`, 1680, 3360},
},
"BKN": {
{`"Preset13"`, 1680, 3360},
{`"Preset14"`, 1680, 3360},
{`"Preset15"`, 840, 5040},
{`"Preset16"`, 1260, 4200},
{`"Preset17"`, 0, 2520},
{`"Preset18"`, 0, 3780},
{`"Preset19"`, 0, 2940},
{`"Preset20"`, 0, 3780},
},
"OVC": {
{`"Preset21"`, 1260, 4200},
{`"Preset22"`, 420, 4200},
{`"Preset23"`, 840, 3360},
{`"Preset24"`, 420, 2520},
{`"Preset25"`, 420, 3360},
{`"Preset26"`, 420, 2940},
{`"Preset27"`, 420, 2520},
},
"OVC+RA": {
{`"RainyPreset1"`, 420, 2940},
{`"RainyPreset2"`, 840, 2520},
{`"RainyPreset3"`, 840, 2520},
},
}
View Source
var (
DecodePreset = map[string][]Cloud{
`"Preset1"`: {{"FEW", "070"}},
`"Preset2"`: {{"FEW", "080"}, {"SCT", "230"}},
`"Preset3"`: {{"SCT", "080"}, {"FEW", "210"}},
`"Preset4"`: {{"SCT", "080"}, {"SCT", "240"}},
`"Preset5"`: {{"SCT", "140"}, {"FEW", "270"}, {"BKN", "400"}},
`"Preset6"`: {{"SCT", "080"}, {"FEW", "400"}},
`"Preset7"`: {{"BKN", "075"}, {"SCT", "210"}, {"SCT", "400"}},
`"Preset8"`: {{"SCT", "180"}, {"FEW", "360"}, {"FEW", "400"}},
`"Preset9"`: {{"BKN", "075"}, {"SCT", "200"}, {"FEW", "410"}},
`"Preset10"`: {{"SCT", "180"}, {"FEW", "360"}, {"FEW", "400"}},
`"Preset11"`: {{"BKN", "180"}, {"BKN", "320"}, {"FEW", "410"}},
`"Preset12"`: {{"BKN", "120"}, {"SCT", "220"}, {"FEW", "410"}},
`"Preset13"`: {{"BKN", "120"}, {"BKN", "260"}, {"FEW", "410"}},
`"Preset14"`: {{"BKN", "070"}, {"FEW", "410"}},
`"Preset15"`: {{"SCT", "140"}, {"BKN", "240"}, {"FEW", "400"}},
`"Preset16"`: {{"BKN", "140"}, {"BKN", "280"}, {"FEW", "400"}},
`"Preset17"`: {{"BKN", "070"}, {"BKN", "200"}, {"BKN", "320"}},
`"Preset18"`: {{"BKN", "130"}, {"BKN", "250"}, {"BKN", "380"}},
`"Preset19"`: {{"OVC", "090"}, {"BKN", "230"}, {"BKN", "310"}},
`"Preset20"`: {{"BKN", "130"}, {"BKN", "280"}, {"FEW", "380"}},
`"Preset21"`: {{"BKN", "070"}, {"OVC", "170"}},
`"Preset22"`: {{"OVC", "070"}, {"BKN", "170"}},
`"Preset23"`: {{"OVC", "110"}, {"BKN", "180"}, {"SCT", "320"}},
`"Preset24"`: {{"OVC", "030"}, {"OVC", "170"}, {"BKN", "340"}},
`"Preset25"`: {{"OVC", "120"}, {"OVC", "220"}, {"OVC", "400"}},
`"Preset26"`: {{"OVC", "090"}, {"BKN", "230"}, {"SCT", "320"}},
`"Preset27"`: {{"OVC", "080"}, {"BKN", "250"}, {"BKN", "340"}},
`"RainyPreset1"`: {{"OVC", "030"}, {"OVC", "280"}, {"FEW", "400"}},
`"RainyPreset2"`: {{"OVC", "030"}, {"SCT", "180"}, {"FEW", "400"}},
`"RainyPreset3"`: {{"OVC", "060"}, {"OVC", "190"}, {"SCT", "340"}},
}
)
View Source
var SelectedBase int
View Source
var SelectedPreset string
Functions ¶
func CelsiusToFahrenheit ¶ added in v1.11.0
func GenerateMETAR ¶ added in v1.11.0
func GenerateMETAR(wx WeatherData) (string, error)
GenerateMETAR generates a metar based on the weather settings added to the DCS miz
Types ¶
type CloudPreset ¶ added in v1.3.0
type Conditions ¶
type Data ¶
type Data struct { Barometer Barometer `json:"barometer"` Ceiling Ceiling `json:"ceiling"` Clouds []Clouds `json:"clouds"` Conditions []Conditions `json:"conditions"` Dewpoint Dewpoint `json:"dewpoint"` Elevation Elevation `json:"elevation"` FlightCategory FlightCategory `json:"flight_category"` Humidity Humidity `json:"humidity"` ICAO string `json:"icao"` ID string `json:"id"` Location Location `json:"location"` Observed string `json:"observed"` RawText string `json:"raw_text"` Station Station `json:"station"` Temperature Temperature `json:"temperature"` Visibility Visibility `json:"visibility"` Wind Wind `json:"wind"` }
type FlightCategory ¶
type FlightCategory string
type Temperature ¶
type Visibility ¶
type WeatherData ¶
var DefaultWeather WeatherData = WeatherData{ Data: []Data{ { Wind: Wind{ SpeedMPS: 1.25, Degrees: 270, GustMPS: 3, }, Temperature: Temperature{ Celsius: 15, }, Barometer: Barometer{ Hg: 29.92, }, Clouds: []Clouds{ { Code: "CLR", }, }, Observed: time.Now().Format("2006-01-02T15:04:05"), }, }, NumResults: 1, }
func GetWeather ¶
func GetWeather() (WeatherData, error)
type Wind ¶
type Wind struct { Degrees float64 `json:"degrees"` SpeedKPH float64 `json:"speed_kph"` SpeedKTS float64 `json:"speed_kts"` SpeedMPH float64 `json:"speed_mph"` SpeedMPS float64 `json:"speed_mps"` GustKPH float64 `json:"gust_kph"` GustKTS float64 `json:"gust_kts"` GustMPH float64 `json:"gust_mph"` GustMPS float64 `json:"gust_mps"` }
Click to show internal directories.
Click to hide internal directories.