mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 01:39:05 -05:00
New scope: implemented trigger moves
This commit is contained in:
parent
ed2fc4bbe8
commit
3078b6cfa1
@ -650,6 +650,28 @@ bool ScopeVisNG::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (MsgScopeVisNGMoveTrigger::match(message))
|
||||
{
|
||||
QMutexLocker configLocker(&m_mutex);
|
||||
MsgScopeVisNGMoveTrigger& conf = (MsgScopeVisNGMoveTrigger&) message;
|
||||
int triggerIndex = conf.getTriggerIndex();
|
||||
|
||||
if (!conf.getMoveUp() && (triggerIndex == 0)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
int nextTriggerIndex = (triggerIndex + (conf.getMoveUp() ? 1 : -1)) % m_triggerConditions.size();
|
||||
|
||||
TriggerCondition nextTrigger = m_triggerConditions[nextTriggerIndex];
|
||||
m_triggerConditions[nextTriggerIndex] = m_triggerConditions[triggerIndex];
|
||||
m_triggerConditions[triggerIndex] = nextTrigger;
|
||||
|
||||
computeDisplayTriggerLevels();
|
||||
m_glScope->setFocusedTriggerData(m_triggerConditions[m_focusedTriggerIndex].m_triggerData);
|
||||
updateGLScopeDisplay();
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (MsgScopeVisNGFocusOnTrigger::match(message))
|
||||
{
|
||||
MsgScopeVisNGFocusOnTrigger& conf = (MsgScopeVisNGFocusOnTrigger&) message;
|
||||
|
@ -647,6 +647,11 @@ private:
|
||||
m_triggerDelayCount = 0;
|
||||
m_triggerCounter = 0;
|
||||
}
|
||||
|
||||
void operator=(const TriggerCondition& other)
|
||||
{
|
||||
setData(other.m_triggerData);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -654,6 +654,34 @@ void GLScopeNGGUI::on_trigDel_clicked(bool checked)
|
||||
}
|
||||
}
|
||||
|
||||
void GLScopeNGGUI::on_trigUp_clicked(bool checked)
|
||||
{
|
||||
if (ui->trig->maximum() > 0) // more than one trigger
|
||||
{
|
||||
int newTriggerIndex = (ui->trig->value() + 1) % (ui->trig->maximum()+1);
|
||||
m_scopeVis->moveTrigger(ui->trace->value(), true);
|
||||
ui->trig->setValue(newTriggerIndex); // follow trigger
|
||||
ScopeVisNG::TriggerData triggerData;
|
||||
m_scopeVis->getTriggerData(triggerData, ui->trig->value());
|
||||
setTriggerUI(triggerData);
|
||||
m_scopeVis->focusOnTrigger(ui->trig->value());
|
||||
}
|
||||
}
|
||||
|
||||
void GLScopeNGGUI::on_trigDown_clicked(bool checked)
|
||||
{
|
||||
if (ui->trig->value() > 0) // not the 0 (lowest) trigger
|
||||
{
|
||||
int newTriggerIndex = (ui->trig->value() - 1) % (ui->trig->maximum()+1);
|
||||
m_scopeVis->moveTrigger(ui->trace->value(), false);
|
||||
ui->trig->setValue(newTriggerIndex); // follow trigger
|
||||
ScopeVisNG::TriggerData triggerData;
|
||||
m_scopeVis->getTriggerData(triggerData, ui->trig->value());
|
||||
setTriggerUI(triggerData);
|
||||
m_scopeVis->focusOnTrigger(ui->trig->value());
|
||||
}
|
||||
}
|
||||
|
||||
void GLScopeNGGUI::on_traceMode_currentIndexChanged(int index)
|
||||
{
|
||||
setAmpScaleDisplay();
|
||||
|
@ -189,6 +189,8 @@ private slots:
|
||||
void on_trig_valueChanged(int value);
|
||||
void on_trigAdd_clicked(bool checked);
|
||||
void on_trigDel_clicked(bool checked);
|
||||
void on_trigUp_clicked(bool checked);
|
||||
void on_trigDown_clicked(bool checked);
|
||||
void on_trigMode_currentIndexChanged(int index);
|
||||
void on_trigCount_valueChanged(int value);
|
||||
void on_trigPos_toggled(bool checked);
|
||||
|
Loading…
Reference in New Issue
Block a user