Added compound callsigns to APRS position comment

This commit is contained in:
Jordan Sherer 2018-08-30 15:01:43 -04:00
parent 42c8d1c0bb
commit 64022c18b6
3 changed files with 10 additions and 7 deletions

View File

@ -184,17 +184,16 @@ QPair<QString, QString> APRSISClient::grid2aprs(QString grid){
}; };
} }
void APRSISClient::enqueueSpot(QString theircall, QString grid, quint64 frequency, int snr){ void APRSISClient::enqueueSpot(QString theircall, QString grid, QString comment){
if(m_localCall.isEmpty()) return; if(m_localCall.isEmpty()) return;
auto geo = APRSISClient::grid2aprs(grid); auto geo = APRSISClient::grid2aprs(grid);
auto spotFrame = QString("%1>%2,APRS,TCPIP*:=%3/%4nFT8CALL %5MHz %6dB\n"); auto spotFrame = QString("%1>%2,APRS,TCPIP*:=%3/%4nFT8CALL %5\n");
spotFrame = spotFrame.arg(theircall); spotFrame = spotFrame.arg(theircall);
spotFrame = spotFrame.arg(m_localCall); spotFrame = spotFrame.arg(m_localCall);
spotFrame = spotFrame.arg(geo.first); spotFrame = spotFrame.arg(geo.first);
spotFrame = spotFrame.arg(geo.second); spotFrame = spotFrame.arg(geo.second);
spotFrame = spotFrame.arg(Radio::frequency_MHz_string(frequency)); spotFrame = spotFrame.arg(comment.left(43));
spotFrame = spotFrame.arg(Varicode::formatSNR(snr));
enqueueRaw(spotFrame); enqueueRaw(spotFrame);
} }
@ -240,7 +239,7 @@ void APRSISClient::processQueue(bool disconnect){
} }
} }
auto re = QRegExp("full|unavailable|busy"); auto re = QRegExp("(full|unavailable|busy)");
auto line = QString(readLine()); auto line = QString(readLine());
if(line.toLower().indexOf(re) >= 0){ if(line.toLower().indexOf(re) >= 0){
qDebug() << "APRSISClient Connection Busy:" << line; qDebug() << "APRSISClient Connection Busy:" << line;

View File

@ -21,7 +21,7 @@ public:
m_localGrid = mygrid; m_localGrid = mygrid;
} }
void enqueueSpot(QString theircall, QString grid, quint64 frequency, int snr); void enqueueSpot(QString theircall, QString grid, QString comment);
void enqueueMessage(QString tocall, QString message); void enqueueMessage(QString tocall, QString message);
void enqueueThirdParty(QString theircall, QString payload); void enqueueThirdParty(QString theircall, QString payload);
void enqueueRaw(QString aprsFrame); void enqueueRaw(QString aprsFrame);

View File

@ -3887,7 +3887,11 @@ void MainWindow::aprsLogReport(int offset, int snr, QString callsign, QString gr
return; return;
} }
m_aprsClient->enqueueSpot(Radio::base_callsign(callsign), grid, frequency, snr); auto comment = QString("%1MHz %2dB").arg(Radio::frequency_MHz_string(frequency)).arg(Varicode::formatSNR(snr));
if(callsign.contains("/")){
comment = QString("%1 %2").arg(callsign).arg(comment);
}
m_aprsClient->enqueueSpot(Radio::base_callsign(callsign), grid, comment);
} }
void MainWindow::killFile () void MainWindow::killFile ()