Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added remote control commands for IQ recording #1405

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/applications/gqrx/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand All @@ -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);

Expand Down
27 changes: 27 additions & 0 deletions src/applications/gqrx/remote_control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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()));
}
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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)
{
Expand Down
6 changes: 6 additions & 0 deletions src/applications/gqrx/remote_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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 */
Expand All @@ -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;
};
Expand Down
18 changes: 18 additions & 0 deletions src/qtgui/iq_tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/qtgui/iq_tool.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading