Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
The container registry cleanup task is now completed and the registry can be used normally.
Open sidebar
dcdb
dcdb
Commits
39479779
Commit
39479779
authored
Apr 01, 2020
by
Alessio Netti
Browse files
Analytics: fixing sensor cache initialization
parent
75563503
Changes
4
Hide whitespace changes
Inline
Side-by-side
analytics/includes/JobOperatorTemplate.h
View file @
39479779
...
...
@@ -225,7 +225,7 @@ protected:
// The job unit is generated as a hierarchical unit
jobUnit
=
unitGen
.
generateFromTemplate
(
uTemplate
,
jobTopic
,
jobData
.
nodes
,
this
->
_mqttPart
,
this
->
_enforceTopics
,
this
->
_relaxed
);
// Initializing sensors if necessary
jobUnit
->
init
(
this
->
_
cacheSize
);
jobUnit
->
init
(
this
->
_
interval
);
this
->
addToUnitCache
(
jobUnit
);
}
return
jobUnit
;
...
...
analytics/includes/OperatorTemplate.h
View file @
39479779
...
...
@@ -231,7 +231,7 @@ public:
OperatorInterface
::
init
(
io
);
for
(
const
auto
u
:
_units
)
u
->
init
(
_
cacheSize
);
u
->
init
(
_
interval
);
this
->
execOnInit
();
}
...
...
@@ -350,7 +350,7 @@ public:
addToUnitCache
(
tempUnit
);
}
// Initializing sensors if necessary
tempUnit
->
init
(
_
cacheSize
);
tempUnit
->
init
(
_
interval
);
compute
(
tempUnit
);
retrieveAndFlush
(
outMap
,
tempUnit
);
}
catch
(
const
exception
&
e
)
{
...
...
analytics/includes/UnitInterface.h
View file @
39479779
...
...
@@ -59,9 +59,9 @@ public:
/**
* @brief Initializes the sensors in the unit
*
* @param
cacheSize size of the sensor cache
* @param
interval Sampling interval in milliseconds
*/
virtual
void
init
(
unsigned
int
cacheSize
)
=
0
;
virtual
void
init
(
unsigned
int
interval
)
=
0
;
/**
* @brief Sets the name of this unit
...
...
analytics/includes/UnitTemplate.h
View file @
39479779
...
...
@@ -177,16 +177,16 @@ public:
/**
* @brief Initializes the sensors in the unit
*
* @param
cacheSize size of the sensor cache
* @param
interval Sampling interval in milliseconds
*/
void
init
(
unsigned
int
cacheSize
)
override
{
void
init
(
unsigned
int
interval
)
override
{
for
(
const
auto
s
:
_outputs
)
if
(
!
s
->
isInit
())
s
->
initSensor
(
cacheSize
);
s
->
initSensor
(
interval
);
for
(
const
auto
&
su
:
_subUnits
)
for
(
const
auto
s
:
su
->
getOutputs
())
if
(
!
s
->
isInit
())
s
->
initSensor
(
cacheSize
);
s
->
initSensor
(
interval
);
}
/**
...
...
Write
Preview
Supports
Markdown
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