Turns one weather message into the reading a store keeps. More...
#include "weather/weather_reading.h"#include <limits.h>#include "math/scale.h"#include "text/cstring_fit.h"Functions | |
| static int | or_none (int value, int none) |
| static int | temp_or_none (int value) |
| static int16_t | day_minute_or_none (int value) |
| bool | weather_reading_apply (WeatherState *state, const WeatherMessage *msg, const WeatherClock *clock) |
| Put a message's readings into the kept weather. | |
| static int | div_nearest (int numerator, int denominator) |
| static int | convert_temp (int value, bool to_fahrenheit) |
| void | weather_reading_convert (WeatherState *state, bool to_fahrenheit) |
| Convert every temperature in the kept weather to the other unit. | |
Turns one weather message into the reading a store keeps.
|
static |
One temperature in the other unit, or no data left as it is.
|
static |
A time of day in minutes, or -1 for one the message left out or one no clock can read.
|
static |
Divides to the nearest whole number. Neither a fifth nor a ninth lands on a half, so nothing ties.
|
static |
A number the message left out, as the store's own no-data value.
|
static |
A temperature held to TEMP_LOWEST to TEMP_HIGHEST, so a wild one cannot run past a three digit label or overflow the current temperature's int16, or no data for one the message left out. The store's own no-data value counts as left out too, since clamping it would turn it into a real -99.
| value | The temperature from the message, or INT_MIN when it left one out. |