- weather: formatting code using astyle

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2022-01-24 00:32:37 +01:00
committed by Thilo Graf
parent 668161d7a5
commit d46b87b16b

View File

@@ -188,23 +188,40 @@ std::string CWeather::getDirectionString(int degree)
float step = 11.25; float step = 11.25;
float deg = degree; float deg = degree;
if (deg <= step) { direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_N); } if (deg <= step)
else if (deg <= 3 * step) { direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_NNE); } direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_N);
else if (deg <= 5 * step) { direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_NE); } else if (deg <= 3 * step)
else if (deg <= 7 * step) { direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_ENE); } direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_NNE);
else if (deg <= 9 * step) { direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_E); } else if (deg <= 5 * step)
else if (deg <= 11 * step) { direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_ESE); } direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_NE);
else if (deg <= 13 * step) { direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_SE); } else if (deg <= 7 * step)
else if (deg <= 15 * step) { direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_SSE); } direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_ENE);
else if (deg <= 17 * step) { direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_S); } else if (deg <= 9 * step)
else if (deg <= 19 * step) { direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_SSW); } direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_E);
else if (deg <= 21 * step) { direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_SW); } else if (deg <= 11 * step)
else if (deg <= 23 * step) { direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_WSW); } direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_ESE);
else if (deg <= 25 * step) { direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_W); } else if (deg <= 13 * step)
else if (deg <= 27 * step) { direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_WNW); } direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_SE);
else if (deg <= 29 * step) { direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_NW); } else if (deg <= 15 * step)
else if (deg <= 31 * step) { direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_NNW); } direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_SSE);
else { direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_N); } else if (deg <= 17 * step)
direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_S);
else if (deg <= 19 * step)
direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_SSW);
else if (deg <= 21 * step)
direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_SW);
else if (deg <= 23 * step)
direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_WSW);
else if (deg <= 25 * step)
direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_W);
else if (deg <= 27 * step)
direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_WNW);
else if (deg <= 29 * step)
direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_NW);
else if (deg <= 31 * step)
direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_NNW);
else
direction = g_Locale->getText(LOCALE_WEATHER_DIRECTION_N);
return direction; return direction;
} }