1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-06 07:20:34 +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
* Satellite Systems receiver
@ -56,7 +56,6 @@ class TelemetryDecoderInterface;
*/
class Channel: public ChannelInterface
{
public:
//! Constructor
Channel(ConfigurationInterface *configuration, unsigned int channel,
@ -64,29 +63,19 @@ public:
TrackingInterface *trk, TelemetryDecoderInterface *nav,
std::string role, std::string implementation,
gr_msg_queue_sptr queue);
//! Virtual destructor
virtual ~Channel();
void connect(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_right_block();
std::string role(){ return role_; }
std::string implementation(){ return "Channel"; }
size_t item_size(){ return 0; }
Gnss_Signal get_signal() const { return gnss_signal_; }
AcquisitionInterface* acquisition(){ return acq_; }
TrackingInterface* tracking(){ return trk_; }
TelemetryDecoderInterface* telemetry(){ return nav_; }
void start_acquisition();
void set_signal(Gnss_Signal gnss_signal_);
void start();
@ -98,32 +87,25 @@ public:
void stop();
private:
GNSSBlockInterface *pass_through_;
AcquisitionInterface *acq_;
TrackingInterface *trk_;
TelemetryDecoderInterface *nav_;
std::string role_;
std::string implementation_;
unsigned int channel_;
Gnss_Synchro gnss_synchro_;
Gnss_Signal gnss_signal_;
bool connected_;
bool stop_;
int message_;
bool repeat_;
GpsL1CaChannelFsm channel_fsm_;
gr_msg_queue_sptr queue_;
concurrent_queue<int> channel_internal_queue_;
boost::thread ch_thread_;
void run();
void process_channel_messages();
};
#endif /*GNSS_SDR_CHANNEL_H_*/

View File

@ -55,15 +55,12 @@ class ConfigurationInterface;
*/
class FirFilter: public GNSSBlockInterface
{
public:
FirFilter(ConfigurationInterface* configuration,
std::string role, unsigned int in_streams,
unsigned int out_streams, gr_msg_queue_sptr queue);
virtual ~FirFilter();
std::string role()
{
return role_;
@ -76,15 +73,12 @@ public:
{
return 0;
}
void connect(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_right_block();
private:
gr_fir_filter_ccf_sptr fir_filter_ccf_;
ConfigurationInterface* config_;
bool dump_;

View File

@ -57,15 +57,12 @@ class ConfigurationInterface;
*/
class FreqXlatingFirFilter: public GNSSBlockInterface
{
public:
FreqXlatingFirFilter(ConfigurationInterface* configuration,
std::string role, unsigned int in_streams,
unsigned int out_streams, gr_msg_queue_sptr queue);
virtual ~FreqXlatingFirFilter();
std::string role()
{
return role_;
@ -78,15 +75,12 @@ public:
{
return 0;
}
void connect(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_right_block();
private:
gr_freq_xlating_fir_filter_ccf_sptr freq_xlating_fir_filter_ccf_;
ConfigurationInterface* config_;
bool dump_;

View File

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

View File

@ -4,7 +4,7 @@
* \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
* 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
{
public:
~gps_l1_ca_observables_cc ();
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_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;};
int general_work (int noutput_items, gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
private:
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_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;
std::string d_dump_filename;
std::ofstream d_dump_file;
//std::deque<double> *d_history_prn_delay_ms;
std::deque<Gnss_Synchro> *d_history_gnss_synchro_deque;
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
* Satellite Systems receiver
@ -48,14 +48,12 @@ class ConfigurationInterface;
*/
class ControlThread
{
public:
/*!
* \brief Default constructor
*/
ControlThread();
/*!
* \brief Constructor that initializes the class with parameters
*
@ -63,7 +61,6 @@ public:
*/
ControlThread(ConfigurationInterface *configuration);
//! \brief Virtual destructor. Derived classes must implement the destructor
virtual ~ControlThread();
@ -107,21 +104,17 @@ public:
private:
void init();
void read_control_messages();
void process_control_messages();
void apply_action(unsigned int what);
GNSSFlowgraph *flowgraph_;
ConfigurationInterface *configuration_;
gr_msg_queue_sptr control_queue_;
ControlMessageFactory *control_message_factory_;
std::vector<ControlMessage*> *control_messages_;
bool stop_;
bool delete_configuration_;
unsigned int processed_control_messages_;
unsigned int applied_actions_;
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
* Satellite Systems receiver
@ -45,12 +45,9 @@ class GNSSBlockInterface;
class GNSSBlockFactory
{
public:
GNSSBlockFactory();
virtual ~GNSSBlockFactory();
GNSSBlockInterface* GetSignalSource(
ConfigurationInterface *configuration, gr_msg_queue_sptr queue);
GNSSBlockInterface* GetSignalConditioner(
@ -66,7 +63,6 @@ public:
gr_msg_queue_sptr queue);
std::vector<GNSSBlockInterface*>* GetChannels(
ConfigurationInterface *configuration, gr_msg_queue_sptr queue);
/*
* \brief Returns the block with the required configuration and implementation
*/
@ -74,7 +70,6 @@ public:
std::string role, std::string implementation,
unsigned int in_streams, unsigned int out_streams,
gr_msg_queue_sptr queue);
};
#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
* Satellite Systems receiver
@ -55,7 +55,6 @@ class GNSSBlockFactory;
*/
class GNSSFlowgraph
{
public:
/*!
* \brief Constructor that initializes the receiver flowgraph
@ -114,29 +113,22 @@ public:
}
private:
void init();
void apply_action(unsigned int what);
void set_signals_list();
void set_channels_state();
bool connected_;
bool running_;
unsigned int channels_count_;
unsigned int acq_channels_count_;
unsigned int max_acq_channels_;
unsigned int applied_actions_;
std::string config_file_;
ConfigurationInterface *configuration_;
GNSSBlockFactory *block_factory_;
std::vector<GNSSBlockInterface*>* blocks_;
gr_top_block_sptr top_block_;
gr_msg_queue_sptr queue_;
std::list<Gnss_Signal> available_GNSS_signals_;
std::vector<unsigned int> channels_state_;
};