cursors: Split cursors into n segments to align with multiple bits

This commit is contained in:
Mike
2016-03-06 00:48:45 +00:00
parent e288f93b29
commit f2b7f918d2
7 changed files with 45 additions and 3 deletions

View File

@@ -73,12 +73,21 @@ SpectrogramControls::SpectrogramControls(const QString & title, QWidget * parent
cursorsCheckBox = new QCheckBox(widget);
layout->addRow(new QLabel(tr("Enable cursors:")), cursorsCheckBox);
cursorBitsSpinBox = new QSpinBox();
layout->addRow(new QLabel(tr("Bits:")), cursorBitsSpinBox);
timeSelectionFreqLabel = new QLabel();
layout->addRow(new QLabel(tr("Frequency:")), timeSelectionFreqLabel);
timeSelectionTimeLabel = new QLabel();
layout->addRow(new QLabel(tr("Time:")), timeSelectionTimeLabel);
bitSelectionFreqLabel = new QLabel();
layout->addRow(new QLabel(tr("Bit frequency:")), bitSelectionFreqLabel);
bitSelectionTimeLabel = new QLabel();
layout->addRow(new QLabel(tr("Bit time:")), bitSelectionTimeLabel);
widget->setLayout(layout);
setWidget(widget);
@@ -94,6 +103,7 @@ void SpectrogramControls::setDefaults()
powerMaxSlider->setValue(0);
powerMinSlider->setValue(-50);
cursorsCheckBox->setCheckState(Qt::Unchecked);
cursorBitsSpinBox->setValue(1);
}
void SpectrogramControls::fftSizeSliderChanged(int size)
@@ -113,4 +123,8 @@ void SpectrogramControls::timeSelectionChanged(float time)
{
timeSelectionTimeLabel->setText(QString::number(time) + "s");
timeSelectionFreqLabel->setText(QString::number(1 / time) + "Hz");
int bits = cursorBitsSpinBox->value();
bitSelectionTimeLabel->setText(QString::number(time / bits) + "s");
bitSelectionFreqLabel->setText(QString::number(bits / time) + "Hz");
}