mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-09-27 15:26:33 -04:00
Mew scope: trace memory interim state (2)
This commit is contained in:
parent
4dc4ab493b
commit
f86d11e2d1
@ -55,7 +55,8 @@ ScopeVisNG::ScopeVisNG(GLScopeNG* glScope) :
|
||||
m_freeRun(true),
|
||||
m_maxTraceDelay(0),
|
||||
m_triggerOneShot(false),
|
||||
m_triggerWaitForReset(false)
|
||||
m_triggerWaitForReset(false),
|
||||
m_currentTraceMemoryIndex(0)
|
||||
{
|
||||
setObjectName("ScopeVisNG");
|
||||
m_traceDiscreteMemory.resize(m_traceChunkSize); // arbitrary
|
||||
@ -163,14 +164,14 @@ void ScopeVisNG::feed(const SampleVector::const_iterator& cbegin, const SampleVe
|
||||
else if (m_triggerState == TriggerUntriggered) {
|
||||
m_triggerPoint = end;
|
||||
}
|
||||
else if (m_triggerWaitForReset) {
|
||||
else if ((m_triggerWaitForReset) || (m_currentTraceMemoryIndex > 0)) {
|
||||
m_triggerPoint = end;
|
||||
}
|
||||
else {
|
||||
m_triggerPoint = cbegin;
|
||||
}
|
||||
|
||||
if (m_triggerWaitForReset) {
|
||||
if ((m_triggerWaitForReset) || (m_currentTraceMemoryIndex > 0)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -205,6 +206,19 @@ void ScopeVisNG::feed(const SampleVector::const_iterator& cbegin, const SampleVe
|
||||
m_mutex.unlock();
|
||||
}
|
||||
|
||||
void ScopeVisNG::processMemoryTrace()
|
||||
{
|
||||
if ((m_currentTraceMemoryIndex > 0) && (m_currentTraceMemoryIndex < m_nbTraceMemories))
|
||||
{
|
||||
SampleVector::const_iterator mend = m_traceDiscreteMemory.at(m_currentTraceMemoryIndex).m_endPoint;
|
||||
SampleVector::const_iterator mbegin = mend - m_traceSize;
|
||||
SampleVector::const_iterator mbegin_tb = mbegin - m_maxTraceDelay;
|
||||
|
||||
processTraces(mbegin_tb, mbegin, true); // traceback
|
||||
processTraces(mbegin, mend, false);
|
||||
}
|
||||
}
|
||||
|
||||
void ScopeVisNG::processTrace(const SampleVector::const_iterator& cbegin, const SampleVector::const_iterator& end, int& triggerPointToEnd)
|
||||
{
|
||||
SampleVector::const_iterator begin(cbegin);
|
||||
@ -638,6 +652,15 @@ bool ScopeVisNG::handleMessage(const Message& message)
|
||||
{
|
||||
MsgScopeVisNGMemoryTrace& conf = (MsgScopeVisNGMemoryTrace&) message;
|
||||
uint32_t memoryIndex = conf.getMemoryIndex();
|
||||
|
||||
if (memoryIndex != m_currentTraceMemoryIndex)
|
||||
{
|
||||
m_currentTraceMemoryIndex = memoryIndex;
|
||||
|
||||
if (m_currentTraceMemoryIndex > 0) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -684,6 +684,14 @@ private:
|
||||
return m_traceBackBuffers[m_currentMemIndex];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return trace at given memory position
|
||||
*/
|
||||
TraceBackBuffer& at(int index)
|
||||
{
|
||||
return m_traceBackBuffers[index];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return current memory index
|
||||
*/
|
||||
@ -926,6 +934,7 @@ private:
|
||||
Real m_projectorCache[(int) nbProjectionTypes];
|
||||
bool m_triggerOneShot; //!< True when one shot mode is active
|
||||
bool m_triggerWaitForReset; //!< In one shot mode suspended until reset by UI
|
||||
uint32_t m_currentTraceMemoryIndex; //!< The current index of trace in memory (0: current)
|
||||
|
||||
/**
|
||||
* Moves on to the next trigger if any or increments trigger count if in repeat mode
|
||||
@ -939,6 +948,11 @@ private:
|
||||
*/
|
||||
void processTrace(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, int& triggerPointToEnd);
|
||||
|
||||
/**
|
||||
* process a trace in memory at current trace index in memory
|
||||
*/
|
||||
void processMemoryTrace();
|
||||
|
||||
/**
|
||||
* Process traces from complex trace memory buffer.
|
||||
* - if finished it returns the number of unprocessed samples left in the buffer
|
||||
|
@ -669,15 +669,8 @@ void GLScopeNGGUI::on_mem_valueChanged(int value)
|
||||
QString text;
|
||||
text.sprintf("%02d", value);
|
||||
ui->memText->setText(text);
|
||||
|
||||
if (value > 0)
|
||||
{
|
||||
disableLiveMode(true); // block trigger UI line
|
||||
}
|
||||
else
|
||||
{
|
||||
disableLiveMode(false); // unblock trigger UI line
|
||||
}
|
||||
disableLiveMode(value > 0); // block trigger UI line if memory is active
|
||||
m_scopeVis->setMemoryIndex(value);
|
||||
}
|
||||
|
||||
void GLScopeNGGUI::on_trigMode_currentIndexChanged(int index)
|
||||
|
Loading…
Reference in New Issue
Block a user