Skip to content

Commit

Permalink
Scope: fixed channel rate affecting scope rate in memory mode
Browse files Browse the repository at this point in the history
  • Loading branch information
f4exb committed Oct 15, 2018
1 parent be36430 commit 966d957
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo
*/
QCoreApplication::setOrganizationName("f4exb");
QCoreApplication::setApplicationName("SDRangel");
QCoreApplication::setApplicationVersion("4.2.2");
QCoreApplication::setApplicationVersion("4.2.3");

#if 1
qApp->setStyle(QStyleFactory::create("fusion"));
Expand Down
2 changes: 1 addition & 1 deletion appbench/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo

QCoreApplication::setOrganizationName("f4exb");
QCoreApplication::setApplicationName("SDRangelBench");
QCoreApplication::setApplicationVersion("4.2.2");
QCoreApplication::setApplicationVersion("4.2.3");

int catchSignals[] = {SIGQUIT, SIGINT, SIGTERM, SIGHUP};
std::vector<int> vsig(catchSignals, catchSignals + sizeof(catchSignals) / sizeof(int));
Expand Down
2 changes: 1 addition & 1 deletion appsrv/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo

QCoreApplication::setOrganizationName("f4exb");
QCoreApplication::setApplicationName("SDRangelSrv");
QCoreApplication::setApplicationVersion("4.2.2");
QCoreApplication::setApplicationVersion("4.2.3");

int catchSignals[] = {SIGQUIT, SIGINT, SIGTERM, SIGHUP};
std::vector<int> vsig(catchSignals, catchSignals + sizeof(catchSignals) / sizeof(int));
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
sdrangel (4.2.3-1) unstable; urgency=medium

* Scope: fixed channel rate affecting scope in memory mode. Issue #227

-- Edouard Griffiths, F4EXB <[email protected]> Sun, 21 Oct 2018 21:14:18 +0200

sdrangel (4.2.2-1) unstable; urgency=medium

* Spectrum: option to get max over a number of FFTs. Implements issue #207
Expand Down
2 changes: 1 addition & 1 deletion plugins/channelrx/chanalyzer/chanalyzergui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ void ChannelAnalyzerGUI::setNewFinalRate()
QString s = QString::number(m_rate/1000.0, 'f', 1);
ui->spanText->setText(tr("%1 kS/s").arg(s));

m_scopeVis->setSampleRate(m_rate);
m_scopeVis->setLiveRate(m_rate);
}

void ChannelAnalyzerGUI::setFiltersUIBoundaries()
Expand Down
2 changes: 1 addition & 1 deletion plugins/channelrx/demodatv/atvdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ bool ATVDemodGUI::handleMessage(const Message& objMessage)
int nbPointsPerLine = ((ATVDemod::MsgReportEffectiveSampleRate&)objMessage).getNbPointsPerLine();
ui->channelSampleRateText->setText(tr("%1k").arg(sampleRate/1000.0f, 0, 'f', 2));
ui->nbPointsPerLineText->setText(tr("%1p").arg(nbPointsPerLine));
m_scopeVis->setSampleRate(sampleRate);
m_scopeVis->setLiveRate(sampleRate);
setRFFiltersSlidersRange(sampleRate);
lineTimeUpdate();
topTimeUpdate();
Expand Down
2 changes: 1 addition & 1 deletion plugins/channelrx/demodatv/atvdemodplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
const PluginDescriptor ATVDemodPlugin::m_ptrPluginDescriptor =
{
QString("ATV Demodulator"),
QString("3.14.5"),
QString("4.2.3"),
QString("(c) F4HKW for F4EXB / SDRAngel"),
QString("https://github.com/f4exb/sdrangel"),
true,
Expand Down
22 changes: 20 additions & 2 deletions sdrgui/dsp/scopevis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ ScopeVis::ScopeVis(GLScope* glScope) :
m_timeOfsProMill(0),
m_traceStart(true),
m_sampleRate(0),
m_liveRate(0),
m_memoryRate(0),
m_traceDiscreteMemory(m_nbTraceMemories),
m_freeRun(true),
m_maxTraceDelay(0),
Expand All @@ -74,6 +76,15 @@ ScopeVis::~ScopeVis()
}
}

void ScopeVis::setLiveRate(int sampleRate)
{
m_liveRate = sampleRate;

if (m_currentTraceMemoryIndex == 0) { // update only in live mode
setSampleRate(m_liveRate);
}
}

void ScopeVis::setSampleRate(int sampleRate)
{
m_sampleRate = sampleRate;
Expand Down Expand Up @@ -589,7 +600,7 @@ bool ScopeVis::handleMessage(const Message& message)
if (DSPSignalNotification::match(message))
{
DSPSignalNotification& notif = (DSPSignalNotification&) message;
setSampleRate(notif.getSampleRate());
setLiveRate(notif.getSampleRate());
qDebug() << "ScopeVis::handleMessage: DSPSignalNotification: m_sampleRate: " << m_sampleRate;
return true;
}
Expand Down Expand Up @@ -827,9 +838,16 @@ bool ScopeVis::handleMessage(const Message& message)

if (memoryIndex != m_currentTraceMemoryIndex)
{
// on transition from live rate initialize memory rate to live rate
if (memoryIndex == 0) {
m_memoryRate = m_liveRate;
}

m_currentTraceMemoryIndex = memoryIndex;

if (m_currentTraceMemoryIndex > 0) {
if (m_currentTraceMemoryIndex == 0) { // transition to live mode
setSampleRate(m_liveRate); // reset to live rate
} else {
processMemoryTrace();
}
}
Expand Down
11 changes: 9 additions & 2 deletions sdrgui/dsp/scopevis.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class SDRGUI_API ScopeVis : public BasebandSampleSink {
ScopeVis(GLScope* glScope = 0);
virtual ~ScopeVis();

void setSampleRate(int sampleRate);
void setLiveRate(int sampleRate);
void configure(uint32_t traceSize, uint32_t timeBase, uint32_t timeOfsProMill, uint32_t triggerPre, bool freeRun);
void addTrace(const TraceData& traceData);
void changeTrace(const TraceData& traceData, uint32_t traceIndex);
Expand Down Expand Up @@ -1049,7 +1049,9 @@ class SDRGUI_API ScopeVis : public BasebandSampleSink {
uint32_t m_timeOfsProMill; //!< Start trace shift in 1/1000 trace size
bool m_traceStart; //!< Trace is at start point
SampleVector::const_iterator m_triggerPoint; //!< Trigger start location in the samples vector
int m_sampleRate;
int m_sampleRate; //!< Actual sample rate being used
int m_liveRate; //!< Sample rate in live mode
int m_memoryRate; //!< Sample rate in memory mode
TraceBackDiscreteMemory m_traceDiscreteMemory; //!< Complex trace memory for triggered states TODO: vectorize when more than on input is allowed
bool m_freeRun; //!< True if free running (trigger globally disabled)
int m_maxTraceDelay; //!< Maximum trace delay
Expand Down Expand Up @@ -1109,6 +1111,11 @@ class SDRGUI_API ScopeVis : public BasebandSampleSink {
* - Trace in memory: call process memory trace
*/
void updateGLScopeDisplay();

/**
* Set the actual sample rate
*/
void setSampleRate(int sampleRate);
};


Expand Down

0 comments on commit 966d957

Please sign in to comment.