-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestReader.cpp
47 lines (37 loc) · 1.04 KB
/
testReader.cpp
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
45
46
#include "testReader.h"
#include "utils.h"
#include "units.h"
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <termios.h>
#include "WeatherSource.h"
TestReader::TestReader( Config &cfg ):
dbg("TestReader")
{
if ( cfg.getInteger("test_only") != 1 )
{
printf("Cannot use testReader except in TEST_ONLY mode!\n");
exit(0);
}
}
bool TestReader::read( )
{
wd->setValue(WeatherData::SLP, 30.12 );
wd->setValue(WeatherData::insideTemp, 68.0 );
wd->setValue(WeatherData::insideHumidity, 35 );
wd->setValue(WeatherData::outsideTemp, 54.1 );
wd->setValue(WeatherData::outsideHumidity, 88 );
wd->setValue(WeatherData::windSpeed, 12.1 );
wd->setValue(WeatherData::windDirection, 173 );
wd->setValue(WeatherData::dailyRain, .01 );
wd->setValue(WeatherData::dailyET, .03 );
wd->setValue(WeatherData::solarRadiation, 1023 );
wd->setValue(WeatherData::UV, 7.1 );
return true;
}