-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure_limits.c
44 lines (33 loc) · 1.47 KB
/
configure_limits.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "globals.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void configure_limits() {
printf("Please configure the pollutant limits and collection settings:\n");
char input[10];
printf("PM2.5 limit (current: %.2f): ", limit_pm25);
fgets(input, sizeof(input), stdin);
if (strlen(input) > 1) limit_pm25 = atof(input);
printf("PM10 limit (current: %.2f): ", limit_pm10);
fgets(input, sizeof(input), stdin);
if (strlen(input) > 1) limit_pm10 = atof(input);
printf("CO limit (current: %.2f): ", limit_co);
fgets(input, sizeof(input), stdin);
if (strlen(input) > 1) limit_co = atof(input);
printf("NO2 limit (current: %.2f): ", limit_no2);
fgets(input, sizeof(input), stdin);
if (strlen(input) > 1) limit_no2 = atof(input);
printf("O3 limit (current: %.2f): ", limit_o3);
fgets(input, sizeof(input), stdin);
if (strlen(input) > 1) limit_o3 = atof(input);
printf("SO2 limit (current: %.2f): ", limit_so2);
fgets(input, sizeof(input), stdin);
if (strlen(input) > 1) limit_so2 = atof(input);
printf("Data collection interval (in seconds, current: %d): ", collection_interval);
fgets(input, sizeof(input), stdin);
if (strlen(input) > 1) collection_interval = atoi(input);
printf("Data retention period (in days, current: %d): ", retention_period);
fgets(input, sizeof(input), stdin);
if (strlen(input) > 1) retention_period = atoi(input);
printf("Configuration updated.\n");
}