mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-17 23:28:50 -05:00
Prepare scope trigger #2
This commit is contained in:
parent
9fa737ec67
commit
d67e4e0b82
@ -48,16 +48,18 @@ private:
|
||||
qint32 m_ampOffset;
|
||||
int m_displayGridIntensity;
|
||||
qint32 m_triggerChannel;
|
||||
Real m_triggerLevel;
|
||||
qint32 m_triggerLevel; // percent
|
||||
bool m_triggerPositiveEdge;
|
||||
|
||||
static const qreal amps[11];
|
||||
|
||||
void applySettings();
|
||||
void applyTriggerSettings();
|
||||
void setTimeScaleDisplay();
|
||||
void setTimeOfsDisplay();
|
||||
void setAmpScaleDisplay();
|
||||
void setAmpOfsDisplay();
|
||||
void setTrigLevelDisplay();
|
||||
|
||||
private slots:
|
||||
void on_amp_valueChanged(int value);
|
||||
@ -73,6 +75,11 @@ private slots:
|
||||
void on_vertView_clicked();
|
||||
void on_onlyPrimeView_clicked();
|
||||
void on_onlySecondView_clicked();
|
||||
|
||||
void on_trigMode_currentIndexChanged(int index);
|
||||
void on_slopePos_clicked();
|
||||
void on_slopeNeg_clicked();
|
||||
void on_trigLevel_valueChanged(int value);
|
||||
};
|
||||
|
||||
#endif // INCLUDE_GLSCOPEGUI_H
|
||||
|
@ -77,6 +77,9 @@ QByteArray GLScopeGUI::serialize() const
|
||||
s.writeS32(6, m_displayGridIntensity);
|
||||
s.writeS32(7, m_ampOffset);
|
||||
s.writeS32(8, m_displays);
|
||||
s.writeS32(9, m_triggerChannel);
|
||||
s.writeS32(10, m_triggerLevel);
|
||||
s.writeBool(11, m_triggerPositiveEdge);
|
||||
|
||||
return s.final();
|
||||
}
|
||||
@ -101,7 +104,16 @@ bool GLScopeGUI::deserialize(const QByteArray& data)
|
||||
m_timeBase = 1;
|
||||
d.readS32(7, &m_ampOffset, 0);
|
||||
d.readS32(8, &m_displays, GLScope::DisplayBoth);
|
||||
d.readS32(9, &m_triggerChannel, ScopeVis::TriggerFreeRun);
|
||||
ui->trigMode->setCurrentIndex(m_triggerChannel);
|
||||
d.readS32(10, &m_triggerLevel, 0);
|
||||
ui->trigLevel->setValue(m_triggerLevel);
|
||||
setTrigLevelDisplay();
|
||||
d.readBool(11, &m_triggerPositiveEdge, true);
|
||||
ui->slopePos->setChecked(m_triggerPositiveEdge);
|
||||
ui->slopeNeg->setChecked(!m_triggerPositiveEdge);
|
||||
applySettings();
|
||||
applyTriggerSettings();
|
||||
return true;
|
||||
} else {
|
||||
resetToDefaults();
|
||||
@ -151,6 +163,15 @@ void GLScopeGUI::applySettings()
|
||||
ui->gridIntensity->setSliderPosition(m_displayGridIntensity);
|
||||
}
|
||||
|
||||
void GLScopeGUI::applyTriggerSettings()
|
||||
{
|
||||
}
|
||||
|
||||
void GLScopeGUI::setTrigLevelDisplay()
|
||||
{
|
||||
ui->trigText->setText(tr("%1").arg(m_triggerLevel/100.0, 0, 'f', 2));
|
||||
}
|
||||
|
||||
void GLScopeGUI::setAmpScaleDisplay()
|
||||
{
|
||||
if (m_glScope->getDataMode() == GLScope::ModeMagdBPha) {
|
||||
@ -344,6 +365,45 @@ void GLScopeGUI::on_gridIntensity_valueChanged(int index)
|
||||
m_glScope->setDisplayGridIntensity(m_displayGridIntensity);
|
||||
}
|
||||
|
||||
void GLScopeGUI::on_trigMode_currentIndexChanged(int index)
|
||||
{
|
||||
m_triggerChannel = index;
|
||||
applyTriggerSettings();
|
||||
}
|
||||
|
||||
void GLScopeGUI::on_trigLevel_valueChanged(int value)
|
||||
{
|
||||
m_triggerLevel = value;
|
||||
setTrigLevelDisplay();
|
||||
applyTriggerSettings();
|
||||
}
|
||||
|
||||
void GLScopeGUI::on_slopePos_clicked()
|
||||
{
|
||||
m_triggerPositiveEdge = true;
|
||||
|
||||
if(ui->slopePos->isChecked()) {
|
||||
ui->slopeNeg->setChecked(false);
|
||||
} else {
|
||||
ui->slopePos->setChecked(true);
|
||||
}
|
||||
|
||||
applyTriggerSettings();
|
||||
}
|
||||
|
||||
void GLScopeGUI::on_slopeNeg_clicked()
|
||||
{
|
||||
m_triggerPositiveEdge = false;
|
||||
|
||||
if(ui->slopeNeg->isChecked()) {
|
||||
ui->slopePos->setChecked(false);
|
||||
} else {
|
||||
ui->slopeNeg->setChecked(true);
|
||||
}
|
||||
|
||||
applyTriggerSettings();
|
||||
}
|
||||
|
||||
bool GLScopeGUI::handleMessage(Message* cmd)
|
||||
{
|
||||
return false;
|
||||
|
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>807</width>
|
||||
<height>50</height>
|
||||
<height>67</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -126,7 +126,7 @@
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/res.qrc">
|
||||
<normaloff>:/display1.png</normaloff>:/display1.png</iconset>
|
||||
<normaloff>:/display1_w.png</normaloff>:/display1_w.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
@ -137,6 +137,9 @@
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -149,7 +152,7 @@
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/res.qrc">
|
||||
<normaloff>:/display2.png</normaloff>:/display2.png</iconset>
|
||||
<normaloff>:/display2_w.png</normaloff>:/display2_w.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
@ -160,6 +163,9 @@
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -172,7 +178,7 @@
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/res.qrc">
|
||||
<normaloff>:/horizontal.png</normaloff>:/horizontal.png</iconset>
|
||||
<normaloff>:/horizontal_w.png</normaloff>:/horizontal_w.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
@ -186,6 +192,9 @@
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -198,7 +207,7 @@
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/res.qrc">
|
||||
<normaloff>:/vertical.png</normaloff>:/vertical.png</iconset>
|
||||
<normaloff>:/vertical_w.png</normaloff>:/vertical_w.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
@ -209,6 +218,9 @@
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@ -240,6 +252,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Time range</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
@ -352,6 +367,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Y range</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@ -550,7 +568,11 @@
|
||||
<string>Trigger slope positive</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>+</string>
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/res.qrc">
|
||||
<normaloff>:/slopep_icon.png</normaloff>:/slopep_icon.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
@ -564,6 +586,12 @@
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonIconOnly</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -577,7 +605,11 @@
|
||||
<string>Trigger slope negative</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>-</string>
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/res.qrc">
|
||||
<normaloff>:/slopen_icon.png</normaloff>:/slopen_icon.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
@ -588,6 +620,9 @@
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@ -602,6 +637,9 @@
|
||||
<property name="toolTip">
|
||||
<string>Trigger level</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
|
BIN
sdrbase/resources/display1_w.png
Normal file
BIN
sdrbase/resources/display1_w.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 259 B |
BIN
sdrbase/resources/display2_w.png
Normal file
BIN
sdrbase/resources/display2_w.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 290 B |
BIN
sdrbase/resources/horizontal_w.png
Normal file
BIN
sdrbase/resources/horizontal_w.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 190 B |
@ -16,5 +16,11 @@
|
||||
<file>preset-last.png</file>
|
||||
<file>display1.png</file>
|
||||
<file>display2.png</file>
|
||||
<file>slopen_icon.png</file>
|
||||
<file>slopep_icon.png</file>
|
||||
<file>display1_w.png</file>
|
||||
<file>display2_w.png</file>
|
||||
<file>horizontal_w.png</file>
|
||||
<file>vertical_w.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
BIN
sdrbase/resources/slopen_icon.png
Normal file
BIN
sdrbase/resources/slopen_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 404 B |
BIN
sdrbase/resources/slopep_icon.png
Normal file
BIN
sdrbase/resources/slopep_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 410 B |
BIN
sdrbase/resources/vertical_w.png
Normal file
BIN
sdrbase/resources/vertical_w.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 202 B |
Loading…
Reference in New Issue
Block a user