GROUPCALL easter egg

This commit is contained in:
Jordan Sherer 2018-10-06 03:59:54 -04:00
parent 4df77ac774
commit 1f210bba63
3 changed files with 18 additions and 10 deletions

View File

@ -8971,6 +8971,10 @@ bool MainWindow::isAllCallIncluded(const QString &text){
return text.contains("ALLCALL");
}
bool MainWindow::isGroupCallIncluded(const QString &text){
return text.contains("GROUPCALL");
}
void MainWindow::processActivity(bool force) {
if (!m_rxDirty && !force) {
return;
@ -9261,6 +9265,8 @@ void MainWindow::processCommandActivity() {
auto d = m_rxCommandQueue.dequeue();
bool isAllCall = isAllCallIncluded(d.to);
bool isGroupCall = isGroupCallIncluded(d.to);
bool isNear = abs(d.freq - currentFreqOffset()) <= 150;
qDebug() << "try processing command" << d.from << d.to << d.cmd << d.freq << d.grid << d.extra;
@ -9288,8 +9294,8 @@ void MainWindow::processCommandActivity() {
cd.utcTimestamp = d.utcTimestamp;
logCallActivity(cd, true);
// we're only responding to allcall and our callsign at this point, so we'll end after logging the callsigns we've heard
if (!isAllCall && !toMe) {
// we're only responding to allcall, groupcalls near us, and our callsign at this point, so we'll end after logging the callsigns we've heard
if (!isAllCall && !toMe && !(isGroupCall && isNear)) {
continue;
}
@ -9298,12 +9304,6 @@ void MainWindow::processCommandActivity() {
continue;
}
// if this is an allcall, check to make sure we haven't replied to their allcall recently (in the past beacon interval)
// that way we never get spammed by allcalls at a higher frequency than what we would normally beacon
if (isAllCall && m_txAllcallCommandCache.contains(d.from) && m_txAllcallCommandCache[d.from]->secsTo(now) / 60 < m_config.beacon()) {
continue;
}
// display the command activity
ActivityDetail ad = {};
ad.isLowConfidence = false;
@ -9378,6 +9378,12 @@ void MainWindow::processCommandActivity() {
writeDirectedCommandToFile(d);
}
// if this is an allcall, check to make sure we haven't replied to their allcall recently (in the past beacon interval)
// that way we never get spammed by allcalls at a higher frequency than what we would normally beacon
if (isAllCall && m_txAllcallCommandCache.contains(d.from) && m_txAllcallCommandCache[d.from]->secsTo(now) / 60 < m_config.beacon()) {
continue;
}
// and mark the offset as a directed offset so future free text is displayed
// markOffsetDirected(ad.freq, isAllCall);

View File

@ -890,6 +890,7 @@ private:
void updateTxButtonDisplay();
bool isMyCallIncluded(QString const &text);
bool isAllCallIncluded(QString const &text);
bool isGroupCallIncluded(const QString &text);
QString callsignSelected(bool useInputText=false);
bool isRecentOffset(int offset);
void markOffsetRecent(int offset);

View File

@ -173,8 +173,9 @@ quint16 nusergrid = nbasegrid + 10;
quint16 nmaxgrid = (1<<15)-1;
QMap<QString, quint32> basecalls = {
{ "<....>", nbasecall + 1 }, // incomplete callsign
{ "ALLCALL", nbasecall + 2 },
{ "<....>", nbasecall + 1 }, // incomplete callsign
{ "ALLCALL", nbasecall + 2 },
{ "GROUPCALL", nbasecall + 3 },
};
QMap<quint32, QString> cqs = {