From 9f1ba12f3640f95ebb56b83069b925c4d63b5f43 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 12 Mar 2019 15:28:22 +0100 Subject: Lime: Show fifo fullness in RC --- src/output/SDR.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/output/SDR.cpp') diff --git a/src/output/SDR.cpp b/src/output/SDR.cpp index 23a947b..31a5c79 100644 --- a/src/output/SDR.cpp +++ b/src/output/SDR.cpp @@ -25,6 +25,7 @@ */ #include "output/SDR.h" +#include "output/Lime.h" #include "PcDebug.h" #include "Log.h" @@ -83,6 +84,10 @@ SDR::SDR(SDRDeviceConfig& config, std::shared_ptr device) : RC_ADD_PARAMETER(frames, "Counter of number of frames modulated"); RC_ADD_PARAMETER(gpsdo_num_sv, "Number of Satellite Vehicles tracked by GPSDO"); RC_ADD_PARAMETER(gpsdo_holdover, "1 if the GPSDO is in holdover, 0 if it is using gnss"); + + if (std::dynamic_pointer_cast(device)) { + RC_ADD_PARAMETER(fifo_fill, "A value representing the Lime FIFO fullness"); + } } SDR::~SDR() @@ -388,7 +393,8 @@ void SDR::set_parameter(const string& parameter, const string& value) parameter == "latepackets" or parameter == "frames" or parameter == "gpsdo_num_sv" or - parameter == "gpsdo_holdover") { + parameter == "gpsdo_holdover" or + parameter == "fifo_fill") { throw ParameterError("Parameter " + parameter + " is read-only."); } else { @@ -453,6 +459,18 @@ const string SDR::get_parameter(const string& parameter) const const auto stat = m_device->get_run_statistics(); ss << (stat.gpsdo_holdover ? 1 : 0); } + else if (parameter == "fifo_fill") { + const auto dev = std::dynamic_pointer_cast(m_device); + + if (dev) { + ss << dev->get_fifo_fill_count(); + } + else { + ss << "Parameter '" << parameter << + "' is not exported by controllable " << get_rc_name(); + throw ParameterError(ss.str()); + } + } else { ss << "Parameter '" << parameter << "' is not exported by controllable " << get_rc_name(); -- cgit v1.2.3