diff --git a/doc/img/APTDemod_plugin.png b/doc/img/APTDemod_plugin.png index 24d98125b..573fb0dc7 100644 Binary files a/doc/img/APTDemod_plugin.png and b/doc/img/APTDemod_plugin.png differ diff --git a/doc/img/APTDemod_plugin_settings.png b/doc/img/APTDemod_plugin_settings.png index 5934b4e54..fed33a7cf 100644 Binary files a/doc/img/APTDemod_plugin_settings.png and b/doc/img/APTDemod_plugin_settings.png differ diff --git a/doc/img/RadioClock_waveforms.png b/doc/img/RadioClock_waveforms.png new file mode 100644 index 000000000..365890455 Binary files /dev/null and b/doc/img/RadioClock_waveforms.png differ diff --git a/plugins/channelrx/demodapt/aptdemod.cpp b/plugins/channelrx/demodapt/aptdemod.cpp index 11c99bb1b..4fbe8fec6 100644 --- a/plugins/channelrx/demodapt/aptdemod.cpp +++ b/plugins/channelrx/demodapt/aptdemod.cpp @@ -584,6 +584,7 @@ int APTDemod::webapiActionsPost( { SWGSDRangel::SWGAPTDemodActions_aos* aos = swgAPTDemodActions->getAos(); QString *satelliteName = aos->getSatelliteName(); + qDebug() << "APTDemod::webapiActionsPost - AOS " << *satelliteName; if (satelliteName != nullptr) { if (matchSatellite(*satelliteName)) @@ -617,6 +618,7 @@ int APTDemod::webapiActionsPost( { SWGSDRangel::SWGAPTDemodActions_los* los = swgAPTDemodActions->getLos(); QString *satelliteName = los->getSatelliteName(); + qDebug() << "APTDemod::webapiActionsPost - LOS " << *satelliteName; if (satelliteName != nullptr) { diff --git a/plugins/channelrx/demodapt/aptdemodgui.cpp b/plugins/channelrx/demodapt/aptdemodgui.cpp index fcbc9c175..163332c61 100644 --- a/plugins/channelrx/demodapt/aptdemodgui.cpp +++ b/plugins/channelrx/demodapt/aptdemodgui.cpp @@ -25,9 +25,10 @@ #include #include #include +#include +#include #include "aptdemodgui.h" -#include "util/ax25.h" #include "device/deviceuiset.h" #include "dsp/dspengine.h" @@ -42,6 +43,7 @@ #include "gui/devicestreamselectiondialog.h" #include "dsp/dspengine.h" #include "gui/crightclickenabler.h" +#include "gui/graphicsviewzoom.h" #include "channel/channelwebapiutils.h" #include "maincore.h" @@ -101,7 +103,20 @@ bool APTDemodGUI::handleMessage(const Message& message) const APTDemod::MsgImage& imageMsg = (APTDemod::MsgImage&) message; m_image = imageMsg.getImage(); m_pixmap.convertFromImage(m_image); - ui->image->setPixmap(m_pixmap); + if (m_pixmapItem != nullptr) + { + m_pixmapItem->setPixmap(m_pixmap); + if (ui->zoomAll->isChecked()) { + ui->image->fitInView(m_pixmapItem, Qt::KeepAspectRatio); + } + } + else + { + m_pixmapItem = m_scene->addPixmap(m_pixmap); + m_pixmapItem->setPos(0, 0); + ui->image->fitInView(m_pixmapItem, Qt::KeepAspectRatio); + } + QStringList imageTypes = imageMsg.getImageTypes(); if (imageTypes.size() == 0) { @@ -171,7 +186,19 @@ bool APTDemodGUI::handleMessage(const Message& message) } m_pixmap.convertFromImage(m_image); - ui->image->setPixmap(m_pixmap); + if (m_pixmapItem != nullptr) + { + m_pixmapItem->setPixmap(m_pixmap); + if (ui->zoomAll->isChecked()) { + ui->image->fitInView(m_pixmapItem, Qt::KeepAspectRatio); + } + } + else + { + m_pixmapItem = m_scene->addPixmap(m_pixmap); + m_pixmapItem->setPos(0, 0); + ui->image->fitInView(m_pixmapItem, Qt::KeepAspectRatio); + } return true; } @@ -302,7 +329,9 @@ void APTDemodGUI::on_startStop_clicked(bool checked) void APTDemodGUI::on_resetDecoder_clicked() { - ui->image->setPixmap(QPixmap()); + if (m_pixmapItem != nullptr) { + m_pixmapItem->setPixmap(QPixmap()); + } ui->imageContainer->setWindowTitle("Received image"); // Send message to reset decoder m_aptDemod->getInputMessageQueue()->push(APTDemod::MsgResetDecoder::create()); @@ -332,6 +361,30 @@ void APTDemodGUI::on_saveImage_clicked() } } +void APTDemodGUI::on_zoomIn_clicked() +{ + m_zoom->gentleZoom(1.25); + ui->zoomAll->setChecked(false); +} + +void APTDemodGUI::on_zoomOut_clicked() +{ + m_zoom->gentleZoom(0.75); + ui->zoomAll->setChecked(false); +} + +void APTDemodGUI::on_zoomAll_clicked(bool checked) +{ + if (checked && (m_pixmapItem != nullptr)) { + ui->image->fitInView(m_pixmapItem, Qt::KeepAspectRatio); + } +} + +void APTDemodGUI::on_image_zoomed() +{ + ui->zoomAll->setChecked(false); +} + void APTDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown) { (void) widget; @@ -389,7 +442,9 @@ APTDemodGUI::APTDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban m_deviceUISet(deviceUISet), m_channelMarker(this), m_doApplySettings(true), - m_tickCount(0) + m_tickCount(0), + m_scene(nullptr), + m_pixmapItem(nullptr) { ui->setupUi(this); @@ -425,6 +480,13 @@ APTDemodGUI::APTDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor())); 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())); + + m_scene = new QGraphicsScene(ui->image); + ui->image->setScene(m_scene); + ui->image->show(); + displaySettings(); applySettings(true); } diff --git a/plugins/channelrx/demodapt/aptdemodgui.h b/plugins/channelrx/demodapt/aptdemodgui.h index 7c324af48..b80c35f8d 100644 --- a/plugins/channelrx/demodapt/aptdemodgui.h +++ b/plugins/channelrx/demodapt/aptdemodgui.h @@ -42,6 +42,9 @@ class DeviceUISet; class BasebandSampleSink; class APTDemod; class APTDemodGUI; +class QGraphicsScene; +class QGraphicsPixmapItem; +class GraphicsViewZoom; namespace Ui { class APTDemodGUI; @@ -79,6 +82,9 @@ private: QImage m_image; QPixmap m_pixmap; + QGraphicsScene* m_scene; + QGraphicsPixmapItem* m_pixmapItem; + GraphicsViewZoom* m_zoom; explicit APTDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0); virtual ~APTDemodGUI(); @@ -107,6 +113,10 @@ private slots: void on_showSettings_clicked(); void on_resetDecoder_clicked(); void on_saveImage_clicked(); + void on_zoomIn_clicked(); + void on_zoomOut_clicked(); + void on_zoomAll_clicked(bool checked=false); + void on_image_zoomed(); void onWidgetRolled(QWidget* widget, bool rollDown); void onMenuDialogCalled(const QPoint& p); void handleInputMessages(); diff --git a/plugins/channelrx/demodapt/aptdemodgui.ui b/plugins/channelrx/demodapt/aptdemodgui.ui index 2579d8c26..d7eb1f9fc 100644 --- a/plugins/channelrx/demodapt/aptdemodgui.ui +++ b/plugins/channelrx/demodapt/aptdemodgui.ui @@ -356,6 +356,9 @@ + + 4 + @@ -372,7 +375,7 @@ - + Show settings dialog @@ -386,7 +389,7 @@ - + Reset decoder (clears current image) @@ -400,7 +403,7 @@ - + Save image to disk @@ -413,6 +416,54 @@ + + + + Zoom in to image + + + + + + + :/zoomin.png:/zoomin.png + + + + + + + Zoom out from image + + + + + + + :/zoomout.png:/zoomout.png + + + + + + + Zoom image to fit window + + + ^ + + + + :/zoomall.png:/zoomall.png + + + true + + + true + + + @@ -426,13 +477,6 @@ - - - - Channels - - - @@ -645,25 +689,13 @@ - - - - 0 - 0 - - + 300 350 - - - - - Qt::AlignCenter - @@ -677,9 +709,10 @@ 1 - ButtonSwitch - QToolButton -
gui/buttonswitch.h
+ ValueDialZ + QWidget +
gui/valuedialz.h
+ 1
LevelMeterSignalDB @@ -688,15 +721,9 @@ 1 - ValueDialZ - QWidget -
gui/valuedialz.h
- 1 -
- - ScaledImage - QLabel -
gui/scaledimage.h
+ ButtonSwitch + QToolButton +
gui/buttonswitch.h
diff --git a/plugins/channelrx/demodapt/readme.md b/plugins/channelrx/demodapt/readme.md index a81ec7b7a..ff24edc88 100644 --- a/plugins/channelrx/demodapt/readme.md +++ b/plugins/channelrx/demodapt/readme.md @@ -62,7 +62,19 @@ Clears the current image and restarts the decoder. The decoder must be reset bet Saves the current image to disk. Images can be saved in PNG, JPEG, BMP, PPM, XBM or XPM formats. -

10: Channel selection

+

10: Zoom in

+ +Zooms in to the image. You can also zoom in with the scroll wheel. + +

11: Zoom out

+ +Zooms out from the image. You can also zoom out with the scroll wheel. + +

12: Zoom image to fit

+ +Zooms so that the image fits in to the available space. + +

13: Channel selection

Selects whether: @@ -70,29 +82,29 @@ Selects whether: - only channel A is displayed - only channel B is displayed -

11: Crop noise

+

14: Crop noise

When checked, noise is cropped from the top and bottom of the image. This is noise that is typically the result of the satellite being at a low elevation. -

12: Apply denoise filter

+

15: Apply denoise filter

When checked, a denoise filter is applied to the received image. -

13: Apply linear equalisation

+

16: Apply linear equalisation

When checked, linear equalisation is performed, which can enhance the contrast. The equalisation is performed separately on each channel. -

14: Apply histogram equalisation

+

17: Apply histogram equalisation

When checked, histogram equalisation is performed, which can enhance the contrast. The equalisation is performed separately on each channel. -

15: Overlay precipitation

+

18: Overlay precipitation

When checked, precipitation is detected from the IR channel and overlayed on both channels using a colour palette. This option will not work if linear or histogram equalisation has been applied. -

16: Pass direction

+

19: Pass direction

The pass direction check button should be set to match the direction of the satellite pass. i.e. select down arrow for satellite passing from the North to the South and the up arrow for the satellite passing from the South to the North. diff --git a/sdrgui/resources/res.qrc b/sdrgui/resources/res.qrc index c426baebb..f62409640 100644 --- a/sdrgui/resources/res.qrc +++ b/sdrgui/resources/res.qrc @@ -107,6 +107,7 @@ load.png keyboard.png kill.png + zoomall.png zoomin.png zoomout.png LiberationMono-Regular.ttf diff --git a/sdrgui/resources/zoomall.png b/sdrgui/resources/zoomall.png new file mode 100644 index 000000000..574cdcdf2 Binary files /dev/null and b/sdrgui/resources/zoomall.png differ