1#include "core/aqm_platform.h"
2#include "core/globals.h"
7void configure_limits(
void) {
10 printf(
"Configure pollutant limits and collection settings (press Enter to keep current value):\n");
14 printf(
"PM2.5 limit (current: %.4f): ", limit_pm25);
15 if (fgets(input,
sizeof(input), stdin) && strlen(input) > 1) {
17 if (aqm_parse_float(input, &temp))
21 printf(
"PM10 limit (current: %.4f): ", limit_pm10);
22 if (fgets(input,
sizeof(input), stdin) && strlen(input) > 1) {
24 if (aqm_parse_float(input, &temp))
28 printf(
"CO limit (current: %.4f): ", limit_co);
29 if (fgets(input,
sizeof(input), stdin) && strlen(input) > 1) {
31 if (aqm_parse_float(input, &temp))
35 printf(
"NO2 limit (current: %.6f): ", limit_no2);
36 if (fgets(input,
sizeof(input), stdin) && strlen(input) > 1) {
38 if (aqm_parse_float(input, &temp))
42 printf(
"O3 limit (current: %.6f): ", limit_o3);
43 if (fgets(input,
sizeof(input), stdin) && strlen(input) > 1) {
45 if (aqm_parse_float(input, &temp))
49 printf(
"SO2 limit (current: %.6f): ", limit_so2);
50 if (fgets(input,
sizeof(input), stdin) && strlen(input) > 1) {
52 if (aqm_parse_float(input, &temp))
56 printf(
"Data collection interval in seconds (current: %d): ", collection_interval);
57 if (fgets(input,
sizeof(input), stdin) && strlen(input) > 1) {
59 if (aqm_parse_int(input, &temp) && temp >= 1)
60 collection_interval = temp;
63 printf(
"Data retention period in days (current: %d): ", retention_period);
64 if (fgets(input,
sizeof(input), stdin) && strlen(input) > 1) {
66 if (aqm_parse_int(input, &temp) && temp >= 1)
67 retention_period = temp;
70 if (collection_interval < 1)
71 collection_interval = 1;
72 if (retention_period < 1)
75 printf(
"Configuration updated.\n");