DXCC, ITU and CQ worked/confirmed hash update with seperator

merge-requests/201/merge
Tag 2022-10-03 14:59:16 -07:00
rodzic 5f17147363
commit ec4750dbcc
5 zmienionych plików z 81 dodań i 81 usunięć

Wyświetl plik

@ -41,6 +41,28 @@ function dropHandler(ev)
} }
} }
function dateToISO8601(dString, tZone)
{
var retDate = "";
var tZone = (typeof tZone !== "undefined") ? tZone : "Z";
var dateParts = dString.match(/(\d{4}-\d{2}-\d{2})(\s+(\d{2}:\d{2}:\d{2}))?/);
if (dateParts !== null)
{
retDate = dateParts[1]
if ((typeof dateParts[3]) !== "undefined")
{
retDate += "T" + dateParts[3] + ".000" + tZone;
}
else
{
retDate += "T00:00:00.000" + tZone;
}
}
return retDate;
}
function findAdiField(row, field) function findAdiField(row, field)
{ {
var value = ""; var value = "";

Wyświetl plik

@ -1237,13 +1237,13 @@ function alertCheckDXCC(key, callObj)
if ( if (
status == "worked" && status == "worked" &&
String(callObj.dxcc) + hashMaker(callObj.band, callObj.mode) in String(callObj.dxcc) + "|" + hashMaker(callObj.band, callObj.mode) in
g_tracker.worked.dxcc g_tracker.worked.dxcc
) )
{ return 0; } { return 0; }
if ( if (
status == "confirmed" && status == "confirmed" &&
String(callObj.dxcc) + hashMaker(callObj.band, callObj.mode) in String(callObj.dxcc) + "|" + hashMaker(callObj.band, callObj.mode) in
g_tracker.confirmed.dxcc g_tracker.confirmed.dxcc
) )
{ return 0; } { return 0; }
@ -1259,7 +1259,7 @@ function alertCheckCQz(key, callObj)
var workedFound = (confirmedFound = 0); var workedFound = (confirmedFound = 0);
for (index in callObj.cqza) for (index in callObj.cqza)
{ {
var hash = callObj.cqza[index] + hashMaker(callObj.band, callObj.mode); var hash = callObj.cqza[index] + "|" + hashMaker(callObj.band, callObj.mode);
if (hash in g_tracker.worked.cqz) workedFound++; if (hash in g_tracker.worked.cqz) workedFound++;
if (hash in g_tracker.confirmed.cqz) confirmedFound++; if (hash in g_tracker.confirmed.cqz) confirmedFound++;
@ -1281,7 +1281,7 @@ function alertCheckITUz(key, callObj)
var workedFound = (confirmedFound = 0); var workedFound = (confirmedFound = 0);
for (index in callObj.ituza) for (index in callObj.ituza)
{ {
var hash = callObj.ituza[index] + hashMaker(callObj.band, callObj.mode); var hash = callObj.ituza[index] + "|" + hashMaker(callObj.band, callObj.mode);
if (hash in g_tracker.worked.ituz) workedFound++; if (hash in g_tracker.worked.ituz) workedFound++;
if (hash in g_tracker.confirmed.ituz) confirmedFound++; if (hash in g_tracker.confirmed.ituz) confirmedFound++;

Wyświetl plik

@ -7,19 +7,20 @@ var gtVersion = parseInt(gtVersionStr.replace(/\./g, ""));
var gtBeta = pjson.betaVersion; var gtBeta = pjson.betaVersion;
var g_startVersion = 0; var g_startVersion = 0;
var g_readInternalQso = true;
if (typeof localStorage.currentVersion != "undefined") if (typeof localStorage.currentVersion != "undefined")
{ {
g_startVersion = localStorage.currentVersion; g_startVersion = localStorage.currentVersion;
} }
if ( if (typeof localStorage.currentVersion == "undefined" || localStorage.currentVersion != String(gtVersion))
typeof localStorage.currentVersion == "undefined" ||
localStorage.currentVersion != String(gtVersion)
)
{ {
localStorage.currentVersion = String(gtVersion); localStorage.currentVersion = String(gtVersion);
var gui = require("nw.gui"); var gui = require("nw.gui");
gui.App.clearCache(); gui.App.clearCache();
// If the version changed, the interanl qso file is possibly out of date so don't read it
g_readInternalQso = false;
} }
var vers = String(gtVersion); var vers = String(gtVersion);
@ -490,7 +491,6 @@ function initQSOdata()
var g_offlineLayer = null; var g_offlineLayer = null;
var g_mapsLayer = Array(); var g_mapsLayer = Array();
var g_tileLayer = null; var g_tileLayer = null;
var g_mapControl = null;
var g_mapView = null; var g_mapView = null;
var g_layerSources = {}; var g_layerSources = {};
var g_layerVectors = {}; var g_layerVectors = {};
@ -529,8 +529,6 @@ var g_stateToCounty = {};
var g_cntyToCounty = {}; var g_cntyToCounty = {};
var g_us48Data = {}; var g_us48Data = {};
var g_startupFunctions = Array();
var g_pskColors = {}; var g_pskColors = {};
g_pskColors.OOB = "888888"; g_pskColors.OOB = "888888";
g_pskColors["4000m"] = "45E0FF"; g_pskColors["4000m"] = "45E0FF";
@ -863,6 +861,7 @@ function toggleOffline()
changeMapValues(); changeMapValues();
} }
// from GridTracker.html
function ignoreMessagesToggle() function ignoreMessagesToggle()
{ {
g_ignoreMessages ^= 1; g_ignoreMessages ^= 1;
@ -882,6 +881,7 @@ function ignoreMessagesToggle()
} }
} }
// from GridTracker.html
function toggleTime() function toggleTime()
{ {
g_appSettings.useLocalTime ^= 1; g_appSettings.useLocalTime ^= 1;
@ -916,28 +916,6 @@ function userTimeString(Msec)
return dateToString(dateTime); return dateToString(dateTime);
} }
function dateToISO8601(dString, tZone)
{
var retDate = "";
var tZone = (typeof tZone !== "undefined") ? tZone : "Z";
var dateParts = dString.match(/(\d{4}-\d{2}-\d{2})(\s+(\d{2}:\d{2}:\d{2}))?/);
if (dateParts !== null)
{
retDate = dateParts[1]
if ((typeof dateParts[3]) !== "undefined")
{
retDate += "T" + dateParts[3] + ".000" + tZone;
}
else
{
retDate += "T00:00:00.000" + tZone;
}
}
return retDate;
}
function getWpx(callsign) function getWpx(callsign)
{ {
var prefix = null; var prefix = null;
@ -1252,14 +1230,14 @@ function addDeDx(
} }
if (details.ituz.length > 0) if (details.ituz.length > 0)
{ {
g_tracker.worked.ituz[details.ituz + band + mode] = true; g_tracker.worked.ituz[details.ituz + "|" + band + mode] = true;
g_tracker.worked.ituz[details.ituz] = true; g_tracker.worked.ituz[details.ituz + "|"] = true;
g_tracker.worked.ituz[details.ituz + mode] = true; g_tracker.worked.ituz[details.ituz + "|" + mode] = true;
g_tracker.worked.ituz[details.ituz + band] = true; g_tracker.worked.ituz[details.ituz + "|" + band] = true;
if (isDigi == true) if (isDigi == true)
{ {
g_tracker.worked.ituz[details.ituz + "dg"] = true; g_tracker.worked.ituz[details.ituz + "|dg"] = true;
g_tracker.worked.ituz[details.ituz + band + "dg"] = true; g_tracker.worked.ituz[details.ituz + "|" + band + "dg"] = true;
} }
} }
if ( if (
@ -1272,14 +1250,14 @@ function addDeDx(
} }
if (details.cqz.length > 0) if (details.cqz.length > 0)
{ {
g_tracker.worked.cqz[details.cqz + band + mode] = true; g_tracker.worked.cqz[details.cqz + "|" + band + mode] = true;
g_tracker.worked.cqz[details.cqz] = true; g_tracker.worked.cqz[details.cqz + "|"] = true;
g_tracker.worked.cqz[details.cqz + mode] = true; g_tracker.worked.cqz[details.cqz + "|" + mode] = true;
g_tracker.worked.cqz[details.cqz + band] = true; g_tracker.worked.cqz[details.cqz + "|" + band] = true;
if (isDigi == true) if (isDigi == true)
{ {
g_tracker.worked.cqz[details.cqz + "dg"] = true; g_tracker.worked.cqz[details.cqz + "|dg"] = true;
g_tracker.worked.cqz[details.cqz + band + "dg"] = true; g_tracker.worked.cqz[details.cqz + "|" + band + "dg"] = true;
} }
if (isCurrentYear) if (isCurrentYear)
{ {
@ -1290,14 +1268,14 @@ function addDeDx(
if (details.dxcc > 0) if (details.dxcc > 0)
{ {
var sDXCC = String(details.dxcc); var sDXCC = String(details.dxcc);
g_tracker.worked.dxcc[sDXCC + band + mode] = true; g_tracker.worked.dxcc[sDXCC + "|" + band + mode] = true;
g_tracker.worked.dxcc[sDXCC] = true; g_tracker.worked.dxcc[sDXCC + "|"] = true;
g_tracker.worked.dxcc[sDXCC + mode] = true; g_tracker.worked.dxcc[sDXCC + "|" + mode] = true;
g_tracker.worked.dxcc[sDXCC + band] = true; g_tracker.worked.dxcc[sDXCC + "|" + band] = true;
if (isDigi == true) if (isDigi == true)
{ {
g_tracker.worked.dxcc[sDXCC + "dg"] = true; g_tracker.worked.dxcc[sDXCC + "|dg"] = true;
g_tracker.worked.dxcc[sDXCC + band + "dg"] = true; g_tracker.worked.dxcc[sDXCC + "|" + band + "dg"] = true;
} }
if (isCurrentYear) if (isCurrentYear)
{ {
@ -1397,40 +1375,40 @@ function addDeDx(
} }
if (details.ituz.length > 0) if (details.ituz.length > 0)
{ {
g_tracker.confirmed.ituz[details.ituz + band + mode] = true; g_tracker.confirmed.ituz[details.ituz + "|" + band + mode] = true;
g_tracker.confirmed.ituz[details.ituz] = true; g_tracker.confirmed.ituz[details.ituz + "|"] = true;
g_tracker.confirmed.ituz[details.ituz + mode] = true; g_tracker.confirmed.ituz[details.ituz + "|" + mode] = true;
g_tracker.confirmed.ituz[details.ituz + band] = true; g_tracker.confirmed.ituz[details.ituz + "|" + band] = true;
if (isDigi == true) if (isDigi == true)
{ {
g_tracker.confirmed.ituz[details.ituz + "dg"] = true; g_tracker.confirmed.ituz[details.ituz + "|dg"] = true;
g_tracker.confirmed.ituz[details.ituz + band + "dg"] = true; g_tracker.confirmed.ituz[details.ituz + "|" + band + "dg"] = true;
} }
} }
if (details.cqz.length > 0) if (details.cqz.length > 0)
{ {
g_tracker.confirmed.cqz[details.cqz + band + mode] = true; g_tracker.confirmed.cqz[details.cqz + "|" + band + mode] = true;
g_tracker.confirmed.cqz[details.cqz] = true; g_tracker.confirmed.cqz[details.cqz + "|"] = true;
g_tracker.confirmed.cqz[details.cqz + mode] = true; g_tracker.confirmed.cqz[details.cqz + "|" + mode] = true;
g_tracker.confirmed.cqz[details.cqz + band] = true; g_tracker.confirmed.cqz[details.cqz + "|" + band] = true;
if (isDigi == true) if (isDigi == true)
{ {
g_tracker.confirmed.cqz[details.cqz + "dg"] = true; g_tracker.confirmed.cqz[details.cqz + "|dg"] = true;
g_tracker.confirmed.cqz[details.cqz + band + "dg"] = true; g_tracker.confirmed.cqz[details.cqz + "|" + band + "dg"] = true;
} }
} }
if (details.dxcc > 0) if (details.dxcc > 0)
{ {
var sDXCC = String(details.dxcc); var sDXCC = String(details.dxcc);
g_tracker.confirmed.dxcc[sDXCC + band + mode] = true; g_tracker.confirmed.dxcc[sDXCC + "|" + band + mode] = true;
g_tracker.confirmed.dxcc[sDXCC] = true; g_tracker.confirmed.dxcc[sDXCC + "|"] = true;
g_tracker.confirmed.dxcc[sDXCC + mode] = true; g_tracker.confirmed.dxcc[sDXCC + "|" + mode] = true;
g_tracker.confirmed.dxcc[sDXCC + band] = true; g_tracker.confirmed.dxcc[sDXCC + "|" + band] = true;
if (isDigi == true) if (isDigi == true)
{ {
g_tracker.confirmed.dxcc[sDXCC + "dg"] = true; g_tracker.confirmed.dxcc[sDXCC + "|dg"] = true;
g_tracker.confirmed.dxcc[sDXCC + band + "dg"] = true; g_tracker.confirmed.dxcc[sDXCC + "|" + band + "dg"] = true;
} }
} }
@ -15602,10 +15580,10 @@ function searchLogForCallsign(call)
")</th><td>"; ")</th><td>";
for (var band in g_colorBands) for (var band in g_colorBands)
{ {
if (String(dxcc) + g_colorBands[band] in g_tracker.worked.dxcc) if (String(dxcc) + "|" + g_colorBands[band] in g_tracker.worked.dxcc)
{ {
var strike = ""; var strike = "";
if (String(dxcc) + g_colorBands[band] in g_tracker.confirmed.dxcc) { strike = "text-decoration: underline overline;"; } if (String(dxcc) + "|" + g_colorBands[band] in g_tracker.confirmed.dxcc) { strike = "text-decoration: underline overline;"; }
worker += worker +=
"<div style='" + "<div style='" +
strike + strike +
@ -15807,7 +15785,7 @@ function mediaCheck()
try try
{ {
if (fs.existsSync(g_NWappData + "internal_qso.json")) if (fs.existsSync(g_NWappData + "internal_qso.json") && g_readInternalQso)
{ {
var data = JSON.parse(fs.readFileSync(g_NWappData + "internal_qso.json")); var data = JSON.parse(fs.readFileSync(g_NWappData + "internal_qso.json"));

Wyświetl plik

@ -227,7 +227,7 @@ function processRosterFiltering(callRoster, rosterSettings)
} }
if (g_rosterSettings.hunting == "dxcc") if (g_rosterSettings.hunting == "dxcc")
{ {
let hash = hashMaker(String(callObj.dxcc), let hash = hashMaker(String(callObj.dxcc) + "|",
callObj, g_rosterSettings.reference); callObj, g_rosterSettings.reference);
if (rosterSettings.huntIndex && (hash in rosterSettings.huntIndex.dxcc)) if (rosterSettings.huntIndex && (hash in rosterSettings.huntIndex.dxcc))
@ -283,7 +283,7 @@ function processRosterFiltering(callRoster, rosterSettings)
let huntFound = 0; let huntFound = 0;
for (index in callObj.cqza) for (index in callObj.cqza)
{ {
let hash = hashMaker(callObj.cqza[index], callObj, g_rosterSettings.reference); let hash = hashMaker(callObj.cqza[index] + "|", callObj, g_rosterSettings.reference);
if (hash in rosterSettings.huntIndex.cqz) huntFound++; if (hash in rosterSettings.huntIndex.cqz) huntFound++;
} }
@ -306,7 +306,7 @@ function processRosterFiltering(callRoster, rosterSettings)
let huntFound = 0; let huntFound = 0;
for (index in callObj.ituza) for (index in callObj.ituza)
{ {
let hash = hashMaker(callObj.ituza[index], callObj, g_rosterSettings.reference); let hash = hashMaker(callObj.ituza[index] + "|", callObj, g_rosterSettings.reference);
if (hash in rosterSettings.huntIndex.ituz) huntFound++; if (hash in rosterSettings.huntIndex.ituz) huntFound++;
} }

Wyświetl plik

@ -296,8 +296,8 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
// Hunting for DXCC // Hunting for DXCC
if (huntDXCC.checked) if (huntDXCC.checked)
{ {
let hash = String(callObj.dxcc) + workHashSuffix; let hash = String(callObj.dxcc) + "|" + workHashSuffix;
let layeredHash = rosterSettings.layeredMode && (String(callObj.dxcc) + layeredHashSuffix) let layeredHash = rosterSettings.layeredMode && (String(callObj.dxcc) + "|" + layeredHashSuffix)
if (rosterSettings.huntIndex && !(hash in rosterSettings.huntIndex.dxcc)) if (rosterSettings.huntIndex && !(hash in rosterSettings.huntIndex.dxcc))
{ {
@ -508,8 +508,8 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
for (const index in callObj.cqza) for (const index in callObj.cqza)
{ {
let hash = callObj.cqza[index] + workHashSuffix; let hash = callObj.cqza[index] + "|" + workHashSuffix;
let layeredHash = rosterSettings.layeredMode && (callObj.cqza[index] + layeredHashSuffix); let layeredHash = rosterSettings.layeredMode && (callObj.cqza[index] + "|" + layeredHashSuffix);
let marathonHash = huntMarathon.checked && `${callObj.cqza[index]}-${currentYear}`; let marathonHash = huntMarathon.checked && `${callObj.cqza[index]}-${currentYear}`;
if (rosterSettings.huntIndex && hash in rosterSettings.huntIndex.cqz) huntFound++; if (rosterSettings.huntIndex && hash in rosterSettings.huntIndex.cqz) huntFound++;
@ -590,8 +590,8 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
for (const index in callObj.ituza) for (const index in callObj.ituza)
{ {
let hash = callObj.ituza[index] + workHashSuffix; let hash = callObj.ituza[index] + "|" + workHashSuffix;
let layeredHash = rosterSettings.layeredMode && (callObj.ituza[index] + layeredHashSuffix) let layeredHash = rosterSettings.layeredMode && (callObj.ituza[index] + "|" + layeredHashSuffix)
if (rosterSettings.huntIndex && hash in rosterSettings.huntIndex.ituz) huntFound++; if (rosterSettings.huntIndex && hash in rosterSettings.huntIndex.ituz) huntFound++;
if (rosterSettings.layeredMode && layeredHash in rosterSettings.huntIndex.ituz) layeredFound++; if (rosterSettings.layeredMode && layeredHash in rosterSettings.huntIndex.ituz) layeredFound++;