Re-enable TTFF test

This commit is contained in:
Carles Fernandez 2017-04-29 19:14:59 +02:00
parent 731d0e04eb
commit 6f140b67d1
3 changed files with 10 additions and 3 deletions

View File

@ -324,6 +324,8 @@ rtklib_pvt_cc::rtklib_pvt_cc(unsigned int nchannels, bool dump, std::string dump
std::cout << "GNSS-SDR can not create message queues!" << std::endl;
throw new std::exception();
}
gettimeofday(&tv, NULL);
begin = tv.tv_sec * 1000000 + tv.tv_usec;
}
@ -557,7 +559,9 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
<< " [deg], Height= " << d_ls_pvt->d_height_m << " [m]" << std::endl;
ttff_msgbuf ttff;
ttff.mtype = 1;
ttff.ttff = 0; //d_sample_counter;
gettimeofday(&tv, NULL);
long long int end = tv.tv_sec * 1000000 + tv.tv_usec;
ttff.ttff = static_cast<double>(end - begin) / 1000000.0;
send_sys_v_ttff_msg(ttff);
first_fix = false;
}

View File

@ -31,6 +31,7 @@
#ifndef GNSS_SDR_RTKLIB_PVT_CC_H
#define GNSS_SDR_RTKLIB_PVT_CC_H
#include <ctime>
#include <fstream>
#include <utility>
#include <string>
@ -142,6 +143,8 @@ private:
double ttff;
} ttff_msgbuf;
bool send_sys_v_ttff_msg(ttff_msgbuf ttff);
struct timeval tv;
long long int begin;
public:
rtklib_pvt_cc(unsigned int nchannels,

View File

@ -279,8 +279,8 @@ void receive_msg()
ttff_msg = msg.ttff;
if( (ttff_msg != 0) && (ttff_msg != -1))
{
TTFF_v.push_back(ttff_msg / (1000.0 / decimation_factor) );
LOG(INFO) << "Valid Time-To-First-Fix: " << ttff_msg / (1000.0 / decimation_factor ) << "[s]";
TTFF_v.push_back(ttff_msg);
LOG(INFO) << "Valid Time-To-First-Fix: " << ttff_msg << "[s]";
// Stop the receiver
while(((msqid_stop = msgget(key_stop, 0644))) == -1){}
double msgsend_size = sizeof(msg_stop.ttff);