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

Freq in driver_obs

parent 71d78094
......@@ -32,6 +32,9 @@ buffer_obs* buffer;
/** The calibration constants of the instrument */
Obs_Calibration* cal;
/** The selected sampling frequency */
double freq;
//
// Public Methods
//
......
......@@ -749,9 +749,6 @@ int driver_obs_obsdaq::parse_data_ascii(data_obs_vector* data, char* buf) {
***************************************************************************/
int driver_obs_obsdaq::parse_data_bin(data_obs_vector* data, char* buf) {
// TODO Use for sampling rates higher than 10 Hz (else, suppl. data is
// not returned).
// OBSDAQ uses LittleEndian
/////////////////////////////////////////////////////////////////////////
//
......@@ -771,6 +768,19 @@ int driver_obs_obsdaq::parse_data_bin(data_obs_vector* data, char* buf) {
// Set data to missing
data->set_data_MD();
////////////////////////////////////////////////////////////////////////
// TODO Use for sampling rates higher than 10 Hz (else, suppl. data is
// not returned).
// OBSDAQ uses LittleEndian
////////////////////////////////////////////////////////////////////////
if (driver_obs::freq < 10.0){
std::cerr << "ERROR: Binary mode not available for sampling rate "
<< "of lower than 10 Hz. Current sampling rate is " << freq
<< " Hz." << std::endl;
return(-1);
}
////////////////////////////////////////////////////////////////////////
//
// Parse the binary data (Manual 12.5.2).
......@@ -1017,6 +1027,9 @@ int driver_obs_obsdaq::init_run(double freq){
}
}
// Set the frequency
driver_obs::freq = valid_filter_rates[freq_sel];
// Set range to +10V and set frequency of digital filter
for (int i=0; i<3; i++){
sprintf(cmd,"$%1dWS020102%s",i,filter_cmds[freq_sel]);
......
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