Commit e1ed5335 authored by Achim Morschhauser's avatar Achim Morschhauser
Browse files

.gitignore updated

parent c5c60c3c
......@@ -4,7 +4,6 @@
.settings/
*.anjuta*
usr/data/*
usr/*
bin/*
lib/*
.cproject
......@@ -12,12 +11,18 @@ lib/*
PRIVATE/
CHANGELOG
DataLogger
usr/*
!usr/GNUPLOT
!usr/START
!/usr/src/
usr/src/*
!usr/src/GSM_Logger.cpp
!usr/src/OBSDAQ_Logger.cpp
!usr/src/Serial_Talk.cpp
!usr/src/Stream_Reader.cpp
!usr/START
!usr/par/
/usr/par/*
!usr/par/parameters_default.par
!usr/par/ADC_example.par
!*/.gitkeep
# config (serialnumber/ccdd/channel),scale,offset
# AUTO-CALIBRATE 2018-11-15 12:01:39 UTC
OD-56A17021/0223/2,2F23B0,000333;
# AUTO-CALIBRATE 2018-11-15 12:01:39 UTC
OD-56A17021/0223/0,2F2486,0003E3;
# AUTO-CALIBRATE 2018-11-15 12:01:39 UTC
OD-56A17021/0223/1,2F2552,FFFEE2;
# AUTO-CALIBRATE 2018-11-15 12:21:11 UTC
OD-56A17021/0282/2,3AEC9D,00028C;
# AUTO-CALIBRATE 2018-11-15 12:21:11 UTC
OD-56A17021/0282/1,3AEEA7,FFFF1A;
# AUTO-CALIBRATE 2018-11-15 12:21:11 UTC
OD-56A17021/0282/0,3AEDAB,00031A;
# AUTO-CALIBRATE 2018-11-15 13:03:26 UTC
OD-56A17021/0203/2,2F23AF,000333;
# AUTO-CALIBRATE 2018-11-15 13:03:26 UTC
OD-56A17021/0203/1,2F2552,FFFEE2;
# AUTO-CALIBRATE 2018-11-15 13:03:26 UTC
OD-56A17021/0203/0,2F2486,0003E3;
# Baudrate for ObsDAQ
BAUD=115200 #19200
# PORT for ObsDAQ
PORT=/dev/ttyUSB0
# Resistance of variometer
R=1.0
# Scale values of variometer
X_s=1.0
Y_s=1.0
Z_s=1.0
# Recording frequency
Freq=120
//
// 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/par/parameters_default.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/par/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"));
}
#include <iostream>
#include <string.h>
#include <inttypes.h>
#include <stdio.h>
#include <driver_serial.hpp>
int main(){
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);
*/
}
}
// C Headers
#include <stdio.h>
// Custom C++ Headers
#include <Filter_Obs.hpp>
#include <driver_obs_obsdaq.hpp>
#include <buffer_obs_pipe.hpp>
int main() {
// Initialize new buffer
buffer_obs_pipe pipe_in = buffer_obs_pipe();
buffer_obs_pipe pipe_out = buffer_obs_pipe(5);
// Initialize new filter
Filter_Obs filter = Filter_Obs();
// Apply PLASMON filter
filter.lowpass_PLASMON_1Hz(&pipe_in,&pipe_out,128);
}
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