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
873a0ccd
Commit
873a0ccd
authored
Jul 29, 2019
by
Achim Morschhauser
Browse files
Multi buffer
parent
c54923a0
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/buffer_obs_file.hpp
View file @
873a0ccd
...
...
@@ -32,7 +32,7 @@ std::string path;
// Format of output file (strftime)
std
::
string
format
;
// Currently opened filename (no path)
std
::
string
filename
;
std
::
string
filename
=
""
;
// File stream
std
::
fstream
file
;
...
...
include/buffer_obs_mult.hpp
View file @
873a0ccd
...
...
@@ -27,7 +27,7 @@ class buffer_obs_mult : public buffer_obs
private:
// Vector of buffers
std
::
vector
<
buffer_obs
*>
buffers
;
std
::
vector
<
buffer_obs
*>
buffers
;
//
// Constructors
...
...
@@ -37,6 +37,9 @@ public:
buffer_obs_mult
(
buffer_obs
*
buffer
);
// Don't allow to avoid checking for empty buffer
//buffer_obs_mult();
//
// Public Methods
//
...
...
usr/src/OBSDAQ_Logger.cpp
View file @
873a0ccd
...
...
@@ -2,7 +2,8 @@
#include
<stdio.h>
#include
<iostream>
#include
<thread>
//#include <thread>
//#include <vector>
// C++ Headers from library (should use dynamic linking in future)
...
...
@@ -10,6 +11,7 @@
#include
<driver_obs_obsdaq.hpp>
#include
<buffer_obs_pipe.hpp>
#include
<buffer_obs_file.hpp>
#include
<buffer_obs_mult.hpp>
#include
<buffer_obs_queue.hpp>
#include
<Obs_Calibration_Vector.hpp>
#include
<Parameters_Reader.hpp>
...
...
@@ -43,9 +45,10 @@ int main(int argc, char* argv[]) {
double
Y_s
=
par
.
get_dbl
(
"Y_s"
);
double
Z_s
=
par
.
get_dbl
(
"Z_s"
);
// Initialize new buffer for STDOUT
buffer_obs_file
pipe
=
buffer_obs_file
(
5
,
par
.
get_str
(
"PATH"
),
par
.
get_str
(
"FORMAT"
));
// Initialize output buffers
buffer_obs_mult
mult
=
new
buffer_obs_mult
(
new
buffer_obs_pipe
(
5
));
mult
.
add
(
new
buffer_obs_file
(
5
,
par
.
get_str
(
"PATH"
),
par
.
get_str
(
"FORMAT_1Hz"
)));
// Initialize the calibration constants for FGE
Obs_Calibration_Vector
cal
=
Obs_Calibration_Vector
(
X_s
/
R
,
Y_s
/
R
,
Z_s
/
R
);
...
...
@@ -54,7 +57,7 @@ int main(int argc, char* argv[]) {
// Initialize new OBSDAQ device
driver_obs_obsdaq
obsdaq
=
driver_obs_obsdaq
(
par
.
get_str
(
"PORT"
),
par
.
get_int
(
"BAUD"
),
&
pipe
,
&
cal
,
par
.
get_int
(
"ADDRESS"
));
par
.
get_int
(
"BAUD"
),
&
mult
,
&
cal
,
par
.
get_int
(
"ADDRESS"
));
// Get some data
...
...
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