1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

Massive UI revamping (v7): added channels

This commit is contained in:
f4exb 2022-04-12 16:20:45 +02:00
parent 32973132d9
commit 2f89b79c84
251 changed files with 3455 additions and 678 deletions

View File

@ -96,11 +96,12 @@ BeamSteeringCWModGUI::BeamSteeringCWModGUI(PluginAPI* pluginAPI, DeviceUISet *de
m_centerFrequency(435000000),
m_tickCount(0)
{
ui->setupUi(this);
ui->setupUi(getRollupContents());
getRollupContents()->arrangeRollups();
setAttribute(Qt::WA_DeleteOnClose, true);
setStreamIndicator("M");
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
m_bsCWSource = (BeamSteeringCWMod*) mimoChannel;
@ -127,6 +128,7 @@ BeamSteeringCWModGUI::BeamSteeringCWModGUI(PluginAPI* pluginAPI, DeviceUISet *de
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
displaySettings();
makeUIConnections();
displayRateAndShift();
applySettings(true);
}
@ -164,12 +166,13 @@ void BeamSteeringCWModGUI::displaySettings()
setTitleColor(m_settings.m_rgbColor);
setWindowTitle(m_channelMarker.getTitle());
setTitle(m_channelMarker.getTitle());
blockApplySettings(true);
ui->interpolationFactor->setCurrentIndex(m_settings.m_log2Interp);
applyInterpolation();
ui->steeringDegreesText->setText(tr("%1").arg(m_settings.m_steerDegrees));
restoreState(m_rollupState);
getRollupContents()->restoreState(m_rollupState);
blockApplySettings(false);
}
@ -212,7 +215,7 @@ void BeamSteeringCWModGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;
saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}
@ -239,6 +242,7 @@ void BeamSteeringCWModGUI::onMenuDialogCalled(const QPoint &p)
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
setWindowTitle(m_settings.m_title);
setTitle(m_channelMarker.getTitle());
setTitleColor(m_settings.m_rgbColor);
applySettings();
@ -303,3 +307,11 @@ void BeamSteeringCWModGUI::tick()
m_tickCount = 0;
}
}
void BeamSteeringCWModGUI::makeUIConnections()
{
QObject::connect(ui->channelOutput, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &BeamSteeringCWModGUI::on_channelOutput_currentIndexChanged);
QObject::connect(ui->interpolationFactor, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &BeamSteeringCWModGUI::on_interpolationFactor_currentIndexChanged);
QObject::connect(ui->position, &QSlider::valueChanged, this, &BeamSteeringCWModGUI::on_position_valueChanged);
QObject::connect(ui->steeringDegrees, &QSlider::valueChanged, this, &BeamSteeringCWModGUI::on_steeringDegrees_valueChanged);
}

View File

@ -48,6 +48,12 @@ public:
QByteArray serialize() const;
bool deserialize(const QByteArray& data);
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
virtual QString getTitle() const { return m_settings.m_title; };
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
private:
Ui::BeamSteeringCWModGUI* ui;
@ -74,6 +80,7 @@ private:
void displaySettings();
void displayRateAndShift();
bool handleMessage(const Message& message);
void makeUIConnections();
void leaveEvent(QEvent*);
void enterEvent(QEvent*);

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>BeamSteeringCWModGUI</class>
<widget class="RollupWidget" name="BeamSteeringCWModGUI">
<widget class="RollupContents" name="BeamSteeringCWModGUI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>320</width>
<height>102</height>
<width>360</width>
<height>100</height>
</rect>
</property>
<property name="sizePolicy">
@ -18,16 +18,10 @@
</property>
<property name="minimumSize">
<size>
<width>320</width>
<width>360</width>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>320</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<family>Liberation Sans</family>
@ -40,12 +34,24 @@
<widget class="QWidget" name="settingsContainer" native="true">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>301</width>
<x>0</x>
<y>0</y>
<width>358</width>
<height>91</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>358</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Settings</string>
</property>
@ -326,9 +332,9 @@
</widget>
<customwidgets>
<customwidget>
<class>RollupWidget</class>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupwidget.h</header>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
</customwidgets>

View File

@ -106,11 +106,12 @@ InterferometerGUI::InterferometerGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUI
m_centerFrequency(435000000),
m_tickCount(0)
{
ui->setupUi(this);
ui->setupUi(getRollupContents());
getRollupContents()->arrangeRollups();
setAttribute(Qt::WA_DeleteOnClose, true);
setStreamIndicator("M");
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
m_interferometer = (Interferometer*) channelMIMO;
@ -157,6 +158,7 @@ InterferometerGUI::InterferometerGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUI
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
displaySettings();
makeUIConnections();
displayRateAndShift();
applySettings(true);
}
@ -196,13 +198,14 @@ void InterferometerGUI::displaySettings()
setTitleColor(m_settings.m_rgbColor);
setWindowTitle(m_channelMarker.getTitle());
setTitle(m_channelMarker.getTitle());
blockApplySettings(true);
ui->decimationFactor->setCurrentIndex(m_settings.m_log2Decim);
applyDecimation();
ui->phaseCorrection->setValue(m_settings.m_phase);
ui->phaseCorrectionText->setText(tr("%1").arg(m_settings.m_phase));
restoreState(m_rollupState);
getRollupContents()->restoreState(m_rollupState);
blockApplySettings(false);
}
@ -247,7 +250,7 @@ void InterferometerGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;
saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}
@ -274,6 +277,7 @@ void InterferometerGUI::onMenuDialogCalled(const QPoint &p)
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
setWindowTitle(m_settings.m_title);
setTitle(m_channelMarker.getTitle());
setTitleColor(m_settings.m_rgbColor);
applySettings();
@ -338,3 +342,11 @@ void InterferometerGUI::tick()
m_tickCount = 0;
}
}
void InterferometerGUI::makeUIConnections()
{
QObject::connect(ui->decimationFactor, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &InterferometerGUI::on_decimationFactor_currentIndexChanged);
QObject::connect(ui->position, &QSlider::valueChanged, this, &InterferometerGUI::on_position_valueChanged);
QObject::connect(ui->phaseCorrection, &QSlider::valueChanged, this, &InterferometerGUI::on_phaseCorrection_valueChanged);
QObject::connect(ui->correlationType, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &InterferometerGUI::on_correlationType_currentIndexChanged);
}

View File

@ -47,6 +47,12 @@ public:
virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data);
virtual MessageQueue* getInputMessageQueue();
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
virtual QString getTitle() const { return m_settings.m_title; };
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
private:
Ui::InterferometerGUI* ui;
@ -76,6 +82,7 @@ private:
void displaySettings();
void displayRateAndShift();
bool handleMessage(const Message& message);
void makeUIConnections();
void leaveEvent(QEvent*);
void enterEvent(QEvent*);

View File

@ -1,15 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>InterferometerGUI</class>
<widget class="RollupWidget" name="InterferometerGUI">
<widget class="RollupContents" name="InterferometerGUI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>739</width>
<height>778</height>
<width>720</width>
<height>770</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>720</width>
@ -30,10 +36,16 @@
<rect>
<x>0</x>
<y>10</y>
<width>631</width>
<width>718</width>
<height>81</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>718</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Settings</string>
</property>
@ -352,9 +364,15 @@
<height>284</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>716</width>
<width>718</width>
<height>0</height>
</size>
</property>
@ -379,6 +397,12 @@
</property>
<item>
<widget class="GLSpectrum" name="glSpectrum" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
@ -407,9 +431,15 @@
<height>334</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>716</width>
<width>718</width>
<height>0</height>
</size>
</property>
@ -434,6 +464,12 @@
</property>
<item>
<widget class="GLScope" name="glScope" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
@ -456,9 +492,9 @@
</widget>
<customwidgets>
<customwidget>
<class>RollupWidget</class>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupwidget.h</header>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
<customwidget>

View File

@ -76,6 +76,7 @@ void ChannelAnalyzerGUI::displaySettings()
setTitleColor(m_settings.m_rgbColor);
setWindowTitle(m_channelMarker.getTitle());
setTitle(m_channelMarker.getTitle());
blockApplySettings(true);
@ -97,7 +98,7 @@ void ChannelAnalyzerGUI::displaySettings()
QString rolloffStr = QString::number(m_settings.m_rrcRolloff/100.0, 'f', 2);
ui->rrcRolloffText->setText(rolloffStr);
restoreState(m_rollupState);
getRollupContents()->restoreState(m_rollupState);
blockApplySettings(false);
}
@ -181,7 +182,7 @@ void ChannelAnalyzerGUI::setPLLVisibility()
else
ui->pllPskOrder->setCurrentIndex(i);
ui->pllPskOrder->blockSignals(false);
arrangeRollups();
getRollupContents()->arrangeRollups();
}
void ChannelAnalyzerGUI::setSpectrumDisplay()
@ -279,7 +280,7 @@ void ChannelAnalyzerGUI::channelMarkerChangedByCursor()
void ChannelAnalyzerGUI::channelMarkerHighlightedByCursor()
{
setHighlighted(m_channelMarker.getHighlighted());
getRollupContents()->setHighlighted(m_channelMarker.getHighlighted());
}
void ChannelAnalyzerGUI::tick()
@ -450,7 +451,7 @@ void ChannelAnalyzerGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;
saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}
@ -477,6 +478,7 @@ void ChannelAnalyzerGUI::onMenuDialogCalled(const QPoint& p)
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
setWindowTitle(m_settings.m_title);
setTitle(m_channelMarker.getTitle());
setTitleColor(m_settings.m_rgbColor);
applySettings();
@ -494,11 +496,12 @@ ChannelAnalyzerGUI::ChannelAnalyzerGUI(PluginAPI* pluginAPI, DeviceUISet *device
m_doApplySettings(true),
m_basebandSampleRate(48000)
{
ui->setupUi(this);
ui->setupUi(getRollupContents());
getRollupContents()->arrangeRollups();
m_helpURL = "plugins/channelrx/chanalyzer/readme.md";
setAttribute(Qt::WA_DeleteOnClose, true);
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
m_channelAnalyzer = (ChannelAnalyzer*) rxChannel;
@ -555,6 +558,7 @@ ChannelAnalyzerGUI::ChannelAnalyzerGUI(PluginAPI* pluginAPI, DeviceUISet *device
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
displaySettings();
makeUIConnections();
applySettings(true);
}
@ -681,3 +685,21 @@ void ChannelAnalyzerGUI::enterEvent(QEvent*)
m_channelMarker.setHighlighted(true);
}
void ChannelAnalyzerGUI::makeUIConnections()
{
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &ChannelAnalyzerGUI::on_deltaFrequency_changed);
QObject::connect(ui->rationalDownSamplerRate, &ValueDial::changed, this, &ChannelAnalyzerGUI::on_rationalDownSamplerRate_changed);
QObject::connect(ui->pll, &QToolButton::toggled, this, &ChannelAnalyzerGUI::on_pll_toggled);
QObject::connect(ui->pllType, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ChannelAnalyzerGUI::on_pllType_currentIndexChanged);
QObject::connect(ui->pllPskOrder, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ChannelAnalyzerGUI::on_pllPskOrder_currentIndexChanged);
QObject::connect(ui->pllBandwidth, &QDial::valueChanged, this, &ChannelAnalyzerGUI::on_pllBandwidth_valueChanged);
QObject::connect(ui->pllDampingFactor, &QDial::valueChanged, this, &ChannelAnalyzerGUI::on_pllDampingFactor_valueChanged);
QObject::connect(ui->pllLoopGain, &QDial::valueChanged, this, &ChannelAnalyzerGUI::on_pllLoopGain_valueChanged);
QObject::connect(ui->useRationalDownsampler, &ButtonSwitch::toggled, this, &ChannelAnalyzerGUI::on_useRationalDownsampler_toggled);
QObject::connect(ui->signalSelect, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ChannelAnalyzerGUI::on_signalSelect_currentIndexChanged);
QObject::connect(ui->rrcFilter, &ButtonSwitch::toggled, this, &ChannelAnalyzerGUI::on_rrcFilter_toggled);
QObject::connect(ui->rrcRolloff, &QDial::valueChanged, this, &ChannelAnalyzerGUI::on_rrcRolloff_valueChanged);
QObject::connect(ui->BW, &QSlider::valueChanged, this, &ChannelAnalyzerGUI::on_BW_valueChanged);
QObject::connect(ui->lowCut, &QSlider::valueChanged, this, &ChannelAnalyzerGUI::on_lowCut_valueChanged);
QObject::connect(ui->ssb, &QCheckBox::toggled, this, &ChannelAnalyzerGUI::on_ssb_toggled);
}

View File

@ -49,6 +49,12 @@ public:
QByteArray serialize() const;
bool deserialize(const QByteArray& data);
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
virtual QString getTitle() const { return m_settings.m_title; };
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
public slots:
void channelMarkerChangedByCursor();
@ -84,6 +90,7 @@ private:
void setPLLVisibility();
void setSpectrumDisplay();
bool handleMessage(const Message& message);
void makeUIConnections();
void leaveEvent(QEvent*);
void enterEvent(QEvent*);

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ChannelAnalyzerGUI</class>
<widget class="RollupWidget" name="ChannelAnalyzerGUI">
<widget class="RollupContents" name="ChannelAnalyzerGUI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>739</width>
<width>720</width>
<height>778</height>
</rect>
</property>
@ -36,10 +36,16 @@
<rect>
<x>0</x>
<y>0</y>
<width>524</width>
<width>718</width>
<height>101</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>718</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Settings</string>
</property>
@ -861,9 +867,15 @@
<height>284</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>716</width>
<width>718</width>
<height>0</height>
</size>
</property>
@ -888,6 +900,12 @@
</property>
<item>
<widget class="GLSpectrum" name="glSpectrum" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
@ -916,9 +934,15 @@
<height>334</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>716</width>
<width>718</width>
<height>0</height>
</size>
</property>
@ -943,6 +967,12 @@
</property>
<item>
<widget class="GLScope" name="glScope" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
@ -965,9 +995,20 @@
</widget>
<customwidgets>
<customwidget>
<class>RollupWidget</class>
<class>ValueDial</class>
<extends>QWidget</extends>
<header>gui/rollupwidget.h</header>
<header>gui/valuedial.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
<customwidget>
@ -976,23 +1017,6 @@
<header>gui/valuedialz.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>GLScope</class>
<extends>QWidget</extends>
<header>gui/glscope.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>GLScopeGUI</class>
<extends>QWidget</extends>
<header>gui/glscopegui.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>GLSpectrum</class>
<extends>QWidget</extends>
@ -1006,9 +1030,15 @@
<container>1</container>
</customwidget>
<customwidget>
<class>ValueDial</class>
<class>GLScope</class>
<extends>QWidget</extends>
<header>gui/valuedial.h</header>
<header>gui/glscope.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>GLScopeGUI</class>
<extends>QWidget</extends>
<header>gui/glscopegui.h</header>
<container>1</container>
</customwidget>
</customwidgets>

View File

@ -59,6 +59,7 @@ void ChannelAnalyzerSettings::resetToDefaults()
m_reverseAPIPort = 8888;
m_reverseAPIDeviceIndex = 0;
m_reverseAPIChannelIndex = 0;
m_workspaceIndex = 0;
}
QByteArray ChannelAnalyzerSettings::serialize() const
@ -105,6 +106,8 @@ QByteArray ChannelAnalyzerSettings::serialize() const
s.writeU32(26, m_reverseAPIDeviceIndex);
s.writeU32(27, m_reverseAPIChannelIndex);
s.writeS32(28, m_streamIndex);
s.writeS32(29, m_workspaceIndex);
s.writeString(30, m_geometryBytes);
return s.final();
}
@ -179,6 +182,8 @@ bool ChannelAnalyzerSettings::deserialize(const QByteArray& data)
d.readU32(27, &utmp, 0);
m_reverseAPIChannelIndex = utmp > 99 ? 99 : utmp;
d.readS32(28, &m_streamIndex, 0);
d.readS32(29, &m_workspaceIndex, 0);
d.readBlob(30, &m_geometryBytes);
return true;
}

View File

@ -60,6 +60,8 @@ struct ChannelAnalyzerSettings
uint16_t m_reverseAPIPort;
uint16_t m_reverseAPIDeviceIndex;
uint16_t m_reverseAPIChannelIndex;
int m_workspaceIndex;
QByteArray m_geometryBytes;
ChannelAnalyzerSettings();
void resetToDefaults();

View File

@ -2143,7 +2143,7 @@ if (DSPSignalNotification::match(message))
} else {
ui->warning->setText("");
}
arrangeRollups();
getRollupContents()->arrangeRollups();
return true;
}
else if (ADSBDemodReport::MsgReportADSB::match(message))
@ -2204,7 +2204,7 @@ void ADSBDemodGUI::channelMarkerChangedByCursor()
void ADSBDemodGUI::channelMarkerHighlightedByCursor()
{
setHighlighted(m_channelMarker.getHighlighted());
getRollupContents()->setHighlighted(m_channelMarker.getHighlighted());
}
void ADSBDemodGUI::on_deltaFrequency_changed(qint64 value)
@ -2759,7 +2759,7 @@ void ADSBDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;
saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}
@ -2786,6 +2786,7 @@ void ADSBDemodGUI::onMenuDialogCalled(const QPoint &p)
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
setWindowTitle(m_settings.m_title);
setTitle(m_channelMarker.getTitle());
setTitleColor(m_settings.m_rgbColor);
applySettings();
@ -3684,7 +3685,8 @@ ADSBDemodGUI::ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb
m_highlightAircraft(nullptr),
m_progressDialog(nullptr)
{
ui->setupUi(this);
ui->setupUi(getRollupContents());
getRollupContents()->arrangeRollups();
m_helpURL = "plugins/channelrx/demodadsb/readme.md";
m_osmPort = 0; // Pick a free port
@ -3698,7 +3700,7 @@ ADSBDemodGUI::ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb
setAttribute(Qt::WA_DeleteOnClose, true);
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
connect(&m_dlm, &HttpDownloadManager::downloadComplete, this, &ADSBDemodGUI::downloadFinished);
@ -3829,6 +3831,7 @@ ADSBDemodGUI::ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb
updateDeviceSetList();
displaySettings();
makeUIConnections();
applySettings(true);
connect(&m_importTimer, &QTimer::timeout, this, &ADSBDemodGUI::import);
@ -3903,6 +3906,7 @@ void ADSBDemodGUI::displaySettings()
setTitleColor(m_settings.m_rgbColor);
setWindowTitle(m_channelMarker.getTitle());
setTitle(m_channelMarker.getTitle());
blockApplySettings(true);
@ -3989,7 +3993,7 @@ void ADSBDemodGUI::displaySettings()
applyMapSettings();
applyImportSettings();
restoreState(m_rollupState);
getRollupContents()->restoreState(m_rollupState);
blockApplySettings(false);
}
@ -4659,3 +4663,31 @@ void ADSBDemodGUI::preferenceChanged(int elementType)
}
}
}
void ADSBDemodGUI::makeUIConnections()
{
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &ADSBDemodGUI::on_deltaFrequency_changed);
QObject::connect(ui->rfBW, &QSlider::valueChanged, this, &ADSBDemodGUI::on_rfBW_valueChanged);
QObject::connect(ui->threshold, &QDial::valueChanged, this, &ADSBDemodGUI::on_threshold_valueChanged);
QObject::connect(ui->phaseSteps, &QDial::valueChanged, this, &ADSBDemodGUI::on_phaseSteps_valueChanged);
QObject::connect(ui->tapsPerPhase, &QDial::valueChanged, this, &ADSBDemodGUI::on_tapsPerPhase_valueChanged);
QObject::connect(ui->adsbData, &QTableWidget::cellClicked, this, &ADSBDemodGUI::on_adsbData_cellClicked);
QObject::connect(ui->adsbData, &QTableWidget::cellDoubleClicked, this, &ADSBDemodGUI::on_adsbData_cellDoubleClicked);
QObject::connect(ui->spb, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ADSBDemodGUI::on_spb_currentIndexChanged);
QObject::connect(ui->correlateFullPreamble, &ButtonSwitch::clicked, this, &ADSBDemodGUI::on_correlateFullPreamble_clicked);
QObject::connect(ui->demodModeS, &ButtonSwitch::clicked, this, &ADSBDemodGUI::on_demodModeS_clicked);
QObject::connect(ui->feed, &ButtonSwitch::clicked, this, &ADSBDemodGUI::on_feed_clicked);
QObject::connect(ui->notifications, &QToolButton::clicked, this, &ADSBDemodGUI::on_notifications_clicked);
QObject::connect(ui->flightInfo, &QToolButton::clicked, this, &ADSBDemodGUI::on_flightInfo_clicked);
QObject::connect(ui->findOnMapFeature, &QToolButton::clicked, this, &ADSBDemodGUI::on_findOnMapFeature_clicked);
QObject::connect(ui->getOSNDB, &QToolButton::clicked, this, &ADSBDemodGUI::on_getOSNDB_clicked);
QObject::connect(ui->getAirportDB, &QToolButton::clicked, this, &ADSBDemodGUI::on_getAirportDB_clicked);
QObject::connect(ui->getAirspacesDB, &QToolButton::clicked, this, &ADSBDemodGUI::on_getAirspacesDB_clicked);
QObject::connect(ui->flightPaths, &ButtonSwitch::clicked, this, &ADSBDemodGUI::on_flightPaths_clicked);
QObject::connect(ui->allFlightPaths, &ButtonSwitch::clicked, this, &ADSBDemodGUI::on_allFlightPaths_clicked);
QObject::connect(ui->device, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ADSBDemodGUI::on_device_currentIndexChanged);
QObject::connect(ui->displaySettings, &QToolButton::clicked, this, &ADSBDemodGUI::on_displaySettings_clicked);
QObject::connect(ui->logEnable, &ButtonSwitch::clicked, this, &ADSBDemodGUI::on_logEnable_clicked);
QObject::connect(ui->logFilename, &QToolButton::clicked, this, &ADSBDemodGUI::on_logFilename_clicked);
QObject::connect(ui->logOpen, &QToolButton::clicked, this, &ADSBDemodGUI::on_logOpen_clicked);
}

View File

@ -752,6 +752,13 @@ public:
QByteArray serialize() const;
bool deserialize(const QByteArray& data);
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
virtual QString getTitle() const { return m_settings.m_title; };
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
void highlightAircraft(Aircraft *aircraft);
void targetAircraft(Aircraft *aircraft);
void target(const QString& name, float az, float el, float range);
@ -838,6 +845,8 @@ private:
void displaySettings();
void displayStreamIndex();
bool handleMessage(const Message& message);
void makeUIConnections();
void updatePosition(Aircraft *aircraft);
bool updateLocalPosition(Aircraft *aircraft, double latitude, double longitude, bool surfacePosition);
void sendToMap(Aircraft *aircraft, QList<SWGSDRangel::SWGMapAnimation *> *animations);

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ADSBDemodGUI</class>
<widget class="RollupWidget" name="ADSBDemodGUI">
<widget class="RollupContents" name="ADSBDemodGUI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>604</width>
<width>600</width>
<height>1046</height>
</rect>
</property>
@ -18,7 +18,7 @@
</property>
<property name="minimumSize">
<size>
<width>350</width>
<width>600</width>
<height>0</height>
</size>
</property>
@ -35,13 +35,13 @@
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<width>598</width>
<height>141</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>600</width>
<width>598</width>
<height>0</height>
</size>
</property>
@ -758,7 +758,7 @@
<rect>
<x>0</x>
<y>140</y>
<width>600</width>
<width>598</width>
<height>600</height>
</rect>
</property>
@ -770,7 +770,7 @@
</property>
<property name="minimumSize">
<size>
<width>600</width>
<width>598</width>
<height>0</height>
</size>
</property>
@ -1269,17 +1269,17 @@
<extends>QWidget</extends>
<header location="global">QtQuickWidgets/QQuickWidget</header>
</customwidget>
<customwidget>
<class>RollupWidget</class>
<extends>QWidget</extends>
<header>gui/rollupwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ValueDialZ</class>
<extends>QWidget</extends>

View File

@ -96,6 +96,7 @@ void ADSBDemodSettings::resetToDefaults()
m_displayPhotos = true;
m_verboseModelMatching = false;
m_airfieldElevation = 0;
m_workspaceIndex = 0;
}
QByteArray ADSBDemodSettings::serialize() const
@ -172,6 +173,8 @@ QByteArray ADSBDemodSettings::serialize() const
s.writeString(56, m_importMaxLatitude);
s.writeString(57, m_importMinLongitude);
s.writeString(58, m_importMaxLongitude);
s.writeS32(59, m_workspaceIndex);
s.writeBlob(60, m_geometryBytes);
for (int i = 0; i < ADSBDEMOD_COLUMNS; i++) {
s.writeS32(100 + i, m_columnIndexes[i]);
@ -298,6 +301,8 @@ bool ADSBDemodSettings::deserialize(const QByteArray& data)
d.readString(56, &m_importMaxLatitude, "");
d.readString(57, &m_importMinLongitude, "");
d.readString(58, &m_importMaxLongitude, "");
d.readS32(59, &m_workspaceIndex, 0);
d.readBlob(60, &m_geometryBytes);
for (int i = 0; i < ADSBDEMOD_COLUMNS; i++) {
d.readS32(100 + i, &m_columnIndexes[i], i);

View File

@ -116,6 +116,8 @@ struct ADSBDemodSettings
uint16_t m_reverseAPIPort;
uint16_t m_reverseAPIDeviceIndex;
uint16_t m_reverseAPIChannelIndex;
int m_workspaceIndex;
QByteArray m_geometryBytes;
int m_columnIndexes[ADSBDEMOD_COLUMNS];//!< How the columns are ordered in the table
int m_columnSizes[ADSBDEMOD_COLUMNS]; //!< Size of the coumns in the table

View File

@ -243,7 +243,7 @@ void AISDemodGUI::channelMarkerChangedByCursor()
void AISDemodGUI::channelMarkerHighlightedByCursor()
{
setHighlighted(m_channelMarker.getHighlighted());
getRollupContents()->setHighlighted(m_channelMarker.getHighlighted());
}
void AISDemodGUI::on_deltaFrequency_changed(qint64 value)
@ -371,7 +371,7 @@ void AISDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
}
}
saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}
@ -397,6 +397,7 @@ void AISDemodGUI::onMenuDialogCalled(const QPoint &p)
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
setWindowTitle(m_settings.m_title);
setTitle(m_channelMarker.getTitle());
setTitleColor(m_settings.m_rgbColor);
applySettings();
@ -428,11 +429,12 @@ AISDemodGUI::AISDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_doApplySettings(true),
m_tickCount(0)
{
ui->setupUi(this);
ui->setupUi(getRollupContents());
getRollupContents()->arrangeRollups();
m_helpURL = "plugins/channelrx/demodais/readme.md";
setAttribute(Qt::WA_DeleteOnClose, true);
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
m_aisDemod = reinterpret_cast<AISDemod*>(rxChannel);
@ -518,6 +520,7 @@ AISDemodGUI::AISDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
ui->scopeContainer->setVisible(false);
displaySettings();
makeUIConnections();
applySettings(true);
}
@ -569,6 +572,7 @@ void AISDemodGUI::displaySettings()
setTitleColor(m_settings.m_rgbColor);
setWindowTitle(m_channelMarker.getTitle());
setTitle(m_channelMarker.getTitle());
blockApplySettings(true);
@ -612,7 +616,7 @@ void AISDemodGUI::displaySettings()
filter();
restoreState(m_rollupState);
getRollupContents()->restoreState(m_rollupState);
blockApplySettings(false);
}
@ -756,3 +760,21 @@ void AISDemodGUI::on_logOpen_clicked()
}
}
}
void AISDemodGUI::makeUIConnections()
{
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &AISDemodGUI::on_deltaFrequency_changed);
QObject::connect(ui->rfBW, &QSlider::valueChanged, this, &AISDemodGUI::on_rfBW_valueChanged);
QObject::connect(ui->fmDev, &QSlider::valueChanged, this, &AISDemodGUI::on_fmDev_valueChanged);
QObject::connect(ui->threshold, &QDial::valueChanged, this, &AISDemodGUI::on_threshold_valueChanged);
QObject::connect(ui->filterMMSI, &QLineEdit::editingFinished, this, &AISDemodGUI::on_filterMMSI_editingFinished);
QObject::connect(ui->clearTable, &QPushButton::clicked, this, &AISDemodGUI::on_clearTable_clicked);
QObject::connect(ui->udpEnabled, &QCheckBox::clicked, this, &AISDemodGUI::on_udpEnabled_clicked);
QObject::connect(ui->udpAddress, &QLineEdit::editingFinished, this, &AISDemodGUI::on_udpAddress_editingFinished);
QObject::connect(ui->udpPort, &QLineEdit::editingFinished, this, &AISDemodGUI::on_udpPort_editingFinished);
QObject::connect(ui->udpFormat, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &AISDemodGUI::on_udpFormat_currentIndexChanged);
QObject::connect(ui->messages, &QTableWidget::cellDoubleClicked, this, &AISDemodGUI::on_messages_cellDoubleClicked);
QObject::connect(ui->logEnable, &ButtonSwitch::clicked, this, &AISDemodGUI::on_logEnable_clicked);
QObject::connect(ui->logFilename, &QToolButton::clicked, this, &AISDemodGUI::on_logFilename_clicked);
QObject::connect(ui->logOpen, &QToolButton::clicked, this, &AISDemodGUI::on_logOpen_clicked);
}

View File

@ -58,6 +58,12 @@ public:
QByteArray serialize() const;
bool deserialize(const QByteArray& data);
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
virtual QString getTitle() const { return m_settings.m_title; };
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
public slots:
void channelMarkerChangedByCursor();
@ -89,6 +95,7 @@ private:
void displayStreamIndex();
void messageReceived(const QByteArray& message, const QDateTime& dateTime);
bool handleMessage(const Message& message);
void makeUIConnections();
void leaveEvent(QEvent*);
void enterEvent(QEvent*);

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AISDemodGUI</class>
<widget class="RollupWidget" name="AISDemodGUI">
<widget class="RollupContents" name="AISDemodGUI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>404</width>
<height>764</height>
<width>388</width>
<height>446</height>
</rect>
</property>
<property name="sizePolicy">
@ -912,9 +912,14 @@
</widget>
<customwidgets>
<customwidget>
<class>RollupWidget</class>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupwidget.h</header>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
<customwidget>
@ -929,11 +934,6 @@
<header>gui/levelmeter.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>GLScope</class>
<extends>QWidget</extends>

View File

@ -55,6 +55,7 @@ void AISDemodSettings::resetToDefaults()
m_reverseAPIPort = 8888;
m_reverseAPIDeviceIndex = 0;
m_reverseAPIChannelIndex = 0;
m_workspaceIndex = 0;
for (int i = 0; i < AISDEMOD_MESSAGE_COLUMNS; i++)
{
@ -100,6 +101,9 @@ QByteArray AISDemodSettings::serialize() const
s.writeBlob(25, m_rollupState->serialize());
}
s.writeS32(26, m_workspaceIndex);
s.writeBlob(27, m_geometryBytes);
for (int i = 0; i < AISDEMOD_MESSAGE_COLUMNS; i++)
s.writeS32(100 + i, m_messageColumnIndexes[i]);
for (int i = 0; i < AISDEMOD_MESSAGE_COLUMNS; i++)
@ -183,6 +187,9 @@ bool AISDemodSettings::deserialize(const QByteArray& data)
m_rollupState->deserialize(bytetmp);
}
d.readS32(26, &m_workspaceIndex, 0);
d.readBlob(27, &m_geometryBytes);
for (int i = 0; i < AISDEMOD_MESSAGE_COLUMNS; i++) {
d.readS32(100 + i, &m_messageColumnIndexes[i], i);
}

View File

@ -61,6 +61,8 @@ struct AISDemodSettings
uint16_t m_reverseAPIChannelIndex;
Serializable *m_scopeGUI;
Serializable *m_rollupState;
int m_workspaceIndex;
QByteArray m_geometryBytes;
int m_messageColumnIndexes[AISDEMOD_MESSAGE_COLUMNS];//!< How the columns are ordered in the table
int m_messageColumnSizes[AISDEMOD_MESSAGE_COLUMNS]; //!< Size of the columns in the table

View File

@ -111,7 +111,7 @@ void AMDemodGUI::channelMarkerChangedByCursor()
void AMDemodGUI::channelMarkerHighlightedByCursor()
{
setHighlighted(m_channelMarker.getHighlighted());
getRollupContents()->setHighlighted(m_channelMarker.getHighlighted());
}
void AMDemodGUI::on_deltaFrequency_changed(qint64 value)
@ -182,7 +182,7 @@ void AMDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
m_nfmDemod->setSpectrum(m_threadedSampleSink->getMessageQueue(), rollDown);
*/
saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}
@ -209,6 +209,7 @@ void AMDemodGUI::onMenuDialogCalled(const QPoint &p)
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
setWindowTitle(m_settings.m_title);
setTitle(m_channelMarker.getTitle());
setTitleColor(m_settings.m_rgbColor);
applySettings();
@ -243,10 +244,11 @@ AMDemodGUI::AMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandS
m_samUSB(true),
m_tickCount(0)
{
ui->setupUi(this);
ui->setupUi(getRollupContents());
getRollupContents()->arrangeRollups();
m_helpURL = "plugins/channelrx/demodam/readme.md";
setAttribute(Qt::WA_DeleteOnClose, true);
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
m_amDemod = reinterpret_cast<AMDemod*>(rxChannel);
@ -290,6 +292,7 @@ AMDemodGUI::AMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandS
m_iconDSBLSB.addPixmap(QPixmap("://lsb.png"), QIcon::Normal, QIcon::On);
displaySettings();
makeUIConnections();
applySettings(true);
}
@ -323,6 +326,7 @@ void AMDemodGUI::displaySettings()
setTitleColor(m_settings.m_rgbColor);
setWindowTitle(m_channelMarker.getTitle());
setTitle(m_channelMarker.getTitle());
blockApplySettings(true);
@ -373,7 +377,7 @@ void AMDemodGUI::displaySettings()
displayStreamIndex();
restoreState(m_rollupState);
getRollupContents()->restoreState(m_rollupState);
blockApplySettings(false);
}
@ -478,3 +482,14 @@ void AMDemodGUI::tick()
m_tickCount++;
}
void AMDemodGUI::makeUIConnections()
{
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &AMDemodGUI::on_deltaFrequency_changed);
QObject::connect(ui->pll, &QToolButton::toggled, this, &AMDemodGUI::on_pll_toggled);
QObject::connect(ui->ssb, &QToolButton::toggled, this, &AMDemodGUI::on_ssb_toggled);
QObject::connect(ui->bandpassEnable, &ButtonSwitch::toggled, this, &AMDemodGUI::on_bandpassEnable_toggled);
QObject::connect(ui->rfBW, &QSlider::valueChanged, this, &AMDemodGUI::on_rfBW_valueChanged);
QObject::connect(ui->volume, &QSlider::valueChanged, this, &AMDemodGUI::on_volume_valueChanged);
QObject::connect(ui->squelch, &QSlider::valueChanged, this, &AMDemodGUI::on_squelch_valueChanged);
QObject::connect(ui->audioMute, &QToolButton::toggled, this, &AMDemodGUI::on_audioMute_toggled);
}

View File

@ -31,6 +31,12 @@ public:
QByteArray serialize() const;
bool deserialize(const QByteArray& data);
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
virtual QString getTitle() const { return m_settings.m_title; };
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
public slots:
void channelMarkerChangedByCursor();
@ -63,6 +69,7 @@ private:
void displaySettings();
void displayStreamIndex();
bool handleMessage(const Message& message);
void makeUIConnections();
void leaveEvent(QEvent*);
void enterEvent(QEvent*);

View File

@ -1,24 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AMDemodGUI</class>
<widget class="RollupWidget" name="AMDemodGUI">
<widget class="RollupContents" name="AMDemodGUI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>396</width>
<height>170</height>
<width>360</width>
<height>153</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>352</width>
<width>360</width>
<height>0</height>
</size>
</property>
@ -39,13 +39,13 @@
<rect>
<x>0</x>
<y>0</y>
<width>390</width>
<height>131</height>
<width>358</width>
<height>151</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>350</width>
<width>358</width>
<height>0</height>
</size>
</property>
@ -428,9 +428,20 @@
</widget>
<customwidgets>
<customwidget>
<class>RollupWidget</class>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupwidget.h</header>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ValueDialZ</class>
<extends>QWidget</extends>
<header>gui/valuedialz.h</header>
<container>1</container>
</customwidget>
<customwidget>
@ -439,17 +450,6 @@
<header>gui/levelmeter.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>ValueDialZ</class>
<extends>QWidget</extends>
<header>gui/valuedialz.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../../../sdrgui/resources/res.qrc"/>

View File

@ -49,6 +49,7 @@ void AMDemodSettings::resetToDefaults()
m_reverseAPIPort = 8888;
m_reverseAPIDeviceIndex = 0;
m_reverseAPIChannelIndex = 0;
m_workspaceIndex = 0;
}
QByteArray AMDemodSettings::serialize() const
@ -80,6 +81,9 @@ QByteArray AMDemodSettings::serialize() const
s.writeBlob(19, m_rollupState->serialize());
}
s.writeS32(20, m_workspaceIndex);
s.writeBlob(21, m_geometryBytes);
return s.final();
}
@ -143,6 +147,9 @@ bool AMDemodSettings::deserialize(const QByteArray& data)
m_rollupState->deserialize(bytetmp);
}
d.readS32(20, &m_workspaceIndex, 0);
d.readBlob(21, &m_geometryBytes);
return true;
}
else

View File

@ -50,6 +50,8 @@ struct AMDemodSettings
uint16_t m_reverseAPIDeviceIndex;
uint16_t m_reverseAPIChannelIndex;
Serializable *m_rollupState;
int m_workspaceIndex;
QByteArray m_geometryBytes;
AMDemodSettings();
void resetToDefaults();

View File

@ -303,7 +303,7 @@ void APTDemodGUI::channelMarkerChangedByCursor()
void APTDemodGUI::channelMarkerHighlightedByCursor()
{
setHighlighted(m_channelMarker.getHighlighted());
getRollupContents()->setHighlighted(m_channelMarker.getHighlighted());
}
void APTDemodGUI::on_deltaFrequency_changed(qint64 value)
@ -527,7 +527,7 @@ void APTDemodGUI::on_zoomAll_clicked(bool checked)
}
}
void APTDemodGUI::on_image_zoomed()
void APTDemodGUI::onImageZoomed()
{
ui->zoomAll->setChecked(false);
}
@ -537,7 +537,7 @@ void APTDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;
saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}
@ -563,6 +563,7 @@ void APTDemodGUI::onMenuDialogCalled(const QPoint &p)
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
setWindowTitle(m_settings.m_title);
setTitle(m_channelMarker.getTitle());
setTitleColor(m_settings.m_rgbColor);
applySettings();
@ -596,11 +597,12 @@ APTDemodGUI::APTDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_scene(nullptr),
m_pixmapItem(nullptr)
{
ui->setupUi(this);
ui->setupUi(getRollupContents());
getRollupContents()->arrangeRollups();
m_helpURL = "plugins/channelrx/demodapt/readme.md";
setAttribute(Qt::WA_DeleteOnClose, true);
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
m_aptDemod = reinterpret_cast<APTDemod*>(rxChannel);
@ -633,7 +635,7 @@ APTDemodGUI::APTDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
m_zoom = new GraphicsViewZoom(ui->image); // Deleted automatically when view is deleted
connect(m_zoom, SIGNAL(zoomed()), this, SLOT(on_image_zoomed()));
connect(m_zoom, SIGNAL(zoomed()), this, SLOT(onImageZoomed()));
// Create slightly transparent white background so labels can be seen
m_tempScale = new TempScale();
@ -658,6 +660,7 @@ APTDemodGUI::APTDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_scene->installEventFilter(this);
displaySettings();
makeUIConnections();
applySettings(true);
}
@ -740,6 +743,7 @@ void APTDemodGUI::displaySettings()
setTitleColor(m_settings.m_rgbColor);
setWindowTitle(m_channelMarker.getTitle());
setTitle(m_channelMarker.getTitle());
blockApplySettings(true);
@ -774,7 +778,7 @@ void APTDemodGUI::displaySettings()
displayLabels();
displayStreamIndex();
restoreState(m_rollupState);
getRollupContents()->restoreState(m_rollupState);
blockApplySettings(false);
}
@ -882,3 +886,29 @@ void APTDemodGUI::deleteImageFromMap(const QString &name)
messageQueue->push(msg);
}
}
void APTDemodGUI::makeUIConnections()
{
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &APTDemodGUI::on_deltaFrequency_changed);
QObject::connect(ui->rfBW, &QSlider::valueChanged, this, &APTDemodGUI::on_rfBW_valueChanged);
QObject::connect(ui->fmDev, &QSlider::valueChanged, this, &APTDemodGUI::on_fmDev_valueChanged);
QObject::connect(ui->channels, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &APTDemodGUI::on_channels_currentIndexChanged);
QObject::connect(ui->transparencyThreshold, &QDial::valueChanged, this, &APTDemodGUI::on_transparencyThreshold_valueChanged);
QObject::connect(ui->transparencyThreshold, &QDial::sliderReleased, this, &APTDemodGUI::on_transparencyThreshold_sliderReleased);
QObject::connect(ui->opacityThreshold, &QDial::valueChanged, this, &APTDemodGUI::on_opacityThreshold_valueChanged);
QObject::connect(ui->opacityThreshold, &QDial::sliderReleased, this, &APTDemodGUI::on_opacityThreshold_sliderReleased);
QObject::connect(ui->deleteImageFromMap, &QToolButton::clicked, this, &APTDemodGUI::on_deleteImageFromMap_clicked);
QObject::connect(ui->cropNoise, &ButtonSwitch::clicked, this, &APTDemodGUI::on_cropNoise_clicked);
QObject::connect(ui->denoise, &ButtonSwitch::clicked, this, &APTDemodGUI::on_denoise_clicked);
QObject::connect(ui->linear, &ButtonSwitch::clicked, this, &APTDemodGUI::on_linear_clicked);
QObject::connect(ui->histogram, &ButtonSwitch::clicked, this, &APTDemodGUI::on_histogram_clicked);
QObject::connect(ui->precipitation, &ButtonSwitch::clicked, this, &APTDemodGUI::on_precipitation_clicked);
QObject::connect(ui->flip, &ButtonSwitch::clicked, this, &APTDemodGUI::on_flip_clicked);
QObject::connect(ui->startStop, &ButtonSwitch::clicked, this, &APTDemodGUI::on_startStop_clicked);
QObject::connect(ui->showSettings, &QToolButton::clicked, this, &APTDemodGUI::on_showSettings_clicked);
QObject::connect(ui->resetDecoder, &QToolButton::clicked, this, &APTDemodGUI::on_resetDecoder_clicked);
QObject::connect(ui->saveImage, &QToolButton::clicked, this, &APTDemodGUI::on_saveImage_clicked);
QObject::connect(ui->zoomIn, &QToolButton::clicked, this, &APTDemodGUI::on_zoomIn_clicked);
QObject::connect(ui->zoomOut, &QToolButton::clicked, this, &APTDemodGUI::on_zoomOut_clicked);
QObject::connect(ui->zoomAll, &ButtonSwitch::clicked, this, &APTDemodGUI::on_zoomAll_clicked);
}

View File

@ -75,6 +75,12 @@ public:
bool deserialize(const QByteArray& data);
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
virtual bool eventFilter(QObject *watched, QEvent *event) override;
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
virtual QString getTitle() const { return m_settings.m_title; };
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
public slots:
void channelMarkerChangedByCursor();
@ -115,6 +121,8 @@ private:
void displayLabels();
void displayStreamIndex();
bool handleMessage(const Message& message);
void makeUIConnections();
void deleteImageFromMap(const QString &name);
void resetDecoder();
@ -144,7 +152,7 @@ private slots:
void on_zoomIn_clicked();
void on_zoomOut_clicked();
void on_zoomAll_clicked(bool checked=false);
void on_image_zoomed();
void onImageZoomed();
void onWidgetRolled(QWidget* widget, bool rollDown);
void onMenuDialogCalled(const QPoint& p);
void handleInputMessages();

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>APTDemodGUI</class>
<widget class="RollupWidget" name="APTDemodGUI">
<widget class="RollupContents" name="APTDemodGUI">
<property name="geometry">
<rect>
<x>0</x>
@ -803,9 +803,9 @@
</widget>
<customwidgets>
<customwidget>
<class>RollupWidget</class>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupwidget.h</header>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
<customwidget>

View File

@ -69,6 +69,7 @@ void APTDemodSettings::resetToDefaults()
m_reverseAPIPort = 8888;
m_reverseAPIDeviceIndex = 0;
m_reverseAPIChannelIndex = 0;
m_workspaceIndex = 0;
}
QByteArray APTDemodSettings::serialize() const
@ -120,6 +121,8 @@ QByteArray APTDemodSettings::serialize() const
s.writeS32(36, m_verticalPixelsPerDegree);
s.writeFloat(37, m_satTimeOffset);
s.writeFloat(38, m_satYaw);
s.writeS32(39, m_workspaceIndex);
s.writeBlob(40, m_geometryBytes);
return s.final();
}
@ -201,6 +204,8 @@ bool APTDemodSettings::deserialize(const QByteArray& data)
d.readS32(36, &m_verticalPixelsPerDegree, 20);
d.readFloat(37, &m_satTimeOffset, 0.0f);
d.readFloat(38, &m_satYaw, 0.0f);
d.readS32(39, &m_workspaceIndex, 0);
d.readBlob(40, &m_geometryBytes);
return true;
}

View File

@ -66,6 +66,8 @@ struct APTDemodSettings
uint16_t m_reverseAPIDeviceIndex;
uint16_t m_reverseAPIChannelIndex;
Serializable *m_rollupState;
int m_workspaceIndex;
QByteArray m_geometryBytes;
// The following are really working state, rather than settings
QString m_tle; // Satelite two-line elements, from satellite tracker

View File

@ -86,6 +86,7 @@ void ATVDemodGUI::displaySettings()
setTitleColor(m_settings.m_rgbColor);
setWindowTitle(m_channelMarker.getTitle());
setTitle(m_channelMarker.getTitle());
displayStreamIndex();
m_doApplySettings = false;
@ -119,7 +120,7 @@ void ATVDemodGUI::displaySettings()
ui->amScaleOffsetText->setText(QString("%1").arg(m_settings.m_amOffsetFactor));
applySampleRate();
restoreState(m_rollupState);
getRollupContents()->restoreState(m_rollupState);
m_doApplySettings = true;
}
@ -187,7 +188,7 @@ void ATVDemodGUI::channelMarkerChangedByCursor()
void ATVDemodGUI::channelMarkerHighlightedByCursor()
{
setHighlighted(m_channelMarker.getHighlighted());
getRollupContents()->setHighlighted(m_channelMarker.getHighlighted());
}
void ATVDemodGUI::handleSourceMessages()
@ -208,7 +209,7 @@ void ATVDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;
saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}
@ -222,10 +223,11 @@ ATVDemodGUI::ATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, Base
m_intTickCount(0),
m_basebandSampleRate(48000)
{
ui->setupUi(this);
ui->setupUi(getRollupContents());
getRollupContents()->arrangeRollups();
m_helpURL = "plugins/channelrx/demodatv/readme.md";
setAttribute(Qt::WA_DeleteOnClose, true);
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
m_atvDemod = (ATVDemod*) rxChannel;
m_atvDemod->setMessageQueueToGUI(getInputMessageQueue());
@ -278,6 +280,8 @@ ATVDemodGUI::ATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, Base
QChar delta = QChar(0x94, 0x03);
ui->fmDeviationLabel->setText(delta);
makeUIConnections();
}
ATVDemodGUI::~ATVDemodGUI()
@ -564,3 +568,27 @@ void ATVDemodGUI::topTimeUpdate()
else
ui->topTimeText->setText(tr("%1 s").arg(nominalTopTime * 1.0, 0, 'f', 2));
}
void ATVDemodGUI::makeUIConnections()
{
QObject::connect(ui->synchLevel, &QSlider::valueChanged, this, &ATVDemodGUI::on_synchLevel_valueChanged);
QObject::connect(ui->blackLevel, &QSlider::valueChanged, this, &ATVDemodGUI::on_blackLevel_valueChanged);
QObject::connect(ui->hSync, &QCheckBox::clicked, this, &ATVDemodGUI::on_hSync_clicked);
QObject::connect(ui->vSync, &QCheckBox::clicked, this, &ATVDemodGUI::on_vSync_clicked);
QObject::connect(ui->invertVideo, &QCheckBox::clicked, this, &ATVDemodGUI::on_invertVideo_clicked);
QObject::connect(ui->halfImage, &QCheckBox::clicked, this, &ATVDemodGUI::on_halfImage_clicked);
QObject::connect(ui->modulation, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ATVDemodGUI::on_modulation_currentIndexChanged);
QObject::connect(ui->nbLines, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ATVDemodGUI::on_nbLines_currentIndexChanged);
QObject::connect(ui->fps, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ATVDemodGUI::on_fps_currentIndexChanged);
QObject::connect(ui->standard, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ATVDemodGUI::on_standard_currentIndexChanged);
QObject::connect(ui->reset, &QPushButton::clicked, this, &ATVDemodGUI::on_reset_clicked);
QObject::connect(ui->rfBW, &QSlider::valueChanged, this, &ATVDemodGUI::on_rfBW_valueChanged);
QObject::connect(ui->rfOppBW, &QSlider::valueChanged, this, &ATVDemodGUI::on_rfOppBW_valueChanged);
QObject::connect(ui->rfFiltering, &ButtonSwitch::toggled, this, &ATVDemodGUI::on_rfFiltering_toggled);
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &ATVDemodGUI::on_deltaFrequency_changed);
QObject::connect(ui->bfo, &QDial::valueChanged, this, &ATVDemodGUI::on_bfo_valueChanged);
QObject::connect(ui->fmDeviation, &QDial::valueChanged, this, &ATVDemodGUI::on_fmDeviation_valueChanged);
QObject::connect(ui->amScaleFactor, &QDial::valueChanged, this, &ATVDemodGUI::on_amScaleFactor_valueChanged);
QObject::connect(ui->amScaleOffset, &QDial::valueChanged, this, &ATVDemodGUI::on_amScaleOffset_valueChanged);
QObject::connect(ui->screenTabWidget, &QTabWidget::currentChanged, this, &ATVDemodGUI::on_screenTabWidget_currentChanged);
}

View File

@ -50,6 +50,12 @@ public:
QByteArray serialize() const;
bool deserialize(const QByteArray& arrData);
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
virtual QString getTitle() const { return m_settings.m_title; };
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
public slots:
void channelMarkerChangedByCursor();
@ -88,6 +94,7 @@ private:
void lineTimeUpdate();
void topTimeUpdate();
bool handleMessage(const Message& objMessage);
void makeUIConnections();
void leaveEvent(QEvent*);
void enterEvent(QEvent*);

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ATVDemodGUI</class>
<widget class="RollupWidget" name="ATVDemodGUI">
<widget class="RollupContents" name="ATVDemodGUI">
<property name="geometry">
<rect>
<x>0</x>
@ -1155,9 +1155,9 @@
</widget>
<customwidgets>
<customwidget>
<class>RollupWidget</class>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupwidget.h</header>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
<customwidget>

View File

@ -54,6 +54,12 @@ void ATVDemodSettings::resetToDefaults()
m_udpAddress = "127.0.0.1";
m_udpPort = 9999;
m_streamIndex = 0;
m_useReverseAPI = false;
m_reverseAPIAddress = "127.0.0.1";
m_reverseAPIPort = 8888;
m_reverseAPIDeviceIndex = 0;
m_reverseAPIChannelIndex = 0;
m_workspaceIndex = 0;
}
QByteArray ATVDemodSettings::serialize() const
@ -91,6 +97,14 @@ QByteArray ATVDemodSettings::serialize() const
s.writeBlob(25, m_rollupState->serialize());
}
s.writeBool(26, m_useReverseAPI);
s.writeString(27, m_reverseAPIAddress);
s.writeU32(28, m_reverseAPIPort);
s.writeU32(29, m_reverseAPIDeviceIndex);
s.writeU32(30, m_reverseAPIChannelIndex);
s.writeS32(31, m_workspaceIndex);
s.writeBlob(32, m_geometryBytes);
return s.final();
}
@ -108,6 +122,7 @@ bool ATVDemodSettings::deserialize(const QByteArray& arrData)
{
QByteArray bytetmp;
int tmp;
uint32_t utmp;
d.readS64(1, &m_inputFrequencyOffset, 0);
// TODO: rgb color
@ -152,6 +167,23 @@ bool ATVDemodSettings::deserialize(const QByteArray& arrData)
m_rollupState->deserialize(bytetmp);
}
d.readBool(26, &m_useReverseAPI, false);
d.readString(27, &m_reverseAPIAddress, "127.0.0.1");
d.readU32(28, &utmp, 0);
if ((utmp > 1023) && (utmp < 65535)) {
m_reverseAPIPort = utmp;
} else {
m_reverseAPIPort = 8888;
}
d.readU32(29, &utmp, 0);
m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp;
d.readU32(30, &utmp, 0);
m_reverseAPIChannelIndex = utmp > 99 ? 99 : utmp;
d.readS32(31, &m_workspaceIndex, 0);
d.readBlob(32, &m_geometryBytes);
return true;
}
else

View File

@ -74,7 +74,14 @@ struct ATVDemodSettings
uint16_t m_udpPort;
Serializable *m_channelMarker;
int m_streamIndex;
bool m_useReverseAPI;
QString m_reverseAPIAddress;
uint16_t m_reverseAPIPort;
uint16_t m_reverseAPIDeviceIndex;
uint16_t m_reverseAPIChannelIndex;
Serializable *m_rollupState;
int m_workspaceIndex;
QByteArray m_geometryBytes;
ATVDemodSettings();
void resetToDefaults();

View File

@ -138,7 +138,7 @@ void BFMDemodGUI::channelMarkerChangedByCursor()
void BFMDemodGUI::channelMarkerHighlightedByCursor()
{
setHighlighted(m_channelMarker.getHighlighted());
getRollupContents()->setHighlighted(m_channelMarker.getHighlighted());
}
void BFMDemodGUI::on_deltaFrequency_changed(qint64 value)
@ -304,7 +304,7 @@ void BFMDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;
saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}
@ -332,6 +332,7 @@ void BFMDemodGUI::onMenuDialogCalled(const QPoint &p)
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
setWindowTitle(m_settings.m_title);
setTitle(m_channelMarker.getTitle());
setTitleColor(m_settings.m_rgbColor);
applySettings();
@ -364,7 +365,8 @@ BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_radiotext_AB_flag(false),
m_rate(625000)
{
ui->setupUi(this);
ui->setupUi(getRollupContents());
getRollupContents()->arrangeRollups();
m_helpURL = "plugins/channelrx/demodbfm/readme.md";
ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03)));
ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
@ -375,7 +377,7 @@ BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
connect(audioMuteRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(audioSelect()));
setAttribute(Qt::WA_DeleteOnClose, true);
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
@ -421,6 +423,7 @@ BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
rdsUpdateFixedFields();
rdsUpdate(true);
displaySettings();
makeUIConnections();
applySettings(true);
}
@ -454,6 +457,7 @@ void BFMDemodGUI::displaySettings()
setTitleColor(m_settings.m_rgbColor);
setWindowTitle(m_channelMarker.getTitle());
setTitle(m_channelMarker.getTitle());
blockApplySettings(true);
@ -478,7 +482,7 @@ void BFMDemodGUI::displaySettings()
displayStreamIndex();
restoreState(m_rollupState);
getRollupContents()->restoreState(m_rollupState);
blockApplySettings(false);
}
@ -829,3 +833,17 @@ void BFMDemodGUI::changeFrequency(qint64 f)
qint64 df = m_channelMarker.getCenterFrequency();
qDebug() << "BFMDemodGUI::changeFrequency: " << f - df;
}
void BFMDemodGUI::makeUIConnections()
{
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &BFMDemodGUI::on_deltaFrequency_changed);
QObject::connect(ui->rfBW, &QSlider::valueChanged, this, &BFMDemodGUI::on_rfBW_valueChanged);
QObject::connect(ui->afBW, &QSlider::valueChanged, this, &BFMDemodGUI::on_afBW_valueChanged);
QObject::connect(ui->volume, &QSlider::valueChanged, this, &BFMDemodGUI::on_volume_valueChanged);
QObject::connect(ui->squelch, &QSlider::valueChanged, this, &BFMDemodGUI::on_squelch_valueChanged);
QObject::connect(ui->audioStereo, &QToolButton::toggled, this, &BFMDemodGUI::on_audioStereo_toggled);
QObject::connect(ui->lsbStereo, &ButtonSwitch::toggled, this, &BFMDemodGUI::on_lsbStereo_toggled);
QObject::connect(ui->showPilot, &ButtonSwitch::clicked, this, &BFMDemodGUI::on_showPilot_clicked);
QObject::connect(ui->rds, &ButtonSwitch::clicked, this, &BFMDemodGUI::on_rds_clicked);
QObject::connect(ui->clearData, &QPushButton::clicked, this, &BFMDemodGUI::on_clearData_clicked);
}

View File

@ -48,6 +48,12 @@ public:
QByteArray serialize() const;
bool deserialize(const QByteArray& data);
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
virtual QString getTitle() const { return m_settings.m_title; };
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
public slots:
void channelMarkerChangedByCursor();
@ -81,6 +87,7 @@ private:
void rdsUpdate(bool force);
void rdsUpdateFixedFields();
bool handleMessage(const Message& message);
void makeUIConnections();
void leaveEvent(QEvent*);
void enterEvent(QEvent*);

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>BFMDemodGUI</class>
<widget class="RollupWidget" name="BFMDemodGUI">
<widget class="RollupContents" name="BFMDemodGUI">
<property name="geometry">
<rect>
<x>0</x>
@ -1884,9 +1884,9 @@
</widget>
<customwidgets>
<customwidget>
<class>RollupWidget</class>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupwidget.h</header>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
<customwidget>

View File

@ -56,6 +56,7 @@ void BFMDemodSettings::resetToDefaults()
m_reverseAPIPort = 8888;
m_reverseAPIDeviceIndex = 0;
m_reverseAPIChannelIndex = 0;
m_workspaceIndex = 0;
}
QByteArray BFMDemodSettings::serialize() const
@ -93,6 +94,8 @@ QByteArray BFMDemodSettings::serialize() const
}
s.writeBool(21, m_rdsActive);
s.writeS32(22, m_workspaceIndex);
s.writeBlob(23, m_geometryBytes);
return s.final();
}
@ -167,6 +170,8 @@ bool BFMDemodSettings::deserialize(const QByteArray& data)
}
d.readBool(21, &m_rdsActive, false);
d.readS32(22, &m_workspaceIndex, 0);
d.readBlob(23, &m_geometryBytes);
return true;
}

View File

@ -42,6 +42,8 @@ struct BFMDemodSettings
uint16_t m_reverseAPIPort;
uint16_t m_reverseAPIDeviceIndex;
uint16_t m_reverseAPIChannelIndex;
int m_workspaceIndex;
QByteArray m_geometryBytes;
Serializable *m_channelMarker;
Serializable *m_spectrumGUI;

View File

@ -156,7 +156,7 @@ void ChirpChatDemodGUI::on_deltaFrequency_changed(qint64 value)
void ChirpChatDemodGUI::channelMarkerHighlightedByCursor()
{
setHighlighted(m_channelMarker.getHighlighted());
getRollupContents()->setHighlighted(m_channelMarker.getHighlighted());
}
void ChirpChatDemodGUI::on_BW_valueChanged(int value)
@ -323,7 +323,7 @@ void ChirpChatDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;
saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}
@ -350,6 +350,7 @@ void ChirpChatDemodGUI::onMenuDialogCalled(const QPoint &p)
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
setWindowTitle(m_settings.m_title);
setTitle(m_channelMarker.getTitle());
setTitleColor(m_settings.m_rgbColor);
applySettings();
@ -382,10 +383,11 @@ ChirpChatDemodGUI::ChirpChatDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUI
m_doApplySettings(true),
m_tickCount(0)
{
ui->setupUi(this);
ui->setupUi(getRollupContents());
getRollupContents()->arrangeRollups();
m_helpURL = "plugins/channelrx/demodchirpchat/readme.md";
setAttribute(Qt::WA_DeleteOnClose, true);
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
m_chirpChatDemod = (ChirpChatDemod*) rxChannel;
@ -424,6 +426,7 @@ ChirpChatDemodGUI::ChirpChatDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUI
setBandwidths();
displaySettings();
makeUIConnections();
resetLoRaStatus();
applySettings(true);
}
@ -459,6 +462,7 @@ void ChirpChatDemodGUI::displaySettings()
m_channelMarker.blockSignals(false);
m_channelMarker.setColor(m_settings.m_rgbColor);
setTitleColor(m_settings.m_rgbColor);
setTitle(m_channelMarker.getTitle());
ui->glSpectrum->setSampleRate(thisBW);
ui->glSpectrum->setCenterFrequency(thisBW/2);
@ -499,7 +503,7 @@ void ChirpChatDemodGUI::displaySettings()
displaySquelch();
restoreState(m_rollupState);
getRollupContents()->restoreState(m_rollupState);
blockApplySettings(false);
}
@ -767,3 +771,25 @@ void ChirpChatDemodGUI::tick()
}
}
void ChirpChatDemodGUI::makeUIConnections()
{
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &ChirpChatDemodGUI::on_deltaFrequency_changed);
QObject::connect(ui->BW, &QSlider::valueChanged, this, &ChirpChatDemodGUI::on_BW_valueChanged);
QObject::connect(ui->Spread, &QSlider::valueChanged, this, &ChirpChatDemodGUI::on_Spread_valueChanged);
QObject::connect(ui->deBits, &QSlider::valueChanged, this, &ChirpChatDemodGUI::on_deBits_valueChanged);
QObject::connect(ui->fftWindow, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ChirpChatDemodGUI::on_fftWindow_currentIndexChanged);
QObject::connect(ui->preambleChirps, &QSlider::valueChanged, this, &ChirpChatDemodGUI::on_preambleChirps_valueChanged);
QObject::connect(ui->scheme, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ChirpChatDemodGUI::on_scheme_currentIndexChanged);
QObject::connect(ui->mute, &QToolButton::toggled, this, &ChirpChatDemodGUI::on_mute_toggled);
QObject::connect(ui->clear, &QPushButton::clicked, this, &ChirpChatDemodGUI::on_clear_clicked);
QObject::connect(ui->eomSquelch, &QDial::valueChanged, this, &ChirpChatDemodGUI::on_eomSquelch_valueChanged);
QObject::connect(ui->messageLength, &QDial::valueChanged, this, &ChirpChatDemodGUI::on_messageLength_valueChanged);
QObject::connect(ui->messageLengthAuto, &QCheckBox::stateChanged, this, &ChirpChatDemodGUI::on_messageLengthAuto_stateChanged);
QObject::connect(ui->header, &QCheckBox::stateChanged, this, &ChirpChatDemodGUI::on_header_stateChanged);
QObject::connect(ui->fecParity, &QDial::valueChanged, this, &ChirpChatDemodGUI::on_fecParity_valueChanged);
QObject::connect(ui->crc, &QCheckBox::stateChanged, this, &ChirpChatDemodGUI::on_crc_stateChanged);
QObject::connect(ui->packetLength, &QDial::valueChanged, this, &ChirpChatDemodGUI::on_packetLength_valueChanged);
QObject::connect(ui->udpSend, &QCheckBox::stateChanged, this, &ChirpChatDemodGUI::on_udpSend_stateChanged);
QObject::connect(ui->udpAddress, &QLineEdit::editingFinished, this, &ChirpChatDemodGUI::on_udpAddress_editingFinished);
QObject::connect(ui->udpPort, &QLineEdit::editingFinished, this, &ChirpChatDemodGUI::on_udpPort_editingFinished);
}

View File

@ -46,6 +46,12 @@ public:
QByteArray serialize() const;
bool deserialize(const QByteArray& data);
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
virtual QString getTitle() const { return m_settings.m_title; };
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
private slots:
void channelMarkerChangedByCursor();
@ -115,6 +121,7 @@ private:
QString getParityStr(int parityStatus);
void resetLoRaStatus();
bool handleMessage(const Message& message);
void makeUIConnections();
};
#endif // INCLUDE_CHIRPCHATDEMODGUI_H

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ChirpChatDemodGUI</class>
<widget class="RollupWidget" name="ChirpChatDemodGUI">
<widget class="RollupContents" name="ChirpChatDemodGUI">
<property name="geometry">
<rect>
<x>0</x>
@ -1223,9 +1223,9 @@
</widget>
<customwidgets>
<customwidget>
<class>RollupWidget</class>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupwidget.h</header>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
<customwidget>

View File

@ -89,6 +89,7 @@ void ChirpChatDemodSettings::resetToDefaults()
m_reverseAPIPort = 8888;
m_reverseAPIDeviceIndex = 0;
m_reverseAPIChannelIndex = 0;
m_workspaceIndex = 0;
}
QByteArray ChirpChatDemodSettings::serialize() const
@ -132,6 +133,9 @@ QByteArray ChirpChatDemodSettings::serialize() const
s.writeBlob(29, m_rollupState->serialize());
}
s.writeS32(30, m_workspaceIndex);
s.writeBlob(31, m_geometryBytes);
return s.final();
}
@ -212,6 +216,9 @@ bool ChirpChatDemodSettings::deserialize(const QByteArray& data)
m_rollupState->deserialize(bytetmp);
}
d.readS32(30, &m_workspaceIndex, 0);
d.readBlob(31, &m_geometryBytes);
return true;
}
else

View File

@ -63,6 +63,8 @@ struct ChirpChatDemodSettings
uint16_t m_reverseAPIPort;
uint16_t m_reverseAPIDeviceIndex;
uint16_t m_reverseAPIChannelIndex;
int m_workspaceIndex;
QByteArray m_geometryBytes;
Serializable *m_channelMarker;
Serializable *m_spectrumGUI;

View File

@ -208,7 +208,7 @@ bool DABDemodGUI::handleMessage(const Message& message)
} else {
ui->warning->setText("");
}
arrangeRollups();
getRollupContents()->arrangeRollups();
return true;
}
else if (DABDemod::MsgDABEnsembleName::match(message))
@ -281,7 +281,7 @@ bool DABDemodGUI::handleMessage(const Message& message)
ui->motImage->resize(ui->motImage->width(), pixmap.height());
ui->motImage->setVisible(true);
ui->motImage->setPixmap(pixmap, pixmap.size());
arrangeRollups();
getRollupContents()->arrangeRollups();
}
return true;
}
@ -311,7 +311,7 @@ void DABDemodGUI::channelMarkerChangedByCursor()
void DABDemodGUI::channelMarkerHighlightedByCursor()
{
setHighlighted(m_channelMarker.getHighlighted());
getRollupContents()->setHighlighted(m_channelMarker.getHighlighted());
}
void DABDemodGUI::on_deltaFrequency_changed(qint64 value)
@ -384,7 +384,7 @@ void DABDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;
saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}
@ -410,6 +410,7 @@ void DABDemodGUI::onMenuDialogCalled(const QPoint &p)
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
setWindowTitle(m_settings.m_title);
setTitle(m_channelMarker.getTitle());
setTitleColor(m_settings.m_rgbColor);
applySettings();
@ -442,11 +443,12 @@ DABDemodGUI::DABDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_tickCount(0),
m_channelFreq(0.0)
{
ui->setupUi(this);
ui->setupUi(getRollupContents());
getRollupContents()->arrangeRollups();
m_helpURL = "plugins/channelrx/demoddab/readme.md";
setAttribute(Qt::WA_DeleteOnClose, true);
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
m_dabDemod = reinterpret_cast<DABDemod*>(rxChannel);
@ -506,6 +508,7 @@ DABDemodGUI::DABDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
connect(ui->programs->horizontalHeader(), SIGNAL(sectionResized(int, int, int)), SLOT(programs_sectionResized(int, int, int)));
displaySettings();
makeUIConnections();
applySettings(true);
}
@ -539,6 +542,7 @@ void DABDemodGUI::displaySettings()
setTitleColor(m_settings.m_rgbColor);
setWindowTitle(m_channelMarker.getTitle());
setTitle(m_channelMarker.getTitle());
blockApplySettings(true);
@ -569,7 +573,7 @@ void DABDemodGUI::displaySettings()
filter();
restoreState(m_rollupState);
getRollupContents()->restoreState(m_rollupState);
blockApplySettings(false);
}
@ -605,7 +609,7 @@ void DABDemodGUI::clearProgram()
ui->data->setText("");
ui->motImage->setPixmap(QPixmap());
ui->motImage->setVisible(false);
arrangeRollups();
getRollupContents()->arrangeRollups();
}
void DABDemodGUI::resetService()
@ -692,3 +696,15 @@ void DABDemodGUI::tick()
m_tickCount++;
}
void DABDemodGUI::makeUIConnections()
{
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &DABDemodGUI::on_deltaFrequency_changed);
QObject::connect(ui->audioMute, &QToolButton::toggled, this, &DABDemodGUI::on_audioMute_toggled);
QObject::connect(ui->volume, &QSlider::valueChanged, this, &DABDemodGUI::on_volume_valueChanged);
QObject::connect(ui->rfBW, &QSlider::valueChanged, this, &DABDemodGUI::on_rfBW_valueChanged);
QObject::connect(ui->filter, &QLineEdit::editingFinished, this, &DABDemodGUI::on_filter_editingFinished);
QObject::connect(ui->clearTable, &QPushButton::clicked, this, &DABDemodGUI::on_clearTable_clicked);
QObject::connect(ui->programs, &QTableWidget::cellDoubleClicked, this, &DABDemodGUI::on_programs_cellDoubleClicked);
QObject::connect(ui->channel, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &DABDemodGUI::on_channel_currentIndexChanged);
}

View File

@ -53,6 +53,12 @@ public:
QByteArray serialize() const;
bool deserialize(const QByteArray& data);
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
virtual QString getTitle() const { return m_settings.m_title; };
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
public slots:
void channelMarkerChangedByCursor();
@ -84,6 +90,8 @@ private:
void displayStreamIndex();
void addProgramName(const DABDemod::MsgDABProgramName& program);
bool handleMessage(const Message& message);
void makeUIConnections();
void leaveEvent(QEvent*);
void enterEvent(QEvent*);
void resetService();

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DABDemodGUI</class>
<widget class="RollupWidget" name="DABDemodGUI">
<widget class="RollupContents" name="DABDemodGUI">
<property name="geometry">
<rect>
<x>0</x>
@ -1009,9 +1009,9 @@
</widget>
<customwidgets>
<customwidget>
<class>RollupWidget</class>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupwidget.h</header>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
<customwidget>

View File

@ -47,6 +47,7 @@ void DABDemodSettings::resetToDefaults()
m_reverseAPIPort = 8888;
m_reverseAPIDeviceIndex = 0;
m_reverseAPIChannelIndex = 0;
m_workspaceIndex = 0;
for (int i = 0; i < DABDEMOD_COLUMNS; i++)
{
@ -82,6 +83,9 @@ QByteArray DABDemodSettings::serialize() const
s.writeBlob(16, m_rollupState->serialize());
}
s.writeS32(17, m_workspaceIndex);
s.writeBlob(18, m_geometryBytes);
for (int i = 0; i < DABDEMOD_COLUMNS; i++) {
s.writeS32(100 + i, m_columnIndexes[i]);
}
@ -146,6 +150,9 @@ bool DABDemodSettings::deserialize(const QByteArray& data)
m_rollupState->deserialize(bytetmp);
}
d.readS32(17, &m_workspaceIndex, 0);
d.readBlob(18, &m_geometryBytes);
for (int i = 0; i < DABDEMOD_COLUMNS; i++) {
d.readS32(100 + i, &m_columnIndexes[i], i);
}

View File

@ -46,6 +46,8 @@ struct DABDemodSettings
uint16_t m_reverseAPIDeviceIndex;
uint16_t m_reverseAPIChannelIndex;
Serializable *m_rollupState;
int m_workspaceIndex;
QByteArray m_geometryBytes;
int m_columnIndexes[DABDEMOD_COLUMNS];//!< How the columns are ordered in the table
int m_columnSizes[DABDEMOD_COLUMNS]; //!< Size of the columns in the table

View File

@ -128,7 +128,7 @@ void DATVDemodGUI::channelMarkerChangedByCursor()
void DATVDemodGUI::channelMarkerHighlightedByCursor()
{
setHighlighted(m_objChannelMarker.getHighlighted());
getRollupContents()->setHighlighted(m_objChannelMarker.getHighlighted());
}
@ -137,7 +137,7 @@ void DATVDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;
saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}
@ -164,6 +164,7 @@ void DATVDemodGUI::onMenuDialogCalled(const QPoint &p)
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
setWindowTitle(m_settings.m_title);
setTitle(m_objChannelMarker.getTitle());
setTitleColor(m_settings.m_rgbColor);
applySettings();
@ -198,12 +199,13 @@ DATVDemodGUI::DATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, Ba
m_modcodCodeRateIndex(-1),
m_cstlnSetByModcod(false)
{
ui->setupUi(this);
ui->setupUi(getRollupContents());
getRollupContents()->arrangeRollups();
m_helpURL = "plugins/channelrx/demoddatv/readme.md";
ui->screenTV->setColor(true);
ui->screenTV->resizeTVScreen(256,256);
setAttribute(Qt::WA_DeleteOnClose, true);
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
@ -283,6 +285,7 @@ DATVDemodGUI::DATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, Ba
ui->playerIndicator->setStyleSheet("QLabel { background-color: gray; border-radius: 8px; }");
ui->udpIndicator->setStyleSheet("QLabel { background-color: gray; border-radius: 8px; }");
resetToDefaults(); // does applySettings()
makeUIConnections();
}
DATVDemodGUI::~DATVDemodGUI()
@ -308,6 +311,7 @@ void DATVDemodGUI::displaySettings()
setTitleColor(m_settings.m_rgbColor);
setWindowTitle(m_objChannelMarker.getTitle());
setTitle(m_objChannelMarker.getTitle());
ui->deltaFrequency->setValue(m_settings.m_centerFrequency);
ui->chkAllowDrift->setChecked(m_settings.m_allowDrift);
@ -395,7 +399,7 @@ void DATVDemodGUI::displaySettings()
connect(m_datvDemod->getUDPStream(), &DATVUDPStream::fifoData, this, &DATVDemodGUI::on_StreamDataAvailable);
}
restoreState(m_rollupState);
getRollupContents()->restoreState(m_rollupState);
blockApplySettings(false);
}
@ -656,7 +660,7 @@ void DATVDemodGUI::on_cmbStandard_currentIndexChanged(int index)
applySettings();
}
void DATVDemodGUI::on_cmbModulation_currentIndexChanged(const QString &arg1)
void DATVDemodGUI::on_cmbModulation_currentIndexChanged(int arg1)
{
(void) arg1;
QString strModulation = ui->cmbModulation->currentText();
@ -674,7 +678,7 @@ void DATVDemodGUI::on_cmbModulation_currentIndexChanged(const QString &arg1)
applySettings();
}
void DATVDemodGUI::on_cmbFEC_currentIndexChanged(const QString &arg1)
void DATVDemodGUI::on_cmbFEC_currentIndexChanged(int arg1)
{
(void) arg1;
QString strFEC = ui->cmbFEC->currentText();
@ -919,3 +923,32 @@ void DATVDemodGUI::on_udpTSPort_editingFinished()
ui->udpTSPort->setText(tr("%1").arg(udpPort));
applySettings();
}
void DATVDemodGUI::makeUIConnections()
{
QObject::connect(ui->cmbStandard, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &DATVDemodGUI::on_cmbStandard_currentIndexChanged);
QObject::connect(ui->cmbModulation, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &DATVDemodGUI::on_cmbModulation_currentIndexChanged);
QObject::connect(ui->cmbFEC, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &DATVDemodGUI::on_cmbFEC_currentIndexChanged);
QObject::connect(ui->softLDPC, &QCheckBox::clicked, this, &DATVDemodGUI::on_softLDPC_clicked);
QObject::connect(ui->maxBitflips, QOverload<int>::of(&QSpinBox::valueChanged), this, &DATVDemodGUI::on_maxBitflips_valueChanged);
QObject::connect(ui->chkViterbi, &QCheckBox::clicked, this, &DATVDemodGUI::on_chkViterbi_clicked);
QObject::connect(ui->chkHardMetric, &QCheckBox::clicked, this, &DATVDemodGUI::on_chkHardMetric_clicked);
QObject::connect(ui->resetDefaults, &QPushButton::clicked, this, &DATVDemodGUI::on_resetDefaults_clicked);
QObject::connect(ui->spiSymbolRate, QOverload<int>::of(&QSpinBox::valueChanged), this, &DATVDemodGUI::on_spiSymbolRate_valueChanged);
QObject::connect(ui->spiNotchFilters, QOverload<int>::of(&QSpinBox::valueChanged), this, &DATVDemodGUI::on_spiNotchFilters_valueChanged);
QObject::connect(ui->chkAllowDrift, &QCheckBox::clicked, this, &DATVDemodGUI::on_chkAllowDrift_clicked);
QObject::connect(ui->fullScreen, &QPushButton::clicked, this, &DATVDemodGUI::on_fullScreen_clicked);
QObject::connect(ui->chkFastlock, &QCheckBox::clicked, this, &DATVDemodGUI::on_chkFastlock_clicked);
QObject::connect(ui->cmbFilter, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &DATVDemodGUI::on_cmbFilter_currentIndexChanged);
QObject::connect(ui->spiRollOff, QOverload<int>::of(&QSpinBox::valueChanged), this, &DATVDemodGUI::on_spiRollOff_valueChanged);
QObject::connect(ui->spiExcursion, QOverload<int>::of(&QSpinBox::valueChanged), this, &DATVDemodGUI::on_spiExcursion_valueChanged);
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &DATVDemodGUI::on_deltaFrequency_changed);
QObject::connect(ui->rfBandwidth, &ValueDialZ::changed, this, &DATVDemodGUI::on_rfBandwidth_changed);
QObject::connect(ui->audioMute, &QToolButton::toggled, this, &DATVDemodGUI::on_audioMute_toggled);
QObject::connect(ui->audioVolume, &QSlider::valueChanged, this, &DATVDemodGUI::on_audioVolume_valueChanged);
QObject::connect(ui->videoMute, &QToolButton::toggled, this, &DATVDemodGUI::on_videoMute_toggled);
QObject::connect(ui->udpTS, &ButtonSwitch::clicked, this, &DATVDemodGUI::on_udpTS_clicked);
QObject::connect(ui->udpTSAddress, &QLineEdit::editingFinished, this, &DATVDemodGUI::on_udpTSAddress_editingFinished);
QObject::connect(ui->udpTSPort, &QLineEdit::editingFinished, this, &DATVDemodGUI::on_udpTSPort_editingFinished);
QObject::connect(ui->playerEnable, &QCheckBox::clicked, this, &DATVDemodGUI::on_playerEnable_clicked);
}

View File

@ -50,6 +50,12 @@ public:
void resetToDefaults();
QByteArray serialize() const;
bool deserialize(const QByteArray& arrData);
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
virtual QString getTitle() const { return m_settings.m_title; };
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
@ -68,8 +74,8 @@ private slots:
void tickMeter();
void on_cmbStandard_currentIndexChanged(int index);
void on_cmbModulation_currentIndexChanged(const QString &arg1);
void on_cmbFEC_currentIndexChanged(const QString &arg1);
void on_cmbModulation_currentIndexChanged(int arg1);
void on_cmbFEC_currentIndexChanged(int arg1);
void on_softLDPC_clicked();
void on_maxBitflips_valueChanged(int value);
void on_chkViterbi_clicked();
@ -137,6 +143,7 @@ private:
void leaveEvent(QEvent*);
void enterEvent(QEvent*);
bool handleMessage(const Message& objMessage);
void makeUIConnections();
};
#endif // INCLUDE_DATVDEMODGUI_H

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DATVDemodGUI</class>
<widget class="RollupWidget" name="DATVDemodGUI">
<widget class="RollupContents" name="DATVDemodGUI">
<property name="geometry">
<rect>
<x>0</x>
@ -1394,9 +1394,9 @@
</widget>
<customwidgets>
<customwidget>
<class>RollupWidget</class>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupwidget.h</header>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
<customwidget>

View File

@ -70,6 +70,7 @@ void DATVDemodSettings::resetToDefaults()
m_reverseAPIPort = 8888;
m_reverseAPIDeviceIndex = 0;
m_reverseAPIChannelIndex = 0;
m_workspaceIndex = 0;
}
QByteArray DATVDemodSettings::serialize() const
@ -119,6 +120,9 @@ QByteArray DATVDemodSettings::serialize() const
s.writeBlob(37, m_rollupState->serialize());
}
s.writeS32(38, m_workspaceIndex);
s.writeBlob(39, m_geometryBytes);
return s.final();
}
@ -213,6 +217,9 @@ bool DATVDemodSettings::deserialize(const QByteArray& data)
m_rollupState->deserialize(bytetmp);
}
d.readS32(38, &m_workspaceIndex, 0);
d.readBlob(39, &m_geometryBytes);
validateSystemConfiguration();
return true;

View File

@ -108,6 +108,9 @@ struct DATVDemodSettings
uint16_t m_reverseAPIDeviceIndex;
uint16_t m_reverseAPIChannelIndex;
Serializable *m_rollupState;
int m_workspaceIndex;
QByteArray m_geometryBytes;
static const int m_softLDPCMaxMaxTrials = 50;
DATVDemodSettings();

View File

@ -248,7 +248,7 @@ void DSDDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;
saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}
@ -276,6 +276,7 @@ void DSDDemodGUI::onMenuDialogCalled(const QPoint &p)
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
setWindowTitle(m_settings.m_title);
setTitle(m_channelMarker.getTitle());
setTitleColor(m_settings.m_rgbColor);
applySettings();
@ -321,13 +322,14 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_tickCount(0),
m_dsdStatusTextDialog(0)
{
ui->setupUi(this);
ui->setupUi(getRollupContents());
getRollupContents()->arrangeRollups();
m_helpURL = "plugins/channelrx/demoddsd/readme.md";
ui->screenTV->setColor(true);
ui->screenTV->resizeTVScreen(200,200);
setAttribute(Qt::WA_DeleteOnClose, true);
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
@ -382,6 +384,7 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
updateMyPosition();
displaySettings();
makeUIConnections();
applySettings(true);
}
@ -415,6 +418,7 @@ void DSDDemodGUI::displaySettings()
setTitleColor(m_settings.m_rgbColor);
setWindowTitle(m_channelMarker.getTitle());
setTitle(m_channelMarker.getTitle());
blockApplySettings(true);
@ -463,7 +467,7 @@ void DSDDemodGUI::displaySettings()
displayStreamIndex();
restoreState(m_rollupState);
getRollupContents()->restoreState(m_rollupState);
blockApplySettings(false);
}
@ -511,7 +515,7 @@ void DSDDemodGUI::channelMarkerChangedByCursor()
void DSDDemodGUI::channelMarkerHighlightedByCursor()
{
setHighlighted(m_channelMarker.getHighlighted());
getRollupContents()->setHighlighted(m_channelMarker.getHighlighted());
}
void DSDDemodGUI::audioSelect()
@ -614,3 +618,25 @@ void DSDDemodGUI::tick()
m_tickCount++;
}
void DSDDemodGUI::makeUIConnections()
{
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &DSDDemodGUI::on_deltaFrequency_changed);
QObject::connect(ui->rfBW, &QSlider::valueChanged, this, &DSDDemodGUI::on_rfBW_valueChanged);
QObject::connect(ui->demodGain, &QSlider::valueChanged, this, &DSDDemodGUI::on_demodGain_valueChanged);
QObject::connect(ui->volume, &QDial::valueChanged, this, &DSDDemodGUI::on_volume_valueChanged);
QObject::connect(ui->baudRate, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &DSDDemodGUI::on_baudRate_currentIndexChanged);
QObject::connect(ui->enableCosineFiltering, &ButtonSwitch::toggled, this, &DSDDemodGUI::on_enableCosineFiltering_toggled);
QObject::connect(ui->syncOrConstellation, &QToolButton::toggled, this, &DSDDemodGUI::on_syncOrConstellation_toggled);
QObject::connect(ui->traceLength, &QDial::valueChanged, this, &DSDDemodGUI::on_traceLength_valueChanged);
QObject::connect(ui->traceStroke, &QDial::valueChanged, this, &DSDDemodGUI::on_traceStroke_valueChanged);
QObject::connect(ui->traceDecay, &QDial::valueChanged, this, &DSDDemodGUI::on_traceDecay_valueChanged);
QObject::connect(ui->tdmaStereoSplit, &QToolButton::toggled, this, &DSDDemodGUI::on_tdmaStereoSplit_toggled);
QObject::connect(ui->fmDeviation, &QSlider::valueChanged, this, &DSDDemodGUI::on_fmDeviation_valueChanged);
QObject::connect(ui->squelchGate, &QDial::valueChanged, this, &DSDDemodGUI::on_squelchGate_valueChanged);
QObject::connect(ui->squelch, &QDial::valueChanged, this, &DSDDemodGUI::on_squelch_valueChanged);
QObject::connect(ui->highPassFilter, &ButtonSwitch::toggled, this, &DSDDemodGUI::on_highPassFilter_toggled);
QObject::connect(ui->audioMute, &QToolButton::toggled, this, &DSDDemodGUI::on_audioMute_toggled);
QObject::connect(ui->symbolPLLLock, &QToolButton::toggled, this, &DSDDemodGUI::on_symbolPLLLock_toggled);
QObject::connect(ui->viewStatusLog, &QPushButton::clicked, this, &DSDDemodGUI::on_viewStatusLog_clicked);
}

View File

@ -52,6 +52,12 @@ public:
QByteArray serialize() const;
bool deserialize(const QByteArray& data);
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
virtual QString getTitle() const { return m_settings.m_title; };
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
public slots:
void channelMarkerChangedByCursor();
@ -104,6 +110,7 @@ private:
void displayStreamIndex();
void updateMyPosition();
bool handleMessage(const Message& message);
void makeUIConnections();
void leaveEvent(QEvent*);
void enterEvent(QEvent*);

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DSDDemodGUI</class>
<widget class="RollupWidget" name="DSDDemodGUI">
<widget class="RollupContents" name="DSDDemodGUI">
<property name="geometry">
<rect>
<x>0</x>
@ -1232,9 +1232,9 @@
</widget>
<customwidgets>
<customwidget>
<class>RollupWidget</class>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupwidget.h</header>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
<customwidget>

View File

@ -59,6 +59,7 @@ void DSDDemodSettings::resetToDefaults()
m_reverseAPIPort = 8888;
m_reverseAPIDeviceIndex = 0;
m_reverseAPIChannelIndex = 0;
m_workspaceIndex = 0;
}
QByteArray DSDDemodSettings::serialize() const
@ -102,6 +103,9 @@ QByteArray DSDDemodSettings::serialize() const
s.writeBlob(31, m_rollupState->serialize());
}
s.writeS32(32, m_workspaceIndex);
s.writeBlob(33, m_geometryBytes);
return s.final();
}
@ -181,6 +185,9 @@ bool DSDDemodSettings::deserialize(const QByteArray& data)
m_rollupState->deserialize(bytetmp);
}
d.readS32(32, &m_workspaceIndex, 0);
d.readBlob(33, &m_geometryBytes);
return true;
}
else

View File

@ -52,6 +52,8 @@ struct DSDDemodSettings
uint16_t m_reverseAPIPort;
uint16_t m_reverseAPIDeviceIndex;
uint16_t m_reverseAPIChannelIndex;
int m_workspaceIndex;
QByteArray m_geometryBytes;
Serializable *m_channelMarker;
Serializable *m_rollupState;

View File

@ -123,7 +123,7 @@ void FreeDVDemodGUI::channelMarkerChangedByCursor()
void FreeDVDemodGUI::channelMarkerHighlightedByCursor()
{
setHighlighted(m_channelMarker.getHighlighted());
getRollupContents()->setHighlighted(m_channelMarker.getHighlighted());
}
void FreeDVDemodGUI::on_deltaFrequency_changed(qint64 value)
@ -209,6 +209,7 @@ void FreeDVDemodGUI::onMenuDialogCalled(const QPoint &p)
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
setWindowTitle(m_settings.m_title);
setTitle(m_channelMarker.getTitle());
setTitleColor(m_settings.m_rgbColor);
applySettings();
@ -236,7 +237,7 @@ void FreeDVDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;
saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}
@ -254,10 +255,11 @@ FreeDVDemodGUI::FreeDVDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, B
m_squelchOpen(false),
m_audioSampleRate(-1)
{
ui->setupUi(this);
ui->setupUi(getRollupContents());
getRollupContents()->arrangeRollups();
m_helpURL = "plugins/channelrx/demodfreedv/readme.md";
setAttribute(Qt::WA_DeleteOnClose, true);
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
m_freeDVDemod = (FreeDVDemod*) rxChannel;
@ -308,6 +310,7 @@ FreeDVDemodGUI::FreeDVDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, B
m_iconDSBLSB.addPixmap(QPixmap("://lsb.png"), QIcon::Normal, QIcon::Off);
displaySettings();
makeUIConnections();
applyBandwidths(5 - ui->spanLog2->value(), true); // does applySettings(true)
}
@ -371,6 +374,7 @@ void FreeDVDemodGUI::displaySettings()
setTitleColor(m_settings.m_rgbColor);
setWindowTitle(m_channelMarker.getTitle());
setTitle(m_channelMarker.getTitle());
blockApplySettings(true);
@ -393,7 +397,7 @@ void FreeDVDemodGUI::displaySettings()
displayStreamIndex();
restoreState(m_rollupState);
getRollupContents()->restoreState(m_rollupState);
blockApplySettings(false);
}
@ -487,3 +491,14 @@ void FreeDVDemodGUI::tick()
m_tickCount++;
}
void FreeDVDemodGUI::makeUIConnections()
{
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &FreeDVDemodGUI::on_deltaFrequency_changed);
QObject::connect(ui->reSync, &QPushButton::clicked, this, &FreeDVDemodGUI::on_reSync_clicked);
QObject::connect(ui->freeDVMode, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &FreeDVDemodGUI::on_freeDVMode_currentIndexChanged);
QObject::connect(ui->volume, &QDial::valueChanged, this, &FreeDVDemodGUI::on_volume_valueChanged);
QObject::connect(ui->volumeIn, &QDial::valueChanged, this, &FreeDVDemodGUI::on_volumeIn_valueChanged);
QObject::connect(ui->agc, &ButtonSwitch::toggled, this, &FreeDVDemodGUI::on_agc_toggled);
QObject::connect(ui->audioMute, &QToolButton::toggled, this, &FreeDVDemodGUI::on_audioMute_toggled);
}

View File

@ -50,6 +50,12 @@ public:
QByteArray serialize() const;
bool deserialize(const QByteArray& data);
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
virtual QString getTitle() const { return m_settings.m_title; };
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
public slots:
void channelMarkerChangedByCursor();
@ -88,6 +94,7 @@ private:
void displaySettings();
void displayStreamIndex();
bool handleMessage(const Message& message);
void makeUIConnections();
void leaveEvent(QEvent*);
void enterEvent(QEvent*);

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>FreeDVDemodGUI</class>
<widget class="RollupWidget" name="FreeDVDemodGUI">
<widget class="RollupContents" name="FreeDVDemodGUI">
<property name="geometry">
<rect>
<x>0</x>
@ -710,9 +710,9 @@
</widget>
<customwidgets>
<customwidget>
<class>RollupWidget</class>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupwidget.h</header>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
<customwidget>

View File

@ -56,6 +56,7 @@ void FreeDVDemodSettings::resetToDefaults()
m_reverseAPIPort = 8888;
m_reverseAPIDeviceIndex = 0;
m_reverseAPIChannelIndex = 0;
m_workspaceIndex = 0;
}
QByteArray FreeDVDemodSettings::serialize() const
@ -86,6 +87,9 @@ QByteArray FreeDVDemodSettings::serialize() const
s.writeBlob(25, m_rollupState->serialize());
}
s.writeS32(26, m_workspaceIndex);
s.writeBlob(27, m_geometryBytes);
return s.final();
}
@ -154,6 +158,9 @@ bool FreeDVDemodSettings::deserialize(const QByteArray& data)
m_rollupState->deserialize(bytetmp);
}
d.readS32(26, &m_workspaceIndex, 0);
d.readBlob(27, &m_geometryBytes);
return true;
}
else

View File

@ -51,6 +51,8 @@ struct FreeDVDemodSettings
uint16_t m_reverseAPIPort;
uint16_t m_reverseAPIDeviceIndex;
uint16_t m_reverseAPIChannelIndex;
int m_workspaceIndex;
QByteArray m_geometryBytes;
Serializable *m_channelMarker;
Serializable *m_spectrumGUI;

View File

@ -106,7 +106,7 @@ void NFMDemodGUI::channelMarkerChangedByCursor()
void NFMDemodGUI::channelMarkerHighlightedByCursor()
{
setHighlighted(m_channelMarker.getHighlighted());
getRollupContents()->setHighlighted(m_channelMarker.getHighlighted());
}
void NFMDemodGUI::on_deltaFrequency_changed(qint64 value)
@ -280,7 +280,7 @@ void NFMDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
m_nfmDemod->setSpectrum(m_threadedSampleSink->getMessageQueue(), rollDown);
*/
saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}
@ -307,6 +307,7 @@ void NFMDemodGUI::onMenuDialogCalled(const QPoint &p)
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
setWindowTitle(m_settings.m_title);
setTitle(m_channelMarker.getTitle());
setTitleColor(m_settings.m_rgbColor);
applySettings();
@ -343,11 +344,12 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_dcsShowPositive(false),
m_tickCount(0)
{
ui->setupUi(this);
ui->setupUi(getRollupContents());
getRollupContents()->arrangeRollups();
m_helpURL = "plugins/channelrx/demodnfm/readme.md";
setAttribute(Qt::WA_DeleteOnClose, true);
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
m_nfmDemod = reinterpret_cast<NFMDemod*>(rxChannel);
@ -420,6 +422,7 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
displaySettings();
makeUIConnections();
applySettings(true);
}
@ -450,6 +453,7 @@ void NFMDemodGUI::displaySettings()
setTitleColor(m_settings.m_rgbColor);
setWindowTitle(m_channelMarker.getTitle());
setTitle(m_channelMarker.getTitle());
blockApplySettings(true);
@ -509,7 +513,7 @@ void NFMDemodGUI::displaySettings()
setDcsCode(m_reportedDcsCode);
displayStreamIndex();
restoreState(m_rollupState);
getRollupContents()->restoreState(m_rollupState);
blockApplySettings(false);
}
@ -611,3 +615,22 @@ void NFMDemodGUI::tick()
m_tickCount++;
}
void NFMDemodGUI::makeUIConnections()
{
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &NFMDemodGUI::on_deltaFrequency_changed);
QObject::connect(ui->channelSpacingApply, &QPushButton::clicked, this, &NFMDemodGUI::on_channelSpacingApply_clicked);
QObject::connect(ui->rfBW, &QSlider::valueChanged, this, &NFMDemodGUI::on_rfBW_valueChanged);
QObject::connect(ui->afBW, &QSlider::valueChanged, this, &NFMDemodGUI::on_afBW_valueChanged);
QObject::connect(ui->fmDev, &QSlider::valueChanged, this, &NFMDemodGUI::on_fmDev_valueChanged);
QObject::connect(ui->volume, &QDial::valueChanged, this, &NFMDemodGUI::on_volume_valueChanged);
QObject::connect(ui->squelchGate, &QDial::valueChanged, this, &NFMDemodGUI::on_squelchGate_valueChanged);
QObject::connect(ui->deltaSquelch, &ButtonSwitch::toggled, this, &NFMDemodGUI::on_deltaSquelch_toggled);
QObject::connect(ui->squelch, &QDial::valueChanged, this, &NFMDemodGUI::on_squelch_valueChanged);
QObject::connect(ui->ctcss, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &NFMDemodGUI::on_ctcss_currentIndexChanged);
QObject::connect(ui->ctcssOn, &QCheckBox::toggled, this, &NFMDemodGUI::on_ctcssOn_toggled);
QObject::connect(ui->dcsOn, &QCheckBox::toggled, this, &NFMDemodGUI::on_dcsOn_toggled);
QObject::connect(ui->dcsCode, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &NFMDemodGUI::on_dcsCode_currentIndexChanged);
QObject::connect(ui->highPassFilter, &ButtonSwitch::toggled, this, &NFMDemodGUI::on_highPassFilter_toggled);
QObject::connect(ui->audioMute, &QToolButton::toggled, this, &NFMDemodGUI::on_audioMute_toggled);
}

View File

@ -30,6 +30,12 @@ public:
QByteArray serialize() const;
bool deserialize(const QByteArray& data);
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
virtual QString getTitle() const { return m_settings.m_title; };
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
public slots:
void channelMarkerChangedByCursor();
@ -63,6 +69,7 @@ private:
void setCtcssFreq(Real ctcssFreq);
void setDcsCode(unsigned int dcsCode);
bool handleMessage(const Message& message);
void makeUIConnections();
void leaveEvent(QEvent*);
void enterEvent(QEvent*);

View File

@ -1,25 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>NFMDemodGUI</class>
<widget class="RollupWidget" name="NFMDemodGUI">
<widget class="RollupContents" name="NFMDemodGUI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>364</width>
<height>200</height>
<width>360</width>
<height>197</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>364</width>
<height>200</height>
<width>360</width>
<height>0</height>
</size>
</property>
<property name="font">
@ -36,13 +36,13 @@
<rect>
<x>0</x>
<y>0</y>
<width>362</width>
<width>358</width>
<height>191</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>362</width>
<width>358</width>
<height>0</height>
</size>
</property>
@ -778,17 +778,17 @@
</widget>
</widget>
<customwidgets>
<customwidget>
<class>RollupWidget</class>
<extends>QWidget</extends>
<header>gui/rollupwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ValueDialZ</class>
<extends>QWidget</extends>

View File

@ -74,6 +74,7 @@ void NFMDemodSettings::resetToDefaults()
m_reverseAPIPort = 8888;
m_reverseAPIDeviceIndex = 0;
m_reverseAPIChannelIndex = 0;
m_workspaceIndex = 0;
}
QByteArray NFMDemodSettings::serialize() const
@ -113,6 +114,9 @@ QByteArray NFMDemodSettings::serialize() const
s.writeBlob(26, m_rollupState->serialize());
}
s.writeS32(27, m_workspaceIndex);
s.writeBlob(28, m_geometryBytes);
return s.final();
}
@ -182,6 +186,9 @@ bool NFMDemodSettings::deserialize(const QByteArray& data)
m_rollupState->deserialize(bytetmp);
}
d.readS32(27, &m_workspaceIndex, 0);
d.readBlob(28, &m_geometryBytes);
return true;
}
else

View File

@ -54,6 +54,8 @@ struct NFMDemodSettings
uint16_t m_reverseAPIPort;
uint16_t m_reverseAPIDeviceIndex;
uint16_t m_reverseAPIChannelIndex;
int m_workspaceIndex;
QByteArray m_geometryBytes;
Serializable *m_channelMarker;
Serializable *m_rollupState;

View File

@ -253,7 +253,7 @@ void PacketDemodGUI::channelMarkerChangedByCursor()
void PacketDemodGUI::channelMarkerHighlightedByCursor()
{
setHighlighted(m_channelMarker.getHighlighted());
getRollupContents()->setHighlighted(m_channelMarker.getHighlighted());
}
void PacketDemodGUI::on_deltaFrequency_changed(qint64 value)
@ -369,7 +369,7 @@ void PacketDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;
saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}
@ -395,6 +395,7 @@ void PacketDemodGUI::onMenuDialogCalled(const QPoint &p)
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
setWindowTitle(m_settings.m_title);
setTitle(m_channelMarker.getTitle());
setTitleColor(m_settings.m_rgbColor);
applySettings();
@ -426,11 +427,12 @@ PacketDemodGUI::PacketDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, B
m_doApplySettings(true),
m_tickCount(0)
{
ui->setupUi(this);
ui->setupUi(getRollupContents());
getRollupContents()->arrangeRollups();
m_helpURL = "plugins/channelrx/demodpacket/readme.md";
setAttribute(Qt::WA_DeleteOnClose, true);
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
m_packetDemod = reinterpret_cast<PacketDemod*>(rxChannel);
@ -482,6 +484,7 @@ PacketDemodGUI::PacketDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, B
connect(ui->packets->horizontalHeader(), SIGNAL(sectionResized(int, int, int)), SLOT(packets_sectionResized(int, int, int)));
displaySettings();
makeUIConnections();
applySettings(true);
}
@ -515,6 +518,7 @@ void PacketDemodGUI::displaySettings()
setTitleColor(m_settings.m_rgbColor);
setWindowTitle(m_channelMarker.getTitle());
setTitle(m_channelMarker.getTitle());
blockApplySettings(true);
@ -553,7 +557,7 @@ void PacketDemodGUI::displaySettings()
filter();
restoreState(m_rollupState);
getRollupContents()->restoreState(m_rollupState);
blockApplySettings(false);
}
@ -682,3 +686,21 @@ void PacketDemodGUI::on_logOpen_clicked()
}
}
}
void PacketDemodGUI::makeUIConnections()
{
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &PacketDemodGUI::on_deltaFrequency_changed);
QObject::connect(ui->mode, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &PacketDemodGUI::on_mode_currentIndexChanged);
QObject::connect(ui->rfBW, &QSlider::valueChanged, this, &PacketDemodGUI::on_rfBW_valueChanged);
QObject::connect(ui->fmDev, &QSlider::valueChanged, this, &PacketDemodGUI::on_fmDev_valueChanged);
QObject::connect(ui->filterFrom, &QLineEdit::editingFinished, this, &PacketDemodGUI::on_filterFrom_editingFinished);
QObject::connect(ui->filterTo, &QLineEdit::editingFinished, this, &PacketDemodGUI::on_filterTo_editingFinished);
QObject::connect(ui->filterPID, &QCheckBox::stateChanged, this, &PacketDemodGUI::on_filterPID_stateChanged);
QObject::connect(ui->clearTable, &QPushButton::clicked, this, &PacketDemodGUI::on_clearTable_clicked);
QObject::connect(ui->udpEnabled, &QCheckBox::clicked, this, &PacketDemodGUI::on_udpEnabled_clicked);
QObject::connect(ui->udpAddress, &QLineEdit::editingFinished, this, &PacketDemodGUI::on_udpAddress_editingFinished);
QObject::connect(ui->udpPort, &QLineEdit::editingFinished, this, &PacketDemodGUI::on_udpPort_editingFinished);
QObject::connect(ui->logEnable, &ButtonSwitch::clicked, this, &PacketDemodGUI::on_logEnable_clicked);
QObject::connect(ui->logFilename, &QToolButton::clicked, this, &PacketDemodGUI::on_logFilename_clicked);
QObject::connect(ui->logOpen, &QToolButton::clicked, this, &PacketDemodGUI::on_logOpen_clicked);
}

View File

@ -58,6 +58,12 @@ public:
QByteArray serialize() const;
bool deserialize(const QByteArray& data);
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
virtual QString getTitle() const { return m_settings.m_title; };
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
public slots:
void channelMarkerChangedByCursor();
@ -88,6 +94,7 @@ private:
void displayStreamIndex();
void packetReceived(QByteArray packet);
bool handleMessage(const Message& message);
void makeUIConnections();
void leaveEvent(QEvent*);
void enterEvent(QEvent*);

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PacketDemodGUI</class>
<widget class="RollupWidget" name="PacketDemodGUI">
<widget class="RollupContents" name="PacketDemodGUI">
<property name="geometry">
<rect>
<x>0</x>
@ -713,9 +713,9 @@
</widget>
<customwidgets>
<customwidget>
<class>RollupWidget</class>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupwidget.h</header>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
<customwidget>

View File

@ -53,6 +53,7 @@ void PacketDemodSettings::resetToDefaults()
m_reverseAPIPort = 8888;
m_reverseAPIDeviceIndex = 0;
m_reverseAPIChannelIndex = 0;
m_workspaceIndex = 0;
for (int i = 0; i < PACKETDEMOD_COLUMNS; i++)
{
@ -95,6 +96,9 @@ QByteArray PacketDemodSettings::serialize() const
s.writeBlob(27, m_rollupState->serialize());
}
s.writeS32(28, m_workspaceIndex);
s.writeBlob(29, m_geometryBytes);
for (int i = 0; i < PACKETDEMOD_COLUMNS; i++) {
s.writeS32(100 + i, m_columnIndexes[i]);
}
@ -173,6 +177,9 @@ bool PacketDemodSettings::deserialize(const QByteArray& data)
m_rollupState->deserialize(bytetmp);
}
d.readS32(28, &m_workspaceIndex, 0);
d.readBlob(29, &m_geometryBytes);
for (int i = 0; i < PACKETDEMOD_COLUMNS; i++) {
d.readS32(100 + i, &m_columnIndexes[i], i);
}

View File

@ -57,6 +57,8 @@ struct PacketDemodSettings
QString m_logFilename;
bool m_logEnabled;
Serializable *m_rollupState;
int m_workspaceIndex;
QByteArray m_geometryBytes;
int m_columnIndexes[PACKETDEMOD_COLUMNS];//!< How the columns are ordered in the table
int m_columnSizes[PACKETDEMOD_COLUMNS]; //!< Size of the columns in the table

View File

@ -303,7 +303,7 @@ void PagerDemodGUI::channelMarkerChangedByCursor()
void PagerDemodGUI::channelMarkerHighlightedByCursor()
{
setHighlighted(m_channelMarker.getHighlighted());
getRollupContents()->setHighlighted(m_channelMarker.getHighlighted());
}
void PagerDemodGUI::on_deltaFrequency_changed(qint64 value)
@ -420,7 +420,7 @@ void PagerDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
}
}
saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}
@ -446,6 +446,7 @@ void PagerDemodGUI::onMenuDialogCalled(const QPoint &p)
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
setWindowTitle(m_settings.m_title);
setTitle(m_channelMarker.getTitle());
setTitleColor(m_settings.m_rgbColor);
applySettings();
@ -477,11 +478,12 @@ PagerDemodGUI::PagerDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas
m_doApplySettings(true),
m_tickCount(0)
{
ui->setupUi(this);
ui->setupUi(getRollupContents());
getRollupContents()->arrangeRollups();
m_helpURL = "plugins/channelrx/demodpager/readme.md";
setAttribute(Qt::WA_DeleteOnClose, true);
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
m_pagerDemod = reinterpret_cast<PagerDemod*>(rxChannel);
@ -545,6 +547,7 @@ PagerDemodGUI::PagerDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas
ui->scopeContainer->setVisible(false);
displaySettings();
makeUIConnections();
applySettings(true);
}
@ -596,6 +599,7 @@ void PagerDemodGUI::displaySettings()
setTitleColor(m_settings.m_rgbColor);
setWindowTitle(m_channelMarker.getTitle());
setTitle(m_channelMarker.getTitle());
blockApplySettings(true);
@ -645,7 +649,7 @@ void PagerDemodGUI::displaySettings()
filter();
restoreState(m_rollupState);
getRollupContents()->restoreState(m_rollupState);
blockApplySettings(false);
}
@ -797,3 +801,21 @@ void PagerDemodGUI::on_logOpen_clicked()
}
}
}
void PagerDemodGUI::makeUIConnections()
{
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &PagerDemodGUI::on_deltaFrequency_changed);
QObject::connect(ui->rfBW, &QSlider::valueChanged, this, &PagerDemodGUI::on_rfBW_valueChanged);
QObject::connect(ui->fmDev, &QSlider::valueChanged, this, &PagerDemodGUI::on_fmDev_valueChanged);
QObject::connect(ui->baud, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &PagerDemodGUI::on_baud_currentIndexChanged);
QObject::connect(ui->decode, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &PagerDemodGUI::on_decode_currentIndexChanged);
QObject::connect(ui->charset, &QToolButton::clicked, this, &PagerDemodGUI::on_charset_clicked);
QObject::connect(ui->filterAddress, &QLineEdit::editingFinished, this, &PagerDemodGUI::on_filterAddress_editingFinished);
QObject::connect(ui->clearTable, &QToolButton::clicked, this, &PagerDemodGUI::on_clearTable_clicked);
QObject::connect(ui->udpEnabled, &QCheckBox::clicked, this, &PagerDemodGUI::on_udpEnabled_clicked);
QObject::connect(ui->udpAddress, &QLineEdit::editingFinished, this, &PagerDemodGUI::on_udpAddress_editingFinished);
QObject::connect(ui->udpPort, &QLineEdit::editingFinished, this, &PagerDemodGUI::on_udpPort_editingFinished);
QObject::connect(ui->logEnable, &ButtonSwitch::clicked, this, &PagerDemodGUI::on_logEnable_clicked);
QObject::connect(ui->logFilename, &QToolButton::clicked, this, &PagerDemodGUI::on_logFilename_clicked);
QObject::connect(ui->logOpen, &QToolButton::clicked, this, &PagerDemodGUI::on_logOpen_clicked);
}

View File

@ -52,6 +52,12 @@ public:
QByteArray serialize() const;
bool deserialize(const QByteArray& data);
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
virtual QString getTitle() const { return m_settings.m_title; };
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
public slots:
void channelMarkerChangedByCursor();
@ -84,6 +90,7 @@ private:
const QString &numericMessage, const QString &alphaMessage,
int evenParityErrors, int bchParityErrors);
bool handleMessage(const Message& message);
void makeUIConnections();
void leaveEvent(QEvent*);
void enterEvent(QEvent*);

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PagerDemodGUI</class>
<widget class="RollupWidget" name="PagerDemodGUI">
<widget class="RollupContents" name="PagerDemodGUI">
<property name="geometry">
<rect>
<x>0</x>
@ -1013,9 +1013,9 @@
</widget>
<customwidgets>
<customwidget>
<class>RollupWidget</class>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupwidget.h</header>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
<customwidget>

View File

@ -56,6 +56,7 @@ void PagerDemodSettings::resetToDefaults()
m_reverseAPIDeviceIndex = 0;
m_reverseAPIChannelIndex = 0;
m_reverse = false;
m_workspaceIndex = 0;
for (int i = 0; i < PAGERDEMOD_MESSAGE_COLUMNS; i++)
{
@ -103,6 +104,9 @@ QByteArray PagerDemodSettings::serialize() const
s.writeBlob(27, m_rollupState->serialize());
}
s.writeS32(28, m_workspaceIndex);
s.writeBlob(29, m_geometryBytes);
for (int i = 0; i < PAGERDEMOD_MESSAGE_COLUMNS; i++) {
s.writeS32(100 + i, m_messageColumnIndexes[i]);
}
@ -194,6 +198,9 @@ bool PagerDemodSettings::deserialize(const QByteArray& data)
m_rollupState->deserialize(bytetmp);
}
d.readS32(28, &m_workspaceIndex, 0);
d.readBlob(29, &m_geometryBytes);
for (int i = 0; i < PAGERDEMOD_MESSAGE_COLUMNS; i++) {
d.readS32(100 + i, &m_messageColumnIndexes[i], i);
}

View File

@ -67,6 +67,8 @@ struct PagerDemodSettings
QString m_logFilename;
bool m_logEnabled;
Serializable *m_rollupState;
int m_workspaceIndex;
QByteArray m_geometryBytes;
int m_messageColumnIndexes[PAGERDEMOD_MESSAGE_COLUMNS];//!< How the columns are ordered in the table
int m_messageColumnSizes[PAGERDEMOD_MESSAGE_COLUMNS]; //!< Size of the columns in the table

View File

@ -350,7 +350,7 @@ void RadiosondeDemodGUI::channelMarkerChangedByCursor()
void RadiosondeDemodGUI::channelMarkerHighlightedByCursor()
{
setHighlighted(m_channelMarker.getHighlighted());
getRollupContents()->setHighlighted(m_channelMarker.getHighlighted());
}
void RadiosondeDemodGUI::on_deltaFrequency_changed(qint64 value)
@ -477,7 +477,7 @@ void RadiosondeDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
}
}
saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}
@ -503,6 +503,7 @@ void RadiosondeDemodGUI::onMenuDialogCalled(const QPoint &p)
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
setWindowTitle(m_settings.m_title);
setTitle(m_channelMarker.getTitle());
setTitleColor(m_settings.m_rgbColor);
applySettings();
@ -534,11 +535,12 @@ RadiosondeDemodGUI::RadiosondeDemodGUI(PluginAPI* pluginAPI, DeviceUISet *device
m_doApplySettings(true),
m_tickCount(0)
{
ui->setupUi(this);
ui->setupUi(getRollupContents());
getRollupContents()->arrangeRollups();
m_helpURL = "plugins/channelrx/demodradiosonde/readme.md";
setAttribute(Qt::WA_DeleteOnClose, true);
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
m_radiosondeDemod = reinterpret_cast<RadiosondeDemod*>(rxChannel);
@ -634,6 +636,7 @@ RadiosondeDemodGUI::RadiosondeDemodGUI(PluginAPI* pluginAPI, DeviceUISet *device
ui->scopeContainer->setVisible(false);
displaySettings();
makeUIConnections();
applySettings(true);
}
@ -707,6 +710,7 @@ void RadiosondeDemodGUI::displaySettings()
setTitleColor(m_settings.m_rgbColor);
setWindowTitle(m_channelMarker.getTitle());
setTitle(m_channelMarker.getTitle());
blockApplySettings(true);
@ -749,7 +753,7 @@ void RadiosondeDemodGUI::displaySettings()
filter();
restoreState(m_rollupState);
getRollupContents()->restoreState(m_rollupState);
blockApplySettings(false);
}
@ -893,3 +897,20 @@ void RadiosondeDemodGUI::on_logOpen_clicked()
}
}
}
void RadiosondeDemodGUI::makeUIConnections()
{
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &RadiosondeDemodGUI::on_deltaFrequency_changed);
QObject::connect(ui->rfBW, &QSlider::valueChanged, this, &RadiosondeDemodGUI::on_rfBW_valueChanged);
QObject::connect(ui->fmDev, &QSlider::valueChanged, this, &RadiosondeDemodGUI::on_fmDev_valueChanged);
QObject::connect(ui->threshold, &QDial::valueChanged, this, &RadiosondeDemodGUI::on_threshold_valueChanged);
QObject::connect(ui->filterSerial, &QLineEdit::editingFinished, this, &RadiosondeDemodGUI::on_filterSerial_editingFinished);
QObject::connect(ui->clearTable, &QPushButton::clicked, this, &RadiosondeDemodGUI::on_clearTable_clicked);
QObject::connect(ui->udpEnabled, &QCheckBox::clicked, this, &RadiosondeDemodGUI::on_udpEnabled_clicked);
QObject::connect(ui->udpAddress, &QLineEdit::editingFinished, this, &RadiosondeDemodGUI::on_udpAddress_editingFinished);
QObject::connect(ui->udpPort, &QLineEdit::editingFinished, this, &RadiosondeDemodGUI::on_udpPort_editingFinished);
QObject::connect(ui->frames, &QTableWidget::cellDoubleClicked, this, &RadiosondeDemodGUI::on_frames_cellDoubleClicked);
QObject::connect(ui->logEnable, &ButtonSwitch::clicked, this, &RadiosondeDemodGUI::on_logEnable_clicked);
QObject::connect(ui->logFilename, &QToolButton::clicked, this, &RadiosondeDemodGUI::on_logFilename_clicked);
QObject::connect(ui->logOpen, &QToolButton::clicked, this, &RadiosondeDemodGUI::on_logOpen_clicked);
}

View File

@ -54,6 +54,12 @@ public:
QByteArray serialize() const;
bool deserialize(const QByteArray& data);
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
virtual QString getTitle() const { return m_settings.m_title; };
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
public slots:
void channelMarkerChangedByCursor();
@ -87,6 +93,7 @@ private:
void displayStreamIndex();
void frameReceived(const QByteArray& frame, const QDateTime& dateTime, int errorsCorrected, int threshold);
bool handleMessage(const Message& message);
void makeUIConnections();
void leaveEvent(QEvent*);
void enterEvent(QEvent*);

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>RadiosondeDemodGUI</class>
<widget class="RollupWidget" name="RadiosondeDemodGUI">
<widget class="RollupContents" name="RadiosondeDemodGUI">
<property name="geometry">
<rect>
<x>0</x>
@ -1055,9 +1055,9 @@
</widget>
<customwidgets>
<customwidget>
<class>RollupWidget</class>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupwidget.h</header>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
<customwidget>

View File

@ -54,6 +54,7 @@ void RadiosondeDemodSettings::resetToDefaults()
m_reverseAPIPort = 8888;
m_reverseAPIDeviceIndex = 0;
m_reverseAPIChannelIndex = 0;
m_workspaceIndex = 0;
for (int i = 0; i < RADIOSONDEDEMOD_FRAME_COLUMNS; i++)
{
@ -98,6 +99,9 @@ QByteArray RadiosondeDemodSettings::serialize() const
s.writeBlob(25, m_rollupState->serialize());
}
s.writeS32(26, m_workspaceIndex);
s.writeBlob(27, m_geometryBytes);
for (int i = 0; i < RADIOSONDEDEMOD_FRAME_COLUMNS; i++)
s.writeS32(100 + i, m_frameColumnIndexes[i]);
for (int i = 0; i < RADIOSONDEDEMOD_FRAME_COLUMNS; i++)
@ -180,6 +184,9 @@ bool RadiosondeDemodSettings::deserialize(const QByteArray& data)
m_rollupState->deserialize(bytetmp);
}
d.readS32(26, &m_workspaceIndex, 0);
d.readBlob(27, &m_geometryBytes);
for (int i = 0; i < RADIOSONDEDEMOD_FRAME_COLUMNS; i++) {
d.readS32(100 + i, &m_frameColumnIndexes[i], i);
}

View File

@ -57,6 +57,8 @@ struct RadiosondeDemodSettings
uint16_t m_reverseAPIChannelIndex;
Serializable *m_scopeGUI;
Serializable *m_rollupState;
int m_workspaceIndex;
QByteArray m_geometryBytes;
int m_frameColumnIndexes[RADIOSONDEDEMOD_FRAME_COLUMNS];//!< How the columns are ordered in the table
int m_frameColumnSizes[RADIOSONDEDEMOD_FRAME_COLUMNS]; //!< Size of the columns in the table

View File

@ -112,7 +112,7 @@ void SSBDemodGUI::channelMarkerChangedByCursor()
void SSBDemodGUI::channelMarkerHighlightedByCursor()
{
setHighlighted(m_channelMarker.getHighlighted());
getRollupContents()->setHighlighted(m_channelMarker.getHighlighted());
}
void SSBDemodGUI::on_audioBinaural_toggled(bool binaural)
@ -249,6 +249,7 @@ void SSBDemodGUI::onMenuDialogCalled(const QPoint &p)
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
setWindowTitle(m_settings.m_title);
setTitle(m_channelMarker.getTitle());
setTitleColor(m_settings.m_rgbColor);
applySettings();
@ -276,7 +277,7 @@ void SSBDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;
saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}
@ -294,10 +295,11 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_squelchOpen(false),
m_audioSampleRate(-1)
{
ui->setupUi(this);
ui->setupUi(getRollupContents());
getRollupContents()->arrangeRollups();
m_helpURL = "plugins/channelrx/demodssb/readme.md";
setAttribute(Qt::WA_DeleteOnClose, true);
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
m_ssbDemod = (SSBDemod*) rxChannel;
@ -352,6 +354,8 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
ui->BW->setMaximum(480);
ui->lowCut->setMaximum(480);
displaySettings();
makeUIConnections();
applyBandwidths(m_settings.m_spanLog2, true); // does applySettings(true)
}
@ -520,6 +524,7 @@ void SSBDemodGUI::displaySettings()
setTitleColor(m_settings.m_rgbColor);
setWindowTitle(m_channelMarker.getTitle());
setTitle(m_channelMarker.getTitle());
blockApplySettings(true);
@ -575,7 +580,7 @@ void SSBDemodGUI::displaySettings()
displayStreamIndex();
restoreState(m_rollupState);
getRollupContents()->restoreState(m_rollupState);
blockApplySettings(false);
}
@ -673,3 +678,21 @@ void SSBDemodGUI::tick()
m_tickCount++;
}
void SSBDemodGUI::makeUIConnections()
{
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &SSBDemodGUI::on_deltaFrequency_changed);
QObject::connect(ui->audioBinaural, &QToolButton::toggled, this, &SSBDemodGUI::on_audioBinaural_toggled);
QObject::connect(ui->audioFlipChannels, &QToolButton::toggled, this, &SSBDemodGUI::on_audioFlipChannels_toggled);
QObject::connect(ui->dsb, &QToolButton::toggled, this, &SSBDemodGUI::on_dsb_toggled);
QObject::connect(ui->BW, &TickedSlider::valueChanged, this, &SSBDemodGUI::on_BW_valueChanged);
QObject::connect(ui->lowCut, &TickedSlider::valueChanged, this, &SSBDemodGUI::on_lowCut_valueChanged);
QObject::connect(ui->volume, &QDial::valueChanged, this, &SSBDemodGUI::on_volume_valueChanged);
QObject::connect(ui->agc, &ButtonSwitch::toggled, this, &SSBDemodGUI::on_agc_toggled);
QObject::connect(ui->agcClamping, &ButtonSwitch::toggled, this, &SSBDemodGUI::on_agcClamping_toggled);
QObject::connect(ui->agcPowerThreshold, &QDial::valueChanged, this, &SSBDemodGUI::on_agcPowerThreshold_valueChanged);
QObject::connect(ui->agcThresholdGate, &QDial::valueChanged, this, &SSBDemodGUI::on_agcThresholdGate_valueChanged);
QObject::connect(ui->audioMute, &QToolButton::toggled, this, &SSBDemodGUI::on_audioMute_toggled);
QObject::connect(ui->spanLog2, &QSlider::valueChanged, this, &SSBDemodGUI::on_spanLog2_valueChanged);
QObject::connect(ui->flipSidebands, &QPushButton::clicked, this, &SSBDemodGUI::on_flipSidebands_clicked);
}

View File

@ -33,6 +33,12 @@ public:
QByteArray serialize() const;
bool deserialize(const QByteArray& data);
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
virtual QString getTitle() const { return m_settings.m_title; };
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
public slots:
void channelMarkerChangedByCursor();
@ -73,6 +79,7 @@ private:
void displayAGCPowerThreshold(int value);
void displayAGCThresholdGate(int value);
bool handleMessage(const Message& message);
void makeUIConnections();
void leaveEvent(QEvent*);
void enterEvent(QEvent*);

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SSBDemodGUI</class>
<widget class="RollupWidget" name="SSBDemodGUI">
<widget class="RollupContents" name="SSBDemodGUI">
<property name="geometry">
<rect>
<x>0</x>
@ -11,7 +11,7 @@
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -530,6 +530,7 @@
</property>
<property name="font">
<font>
<family>Liberation Sans</family>
<pointsize>8</pointsize>
</font>
</property>
@ -551,6 +552,7 @@
</property>
<property name="font">
<font>
<family>Liberation Sans</family>
<pointsize>8</pointsize>
</font>
</property>
@ -563,6 +565,7 @@
<widget class="QLabel" name="lsbLabel">
<property name="font">
<font>
<family>Liberation Sans</family>
<pointsize>8</pointsize>
</font>
</property>
@ -584,6 +587,7 @@
</property>
<property name="font">
<font>
<family>Liberation Sans</family>
<pointsize>8</pointsize>
</font>
</property>
@ -599,6 +603,7 @@
<widget class="QLabel" name="usbLabel">
<property name="font">
<font>
<family>Liberation Sans</family>
<pointsize>8</pointsize>
</font>
</property>
@ -620,6 +625,7 @@
</property>
<property name="font">
<font>
<family>Liberation Sans</family>
<pointsize>8</pointsize>
</font>
</property>
@ -915,6 +921,12 @@
<height>284</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Channel Spectrum</string>
</property>
@ -936,6 +948,12 @@
</property>
<item>
<widget class="GLSpectrum" name="glSpectrum" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
@ -958,9 +976,20 @@
</widget>
<customwidgets>
<customwidget>
<class>RollupWidget</class>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupwidget.h</header>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ValueDialZ</class>
<extends>QWidget</extends>
<header>gui/valuedialz.h</header>
<container>1</container>
</customwidget>
<customwidget>
@ -981,17 +1010,6 @@
<header>gui/glspectrumgui.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ValueDialZ</class>
<extends>QWidget</extends>
<header>gui/valuedialz.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>TickedSlider</class>
<extends>QSlider</extends>

View File

@ -63,6 +63,7 @@ void SSBDemodSettings::resetToDefaults()
m_reverseAPIPort = 8888;
m_reverseAPIDeviceIndex = 0;
m_reverseAPIChannelIndex = 0;
m_workspaceIndex = 0;
}
QByteArray SSBDemodSettings::serialize() const
@ -100,6 +101,9 @@ QByteArray SSBDemodSettings::serialize() const
s.writeBlob(24, m_rollupState->serialize());
}
s.writeS32(25, m_workspaceIndex);
s.writeBlob(26, m_geometryBytes);
return s.final();
}
@ -168,6 +172,9 @@ bool SSBDemodSettings::deserialize(const QByteArray& data)
m_rollupState->deserialize(bytetmp);
}
d.readS32(25, &m_workspaceIndex, 0);
d.readBlob(26, &m_geometryBytes);
return true;
}
else

View File

@ -47,6 +47,8 @@ struct SSBDemodSettings
uint16_t m_reverseAPIPort;
uint16_t m_reverseAPIDeviceIndex;
uint16_t m_reverseAPIChannelIndex;
int m_workspaceIndex;
QByteArray m_geometryBytes;
Serializable *m_channelMarker;
Serializable *m_spectrumGUI;

View File

@ -887,7 +887,7 @@ void VORDemodGUI::channelMarkerChangedByCursor()
void VORDemodGUI::channelMarkerHighlightedByCursor()
{
setHighlighted(m_channelMarker.getHighlighted());
getRollupContents()->setHighlighted(m_channelMarker.getHighlighted());
}
void VORDemodGUI::on_thresh_valueChanged(int value)
@ -1105,7 +1105,7 @@ void VORDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;
saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}
@ -1131,6 +1131,7 @@ void VORDemodGUI::onMenuDialogCalled(const QPoint &p)
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
setWindowTitle(m_settings.m_title);
setTitle(m_channelMarker.getTitle());
setTitleColor(m_settings.m_rgbColor);
applySettings();
@ -1166,7 +1167,8 @@ VORDemodGUI::VORDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_vorModel(this),
m_vors(nullptr)
{
ui->setupUi(this);
ui->setupUi(getRollupContents());
getRollupContents()->arrangeRollups();
m_helpURL = "plugins/channelrx/demodvor/readme.md";
ui->map->rootContext()->setContextProperty("vorModel", &m_vorModel);
@ -1176,7 +1178,7 @@ VORDemodGUI::VORDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_muteIcon.addPixmap(QPixmap("://sound_on.png"), QIcon::Normal, QIcon::Off);
setAttribute(Qt::WA_DeleteOnClose, true);
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
connect(&m_dlm, &HttpDownloadManager::downloadComplete, this, &VORDemodGUI::downloadFinished);
@ -1272,6 +1274,7 @@ VORDemodGUI::VORDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
connect(ui->vorData->horizontalHeader(), SIGNAL(sectionResized(int, int, int)), SLOT(vorData_sectionResized(int, int, int)));
displaySettings();
makeUIConnections();
applySettings(true);
}
@ -1305,6 +1308,7 @@ void VORDemodGUI::displaySettings()
setTitleColor(m_settings.m_rgbColor);
setWindowTitle(m_channelMarker.getTitle());
setTitle(m_channelMarker.getTitle());
blockApplySettings(true);
@ -1333,7 +1337,7 @@ void VORDemodGUI::displaySettings()
header->moveSection(header->visualIndex(i), m_settings.m_columnIndexes[i]);
}
restoreState(m_rollupState);
getRollupContents()->restoreState(m_rollupState);
blockApplySettings(false);
}
@ -1425,3 +1429,15 @@ void VORDemodGUI::tick()
m_tickCount++;
}
void VORDemodGUI::makeUIConnections()
{
QObject::connect(ui->audioMute, &QToolButton::toggled, this, &VORDemodGUI::on_audioMute_toggled);
QObject::connect(ui->thresh, &QDial::valueChanged, this, &VORDemodGUI::on_thresh_valueChanged);
QObject::connect(ui->volume, &QDial::valueChanged, this, &VORDemodGUI::on_volume_valueChanged);
QObject::connect(ui->squelch, &QDial::valueChanged, this, &VORDemodGUI::on_squelch_valueChanged);
QObject::connect(ui->audioMute, &QToolButton::toggled, this, &VORDemodGUI::on_audioMute_toggled);
QObject::connect(ui->getOurAirportsVORDB, &QPushButton::clicked, this, &VORDemodGUI::on_getOurAirportsVORDB_clicked);
QObject::connect(ui->getOpenAIPVORDB, &QPushButton::clicked, this, &VORDemodGUI::on_getOpenAIPVORDB_clicked);
QObject::connect(ui->magDecAdjust, &QPushButton::clicked, this, &VORDemodGUI::on_magDecAdjust_clicked);
}

View File

@ -211,6 +211,13 @@ public:
QByteArray serialize() const;
bool deserialize(const QByteArray& data);
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
virtual QString getTitle() const { return m_settings.m_title; };
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
void selectVOR(VORGUI *vorGUI, bool selected);
public slots:
@ -253,6 +260,7 @@ private:
void displaySettings();
void displayStreamIndex();
bool handleMessage(const Message& message);
void makeUIConnections();
void leaveEvent(QEvent*);
void enterEvent(QEvent*);

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>VORDemodGUI</class>
<widget class="RollupWidget" name="VORDemodGUI">
<widget class="RollupContents" name="VORDemodGUI">
<property name="geometry">
<rect>
<x>0</x>
@ -593,9 +593,9 @@
<header location="global">QtQuickWidgets/QQuickWidget</header>
</customwidget>
<customwidget>
<class>RollupWidget</class>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupwidget.h</header>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
<customwidget>

View File

@ -44,6 +44,7 @@ void VORDemodSettings::resetToDefaults()
m_reverseAPIPort = 8888;
m_reverseAPIDeviceIndex = 0;
m_reverseAPIChannelIndex = 0;
m_workspaceIndex = 0;
m_identThreshold = 2.0;
m_refThresholdDB = -45.0;
@ -85,6 +86,9 @@ QByteArray VORDemodSettings::serialize() const
s.writeBlob(24, m_rollupState->serialize());
}
s.writeS32(25, m_workspaceIndex);
s.writeBlob(26, m_geometryBytes);
for (int i = 0; i < VORDEMOD_COLUMNS; i++) {
s.writeS32(100 + i, m_columnIndexes[i]);
}
@ -153,6 +157,9 @@ bool VORDemodSettings::deserialize(const QByteArray& data)
m_rollupState->deserialize(bytetmp);
}
d.readS32(25, &m_workspaceIndex, 0);
d.readBlob(26, &m_geometryBytes);
for (int i = 0; i < VORDEMOD_COLUMNS; i++) {
d.readS32(100 + i, &m_columnIndexes[i], i);
}

View File

@ -54,6 +54,8 @@ struct VORDemodSettings
Real m_varThresholdDB; //!< Threshold in dB for valid VOR variable signal
bool m_magDecAdjust; //!< Adjust for magnetic declination when drawing radials on the map
Serializable *m_rollupState;
int m_workspaceIndex;
QByteArray m_geometryBytes;
int m_columnIndexes[VORDEMOD_COLUMNS];//!< How the columns are ordered in the table
int m_columnSizes[VORDEMOD_COLUMNS]; //!< Size of the coumns in the table

View File

@ -181,7 +181,7 @@ void VORDemodSCGUI::channelMarkerChangedByCursor()
void VORDemodSCGUI::channelMarkerHighlightedByCursor()
{
setHighlighted(m_channelMarker.getHighlighted());
getRollupContents()->setHighlighted(m_channelMarker.getHighlighted());
}
void VORDemodSCGUI::on_deltaFrequency_changed(qint64 value)
@ -223,7 +223,7 @@ void VORDemodSCGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;
saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}
@ -249,6 +249,7 @@ void VORDemodSCGUI::onMenuDialogCalled(const QPoint &p)
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
setWindowTitle(m_settings.m_title);
setTitle(m_channelMarker.getTitle());
setTitleColor(m_settings.m_rgbColor);
applySettings();
@ -281,11 +282,12 @@ VORDemodSCGUI::VORDemodSCGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas
m_squelchOpen(false),
m_tickCount(0)
{
ui->setupUi(this);
ui->setupUi(getRollupContents());
getRollupContents()->arrangeRollups();
m_helpURL = "plugins/channelrx/demodvorsc/readme.md";
setAttribute(Qt::WA_DeleteOnClose, true);
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
m_vorDemod = reinterpret_cast<VORDemodSC*>(rxChannel);
@ -321,6 +323,7 @@ VORDemodSCGUI::VORDemodSCGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
displaySettings();
makeUIConnections();
applySettings(true);
}
@ -354,6 +357,7 @@ void VORDemodSCGUI::displaySettings()
setTitleColor(m_settings.m_rgbColor);
setWindowTitle(m_channelMarker.getTitle());
setTitle(m_channelMarker.getTitle());
blockApplySettings(true);
@ -372,7 +376,7 @@ void VORDemodSCGUI::displaySettings()
displayStreamIndex();
restoreState(m_rollupState);
getRollupContents()->restoreState(m_rollupState);
blockApplySettings(false);
}
@ -443,3 +447,12 @@ void VORDemodSCGUI::tick()
m_tickCount++;
}
void VORDemodSCGUI::makeUIConnections()
{
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &VORDemodSCGUI::on_deltaFrequency_changed);
QObject::connect(ui->thresh, &QDial::valueChanged, this, &VORDemodSCGUI::on_thresh_valueChanged);
QObject::connect(ui->volume, &QDial::valueChanged, this, &VORDemodSCGUI::on_volume_valueChanged);
QObject::connect(ui->squelch, &QDial::valueChanged, this, &VORDemodSCGUI::on_squelch_valueChanged);
QObject::connect(ui->audioMute, &QToolButton::toggled, this, &VORDemodSCGUI::on_audioMute_toggled);
}

View File

@ -48,6 +48,12 @@ public:
QByteArray serialize() const;
bool deserialize(const QByteArray& data);
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
virtual QString getTitle() const { return m_settings.m_title; };
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
public slots:
void channelMarkerChangedByCursor();
@ -76,6 +82,7 @@ private:
void displaySettings();
void displayStreamIndex();
bool handleMessage(const Message& message);
void makeUIConnections();
void leaveEvent(QEvent*);
void enterEvent(QEvent*);

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>VORDemodSCGUI</class>
<widget class="RollupWidget" name="VORDemodSCGUI">
<widget class="RollupContents" name="VORDemodSCGUI">
<property name="geometry">
<rect>
<x>0</x>
@ -614,9 +614,9 @@
</widget>
<customwidgets>
<customwidget>
<class>RollupWidget</class>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupwidget.h</header>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
<customwidget>

View File

@ -46,6 +46,7 @@ void VORDemodSCSettings::resetToDefaults()
m_reverseAPIPort = 8888;
m_reverseAPIDeviceIndex = 0;
m_reverseAPIChannelIndex = 0;
m_workspaceIndex = 0;
m_identThreshold = 2.0;
m_refThresholdDB = -45.0;
@ -80,6 +81,9 @@ QByteArray VORDemodSCSettings::serialize() const
s.writeBlob(23, m_rollupState->serialize());
}
s.writeS32(24, m_workspaceIndex);
s.writeBlob(25, m_geometryBytes);
return s.final();
}
@ -140,6 +144,9 @@ bool VORDemodSCSettings::deserialize(const QByteArray& data)
m_rollupState->deserialize(bytetmp);
}
d.readS32(24, &m_workspaceIndex, 0);
d.readBlob(25, &m_geometryBytes);
return true;
}
else

Some files were not shown because too many files have changed in this diff Show More