kopia lustrzana https://gitlab.com/gridtracker.org/gridtracker
rodzic
b177946a84
commit
60a64d9da9
|
@ -1818,14 +1818,22 @@ function sendToLogger(ADIF)
|
||||||
localMode = record.SUBMODE;
|
localMode = record.SUBMODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let localHash = record.CALL + record.BAND + localMode;
|
||||||
if (
|
if (
|
||||||
(!("GRIDSQUARE" in record) || record.GRIDSQUARE.length == 0) &&
|
(!("GRIDSQUARE" in record) || record.GRIDSQUARE.length == 0) &&
|
||||||
record.CALL + record.BAND + localMode in g_liveCallsigns
|
localHash in g_liveCallsigns
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
record.GRIDSQUARE = g_liveCallsigns[
|
record.GRIDSQUARE = g_liveCallsigns[localHash].grid.substr(0, 4);
|
||||||
record.CALL + record.BAND + localMode
|
}
|
||||||
].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)
|
if ("TX_PWR" in record)
|
||||||
|
@ -1918,18 +1926,34 @@ function sendToLogger(ADIF)
|
||||||
function finishSendingReport(record, localMode)
|
function finishSendingReport(record, localMode)
|
||||||
{
|
{
|
||||||
let report = "";
|
let report = "";
|
||||||
|
for (const key in record)
|
||||||
for (let key in record)
|
|
||||||
{
|
{
|
||||||
report += "<" + key + ":" + Buffer.byteLength(record[key]) + ">" + record[key] + " ";
|
if (key != "POTA")
|
||||||
|
{
|
||||||
|
report += "<" + key + ":" + Buffer.byteLength(record[key]) + ">" + record[key] + " ";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
report += "<EOR>";
|
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
|
// Full record dupe check
|
||||||
if (report != g_lastReport)
|
if (report != g_lastReport)
|
||||||
{
|
{
|
||||||
g_lastReport = report;
|
g_lastReport = report;
|
||||||
|
|
||||||
|
if (g_potaEnabled == 1 && "POTA" in record)
|
||||||
|
{
|
||||||
|
reportPotaQSO(record);
|
||||||
|
addLastTraffic("<font style='color:white'>Spotted to POTA</font>");
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
g_N1MMSettings.enable == true &&
|
g_N1MMSettings.enable == true &&
|
||||||
g_N1MMSettings.port > 1024 &&
|
g_N1MMSettings.port > 1024 &&
|
||||||
|
@ -1962,7 +1986,7 @@ function finishSendingReport(record, localMode)
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
onAdiLoadComplete("GT<EOH>" + report);
|
onAdiLoadComplete("GT<EOH>" + reportWithPota);
|
||||||
}
|
}
|
||||||
catch (e)
|
catch (e)
|
||||||
{
|
{
|
||||||
|
@ -1974,7 +1998,7 @@ function finishSendingReport(record, localMode)
|
||||||
if (logGTqsoCheckBox.checked == true)
|
if (logGTqsoCheckBox.checked == true)
|
||||||
{
|
{
|
||||||
var fs = require("fs");
|
var fs = require("fs");
|
||||||
fs.appendFileSync(g_qsoLogFile, report + "\r\n");
|
fs.appendFileSync(g_qsoLogFile, reportWithPota + "\r\n");
|
||||||
addLastTraffic(
|
addLastTraffic(
|
||||||
"<font style='color:white'>Logged to GridTracker backup</font>"
|
"<font style='color:white'>Logged to GridTracker backup</font>"
|
||||||
);
|
);
|
||||||
|
|
|
@ -6301,11 +6301,6 @@ function handleWsjtxADIF(newMessage)
|
||||||
g_oldQSOTimer = null;
|
g_oldQSOTimer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_ignoreMessages == 0)
|
|
||||||
{
|
|
||||||
onAdiLoadComplete(newMessage.ADIF);
|
|
||||||
}
|
|
||||||
|
|
||||||
sendToLogger(newMessage.ADIF);
|
sendToLogger(newMessage.ADIF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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)
|
function rbnReportResult(buffer, flag, cookies)
|
||||||
{
|
{
|
||||||
// It worked! process latest spots!
|
// It worked! process latest spots!
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "GridTracker",
|
"name": "GridTracker",
|
||||||
"product_string_do_not_use": "gridtracker",
|
"product_string_do_not_use": "gridtracker",
|
||||||
"version": "1.22.0925",
|
"version": "1.22.0929",
|
||||||
"betaVersion": "POTA",
|
"betaVersion": "POTA",
|
||||||
"description": "GridTracker, an amateur radio companion",
|
"description": "GridTracker, an amateur radio companion",
|
||||||
"author": "GridTracker.org",
|
"author": "GridTracker.org",
|
||||||
|
|
Ładowanie…
Reference in New Issue