Created
February 22, 2024 19:09
-
-
Save centralhardware/349246649369e6713845e25ed1c3ccd6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun getMetar(icao: String): String{ | |
val metar = metarService.retrieveFromAirport(icao) | |
return """ | |
${getAirport(metar.airport)} | |
${metar.day} ${metar.time} | |
temp: ${metar.temperature}, dew point: ${metar.dewPoint}, ${if (metar.isNosig == true) "nosig" else ""} | |
${getWind(metar.wind)} | |
${getVisibility(metar.visibility)} | |
${getWeatherConditions(metar.weatherConditions)} | |
${metar.message} | |
""".trimIndent() | |
} | |
fun getTaf(icao: String): String{ | |
val taf = tafService.retrieveFromAirport(icao) | |
val validity = taf.validity | |
return """ | |
${getAirport(taf.airport)} | |
${validity.startDay}d ${validity.startHour}h - ${validity.endDay}d ${validity.endHour}h | |
${getWind(taf.wind)} | |
${getVisibility(taf.visibility)} | |
${getWeatherConditions(taf.weatherConditions)} | |
${taf.message} | |
""".trimIndent() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment