Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dcdb
dcdb
Commits
14cb641a
Commit
14cb641a
authored
Dec 04, 2019
by
Micha Müller
Browse files
Pusher: ConfiguratorTemplateEntity: remove code to read in SensorGroups without associated Entity
parent
5c7ca5ab
Changes
1
Hide whitespace changes
Inline
Side-by-side
dcdbpusher/includes/ConfiguratorTemplateEntity.h
View file @
14cb641a
...
...
@@ -102,7 +102,7 @@ class ConfiguratorTemplateEntity : public ConfiguratorTemplate<SBase, SGroup> {
//read global variables (if present overwrite those from global.conf)
readGlobal
(
cfg
);
//read
groups and templates for groups. If present also entity/-
template stuff
//read
entities and
template stuff
BOOST_FOREACH
(
boost
::
property_tree
::
iptree
::
value_type
&
val
,
cfg
)
{
//template entity
if
(
boost
::
iequals
(
val
.
first
,
"template_"
+
_entityName
))
{
...
...
@@ -199,51 +199,6 @@ class ConfiguratorTemplateEntity : public ConfiguratorTemplate<SBase, SGroup> {
delete
entity
;
}
}
//group
}
else
if
(
boost
::
iequals
(
val
.
first
,
_groupName
))
{
LOG
(
debug
)
<<
_groupName
<<
"
\"
"
<<
val
.
second
.
data
()
<<
"
\"
"
;
if
(
!
val
.
second
.
empty
())
{
SG_Ptr
group
=
std
::
make_shared
<
SGroup
>
(
val
.
second
.
data
());
if
(
readSensorGroup
(
*
group
,
val
.
second
))
{
storeSensorGroup
(
group
);
}
else
{
LOG
(
warning
)
<<
_groupName
<<
"
\"
"
<<
val
.
second
.
data
()
<<
"
\"
has bad values! Ignoring..."
;
}
}
//single sensor
}
else
if
(
boost
::
iequals
(
val
.
first
,
"single_"
+
_baseName
))
{
LOG
(
debug
)
<<
"Single "
<<
_baseName
<<
"
\"
"
<<
val
.
second
.
data
()
<<
"
\"
"
;
if
(
!
val
.
second
.
empty
())
{
SG_Ptr
group
=
std
::
make_shared
<
SGroup
>
(
val
.
second
.
data
());
if
(
readSensorGroup
(
*
group
,
val
.
second
))
{
//group which consists of only one sensor
SB_Ptr
sensor
;
//perhaps one sensor is already present because it was copied from the template group
if
(
group
->
getDerivedSensors
().
size
()
!=
0
)
{
sensor
=
group
->
getDerivedSensors
()[
0
];
sensor
->
setName
(
val
.
second
.
data
());
if
(
readSensorBase
(
*
sensor
,
val
.
second
))
{
storeSensorGroup
(
group
);
}
else
{
LOG
(
warning
)
<<
"Single "
<<
_baseName
<<
" "
<<
val
.
second
.
data
()
<<
" could not be read! Omitting"
;
}
}
else
{
sensor
=
std
::
make_shared
<
SBase
>
(
val
.
second
.
data
());
if
(
readSensorBase
(
*
sensor
,
val
.
second
))
{
group
->
pushBackSensor
(
sensor
);
storeSensorGroup
(
group
);
}
else
{
LOG
(
warning
)
<<
"Single "
<<
_baseName
<<
" "
<<
val
.
second
.
data
()
<<
" could not be read! Omitting"
;
}
}
}
else
{
LOG
(
warning
)
<<
"Single "
<<
_baseName
<<
"
\"
"
<<
val
.
second
.
data
()
<<
"
\"
has bad values! Ignoring..."
;
}
}
}
else
if
(
!
boost
::
iequals
(
val
.
first
,
"global"
))
{
LOG
(
error
)
<<
"
\"
"
<<
val
.
first
<<
"
\"
: unknown construct!"
;
return
false
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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