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
cc1da25b
Commit
cc1da25b
authored
Jan 18, 2019
by
Micha Mueller
Browse files
Minor bugfixes. Init _lastRawUValue in constructors
parent
7b842a86
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/includes/SensorBase.h
View file @
cc1da25b
...
...
@@ -44,12 +44,14 @@ public:
_readingQueue
(
nullptr
),
_sinkFile
(
nullptr
)
{
_lastRawUValue
.
timestamp
=
0
;
_lastRawUValue
.
value
=
0
;
_lastRawValue
.
timestamp
=
0
;
_lastRawValue
.
value
=
0
;
_latestValue
.
timestamp
=
0
;
_latestValue
.
value
=
0
;
_lastSentValue
.
timestamp
=
0
;
_lastSentValue
.
value
=
0
;
_lastRawValue
.
timestamp
=
0
;
_lastRawValue
.
value
=
0
;
_accumulator
.
timestamp
=
0
;
_accumulator
.
value
=
0
;
}
...
...
@@ -66,8 +68,9 @@ public:
_cache
(
nullptr
),
_delta
(
other
.
_delta
),
_firstReading
(
true
),
_la
te
stValue
(
other
.
_la
te
stValue
),
_last
RawU
Value
(
other
.
_last
RawU
Value
),
_lastRawValue
(
other
.
_lastRawValue
),
_latestValue
(
other
.
_latestValue
),
_lastSentValue
(
other
.
_lastSentValue
),
_accumulator
(
other
.
_accumulator
),
_readingQueue
(
nullptr
),
...
...
@@ -87,10 +90,12 @@ public:
_cache
.
reset
(
nullptr
);
_delta
=
other
.
_delta
;
_firstReading
=
true
;
_lastRawUValue
.
timestamp
=
other
.
_lastRawUValue
.
timestamp
;
_lastRawUValue
.
value
=
other
.
_lastRawUValue
.
value
;
_lastRawValue
.
timestamp
=
other
.
_lastRawValue
.
timestamp
;
_lastRawValue
.
value
=
other
.
_lastRawValue
.
value
;
_latestValue
.
timestamp
=
other
.
_latestValue
.
timestamp
;
_latestValue
.
value
=
other
.
_latestValue
.
value
;
_lastRawValue
.
timestamp
=
other
.
_lastRawValue
.
timestamp
;
_lastRawValue
.
value
=
other
.
_lastRawValue
.
value
;
_lastSentValue
.
timestamp
=
other
.
_lastSentValue
.
timestamp
;
_lastSentValue
.
value
=
other
.
_lastSentValue
.
value
;
_accumulator
.
timestamp
=
other
.
_accumulator
.
timestamp
;
...
...
@@ -220,7 +225,8 @@ public:
* delta computation to detect an overflow.
*/
void
storeReading
(
ureading_t
rawReading
,
double
factor
=
1.0
,
unsigned
long
long
maxValue
=
ULLONG_MAX
)
{
reading_t
reading
=
rawReading
;
reading_t
reading
;
reading
.
timestamp
=
rawReading
.
timestamp
;
if
(
_delta
)
{
if
(
!
_firstReading
)
{
if
(
rawReading
.
value
<
_lastRawUValue
.
value
)
...
...
src/sensors/perfevent/PerfSensorGroup.cpp
View file @
cc1da25b
...
...
@@ -232,7 +232,7 @@ void PerfSensorGroup::read() {
for
(
unsigned
j
=
0
;
j
<
_sensors
.
size
();
j
++
)
{
if
(
rf
->
values
[
i
].
id
==
_ids
[
j
])
{
#ifdef DEBUG
LOG
(
debug
)
<<
_groupName
<<
"::"
<<
_sensors
[
j
]
->
getName
()
<<
" raw reading:
\"
"
<<
val
<<
"
\"
"
;
LOG
(
debug
)
<<
_groupName
<<
"::"
<<
_sensors
[
j
]
->
getName
()
<<
" raw reading:
\"
"
<<
reading
.
val
ue
<<
"
\"
"
;
#endif
if
(
_lastValid
){
//storeReading takes care of delta computation and applies correction value on the result
...
...
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