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
Changes from 1 commit
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
Next Next commit
added AOIQ/LOIQ options to remote control
mhassell committed Jan 21, 2025

Unverified

This user has not yet uploaded their public signing key.
commit d3a9b5b19eff62aef69cb7db354be061c5932a5e
7 changes: 4 additions & 3 deletions src/applications/gqrx/mainwindow.cpp
Original file line number Diff line number Diff line change
@@ -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);

27 changes: 27 additions & 0 deletions src/applications/gqrx/remote_control.cpp
Original file line number Diff line number Diff line change
@@ -50,6 +50,7 @@ RemoteControl::RemoteControl(QObject *parent) :
squelch_level = -150.0;
audio_gain = -6.0;
audio_recorder_status = false;
iq_recorder_status = true;
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)
{
// here
emit iq_tool->startRecording();
iq_recorder_status = true;
}
return QString("RPRT 0\n");
}

/* Gpredict / Gqrx specific command: LOIQ - satellite LOIQ event */
QString RemoteControl::cmd_LOIQ()
{
emit iq_tool->stopRecording();
iq_recorder_status = false;
return QString("RPRT 0\n");
}


/* Set the LNB LO value */
QString RemoteControl::cmd_lnb_lo(QStringList cmdlist)
{
9 changes: 8 additions & 1 deletion src/applications/gqrx/remote_control.h
Original file line number Diff line number Diff line change
@@ -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.
*
@@ -61,6 +62,7 @@ class RemoteControl : public QObject
Q_OBJECT
public:
explicit RemoteControl(QObject *parent = 0);
//RemoteControl(CIqTool *iq_tool);
~RemoteControl();

void start_server(void);
@@ -82,6 +84,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 +148,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 */
@@ -152,7 +157,7 @@ private slots:
void setNewRemoteFreq(qint64 freq);
int modeStrToInt(QString mode_str);
QString intToModeStr(int mode);

/* RC commands */
QString cmd_get_freq() const;
QString cmd_set_freq(QStringList cmdlist);
@@ -170,6 +175,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;
};
9 changes: 9 additions & 0 deletions src/qtgui/iq_tool.cpp
Original file line number Diff line number Diff line change
@@ -141,6 +141,15 @@ void CIqTool::on_playButton_clicked(bool checked)
}
}

/*! \brief wrapper for startRecording to not need access to private attributes.
*/
void CIqTool::startRecording()
{

emit startRecording(recdir->path(), ui->formatCombo->currentText());

}

/*! \brief Cancel playback.
*
* This slot can be activated to cancel an ongoing playback.
1 change: 1 addition & 0 deletions src/qtgui/iq_tool.h
Original file line number Diff line number Diff line change
@@ -60,6 +60,7 @@ class CIqTool : public QDialog

void saveSettings(QSettings *settings);
void readSettings(QSettings *settings);
void startRecording();

signals:
void startRecording(const QString recdir, const QString format);