1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-28 15:56:33 -04:00

ATV Demod: GUI refactoring: fixed segfault at initialization

This commit is contained in:
f4exb 2017-03-15 22:12:12 +01:00
parent 78b3e8d69a
commit c7c2aa1fa7
3 changed files with 37 additions and 27 deletions

View File

@ -73,8 +73,6 @@ void ATVDemodGUI::resetToDefaults()
{ {
blockApplySettings(true); blockApplySettings(true);
//********** RF Default values **********
ui->deltaFrequency->setValue(0);
//********** ATV Default values ********** //********** ATV Default values **********
ui->synchLevel->setValue(100); ui->synchLevel->setValue(100);
ui->blackLevel->setValue(310); ui->blackLevel->setValue(310);
@ -203,41 +201,40 @@ void ATVDemodGUI::onMenuDoubleClicked()
ATVDemodGUI::ATVDemodGUI(PluginAPI* objPluginAPI, DeviceSourceAPI *objDeviceAPI, ATVDemodGUI::ATVDemodGUI(PluginAPI* objPluginAPI, DeviceSourceAPI *objDeviceAPI,
QWidget* objParent) : QWidget* objParent) :
RollupWidget(objParent), ui(new Ui::ATVDemodGUI), m_objPluginAPI( RollupWidget(objParent),
objPluginAPI), m_objDeviceAPI(objDeviceAPI), m_objChannelMarker( ui(new Ui::ATVDemodGUI),
this), m_blnBasicSettingsShown(false), m_blnDoApplySettings( m_objPluginAPI(objPluginAPI),
true) m_objDeviceAPI(objDeviceAPI),
m_objChannelMarker(this),
m_blnBasicSettingsShown(false),
m_blnDoApplySettings(true)
{ {
ui->setupUi(this); ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose, true); setAttribute(Qt::WA_DeleteOnClose, true);
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
SLOT(onWidgetRolled(QWidget*,bool))); connect(this, SIGNAL(menuDoubleClickEvent()), this, SLOT(onMenuDoubleClicked()));
connect(this, SIGNAL(menuDoubleClickEvent()), this,
SLOT(onMenuDoubleClicked()));
m_objATVDemod = new ATVDemod(); m_objATVDemod = new ATVDemod();
m_objATVDemod->SetATVScreen(ui->screenTV); m_objATVDemod->SetATVScreen(ui->screenTV);
m_objChannelizer = new DownChannelizer(m_objATVDemod); m_objChannelizer = new DownChannelizer(m_objATVDemod);
m_objThreadedChannelizer = new ThreadedBasebandSampleSink(m_objChannelizer, m_objThreadedChannelizer = new ThreadedBasebandSampleSink(m_objChannelizer, this);
this);
m_objDeviceAPI->addThreadedSink(m_objThreadedChannelizer); m_objDeviceAPI->addThreadedSink(m_objThreadedChannelizer);
//connect(&m_objPluginAPI->getMainWindow()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); // 50 ms
ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold));
ui->deltaFrequency->setValueRange(7, 0U, 9999999U);
connect(m_objChannelizer, SIGNAL(inputSampleRateChanged()), this, SLOT(channelSampleRateChanged())); connect(m_objChannelizer, SIGNAL(inputSampleRateChanged()), this, SLOT(channelSampleRateChanged()));
//m_objPluginAPI->addThreadedSink(m_objThreadedChannelizer); //m_objPluginAPI->addThreadedSink(m_objThreadedChannelizer);
//connect(&m_objPluginAPI->getMainWindow()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); // 50 ms
ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold));
ui->deltaFrequency->setValueRange(7, 0U, 9999999U);
m_objChannelMarker.setColor(Qt::white); m_objChannelMarker.setColor(Qt::white);
m_objChannelMarker.setBandwidth(6000000); m_objChannelMarker.setBandwidth(6000000);
m_objChannelMarker.setCenterFrequency(0); m_objChannelMarker.setCenterFrequency(0);
m_objChannelMarker.setVisible(true); m_objChannelMarker.setVisible(true);
connect(&m_objChannelMarker, SIGNAL(changed()), this, SLOT(viewChanged())); //connect(&m_objChannelMarker, SIGNAL(changed()), this, SLOT(viewChanged()));
m_objDeviceAPI->registerChannelInstance(m_strChannelID, this); m_objDeviceAPI->registerChannelInstance(m_strChannelID, this);
m_objDeviceAPI->addChannelMarker(&m_objChannelMarker); m_objDeviceAPI->addChannelMarker(&m_objChannelMarker);

View File

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>480</width> <width>520</width>
<height>480</height> <height>480</height>
</rect> </rect>
</property> </property>
@ -18,7 +18,7 @@
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>480</width> <width>520</width>
<height>480</height> <height>480</height>
</size> </size>
</property> </property>
@ -39,8 +39,8 @@
<rect> <rect>
<x>10</x> <x>10</x>
<y>10</y> <y>10</y>
<width>461</width> <width>501</width>
<height>26</height> <height>27</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -76,6 +76,12 @@
<height>16</height> <height>16</height>
</size> </size>
</property> </property>
<property name="font">
<font>
<family>Monospace</family>
<pointsize>12</pointsize>
</font>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -123,6 +129,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QLabel" name="rfBWText">
<property name="text">
<string>10.0</string>
</property>
</widget>
</item>
<item> <item>
<spacer name="horizontalSpacer_3"> <spacer name="horizontalSpacer_3">
<property name="orientation"> <property name="orientation">
@ -139,7 +152,7 @@
<item> <item>
<widget class="QLabel" name="channelSampleRateText"> <widget class="QLabel" name="channelSampleRateText">
<property name="text"> <property name="text">
<string>00000 kS/s</string> <string>00000k</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -150,7 +163,7 @@
<rect> <rect>
<x>10</x> <x>10</x>
<y>40</y> <y>40</y>
<width>462</width> <width>501</width>
<height>347</height> <height>347</height>
</rect> </rect>
</property> </property>
@ -193,7 +206,7 @@
<rect> <rect>
<x>10</x> <x>10</x>
<y>390</y> <y>390</y>
<width>461</width> <width>501</width>
<height>80</height> <height>80</height>
</rect> </rect>
</property> </property>

View File

@ -26,7 +26,7 @@
const PluginDescriptor ATVDemodPlugin::m_ptrPluginDescriptor = const PluginDescriptor ATVDemodPlugin::m_ptrPluginDescriptor =
{ {
QString("ATV Demodulator"), QString("ATV Demodulator"),
QString("3.3.0"), QString("3.3.1"),
QString("(c) F4HKW for F4EXB / SDRAngel"), QString("(c) F4HKW for F4EXB / SDRAngel"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,