MCPcopy Create free account
hub / github.com/BatchDrake/SigDigger / onZeroCrossingComponentChanged

Method onZeroCrossingComponentChanged

Components/TimeWindow.cpp:2190–2221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2188}
2189
2190void
2191TimeWindow::onZeroCrossingComponentChanged(void)
2192{
2193 qreal min = -1, max = 1;
2194 int digits;
2195
2196 switch (this->ui->clkComponentCombo->currentIndex()) {
2197 case 0:
2198 min = this->ui->realWaveform->getMin();
2199 max = this->ui->realWaveform->getMax();
2200 break;
2201
2202 case 1:
2203 min = this->ui->imagWaveform->getMin();
2204 max = this->ui->imagWaveform->getMax();
2205 break;
2206
2207 case 2:
2208 min = 0;
2209 max = this->ui->realWaveform->getEnvelope();
2210 break;
2211 }
2212
2213 digits = SCAST(int, floor(log10(max - min)));
2214
2215 this->ui->zeroPointSpin->setDecimals(7 - digits);
2216 this->ui->zeroPointSpin->setSingleStep(5e-3 * (max - min));
2217 this->ui->zeroPointSpin->setMinimum(min);
2218 this->ui->zeroPointSpin->setMaximum(max);
2219
2220 this->onZeroPointChanged();
2221}
2222
2223void
2224TimeWindow::onZeroPointChanged(void)

Callers 1

refreshUiMethod · 0.95

Calls 3

onZeroPointChangedMethod · 0.95
getMinMethod · 0.45
getMaxMethod · 0.45

Tested by

no test coverage detected