QSO pota tracking and spotting complete

merge-requests/203/head test_pota0928
Tag 2022-09-29 15:52:18 -07:00
rodzic b177946a84
commit 60a64d9da9
4 zmienionych plików z 66 dodań i 15 usunięć

Wyświetl plik

@ -1818,14 +1818,22 @@ function sendToLogger(ADIF)
localMode = record.SUBMODE;
}
let localHash = record.CALL + record.BAND + localMode;
if (
(!("GRIDSQUARE" in record) || record.GRIDSQUARE.length == 0) &&
record.CALL + record.BAND + localMode in g_liveCallsigns
localHash in g_liveCallsigns
)
{
record.GRIDSQUARE = g_liveCallsigns[
record.CALL + record.BAND + localMode
].grid.substr(0, 4);
record.GRIDSQUARE = g_liveCallsigns[localHash].grid.substr(0, 4);
}
if (g_potaEnabled == 1 && localHash in g_liveCallsigns && g_liveCallsigns[localHash].pota.length > 0)
{
let pota = g_liveCallsigns[localHash].pota[0];
if (pota != "?-????")
{
record.POTA = pota;
}
}
if ("TX_PWR" in record)
@ -1918,17 +1926,33 @@ function sendToLogger(ADIF)
function finishSendingReport(record, localMode)
{
let report = "";
for (let key in record)
for (const key in record)
{
report += "<" + key + ":" + Buffer.byteLength(record[key]) + ">" + record[key] + " ";
if (key != "POTA")
{
report += "<" + key + ":" + Buffer.byteLength(record[key]) + ">" + record[key] + " ";
}
}
report += "<EOR>";
// this report is for internal use ONLY!
let reportWithPota = "";
for (const key in record)
{
reportWithPota += "<" + key + ":" + Buffer.byteLength(record[key]) + ">" + record[key] + " ";
}
reportWithPota += "<EOR>";
// Full record dupe check
if (report != g_lastReport)
{
g_lastReport = report;
if (g_potaEnabled == 1 && "POTA" in record)
{
reportPotaQSO(record);
addLastTraffic("<font style='color:white'>Spotted to POTA</font>");
}
if (
g_N1MMSettings.enable == true &&
@ -1962,7 +1986,7 @@ function finishSendingReport(record, localMode)
try
{
onAdiLoadComplete("GT<EOH>" + report);
onAdiLoadComplete("GT<EOH>" + reportWithPota);
}
catch (e)
{
@ -1974,7 +1998,7 @@ function finishSendingReport(record, localMode)
if (logGTqsoCheckBox.checked == true)
{
var fs = require("fs");
fs.appendFileSync(g_qsoLogFile, report + "\r\n");
fs.appendFileSync(g_qsoLogFile, reportWithPota + "\r\n");
addLastTraffic(
"<font style='color:white'>Logged to GridTracker backup</font>"
);

Wyświetl plik

@ -6301,11 +6301,6 @@ function handleWsjtxADIF(newMessage)
g_oldQSOTimer = null;
}
if (g_ignoreMessages == 0)
{
onAdiLoadComplete(newMessage.ADIF);
}
sendToLogger(newMessage.ADIF);
}

Wyświetl plik

@ -202,6 +202,38 @@ function reportPotaRBN(callSpot)
);
}
function reportPotaQSO(record)
{
let report = {
activator: record.CALL,
spotter: record.STATION_CALLSIGN,
frequency: record.FREQ,
reference: record.POTA,
mode: record.MODE,
source: "GT",
comments: record.COMMENT ? record.COMMENT : "",
activatorGrid: record.GRIDSQUARE ? record.GRIDSQUARE : "",
spotterGrid: record.MY_GRIDSQUARE ? record.MY_GRIDSQUARE : ""
}
if ("SUBMODE" in record)
{
report.mode = record.SUBMODE;
}
getPostJSONBuffer(
"https://api.pota.app/spot",
rbnReportResult,
null,
"https",
443,
report,
10000,
null,
null
);
}
function rbnReportResult(buffer, flag, cookies)
{
// It worked! process latest spots!

Wyświetl plik

@ -1,7 +1,7 @@
{
"name": "GridTracker",
"product_string_do_not_use": "gridtracker",
"version": "1.22.0925",
"version": "1.22.0929",
"betaVersion": "POTA",
"description": "GridTracker, an amateur radio companion",
"author": "GridTracker.org",