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

Parameter file for GSM prepared

parent 2786440e
......@@ -9,20 +9,6 @@ PAR_FILE=/home/odaq/parameters.par
DIR_BIN=$DIR_BASE\bin/
PATH=$PATH:$DIR_BIN
#MYPID=$$
#echo $MYPID > /home/odaq/pidfile
# Kill all subprocesses when parent dies
#trap 'echo "HELLO: TEST" > /home/odaq/TEST; killall Stream_Reader; killall OBSDAQ_Logger' SIGHUP SIGINT SIGQUIT SIGTERM SIGPIPE TERM EXIT SIGCHLD SIGTSTP SIGBUS SIGABRT SIGTAP SIGILL
function killit {
PIDs=$(pgrep -P $MYPID)
for p in $PIDs; do
pkill -P $p;
done
}
# Read parameters file
source $PAR_FILE
......@@ -31,16 +17,3 @@ mkdir -p $DIR_LOG
# Start data acquisition
{ trap 'kill 0' EXIT; OBSDAQ_Logger $PAR_FILE 2> $DIR_LOG/OBSDAQ.log; pkill -g 0; } | { trap 'kill 0' EXIT; Stream_Reader $PAR_FILE 2> $DIR_LOG/Stream_Reader.log ; pkill -g 0; }
#(OBSDAQ_Logger $PAR_FILE 2> $DIR_LOG/OBSDAQ.log && pkill -g 0) | { Stream_Reader $PAR_FILE; pkill -g 0; }
#{ (OBSDAQ_Logger $PAR_FILE $DIR_LOG/OBSDAQ.log | Stream_Reader $PAR_FILE); pkill -P $MYPID; }
# Some attempts to kill all from child process
#PID=$!
#PIDs=$(pgrep -P $PID)
#PID_O=$(pidof OBSDAQ_Logger)
#PID_S=$(pidof Stream_Reader)
#echo "TEST: " $PIDs > /home/odaq/TEST
#wait $!
#########################
# Filenames and paths
#########################
# Path to logfiles
DIR_LOG=/home/odaq/log/
# Path to variometer recordings
DIR_VAR=/home/odaq/DATA/
# File format of 1Hz data (see 'man strftime')
FILE_1Hz=BEL1_%Y%m%d.txt
# File format of raw data, uncomment
# if raw data should not be written
#FILE_RAW=TEST_%Y%m%d.txt
#########################
# ADC
#########################
# Baudrate for ObsDAQ
BAUD=115200 #19200
BAUD=19200 #19200
# PORT for ObsDAQ
PORT=/dev/ttyUSB0
PORT=/dev/ttyUSB1
# Send to address, (RS-485 uses 01), ObsDAQ FTDI)
ADDRESS=01
#ADDRESS=255
FILE_ADC_CONFIG=/home/mors/TMP/ADC.par
#########################
# Recording variometer
#########################
# 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
X_s=500.0
Y_s=500.0
Z_s=500.0
# Recording frequency [Hz]
Freq=3
......@@ -8,19 +8,28 @@
// Custom C++ Headers
//
// Driver for GSM19
#include <Parameters_Reader.hpp>
#include <driver_obs_gsm90.hpp>
// Data buffer implemented as pipe on stdout/stdin
#include <buffer_obs_pipe.hpp>
#include <buffer_obs_file.hpp>
int main() {
int main(int argc, char* argv[]) {
// Read from parameters file
if (argc != 2){
fprintf(stderr,"Please specify one parameter file to use !\n");
return(-1);
}
Parameters_Reader par = Parameters_Reader(argv[1]);
// Initialize new data buffer
buffer_obs_pipe pipe = buffer_obs_pipe();
//buffer_obs_pipe pipe = buffer_obs_pipe();
buffer_obs_file pipe = buffer_obs_file(5,par.get_str("DIR_SCA"),
par.get_str("FILE_SCA"));
// Initialize new GSM90 device
// Provide serial port and buffer as arguments
driver_obs_gsm90 gsm90 = driver_obs_gsm90("/dev/ttyUSB0", &pipe);
driver_obs_gsm90 gsm90 = driver_obs_gsm90(par.get_str("PORT_SCA"), &pipe);
// Take continuous measurements every 5s
fprintf(stderr,"Run\n");
......
......@@ -62,7 +62,7 @@ int main(int argc, char* argv[]) {
// Add file buffer, if file_format is given
if (par.get_str("FILE_RAW")!="") {
mult.add(new buffer_obs_file(5,par.get_str("DIR_VAR"),
mult.add(new buffer_obs_file(5,par.get_str("DIR_VEC"),
par.get_str("FILE_RAW")));
}
......@@ -72,8 +72,8 @@ int main(int argc, char* argv[]) {
cal.set_adc_calibrate(par.get_str("FILE_ADC_CONFIG"));
// Initialize new OBSDAQ device
driver_obs_obsdaq obsdaq = driver_obs_obsdaq(par.get_str("PORT"),
par.get_int("BAUD"), &mult, &cal, par.get_int("ADDRESS"));
driver_obs_obsdaq obsdaq = driver_obs_obsdaq(par.get_str("PORT_VEC"),
par.get_int("BAUD_VEC"), &mult, &cal, par.get_int("ADDRESS"));
// Get some data
......@@ -93,7 +93,7 @@ int main(int argc, char* argv[]) {
// Take continuous measurements
fprintf(stderr,"Run\n");
obsdaq.freerun(par.get_dbl("Freq"));
obsdaq.freerun(par.get_dbl("FREQ_VEC"));
}
......
......@@ -23,7 +23,7 @@ int main(int argc, char* argv[]) {
// Initialize new buffer
buffer_obs_pipe buf_in = buffer_obs_pipe();
buffer_obs_file buf_out = buffer_obs_file(5,
par.get_str("DIR_VAR"),par.get_str("FILE_1Hz"));
par.get_str("DIR_VEC"),par.get_str("FILE_VEC"));
// Initialize new filter
Filter_Obs filter = Filter_Obs();
......
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