1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-20 20:06:57 -04:00

New scope: activate trace cache

This commit is contained in:
f4exb 2017-02-19 04:46:15 +01:00
parent e7e83b13be
commit daa2619bb3
2 changed files with 30 additions and 1 deletions

View File

@ -620,13 +620,41 @@ bool ScopeVisNG::handleMessage(const Message& message)
void ScopeVisNG::updateMaxTraceDelay()
{
int maxTraceDelay = 0;
bool allocateCache = false;
uint32_t projectorCounts[(int) nbProjectionTypes];
memset(projectorCounts, 0, ((int) nbProjectionTypes)*sizeof(uint32_t));
std::vector<TraceData>::iterator itData = m_traces.m_tracesData.begin();
std::vector<TraceControl>::iterator itCtrl = m_traces.m_tracesControl.begin();
for (std::vector<TraceData>::iterator itData = m_traces.m_tracesData.begin(); itData != m_traces.m_tracesData.end(); ++itData)
for (; itData != m_traces.m_tracesData.end(); ++itData, ++itCtrl)
{
if (itData->m_traceDelay > maxTraceDelay)
{
maxTraceDelay = itData->m_traceDelay;
}
if (projectorCounts[(int) itData->m_projectionType] > 0)
{
allocateCache = true;
itCtrl->m_projector.setCacheMaster(false);
}
else
{
itCtrl->m_projector.setCacheMaster(true);
}
projectorCounts[(int) itData->m_projectionType]++;
}
itCtrl = m_traces.m_tracesControl.begin();
for (; itCtrl != m_traces.m_tracesControl.end(); ++itCtrl)
{
if (allocateCache) {
itCtrl->m_projector.setCache(m_projectorCache);
} else {
itCtrl->m_projector.setCache(0);
}
}
m_maxTraceDelay = maxTraceDelay;

View File

@ -875,6 +875,7 @@ private:
int m_maxTraceDelay; //!< Maximum trace delay
TriggerComparator m_triggerComparator; //!< Compares sample level to trigger level
QMutex m_mutex;
Real m_projectorCache[(int) nbProjectionTypes];
/**
* Moves on to the next trigger if any or increments trigger count if in repeat mode