mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-02 06:04:39 -04:00
MIMO: add channel to TestMI (1)
This commit is contained in:
@@ -52,6 +52,7 @@ TestMIGui::TestMIGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
{
|
||||
qDebug("TestMIGui::TestMIGui");
|
||||
m_sampleMIMO = m_deviceUISet->m_deviceAPI->getSampleMIMO();
|
||||
m_streamIndex = 0;
|
||||
|
||||
ui->setupUi(this);
|
||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
@@ -104,12 +105,12 @@ void TestMIGui::resetToDefaults()
|
||||
|
||||
qint64 TestMIGui::getCenterFrequency() const
|
||||
{
|
||||
return m_settings.m_centerFrequency;
|
||||
return m_settings.m_streams[m_streamIndex].m_centerFrequency;
|
||||
}
|
||||
|
||||
void TestMIGui::setCenterFrequency(qint64 centerFrequency)
|
||||
{
|
||||
m_settings.m_centerFrequency = centerFrequency;
|
||||
m_settings.m_streams[m_streamIndex].m_centerFrequency = centerFrequency;
|
||||
displaySettings();
|
||||
sendSettings();
|
||||
}
|
||||
@@ -141,25 +142,31 @@ void TestMIGui::on_startStop_toggled(bool checked)
|
||||
}
|
||||
}
|
||||
|
||||
void TestMIGui::on_streamIndex_currentIndexChanged(int index)
|
||||
{
|
||||
m_streamIndex = index;
|
||||
displaySettings();
|
||||
}
|
||||
|
||||
void TestMIGui::on_centerFrequency_changed(quint64 value)
|
||||
{
|
||||
m_settings.m_centerFrequency = value * 1000;
|
||||
m_settings.m_streams[m_streamIndex].m_centerFrequency = value * 1000;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void TestMIGui::on_autoCorr_currentIndexChanged(int index)
|
||||
{
|
||||
if ((index < 0) || (index > TestMISettings::AutoCorrLast)) {
|
||||
if ((index < 0) || (index > TestMIStreamSettings::AutoCorrLast)) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_settings.m_autoCorrOptions = (TestMISettings::AutoCorrOptions) index;
|
||||
m_settings.m_streams[m_streamIndex].m_autoCorrOptions = (TestMIStreamSettings::AutoCorrOptions) index;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void TestMIGui::on_frequencyShift_changed(qint64 value)
|
||||
{
|
||||
m_settings.m_frequencyShift = value;
|
||||
m_settings.m_streams[m_streamIndex].m_frequencyShift = value;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
@@ -169,7 +176,7 @@ void TestMIGui::on_decimation_currentIndexChanged(int index)
|
||||
return;
|
||||
}
|
||||
|
||||
m_settings.m_log2Decim = index;
|
||||
m_settings.m_streams[m_streamIndex].m_log2Decim = index;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
@@ -179,15 +186,15 @@ void TestMIGui::on_fcPos_currentIndexChanged(int index)
|
||||
return;
|
||||
}
|
||||
|
||||
m_settings.m_fcPos = (TestMISettings::fcPos_t) index;
|
||||
m_settings.m_streams[m_streamIndex].m_fcPos = (TestMIStreamSettings::fcPos_t) index;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void TestMIGui::on_sampleRate_changed(quint64 value)
|
||||
{
|
||||
updateFrequencyShiftLimit();
|
||||
m_settings.m_frequencyShift = ui->frequencyShift->getValueNew();
|
||||
m_settings.m_sampleRate = value;
|
||||
m_settings.m_streams[m_streamIndex].m_frequencyShift = ui->frequencyShift->getValueNew();
|
||||
m_settings.m_streams[m_streamIndex].m_sampleRate = value;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
@@ -200,8 +207,8 @@ void TestMIGui::on_sampleSize_currentIndexChanged(int index)
|
||||
updateAmpCoarseLimit();
|
||||
updateAmpFineLimit();
|
||||
displayAmplitude();
|
||||
m_settings.m_amplitudeBits = ui->amplitudeCoarse->value() * 100 + ui->amplitudeFine->value();
|
||||
m_settings.m_sampleSizeIndex = index;
|
||||
m_settings.m_streams[m_streamIndex].m_amplitudeBits = ui->amplitudeCoarse->value() * 100 + ui->amplitudeFine->value();
|
||||
m_settings.m_streams[m_streamIndex].m_sampleSizeIndex = index;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
@@ -210,7 +217,7 @@ void TestMIGui::on_amplitudeCoarse_valueChanged(int value)
|
||||
(void) value;
|
||||
updateAmpFineLimit();
|
||||
displayAmplitude();
|
||||
m_settings.m_amplitudeBits = ui->amplitudeCoarse->value() * 100 + ui->amplitudeFine->value();
|
||||
m_settings.m_streams[m_streamIndex].m_amplitudeBits = ui->amplitudeCoarse->value() * 100 + ui->amplitudeFine->value();
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
@@ -218,66 +225,66 @@ void TestMIGui::on_amplitudeFine_valueChanged(int value)
|
||||
{
|
||||
(void) value;
|
||||
displayAmplitude();
|
||||
m_settings.m_amplitudeBits = ui->amplitudeCoarse->value() * 100 + ui->amplitudeFine->value();
|
||||
m_settings.m_streams[m_streamIndex].m_amplitudeBits = ui->amplitudeCoarse->value() * 100 + ui->amplitudeFine->value();
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void TestMIGui::on_modulation_currentIndexChanged(int index)
|
||||
{
|
||||
if ((index < 0) || (index > TestMISettings::ModulationLast)) {
|
||||
if ((index < 0) || (index > TestMIStreamSettings::ModulationLast)) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_settings.m_modulation = (TestMISettings::Modulation) index;
|
||||
m_settings.m_streams[m_streamIndex].m_modulation = (TestMIStreamSettings::Modulation) index;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void TestMIGui::on_modulationFrequency_valueChanged(int value)
|
||||
{
|
||||
m_settings.m_modulationTone = value;
|
||||
ui->modulationFrequencyText->setText(QString("%1").arg(m_settings.m_modulationTone / 100.0, 0, 'f', 2));
|
||||
m_settings.m_streams[m_streamIndex].m_modulationTone = value;
|
||||
ui->modulationFrequencyText->setText(QString("%1").arg(m_settings.m_streams[m_streamIndex].m_modulationTone / 100.0, 0, 'f', 2));
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void TestMIGui::on_amModulation_valueChanged(int value)
|
||||
{
|
||||
m_settings.m_amModulation = value;
|
||||
ui->amModulationText->setText(QString("%1").arg(m_settings.m_amModulation));
|
||||
m_settings.m_streams[m_streamIndex].m_amModulation = value;
|
||||
ui->amModulationText->setText(QString("%1").arg(m_settings.m_streams[m_streamIndex].m_amModulation));
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void TestMIGui::on_fmDeviation_valueChanged(int value)
|
||||
{
|
||||
m_settings.m_fmDeviation = value;
|
||||
ui->fmDeviationText->setText(QString("%1").arg(m_settings.m_fmDeviation / 10.0, 0, 'f', 1));
|
||||
m_settings.m_streams[m_streamIndex].m_fmDeviation = value;
|
||||
ui->fmDeviationText->setText(QString("%1").arg(m_settings.m_streams[m_streamIndex].m_fmDeviation / 10.0, 0, 'f', 1));
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void TestMIGui::on_dcBias_valueChanged(int value)
|
||||
{
|
||||
ui->dcBiasText->setText(QString(tr("%1 %").arg(value)));
|
||||
m_settings.m_dcFactor = value / 100.0f;
|
||||
m_settings.m_streams[m_streamIndex].m_dcFactor = value / 100.0f;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void TestMIGui::on_iBias_valueChanged(int value)
|
||||
{
|
||||
ui->iBiasText->setText(QString(tr("%1 %").arg(value)));
|
||||
m_settings.m_iFactor = value / 100.0f;
|
||||
m_settings.m_streams[m_streamIndex].m_iFactor = value / 100.0f;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void TestMIGui::on_qBias_valueChanged(int value)
|
||||
{
|
||||
ui->qBiasText->setText(QString(tr("%1 %").arg(value)));
|
||||
m_settings.m_qFactor = value / 100.0f;
|
||||
m_settings.m_streams[m_streamIndex].m_qFactor = value / 100.0f;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void TestMIGui::on_phaseImbalance_valueChanged(int value)
|
||||
{
|
||||
ui->phaseImbalanceText->setText(QString(tr("%1 %").arg(value)));
|
||||
m_settings.m_phaseImbalance = value / 100.0f;
|
||||
m_settings.m_streams[m_streamIndex].m_phaseImbalance = value / 100.0f;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
@@ -374,40 +381,41 @@ void TestMIGui::displaySettings()
|
||||
blockApplySettings(true);
|
||||
ui->sampleSize->blockSignals(true);
|
||||
|
||||
ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000);
|
||||
ui->decimation->setCurrentIndex(m_settings.m_log2Decim);
|
||||
ui->fcPos->setCurrentIndex((int) m_settings.m_fcPos);
|
||||
ui->sampleRate->setValue(m_settings.m_sampleRate);
|
||||
ui->streamIndex->setCurrentIndex(m_streamIndex);
|
||||
ui->centerFrequency->setValue(m_settings.m_streams[m_streamIndex].m_centerFrequency / 1000);
|
||||
ui->decimation->setCurrentIndex(m_settings.m_streams[m_streamIndex].m_log2Decim);
|
||||
ui->fcPos->setCurrentIndex((int) m_settings.m_streams[m_streamIndex].m_fcPos);
|
||||
ui->sampleRate->setValue(m_settings.m_streams[m_streamIndex].m_sampleRate);
|
||||
updateFrequencyShiftLimit();
|
||||
ui->frequencyShift->setValue(m_settings.m_frequencyShift);
|
||||
ui->sampleSize->setCurrentIndex(m_settings.m_sampleSizeIndex);
|
||||
ui->frequencyShift->setValue(m_settings.m_streams[m_streamIndex].m_frequencyShift);
|
||||
ui->sampleSize->setCurrentIndex(m_settings.m_streams[m_streamIndex].m_sampleSizeIndex);
|
||||
updateAmpCoarseLimit();
|
||||
int amplitudeBits = m_settings.m_amplitudeBits;
|
||||
int amplitudeBits = m_settings.m_streams[m_streamIndex].m_amplitudeBits;
|
||||
ui->amplitudeCoarse->setValue(amplitudeBits/100);
|
||||
updateAmpFineLimit();
|
||||
ui->amplitudeFine->setValue(amplitudeBits%100);
|
||||
displayAmplitude();
|
||||
int dcBiasPercent = roundf(m_settings.m_dcFactor * 100.0f);
|
||||
int dcBiasPercent = roundf(m_settings.m_streams[m_streamIndex].m_dcFactor * 100.0f);
|
||||
ui->dcBias->setValue((int) dcBiasPercent);
|
||||
ui->dcBiasText->setText(QString(tr("%1 %").arg(dcBiasPercent)));
|
||||
int iBiasPercent = roundf(m_settings.m_iFactor * 100.0f);
|
||||
int iBiasPercent = roundf(m_settings.m_streams[m_streamIndex].m_iFactor * 100.0f);
|
||||
ui->iBias->setValue((int) iBiasPercent);
|
||||
ui->iBiasText->setText(QString(tr("%1 %").arg(iBiasPercent)));
|
||||
int qBiasPercent = roundf(m_settings.m_qFactor * 100.0f);
|
||||
int qBiasPercent = roundf(m_settings.m_streams[m_streamIndex].m_qFactor * 100.0f);
|
||||
ui->qBias->setValue((int) qBiasPercent);
|
||||
ui->qBiasText->setText(QString(tr("%1 %").arg(qBiasPercent)));
|
||||
int phaseImbalancePercent = roundf(m_settings.m_phaseImbalance * 100.0f);
|
||||
int phaseImbalancePercent = roundf(m_settings.m_streams[m_streamIndex].m_phaseImbalance * 100.0f);
|
||||
ui->phaseImbalance->setValue((int) phaseImbalancePercent);
|
||||
ui->phaseImbalanceText->setText(QString(tr("%1 %").arg(phaseImbalancePercent)));
|
||||
ui->autoCorr->setCurrentIndex(m_settings.m_autoCorrOptions);
|
||||
ui->autoCorr->setCurrentIndex(m_settings.m_streams[m_streamIndex].m_autoCorrOptions);
|
||||
ui->sampleSize->blockSignals(false);
|
||||
ui->modulation->setCurrentIndex((int) m_settings.m_modulation);
|
||||
ui->modulationFrequency->setValue(m_settings.m_modulationTone);
|
||||
ui->modulationFrequencyText->setText(QString("%1").arg(m_settings.m_modulationTone / 100.0, 0, 'f', 2));
|
||||
ui->amModulation->setValue(m_settings.m_amModulation);
|
||||
ui->amModulationText->setText(QString("%1").arg(m_settings.m_amModulation));
|
||||
ui->fmDeviation->setValue(m_settings.m_fmDeviation);
|
||||
ui->fmDeviationText->setText(QString("%1").arg(m_settings.m_fmDeviation / 10.0, 0, 'f', 1));
|
||||
ui->modulation->setCurrentIndex((int) m_settings.m_streams[m_streamIndex].m_modulation);
|
||||
ui->modulationFrequency->setValue(m_settings.m_streams[m_streamIndex].m_modulationTone);
|
||||
ui->modulationFrequencyText->setText(QString("%1").arg(m_settings.m_streams[m_streamIndex].m_modulationTone / 100.0, 0, 'f', 2));
|
||||
ui->amModulation->setValue(m_settings.m_streams[m_streamIndex].m_amModulation);
|
||||
ui->amModulationText->setText(QString("%1").arg(m_settings.m_streams[m_streamIndex].m_amModulation));
|
||||
ui->fmDeviation->setValue(m_settings.m_streams[m_streamIndex].m_fmDeviation);
|
||||
ui->fmDeviationText->setText(QString("%1").arg(m_settings.m_streams[m_streamIndex].m_fmDeviation / 10.0, 0, 'f', 1));
|
||||
blockApplySettings(false);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user