Skip to content
GitLab
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
ad900b23
Commit
ad900b23
authored
Mar 31, 2021
by
Thomas Edwards
Browse files
Fixed some logic, appears to be a working solution. Still lots of debug prints
parent
523e8f24
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Filter_Obs.cpp
View file @
ad900b23
...
...
@@ -417,7 +417,8 @@ int Filter_Obs::lowpass_PLASMON_1Hz(buffer_obs* buffer_in,
// Degbugging monitoring info
// --------------------------------------------------------------
std
::
cerr
<<
"-----------------------------------"
<<
std
::
endl
;
std
::
cerr
<<
"No. Rec: "
<<
tofilter1
.
size
()
<<
" | "
;
std
::
cerr
<<
"Latest timestamp: "
<<
tofilter1
.
back
()
->
get_sec
()
<<
"."
<<
tofilter1
.
back
()
->
get_msec
()
<<
" | "
;
// std::cerr << "No. Rec: " << tofilter1.size() << " | ";
// std::cerr << "Elapsed time: ";
// long long check_time_diff = (((time_block_info.back().start.tv_sec - time_block_info.front().start.tv_sec) * 1e9) + (time_block_info.back().start.tv_nsec - time_block_info.front().start.tv_nsec));
// std::cerr << check_time_diff << " | ";
...
...
@@ -446,9 +447,10 @@ int Filter_Obs::lowpass_PLASMON_1Hz(buffer_obs* buffer_in,
int
points_to_drop
=
0
;
// Check if we have (8*(blocks) +/- 1) data in the filter que
time_block_check
=
8
*
(
total_blocks
);
std
::
cerr
<<
"Filter blocks and data check: "
<<
tofilter1
.
size
()
<<
" "
<<
time_block_check
<<
std
::
endl
;
while
(((
tofilter1
.
size
()
<
(
time_block_check
+
1
))
||
(
tofilter1
.
size
()
>
(
time_block_check
-
1
)))
&&
(
check_filters
>=
1
))
{
std
::
cerr
<<
"Run the filter! "
<<
std
::
endl
;
bool
run_the_filter
=
((
tofilter1
.
size
()
<=
(
time_block_check
+
1
))
&&
(
tofilter1
.
size
()
>=
(
time_block_check
-
1
)))
&&
(
check_filters
>=
1
);
std
::
cerr
<<
"Data in que: "
<<
tofilter1
.
size
()
<<
" | blocks*8: "
<<
time_block_check
<<
" | Run the filter?: "
<<
run_the_filter
<<
std
::
endl
;
while
(
run_the_filter
)
{
// std::cerr << "Run the filter! " << std::endl;
// Try to just run as normal
try
{
filter1_win
=
&
filter1_wins
.
at
(
tofilter1
.
size
());
...
...
@@ -459,7 +461,7 @@ int Filter_Obs::lowpass_PLASMON_1Hz(buffer_obs* buffer_in,
// Use the time_block_check information to assume if we are over or under
// this is just the +/- part, so we can expand or reduce the filter to match
int
filter_jitter
=
time_block_check
-
tofilter1
.
size
();
std
::
cerr
<<
"Filter Jitter: "
<<
filter_jitter
<<
std
::
endl
;
std
::
cerr
<<
"
OOR err,
Filter Jitter: "
<<
filter_jitter
<<
std
::
endl
;
// // DEBUG: Test the vector copy constructor
// std::vector <data_obs*> test_vec;
...
...
@@ -488,6 +490,8 @@ int Filter_Obs::lowpass_PLASMON_1Hz(buffer_obs* buffer_in,
time_block_check
=
8
*
(
total_blocks
);
check_filters
=
total_blocks
/
16
;
std
::
cerr
<<
"Filter blocks and data check (after filter): "
<<
tofilter1
.
size
()
<<
" "
<<
time_block_check
<<
std
::
endl
;
run_the_filter
=
((
tofilter1
.
size
()
<=
(
time_block_check
+
1
))
&&
(
tofilter1
.
size
()
>=
(
time_block_check
-
1
)))
&&
(
check_filters
>=
1
);
// // Drop the oldest block information
// time_block_info.erase(time_block_info.begin());
// filter1_blocks_info.erase(filter1_blocks_info.begin());
...
...
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