Commit 159b6941 authored by Achim Morschhauser's avatar Achim Morschhauser
Browse files

Init data in obsdaq

parent 4a01b1c8
Makefile.static
\ No newline at end of file
Makefile.dynamic
\ No newline at end of file
......@@ -699,11 +699,12 @@ int driver_obs_obsdaq::parse_data_ascii(data_obs_vector* data, char* buf) {
//
/////////////////////////////////////////////////////////////////////////
double n[5] = {data->get_MD()};
double n[5];
uint32_t n32, num;
// Set data to missing
data->set_data_MD();
std::fill(n,n+5,data->get_MD());
/////////////////////////////////////////////////////////////////////////
//
......@@ -771,7 +772,7 @@ int driver_obs_obsdaq::parse_data_bin(data_obs_vector* data, char* buf) {
//
/////////////////////////////////////////////////////////////////////////
double n[5] = {data->get_MD()};
double n[5];
uint32_t n32, num;
// Record length (is updated below)
......@@ -782,6 +783,7 @@ int driver_obs_obsdaq::parse_data_bin(data_obs_vector* data, char* buf) {
// Set data to missing
data->set_data_MD();
std::fill(n,n+5,data->get_MD());
////////////////////////////////////////////////////////////////////////
// TODO Use for sampling rates higher than 10 Hz (else, suppl. data is
......@@ -883,7 +885,6 @@ 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) ) );
......@@ -906,98 +907,98 @@ int driver_obs_obsdaq::parse_data_bin(data_obs_vector* data, char* buf) {
***************************************************************************/
int driver_obs_obsdaq::init() {
/////////////////////////////////////////////////////////////////////////
//
// Stop running data acquisition.
//
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
//
// Stop running data acquisition.
//
/////////////////////////////////////////////////////////////////////////
stop();
stop();
/////////////////////////////////////////////////////////////////////////
//
// Stop the internal trigger.
//
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
//
// Stop the internal trigger.
//
/////////////////////////////////////////////////////////////////////////
send("#PP00000000");
usleep(2e6);
send("#PP00000000");
usleep(2e6);
/////////////////////////////////////////////////////////////////////////
//
// Get the quartz crystal frequency.
//
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
//
// Get the quartz crystal frequency.
//
/////////////////////////////////////////////////////////////////////////
std::string recv;
std::string recv;
checked_send("$QF", "R", 1, 1, &recv);
std::cerr << "Received: " << recv << std::endl;
quartz_freq = atoi(recv.c_str());
// Set the valid output rates of the digital filter (Table 6 in Manual)
switch (quartz_freq) {
case 76:
// 7.6800 MHz
valid_filter_rates[0] = 2.5;
valid_filter_rates[1] = 5.0;
valid_filter_rates[2] = 10.0;
valid_filter_rates[3] = 15.0;
valid_filter_rates[4] = 25.0;
valid_filter_rates[5] = 30.0;
valid_filter_rates[6] = 50.0;
valid_filter_rates[7] = 60.0;
valid_filter_rates[8] = 100.0;
valid_filter_rates[9] = 500.0;
valid_filter_rates[10] = 1000.0;
break;
case 92:
// 9.2160 MHz
valid_filter_rates[0] = 3.0;
valid_filter_rates[1] = 6.0;
valid_filter_rates[2] = 12.0;
valid_filter_rates[3] = 18.0;
valid_filter_rates[4] = 30.0;
valid_filter_rates[5] = 36.0;
valid_filter_rates[6] = 60.0;
valid_filter_rates[7] = 72.0;
valid_filter_rates[8] = 120.0;
valid_filter_rates[9] = 600.0;
valid_filter_rates[10] = 1200.0;
break;
case 98:
// 9.8304 MHz (default)
valid_filter_rates[0] = 3.2;
valid_filter_rates[1] = 6.4;
valid_filter_rates[2] = 12.8;
valid_filter_rates[3] = 19.2;
valid_filter_rates[4] = 32.0;
valid_filter_rates[5] = 38.4;
valid_filter_rates[6] = 64.0;
valid_filter_rates[7] = 76.8;
valid_filter_rates[8] = 128.0;
valid_filter_rates[9] = 640.0;
valid_filter_rates[10] = 1280.0;
break;
}
checked_send("$QF", "R", 1, 1, &recv);
std::cerr << "Received: " << recv << std::endl;
// Define the filter commands (Table 6 in Manual)
filter_cmds[0] = "03";
filter_cmds[1] = "13";
filter_cmds[2] = "23";
filter_cmds[3] = "33";
filter_cmds[4] = "43";
filter_cmds[5] = "53";
filter_cmds[6] = "63";
filter_cmds[7] = "72";
filter_cmds[8] = "82";
filter_cmds[9] = "92";
filter_cmds[10] = "A1";
quartz_freq = atoi(recv.c_str());
return (0);
// Set the valid output rates of the digital filter (Table 6 in Manual)
switch (quartz_freq) {
case 76:
// 7.6800 MHz
valid_filter_rates[0] = 2.5;
valid_filter_rates[1] = 5.0;
valid_filter_rates[2] = 10.0;
valid_filter_rates[3] = 15.0;
valid_filter_rates[4] = 25.0;
valid_filter_rates[5] = 30.0;
valid_filter_rates[6] = 50.0;
valid_filter_rates[7] = 60.0;
valid_filter_rates[8] = 100.0;
valid_filter_rates[9] = 500.0;
valid_filter_rates[10] = 1000.0;
break;
case 92:
// 9.2160 MHz
valid_filter_rates[0] = 3.0;
valid_filter_rates[1] = 6.0;
valid_filter_rates[2] = 12.0;
valid_filter_rates[3] = 18.0;
valid_filter_rates[4] = 30.0;
valid_filter_rates[5] = 36.0;
valid_filter_rates[6] = 60.0;
valid_filter_rates[7] = 72.0;
valid_filter_rates[8] = 120.0;
valid_filter_rates[9] = 600.0;
valid_filter_rates[10] = 1200.0;
break;
case 98:
// 9.8304 MHz (default)
valid_filter_rates[0] = 3.2;
valid_filter_rates[1] = 6.4;
valid_filter_rates[2] = 12.8;
valid_filter_rates[3] = 19.2;
valid_filter_rates[4] = 32.0;
valid_filter_rates[5] = 38.4;
valid_filter_rates[6] = 64.0;
valid_filter_rates[7] = 76.8;
valid_filter_rates[8] = 128.0;
valid_filter_rates[9] = 640.0;
valid_filter_rates[10] = 1280.0;
break;
}
// Define the filter commands (Table 6 in Manual)
filter_cmds[0] = "03";
filter_cmds[1] = "13";
filter_cmds[2] = "23";
filter_cmds[3] = "33";
filter_cmds[4] = "43";
filter_cmds[5] = "53";
filter_cmds[6] = "63";
filter_cmds[7] = "72";
filter_cmds[8] = "82";
filter_cmds[9] = "92";
filter_cmds[10] = "A1";
return (0);
}
......
Supports Markdown
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