1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 17:28:50 -05:00

Housekeeping.

This commit is contained in:
John Greb 2015-01-12 14:25:16 +00:00
parent 429b4dbbff
commit dde49f8650
3 changed files with 60 additions and 13 deletions

View File

@ -32,6 +32,7 @@ void LoRaDemodGUI::setName(const QString& name)
void LoRaDemodGUI::resetToDefaults()
{
ui->BW->setValue(0);
ui->Spread->setValue(0);
applySettings();
}
@ -40,8 +41,8 @@ QByteArray LoRaDemodGUI::serialize() const
SimpleSerializer s(1);
s.writeS32(1, m_channelMarker->getCenterFrequency());
s.writeS32(2, ui->BW->value());
s.writeBlob(3, ui->spectrumGUI->serialize());
s.writeU32(4, m_channelMarker->getColor().rgb());
s.writeS32(3, ui->Spread->value());
s.writeBlob(4, ui->spectrumGUI->serialize());
return s.final();
}
@ -56,16 +57,15 @@ bool LoRaDemodGUI::deserialize(const QByteArray& data)
if(d.getVersion() == 1) {
QByteArray bytetmp;
quint32 u32tmp;
qint32 tmp;
d.readS32(1, &tmp, 0);
m_channelMarker->setCenterFrequency(tmp);
d.readS32(2, &tmp, 0);
ui->BW->setValue(tmp);
d.readBlob(3, &bytetmp);
d.readS32(3, &tmp, 0);
ui->Spread->setValue(tmp);
d.readBlob(4, &bytetmp);
ui->spectrumGUI->deserialize(bytetmp);
if(d.readU32(4, &u32tmp))
m_channelMarker->setColor(u32tmp);
applySettings();
return true;
} else {
@ -86,12 +86,17 @@ void LoRaDemodGUI::viewChanged()
void LoRaDemodGUI::on_BW_valueChanged(int value)
{
value = 7813;
ui->BWText->setText(QString("%1 Hz").arg(value));
m_channelMarker->setBandwidth(value);
const int loraBW[] = {7813, 15625, 10417, 20833};
int thisBW = loraBW[value];
ui->BWText->setText(QString("%1 Hz").arg(thisBW));
m_channelMarker->setBandwidth(thisBW);
applySettings();
}
void LoRaDemodGUI::on_Spread_valueChanged(int value)
{
}
void LoRaDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
{
/*
@ -126,8 +131,8 @@ LoRaDemodGUI::LoRaDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
m_threadedSampleSink = new ThreadedSampleSink(m_channelizer);
m_pluginAPI->addSampleSink(m_threadedSampleSink);
ui->glSpectrum->setCenterFrequency(0);
ui->glSpectrum->setSampleRate(7813);
ui->glSpectrum->setCenterFrequency(16000);
ui->glSpectrum->setSampleRate(32000);
ui->glSpectrum->setDisplayWaterfall(true);
ui->glSpectrum->setDisplayMaxHold(true);
@ -158,9 +163,8 @@ LoRaDemodGUI::~LoRaDemodGUI()
void LoRaDemodGUI::applySettings()
{
const int loraBW[] = {7813, 7813, 10417, 20833 };
const int loraBW[] = {7813, 15625, 10417, 20833};
int thisBW = loraBW[ui->BW->value()];
setTitleColor(m_channelMarker->getColor());
m_channelizer->configure(m_threadedSampleSink->getMessageQueue(),
thisBW,
m_channelMarker->getCenterFrequency());

View File

@ -33,6 +33,7 @@ public:
private slots:
void viewChanged();
void on_BW_valueChanged(int value);
void on_Spread_valueChanged(int value);
void onWidgetRolled(QWidget* widget, bool rollDown);
void onMenuDoubleClicked();

View File

@ -39,6 +39,13 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Spreading</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSlider" name="BW">
<property name="minimum">
@ -58,6 +65,25 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSlider" name="Spread">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>1</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="BWText">
<property name="minimumSize">
@ -74,6 +100,22 @@
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="SpreadText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>2^8</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="spectrumContainer" native="true">