mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-03-07 11:59:04 -05:00
New scope: fixed trigger projector initialization and delete
This commit is contained in:
parent
b8e3d60110
commit
f1b5b08fa0
@ -31,7 +31,6 @@ MESSAGE_CLASS_DEFINITION(ScopeVisNG::MsgScopeVisNGRemoveTrace, Message)
|
||||
const uint ScopeVisNG::m_traceChunkSize = 4800;
|
||||
const Real ScopeVisNG::ProjectorMagDB::mult = (10.0f / log2f(10.0f));
|
||||
|
||||
|
||||
ScopeVisNG::ScopeVisNG(GLScopeNG* glScope) :
|
||||
m_glScope(glScope),
|
||||
m_preTriggerDelay(0),
|
||||
@ -479,7 +478,7 @@ bool ScopeVisNG::handleMessage(const Message& message)
|
||||
{
|
||||
MsgScopeVisNGAddTrigger& conf = (MsgScopeVisNGAddTrigger&) message;
|
||||
m_triggerConditions.push_back(TriggerCondition(conf.getTriggerData()));
|
||||
m_triggerConditions.back().init();
|
||||
m_triggerConditions.back().initProjector();
|
||||
return true;
|
||||
}
|
||||
else if (MsgScopeVisNGChangeTrigger::match(message))
|
||||
@ -499,6 +498,7 @@ bool ScopeVisNG::handleMessage(const Message& message)
|
||||
int triggerIndex = conf.getTriggerIndex();
|
||||
|
||||
if (triggerIndex < m_triggerConditions.size()) {
|
||||
m_triggerConditions[triggerIndex].releaseProjector();
|
||||
m_triggerConditions.erase(m_triggerConditions.begin() + triggerIndex);
|
||||
}
|
||||
|
||||
|
@ -360,17 +360,6 @@ private:
|
||||
}
|
||||
|
||||
return dPhi;
|
||||
|
||||
// Real dPhi = curArg - m_prevArg;
|
||||
// m_prevArg = curArg;
|
||||
//
|
||||
// if (dPhi < -M_PI) {
|
||||
// dPhi += 2.0 * M_PI;
|
||||
// } else if (dPhi > M_PI) {
|
||||
// dPhi -= 2.0 * M_PI;
|
||||
// }
|
||||
//
|
||||
// return dPhi/M_PI;
|
||||
}
|
||||
|
||||
private:
|
||||
@ -430,14 +419,18 @@ private:
|
||||
|
||||
~TriggerCondition()
|
||||
{
|
||||
if (m_projector) delete m_projector;
|
||||
}
|
||||
|
||||
void init()
|
||||
void initProjector()
|
||||
{
|
||||
m_projector = createProjector(m_triggerData.m_projectionType);
|
||||
}
|
||||
|
||||
void releaseProjector()
|
||||
{
|
||||
delete m_projector;
|
||||
}
|
||||
|
||||
void setData(const TriggerData& triggerData)
|
||||
{
|
||||
m_triggerData = triggerData;
|
||||
|
@ -257,6 +257,31 @@ void GLScopeNGGUI::on_traceLen_valueChanged(int value)
|
||||
setTimeOfsDisplay();
|
||||
}
|
||||
|
||||
void GLScopeNGGUI::on_trig_valueChanged(int value)
|
||||
{
|
||||
ui->trigText->setText(tr("%1").arg(value));
|
||||
}
|
||||
|
||||
void GLScopeNGGUI::on_trigAdd_clicked(bool checked)
|
||||
{
|
||||
if (ui->trig->maximum() < 9)
|
||||
{
|
||||
ScopeVisNG::TriggerData triggerData;
|
||||
fillTriggerData(triggerData);
|
||||
m_scopeVis->addTrigger(triggerData);
|
||||
ui->trig->setMaximum(ui->trig->maximum() + 1);
|
||||
}
|
||||
}
|
||||
|
||||
void GLScopeNGGUI::on_trigDel_clicked(bool checked)
|
||||
{
|
||||
if (ui->trig->maximum() > 0)
|
||||
{
|
||||
m_scopeVis->removeTrigger(ui->trig->value());
|
||||
ui->trig->setMaximum(ui->trig->maximum() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
void GLScopeNGGUI::on_traceMode_currentIndexChanged(int index)
|
||||
{
|
||||
setAmpScaleDisplay();
|
||||
@ -656,6 +681,11 @@ void GLScopeNGGUI::fillTriggerData(ScopeVisNG::TriggerData& triggerData)
|
||||
triggerData.m_triggerDelay = (int) (m_traceLenMult * ScopeVisNG::m_traceChunkSize * delayMult);
|
||||
}
|
||||
|
||||
void GLScopeNGGUI::setTriggerUI(ScopeVisNG::TriggerData& triggerData)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void GLScopeNGGUI::applySettings()
|
||||
{
|
||||
}
|
||||
|
@ -83,6 +83,7 @@ private:
|
||||
|
||||
void fillTraceData(ScopeVisNG::TraceData& traceData);
|
||||
void fillTriggerData(ScopeVisNG::TriggerData& triggerData);
|
||||
void setTriggerUI(ScopeVisNG::TriggerData& triggerData);
|
||||
|
||||
void fillProjectionCombo(QComboBox* comboBox);
|
||||
|
||||
@ -106,6 +107,9 @@ private slots:
|
||||
void on_ofsFine_valueChanged(int value);
|
||||
void on_traceDelay_valueChanged(int value);
|
||||
// Third row
|
||||
void on_trig_valueChanged(int value);
|
||||
void on_trigAdd_clicked(bool checked);
|
||||
void on_trigDel_clicked(bool checked);
|
||||
void on_trigMode_currentIndexChanged(int index);
|
||||
void on_trigCount_valueChanged(int value);
|
||||
void on_trigPos_toggled(bool checked);
|
||||
|
@ -700,7 +700,7 @@ kS/s</string>
|
||||
<widget class="QLabel" name="ampText">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<width>36</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -749,7 +749,7 @@ kS/s</string>
|
||||
<widget class="QLabel" name="ofsText">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<width>36</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -1292,7 +1292,7 @@ kS/s</string>
|
||||
<widget class="QLabel" name="trigLevelText">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<width>36</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
|
Loading…
Reference in New Issue
Block a user