mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-22 17:45:48 -05:00
Added one shot trigger option
This commit is contained in:
parent
c32f2b72f7
commit
9161e867c9
@ -22,6 +22,7 @@ public:
|
||||
ScopeVis(GLScope* glScope = NULL);
|
||||
|
||||
void configure(MessageQueue* msgQueue, TriggerChannel triggerChannel, Real triggerLevel, bool triggerPositiveEdge);
|
||||
void setOneShot(bool oneShot);
|
||||
|
||||
void feed(SampleVector::const_iterator begin, SampleVector::const_iterator end, bool positiveOnly);
|
||||
void start();
|
||||
@ -72,6 +73,7 @@ private:
|
||||
TriggerChannel m_triggerChannel;
|
||||
Real m_triggerLevel;
|
||||
bool m_triggerPositiveEdge;
|
||||
bool m_triggerOneShot;
|
||||
bool m_armed;
|
||||
int m_sampleRate;
|
||||
|
||||
|
@ -79,6 +79,7 @@ private slots:
|
||||
void on_trigMode_currentIndexChanged(int index);
|
||||
void on_slopePos_clicked();
|
||||
void on_slopeNeg_clicked();
|
||||
void on_oneShot_clicked();
|
||||
void on_trigLevel_valueChanged(int value);
|
||||
};
|
||||
|
||||
|
@ -16,6 +16,7 @@ ScopeVis::ScopeVis(GLScope* glScope) :
|
||||
m_triggerChannel(TriggerFreeRun),
|
||||
m_triggerLevel(0.0),
|
||||
m_triggerPositiveEdge(true),
|
||||
m_triggerOneShot(false),
|
||||
m_armed(false),
|
||||
m_sampleRate(0)
|
||||
{
|
||||
@ -49,6 +50,12 @@ void ScopeVis::feed(SampleVector::const_iterator begin, SampleVector::const_iter
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_triggerState == WaitForReset)
|
||||
{
|
||||
if (!m_triggerOneShot) {
|
||||
m_triggerState = Untriggered;
|
||||
}
|
||||
}
|
||||
if(m_triggerState == Untriggered)
|
||||
{
|
||||
while(begin < end)
|
||||
@ -80,11 +87,15 @@ void ScopeVis::feed(SampleVector::const_iterator begin, SampleVector::const_iter
|
||||
if(m_fill >= m_trace.size()) {
|
||||
m_glScope->newTrace(m_trace, m_sampleRate);
|
||||
m_fill = 0;
|
||||
if (m_triggerOneShot) {
|
||||
m_triggerState = WaitForReset;
|
||||
} else {
|
||||
m_triggerState = Untriggered;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ScopeVis::start()
|
||||
@ -168,3 +179,8 @@ bool ScopeVis::triggerCondition(SampleVector::const_iterator& it)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void ScopeVis::setOneShot(bool oneShot)
|
||||
{
|
||||
m_triggerOneShot = oneShot;
|
||||
}
|
||||
|
@ -426,6 +426,11 @@ void GLScopeGUI::on_slopeNeg_clicked()
|
||||
applyTriggerSettings();
|
||||
}
|
||||
|
||||
void GLScopeGUI::on_oneShot_clicked()
|
||||
{
|
||||
m_scopeVis->setOneShot(ui->oneShot->isChecked());
|
||||
}
|
||||
|
||||
bool GLScopeGUI::handleMessage(Message* cmd)
|
||||
{
|
||||
return false;
|
||||
|
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>807</width>
|
||||
<height>67</height>
|
||||
<height>69</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -625,6 +625,32 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="oneShot">
|
||||
<property name="toolTip">
|
||||
<string>One shot</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/res.qrc">
|
||||
<normaloff>:/display1_w.png</normaloff>:/display1_w.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
Loading…
Reference in New Issue
Block a user