1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 04:00:34 +00:00

Changing some raw pointers by smart pointers. Commenting out some custom

code
This commit is contained in:
Carles Fernandez 2014-09-04 19:35:55 +02:00
parent bcd90ca9cf
commit a57c5ccf8a
5 changed files with 218 additions and 226 deletions

View File

@ -77,17 +77,18 @@ hybrid_pvt_cc::hybrid_pvt_cc(unsigned int nchannels, boost::shared_ptr<gr::msg_q
std::string kml_dump_filename;
kml_dump_filename = d_dump_filename;
kml_dump_filename.append(".kml");
d_kml_dump.set_headers(kml_dump_filename);
d_kml_dump = std::make_shared<Kml_Printer>();
d_kml_dump->set_headers(kml_dump_filename);
//initialize nmea_printer
d_nmea_printer = new Nmea_Printer(nmea_dump_filename, flag_nmea_tty_port, nmea_dump_devname);
d_nmea_printer = std::make_shared<Nmea_Printer>(nmea_dump_filename, flag_nmea_tty_port, nmea_dump_devname);
d_dump_filename.append("_raw.dat");
dump_ls_pvt_filename.append("_ls_pvt.dat");
d_averaging_depth = averaging_depth;
d_flag_averaging = flag_averaging;
d_ls_pvt = new hybrid_ls_pvt(nchannels, dump_ls_pvt_filename, d_dump);
d_ls_pvt = std::make_shared<hybrid_ls_pvt>((int)nchannels, dump_ls_pvt_filename, d_dump);
d_ls_pvt->set_averaging_depth(d_averaging_depth);
d_sample_counter = 0;
@ -96,7 +97,7 @@ hybrid_pvt_cc::hybrid_pvt_cc(unsigned int nchannels, boost::shared_ptr<gr::msg_q
d_rx_time = 0.0;
d_TOW_at_curr_symbol_constellation = 0.0;
b_rinex_header_writen = false;
rp = new Rinex_Printer();
rp = std::make_shared<Rinex_Printer>();
// ############# ENABLE DATA FILE LOG #################
if (d_dump == true)
@ -120,12 +121,7 @@ hybrid_pvt_cc::hybrid_pvt_cc(unsigned int nchannels, boost::shared_ptr<gr::msg_q
hybrid_pvt_cc::~hybrid_pvt_cc()
{
d_kml_dump.close_file();
delete d_ls_pvt;
delete rp;
delete d_nmea_printer;
}
{}
@ -215,7 +211,7 @@ int hybrid_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_items,
valid_solution_counter ++;
d_kml_dump.print_position_hybrid(d_ls_pvt, d_flag_averaging);
d_kml_dump->print_position_hybrid(d_ls_pvt, d_flag_averaging);
/* *********************************** COMPUTE STATISTICS OVER THE FIRST 1000 SOLUTOINS **********************************/
if (valid_solution_counter<=1000)
@ -243,7 +239,7 @@ int hybrid_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_items,
//if(valid_solution_16_sat_counter ==1000)
if (valid_solution_counter==1000)
/* if (valid_solution_counter==1000)
{
//compute ECEF average and standard deviation over the first 1000 solutions
GDOP_sum = std::accumulate( GDOP_vect.begin(), GDOP_vect.end(), 0.0);
@ -260,7 +256,7 @@ int hybrid_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_items,
double ref_Y = 872120.003;
double ref_Z = 4730005.761;
// //REAL CAPTURE reference solutions (obtained with 4 Galileo)
// REAL CAPTURE reference solutions (obtained with 4 Galileo)
// double ref_longitude= 1.987686994;
// double ref_latitude= 41.274786935;
// double ref_X=4797680.560;
@ -498,7 +494,7 @@ int hybrid_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_items,
// {
// rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, d_rx_time, gnss_pseudoranges_map);
// }
// }
// } */
}
}
@ -517,11 +513,6 @@ int hybrid_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_items,
<< " using "<<d_ls_pvt->d_valid_observations<<" observations is HDOP = " << d_ls_pvt->d_HDOP << " VDOP = "
<< d_ls_pvt->d_VDOP <<" TDOP = " << d_ls_pvt->d_TDOP
<< " GDOP = " << d_ls_pvt->d_GDOP;
}
// MULTIPLEXED FILE RECORDING - Record results to file

View File

@ -100,7 +100,7 @@ private:
boost::shared_ptr<gr::msg_queue> d_queue;
bool d_dump;
bool b_rinex_header_writen;
Rinex_Printer *rp;
std::shared_ptr<Rinex_Printer> rp;
unsigned int d_nchannels;
std::string d_dump_filename;
std::ofstream d_dump_file;
@ -112,8 +112,8 @@ private:
long unsigned int valid_solution_counter;
long unsigned int valid_solution_16_sat_counter;
long unsigned int d_last_sample_nav_output;
Kml_Printer d_kml_dump;
Nmea_Printer *d_nmea_printer;
std::shared_ptr<Kml_Printer> d_kml_dump;
std::shared_ptr<Nmea_Printer> d_nmea_printer;
double d_rx_time;
double d_TOW_at_curr_symbol_constellation;
/* *********variable used for final statistics****/
@ -209,8 +209,7 @@ private:
double SEP; //3D-50%
/* END variable used for final statistics */
hybrid_ls_pvt *d_ls_pvt;
std::shared_ptr<hybrid_ls_pvt> d_ls_pvt;
bool pseudoranges_pairCompare_min(std::pair<int,Gnss_Synchro> a, std::pair<int,Gnss_Synchro> b);
public:

View File

@ -40,6 +40,7 @@
#include <fstream>
#include <iostream>
#include <map>
#include <memory>
#include <sstream>
#include <string>
#include <armadillo>

View File

@ -146,7 +146,7 @@ bool Kml_Printer::print_position_galileo(const std::shared_ptr<galileo_e1_ls_pvt
}
}
bool Kml_Printer::print_position_hybrid(hybrid_ls_pvt* position,bool print_average_values)
bool Kml_Printer::print_position_hybrid(const std::shared_ptr<hybrid_ls_pvt>& position, bool print_average_values)
{
double latitude;
double longitude;

View File

@ -35,6 +35,7 @@
#include <iostream>
#include <fstream>
#include <memory>
#include <string>
#include "gps_l1_ca_ls_pvt.h"
#include "galileo_e1_ls_pvt.h"
@ -53,7 +54,7 @@ public:
bool set_headers(std::string filename);
bool print_position(const std::shared_ptr<gps_l1_ca_ls_pvt>& position, bool print_average_values);
bool print_position_galileo(const std::shared_ptr<galileo_e1_ls_pvt>& position, bool print_average_values);
bool print_position_hybrid(hybrid_ls_pvt* position, bool print_average_values);
bool print_position_hybrid(const std::shared_ptr<hybrid_ls_pvt>& position, bool print_average_values);
bool close_file();
Kml_Printer();
~Kml_Printer();