Commit 04bdb7bc authored by Achim Morschhauser's avatar Achim Morschhauser
Browse files

Bug in supp. binary + .gitignore

parent 2e5606ac
......@@ -3,6 +3,8 @@
*~
.settings/
*.anjuta*
usr/data/*
usr/*
bin/*
lib/*
.cproject
......@@ -10,4 +12,12 @@ lib/*
PRIVATE/
CHANGELOG
DataLogger
!usr/GNUPLOT
!usr/GSM_Logger.cpp
!usr/OBSDAQ_Logger.cpp
!usr/Serial_Talk.cpp
!usr/Stream_Reader.cpp
!usr/START
!usr/par/parameters_default.par
!usr/par/ADC_example.par
!*/.gitkeep
......@@ -3,15 +3,15 @@ OBJ_DIR=lib/
HDR_DIR=include/
LIB_DIR=./lib/
USR_DIR=usr/
BIN_DIR=bin/
USE_SRC_DIR=usr/src/
USR_BIN_DIR=bin/
#--------------------------------------
#--------------------------------------
SRC_FILES = $(wildcard $(SRC_DIR)*.cpp)
OBJ_FILES = $(patsubst $(SRC_DIR)%.cpp,$(OBJ_DIR)%.o,$(SRC_FILES))
USR_FILES = $(wildcard $(USR_DIR)*.cpp)
USR_TARGET = $(patsubst $(USR_DIR)%.cpp,%,$(USR_FILES))
USR_FILES = $(wildcard $(USE_SRC_DIR)*.cpp)
USR_TARGET = $(patsubst $(USE_SRC_DIR)%.cpp,%,$(USR_FILES))
#--------------------------------------
CC=g++
......@@ -23,13 +23,13 @@ EXCL=driver_serial_emulate.o
.SECONDARY:
all: $(LIB_DIR)libLogger.so $(USR_TARGET:%=$(BIN_DIR)%)
all: $(LIB_DIR)libLogger.so $(USR_TARGET:%=$(USR_BIN_DIR)%)
%: $(BIN_DIR)%
%: $(USR_BIN_DIR)%
@echo ---- DONE ----
$(BIN_DIR)%: $(USR_DIR)%.cpp
$(USR_BIN_DIR)%: $(USE_SRC_DIR)%.cpp
$(CC) $(CCFLAGS) -no-pie $< -o $@ -I$(HDR_DIR) -L$(LIB_DIR) -Wl,-rpath,"\$$ORIGIN/../$(LIB_DIR)" -lLogger
# $(CC) $(CCFLAGS) $< -o $@ -I$(HDR_DIR) -L$(LIB_DIR) -lLogger
......@@ -40,6 +40,6 @@ $(LIB_DIR)libLogger.so: $(filter-out $(OBJ_DIR)$(EXCL) ,$(OBJ_FILES))
$(CC) $^ -shared -o $@
clean:
rm -f $(BIN_DIR)*
rm -f $(USR_BIN_DIR)*
rm -f $(OBJ_DIR)*
rm -f $(LIB_DIR)libLogger.so
......@@ -2,15 +2,15 @@ SRC_DIR=./src/
OBJ_DIR=./lib/
HDR_DIR=./include/
USR_DIR=./usr/
BIN_DIR=./bin/
USR_SRC_DIR=./usr/src/
USR_BIN_DIR=./bin/
#--------------------------------------
#--------------------------------------
SRC_FILES = $(wildcard $(SRC_DIR)*.cpp)
OBJ_FILES = $(patsubst $(SRC_DIR)%.cpp,$(OBJ_DIR)%.o,$(SRC_FILES))
USR_FILES = $(wildcard $(USR_DIR)*.cpp)
USR_TARGET = $(patsubst $(USR_DIR)%.cpp,%,$(USR_FILES))
USR_FILES = $(wildcard $(USR_SRC_DIR)*.cpp)
USR_TARGET = $(patsubst $(USR_SRC_DIR)%.cpp,%,$(USR_FILES))
#--------------------------------------
CC=g++
......@@ -22,18 +22,18 @@ EXCL=driver_serial_emulate.o
.SECONDARY:
all: $(USR_TARGET:%=$(BIN_DIR)%)
all: $(USR_TARGET:%=$(USR_BIN_DIR)%)
%: $(BIN_DIR)%
%: $(USR_BIN_DIR)%
@echo ---- DONE ----
$(BIN_DIR)%: $(filter-out $(OBJ_DIR)$(EXCL) ,$(OBJ_FILES)) $(USR_DIR)%.cpp
$(USR_BIN_DIR)%: $(filter-out $(OBJ_DIR)$(EXCL) ,$(OBJ_FILES)) $(USR_SRC_DIR)%.cpp
$(CC) $(CCFLAGS) -o $(@) $^ -I./include/
$(OBJ_DIR)%.o: $(SRC_DIR)%.cpp
$(CC) $(CCFLAGS) -c -o $@ $< -I$(HDR_DIR)
clean:
rm $(BIN_DIR)*
rm $(USR_BIN_DIR)*
rm $(OBJ_DIR)*
......@@ -60,7 +60,7 @@ static const int valid_filter_rates_num=11;
const char* filter_cmds[11];
/** Counting variable for binary data supplemental channels */
int supp_count;
int supp_count=0;
/** Baud rate codes */
const static std::unordered_map<int,std::string> map_baud;
......
......@@ -299,7 +299,7 @@ int Obs_Calibration_Vector::add_adc_calibrate(std::string config,
if (parse_adc_calibration(line,config,cal)==0) {
// Save key-value pair
map_ADC[config]=cal;
std::cout << "Read ADC: " << config << " " << cal.offset <<
std::cerr << "Read ADC: " << config << " " << cal.offset <<
" " << cal.scale << std::endl;
}
}
......
......@@ -232,7 +232,7 @@ int data_obs::string(std::string* string, int precision) {
str << setw(4) << year;
str << ' ' << setw(2) << mon << ' ' << setw(2) << day << ' ' << setw(2)
<< hour << ' ' << setw(2) << min << ' ' << setw(2) << sec << '.'
<< setw(5) << round(msec/1e4);
<< setw(3) << round(msec/1e6);
*string = str.str();
......
......@@ -882,7 +882,7 @@ int driver_obs_obsdaq::parse_data_bin(data_obs_vector* data, char* buf) {
}
// Check supplementary data
if (buf[1]&64){
if (buf[1]& (unsigned char) 64){
if (buf[1]&1){
supp_count=1;
} else if (supp_count) {
......@@ -923,8 +923,8 @@ int driver_obs_obsdaq::parse_data_bin(data_obs_vector* data, char* buf) {
num = (uint32_t) 0x8000;
if ((buf[1]&64) && supp_count >= 3 && supp_count <=4){
n32 = ( ( (buf[11 ]&127) + ((buf[0]&4 )<<5) ) <<8 )
+ ( ( (buf[12 ]&127) + ((buf[0]&2 )<<6) ) );
n32 = ( ( (buf[11 ]&127) + ((buf[1]&4 )<<5) ) <<8 )
+ ( ( (buf[12 ]&127) + ((buf[1]&2 )<<6) ) );
n[supp_count] = ((double) ((int32_t) ((n32 ^ num) - num))) / 8000.0;
}
......
# config (serialnumber/ccdd/channel),scale,offset
#include <iostream>
#include <string.h>
#include <inttypes.h>
#include <stdio.h>
#include <driver_obs_obsdaq.hpp>
#include <Obs_Calibration_Vector.hpp>
#include <Parameters_Reader.hpp>
#include <buffer_obs_pipe.hpp>
int main(){
// Create calibration vector
Obs_Calibration_Vector cal = Obs_Calibration_Vector();
// Read from parameters file
Parameters_Reader par = Parameters_Reader("usr/parameters.par");
// Initialize new buffer for STDOUT
//TODO Replace by null buffer (discard everything)
buffer_obs_pipe pipe = buffer_obs_pipe(5);
// Initialize new OBSDAQ device
driver_obs_obsdaq obsdaq = driver_obs_obsdaq(par.get_str("PORT"),
par.get_int("BAUD"), &pipe, &cal, 1);
std::string cmd;
int baud;
char term[1];
term[0]=13;
char buf[500];
std::cout << "BAUD: ";
std::cin >> baud;
driver_serial serial = driver_serial("/dev/ttyUSB0",term,1,baud);
while (1){
std::cout << "CMD: ";
std::cin >> cmd;
//if (cmd.compare("QUIT")){
// break;
//}
cmd=cmd+(char) 13;
serial.send((const char*) cmd.c_str());
serial.receive(buf,sizeof(buf),5);
std::cout << buf << std::endl;
/*
// Extract data from channels 1-3
uint32_t num = (uint32_t) 0x800000L;
uint32_t n32;
double n;
double M = 42.5 / 4 / (double) 0x800000;
// Channel 1
n32 = ( (uint32_t) ( (buf[2 ]&127) + ((buf[0]&32)<<2)) )<<16
+ ( (uint32_t) ( (buf[3 ]&127) + ((buf[0]&16)<<3)) )<<8
+ ( (uint32_t) ( (buf[4 ]&127) + ((buf[0]&8 )<<4)) );
n = (double) ((int32_t) ((n32 ^ num) - num)) * M;
printf("XYZ: %u %f\n",n32,n);
// Channel 2
n32 = ( (uint32_t) ( (buf[5 ]&127) + ((buf[0]&4 )<<5)) )<<16
+ ( (uint32_t) ( (buf[6 ]&127) + ((buf[0]&2 )<<6)) )<<8
+ ( (uint32_t) ( (buf[7 ]&127) + ((buf[0]&1 )<<7)) );
n = (double) ((int32_t) ((n32 ^ num) - num)) * M;
printf("XYZ: %u %f\n",n32,n);
// Channel 3
n32 = ((buf[8 ]&127) + ((buf[1]&32)<<2))<<16
+ ((buf[9 ]&127) + ((buf[1]&16)<<3))<<8
+ ((buf[10]&127) + ((buf[1]&8 )<<4));
n = (double) ((int32_t) ((n32 ^ num) - num)) * M;
printf("XYZ: %u %f\n",n32,n);
*/
}
}
This diff is collapsed.
Baud rate set to: 57600
SERIAL SEND: |01||||||||||||||||||||||||||||||||||||||||
SERIAL SEND: #01PP00000000
SERIAL SEND: $01QF
Received: 98
Run
SERIAL SEND: #01PP00000000
SERIAL SEND: $010WS02010282
SERIAL SEND: $011WS02010282
SERIAL SEND: $012WS02010282
Frequency set to: 128.00 Hz. Requested frequency: 100.00 Hz.
SERIAL SEND: $010RS
REC_CONFIG: !0132010282
SERIAL SEND: $011RS
REC_CONFIG: !0132010282
SERIAL SEND: $012RS
REC_CONFIG: !0132010282
SERIAL SEND: #01PP10000500
SERIAL SEND: #01PP00000000
SERIAL SEND: #01CB
2018 06 22 16 37 31.214 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 32.221 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 33.213 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 34.220 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 35.211 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 36.219 -4.12 -3.82 -0.93 -4.08 0.00
2018 06 22 16 37 37.210 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 38.217 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 39.209 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 40.216 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 41.208 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 42.215 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 43.206 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 44.214 -4.13 -3.82 -0.93 -4.08 0.00
2018 06 22 16 37 45.221 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 46.212 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 47.220 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 48.211 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 49.218 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 50.210 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 51.217 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 52.209 -4.13 -3.82 -0.93 -4.08 0.00
2018 06 22 16 37 53.216 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 54.208 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 55.215 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 56.206 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 57.214 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 58.221 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 37 59.212 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 00.220 -4.13 -3.82 -0.93 -4.08 0.00
2018 06 22 16 38 01.211 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 02.219 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 03.210 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 04.217 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 05.209 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 06.216 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 07.208 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 08.215 -4.13 -3.82 -0.93 -4.08 0.00
2018 06 22 16 38 09.207 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 10.214 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 11.221 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 12.213 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 13.220 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 14.211 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 15.219 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 16.210 -4.13 -3.82 -0.93 -4.08 0.00
2018 06 22 16 38 17.218 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 18.209 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 19.216 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 20.208 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 21.215 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 22.222 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 23.214 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 24.221 -4.13 -3.82 -0.93 -4.08 0.00
2018 06 22 16 38 25.212 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 26.220 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 27.211 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 28.219 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 29.210 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 30.218 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 31.209 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 32.216 -4.13 -3.82 -0.93 -4.08 0.00
2018 06 22 16 38 33.208 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 34.215 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 35.222 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 36.214 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 37.221 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 38.213 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 39.220 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 40.212 -4.13 -3.82 -0.93 -4.08 0.00
2018 06 22 16 38 41.219 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 42.210 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 43.218 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 44.209 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 45.217 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 46.208 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 47.215 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 48.223 -4.12 -3.82 -0.93 -4.08 0.00
2018 06 22 16 38 49.214 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 50.221 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 51.213 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 52.220 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 53.211 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 54.219 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 55.210 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 56.217 -4.12 -3.82 -0.93 -4.08 0.00
2018 06 22 16 38 57.209 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 58.216 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 38 59.207 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 00.215 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 01.222 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 02.214 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 03.221 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 04.212 -4.12 -3.82 -0.93 -4.08 0.00
2018 06 22 16 39 05.220 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 06.211 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 07.219 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 08.210 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 09.217 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 10.209 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 11.216 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 12.208 -4.13 -3.82 -0.93 -4.08 0.00
2018 06 22 16 39 13.215 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 14.222 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 15.214 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 16.221 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 17.213 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 18.220 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 19.211 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 20.219 -4.12 -3.82 -0.93 -4.08 0.00
2018 06 22 16 39 21.210 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 22.217 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 23.209 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 24.216 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 25.208 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 26.215 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 27.222 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 28.214 -4.12 -3.82 -0.93 -4.08 0.00
2018 06 22 16 39 29.221 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 30.212 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 31.220 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 32.211 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 33.218 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 34.210 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 35.217 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 36.209 -4.12 -3.82 -0.93 -4.08 0.00
2018 06 22 16 39 37.216 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 38.223 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 39.215 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 40.222 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 41.213 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 42.221 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 43.212 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 44.219 -4.12 -3.82 -0.93 -4.08 0.00
2018 06 22 16 39 45.211 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 46.218 -4.13 -3.82 -0.94 0.00 0.00
2018 06 22 16 39 47.210 -4.13 -3.82 -0.94 0.00 0.00
2018 06 22 16 39 48.217 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 49.208 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 50.216 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 51.223 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 52.214 -4.12 -3.82 -0.93 -4.08 0.00
2018 06 22 16 39 53.222 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 54.213 -4.13 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 55.220 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 56.212 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 57.219 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 58.211 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 39 59.218 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 00.209 -4.12 -3.82 -0.93 -4.08 0.00
2018 06 22 16 40 01.217 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 02.208 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 03.216 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 04.223 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 05.214 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 06.222 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 07.213 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 08.220 -4.12 -3.82 -0.93 -4.08 0.00
2018 06 22 16 40 09.212 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 10.219 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 11.210 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 12.218 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 13.209 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 14.217 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 15.224 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 16.215 -4.12 -3.82 -0.93 -4.08 0.00
2018 06 22 16 40 17.223 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 18.214 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 19.221 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 20.213 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 21.220 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 22.212 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 23.219 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 24.211 -4.12 -3.82 -0.93 -4.08 0.00
2018 06 22 16 40 25.218 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 26.209 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 27.217 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 28.224 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 29.215 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 30.223 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 31.214 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 32.222 -4.12 -3.82 -0.93 -4.08 0.00
2018 06 22 16 40 33.213 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 34.220 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 35.212 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 36.219 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 37.211 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 38.218 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 39.209 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 40.217 -4.12 -3.82 -0.93 -4.08 0.00
2018 06 22 16 40 41.224 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 42.216 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 43.223 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 44.214 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 45.222 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 46.213 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 47.220 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 48.212 -4.12 -3.82 -0.93 -4.08 0.00
2018 06 22 16 40 49.219 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 50.211 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 51.218 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 52.209 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 53.217 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 54.224 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 55.215 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 56.223 -4.12 -3.82 -0.93 -4.08 0.00
2018 06 22 16 40 57.214 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 58.222 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 40 59.213 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 41 00.220 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 41 01.212 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 41 02.219 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 41 03.211 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 41 04.218 -4.12 -3.82 -0.93 -4.08 0.00
2018 06 22 16 41 05.210 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 41 06.217 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 41 07.224 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 41 08.216 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 41 09.223 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 41 10.215 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 41 11.222 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 41 12.213 -4.12 -3.82 -0.93 -4.08 0.00
2018 06 22 16 41 13.220 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 41 14.212 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 41 15.219 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 41 16.211 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 41 17.218 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 41 18.209 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 41 19.217 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 41 20.224 -4.12 -3.82 -0.93 -4.08 0.00
2018 06 22 16 41 21.216 -4.12 -3.82 -0.93 0.00 0.00
2018 06 22 16 41 22.223 -4.12 -3.82 -0.93 0.00 0.00
set xdata time
set timefmt "%Y %m %d %H %M %S"
plot "< tail -n 5000 ../DATA/OBSDAQ.dat" using 1:7 w p title "128 Hz raw" lt rgb "black", "< tail -n 31 ../DATA/OBSDAQ_FILTER.dat" using 1:7 w l lw 5 title "1 Hz filtered" lt rgb "red"
pause 0.1
set multiplot layout 3,1
plot "< tail -n 5000 usr/data/OBSDAQ.dat" using 1:7 w p lt rgb "black" title "128 Hz raw",\
"< tail -n 31 usr/data/OBSDAQ_FILTER.dat" using 1:7 w l lw 5 lt rgb "red" title "1 Hz filtered"
plot "< tail -n 5000 usr/data/OBSDAQ.dat" using 1:8 w p lt rgb "black" title "128 Hz raw",\
"< tail -n 31 usr/data/OBSDAQ_FILTER.dat" using 1:8 w l lw 5 lt rgb "red" title "1 Hz filtered"
plot "< tail -n 5000 usr/data/OBSDAQ.dat" using 1:9 w p lt rgb "black" title "128 Hz raw",\
"< tail -n 31 usr/data/OBSDAQ_FILTER.dat" using 1:9 w l lw 5 lt rgb "red" title "1 Hz filtered"
pause 0.5
reread
//
// C Headers
//
#include <stdio.h>
//
// Custom C++ Headers
//
// Driver for GSM19
#include <driver_obs_gsm90.hpp>
// Data buffer implemented as pipe on stdout/stdin
#include <buffer_obs_pipe.hpp>
int main() {
// Initialize new data buffer
buffer_obs_pipe pipe = buffer_obs_pipe();
// Initialize new GSM90 device
// Provide serial port and buffer as arguments
driver_obs_gsm90 gsm90 = driver_obs_gsm90("/dev/ttyUSB0", &pipe);
// Take continuous measurements every 5s
printf("Run\n");
gsm90.run(5);
}
// C Headers
#include <stdio.h>
#include <iostream>
#include <thread>
// C++ Headers from library (should use dynamic linking in future)
#include <data_obs_vector.hpp>
#include <driver_obs_obsdaq.hpp>
#include <buffer_obs_pipe.hpp>
#include <buffer_obs_queue.hpp>
#include <Obs_Calibration_Vector.hpp>
#include <Parameters_Reader.hpp>
int main() {
// Read from parameters file
Parameters_Reader par = Parameters_Reader("usr/parameters.par");
// Set the calibration constants.
// Will be done in driver_obs_obsdaq constructor in future, and parameter
// file will be given as argument to constructor
double R = par.get_dbl("R");
double X_s = par.get_dbl("X_s");
double Y_s = par.get_dbl("Y_s");
double Z_s = par.get_dbl("Z_s");
// Initialize new buffer for STDOUT
buffer_obs_pipe pipe = buffer_obs_pipe(5);
// Initialize the calibration constants for FGE
Obs_Calibration_Vector cal = Obs_Calibration_Vector(X_s/R,Y_s/R,Z_s/R);
// Initialize the calibration constants for ObsDAQ
cal.set_adc_calibrate("usr/ADC.par");
// Initialize new OBSDAQ device
driver_obs_obsdaq obsdaq = driver_obs_obsdaq(par.get_str("PORT"),
par.get_int("BAUD"), &pipe, &cal, 1);
// Get some data
/*
data_obs_vector data=data_obs_vector();
printf("First try\n");
obsdaq.get(&data);
pipe.put(&data);
printf("Second try\n");
obsdaq.get(&data);
pipe.put(&data);
*/
// Take continuous measurements
fprintf(stderr,"Run\n");
obsdaq.freerun(par.get_dbl("Freq"));
}
./bin/OBSDAQ_Logger 2> usr/DATA/OBSDAQ.log | tee usr/DATA/OBSDAQ.dat | ./bin/Stream_Reader > usr/DATA/OBSDAQ_FILTER.dat
#!/bin/bash
<