1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-09-02 13:17:48 -04:00

Mew scope: trace memory interim state (1)

This commit is contained in:
f4exb 2017-02-23 08:18:03 +01:00
parent a0c3ffe5da
commit 763d486514
4 changed files with 75 additions and 1 deletions

View File

@ -32,6 +32,7 @@ MESSAGE_CLASS_DEFINITION(ScopeVisNG::MsgScopeVisNGChangeTrace, Message)
MESSAGE_CLASS_DEFINITION(ScopeVisNG::MsgScopeVisNGRemoveTrace, Message) MESSAGE_CLASS_DEFINITION(ScopeVisNG::MsgScopeVisNGRemoveTrace, Message)
MESSAGE_CLASS_DEFINITION(ScopeVisNG::MsgScopeVisNGFocusOnTrace, Message) MESSAGE_CLASS_DEFINITION(ScopeVisNG::MsgScopeVisNGFocusOnTrace, Message)
MESSAGE_CLASS_DEFINITION(ScopeVisNG::MsgScopeVisNGOneShot, Message) MESSAGE_CLASS_DEFINITION(ScopeVisNG::MsgScopeVisNGOneShot, Message)
MESSAGE_CLASS_DEFINITION(ScopeVisNG::MsgScopeVisNGMemoryTrace, Message)
const uint ScopeVisNG::m_traceChunkSize = 4800; const uint ScopeVisNG::m_traceChunkSize = 4800;
@ -50,7 +51,7 @@ ScopeVisNG::ScopeVisNG(GLScopeNG* glScope) :
m_zTraceIndex(-1), m_zTraceIndex(-1),
m_timeOfsProMill(0), m_timeOfsProMill(0),
m_sampleRate(0), m_sampleRate(0),
m_traceDiscreteMemory(10), m_traceDiscreteMemory(m_nbTraceMemories),
m_freeRun(true), m_freeRun(true),
m_maxTraceDelay(0), m_maxTraceDelay(0),
m_triggerOneShot(false), m_triggerOneShot(false),
@ -145,6 +146,12 @@ void ScopeVisNG::setOneShot(bool oneShot)
getInputMessageQueue()->push(cmd); getInputMessageQueue()->push(cmd);
} }
void ScopeVisNG::setMemoryIndex(uint32_t memoryIndex)
{
Message* cmd = MsgScopeVisNGMemoryTrace::create(memoryIndex);
getInputMessageQueue()->push(cmd);
}
void ScopeVisNG::feed(const SampleVector::const_iterator& cbegin, const SampleVector::const_iterator& end, bool positiveOnly) void ScopeVisNG::feed(const SampleVector::const_iterator& cbegin, const SampleVector::const_iterator& end, bool positiveOnly)
{ {
if (m_freeRun) { if (m_freeRun) {
@ -627,6 +634,11 @@ bool ScopeVisNG::handleMessage(const Message& message)
m_triggerOneShot = oneShot; m_triggerOneShot = oneShot;
if (m_triggerWaitForReset && !oneShot) m_triggerWaitForReset = false; if (m_triggerWaitForReset && !oneShot) m_triggerWaitForReset = false;
} }
else if (MsgScopeVisNGMemoryTrace::match(message))
{
MsgScopeVisNGMemoryTrace& conf = (MsgScopeVisNGMemoryTrace&) message;
uint32_t memoryIndex = conf.getMemoryIndex();
}
else else
{ {
return false; return false;

View File

@ -145,6 +145,7 @@ public:
static const uint32_t m_traceChunkSize; static const uint32_t m_traceChunkSize;
static const uint32_t m_maxNbTriggers = 10; static const uint32_t m_maxNbTriggers = 10;
static const uint32_t m_maxNbTraces = 10; static const uint32_t m_maxNbTraces = 10;
static const uint32_t m_nbTraceMemories = 16;
ScopeVisNG(GLScopeNG* glScope = 0); ScopeVisNG(GLScopeNG* glScope = 0);
virtual ~ScopeVisNG(); virtual ~ScopeVisNG();
@ -160,6 +161,7 @@ public:
void removeTrigger(uint32_t triggerIndex); void removeTrigger(uint32_t triggerIndex);
void focusOnTrigger(uint32_t triggerIndex); void focusOnTrigger(uint32_t triggerIndex);
void setOneShot(bool oneShot); void setOneShot(bool oneShot);
void setMemoryIndex(uint32_t memoryIndex);
void getTriggerData(TriggerData& triggerData, uint32_t triggerIndex) void getTriggerData(TriggerData& triggerData, uint32_t triggerIndex)
{ {
@ -420,6 +422,27 @@ private:
{} {}
}; };
// ---------------------------------------------
class MsgScopeVisNGMemoryTrace : public Message {
MESSAGE_CLASS_DECLARATION
public:
static MsgScopeVisNGMemoryTrace* create(
uint32_t memoryIndex)
{
return new MsgScopeVisNGMemoryTrace(memoryIndex);
}
bool getMemoryIndex() const { return m_memoryIndex; }
private:
uint32_t m_memoryIndex;
MsgScopeVisNGMemoryTrace(uint32_t memoryIndex) :
m_memoryIndex(memoryIndex)
{}
};
// --------------------------------------------- // ---------------------------------------------
/** /**

View File

@ -44,6 +44,7 @@ GLScopeNGGUI::GLScopeNGGUI(QWidget* parent) :
ui->trigColor->setStyleSheet("QLabel { background-color : rgb(0,255,0); }"); ui->trigColor->setStyleSheet("QLabel { background-color : rgb(0,255,0); }");
m_focusedTriggerColor.setRgb(0,255,0); m_focusedTriggerColor.setRgb(0,255,0);
ui->traceText->setText("X"); // TODO: remove when more than 2 traces are supported ui->traceText->setText("X"); // TODO: remove when more than 2 traces are supported
ui->mem->setMaximum(ScopeVisNG::m_nbTraceMemories - 1);
} }
GLScopeNGGUI::~GLScopeNGGUI() GLScopeNGGUI::~GLScopeNGGUI()
@ -663,6 +664,22 @@ void GLScopeNGGUI::on_traceColor_clicked()
} }
} }
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
}
}
void GLScopeNGGUI::on_trigMode_currentIndexChanged(int index) void GLScopeNGGUI::on_trigMode_currentIndexChanged(int index)
{ {
setTrigLevelDisplay(); setTrigLevelDisplay();
@ -1074,6 +1091,26 @@ void GLScopeNGGUI::fillProjectionCombo(QComboBox* comboBox)
comboBox->addItem("dPhi", ScopeVisNG::ProjectionDPhase); comboBox->addItem("dPhi", ScopeVisNG::ProjectionDPhase);
} }
void GLScopeNGGUI::disableLiveMode(bool disable)
{
ui->traceLen->setEnabled(!disable);
ui->trig->setEnabled(!disable);
ui->trigAdd->setEnabled(!disable);
ui->trigDel->setEnabled(!disable);
ui->trigMode->setEnabled(!disable);
ui->trigCount->setEnabled(!disable);
ui->trigPos->setEnabled(!disable);
ui->trigNeg->setEnabled(!disable);
ui->trigBoth->setEnabled(!disable);
ui->trigLevelCoarse->setEnabled(!disable);
ui->trigLevelFine->setEnabled(!disable);
ui->trigDelayCoarse->setEnabled(!disable);
ui->trigDelayFine->setEnabled(!disable);
ui->trigPre->setEnabled(!disable);
ui->trigOneShot->setEnabled(!disable);
ui->freerun->setEnabled(!disable);
}
void GLScopeNGGUI::fillTraceData(ScopeVisNG::TraceData& traceData) void GLScopeNGGUI::fillTraceData(ScopeVisNG::TraceData& traceData)
{ {
traceData.m_projectionType = (ScopeVisNG::ProjectionType) ui->traceMode->currentIndex(); traceData.m_projectionType = (ScopeVisNG::ProjectionType) ui->traceMode->currentIndex();

View File

@ -156,6 +156,7 @@ private:
void setTraceUI(ScopeVisNG::TraceData& traceData); void setTraceUI(ScopeVisNG::TraceData& traceData);
void fillProjectionCombo(QComboBox* comboBox); void fillProjectionCombo(QComboBox* comboBox);
void disableLiveMode(bool disable);
private slots: private slots:
void on_scope_sampleRateChanged(int value); void on_scope_sampleRateChanged(int value);
@ -181,6 +182,7 @@ private slots:
void on_traceDelayCoarse_valueChanged(int value); void on_traceDelayCoarse_valueChanged(int value);
void on_traceDelayFine_valueChanged(int value); void on_traceDelayFine_valueChanged(int value);
void on_traceColor_clicked(); void on_traceColor_clicked();
void on_mem_valueChanged(int value);
// Third row // Third row
void on_trig_valueChanged(int value); void on_trig_valueChanged(int value);
void on_trigAdd_clicked(bool checked); void on_trigAdd_clicked(bool checked);