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

Telecommand status: show mode information (channel FSM state)

This commit is contained in:
Álvaro Cebrián Juan 2020-09-01 12:53:10 +02:00
parent 6a16813483
commit 15713fc4bb
4 changed files with 15 additions and 5 deletions

View File

@ -86,6 +86,8 @@ public:
inline std::shared_ptr<TrackingInterface> tracking() const { return trk_; } inline std::shared_ptr<TrackingInterface> tracking() const { return trk_; }
inline std::shared_ptr<TelemetryDecoderInterface> telemetry() const { return nav_; } inline std::shared_ptr<TelemetryDecoderInterface> telemetry() const { return nav_; }
inline uint32_t fsm_state() { return channel_fsm_->state(); }
private: private:
std::shared_ptr<ChannelFsm> channel_fsm_; std::shared_ptr<ChannelFsm> channel_fsm_;
std::shared_ptr<AcquisitionInterface> acq_; std::shared_ptr<AcquisitionInterface> acq_;

View File

@ -58,6 +58,8 @@ public:
virtual bool Event_failed_acquisition_repeat(); virtual bool Event_failed_acquisition_repeat();
virtual bool Event_failed_acquisition_no_repeat(); virtual bool Event_failed_acquisition_no_repeat();
inline uint32_t state() { return state_; }
private: private:
void start_tracking(); void start_tracking();
void stop_acquisition(); void stop_acquisition();

View File

@ -55,6 +55,10 @@ TcpCmdInterface::TcpCmdInterface()
map_signal_pretty_name_["L5"] = "L5"; map_signal_pretty_name_["L5"] = "L5";
map_signal_pretty_name_["B1"] = "B1I"; map_signal_pretty_name_["B1"] = "B1I";
map_signal_pretty_name_["B3"] = "B3I"; map_signal_pretty_name_["B3"] = "B3I";
map_state_name_[0] = "STBY";
map_state_name_[1] = "ACQ";
map_state_name_[2] = "TRK";
} }
@ -153,21 +157,22 @@ std::string TcpCmdInterface::status(const std::vector<std::string> &commandLine
std::shared_ptr<Channel> std::shared_ptr<Channel>
ch_sptr = std::dynamic_pointer_cast<Channel>(channels_sptr_->at(n)); ch_sptr = std::dynamic_pointer_cast<Channel>(channels_sptr_->at(n));
std::string sys = ch_sptr->get_signal().get_satellite().get_system(); std::string system = ch_sptr->get_signal().get_satellite().get_system();
std::string sig = map_signal_pretty_name_.at(ch_sptr->get_signal().get_signal_str()); std::string signal = map_signal_pretty_name_.at(ch_sptr->get_signal().get_signal_str());
uint32_t prn = ch_sptr->get_signal().get_satellite().get_PRN(); uint32_t prn = ch_sptr->get_signal().get_satellite().get_PRN();
std::string state = map_state_name_.at(ch_sptr->fsm_state());
str_stream << std::fixed << std::setprecision(1) str_stream << std::fixed << std::setprecision(1)
<< "| " << "| "
<< std::right << std::setw(3) << n << std::right << std::setw(3) << n
<< " | " << " | "
<< std::left << std::setw(7) << sys << std::left << std::setw(7) << system
<< " | " << " | "
<< std::left << std::setw(6) << sig << std::left << std::setw(6) << signal
<< " | " << " | "
<< std::right << std::setw(3) << prn << std::right << std::setw(3) << prn
<< " | " << " | "
<< std::left << std::setw(4) << "----" << std::left << std::setw(4) << state
<< " | " << " | "
<< std::left << std::setw(3) << "---" << std::left << std::setw(3) << "---"
<< " | " << " | "

View File

@ -75,6 +75,7 @@ private:
std::shared_ptr<std::vector<std::shared_ptr<ChannelInterface>>> channels_sptr_; std::shared_ptr<std::vector<std::shared_ptr<ChannelInterface>>> channels_sptr_;
std::map<std::string, std::string> map_signal_pretty_name_; std::map<std::string, std::string> map_signal_pretty_name_;
std::map<uint32_t, std::string> map_state_name_;
float rx_latitude_; float rx_latitude_;
float rx_longitude_; float rx_longitude_;