Commit 873a0ccd authored by Achim Morschhauser's avatar Achim Morschhauser
Browse files

Multi buffer

parent c54923a0
......@@ -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;
......
......@@ -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
//
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment