-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathVirtualSensorValue.h
More file actions
47 lines (40 loc) · 924 Bytes
/
VirtualSensorValue.h
File metadata and controls
47 lines (40 loc) · 924 Bytes
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
47
/**
* @file VirtualSensorValue.h
* @Author BeeeOn team
* @date
* @brief
*/
#ifndef VIRTUALSENSORVALUE_H
#define VIRTUALSENSORVALUE_H
#include <iostream>
#include <Poco/AutoPtr.h>
#include <Poco/Logger.h>
#include <Poco/Thread.h>
#include <Poco/Timer.h>
#include "utils.h"
/**
* Class for particular sensor value. If there is more "complex" value (other than constant), thread is started.
*/
class VirtualSensorValue {
public:
bool is_actuator;
float from;
float to;
float step;
long int change_time;
long int switch_time;
std::string generator_type; // XXX enum might be better
float actual_value;
int module_id;
Poco::Timer* timer;
Poco::Logger& log;
VirtualSensorValue();
virtual ~VirtualSensorValue();
void print();
void nextVal(Poco::Timer&);
void setNewVal(float val);
void startTimer();
private:
std::shared_ptr<Poco::FastMutex> value_change_mutex;
};
#endif /* VIRTUALSENSORVALUE_H */