From b6b7cc76a351bea1bd25d7eb37e2e441bba968a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Cebri=C3=A1n=20Juan?= Date: Wed, 2 Sep 2020 02:18:38 +0200 Subject: [PATCH] Telecommand status: add DROP state and make map members const --- src/core/receiver/tcp_cmd_interface.cc | 16 +--------------- src/core/receiver/tcp_cmd_interface.h | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index 18ec9d7f3..8eb997c88 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -35,6 +35,7 @@ using b_io_context = boost::asio::io_context; using b_io_context = boost::asio::io_service; #endif + TcpCmdInterface::TcpCmdInterface() { register_functions(); @@ -44,21 +45,6 @@ TcpCmdInterface::TcpCmdInterface() rx_longitude_ = 0.0; rx_altitude_ = 0.0; receiver_utc_time_ = 0; - - map_signal_pretty_name_["1C"] = "L1 C/A"; - map_signal_pretty_name_["1B"] = "E1"; - map_signal_pretty_name_["1G"] = "L1 C/A"; - map_signal_pretty_name_["2S"] = "L2C"; - map_signal_pretty_name_["2G"] = "L2 C/A"; - map_signal_pretty_name_["5X"] = "E5a"; - map_signal_pretty_name_["7X"] = "E5b"; - map_signal_pretty_name_["L5"] = "L5"; - map_signal_pretty_name_["B1"] = "B1I"; - map_signal_pretty_name_["B3"] = "B3I"; - - map_state_name_[0] = "STBY"; - map_state_name_[1] = "ACQ"; - map_state_name_[2] = "TRK"; } diff --git a/src/core/receiver/tcp_cmd_interface.h b/src/core/receiver/tcp_cmd_interface.h index 8f20db106..9d27fa6c4 100644 --- a/src/core/receiver/tcp_cmd_interface.h +++ b/src/core/receiver/tcp_cmd_interface.h @@ -74,8 +74,23 @@ private: std::shared_ptr PVT_sptr_; std::shared_ptr>> channels_sptr_; - std::map map_signal_pretty_name_; - std::map map_state_name_; + const std::map map_signal_pretty_name_{ + {"1C", "L1 C/A"}, + {"1B", "E1"}, + {"1G", "L1 C/A"}, + {"2S", "L2C"}, + {"2G", "L2 C/A"}, + {"5X", "E5a"}, + {"7X", "E5b"}, + {"L5", "L5"}, + {"B1", "B1I"}, + {"B3", "B3I"}}; + + const std::map map_state_name_{ + {0, "STBY"}, + {1, "ACQ"}, + {2, "TRK"}, + {3, "DROP"}}; float rx_latitude_; float rx_longitude_;