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

Method setGrDb

src/gui/ClientCompApplet.cpp:45–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43 }
44
45 void setGrDb(float grDb)
46 {
47 if (std::fabs(grDb - m_grDb) < 0.05f) return;
48 m_grDb = grDb;
49 constexpr float kMaxGr = 20.0f;
50 m_smooth.setTarget(std::clamp(-m_grDb, 0.0f, kMaxGr) / kMaxGr);
51 if (!m_smooth.needsAnimation()) {
52 if (m_animTimer.isActive()) m_animTimer.stop();
53 update();
54 } else if (!m_animTimer.isActive()) {
55 m_animElapsed.restart();
56 m_animTimer.start();
57 }
58 }
59
60protected:
61 void paintEvent(QPaintEvent*) override

Callers 1

tickMeterMethod · 0.45

Calls 5

setTargetMethod · 0.80
needsAnimationMethod · 0.80
isActiveMethod · 0.45
stopMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected