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
66b90453
Commit
66b90453
authored
Sep 30, 2020
by
Alessio Netti
Browse files
Analytics: fixing weight computation in Smoothing plugin
parent
3ec9c4ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
analytics/operators/smoothing/SmoothingSensorBase.h
View file @
66b90453
...
...
@@ -77,6 +77,11 @@ public:
void
smoothAndStore
(
reading_t
r
)
{
double
weight
=
(
double
)(
r
.
timestamp
-
_currTs
)
/
(
double
)
_range
;
if
(
weight
>
1.0
)
{
weight
=
1.0
;
}
else
if
(
weight
<
0.0
)
{
weight
=
0.0
;
}
_currValue
=
_last
?
(
_currValue
*
(
1.0
-
weight
)
+
(
double
)
r
.
value
*
weight
)
:
(
double
)
r
.
value
;
_currTs
=
r
.
timestamp
;
if
(
r
.
timestamp
-
_last
>
_range
)
{
...
...
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