1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-11-15 06:14:58 +00:00

Telecommand status: print basic channel information

Available info: channel number, system, signal and PRN.
Missing info: mode, telemetry status, ephemeris status, Doppler and CN0
This commit is contained in:
Álvaro Cebrián Juan 2020-08-31 14:12:12 +02:00
parent df2f84dfb0
commit e8a03c4855
4 changed files with 53 additions and 11 deletions

View File

@ -326,6 +326,7 @@ int ControlThread::run()
// start the telecommand listener thread
cmd_interface_.set_pvt(flowgraph_->get_pvt());
cmd_interface_.set_channels(flowgraph_->get_channels());
cmd_interface_thread_ = std::thread(&ControlThread::telecommand_listener, this);
#ifdef ENABLE_FPGA

View File

@ -145,6 +145,14 @@ public:
return std::dynamic_pointer_cast<PvtInterface>(pvt_);
}
/*!
* \brief Returns a smart pointer to the Channels object
*/
std::shared_ptr<std::vector<std::shared_ptr<ChannelInterface>>> get_channels()
{
return std::make_shared<std::vector<std::shared_ptr<ChannelInterface>>>(channels_);
}
/*!
* \brief Priorize visible satellites in the specified vector
*/

View File

@ -19,6 +19,7 @@
*/
#include "tcp_cmd_interface.h"
#include "channel.h"
#include "command_event.h"
#include "pvt_interface.h"
#include <boost/asio.hpp>
@ -74,6 +75,12 @@ void TcpCmdInterface::set_pvt(std::shared_ptr<PvtInterface> PVT_sptr)
}
void TcpCmdInterface::set_channels(std::shared_ptr<std::vector<std::shared_ptr<ChannelInterface>>> channels_sptr)
{
channels_sptr_ = std::move(channels_sptr);
}
time_t TcpCmdInterface::get_utc_time() const
{
return receiver_utc_time_;
@ -123,18 +130,41 @@ std::string TcpCmdInterface::standby(const std::vector<std::string> &commandLine
std::string TcpCmdInterface::status(const std::vector<std::string> &commandLine __attribute__((unused)))
{
std::stringstream str_stream;
// todo: implement the receiver status report
// str_stream << "-------------------------------------------------------\n";
// str_stream << "ch | sys | sig | mode | Tlm | Eph | Doppler | CN0 |\n";
// str_stream << " | | | | | | [Hz] | [dB - Hz] |\n";
// str_stream << "-------------------------------------------------------\n";
// int n_ch = 10;
// for (int n = 0; n < n_ch; n++)
// {
// str_stream << n << "GPS | L1CA | TRK | YES | YES | 23412.4 | 44.3 |\n";
// }
// str_stream << "--------------------------------------------------------\n";
str_stream << "----------------------------------------------------------------------------\n";
str_stream << "| Ch | System | Signal | PRN | Mode | Tlm | Eph | Doppler | CN0 |\n";
str_stream << "| | | | | | | | [Hz] | [dB-Hz] |\n";
str_stream << "----------------------------------------------------------------------------\n";
int n_ch = static_cast<int>(channels_sptr_->size());
for (int n = 0; n < n_ch; n++)
{
std::shared_ptr<Channel>
ch_sptr = std::dynamic_pointer_cast<Channel>(channels_sptr_->at(n));
str_stream << std::fixed << std::setprecision(1)
<< "| "
<< std::right << std::setw(3) << n
<< " | "
<< std::left << std::setw(7) << ch_sptr->get_signal().get_satellite().get_system()
<< " | "
<< std::left << std::setw(9) << ch_sptr->get_signal().get_signal_str()
<< " | "
<< std::right << std::setw(3) << ch_sptr->get_signal().get_satellite().get_PRN()
<< " | "
<< std::left << std::setw(4) << "---"
<< " | "
<< std::left << std::setw(3) << "---"
<< " | "
<< std::left << std::setw(3) << "---"
<< " | "
<< std::right << std::setw(9) << 23412.46
<< " | "
<< std::right << std::setw(7) << 44.32
<< " |"
<< "\n";
}
str_stream << "----------------------------------------------------------------------------\n";
double longitude_deg;
double latitude_deg;

View File

@ -33,6 +33,7 @@
#include <vector>
class PvtInterface;
class ChannelInterface;
class TcpCmdInterface
{
@ -53,6 +54,7 @@ public:
std::array<float, 3> get_LLH() const;
void set_pvt(std::shared_ptr<PvtInterface> PVT_sptr);
void set_channels(std::shared_ptr<std::vector<std::shared_ptr<ChannelInterface>>> channels_sptr);
private:
std::unordered_map<std::string, std::function<std::string(const std::vector<std::string> &)>>
@ -69,6 +71,7 @@ private:
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> control_queue_;
std::shared_ptr<PvtInterface> PVT_sptr_;
std::shared_ptr<std::vector<std::shared_ptr<ChannelInterface>>> channels_sptr_;
float rx_latitude_;
float rx_longitude_;