| 117 | } |
| 118 | |
| 119 | void TxApplet::buildUI() |
| 120 | { |
| 121 | auto* outer = new QVBoxLayout(this); |
| 122 | outer->setContentsMargins(0, 0, 0, 0); |
| 123 | outer->setSpacing(0); |
| 124 | |
| 125 | // Body with margins |
| 126 | auto* body = new QWidget; |
| 127 | auto* vbox = new QVBoxLayout(body); |
| 128 | vbox->setContentsMargins(4, 2, 8, 2); |
| 129 | vbox->setSpacing(2); |
| 130 | |
| 131 | // ── Forward Power gauge (0–120 W, red > 100 W) ───────────────────────── |
| 132 | m_fwdGauge = new HGauge(0.0f, 120.0f, 100.0f, "RF Pwr", "W", |
| 133 | {{0, "0"}, {40, "40"}, {80, "80"}, {100, "100"}, {120, "120"}}, |
| 134 | this, 80.0f); |
| 135 | m_fwdGauge->setAccessibleName("Forward power gauge"); |
| 136 | m_fwdGauge->setAccessibleDescription("RF forward power in watts"); |
| 137 | // Mouse-over readout: exact watts, so the operator isn't left estimating |
| 138 | // between the 40 W tick marks while transmitting. (#3936) |
| 139 | static_cast<HGauge*>(m_fwdGauge)->setHoverValueFormatter([](float v) { |
| 140 | return QStringLiteral("%1 W").arg(QString::number(std::lround(v))); |
| 141 | }); |
| 142 | static_cast<HGauge*>(m_fwdGauge)->setHoverValuePopupEnabled(true); |
| 143 | vbox->addWidget(m_fwdGauge); |
| 144 | |
| 145 | // ── SWR gauge (1.0–3.0, red > 2.5) ───────────────────────────────────── |
| 146 | m_swrGauge = new HGauge(1.0f, 3.0f, 2.5f, "SWR", "", |
| 147 | {{1.0f, "1"}, {1.5f, "1.5"}, {2.5f, "2.5"}, {3.0f, "3"}}, |
| 148 | this, 2.0f); |
| 149 | m_swrGauge->setAccessibleName("SWR gauge"); |
| 150 | m_swrGauge->setAccessibleDescription("Standing wave ratio"); |
| 151 | // Mouse-over readout: exact ratio in the conventional N.N:1 form. |
| 152 | static_cast<HGauge*>(m_swrGauge)->setHoverValueFormatter([](float v) { |
| 153 | return QStringLiteral("%1:1").arg(QString::number(v, 'f', 2)); |
| 154 | }); |
| 155 | static_cast<HGauge*>(m_swrGauge)->setHoverValuePopupEnabled(true); |
| 156 | vbox->addWidget(m_swrGauge); |
| 157 | |
| 158 | // ── RF Power slider ───────────────────────────────────────────────────── |
| 159 | { |
| 160 | auto* row = new QHBoxLayout; |
| 161 | row->setSpacing(4); |
| 162 | auto* label = new QLabel("RF Power:"); |
| 163 | AetherSDR::ThemeManager::instance().applyStyleSheet(label, "QLabel { color: {{color.text.secondary}}; font-size: 10px; }"); |
| 164 | label->setFixedWidth(62); |
| 165 | row->addWidget(label); |
| 166 | |
| 167 | m_rfPowerSlider = new GuardedSlider(Qt::Horizontal); |
| 168 | m_rfPowerSlider->setRange(0, 100); |
| 169 | m_rfPowerSlider->setDragValueFormatter(percentText); |
| 170 | applyPrimarySliderStyle(m_rfPowerSlider); |
| 171 | m_rfPowerSlider->setAccessibleName("RF power"); |
| 172 | m_rfPowerSlider->setAccessibleDescription("Transmit RF power level, 0 to 100 percent of maximum"); |
| 173 | row->addWidget(m_rfPowerSlider, 1); |
| 174 | |
| 175 | m_rfPowerLabel = new QLabel("100"); |
| 176 | AetherSDR::ThemeManager::instance().applyStyleSheet(m_rfPowerLabel, "QLabel { color: {{color.text.primary}}; font-size: 10px; }"); |
nothing calls this directly
no test coverage detected