mirror of https://github.com/f4exb/sdrangel.git
GLSpectrum: synchronize spectrum running with the GUI spectrum freeze button. Fixes issue #561
This commit is contained in:
parent
f455d0b984
commit
252156ccbf
|
@ -626,12 +626,24 @@ void SpectrumVis::feed(const SampleVector::const_iterator& cbegin, const SampleV
|
||||||
|
|
||||||
void SpectrumVis::start()
|
void SpectrumVis::start()
|
||||||
{
|
{
|
||||||
m_running = true;
|
setRunning(true);
|
||||||
|
|
||||||
|
if (getMessageQueueToGUI()) // propagate to GUI if any
|
||||||
|
{
|
||||||
|
MsgStartStop *msg = MsgStartStop::create(true);
|
||||||
|
getMessageQueueToGUI()->push(msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpectrumVis::stop()
|
void SpectrumVis::stop()
|
||||||
{
|
{
|
||||||
m_running = false;
|
setRunning(false);
|
||||||
|
|
||||||
|
if (getMessageQueueToGUI()) // propagate to GUI if any
|
||||||
|
{
|
||||||
|
MsgStartStop *msg = MsgStartStop::create(false);
|
||||||
|
getMessageQueueToGUI()->push(msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SpectrumVis::handleMessage(const Message& message)
|
bool SpectrumVis::handleMessage(const Message& message)
|
||||||
|
@ -670,14 +682,10 @@ bool SpectrumVis::handleMessage(const Message& message)
|
||||||
handleConfigureWSSpectrum(conf.getAddress(), conf.getPort());
|
handleConfigureWSSpectrum(conf.getAddress(), conf.getPort());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (MsgStartStop::match(message)) {
|
else if (MsgStartStop::match(message))
|
||||||
|
{
|
||||||
MsgStartStop& cmd = (MsgStartStop&) message;
|
MsgStartStop& cmd = (MsgStartStop&) message;
|
||||||
|
setRunning(cmd.getStartStop());
|
||||||
if (cmd.getStartStop()) {
|
|
||||||
start();
|
|
||||||
} else {
|
|
||||||
stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -199,6 +199,7 @@ private:
|
||||||
|
|
||||||
QMutex m_mutex;
|
QMutex m_mutex;
|
||||||
|
|
||||||
|
void setRunning(bool running) { m_running = running; }
|
||||||
void applySettings(const GLSpectrumSettings& settings, bool force = false);
|
void applySettings(const GLSpectrumSettings& settings, bool force = false);
|
||||||
void handleConfigureDSP(uint64_t centerFrequency, int sampleRate);
|
void handleConfigureDSP(uint64_t centerFrequency, int sampleRate);
|
||||||
void handleScalef(Real scalef);
|
void handleScalef(Real scalef);
|
||||||
|
|
|
@ -492,6 +492,14 @@ bool GLSpectrumGUI::handleMessage(const Message& message)
|
||||||
setAveragingToolitp();
|
setAveragingToolitp();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if (SpectrumVis::MsgStartStop::match(message))
|
||||||
|
{
|
||||||
|
const SpectrumVis::MsgStartStop& msg = (SpectrumVis::MsgStartStop&) message;
|
||||||
|
ui->freeze->blockSignals(true);
|
||||||
|
ui->freeze->doToggle(!msg.getStartStop()); // this is a freeze so stop is true
|
||||||
|
ui->freeze->blockSignals(false);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue