1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 01:18:38 -05:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Edouard Griffiths
8715f4c037
Merge pull request #1083 from srcejon/status_opengl_version
Display OpenGL version in status bar.
2021-12-13 12:46:33 +01:00
Jon Beniston
bb3bc6e527 Display OpenGL version in status bar. Displayed in red if less than version 3. 2021-12-13 10:23:05 +00:00
Edouard Griffiths
023ca69156
Merge pull request #1082 from srcejon/check_sample_rate
Display warnings in ADS-B and DAB if sample rate is too low
2021-12-13 10:48:49 +01:00
Jon Beniston
2b55140d9d Display warnings in ADS-B and DAB if sample rate is too low 2021-12-13 08:44:17 +00:00
8 changed files with 87 additions and 11 deletions

View File

@ -40,6 +40,7 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts); // Needed for WebGL in QWebEngineView and MainWindow::openGLVersion
#endif #endif
QApplication a(argc, argv); QApplication a(argc, argv);

View File

@ -150,6 +150,10 @@ bool ADSBDemod::handleMessage(const Message& cmd)
DSPSignalNotification* rep = new DSPSignalNotification(notif); // make a copy DSPSignalNotification* rep = new DSPSignalNotification(notif); // make a copy
qDebug() << "ADSBDemod::handleMessage: DSPSignalNotification"; qDebug() << "ADSBDemod::handleMessage: DSPSignalNotification";
m_basebandSink->getInputMessageQueue()->push(rep); m_basebandSink->getInputMessageQueue()->push(rep);
// Forward to GUI if any
if (m_guiMessageQueue) {
m_guiMessageQueue->push(new DSPSignalNotification(notif));
}
return true; return true;
} }

View File

@ -46,6 +46,7 @@
#include "gui/crightclickenabler.h" #include "gui/crightclickenabler.h"
#include "gui/clickablelabel.h" #include "gui/clickablelabel.h"
#include "dsp/dspengine.h" #include "dsp/dspengine.h"
#include "dsp/dspcommands.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "adsbdemodreport.h" #include "adsbdemodreport.h"
@ -1535,7 +1536,20 @@ QString ADSBDemodGUI::subAircraftString(Aircraft *aircraft, const QString &strin
bool ADSBDemodGUI::handleMessage(const Message& message) bool ADSBDemodGUI::handleMessage(const Message& message)
{ {
if (ADSBDemodReport::MsgReportADSB::match(message)) if (DSPSignalNotification::match(message))
{
DSPSignalNotification& notif = (DSPSignalNotification&) message;
bool srTooLow = notif.getSampleRate() < 2000000;
ui->warning->setVisible(srTooLow);
if (srTooLow) {
ui->warning->setText("Sample rate must be >= 2000000");
} else {
ui->warning->setText("");
}
arrangeRollups();
return true;
}
else if (ADSBDemodReport::MsgReportADSB::match(message))
{ {
ADSBDemodReport::MsgReportADSB& report = (ADSBDemodReport::MsgReportADSB&) message; ADSBDemodReport::MsgReportADSB& report = (ADSBDemodReport::MsgReportADSB&) message;
handleADSB( handleADSB(
@ -2542,6 +2556,9 @@ ADSBDemodGUI::ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb
ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue); ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue);
ui->warning->setVisible(false);
ui->warning->setStyleSheet("QLabel { background-color: red; }");
ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03))); ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03)));
ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999); ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);

View File

@ -744,6 +744,13 @@
</item> </item>
</layout> </layout>
</item> </item>
<item>
<widget class="QLabel" name="warning">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="dataContainer" native="true"> <widget class="QWidget" name="dataContainer" native="true">
@ -1276,11 +1283,6 @@
<extends>QToolButton</extends> <extends>QToolButton</extends>
<header>gui/buttonswitch.h</header> <header>gui/buttonswitch.h</header>
</customwidget> </customwidget>
<customwidget>
<class>ClickableLabel</class>
<extends>QLabel</extends>
<header>gui/clickablelabel.h</header>
</customwidget>
<customwidget> <customwidget>
<class>ValueDialZ</class> <class>ValueDialZ</class>
<extends>QWidget</extends> <extends>QWidget</extends>
@ -1293,6 +1295,11 @@
<header>gui/levelmeter.h</header> <header>gui/levelmeter.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget>
<class>ClickableLabel</class>
<extends>QLabel</extends>
<header>gui/clickablelabel.h</header>
</customwidget>
</customwidgets> </customwidgets>
<tabstops> <tabstops>
<tabstop>deltaFrequency</tabstop> <tabstop>deltaFrequency</tabstop>

View File

@ -35,7 +35,6 @@
#include "gui/audioselectdialog.h" #include "gui/audioselectdialog.h"
#include "gui/basicchannelsettingsdialog.h" #include "gui/basicchannelsettingsdialog.h"
#include "gui/devicestreamselectiondialog.h" #include "gui/devicestreamselectiondialog.h"
#include "dsp/dspengine.h"
#include "gui/crightclickenabler.h" #include "gui/crightclickenabler.h"
#include "channel/channelwebapiutils.h" #include "channel/channelwebapiutils.h"
#include "maincore.h" #include "maincore.h"
@ -202,6 +201,14 @@ bool DABDemodGUI::handleMessage(const Message& message)
{ {
DSPSignalNotification& notif = (DSPSignalNotification&) message; DSPSignalNotification& notif = (DSPSignalNotification&) message;
m_basebandSampleRate = notif.getSampleRate(); m_basebandSampleRate = notif.getSampleRate();
bool srTooLow = m_basebandSampleRate < 2048000;
ui->warning->setVisible(srTooLow);
if (srTooLow) {
ui->warning->setText("Sample rate must be >= 2048000");
} else {
ui->warning->setText("");
}
arrangeRollups();
return true; return true;
} }
else if (DABDemod::MsgDABEnsembleName::match(message)) else if (DABDemod::MsgDABEnsembleName::match(message))
@ -450,6 +457,9 @@ DABDemodGUI::DABDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); // 50 ms connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); // 50 ms
ui->warning->setVisible(false);
ui->warning->setStyleSheet("QLabel { background-color: red; }");
ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03))); ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03)));
ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999); ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);

View File

@ -43,7 +43,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>390</width> <width>390</width>
<height>131</height> <height>151</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
@ -610,13 +610,20 @@
</item> </item>
</layout> </layout>
</item> </item>
<item>
<widget class="QLabel" name="warning">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="programContainer" native="true"> <widget class="QWidget" name="programContainer" native="true">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>140</y> <y>160</y>
<width>381</width> <width>381</width>
<height>211</height> <height>211</height>
</rect> </rect>

View File

@ -865,14 +865,43 @@ void MainWindow::saveCommandSettings()
{ {
} }
QString MainWindow::openGLVersion()
{
QOpenGLContext *glCurrentContext = QOpenGLContext::globalShareContext();
if (glCurrentContext)
{
if (glCurrentContext->isValid())
{
int major = glCurrentContext->format().majorVersion();
int minor = glCurrentContext->format().minorVersion();
bool es = glCurrentContext->isOpenGLES();
QString version = QString("%1.%2%3").arg(major).arg(minor).arg(es ? " ES" : "");
// Waterfall doesn't work if major version is less than 3, so display in red
if (major < 3) {
version = "<span style=\"color:red\">" + version + "</span>";
}
return version;
}
else
{
return "N/A";
}
}
else
{
return "N/A";
}
}
void MainWindow::createStatusBar() void MainWindow::createStatusBar()
{ {
QString qtVersionStr = QString("Qt %1 ").arg(QT_VERSION_STR); QString qtVersionStr = QString("Qt %1 ").arg(QT_VERSION_STR);
QString openGLVersionStr = QString("OpenGL %1 ").arg(openGLVersion());
#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) #if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
m_showSystemWidget = new QLabel("SDRangel " + qApp->applicationVersion() + " " + qtVersionStr m_showSystemWidget = new QLabel("SDRangel " + qApp->applicationVersion() + " " + qtVersionStr + openGLVersionStr
+ QSysInfo::currentCpuArchitecture() + " " + QSysInfo::prettyProductName(), this); + QSysInfo::currentCpuArchitecture() + " " + QSysInfo::prettyProductName(), this);
#else #else
m_showSystemWidget = new QLabel("SDRangel " + qApp->applicationVersion() + " " + qtVersionStr, this); m_showSystemWidget = new QLabel("SDRangel " + qApp->applicationVersion() + " " + qtVersionStr + openGLVersionStr, this);
#endif #endif
statusBar()->addPermanentWidget(m_showSystemWidget); statusBar()->addPermanentWidget(m_showSystemWidget);

View File

@ -129,6 +129,7 @@ private:
void saveFeatureSetPresetSettings(FeatureSetPreset* preset, int featureSetIndex); void saveFeatureSetPresetSettings(FeatureSetPreset* preset, int featureSetIndex);
void saveCommandSettings(); void saveCommandSettings();
QString openGLVersion();
void createStatusBar(); void createStatusBar();
void closeEvent(QCloseEvent*); void closeEvent(QCloseEvent*);
void updatePresetControls(); void updatePresetControls();