GLScope: fixed pre-trigger samples initialization when trace size changes

This commit is contained in:
f4exb 2016-04-03 01:49:58 +02:00
parent ca52dbf5b4
commit f245dc8206
2 changed files with 18 additions and 1 deletions

View File

@ -183,7 +183,6 @@ bool GLScopeGUI::deserialize(const QByteArray& data)
setTrigUI(m_triggerIndex);
setTrigLevelDisplay();
applySettings();
applyTriggerSettings();
return true;
} else {
resetToDefaults();
@ -191,6 +190,19 @@ bool GLScopeGUI::deserialize(const QByteArray& data)
}
}
void GLScopeGUI::applyAllTriggerSettings()
{
quint32 currentTriggerIndex = m_triggerIndex;
for (int i = 0; i < ScopeVis::m_nbTriggers; i++)
{
m_triggerIndex = i;
applyTriggerSettings();
}
m_triggerIndex = currentTriggerIndex;
}
void GLScopeGUI::setTrigUI(uint index)
{
index %= ScopeVis::m_nbTriggers;
@ -479,6 +491,10 @@ void GLScopeGUI::on_scope_traceSizeChanged(int)
setTrigPreDisplay();
setTrigDelayDisplay();
applySettings();
if (m_triggerPre > 0) {
applyAllTriggerSettings(); // change of trace size changes number of pre-trigger samples
}
}
void GLScopeGUI::on_scope_sampleRateChanged(int)

View File

@ -67,6 +67,7 @@ private:
void applySettings();
void applyTriggerSettings();
void applyAllTriggerSettings();
void setTimeScaleDisplay();
void setTraceLenDisplay();
void setTimeOfsDisplay();