2018-08-12 15:13:06 +00:00
|
|
|
#include "dsp/spectrumscopecombovis.h"
|
2017-01-29 18:51:45 +00:00
|
|
|
#include "dsp/dspcommands.h"
|
2018-08-12 15:22:39 +00:00
|
|
|
#include "dsp/scopevis.h"
|
2017-01-29 18:51:45 +00:00
|
|
|
#include "util/messagequeue.h"
|
|
|
|
|
2018-08-12 15:18:58 +00:00
|
|
|
SpectrumScopeComboVis::SpectrumScopeComboVis(SpectrumVis* spectrumVis, ScopeVis* scopeVis) :
|
2017-01-29 18:51:45 +00:00
|
|
|
m_spectrumVis(spectrumVis),
|
|
|
|
m_scopeVis(scopeVis)
|
|
|
|
{
|
2018-08-12 15:10:31 +00:00
|
|
|
setObjectName("SpectrumScopeComboVis");
|
2017-01-29 18:51:45 +00:00
|
|
|
}
|
|
|
|
|
2018-08-12 15:10:31 +00:00
|
|
|
SpectrumScopeComboVis::~SpectrumScopeComboVis()
|
2017-01-29 18:51:45 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-11-12 17:36:27 +00:00
|
|
|
void SpectrumScopeComboVis::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly)
|
2017-01-29 18:51:45 +00:00
|
|
|
{
|
2018-11-12 17:36:27 +00:00
|
|
|
(void) positiveOnly;
|
2017-01-29 18:51:45 +00:00
|
|
|
m_scopeVis->feed(begin, end, false);
|
2018-11-21 07:58:33 +00:00
|
|
|
//SampleVector::const_iterator triggerPoint = m_scopeVis->getTriggerPoint();
|
|
|
|
//m_spectrumVis->feedTriggered(triggerPoint, end, positiveOnly);
|
2020-07-12 23:17:36 +00:00
|
|
|
int triggerPointLocation = m_scopeVis->getTriggerLocation();
|
|
|
|
|
|
|
|
if (m_scopeVis->getFreeRun()) {
|
|
|
|
m_spectrumVis->feed(begin, end, positiveOnly);
|
|
|
|
} else if ((triggerPointLocation >= 0) && (triggerPointLocation <= end - begin)) {
|
|
|
|
m_spectrumVis->feedTriggered(end - triggerPointLocation, end, positiveOnly);
|
|
|
|
} else {
|
|
|
|
m_spectrumVis->feedTriggered(begin, end, positiveOnly);
|
|
|
|
}
|
2017-01-29 18:51:45 +00:00
|
|
|
}
|
|
|
|
|
2018-08-12 15:10:31 +00:00
|
|
|
void SpectrumScopeComboVis::start()
|
2017-01-29 18:51:45 +00:00
|
|
|
{
|
|
|
|
m_spectrumVis->start();
|
|
|
|
m_scopeVis->start();
|
|
|
|
}
|
|
|
|
|
2018-08-12 15:10:31 +00:00
|
|
|
void SpectrumScopeComboVis::stop()
|
2017-01-29 18:51:45 +00:00
|
|
|
{
|
|
|
|
m_spectrumVis->stop();
|
|
|
|
m_scopeVis->stop();
|
|
|
|
}
|
|
|
|
|
2018-08-12 15:10:31 +00:00
|
|
|
bool SpectrumScopeComboVis::handleMessage(const Message& message)
|
2017-01-29 18:51:45 +00:00
|
|
|
{
|
|
|
|
bool spectDone = m_spectrumVis->handleMessage(message);
|
|
|
|
bool scopeDone = m_scopeVis->handleMessage(message);
|
|
|
|
|
|
|
|
return (spectDone || scopeDone);
|
|
|
|
}
|