1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-07 16:00:35 +00:00

Code cleaning

git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@267 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
Carles Fernandez 2012-10-28 13:20:55 +00:00
parent df984c282b
commit 25a30e3851
8 changed files with 7 additions and 75 deletions

View File

@ -9,7 +9,7 @@
* *
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
* *
* Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) * Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors)
* *
* GNSS-SDR is a software defined Global Navigation * GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver * Satellite Systems receiver
@ -56,7 +56,6 @@ class TelemetryDecoderInterface;
*/ */
class Channel: public ChannelInterface class Channel: public ChannelInterface
{ {
public: public:
//! Constructor //! Constructor
Channel(ConfigurationInterface *configuration, unsigned int channel, Channel(ConfigurationInterface *configuration, unsigned int channel,
@ -64,29 +63,19 @@ public:
TrackingInterface *trk, TelemetryDecoderInterface *nav, TrackingInterface *trk, TelemetryDecoderInterface *nav,
std::string role, std::string implementation, std::string role, std::string implementation,
gr_msg_queue_sptr queue); gr_msg_queue_sptr queue);
//! Virtual destructor //! Virtual destructor
virtual ~Channel(); virtual ~Channel();
void connect(gr_top_block_sptr top_block); void connect(gr_top_block_sptr top_block);
void disconnect(gr_top_block_sptr top_block); void disconnect(gr_top_block_sptr top_block);
gr_basic_block_sptr get_left_block(); gr_basic_block_sptr get_left_block();
gr_basic_block_sptr get_right_block(); gr_basic_block_sptr get_right_block();
std::string role(){ return role_; } std::string role(){ return role_; }
std::string implementation(){ return "Channel"; } std::string implementation(){ return "Channel"; }
size_t item_size(){ return 0; } size_t item_size(){ return 0; }
Gnss_Signal get_signal() const { return gnss_signal_; } Gnss_Signal get_signal() const { return gnss_signal_; }
AcquisitionInterface* acquisition(){ return acq_; } AcquisitionInterface* acquisition(){ return acq_; }
TrackingInterface* tracking(){ return trk_; } TrackingInterface* tracking(){ return trk_; }
TelemetryDecoderInterface* telemetry(){ return nav_; } TelemetryDecoderInterface* telemetry(){ return nav_; }
void start_acquisition(); void start_acquisition();
void set_signal(Gnss_Signal gnss_signal_); void set_signal(Gnss_Signal gnss_signal_);
void start(); void start();
@ -98,32 +87,25 @@ public:
void stop(); void stop();
private: private:
GNSSBlockInterface *pass_through_; GNSSBlockInterface *pass_through_;
AcquisitionInterface *acq_; AcquisitionInterface *acq_;
TrackingInterface *trk_; TrackingInterface *trk_;
TelemetryDecoderInterface *nav_; TelemetryDecoderInterface *nav_;
std::string role_; std::string role_;
std::string implementation_; std::string implementation_;
unsigned int channel_; unsigned int channel_;
Gnss_Synchro gnss_synchro_; Gnss_Synchro gnss_synchro_;
Gnss_Signal gnss_signal_; Gnss_Signal gnss_signal_;
bool connected_; bool connected_;
bool stop_; bool stop_;
int message_; int message_;
bool repeat_; bool repeat_;
GpsL1CaChannelFsm channel_fsm_; GpsL1CaChannelFsm channel_fsm_;
gr_msg_queue_sptr queue_; gr_msg_queue_sptr queue_;
concurrent_queue<int> channel_internal_queue_; concurrent_queue<int> channel_internal_queue_;
boost::thread ch_thread_; boost::thread ch_thread_;
void run(); void run();
void process_channel_messages(); void process_channel_messages();
}; };
#endif /*GNSS_SDR_CHANNEL_H_*/ #endif /*GNSS_SDR_CHANNEL_H_*/

View File

@ -55,15 +55,12 @@ class ConfigurationInterface;
*/ */
class FirFilter: public GNSSBlockInterface class FirFilter: public GNSSBlockInterface
{ {
public: public:
FirFilter(ConfigurationInterface* configuration, FirFilter(ConfigurationInterface* configuration,
std::string role, unsigned int in_streams, std::string role, unsigned int in_streams,
unsigned int out_streams, gr_msg_queue_sptr queue); unsigned int out_streams, gr_msg_queue_sptr queue);
virtual ~FirFilter(); virtual ~FirFilter();
std::string role() std::string role()
{ {
return role_; return role_;
@ -76,15 +73,12 @@ public:
{ {
return 0; return 0;
} }
void connect(gr_top_block_sptr top_block); void connect(gr_top_block_sptr top_block);
void disconnect(gr_top_block_sptr top_block); void disconnect(gr_top_block_sptr top_block);
gr_basic_block_sptr get_left_block(); gr_basic_block_sptr get_left_block();
gr_basic_block_sptr get_right_block(); gr_basic_block_sptr get_right_block();
private: private:
gr_fir_filter_ccf_sptr fir_filter_ccf_; gr_fir_filter_ccf_sptr fir_filter_ccf_;
ConfigurationInterface* config_; ConfigurationInterface* config_;
bool dump_; bool dump_;

View File

@ -57,15 +57,12 @@ class ConfigurationInterface;
*/ */
class FreqXlatingFirFilter: public GNSSBlockInterface class FreqXlatingFirFilter: public GNSSBlockInterface
{ {
public: public:
FreqXlatingFirFilter(ConfigurationInterface* configuration, FreqXlatingFirFilter(ConfigurationInterface* configuration,
std::string role, unsigned int in_streams, std::string role, unsigned int in_streams,
unsigned int out_streams, gr_msg_queue_sptr queue); unsigned int out_streams, gr_msg_queue_sptr queue);
virtual ~FreqXlatingFirFilter(); virtual ~FreqXlatingFirFilter();
std::string role() std::string role()
{ {
return role_; return role_;
@ -78,15 +75,12 @@ public:
{ {
return 0; return 0;
} }
void connect(gr_top_block_sptr top_block); void connect(gr_top_block_sptr top_block);
void disconnect(gr_top_block_sptr top_block); void disconnect(gr_top_block_sptr top_block);
gr_basic_block_sptr get_left_block(); gr_basic_block_sptr get_left_block();
gr_basic_block_sptr get_right_block(); gr_basic_block_sptr get_right_block();
private: private:
gr_freq_xlating_fir_filter_ccf_sptr freq_xlating_fir_filter_ccf_; gr_freq_xlating_fir_filter_ccf_sptr freq_xlating_fir_filter_ccf_;
ConfigurationInterface* config_; ConfigurationInterface* config_;
bool dump_; bool dump_;

View File

@ -41,17 +41,13 @@ class ConfigurationInterface;
class GpsL1CaObservables : public ObservablesInterface class GpsL1CaObservables : public ObservablesInterface
{ {
public: public:
GpsL1CaObservables(ConfigurationInterface* configuration, GpsL1CaObservables(ConfigurationInterface* configuration,
std::string role, std::string role,
unsigned int in_streams, unsigned int in_streams,
unsigned int out_streams, unsigned int out_streams,
gr_msg_queue_sptr queue); gr_msg_queue_sptr queue);
virtual ~GpsL1CaObservables(); virtual ~GpsL1CaObservables();
std::string role() std::string role()
{ {
return role_; return role_;
@ -60,17 +56,14 @@ public:
{ {
return "GPS_L1_CA_Observables"; return "GPS_L1_CA_Observables";
} }
void connect(gr_top_block_sptr top_block); void connect(gr_top_block_sptr top_block);
void disconnect(gr_top_block_sptr top_block); void disconnect(gr_top_block_sptr top_block);
gr_basic_block_sptr get_left_block(); gr_basic_block_sptr get_left_block();
gr_basic_block_sptr get_right_block(); gr_basic_block_sptr get_right_block();
void reset() void reset()
{ {
return; return;
}; };
//!< All blocks must have an item_size() function implementation //!< All blocks must have an item_size() function implementation
size_t item_size() size_t item_size()
{ {
@ -78,7 +71,6 @@ public:
} }
private: private:
gps_l1_ca_observables_cc_sptr observables_; gps_l1_ca_observables_cc_sptr observables_;
bool dump_; bool dump_;
unsigned int fs_in_; unsigned int fs_in_;

View File

@ -4,7 +4,7 @@
* \author Javier Arribas, 2011. jarribas(at)cttc.es * \author Javier Arribas, 2011. jarribas(at)cttc.es
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
* *
* Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) * Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors)
* *
* GNSS-SDR is a software defined Global Navigation * GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver * Satellite Systems receiver
@ -55,20 +55,14 @@ gps_l1_ca_make_observables_cc(unsigned int n_channels, gr_msg_queue_sptr queue,
*/ */
class gps_l1_ca_observables_cc : public gr_block class gps_l1_ca_observables_cc : public gr_block
{ {
public: public:
~gps_l1_ca_observables_cc (); ~gps_l1_ca_observables_cc ();
void set_navigation_queue(concurrent_queue<Gps_Navigation_Message> *nav_queue){d_nav_queue = nav_queue;}
void set_navigation_queue(concurrent_queue<Gps_Navigation_Message> *nav_queue){d_nav_queue=nav_queue;} void set_fs_in(unsigned long int fs_in) {d_fs_in = fs_in;};
void set_fs_in(unsigned long int fs_in) {d_fs_in=fs_in;};
int general_work (int noutput_items, gr_vector_int &ninput_items, int general_work (int noutput_items, gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
private: private:
friend gps_l1_ca_observables_cc_sptr friend gps_l1_ca_observables_cc_sptr
gps_l1_ca_make_observables_cc(unsigned int nchannels, gr_msg_queue_sptr queue, bool dump, std::string dump_filename, int output_rate_ms, bool flag_averaging); gps_l1_ca_make_observables_cc(unsigned int nchannels, gr_msg_queue_sptr queue, bool dump, std::string dump_filename, int output_rate_ms, bool flag_averaging);
gps_l1_ca_observables_cc(unsigned int nchannels, gr_msg_queue_sptr queue, bool dump, std::string dump_filename, int output_rate_ms, bool flag_averaging); gps_l1_ca_observables_cc(unsigned int nchannels, gr_msg_queue_sptr queue, bool dump, std::string dump_filename, int output_rate_ms, bool flag_averaging);
@ -83,12 +77,8 @@ private:
int d_output_rate_ms; int d_output_rate_ms;
std::string d_dump_filename; std::string d_dump_filename;
std::ofstream d_dump_file; std::ofstream d_dump_file;
//std::deque<double> *d_history_prn_delay_ms; //std::deque<double> *d_history_prn_delay_ms;
std::deque<Gnss_Synchro> *d_history_gnss_synchro_deque; std::deque<Gnss_Synchro> *d_history_gnss_synchro_deque;
concurrent_queue<Gps_Navigation_Message> *d_nav_queue; // Navigation ephemeris queue concurrent_queue<Gps_Navigation_Message> *d_nav_queue; // Navigation ephemeris queue
}; };

View File

@ -9,7 +9,7 @@
* *
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
* *
* Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) * Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors)
* *
* GNSS-SDR is a software defined Global Navigation * GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver * Satellite Systems receiver
@ -48,14 +48,12 @@ class ConfigurationInterface;
*/ */
class ControlThread class ControlThread
{ {
public: public:
/*! /*!
* \brief Default constructor * \brief Default constructor
*/ */
ControlThread(); ControlThread();
/*! /*!
* \brief Constructor that initializes the class with parameters * \brief Constructor that initializes the class with parameters
* *
@ -63,7 +61,6 @@ public:
*/ */
ControlThread(ConfigurationInterface *configuration); ControlThread(ConfigurationInterface *configuration);
//! \brief Virtual destructor. Derived classes must implement the destructor //! \brief Virtual destructor. Derived classes must implement the destructor
virtual ~ControlThread(); virtual ~ControlThread();
@ -107,21 +104,17 @@ public:
private: private:
void init(); void init();
void read_control_messages(); void read_control_messages();
void process_control_messages(); void process_control_messages();
void apply_action(unsigned int what); void apply_action(unsigned int what);
GNSSFlowgraph *flowgraph_; GNSSFlowgraph *flowgraph_;
ConfigurationInterface *configuration_; ConfigurationInterface *configuration_;
gr_msg_queue_sptr control_queue_; gr_msg_queue_sptr control_queue_;
ControlMessageFactory *control_message_factory_; ControlMessageFactory *control_message_factory_;
std::vector<ControlMessage*> *control_messages_; std::vector<ControlMessage*> *control_messages_;
bool stop_; bool stop_;
bool delete_configuration_; bool delete_configuration_;
unsigned int processed_control_messages_; unsigned int processed_control_messages_;
unsigned int applied_actions_; unsigned int applied_actions_;
boost::thread keyboard_thread_; boost::thread keyboard_thread_;

View File

@ -10,7 +10,7 @@
* *
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
* *
* Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) * Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors)
* *
* GNSS-SDR is a software defined Global Navigation * GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver * Satellite Systems receiver
@ -45,12 +45,9 @@ class GNSSBlockInterface;
class GNSSBlockFactory class GNSSBlockFactory
{ {
public: public:
GNSSBlockFactory(); GNSSBlockFactory();
virtual ~GNSSBlockFactory(); virtual ~GNSSBlockFactory();
GNSSBlockInterface* GetSignalSource( GNSSBlockInterface* GetSignalSource(
ConfigurationInterface *configuration, gr_msg_queue_sptr queue); ConfigurationInterface *configuration, gr_msg_queue_sptr queue);
GNSSBlockInterface* GetSignalConditioner( GNSSBlockInterface* GetSignalConditioner(
@ -66,7 +63,6 @@ public:
gr_msg_queue_sptr queue); gr_msg_queue_sptr queue);
std::vector<GNSSBlockInterface*>* GetChannels( std::vector<GNSSBlockInterface*>* GetChannels(
ConfigurationInterface *configuration, gr_msg_queue_sptr queue); ConfigurationInterface *configuration, gr_msg_queue_sptr queue);
/* /*
* \brief Returns the block with the required configuration and implementation * \brief Returns the block with the required configuration and implementation
*/ */
@ -74,7 +70,6 @@ public:
std::string role, std::string implementation, std::string role, std::string implementation,
unsigned int in_streams, unsigned int out_streams, unsigned int in_streams, unsigned int out_streams,
gr_msg_queue_sptr queue); gr_msg_queue_sptr queue);
}; };
#endif /*GNSS_SDR_BLOCK_FACTORY_H_*/ #endif /*GNSS_SDR_BLOCK_FACTORY_H_*/

View File

@ -9,7 +9,7 @@
* *
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
* *
* Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) * Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors)
* *
* GNSS-SDR is a software defined Global Navigation * GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver * Satellite Systems receiver
@ -55,7 +55,6 @@ class GNSSBlockFactory;
*/ */
class GNSSFlowgraph class GNSSFlowgraph
{ {
public: public:
/*! /*!
* \brief Constructor that initializes the receiver flowgraph * \brief Constructor that initializes the receiver flowgraph
@ -114,29 +113,22 @@ public:
} }
private: private:
void init(); void init();
void apply_action(unsigned int what); void apply_action(unsigned int what);
void set_signals_list(); void set_signals_list();
void set_channels_state(); void set_channels_state();
bool connected_; bool connected_;
bool running_; bool running_;
unsigned int channels_count_; unsigned int channels_count_;
unsigned int acq_channels_count_; unsigned int acq_channels_count_;
unsigned int max_acq_channels_; unsigned int max_acq_channels_;
unsigned int applied_actions_; unsigned int applied_actions_;
std::string config_file_; std::string config_file_;
ConfigurationInterface *configuration_; ConfigurationInterface *configuration_;
GNSSBlockFactory *block_factory_; GNSSBlockFactory *block_factory_;
std::vector<GNSSBlockInterface*>* blocks_; std::vector<GNSSBlockInterface*>* blocks_;
gr_top_block_sptr top_block_; gr_top_block_sptr top_block_;
gr_msg_queue_sptr queue_; gr_msg_queue_sptr queue_;
std::list<Gnss_Signal> available_GNSS_signals_; std::list<Gnss_Signal> available_GNSS_signals_;
std::vector<unsigned int> channels_state_; std::vector<unsigned int> channels_state_;
}; };