Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Achim Morschhauser
GeomagLogger
Commits
9243b6a7
Commit
9243b6a7
authored
Dec 16, 2020
by
Achim Morschhauser
Browse files
Add error logging timestamp for data
parent
34463b00
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/data_obs.cpp
View file @
9243b6a7
...
...
@@ -678,6 +678,7 @@ int data_obs::filter_fir_sym_data(std::vector <data_obs*>* data,
double
data_in
[
N_data
];
//std::string datastr;
std
::
string
timestamp
;
// Number of data
int
N
=
data
->
size
();
...
...
@@ -701,6 +702,13 @@ int data_obs::filter_fir_sym_data(std::vector <data_obs*>* data,
if
(
data_in
[
j
]
==
MD
)
{
missing
[
j
]
+=
win
->
at
(
i
);
missing_N
[
j
]
++
;
timestamp
=
data
->
at
(
i
)
->
get_time
(
"%Y-%m-%d %H:%M:%S"
,
true
);
std
::
cerr
<<
"["
<<
timestamp
<<
"]: "
<<
"Found missing data in filter: "
<<
j
<<
" "
<<
missing
[
j
]
<<
" "
<<
missing_N
[
j
]
<<
" "
<<
data
->
size
()
<<
std
::
endl
;
// Calculate filtered data
}
else
{
sum
[
j
]
+=
(
data_in
[
j
]);
...
...
@@ -718,14 +726,12 @@ int data_obs::filter_fir_sym_data(std::vector <data_obs*>* data,
if
(
missing_N
[
j
]
==
N
){
this
->
data
[
j
]
=
MD
;
}
else
{
/*std::cerr << "DEBUG FILTER: "
<< filtered[j] << " "
<< missing_N[j] << " "
<< missing[j] << " "
<< sum[j] << " "
<< std::endl;
*/
this
->
data
[
j
]
=
filtered
[
j
]
+
1
/
(
N
-
missing_N
[
j
])
*
missing
[
j
]
*
sum
[
j
];
timestamp
=
this
->
get_time
(
"%Y-%m-%d %H:%M:%S"
,
true
);
std
::
cerr
<<
"["
<<
timestamp
<<
"]: "
;
this
->
data
[
j
]
=
filtered
[
j
]
/
(
1
-
missing
[
j
]);
std
::
cerr
<<
"FILTERED DATA SET TO : "
<<
this
->
data
[
j
]
<<
std
::
endl
;
}
}
...
...
src/driver_obs_obsdaq.cpp
View file @
9243b6a7
...
...
@@ -1030,6 +1030,8 @@ int driver_obs_obsdaq::parse_data_bin(data_obs_vector* data, char* buf) {
// Check 7th bits
for
(
int
i
=
0
;
i
<
reclen
;
i
++
){
if
((
unsigned
char
)
buf
[
i
]
<
32
||
(
unsigned
char
)
buf
[
i
]
>
159
){
std
::
string
timestamp
=
data
->
get_time
(
"%Y-%m-%d %H:%M:%S"
,
true
);
std
::
cerr
<<
"["
<<
timestamp
<<
"]: "
;
fprintf
(
stderr
,
"Faulty data: 7th bit check failed for byte "
"%d: %d.
\n
"
,
i
,(
unsigned
char
)
buf
[
i
]);
fprintf
(
stderr
,
"%d%d%d%d%d%d%d%d
\n
"
,
buf
[
i
]
&
1
,(
buf
[
i
]
&
2
)
/
2
,
...
...
@@ -1047,6 +1049,8 @@ int driver_obs_obsdaq::parse_data_bin(data_obs_vector* data, char* buf) {
}
// Last byte must contain sum of last (N-1) bytes in bits 0-6
if
(
(
tmp_d
&
0x7F
)
!=
(
buf
[
reclen
-
1
]
&
0x7F
)
){
std
::
string
timestamp
=
data
->
get_time
(
"%Y-%m-%d %H:%M:%S"
,
true
);
std
::
cerr
<<
"["
<<
timestamp
<<
"]: "
;
fprintf
(
stderr
,
"Faulty data: Control sum check failed for "
);
for
(
int
i
=
0
;
i
<
reclen
-
1
;
i
++
){
fprintf
(
stderr
,
"%02X "
,
buf
[
i
]);
...
...
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