ue,stdout: fix the SNR formatting in UE console (NR)

When the SNR value is INF, the conversion to (int) causes
-2147483648 to be displayed in the UE console.
This commit fixes the formatting, so that the values INF or
NaN would be displayed as N/A

NOTE: The issue of getting an INF value for the reported SNR metric
still needs to be addressed separately.
master
Carlo Galiotto 3 years ago committed by Andre Puschmann
parent 6d432646b9
commit ebaa71d190

@ -135,7 +135,11 @@ void metrics_stdout::set_metrics_helper(const phy_metrics_t& phy,
fmt::print(" |");
fmt::print(" {:>2}", int(phy.dl[r].mcs));
if (std::isnan(phy.ch[r].sinr) || std::isinf(phy.ch[r].sinr)) {
fmt::print(" {:>3}", "n/a");
} else {
fmt::print(" {:>3}", int(phy.ch[r].sinr));
}
fmt::print(" {:>4.1f}", phy.dl[r].fec_iters);
fmt::print(" {:>6.6}", float_to_eng_string((float)mac[r].rx_brate / (mac[r].nof_tti * 1e-3), 2));

Loading…
Cancel
Save