MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / formatTMate2PowerSmallText

Function formatTMate2PowerSmallText

src/gui/MainWindow_Controllers.cpp:55–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53constexpr int kTMate2DefaultOverlayDurationMs = 1500;
54
55QString formatTMate2PowerSmallText(float watts)
56{
57 // std::lround(NaN) is unspecified; clamp to 0 first, mirroring powerBars().
58 if (!std::isfinite(watts))
59 watts = 0.0f;
60 const int roundedWatts = std::clamp(static_cast<int>(std::lround(watts)), 0, 9999);
61 if (roundedWatts <= 999)
62 return QString::number(roundedWatts);
63
64 const int tenthsKw = std::clamp(static_cast<int>(std::lround(watts / 100.0f)), 10, 99);
65 return QStringLiteral("%1k%2").arg(tenthsKw / 10).arg(tenthsKw % 10);
66}
67
68bool usesExternalReceiveControls(const SliceModel* slice)
69{

Callers 1

updateTMate2DisplayMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected