ATV Demod: GUI refactoring (1)

This commit is contained in:
f4exb 2017-03-15 18:56:38 +01:00
parent f40d030e2e
commit 78b3e8d69a
2 changed files with 399 additions and 363 deletions

View File

@ -73,6 +73,8 @@ void ATVDemodGUI::resetToDefaults()
{
blockApplySettings(true);
//********** RF Default values **********
ui->deltaFrequency->setValue(0);
//********** ATV Default values **********
ui->synchLevel->setValue(100);
ui->blackLevel->setValue(310);
@ -226,13 +228,16 @@ ATVDemodGUI::ATVDemodGUI(PluginAPI* objPluginAPI, DeviceSourceAPI *objDeviceAPI,
//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.setBandwidth(6000000);
m_objChannelMarker.setCenterFrequency(0);
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->addChannelMarker(&m_objChannelMarker);
@ -265,6 +270,8 @@ void ATVDemodGUI::applySettings()
if (m_blnDoApplySettings)
{
setTitleColor(m_objChannelMarker.getColor());
ui->deltaFrequency->setValue(abs(m_objChannelMarker.getCenterFrequency()));
ui->deltaFrequencyMinus->setChecked(m_objChannelMarker.getCenterFrequency() < 0);
m_objChannelizer->configure(m_objChannelizer->getInputMessageQueue(),
//m_objATVDemod->GetSampleRate(),

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>500</height>
<width>480</width>
<height>480</height>
</rect>
</property>
<property name="sizePolicy">
@ -18,8 +18,8 @@
</property>
<property name="minimumSize">
<size>
<width>500</width>
<height>450</height>
<width>480</width>
<height>480</height>
</size>
</property>
<property name="font">
@ -39,10 +39,124 @@
<rect>
<x>10</x>
<y>10</y>
<width>481</width>
<height>361</height>
<width>461</width>
<height>26</height>
</rect>
</property>
<property name="windowTitle">
<string>RF Settings</string>
</property>
<layout class="QHBoxLayout" name="rfSettingsLayout">
<item>
<layout class="QHBoxLayout" name="deltaFrequencyLayout">
<item>
<widget class="QToolButton" name="deltaFrequencyMinus">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<selectedoff>:/plus.png</selectedoff>
<selectedon>:/minus.png</selectedon>
</iconset>
</property>
</widget>
</item>
<item>
<widget class="ValueDial" name="deltaFrequency" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>32</width>
<height>16</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="deltaFrequencyUnits">
<property name="text">
<string>Hz</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QComboBox" name="modulation">
<property name="toolTip">
<string>Modulation type</string>
</property>
<item>
<property name="text">
<string>FM 1</string>
</property>
</item>
<item>
<property name="text">
<string>FM 2</string>
</property>
</item>
<item>
<property name="text">
<string>AM</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QLabel" name="rfBWLabel">
<property name="text">
<string>BW</string>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="rfBW">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="channelSampleRateText">
<property name="text">
<string>00000 kS/s</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_2">
<property name="geometry">
<rect>
<x>10</x>
<y>40</y>
<width>462</width>
<height>347</height>
</rect>
</property>
<property name="windowTitle">
<string>TV Screen</string>
</property>
<layout class="QHBoxLayout" name="screenTVLayout">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
@ -74,373 +188,282 @@
</item>
</layout>
</widget>
<widget class="QGroupBox" name="settingsGroup">
<widget class="QWidget" name="layoutWidget_3">
<property name="geometry">
<rect>
<x>10</x>
<y>380</y>
<width>481</width>
<height>105</height>
<y>390</y>
<width>461</width>
<height>80</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>461</width>
<height>105</height>
</size>
<property name="windowTitle">
<string>TV Settings</string>
</property>
<property name="title">
<string>ATV Settings</string>
</property>
<widget class="QSlider" name="blackLevel">
<property name="geometry">
<rect>
<x>310</x>
<y>60</y>
<width>101</width>
<height>20</height>
</rect>
</property>
<property name="toolTip">
<string>Black level</string>
</property>
<property name="maximum">
<number>999</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QComboBox" name="fps">
<property name="geometry">
<rect>
<x>120</x>
<y>30</y>
<width>72</width>
<height>22</height>
</rect>
</property>
<property name="toolTip">
<string>Frames per second</string>
<layout class="QVBoxLayout" name="tvSettingsLayout" stretch="0,0">
<property name="spacing">
<number>2</number>
</property>
<item>
<property name="text">
<string comment="25">25 Fps</string>
</property>
<layout class="QHBoxLayout" name="buttonsLayout">
<item>
<widget class="QComboBox" name="fps">
<property name="toolTip">
<string>Frames per second</string>
</property>
<item>
<property name="text">
<string comment="25">25 Fps</string>
</property>
</item>
<item>
<property name="text">
<string comment="30">30 Fps</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QCheckBox" name="hSync">
<property name="toolTip">
<string>Toggle horizontal synchronization</string>
</property>
<property name="text">
<string>HSync</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="vSync">
<property name="toolTip">
<string>Toggle vertical synchronization</string>
</property>
<property name="text">
<string>VSync</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="halfImage">
<property name="toolTip">
<string>Render only half of the frames for slow processors</string>
</property>
<property name="text">
<string>Half</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="reset">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolTip">
<string>Reset to default values</string>
</property>
<property name="text">
<string>R</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<property name="text">
<string comment="30">30 Fps</string>
</property>
<layout class="QGridLayout" name="slidersLayout">
<item row="0" column="1">
<widget class="QSlider" name="synchLevel">
<property name="toolTip">
<string>Horizontal synchronization level</string>
</property>
<property name="maximum">
<number>999</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="QLabel" name="blackLevelText">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;right&quot;&gt;mV&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="synchLevelText">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;right&quot;&gt;mV&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="synchLevelLabel">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Synch&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QLabel" name="blackLevelLabel">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Black Lvl&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QSlider" name="blackLevel">
<property name="toolTip">
<string>Black level</string>
</property>
<property name="maximum">
<number>999</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lineTimeLabel">
<property name="text">
<string>Line</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSlider" name="lineTime">
<property name="toolTip">
<string>Line length in time units</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>1000</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="lineTimeText">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;right&quot;&gt;uS&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QLabel" name="topTimeLabel">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Top&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="QSlider" name="topTime">
<property name="toolTip">
<string>Horizontal top length in time units</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>30</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="1" column="6">
<widget class="QLabel" name="topTimeText">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;right&quot;&gt;uS&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</widget>
<widget class="QSlider" name="synchLevel">
<property name="geometry">
<rect>
<x>50</x>
<y>60</y>
<width>101</width>
<height>16</height>
</rect>
</property>
<property name="toolTip">
<string>Horizontal synchronization level</string>
</property>
<property name="maximum">
<number>999</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QCheckBox" name="hSync">
<property name="geometry">
<rect>
<x>220</x>
<y>30</y>
<width>61</width>
<height>20</height>
</rect>
</property>
<property name="toolTip">
<string>Toggle horizontal synchronization</string>
</property>
<property name="text">
<string>HSync</string>
</property>
</widget>
<widget class="QCheckBox" name="vSync">
<property name="geometry">
<rect>
<x>300</x>
<y>30</y>
<width>61</width>
<height>20</height>
</rect>
</property>
<property name="toolTip">
<string>Toggle vertical synchronization</string>
</property>
<property name="text">
<string>VSync</string>
</property>
</widget>
<widget class="QLabel" name="synchLevelLabel">
<property name="geometry">
<rect>
<x>10</x>
<y>60</y>
<width>41</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Synch&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
<widget class="QLabel" name="synchLevelText">
<property name="geometry">
<rect>
<x>160</x>
<y>60</y>
<width>51</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;right&quot;&gt;mV&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLabel" name="blackLevelLabel">
<property name="geometry">
<rect>
<x>250</x>
<y>60</y>
<width>61</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Black Lvl&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
<widget class="QLabel" name="blackLevelText">
<property name="geometry">
<rect>
<x>420</x>
<y>60</y>
<width>51</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;right&quot;&gt;mV&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QCheckBox" name="halfImage">
<property name="geometry">
<rect>
<x>380</x>
<y>30</y>
<width>51</width>
<height>20</height>
</rect>
</property>
<property name="toolTip">
<string>Render only half of the frames for slow processors</string>
</property>
<property name="text">
<string>Half</string>
</property>
</widget>
<widget class="QLabel" name="lineTimeLabel">
<property name="geometry">
<rect>
<x>10</x>
<y>80</y>
<width>31</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Line</string>
</property>
</widget>
<widget class="QSlider" name="lineTime">
<property name="geometry">
<rect>
<x>50</x>
<y>80</y>
<width>101</width>
<height>16</height>
</rect>
</property>
<property name="toolTip">
<string>Line length in time units</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>1000</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QLabel" name="lineTimeText">
<property name="geometry">
<rect>
<x>160</x>
<y>80</y>
<width>51</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;right&quot;&gt;uS&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLabel" name="topTimeLabel">
<property name="geometry">
<rect>
<x>250</x>
<y>80</y>
<width>31</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Top&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
<widget class="QSlider" name="topTime">
<property name="geometry">
<rect>
<x>310</x>
<y>80</y>
<width>101</width>
<height>20</height>
</rect>
</property>
<property name="toolTip">
<string>Horizontal top length in time units</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>30</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QLabel" name="topTimeText">
<property name="geometry">
<rect>
<x>420</x>
<y>80</y>
<width>51</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;right&quot;&gt;uS&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QComboBox" name="modulation">
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>72</width>
<height>22</height>
</rect>
</property>
<property name="toolTip">
<string>Modulation type</string>
</property>
<item>
<property name="text">
<string>FM 1</string>
</property>
</item>
<item>
<property name="text">
<string>FM 2</string>
</property>
</item>
<item>
<property name="text">
<string>AM</string>
</property>
</item>
</widget>
<widget class="QPushButton" name="reset">
<property name="geometry">
<rect>
<x>450</x>
<y>30</y>
<width>24</width>
<height>22</height>
</rect>
</property>
<property name="toolTip">
<string>Reset to default values</string>
</property>
<property name="text">
<string>R</string>
</property>
</widget>
</layout>
</widget>
</widget>
<customwidgets>
@ -450,6 +473,12 @@
<header>gui/rollupwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ValueDial</class>
<extends>QWidget</extends>
<header>gui/valuedial.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ATVScreen</class>
<extends>QWidget</extends>