libhomegear-base  0.7
Base library for Homegear and Homegear family modules.
HmPhysicalParameter.h
Go to the documentation of this file.
1 /* Copyright 2013-2019 Homegear GmbH
2  *
3  * libhomegear-base is free software: you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public License as
5  * published by the Free Software Foundation, either version 3 of the
6  * License, or (at your option) any later version.
7  *
8  * libhomegear-base is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with libhomegear-base. If not, see
15  * <http://www.gnu.org/licenses/>.
16  *
17  * In addition, as a special exception, the copyright holders give
18  * permission to link the code of portions of this program with the
19  * OpenSSL library under certain conditions as described in each
20  * individual source file, and distribute linked combinations
21  * including the two.
22  * You must obey the GNU Lesser General Public License in all respects
23  * for all of the code used other than OpenSSL. If you modify
24  * file(s) with this exception, you may extend this exception to your
25  * version of the file(s), but you are not obligated to do so. If you
26  * do not wish to do so, delete this exception statement from your
27  * version. If you delete this exception statement from all source
28  * files in the program, then also delete it here.
29 */
30 
31 #ifndef HMPHYSICALPARAMETER_H_
32 #define HMPHYSICALPARAMETER_H_
33 
34 #include "../../HelperFunctions/HelperFunctions.h"
35 
36 #include <string>
37 #include <vector>
38 #include <memory>
39 
40 namespace BaseLib
41 {
42 
43 class SharedObjects;
44 
45 namespace HmDeviceDescription
46 {
47 
49 {
50 public:
51  std::string frame;
52  bool dominoEvent = false;
53  int32_t dominoEventValue = 0;
54  std::string dominoEventDelayID;
55 
58 };
59 
61 {
62 public:
63  struct Operation
64  {
65  enum Enum { none, addition, substraction };
66  };
67  Operation::Enum operation = Operation::none;
68  double index = 0;
69  double step = 0;
70 
73 };
74 
76 {
77 public:
79  {
80  enum Enum { none, e, g, l, ge, le };
81  };
82 
83  std::string frame;
84  BooleanOperator::Enum conditionOperator = BooleanOperator::Enum::none;
85  int32_t value = 0;
86 
88  SetRequestEx(SharedObjects* baseLib, xml_node* node);
89  virtual ~SetRequestEx() {}
90 
91  bool checkCondition(int32_t value);
92 };
93 
95 {
96 public:
97  struct Type
98  {
99  enum Enum { none, typeBoolean, typeInteger, typeString };
100  };
101  struct Interface
102  {
103  enum Enum { none, command, centralCommand, internal, config, configString, store, eeprom };
104  };
105  struct Endian
106  {
107  enum Enum { little, big };
108  };
109  Type::Enum type = Type::Enum::none;
110  Interface::Enum interface = Interface::Enum::none;
111  Endian::Enum endian = Endian::Enum::big;
112  uint32_t list = 9999;
113  double index = 0;
114  uint32_t startIndex = 0;
115  uint32_t endIndex = 0;
116  bool sizeDefined = false;
117  double size = 1.0;
118  int32_t mask = -1;
119  //int32_t readSize = -1;
120  std::string valueID;
121  //bool noInit = false;
122  std::string getRequest;
123  std::string getResponse;
124  std::vector<std::shared_ptr<SetRequestEx>> setRequestsEx;
125  std::string setRequest;
126 
127  //std::string counter;
128  std::vector<std::shared_ptr<PhysicalParameterEvent>> eventFrames;
129  std::vector<std::string> resetAfterSend;
130  //bool isVolatile = false;
131  std::string id;
133 
136  virtual ~PhysicalParameter() {}
137 };
138 
139 }
140 }
141 #endif /* PHYSICALPARAMETER_H_ */
PhysicalParameterAddress address
Definition: HmPhysicalParameter.h:132
SetRequestEx()
Definition: HmPhysicalParameter.h:87
Enum
Definition: HmPhysicalParameter.h:99
virtual ~PhysicalParameter()
Definition: HmPhysicalParameter.h:136
Definition: HmPhysicalParameter.h:60
std::string dominoEventDelayID
Definition: HmPhysicalParameter.h:54
std::vector< std::string > resetAfterSend
Definition: HmPhysicalParameter.h:129
This is the base library main class.
Definition: BaseLib.h:95
Definition: HmPhysicalParameter.h:105
Definition: HmPhysicalParameter.h:97
std::string getResponse
Definition: HmPhysicalParameter.h:123
Definition: HmPhysicalParameter.h:94
Enum
Definition: HmPhysicalParameter.h:107
std::string id
Definition: HmPhysicalParameter.h:131
Definition: HmPhysicalParameter.h:75
std::string frame
Definition: HmPhysicalParameter.h:51
int32_t dominoEventValue
Definition: HmPhysicalParameter.h:53
Definition: BaseLib.cpp:34
std::string valueID
Definition: HmPhysicalParameter.h:120
PVariable value
Definition: UiElements.h:217
PhysicalParameterEvent()
Definition: HmPhysicalParameter.h:56
std::string frame
Definition: HmPhysicalParameter.h:83
bool dominoEvent
Definition: HmPhysicalParameter.h:52
std::string setRequest
Definition: HmPhysicalParameter.h:125
Definition: HmPhysicalParameter.h:48
virtual ~SetRequestEx()
Definition: HmPhysicalParameter.h:89
virtual ~PhysicalParameterEvent()
Definition: HmPhysicalParameter.h:57
std::vector< std::shared_ptr< SetRequestEx > > setRequestsEx
Definition: HmPhysicalParameter.h:124
Class representing a node of XML document.
Definition: rapidxml.h:539
PhysicalParameterAddress()
Definition: HmPhysicalParameter.h:71
virtual ~PhysicalParameterAddress()
Definition: HmPhysicalParameter.h:72
std::vector< std::shared_ptr< PhysicalParameterEvent > > eventFrames
Definition: HmPhysicalParameter.h:128
std::string getRequest
Definition: HmPhysicalParameter.h:122