Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dcdb
dcdb
Commits
9c92d372
Commit
9c92d372
authored
Feb 08, 2019
by
Micha Mueller
Browse files
Further fixes and improvements
parent
7cc73e39
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/includes/ConfiguratorTemplate.h
View file @
9c92d372
...
...
@@ -328,16 +328,6 @@ public:
//prints plugin specific configurator attributes and entities if present
printConfiguratorConfig
(
ll
);
/*
LOG_VAR(ll) << " Entities (" << _entityName << "):";
if (_sensorEntitys.size() != 0) {
for(auto e : _sensorEntitys) {
e->printConfig();
}
} else {
LOG_VAR(ll) << " No entities for this plugin";
}*/
LOG_VAR
(
ll
)
<<
" Groups:"
;
for
(
auto
g
:
_sensorGroups
)
{
g
->
SensorGroupInterface
::
printConfig
(
ll
);
...
...
@@ -633,7 +623,6 @@ protected:
if
(
_mqttPrefix
[
_mqttPrefix
.
length
()
-
1
]
!=
'/'
)
{
_mqttPrefix
.
append
(
"/"
);
}
LOG
(
debug
)
<<
" Using own MQTT-Prefix "
<<
_mqttPrefix
;
}
else
if
(
boost
::
iequals
(
global
.
first
,
"cacheInterval"
))
{
_cacheInterval
=
stoul
(
global
.
second
.
data
());
_cacheInterval
*=
1000
;
...
...
src/includes/SensorBase.h
View file @
9c92d372
...
...
@@ -288,19 +288,20 @@ public:
static
std
::
string
formatName
(
const
std
::
string
&
name
,
int
cpuID
=-
1
)
{
return
cpuID
<
0
?
name
:
"cpu"
+
std
::
to_string
(
cpuID
)
+
"."
+
name
;}
virtual
void
printConfig
(
LOG_LEVEL
ll
,
LOGGER
&
lg
)
{
LOG_VAR
(
ll
)
<<
" Sensor "
<<
_name
;
LOG_VAR
(
ll
)
<<
" MQTT Topic: "
<<
_mqtt
;
if
(
_skipConstVal
)
{
LOG_VAR
(
ll
)
<<
" Skipping constant values"
;
}
else
{
LOG_VAR
(
ll
)
<<
" No skipping of constant values"
;
}
LOG_VAR
(
ll
)
<<
" Sensor: "
<<
_name
;
LOG_VAR
(
ll
)
<<
" MQTT Topic: "
<<
_mqtt
;
LOG_VAR
(
ll
)
<<
" sink: "
<<
getSinkPath
();
LOG_VAR
(
ll
)
<<
" subSampling: "
<<
getSubsampling
();
if
(
_skipConstVal
)
{
LOG_VAR
(
ll
)
<<
" Skipping constant values"
;
}
else
{
LOG_VAR
(
ll
)
<<
" No skipping of constant values"
;
}
if
(
_delta
)
{
LOG_VAR
(
ll
)
<<
" Storing delta readings"
;
if
(
_delta
)
{
LOG_VAR
(
ll
)
<<
"
Storing delta readings"
;
}
else
{
LOG_VAR
(
ll
)
<<
" Storing absolute readings"
;
LOG_VAR
(
ll
)
<<
"
Storing absolute readings"
;
}
}
...
...
src/includes/SensorGroupInterface.h
View file @
9c92d372
...
...
@@ -81,7 +81,7 @@ public:
}
virtual
void
printConfig
(
LOG_LEVEL
ll
)
{
LOG_VAR
(
ll
)
<<
" Sensor Group "
<<
_groupName
;
LOG_VAR
(
ll
)
<<
" Sensor Group
:
"
<<
_groupName
;
if
(
_mqttPart
!=
""
)
{
LOG_VAR
(
ll
)
<<
" MQTT part: "
<<
_mqttPart
;
}
...
...
src/sensors/bacnet/BACnetConfigurator.cpp
View file @
9c92d372
...
...
@@ -73,7 +73,7 @@ void BACnetConfigurator::global(CFG_VAL config) {
}
void
BACnetConfigurator
::
printConfiguratorConfig
(
LOG_LEVEL
ll
)
{
LOG_VAR
(
ll
)
<<
" No
t
other plugin specific general attributes"
;
LOG_VAR
(
ll
)
<<
"
No other plugin specific general attributes"
;
if
(
_bacClient
)
{
_bacClient
->
printConfig
(
ll
);
...
...
src/sensors/bacnet/BACnetSensorBase.h
View file @
9c92d372
...
...
@@ -58,11 +58,11 @@ public:
void
setObjectIndex
(
int32_t
objectIndex
)
{
_objectIndex
=
objectIndex
;
}
void
printConfig
(
LOG_LEVEL
ll
,
LOGGER
&
lg
)
override
{
LOG_VAR
(
ll
)
<<
" Factor: "
<<
_factor
;
LOG_VAR
(
ll
)
<<
" objectInstance: "
<<
_objectInstance
;
LOG_VAR
(
ll
)
<<
" objectType: "
<<
_objectType
;
LOG_VAR
(
ll
)
<<
" propertyId: "
<<
_propertyId
;
LOG_VAR
(
ll
)
<<
" objectIndex: "
<<
_objectIndex
;
LOG_VAR
(
ll
)
<<
"
Factor: "
<<
_factor
;
LOG_VAR
(
ll
)
<<
"
objectInstance: "
<<
_objectInstance
;
LOG_VAR
(
ll
)
<<
"
objectType: "
<<
_objectType
;
LOG_VAR
(
ll
)
<<
"
propertyId: "
<<
_propertyId
;
LOG_VAR
(
ll
)
<<
"
objectIndex: "
<<
_objectIndex
;
}
protected:
...
...
src/sensors/bacnet/BACnetSensorGroup.cpp
View file @
9c92d372
...
...
@@ -31,17 +31,6 @@ void BACnetSensorGroup::init(boost::asio::io_service& io) {
SensorGroupTemplate
::
init
(
io
);
if
(
_bacClient
)
{
_bacClient
->
initializeStrand
(
io
);
#ifdef DEBUG
LOG
(
debug
)
<<
" DeviceInstance: "
<<
_deviceInstance
;
LOG
(
debug
)
<<
" "
<<
_sensors
.
size
()
<<
" Sensors:"
;
for
(
const
auto
&
s
:
_sensors
)
{
LOG
(
debug
)
<<
" "
<<
s
->
getName
();
LOG
(
debug
)
<<
" ObjectInstance: "
<<
s
->
getObjectInstance
();
LOG
(
debug
)
<<
" ObjectType: "
<<
s
->
getObjectType
();
LOG
(
debug
)
<<
" PropertyId: "
<<
s
->
getPropertyId
();
}
#endif
}
else
{
LOG
(
error
)
<<
"No BACnetClient set for sensor "
<<
_groupName
<<
"! Cannot initialize sensor."
;
}
...
...
src/sensors/bacnet/BACnetSensorGroup.h
View file @
9c92d372
...
...
@@ -30,7 +30,7 @@ public:
void
setDeviceInstance
(
const
std
::
string
&
deviceInstance
)
{
_deviceInstance
=
stoul
(
deviceInstance
);
}
uint32_t
getDeviceInstance
()
const
{
return
_deviceInstance
;
}
void
printConfig
(
LOG_LEVEL
ll
);
void
printConfig
(
LOG_LEVEL
ll
)
override
;
private:
void
read
()
override
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment