diff --git a/conky.c b/conky.c index 20816a9b..e3b762d3 100644 --- a/conky.c +++ b/conky.c @@ -3,7 +3,11 @@ * * This program is licensed under BSD license, read COPYING * +<<<<<<< conky.c * $Id$ +======= + * $Id$ +>>>>>>> 1.58 */ #include "conky.h" @@ -773,6 +777,8 @@ enum text_object_type { OBJ_metar_dew_point, OBJ_metar_rh, OBJ_metar_windspeed, + OBJ_metar_windspeed_km, + OBJ_metar_windspeed_mph, OBJ_metar_winddir, OBJ_metar_swinddir, OBJ_metar_cloud, @@ -1383,6 +1389,10 @@ int a = stippled_borders, b = 1; END OBJ(metar_windspeed, INFO_METAR) END + OBJ(metar_windspeed_km, INFO_METAR) + END + OBJ(metar_windspeed_mph, INFO_METAR) + END OBJ(metar_winddir, INFO_METAR) END OBJ(metar_swinddir, INFO_METAR) @@ -2492,8 +2502,23 @@ static void generate_text() if (data.winData.windSpeed != INT_MAX && metar_worked) snprintf(p, n, "%i", - knTokph(data.winData. - windSpeed)); + data.winData.windSpeed); + else + snprintf(p, n, "-"); + } + OBJ(metar_windspeed_km) { + if (data.winData.windSpeed != INT_MAX + && metar_worked) + snprintf(p, n, "%'.2f", + (data.winData.windSpeed * 1.852)); + else + snprintf(p, n, "-"); + } + OBJ(metar_windspeed_mph) { + if (data.winData.windSpeed != INT_MAX + && metar_worked) + snprintf(p, n, "%'.2f", + (data.winData.windSpeed * 1.151)); else snprintf(p, n, "-"); } diff --git a/metarinfo.c b/metarinfo.c index f8ac0ac6..c1d24dd3 100644 --- a/metarinfo.c +++ b/metarinfo.c @@ -28,18 +28,19 @@ int calculateRelativeHumidity(int temp, int dew) int calculateWindChill(int temperatureC, int windKn) { - double windKmh = knTokph(windKn); + double windKmh = windKn * 1.852; return (int) (13.112 + 0.6215 * temperatureC - 11.37 * powf(windKmh, .16) + 0.3965 * temperatureC * powf(windKmh, .16)); } +/*Should no longer be needed int knTokph(int knSpeed) { return (knSpeed * 1.852); } - +*/ const char *calculateWindDirectionString(int degree) { if (degree < 22.5) { diff --git a/metarinfo.h b/metarinfo.h index 0e884456..76a1aa0b 100644 --- a/metarinfo.h +++ b/metarinfo.h @@ -12,7 +12,7 @@ int calculateRelativeHumidity(int, int); int calculateWindChill(int, int); -int knTokph(int); +//int knTokph(int); const char *calculateWindDirectionString(int); const char *calculateShortWindDirectionString(int);