mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-22 09:31:10 -05:00
Tweak UI.
This commit is contained in:
parent
f3e5881be2
commit
3824642bff
@ -143,7 +143,7 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
ui->glSpectrum->setDisplayMaxHold(true);
|
||||
|
||||
m_channelMarker = new ChannelMarker(this);
|
||||
m_channelMarker->setColor(Qt::red);
|
||||
m_channelMarker->setColor(Qt::green);
|
||||
m_channelMarker->setBandwidth(8000);
|
||||
m_channelMarker->setCenterFrequency(0);
|
||||
m_channelMarker->setVisible(true);
|
||||
|
@ -32,7 +32,6 @@ USBDemod::USBDemod(AudioFifo* audioFifo, SampleSink* sampleSink) :
|
||||
m_volume = 2.0;
|
||||
m_sampleRate = 96000;
|
||||
m_frequency = 0;
|
||||
m_sampleDistanceRemain = (Real)m_sampleRate / 48000.0;
|
||||
|
||||
m_audioBuffer.resize(512);
|
||||
m_audioBufferFill = 0;
|
||||
@ -67,7 +66,7 @@ void USBDemod::feed(SampleVector::const_iterator begin, SampleVector::const_iter
|
||||
it++; // TODO: Assumes 96kHz; Expect breakage.
|
||||
a += it->real();
|
||||
b += it->imag();
|
||||
c = Complex(a / 32678.0, b / 32768.0);
|
||||
c = Complex(a / 65536.0, b / 65536.0);
|
||||
|
||||
n_out = USBFilter->run(c, &sideband);
|
||||
for (int i = 0; i < n_out; i++) {
|
||||
@ -85,7 +84,6 @@ void USBDemod::feed(SampleVector::const_iterator begin, SampleVector::const_iter
|
||||
uint res = m_audioFifo->write((const quint8*)&m_audioBuffer[0], m_audioBufferFill, 1);
|
||||
m_audioBufferFill = 0;
|
||||
}
|
||||
m_sampleDistanceRemain += 2; // 96k in / 48k out
|
||||
}
|
||||
}
|
||||
if(m_audioFifo->write((const quint8*)&m_audioBuffer[0], m_audioBufferFill, 0) != m_audioBufferFill)
|
||||
@ -110,7 +108,6 @@ bool USBDemod::handleMessage(Message* cmd)
|
||||
if(DSPSignalNotification::match(cmd)) {
|
||||
DSPSignalNotification* signal = (DSPSignalNotification*)cmd;
|
||||
m_sampleRate = signal->getSampleRate();
|
||||
m_sampleDistanceRemain = 0.0;
|
||||
cmd->completed();
|
||||
return true;
|
||||
} else if(MsgConfigureUSBDemod::match(cmd)) {
|
||||
|
@ -79,11 +79,6 @@ private:
|
||||
int m_sampleRate;
|
||||
int m_frequency;
|
||||
|
||||
NCO m_nco;
|
||||
Interpolator m_interpolator;
|
||||
Real m_sampleDistanceRemain;
|
||||
Lowpass<Real> m_lowpass;
|
||||
|
||||
AudioVector m_audioBuffer;
|
||||
uint m_audioBufferFill;
|
||||
AudioFifo* m_audioFifo;
|
||||
|
@ -89,7 +89,8 @@ void USBDemodGUI::viewChanged()
|
||||
void USBDemodGUI::on_BW_valueChanged(int value)
|
||||
{
|
||||
ui->BWText->setText(QString("%1 kHz").arg(value));
|
||||
m_channelMarker->setBandwidth(value * 1000 * 2);
|
||||
m_channelMarker->setBandwidth(value * 1000);
|
||||
m_channelMarker->setCenterFrequency(value * 500);
|
||||
applySettings();
|
||||
}
|
||||
|
||||
@ -142,9 +143,9 @@ USBDemodGUI::USBDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
|
||||
m_channelMarker = new ChannelMarker(this);
|
||||
m_channelMarker->setColor(Qt::blue);
|
||||
m_channelMarker->setBandwidth(8000);
|
||||
m_channelMarker->setCenterFrequency(0);
|
||||
m_channelMarker->setVisible(true);
|
||||
m_channelMarker->setBandwidth(5000);
|
||||
m_channelMarker->setCenterFrequency(2500);
|
||||
m_channelMarker->setVisible(false);
|
||||
connect(m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged()));
|
||||
m_pluginAPI->addChannelMarker(m_channelMarker);
|
||||
|
||||
|
@ -130,7 +130,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Decimation</string>
|
||||
<string>Zoom Out</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -182,7 +182,7 @@ const QString& RTLSDRInput::getDeviceDescription() const
|
||||
|
||||
int RTLSDRInput::getSampleRate() const
|
||||
{
|
||||
return 1536000 / (1 << m_settings.m_decimation);
|
||||
return 96000 * (1 << m_settings.m_decimation);
|
||||
}
|
||||
|
||||
quint64 RTLSDRInput::getCenterFrequency() const
|
||||
|
@ -140,12 +140,12 @@ void RTLSDRThread::callback(const quint8* buf, qint32 len)
|
||||
{
|
||||
qint16 xreal, yimag, phase;
|
||||
SampleVector::iterator it = m_convertBuffer.begin();
|
||||
int decimationFactor[] = {16, 8, 4, 2, 1, 0};
|
||||
int decimationFactor[] = {1, 2, 4, 8, 16, 0};
|
||||
|
||||
if (++m_localdecimation < decimationFactor[m_decimation]) return;
|
||||
m_localdecimation = 0;
|
||||
|
||||
switch(m_decimation) {
|
||||
switch(4 - m_decimation) {
|
||||
case 0: // 1:1 = no decimation
|
||||
// just rotation
|
||||
phase = -1;
|
||||
@ -171,6 +171,7 @@ void RTLSDRThread::callback(const quint8* buf, qint32 len)
|
||||
decimate8(&it, buf, len);
|
||||
break;
|
||||
|
||||
default:
|
||||
case 4: // 1:16
|
||||
decimate16(&it, buf, len);
|
||||
break;
|
||||
|
@ -17,12 +17,12 @@ GLSpectrumGUI::GLSpectrumGUI(QWidget* parent) :
|
||||
m_refLevel(0),
|
||||
m_powerRange(100),
|
||||
m_decay(0),
|
||||
m_displayWaterfall(false),
|
||||
m_displayWaterfall(true),
|
||||
m_invertedWaterfall(false),
|
||||
m_displayMaxHold(true),
|
||||
m_displayHistogram(true),
|
||||
m_displayGrid(true),
|
||||
m_invert(false)
|
||||
m_displayMaxHold(false),
|
||||
m_displayHistogram(false),
|
||||
m_displayGrid(false),
|
||||
m_invert(true)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
for(int ref = 0; ref >= -95; ref -= 5)
|
||||
@ -52,12 +52,12 @@ void GLSpectrumGUI::resetToDefaults()
|
||||
m_refLevel = 0;
|
||||
m_powerRange = 100;
|
||||
m_decay = 0;
|
||||
m_displayWaterfall = false;
|
||||
m_displayWaterfall = true;
|
||||
m_invertedWaterfall = false;
|
||||
m_displayMaxHold = true;
|
||||
m_displayHistogram = true;
|
||||
m_displayGrid = true;
|
||||
m_invert = false;
|
||||
m_displayMaxHold = false;
|
||||
m_displayHistogram = false;
|
||||
m_displayGrid = false;
|
||||
m_invert = true;
|
||||
applySettings();
|
||||
}
|
||||
|
||||
@ -97,10 +97,10 @@ bool GLSpectrumGUI::deserialize(const QByteArray& data)
|
||||
d.readBool(6, &m_displayWaterfall, true);
|
||||
d.readBool(7, &m_invertedWaterfall, false);
|
||||
d.readBool(8, &m_displayMaxHold, false);
|
||||
d.readBool(9, &m_displayHistogram, true);
|
||||
d.readBool(9, &m_displayHistogram, false);
|
||||
d.readS32(10, &m_decay, 0);
|
||||
d.readBool(11, &m_displayGrid, true);
|
||||
d.readBool(12, &m_invert, false);
|
||||
d.readBool(11, &m_displayGrid, false);
|
||||
d.readBool(12, &m_invert, true);
|
||||
applySettings();
|
||||
return true;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user