libhomegear-base
0.7
Base library for Homegear and Homegear family modules.
Role.h
Go to the documentation of this file.
1
//
2
// Created by sathya on 17.09.19.
3
//
4
5
#ifndef LIBHOMEGEAR_BASE_ROLE_H
6
#define LIBHOMEGEAR_BASE_ROLE_H
7
8
#include <cstdint>
9
10
namespace
BaseLib
{
11
12
enum class
RoleLevel
{
13
undefined
= -1,
14
mainCategory
= 0,
15
subCategory
= 1,
16
role
= 2
17
};
18
19
enum class
RoleDirection
{
20
undefined
= -1,
21
input
= 0,
22
output
= 1,
23
both
= 2
24
};
25
26
struct
RoleScaleInfo
{
27
bool
valueSet =
false
;
28
double
valueMin = 0;
29
double
valueMax = 0;
30
double
scaleMin = 0;
31
double
scaleMax = 0;
32
};
33
34
struct
Role
{
35
Role
() =
default
;
36
37
Role
(uint64_t
id
,
RoleDirection
direction,
bool
invert,
bool
scale,
RoleScaleInfo
scaleInfo) : id(id), direction(direction), invert(invert), scale(scale), scaleInfo(scaleInfo) {
38
if
((
id
/ 10000) * 10000 ==
id
) level =
RoleLevel::mainCategory
;
39
else
if
((
id
/ 100) * 100 ==
id
) level =
RoleLevel::subCategory
;
40
else
level =
RoleLevel::role
;
41
}
42
43
uint64_t
id
;
44
RoleLevel
level =
RoleLevel::undefined
;
45
RoleDirection
direction =
RoleDirection::both
;
46
bool
invert =
false
;
47
bool
scale =
false
;
48
RoleScaleInfo
scaleInfo
;
49
};
50
51
}
52
#endif //LIBHOMEGEAR_BASE_ROLE_H
BaseLib::RoleScaleInfo
Definition:
Role.h:26
BaseLib::RoleLevel::undefined
BaseLib::RoleLevel::mainCategory
BaseLib::RoleLevel::subCategory
BaseLib
Definition:
BaseLib.cpp:34
BaseLib::Role::Role
Role(uint64_t id, RoleDirection direction, bool invert, bool scale, RoleScaleInfo scaleInfo)
Definition:
Role.h:37
BaseLib::RoleLevel
RoleLevel
Definition:
Role.h:12
BaseLib::Role
Definition:
Role.h:34
BaseLib::RoleLevel::role
BaseLib::Role::scaleInfo
RoleScaleInfo scaleInfo
Definition:
Role.h:48
BaseLib::Role::id
uint64_t id
Definition:
Role.h:43
BaseLib::RoleDirection::input
BaseLib::RoleDirection::both
BaseLib::RoleDirection::output
BaseLib::RoleDirection
RoleDirection
Definition:
Role.h:19
Systems
Role.h
Generated on Tue Nov 22 2022 10:45:31 for libhomegear-base by
1.8.12