diff --git a/src/applications/gqrx/mainwindow.cpp b/src/applications/gqrx/mainwindow.cpp index 72681f13a..e2ba5b5c2 100644 --- a/src/applications/gqrx/mainwindow.cpp +++ b/src/applications/gqrx/mainwindow.cpp @@ -114,9 +114,6 @@ MainWindow::MainWindow(const QString& cfgfile, bool edit_conf, QWidget *parent) rx = new receiver("", "", 1); rx->set_rf_freq(144500000.0); - // remote controller - remote = new RemoteControl(); - /* meter timer */ meter_timer = new QTimer(this); connect(meter_timer, SIGNAL(timeout()), this, SLOT(meterTimeout())); @@ -141,6 +138,10 @@ MainWindow::MainWindow(const QString& cfgfile, bool edit_conf, QWidget *parent) // create I/Q tool widget iq_tool = new CIqTool(this); + // remote controller + remote = new RemoteControl(); + remote->iq_tool = iq_tool; + // create DXC Objects dxc_options = new DXCOptions(this); diff --git a/src/applications/gqrx/remote_control.cpp b/src/applications/gqrx/remote_control.cpp index 70a3cf687..71a427f24 100644 --- a/src/applications/gqrx/remote_control.cpp +++ b/src/applications/gqrx/remote_control.cpp @@ -50,6 +50,7 @@ RemoteControl::RemoteControl(QObject *parent) : squelch_level = -150.0; audio_gain = -6.0; audio_recorder_status = false; + iq_recorder_status = false; receiver_running = false; hamlib_compatible = false; is_audio_muted = false; @@ -58,6 +59,7 @@ RemoteControl::RemoteControl(QObject *parent) : rc_allowed_hosts.append(DEFAULT_RC_ALLOWED_HOSTS); rc_socket = 0; + iq_tool = nullptr; connect(&rc_server, SIGNAL(newConnection()), this, SLOT(acceptConnection())); } @@ -247,6 +249,10 @@ void RemoteControl::startRead() answer = cmd_AOS(); else if (cmd == "LOS") answer = cmd_LOS(); + else if (cmd == "AOIQ") + answer = cmd_AOIQ(); + else if (cmd == "LOIQ") + answer = cmd_LOIQ(); else if (cmd == "LNB_LO") answer = cmd_lnb_lo(cmdlist); else if (cmd == "\\chk_vfo") @@ -918,6 +924,27 @@ QString RemoteControl::cmd_LOS() return QString("RPRT 0\n"); } +/* Gpredict / Gqrx specific command: AOIQ - satellite AOIQ event */ +QString RemoteControl::cmd_AOIQ() +{ + if (rc_mode > 0 && receiver_running) + { + iq_tool->show(); + iq_tool->remoteRecordingCmd(true); + iq_recorder_status = true; + } + return QString("RPRT 0\n"); +} + +/* Gpredict / Gqrx specific command: LOIQ - satellite LOIQ event */ +QString RemoteControl::cmd_LOIQ() +{ + iq_tool->remoteRecordingCmd(false); + iq_recorder_status = false; + return QString("RPRT 0\n"); +} + + /* Set the LNB LO value */ QString RemoteControl::cmd_lnb_lo(QStringList cmdlist) { diff --git a/src/applications/gqrx/remote_control.h b/src/applications/gqrx/remote_control.h index d16c1fd07..9bfe294c1 100644 --- a/src/applications/gqrx/remote_control.h +++ b/src/applications/gqrx/remote_control.h @@ -33,6 +33,7 @@ /* For gain_t and gain_list_t */ #include "qtgui/dockinputctl.h" +#include "qtgui/iq_tool.h" /*! \brief Simple TCP server for remote control. * @@ -82,6 +83,8 @@ class RemoteControl : public QObject } void setReceiverStatus(bool enabled); void setGainStages(gain_list_t &gain_list); + CIqTool* iq_tool; + public slots: void setNewFrequency(qint64 freq); @@ -144,6 +147,7 @@ private slots: QString rds_station; /*!< RDS program service (station) name */ QString rds_radiotext; /*!< RDS Radiotext */ bool audio_recorder_status; /*!< Recording enabled */ + bool iq_recorder_status; /*!< IQ Recording enabled */ bool receiver_running; /*!< Whether the receiver is running or not */ bool hamlib_compatible; gain_list_t gains; /*!< Possible and current gain settings */ @@ -170,6 +174,8 @@ private slots: QString cmd_get_param(QStringList cmdlist); QString cmd_AOS(); QString cmd_LOS(); + QString cmd_AOIQ(); + QString cmd_LOIQ(); QString cmd_lnb_lo(QStringList cmdlist); QString cmd_dump_state() const; }; diff --git a/src/qtgui/iq_tool.cpp b/src/qtgui/iq_tool.cpp index b90bae8b1..76ddfa63c 100644 --- a/src/qtgui/iq_tool.cpp +++ b/src/qtgui/iq_tool.cpp @@ -201,6 +201,24 @@ void CIqTool::cancelRecording() is_recording = false; } +void CIqTool::remoteRecordingCmd(bool checked) +{ + + if (checked) + { + show(); + ui->recButton->setChecked(true); + on_recButton_clicked(checked); + } + else + { + on_recButton_clicked(checked); + ui->recButton->setChecked(false); + hide(); + } + +} + /*! \brief Catch window close events. * * This method is called when the user closes the audio options dialog diff --git a/src/qtgui/iq_tool.h b/src/qtgui/iq_tool.h index b078da708..6d3f19e35 100644 --- a/src/qtgui/iq_tool.h +++ b/src/qtgui/iq_tool.h @@ -60,6 +60,7 @@ class CIqTool : public QDialog void saveSettings(QSettings *settings); void readSettings(QSettings *settings); + void remoteRecordingCmd(bool checked); signals: void startRecording(const QString recdir, const QString format);