Added RIG.PTT status message to the API

This commit is contained in:
Jordan Sherer 2019-01-01 10:29:35 -05:00
parent bedc6dd96c
commit 0405dba3fc
2 changed files with 17 additions and 2 deletions

View File

@ -4456,7 +4456,7 @@ void MainWindow::guiUpdate()
g_iptt = 1; g_iptt = 1;
setRig (); setRig ();
setXIT (ui->TxFreqSpinBox->value ()); setXIT (ui->TxFreqSpinBox->value ());
Q_EMIT m_config.transceiver_ptt (true); //Assert the PTT emitPTT(true);
m_tx_when_ready = true; m_tx_when_ready = true;
qDebug() << "start threshold" << fTR << lateThreshold; qDebug() << "start threshold" << fTR << lateThreshold;
@ -4910,7 +4910,7 @@ void MainWindow::stopTx()
void MainWindow::stopTx2() void MainWindow::stopTx2()
{ {
Q_EMIT m_config.transceiver_ptt (false); //Lower PTT emitPTT(false);
} }
void MainWindow::ba2msg(QByteArray ba, char message[]) //ba2msg() void MainWindow::ba2msg(QByteArray ba, char message[]) //ba2msg()
@ -10463,6 +10463,16 @@ void MainWindow::postWSPRDecode (bool is_new, QStringList parts)
#endif #endif
} }
void MainWindow::emitPTT(bool on){
Q_EMIT m_config.transceiver_ptt(on);
// emit to network
sendNetworkMessage("RIG.PTT", on ? "on" : "off", {
{"PTT", QVariant(on)},
{"UTC", QVariant(DriftingDateTime::currentDateTimeUtc().toMSecsSinceEpoch())},
});
}
void MainWindow::networkMessage(Message const &message) void MainWindow::networkMessage(Message const &message)
{ {
if(!m_config.accept_udp_requests()){ if(!m_config.accept_udp_requests()){
@ -10478,8 +10488,12 @@ void MainWindow::networkMessage(Message const &message)
// Inspired by FLDigi // Inspired by FLDigi
// TODO: MAIN.RX - Turn on RX // TODO: MAIN.RX - Turn on RX
// TODO: MAIN.TX - Transmit // TODO: MAIN.TX - Transmit
// TODO: MAIN.PTT - PTT
// TODO: MAIN.TUNE - Tune // TODO: MAIN.TUNE - Tune
// TODO: MAIN.HALT - Halt // TODO: MAIN.HALT - Halt
// TODO: MAIN.AUTO - Auto
// TODO: MAIN.SPOT - Spot
// TODO: MAIN.HB - HB
// RIG.GET_FREQ - Get the current Frequency // RIG.GET_FREQ - Get the current Frequency
// RIG.SET_FREQ - Set the current Frequency // RIG.SET_FREQ - Set the current Frequency

View File

@ -377,6 +377,7 @@ private slots:
void on_cbCQonly_toggled(bool b); void on_cbCQonly_toggled(bool b);
void on_cbFirst_toggled(bool b); void on_cbFirst_toggled(bool b);
void on_cbAutoSeq_toggled(bool b); void on_cbAutoSeq_toggled(bool b);
void emitPTT(bool on);
void networkMessage(Message const &message); void networkMessage(Message const &message);
void sendNetworkMessage(QString const &type, QString const &message); void sendNetworkMessage(QString const &type, QString const &message);
void sendNetworkMessage(QString const &type, QString const &message, const QMap<QString, QVariant> &params); void sendNetworkMessage(QString const &type, QString const &message, const QMap<QString, QVariant> &params);