Implementation of new receiver telecommands standby and coldstart

This commit is contained in:
Javier 2018-10-28 11:07:53 +01:00
parent 19dca87427
commit 5b3eb12998
96 changed files with 1407 additions and 844 deletions

View File

@ -40,6 +40,9 @@
using google::LogMessage;
void GalileoE1Pcps8msAmbiguousAcquisition::stop_acquisition()
{
}
GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -122,6 +122,12 @@ public:
* \brief Restart acquisition algorithm
*/
void reset() override;
/*!
* \brief Stop running acquisition
*/
void stop_acquisition() override;
void set_state(int state __attribute__((unused))) override{};
private:

View File

@ -42,6 +42,10 @@
using google::LogMessage;
void GalileoE1PcpsAmbiguousAcquisition::stop_acquisition()
{
}
GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -131,6 +131,11 @@ public:
*/
void set_state(int state) override;
/*!
* \brief Stop running acquisition
*/
void stop_acquisition() override;
private:
ConfigurationInterface* configuration_;
pcps_acquisition_sptr acquisition_;

View File

@ -39,9 +39,12 @@
#include <glog/logging.h>
using google::LogMessage;
void GalileoE1PcpsAmbiguousAcquisitionFpga::stop_acquisition()
{
}
GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
@ -126,7 +129,6 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
for (unsigned int PRN = 1; PRN <= Galileo_E1_NUMBER_OF_CODES; PRN++)
{
//code_ = new gr_complex[vector_length_];
bool cboc = false; // cboc is set to 0 when using the FPGA
@ -252,8 +254,6 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
// fprintf(fid2, "%d\n", d_all_fft_codes_[kk + nsamples_total * (PRN - 1)].imag());
// }
// fclose(fid2);
}
@ -549,4 +549,3 @@ gr::basic_block_sptr GalileoE1PcpsAmbiguousAcquisitionFpga::get_right_block()
return acquisition_fpga_;
// printf("top acq get right block end\n");
}

View File

@ -136,6 +136,11 @@ public:
*/
void set_state(int state) override;
/*!
* \brief Stop running acquisition
*/
void stop_acquisition() override;
private:
ConfigurationInterface* configuration_;
//pcps_acquisition_sptr acquisition_;

View File

@ -40,6 +40,10 @@
using google::LogMessage;
void GalileoE1PcpsCccwsrAmbiguousAcquisition::stop_acquisition()
{
}
GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -125,6 +125,11 @@ public:
*/
void set_state(int state) override;
/*!
* \brief Stop running acquisition
*/
void stop_acquisition() override;
private:
ConfigurationInterface* configuration_;
pcps_cccwsr_acquisition_cc_sptr acquisition_cc_;

View File

@ -40,6 +40,10 @@
using google::LogMessage;
void GalileoE1PcpsQuickSyncAmbiguousAcquisition::stop_acquisition()
{
}
GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcquisition(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -129,6 +129,11 @@ public:
*/
void set_state(int state) override;
/*!
* \brief Stop running acquisition
*/
void stop_acquisition() override;
private:
ConfigurationInterface* configuration_;
pcps_quicksync_acquisition_cc_sptr acquisition_cc_;

View File

@ -40,6 +40,10 @@
using google::LogMessage;
void GalileoE1PcpsTongAmbiguousAcquisition::stop_acquisition()
{
}
GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -128,6 +128,11 @@ public:
*/
void set_state(int state) override;
/*!
* \brief Stop running acquisition
*/
void stop_acquisition() override;
private:
ConfigurationInterface* configuration_;
pcps_tong_acquisition_cc_sptr acquisition_cc_;

View File

@ -46,6 +46,10 @@
using google::LogMessage;
void GalileoE5aNoncoherentIQAcquisitionCaf::stop_acquisition()
{
}
GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -131,6 +131,11 @@ public:
*/
void set_state(int state) override;
/*!
* \brief Stop running acquisition
*/
void stop_acquisition() override;
private:
ConfigurationInterface* configuration_;
galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr acquisition_cc_;

View File

@ -42,6 +42,10 @@
using google::LogMessage;
void GalileoE5aPcpsAcquisition::stop_acquisition()
{
}
GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* configuration,
std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
{

View File

@ -122,6 +122,11 @@ public:
*/
void set_state(int state) override;
/*!
* \brief Stop running acquisition
*/
void stop_acquisition() override;
private:
float calculate_threshold(float pfa);

View File

@ -39,11 +39,12 @@
#include <volk_gnsssdr/volk_gnsssdr_complex.h>
using google::LogMessage;
void GalileoE5aPcpsAcquisitionFpga::stop_acquisition()
{
}
GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterface* configuration,
std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
{
@ -165,7 +166,6 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 15) - 1) / max)),
static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 15) - 1) / max)));
}
}

View File

@ -124,6 +124,11 @@ public:
*/
void set_state(int state) override;
/*!
* \brief Stop running acquisition
*/
void stop_acquisition() override;
private:
//float calculate_threshold(float pfa);

View File

@ -43,6 +43,10 @@
using google::LogMessage;
void GlonassL1CaPcpsAcquisition::stop_acquisition()
{
}
GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -131,6 +131,11 @@ public:
*/
void set_state(int state) override;
/*!
* \brief Stop running acquisition
*/
void stop_acquisition() override;
private:
ConfigurationInterface* configuration_;
pcps_acquisition_sptr acquisition_;

View File

@ -42,6 +42,10 @@
using google::LogMessage;
void GlonassL2CaPcpsAcquisition::stop_acquisition()
{
}
GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -130,6 +130,11 @@ public:
*/
void set_state(int state) override;
/*!
* \brief Stop running acquisition
*/
void stop_acquisition() override;
private:
ConfigurationInterface* configuration_;
pcps_acquisition_sptr acquisition_;

View File

@ -45,6 +45,10 @@
using google::LogMessage;
void GpsL1CaPcpsAcquisition::stop_acquisition()
{
}
GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -135,6 +135,11 @@ public:
*/
void set_state(int state) override;
/*!
* \brief Stop running acquisition
*/
void stop_acquisition() override;
private:
ConfigurationInterface* configuration_;
pcps_acquisition_sptr acquisition_;

View File

@ -42,6 +42,10 @@
using google::LogMessage;
void GpsL1CaPcpsAcquisitionFineDoppler::stop_acquisition()
{
}
GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -126,6 +126,11 @@ public:
*/
void set_state(int state) override;
/*!
* \brief Stop running acquisition
*/
void stop_acquisition() override;
private:
pcps_acquisition_fine_doppler_cc_sptr acquisition_cc_;
size_t item_size_;

View File

@ -48,6 +48,10 @@
using google::LogMessage;
void GpsL1CaPcpsAcquisitionFpga::stop_acquisition()
{
}
GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -134,6 +134,11 @@ public:
*/
void set_state(int state) override;
/*!
* \brief Stop running acquisition
*/
void stop_acquisition() override;
private:
ConfigurationInterface* configuration_;
pcps_acquisition_fpga_sptr acquisition_fpga_;

View File

@ -42,6 +42,10 @@
using google::LogMessage;
void GpsL1CaPcpsAssistedAcquisition::stop_acquisition()
{
}
GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -122,6 +122,11 @@ public:
void reset() override;
void set_state(int state __attribute__((unused))) override{};
/*!
* \brief Stop running acquisition
*/
void stop_acquisition() override;
private:
pcps_assisted_acquisition_cc_sptr acquisition_cc_;
size_t item_size_;

View File

@ -40,6 +40,10 @@
using google::LogMessage;
void GpsL1CaPcpsOpenClAcquisition::stop_acquisition()
{
}
GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -124,6 +124,11 @@ public:
void reset() override;
void set_state(int state __attribute__((unused))) override{};
/*!
* \brief Stop running acquisition
*/
void stop_acquisition() override;
private:
ConfigurationInterface* configuration_;
pcps_opencl_acquisition_cc_sptr acquisition_cc_;

View File

@ -41,6 +41,10 @@
using google::LogMessage;
void GpsL1CaPcpsQuickSyncAcquisition::stop_acquisition()
{
}
GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -130,6 +130,11 @@ public:
*/
void set_state(int state) override;
/*!
* \brief Stop running acquisition
*/
void stop_acquisition() override;
private:
ConfigurationInterface* configuration_;
pcps_quicksync_acquisition_cc_sptr acquisition_cc_;

View File

@ -40,6 +40,10 @@
using google::LogMessage;
void GpsL1CaPcpsTongAcquisition::stop_acquisition()
{
}
GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -129,6 +129,11 @@ public:
*/
void set_state(int state) override;
/*!
* \brief Stop running acquisition
*/
void stop_acquisition() override;
private:
ConfigurationInterface* configuration_;
pcps_tong_acquisition_cc_sptr acquisition_cc_;

View File

@ -43,6 +43,10 @@
using google::LogMessage;
void GpsL2MPcpsAcquisition::stop_acquisition()
{
}
GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -133,6 +133,11 @@ public:
*/
void set_state(int state) override;
/*!
* \brief Stop running acquisition
*/
void stop_acquisition() override;
private:
ConfigurationInterface* configuration_;
pcps_acquisition_sptr acquisition_;

View File

@ -43,6 +43,10 @@
using google::LogMessage;
void GpsL2MPcpsAcquisitionFpga::stop_acquisition()
{
}
GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
@ -134,7 +138,6 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga(
d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)),
static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max)));
}
}
//acq_parameters
@ -153,9 +156,6 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga(
gnss_synchro_ = 0;
// vector_length_ = code_length_;
//
// if (bit_transition_flag_)

View File

@ -134,6 +134,11 @@ public:
*/
void set_state(int state) override;
/*!
* \brief Stop running acquisition
*/
void stop_acquisition() override;
private:
ConfigurationInterface* configuration_;
//pcps_acquisition_sptr acquisition_;

View File

@ -43,6 +43,10 @@
using google::LogMessage;
void GpsL5iPcpsAcquisition::stop_acquisition()
{
}
GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -133,6 +133,11 @@ public:
*/
void set_state(int state) override;
/*!
* \brief Stop running acquisition
*/
void stop_acquisition() override;
private:
ConfigurationInterface* configuration_;
pcps_acquisition_sptr acquisition_;

View File

@ -43,6 +43,10 @@
using google::LogMessage;
void GpsL5iPcpsAcquisitionFpga::stop_acquisition()
{
}
GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
@ -149,8 +153,6 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 15) - 1) / max)),
static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 15) - 1) / max)));
}
}
@ -221,7 +223,6 @@ void GpsL5iPcpsAcquisitionFpga::set_channel(unsigned int channel)
{
channel_ = channel;
acquisition_fpga_->set_channel(channel_);
}
@ -248,7 +249,6 @@ void GpsL5iPcpsAcquisitionFpga::set_threshold(float threshold)
// We don't use the CFAR algorithm in the FPGA. Therefore the threshold is set as such.
DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold;
acquisition_fpga_->set_threshold(threshold);
}

View File

@ -134,6 +134,11 @@ public:
*/
void set_state(int state) override;
/*!
* \brief Stop running acquisition
*/
void stop_acquisition() override;
private:
ConfigurationInterface* configuration_;
//pcps_acquisition_sptr acquisition_;

View File

@ -196,6 +196,19 @@ void Channel::set_signal(const Gnss_Signal& gnss_signal)
}
void Channel::stop_channel()
{
std::lock_guard<std::mutex> lk(mx);
bool result = channel_fsm_->Event_stop_channel();
if (!result)
{
LOG(WARNING) << "Invalid channel event";
return;
}
DLOG(INFO)
<< "Channel stop_channel()";
}
void Channel::start_acquisition()
{
std::lock_guard<std::mutex> lk(mx);

View File

@ -73,21 +73,17 @@ public:
gr::basic_block_sptr get_right_block() override;
inline std::string role() override { return role_; }
//! Returns "Channel"
inline std::string implementation() override { return implementation_; }
inline size_t item_size() override { return 0; }
inline Gnss_Signal get_signal() const override { return gnss_signal_; }
void start_acquisition() override; //!< Start the State Machine
void stop_channel() override; //!< Stop the State Machine
void set_signal(const Gnss_Signal& gnss_signal_) override; //!< Sets the channel GNSS signal
inline std::shared_ptr<AcquisitionInterface> acquisition() { return acq_; }
inline std::shared_ptr<TrackingInterface> tracking() { return trk_; }
inline std::shared_ptr<TelemetryDecoderInterface> telemetry() { return nav_; }
void msg_handler_events(pmt::pmt_t msg);
private:

View File

@ -52,6 +52,28 @@ ChannelFsm::ChannelFsm(std::shared_ptr<AcquisitionInterface> acquisition) : acq_
}
bool ChannelFsm::Event_stop_channel()
{
std::lock_guard<std::mutex> lk(mx);
DLOG(INFO) << "CH = " << channel_ << ". Ev stop channel";
switch (d_state)
{
case 0: //already in stanby
return true;
break;
case 1: //acquisition
d_state = 0;
stop_acquisition();
break;
case 2: //tracking
d_state = 0;
stop_tracking();
break;
default:
return true;
}
}
bool ChannelFsm::Event_start_acquisition()
{
std::lock_guard<std::mutex> lk(mx);
@ -165,6 +187,17 @@ void ChannelFsm::set_channel(uint32_t channel)
}
void ChannelFsm::stop_acquisition()
{
acq_->stop_acquisition();
}
void ChannelFsm::stop_tracking()
{
trk_->stop_tracking();
}
void ChannelFsm::start_acquisition()
{
acq_->reset();

View File

@ -58,6 +58,7 @@ public:
//FSM EVENTS
bool Event_start_acquisition();
bool Event_valid_acquisition();
bool Event_stop_channel();
bool Event_failed_acquisition_repeat();
bool Event_failed_acquisition_no_repeat();
bool Event_failed_tracking_standby();
@ -65,6 +66,8 @@ public:
private:
void start_acquisition();
void start_tracking();
void stop_acquisition();
void stop_tracking();
void request_satellite();
void notify_stop_tracking();

View File

@ -45,6 +45,10 @@
using google::LogMessage;
void GalileoE1DllPllVemlTracking::stop_tracking()
{
}
GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -92,6 +92,10 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override;
/*!
* \brief Stop running tracking
*/
void stop_tracking() override;
private:
dll_pll_veml_tracking_sptr tracking_;

View File

@ -46,6 +46,10 @@
using google::LogMessage;
void GalileoE1DllPllVemlTrackingFpga::stop_tracking()
{
}
GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
@ -164,7 +168,6 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
d_ca_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast<int>(ca_codes_f[s]);
d_data_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast<int>(data_codes_f[s]);
//printf("%f %d | ", data_codes_f[s], d_data_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]);
}
//printf("\n next \n");
//scanf ("%d",&kk);
@ -182,7 +185,6 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
//printf("\n next \n");
//scanf ("%d",&kk);
}
}
delete[] ca_codes_f;
@ -207,7 +209,6 @@ GalileoE1DllPllVemlTrackingFpga::~GalileoE1DllPllVemlTrackingFpga()
if (d_track_pilot)
{
delete[] d_data_codes;
}
}

View File

@ -93,6 +93,12 @@ public:
void start_tracking() override;
/*!
* \brief Stop running tracking
*/
void stop_tracking() override;
private:
//dll_pll_veml_tracking_sptr tracking_;
dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc;
@ -104,7 +110,6 @@ private:
int* d_ca_codes;
int* d_data_codes;
bool d_track_pilot;
};

View File

@ -44,6 +44,10 @@
using google::LogMessage;
void GalileoE1TcpConnectorTracking::stop_tracking()
{
}
GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -93,6 +93,10 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override;
/*!
* \brief Stop running tracking
*/
void stop_tracking() override;
private:
galileo_e1_tcp_connector_tracking_cc_sptr tracking_;

View File

@ -45,6 +45,10 @@
using google::LogMessage;
void GalileoE5aDllPllTracking::stop_tracking()
{
}
GalileoE5aDllPllTracking::GalileoE5aDllPllTracking(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -91,6 +91,10 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override;
/*!
* \brief Stop running tracking
*/
void stop_tracking() override;
private:
dll_pll_veml_tracking_sptr tracking_;

View File

@ -46,6 +46,10 @@
using google::LogMessage;
void GalileoE5aDllPllTrackingFpga::stop_tracking()
{
}
GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
ConfigurationInterface *configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
@ -153,9 +157,6 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
for (unsigned int PRN = 1; PRN <= Galileo_E5a_NUMBER_OF_CODES; PRN++)
{
//galileo_e5_a_code_gen_complex_primary(aux_code, PRN, const_cast<char *>(trk_param_fpga.signal.c_str()));
galileo_e5_a_code_gen_complex_primary(aux_code, PRN, const_cast<char *>(sig_));
if (trk_param_fpga.track_pilot)
@ -171,9 +172,7 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
d_ca_codes[static_cast<int>(code_length_chips) * (PRN - 1) + s] = static_cast<int>(tracking_code[s]);
d_data_codes[static_cast<int>(code_length_chips) * (PRN - 1) + s] = static_cast<int>(data_code[s]);
//printf("%f %d | ", data_codes_f[s], d_data_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]);
}
}
else
{
@ -187,10 +186,7 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
d_ca_codes[static_cast<int>(code_length_chips) * (PRN - 1) + s] = static_cast<int>(tracking_code[s]);
//printf("%f %d | ", ca_codes_f[s], d_ca_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]);
}
}
}
volk_gnsssdr_free(aux_code);
@ -219,8 +215,6 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
//DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
DLOG(INFO) << "tracking(" << tracking_fpga_sc->unique_id() << ")";
}
@ -230,7 +224,6 @@ GalileoE5aDllPllTrackingFpga::~GalileoE5aDllPllTrackingFpga()
if (d_track_pilot)
{
delete[] d_data_codes;
}
}

View File

@ -91,6 +91,10 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override;
/*!
* \brief Stop running tracking
*/
void stop_tracking() override;
private:
dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc;
@ -104,7 +108,6 @@ private:
int* d_ca_codes;
int* d_data_codes;
bool d_track_pilot;
};
#endif /* GNSS_SDR_GALILEO_E5A_DLL_PLL_TRACKING_FPGA_H_ */

View File

@ -46,6 +46,10 @@
using google::LogMessage;
void GlonassL1CaDllPllCAidTracking::stop_tracking()
{
}
GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -93,6 +93,10 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override;
/*!
* \brief Stop running tracking
*/
void stop_tracking() override;
private:
glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr tracking_cc;

View File

@ -45,6 +45,10 @@
using google::LogMessage;
void GlonassL1CaDllPllTracking::stop_tracking()
{
}
GlonassL1CaDllPllTracking::GlonassL1CaDllPllTracking(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -91,6 +91,10 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override;
/*!
* \brief Stop running tracking
*/
void stop_tracking() override;
private:
glonass_l1_ca_dll_pll_tracking_cc_sptr tracking_;

View File

@ -44,6 +44,10 @@
using google::LogMessage;
void GlonassL2CaDllPllCAidTracking::stop_tracking()
{
}
GlonassL2CaDllPllCAidTracking::GlonassL2CaDllPllCAidTracking(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -91,6 +91,10 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override;
/*!
* \brief Stop running tracking
*/
void stop_tracking() override;
private:
glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr tracking_cc;

View File

@ -43,6 +43,10 @@
using google::LogMessage;
void GlonassL2CaDllPllTracking::stop_tracking()
{
}
GlonassL2CaDllPllTracking::GlonassL2CaDllPllTracking(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -90,6 +90,10 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override;
/*!
* \brief Stop running tracking
*/
void stop_tracking() override;
private:
glonass_l2_ca_dll_pll_tracking_cc_sptr tracking_;

View File

@ -45,6 +45,10 @@
using google::LogMessage;
void GpsL1CaDllPllCAidTracking::stop_tracking()
{
}
GpsL1CaDllPllCAidTracking::GpsL1CaDllPllCAidTracking(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -92,6 +92,10 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override;
/*!
* \brief Stop running tracking
*/
void stop_tracking() override;
private:
gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr tracking_cc;

View File

@ -45,6 +45,11 @@
using google::LogMessage;
void GpsL1CaDllPllTracking::stop_tracking()
{
tracking_->stop_tracking();
}
GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -91,6 +91,11 @@ public:
void start_tracking() override;
/*!
* \brief Stop running tracking
*/
void stop_tracking() override;
private:
dll_pll_veml_tracking_sptr tracking_;
size_t item_size_;

View File

@ -48,10 +48,13 @@
using google::LogMessage;
void GpsL1CaDllPllTrackingFpga::stop_tracking()
{
}
GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) :
role_(role), in_streams_(in_streams), out_streams_(out_streams)
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
{
Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga();
DLOG(INFO) << "role " << role;
@ -146,7 +149,6 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga(
tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga);
channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_fpga_sc->unique_id() << ")";
}
GpsL1CaDllPllTrackingFpga::~GpsL1CaDllPllTrackingFpga()
@ -175,14 +177,18 @@ void GpsL1CaDllPllTrackingFpga::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
void GpsL1CaDllPllTrackingFpga::connect(gr::top_block_sptr top_block)
{
if(top_block) { /* top_block is not null */};
if (top_block)
{ /* top_block is not null */
};
//nothing to connect
}
void GpsL1CaDllPllTrackingFpga::disconnect(gr::top_block_sptr top_block)
{
if(top_block) { /* top_block is not null */};
if (top_block)
{ /* top_block is not null */
};
//nothing to disconnect
}
@ -197,5 +203,3 @@ gr::basic_block_sptr GpsL1CaDllPllTrackingFpga::get_right_block()
{
return tracking_fpga_sc;
}

View File

@ -93,7 +93,10 @@ public:
void start_tracking() override;
//void reset(void);
/*!
* \brief Stop running tracking
*/
void stop_tracking() override;
private:
dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc;

View File

@ -44,6 +44,10 @@
using google::LogMessage;
void GpsL1CaDllPllTrackingGPU::stop_tracking()
{
}
GpsL1CaDllPllTrackingGPU::GpsL1CaDllPllTrackingGPU(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -91,6 +91,11 @@ public:
void start_tracking() override;
/*!
* \brief Stop running tracking
*/
void stop_tracking() override;
private:
gps_l1_ca_dll_pll_tracking_gpu_cc_sptr tracking_;
size_t item_size_;

View File

@ -47,6 +47,10 @@
using google::LogMessage;
void GpsL1CaKfTracking::stop_tracking()
{
}
GpsL1CaKfTracking::GpsL1CaKfTracking(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -93,6 +93,11 @@ public:
void start_tracking() override;
/*!
* \brief Stop running tracking
*/
void stop_tracking() override;
private:
gps_l1_ca_kf_tracking_cc_sptr tracking_;
size_t item_size_;

View File

@ -43,6 +43,10 @@
using google::LogMessage;
void GpsL1CaTcpConnectorTracking::stop_tracking()
{
}
GpsL1CaTcpConnectorTracking::GpsL1CaTcpConnectorTracking(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -91,6 +91,10 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override;
/*!
* \brief Stop running tracking
*/
void stop_tracking() override;
private:
gps_l1_ca_tcp_connector_tracking_cc_sptr tracking_;

View File

@ -45,6 +45,10 @@
using google::LogMessage;
void GpsL2MDllPllTracking::stop_tracking()
{
}
GpsL2MDllPllTracking::GpsL2MDllPllTracking(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -90,6 +90,10 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override;
/*!
* \brief Stop running tracking
*/
void stop_tracking() override;
private:
dll_pll_veml_tracking_sptr tracking_;

View File

@ -47,6 +47,10 @@
using google::LogMessage;
void GpsL2MDllPllTrackingFpga::stop_tracking()
{
}
GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -91,6 +91,10 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override;
/*!
* \brief Stop running tracking
*/
void stop_tracking() override;
private:
//dll_pll_veml_tracking_sptr tracking_;

View File

@ -45,6 +45,10 @@
using google::LogMessage;
void GpsL5DllPllTracking::stop_tracking()
{
}
GpsL5DllPllTracking::GpsL5DllPllTracking(
ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)

View File

@ -89,6 +89,10 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override;
/*!
* \brief Stop running tracking
*/
void stop_tracking() override;
private:
dll_pll_veml_tracking_sptr tracking_;

View File

@ -47,6 +47,10 @@
using google::LogMessage;
void GpsL5DllPllTrackingFpga::stop_tracking()
{
}
GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
ConfigurationInterface *configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
@ -153,10 +157,8 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
//printf("start \n");
for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++)
{
if (track_pilot)
{
gps_l5q_code_gen_float(tracking_code, PRN);
gps_l5i_code_gen_float(data_code, PRN);
@ -166,13 +168,11 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
d_ca_codes[static_cast<int>(code_length_chips) * (PRN - 1) + s] = static_cast<int>(tracking_code[s]);
d_data_codes[static_cast<int>(code_length_chips) * (PRN - 1) + s] = static_cast<int>(data_code[s]);
//printf("%f %d | ", data_codes_f[s], d_data_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]);
}
}
else
{
gps_l5i_code_gen_float(tracking_code, PRN);
for (unsigned int s = 0; s < code_length_chips; s++)
{
@ -214,12 +214,10 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
GpsL5DllPllTrackingFpga::~GpsL5DllPllTrackingFpga()
{
delete[] d_ca_codes;
if (d_track_pilot)
{
delete[] d_data_codes;
}
}

View File

@ -89,6 +89,10 @@ public:
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
void start_tracking() override;
/*!
* \brief Stop running tracking
*/
void stop_tracking() override;
private:
//dll_pll_veml_tracking_sptr tracking_;

View File

@ -1324,6 +1324,12 @@ void dll_pll_veml_tracking::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro)
}
void dll_pll_veml_tracking::stop_tracking()
{
gr::thread::scoped_lock l(d_setlock);
d_state = 0;
}
int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
{

View File

@ -61,6 +61,7 @@ public:
void set_channel(uint32_t channel);
void set_gnss_synchro(Gnss_Synchro *p_gnss_synchro);
void start_tracking();
void stop_tracking();
int general_work(int noutput_items, gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);

View File

@ -1214,10 +1214,16 @@ void dll_pll_veml_tracking_fpga::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro)
d_acquisition_gnss_synchro = p_gnss_synchro;
}
void dll_pll_veml_tracking_fpga::stop_tracking()
{
gr::thread::scoped_lock l(d_setlock);
d_state = 0;
}
int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)),
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
{
gr::thread::scoped_lock l(d_setlock);
// Block input data and block output stream pointers
Gnss_Synchro **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);

View File

@ -52,44 +52,11 @@
#include <boost/circular_buffer.hpp>
#include "fpga_multicorrelator.h"
//typedef struct
//{
// /* DLL/PLL tracking configuration */
// double fs_in;
// uint32_t vector_length;
// bool dump;
// std::string dump_filename;
// float pll_bw_hz;
// float dll_bw_hz;
// float pll_bw_narrow_hz;
// float dll_bw_narrow_hz;
// float early_late_space_chips;
// float very_early_late_space_chips;
// float early_late_space_narrow_chips;
// float very_early_late_space_narrow_chips;
// int32_t extend_correlation_symbols;
// int32_t cn0_samples;
// int32_t cn0_min;
// int32_t max_lock_fail;
// double carrier_lock_th;
// bool track_pilot;
// char system;
// char signal[3];
// std::string device_name;
// uint32_t device_base;
// uint32_t multicorr_type;
// uint32_t code_length_chips;
// uint32_t code_samples_per_chip;
// int* ca_codes;
// int* data_codes;
//} dllpllconf_fpga_t;
class dll_pll_veml_tracking_fpga;
typedef boost::shared_ptr<dll_pll_veml_tracking_fpga>
dll_pll_veml_tracking_fpga_sptr;
//dll_pll_veml_tracking_fpga_sptr dll_pll_veml_make_tracking_fpga(const dllpllconf_fpga_t &conf_);
dll_pll_veml_tracking_fpga_sptr dll_pll_veml_make_tracking_fpga(const Dll_Pll_Conf_Fpga &conf_);
@ -104,7 +71,7 @@ public:
void set_channel(uint32_t channel);
void set_gnss_synchro(Gnss_Synchro *p_gnss_synchro);
void start_tracking();
void stop_tracking();
int general_work(int noutput_items, gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);

View File

@ -64,6 +64,7 @@ public:
virtual void set_state(int state) = 0;
virtual signed int mag() = 0;
virtual void reset() = 0;
virtual void stop_acquisition() = 0;
};
#endif /* GNSS_SDR_ACQUISITION_INTERFACE */

View File

@ -53,6 +53,7 @@ class ChannelInterface : public GNSSBlockInterface
public:
virtual Gnss_Signal get_signal() const = 0;
virtual void start_acquisition() = 0;
virtual void stop_channel() = 0;
virtual void set_signal(const Gnss_Signal&) = 0;
};

View File

@ -56,6 +56,7 @@ class TrackingInterface : public GNSSBlockInterface
{
public:
virtual void start_tracking() = 0;
virtual void stop_tracking() = 0;
virtual void set_gnss_synchro(Gnss_Synchro* gnss_synchro) = 0;
virtual void set_channel(unsigned int channel) = 0;
};

View File

@ -5,6 +5,7 @@
* Luis Esteve, 2012. luis(at)epsilon-formacion.com
* Carles Fernandez-Prades, 2014. cfernandez(at)cttc.es
* Álvaro Cebrián Juan, 2018. acebrianjuan(at)gmail.com
* Javier Arribas, 2018. javiarribas(at)gmail.com
*
* -------------------------------------------------------------------------
*
@ -811,14 +812,32 @@ bool GNSSFlowgraph::send_telemetry_msg(pmt::pmt_t msg)
/*
* Applies an action to the flow graph
*
* \param[in] who Who generated the action
* \param[in] what What is the action 0: acquisition failed
* \param[in] who Who generated the action:
* -> 0-199 are the channels IDs
* -> 200 is the control_thread dispatched by the control_thread apply_action
* -> 300 is the telecommand system (TC) for receiver control
* -> 400 - 599 is the TC channel control for channels 0-199
* \param[in] what What is the action:
* --- actions from channels ---
* -> 0 acquisition failed
* -> 1 acquisition succesfull
* -> 2 tracking lost
* --- actions from TC receiver control ---
* -> 10 TC request standby mode
* -> 11 TC request coldstart
* -> 12 TC request hotstart
* -> 13 TC request warmstart
* --- actions from TC channel control ---
* -> 20 stop channel
* -> 21 start channel
*/
void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
{
std::lock_guard<std::mutex> lock(signal_list_mutex);
DLOG(INFO) << "Received " << what << " from " << who << ". Number of applied actions = " << applied_actions_;
unsigned int sat = 0;
if (who < 200)
{
try
{
sat = configuration_->property("Channel" + std::to_string(who) + ".satellite", 0);
@ -827,6 +846,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
{
LOG(WARNING) << e.what();
}
}
switch (what)
{
case 0:
@ -1026,7 +1046,162 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
}
}
break;
case 10: //request stanby mode
LOG(INFO) << "TC request stanby mode";
for (size_t n = 0; n < channels_.size(); n++)
{
if (channels_state_[n] == 1 or channels_state_[n] == 2) //channel in acquisition or in tracking
{
//recover the satellite assigned
Gnss_Signal gs = channels_[n]->get_signal();
switch (mapStringValues_[gs.get_signal_str()])
{
case evGPS_1C:
available_GPS_1C_signals_.remove(gs);
available_GPS_1C_signals_.push_back(gs);
break;
case evGPS_2S:
available_GPS_2S_signals_.remove(gs);
available_GPS_2S_signals_.push_back(gs);
break;
case evGPS_L5:
available_GPS_L5_signals_.remove(gs);
available_GPS_L5_signals_.push_back(gs);
break;
case evGAL_1B:
available_GAL_1B_signals_.remove(gs);
available_GAL_1B_signals_.push_back(gs);
break;
case evGAL_5X:
available_GAL_5X_signals_.remove(gs);
available_GAL_5X_signals_.push_back(gs);
break;
case evGLO_1G:
available_GLO_1G_signals_.remove(gs);
available_GLO_1G_signals_.push_back(gs);
break;
case evGLO_2G:
available_GLO_2G_signals_.remove(gs);
available_GLO_2G_signals_.push_back(gs);
break;
default:
LOG(ERROR) << "This should not happen :-(";
break;
}
channels_[n]->stop_channel(); //stop the acquisition or tracking operation
channels_state_[n] = 0;
}
}
acq_channels_count_ = 0; //all channels are in stanby now
break;
case 11: //request coldstart mode
LOG(INFO) << "TC request coldstart";
//todo: delete all ephemeris and almanac information from maps (also the PVT map queue)
//todo: reorder the satellite queues to the receiver default startup order.
//This is required to allow repeatability. Otherwise the satellite search order will depend on the last tracked satellites
//start again the satellite acquisitions
for (unsigned int i = 0; i < channels_count_; i++)
{
unsigned int ch_index = (who + i + 1) % channels_count_;
unsigned int sat_ = 0;
try
{
sat_ = configuration_->property("Channel" + std::to_string(ch_index) + ".satellite", 0);
}
catch (const std::exception& e)
{
LOG(WARNING) << e.what();
}
if ((acq_channels_count_ < max_acq_channels_) && (channels_state_[ch_index] == 0))
{
channels_state_[ch_index] = 1;
if (sat_ == 0)
{
channels_[ch_index]->set_signal(search_next_signal(channels_[ch_index]->get_signal().get_signal_str(), true));
}
acq_channels_count_++;
DLOG(INFO) << "Channel " << ch_index << " Starting acquisition " << channels_[ch_index]->get_signal().get_satellite() << ", Signal " << channels_[ch_index]->get_signal().get_signal_str();
channels_[ch_index]->start_acquisition();
}
DLOG(INFO) << "Channel " << ch_index << " in state " << channels_state_[ch_index];
}
break;
case 12: //request hotstart mode
LOG(INFO) << "TC request hotstart";
//todo: call here the function that computes the set of visible satellites and its elevation
//for the date and time specified by the hotstart command and the last available PVT
//todo: reorder the satellite queue to acquire first those visible satellites
//start again the satellite acquisitions
for (unsigned int i = 0; i < channels_count_; i++)
{
unsigned int ch_index = (who + i + 1) % channels_count_;
unsigned int sat_ = 0;
try
{
sat_ = configuration_->property("Channel" + std::to_string(ch_index) + ".satellite", 0);
}
catch (const std::exception& e)
{
LOG(WARNING) << e.what();
}
if ((acq_channels_count_ < max_acq_channels_) && (channels_state_[ch_index] == 0))
{
channels_state_[ch_index] = 1;
if (sat_ == 0)
{
channels_[ch_index]->set_signal(search_next_signal(channels_[ch_index]->get_signal().get_signal_str(), true));
}
acq_channels_count_++;
DLOG(INFO) << "Channel " << ch_index << " Starting acquisition " << channels_[ch_index]->get_signal().get_satellite() << ", Signal " << channels_[ch_index]->get_signal().get_signal_str();
channels_[ch_index]->start_acquisition();
}
DLOG(INFO) << "Channel " << ch_index << " in state " << channels_state_[ch_index];
}
break;
case 13: //request warmstart mode
LOG(INFO) << "TC request warmstart";
//todo: delete all ephemeris and almanac information from maps (also the PVT map queue)
//todo: load the ephemeris and the almanac from XML files (receiver assistance)
//todo: call here the function that computes the set of visible satellites and its elevation
//for the date and time specified by the warmstart command and the assisted position
//todo: reorder the satellite queue to acquire first those visible satellites
//start again the satellite acquisitions
for (unsigned int i = 0; i < channels_count_; i++)
{
unsigned int ch_index = (who + i + 1) % channels_count_;
unsigned int sat_ = 0;
try
{
sat_ = configuration_->property("Channel" + std::to_string(ch_index) + ".satellite", 0);
}
catch (const std::exception& e)
{
LOG(WARNING) << e.what();
}
if ((acq_channels_count_ < max_acq_channels_) && (channels_state_[ch_index] == 0))
{
channels_state_[ch_index] = 1;
if (sat_ == 0)
{
channels_[ch_index]->set_signal(search_next_signal(channels_[ch_index]->get_signal().get_signal_str(), true));
}
acq_channels_count_++;
DLOG(INFO) << "Channel " << ch_index << " Starting acquisition " << channels_[ch_index]->get_signal().get_satellite() << ", Signal " << channels_[ch_index]->get_signal().get_signal_str();
channels_[ch_index]->start_acquisition();
}
DLOG(INFO) << "Channel " << ch_index << " in state " << channels_state_[ch_index];
}
break;
default:
break;
}

View File

@ -51,31 +51,63 @@ std::string TcpCmdInterface::reset(const std::vector<std::string> &commandLine)
return response;
}
std::string TcpCmdInterface::stop(const std::vector<std::string> &commandLine)
std::string TcpCmdInterface::standby(const std::vector<std::string> &commandLine)
{
std::string response;
response = "Not implemented\n";
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (control_queue_ != nullptr)
{
control_queue_->handle(cmf->GetQueueMessage(300, 10)); //send the standby message (who=300,what=10)
response = "OK\n";
}
else
{
response = "ERROR\n";
}
return response;
}
std::string TcpCmdInterface::status(const std::vector<std::string> &commandLine)
{
std::string response;
//todo: implement the receiver status report
response = "Not implemented\n";
return response;
}
std::string TcpCmdInterface::assistedstart(const std::vector<std::string> &commandLine)
std::string TcpCmdInterface::hotstart(const std::vector<std::string> &commandLine)
{
std::string response;
response = "Not implemented\n";
//todo: read and parse the command line parameter: dd/mm/yyyy HH:MM:SS
//todo: store it in a member variable
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (control_queue_ != nullptr)
{
control_queue_->handle(cmf->GetQueueMessage(300, 12)); //send the standby message (who=300,what=12)
response = "OK\n";
}
else
{
response = "ERROR\n";
}
return response;
}
std::string TcpCmdInterface::warmstart(const std::vector<std::string> &commandLine)
{
std::string response;
response = "Not implemented\n";
//todo: read and parse the command line parameter: dd/mm/yyyy HH:MM:SS
//todo: store it in a member variable
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (control_queue_ != nullptr)
{
control_queue_->handle(cmf->GetQueueMessage(300, 13)); //send the standby message (who=300,what=13)
response = "OK\n";
}
else
{
response = "ERROR\n";
}
return response;
}
@ -83,13 +115,23 @@ std::string TcpCmdInterface::warmstart(const std::vector<std::string> &commandLi
std::string TcpCmdInterface::coldstart(const std::vector<std::string> &commandLine)
{
std::string response;
response = "Not implemented\n";
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (control_queue_ != nullptr)
{
control_queue_->handle(cmf->GetQueueMessage(300, 11)); //send the standby message (who=300,what=11)
response = "OK\n";
}
else
{
response = "ERROR\n";
}
return response;
}
std::string TcpCmdInterface::set_ch_satellite(const std::vector<std::string> &commandLine)
{
std::string response;
//todo: implement the set satellite command
response = "Not implemented\n";
return response;
}
@ -98,9 +140,9 @@ std::string TcpCmdInterface::set_ch_satellite(const std::vector<std::string> &co
void TcpCmdInterface::register_functions()
{
functions["status"] = std::bind(&TcpCmdInterface::status, this, std::placeholders::_1);
functions["stop"] = std::bind(&TcpCmdInterface::stop, this, std::placeholders::_1);
functions["standby"] = std::bind(&TcpCmdInterface::standby, this, std::placeholders::_1);
functions["reset"] = std::bind(&TcpCmdInterface::reset, this, std::placeholders::_1);
functions["assistedstart"] = std::bind(&TcpCmdInterface::assistedstart, this, std::placeholders::_1);
functions["hotstart"] = std::bind(&TcpCmdInterface::hotstart, this, std::placeholders::_1);
functions["warmstart"] = std::bind(&TcpCmdInterface::warmstart, this, std::placeholders::_1);
functions["coldstart"] = std::bind(&TcpCmdInterface::coldstart, this, std::placeholders::_1);
functions["set_ch_satellite"] = std::bind(&TcpCmdInterface::set_ch_satellite, this, std::placeholders::_1);
@ -168,6 +210,8 @@ void TcpCmdInterface::run_cmd_server(int tcp_port)
if (cmd_vector.at(0).compare("exit") == 0)
{
error = boost::asio::error::eof;
//send cmd response
socket.write_some(boost::asio::buffer("OK\n"), not_throw);
}
else
{

View File

@ -58,8 +58,8 @@ private:
functions;
std::string status(const std::vector<std::string> &commandLine);
std::string reset(const std::vector<std::string> &commandLine);
std::string stop(const std::vector<std::string> &commandLine);
std::string assistedstart(const std::vector<std::string> &commandLine);
std::string standby(const std::vector<std::string> &commandLine);
std::string hotstart(const std::vector<std::string> &commandLine);
std::string warmstart(const std::vector<std::string> &commandLine);
std::string coldstart(const std::vector<std::string> &commandLine);
std::string set_ch_satellite(const std::vector<std::string> &commandLine);