mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-23 10:05:46 -05:00
UDPSink plugin: implemented reset read index button
This commit is contained in:
parent
130759fba7
commit
83026bea59
@ -23,6 +23,7 @@
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(UDPSink::MsgUDPSinkConfigure, Message)
|
||||
MESSAGE_CLASS_DEFINITION(UDPSink::MsgUDPSinkSpectrum, Message)
|
||||
MESSAGE_CLASS_DEFINITION(UDPSink::MsgResetReadIndex, Message)
|
||||
|
||||
UDPSink::UDPSink(MessageQueue* uiMessageQueue, UDPSinkGUI* udpSinkGUI, BasebandSampleSink* spectrum) :
|
||||
m_uiMessageQueue(uiMessageQueue),
|
||||
@ -343,6 +344,16 @@ bool UDPSink::handleMessage(const Message& cmd)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (MsgResetReadIndex::match(cmd))
|
||||
{
|
||||
m_settingsMutex.lock();
|
||||
m_udpHandler.resetReadIndex();
|
||||
m_settingsMutex.unlock();
|
||||
|
||||
qDebug() << "UDPSink::handleMessage: MsgResetReadIndex";
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_spectrum != 0)
|
||||
@ -389,6 +400,12 @@ void UDPSink::setSpectrum(MessageQueue* messageQueue, bool enabled)
|
||||
messageQueue->push(cmd);
|
||||
}
|
||||
|
||||
void UDPSink::resetReadIndex(MessageQueue* messageQueue)
|
||||
{
|
||||
Message* cmd = MsgResetReadIndex::create();
|
||||
messageQueue->push(cmd);
|
||||
}
|
||||
|
||||
|
||||
void UDPSink::apply(bool force)
|
||||
{
|
||||
|
@ -72,6 +72,7 @@ public:
|
||||
bool squelchEnabled,
|
||||
bool force = false);
|
||||
void setSpectrum(MessageQueue* messageQueue, bool enabled);
|
||||
void resetReadIndex(MessageQueue* messageQueue);
|
||||
|
||||
signals:
|
||||
/**
|
||||
@ -184,6 +185,23 @@ private:
|
||||
{ }
|
||||
};
|
||||
|
||||
class MsgResetReadIndex : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
|
||||
static MsgResetReadIndex* create()
|
||||
{
|
||||
return new MsgResetReadIndex();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
MsgResetReadIndex() :
|
||||
Message()
|
||||
{ }
|
||||
};
|
||||
|
||||
struct Config {
|
||||
int m_basebandSampleRate;
|
||||
Real m_outputSampleRate;
|
||||
|
@ -488,6 +488,11 @@ void UDPSinkGUI::on_applyBtn_clicked()
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void UDPSinkGUI::on_resetUDPReadIndex_clicked()
|
||||
{
|
||||
m_udpSink->resetReadIndex(m_udpSink->getInputMessageQueue());
|
||||
}
|
||||
|
||||
void UDPSinkGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
{
|
||||
if ((widget == ui->spectrumBox) && (m_udpSink != 0))
|
||||
|
@ -70,6 +70,7 @@ private slots:
|
||||
void on_gain_valueChanged(int value);
|
||||
void on_squelch_valueChanged(int value);
|
||||
void on_channelMute_toggled(bool checked);
|
||||
void on_resetUDPReadIndex_clicked();
|
||||
void tick();
|
||||
|
||||
private:
|
||||
|
@ -544,7 +544,7 @@
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>14</height>
|
||||
<height>12</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
@ -585,7 +585,7 @@
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>14</height>
|
||||
<height>12</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
@ -625,6 +625,25 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="resetUDPReadIndex">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>22</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>R</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
|
Loading…
Reference in New Issue
Block a user