kopia lustrzana https://gitlab.com/gridtracker.org/gridtracker
DX Marathon hunting
rodzic
f92ca3dd51
commit
6d6e86df36
|
@ -189,6 +189,9 @@
|
|||
<div>
|
||||
<label><input type="checkbox" id="huntITUz" onchange="wantedChanged(this);" /> ITUz</label>
|
||||
</div>
|
||||
<div>
|
||||
<label title='CQ DX Marathon'><input type="checkbox" id="huntMarathon" onchange="wantedChanged(this);" /> Marathon</label>
|
||||
</div>
|
||||
<div>
|
||||
<label><input type="checkbox" id="huntState" onchange="wantedChanged(this);" /> State</label>
|
||||
</div>
|
||||
|
|
|
@ -1065,6 +1065,10 @@ function addDeDx(
|
|||
finalSatName = ""
|
||||
)
|
||||
{
|
||||
var currentYear = new Date().getFullYear();
|
||||
var qsoDate = new Date(1970, 0, 1); qsoDate.setSeconds(finalTime);
|
||||
var isCurrentYear = (qsoDate.getFullYear() == currentYear);
|
||||
|
||||
var callsign = null;
|
||||
var rect = null;
|
||||
var worked = false;
|
||||
|
@ -1262,6 +1266,10 @@ function addDeDx(
|
|||
g_tracker.worked.cqz[details.cqz + "dg"] = true;
|
||||
g_tracker.worked.cqz[details.cqz + band + "dg"] = true;
|
||||
}
|
||||
if (isCurrentYear)
|
||||
{
|
||||
g_tracker.worked.cqz[`${details.cqz}-${currentYear}`] = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (details.dxcc > 0)
|
||||
|
@ -1276,6 +1284,10 @@ function addDeDx(
|
|||
g_tracker.worked.dxcc[sDXCC + "dg"] = true;
|
||||
g_tracker.worked.dxcc[sDXCC + band + "dg"] = true;
|
||||
}
|
||||
if (isCurrentYear)
|
||||
{
|
||||
g_tracker.worked.dxcc[`${sDXCC}-${currentYear}`] = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (details.px)
|
||||
|
|
|
@ -98,6 +98,7 @@ var g_defaultSettings = {
|
|||
huntDXCC: true,
|
||||
huntCQz: false,
|
||||
huntITUz: false,
|
||||
huntMarathon: false,
|
||||
huntState: false,
|
||||
huntCounty: false,
|
||||
huntCont: false,
|
||||
|
|
|
@ -13,6 +13,9 @@ function processRosterHunting(callRoster, rosterSettings)
|
|||
let layeredUnconf = "background-clip:padding-box;box-shadow: 0 0 4px 2px inset ";
|
||||
let layeredUnconfAlpha = "AA";
|
||||
|
||||
const currentYear = new Date().getFullYear();
|
||||
const currentYearSuffix = `’${currentYear - 2000}`;
|
||||
|
||||
// TODO: Hunting results might be used to filter, based on the "Callsigns: Only Wanted" option,
|
||||
// so maybe we can move this loop first, and add a check to the filtering loop?
|
||||
|
||||
|
@ -335,6 +338,27 @@ function processRosterHunting(callRoster, rosterSettings)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
callObj.dxccSuffix = null
|
||||
if (huntMarathon.checked && callObj.hunting.dxcc != "hunted" && callObj.hunting.dxcc != "checked")
|
||||
{
|
||||
callObj.reason.push("dxcc-marathon");
|
||||
|
||||
let hash = `${callObj.dxcc}-${currentYear}`;
|
||||
if (rosterSettings.huntIndex && !(hash in rosterSettings.huntIndex.dxcc))
|
||||
{
|
||||
if (!rosterSettings.workedIndex || !(hash in rosterSettings.workedIndex.dxcc))
|
||||
{
|
||||
callObj.dxccSuffix = currentYearSuffix;
|
||||
|
||||
callObj.hunting.dxccMarathon = "hunted";
|
||||
if (!callObj.hunting.dxcc)
|
||||
{
|
||||
dxccConf = `${unconf}${dxcc}${layeredAlpha};`;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Hunting for US States
|
||||
|
@ -513,17 +537,23 @@ function processRosterHunting(callRoster, rosterSettings)
|
|||
if (huntCQz.checked == true)
|
||||
{
|
||||
let huntTotal = callObj.cqza.length;
|
||||
let huntFound = 0, layeredFound = 0, workedFound = 0, layeredWorkedFound = 0;
|
||||
let huntFound = 0, layeredFound = 0, workedFound = 0, layeredWorkedFound = 0, marathonFound = 0;
|
||||
|
||||
for (index in callObj.cqza)
|
||||
{
|
||||
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}`;
|
||||
|
||||
if (rosterSettings.huntIndex && hash in rosterSettings.huntIndex.cqz) huntFound++;
|
||||
if (rosterSettings.layeredMode && layeredHash in rosterSettings.huntIndex.cqz) layeredFound++;
|
||||
if (rosterSettings.workedIndex && hash in rosterSettings.workedIndex.cqz) workedFound++;
|
||||
if (rosterSettings.layeredMode && layeredHash in rosterSettings.workedIndex.cqz) layeredWorkedFound++;
|
||||
if (marathonHash)
|
||||
{
|
||||
if (rosterSettings.huntIndex && marathonHash in rosterSettings.huntIndex.cqz) marathonFound++;
|
||||
else if (rosterSettings.workedIndex && marathonHash in rosterSettings.workedIndex.cqz) marathonFound++;
|
||||
}
|
||||
}
|
||||
if (huntFound != huntTotal)
|
||||
{
|
||||
|
@ -566,6 +596,23 @@ function processRosterHunting(callRoster, rosterSettings)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
callObj.cqzSuffix = null
|
||||
if (huntMarathon.checked && callObj.hunting.cqz != "hunted" && callObj.hunting.cqz != "worked")
|
||||
{
|
||||
if (marathonFound != huntTotal)
|
||||
{
|
||||
callObj.reason.push("cqz-marathon");
|
||||
|
||||
callObj.cqzSuffix = currentYearSuffix;
|
||||
|
||||
callObj.hunting.cqzMarathon = "hunted";
|
||||
if (!callObj.hunting.cqz)
|
||||
{
|
||||
cqzConf = `${unconf}${cqz}${layeredAlpha};`;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Hunting for ITU Zones
|
||||
|
|
|
@ -117,9 +117,9 @@ const ROSTER_COLUMNS = {
|
|||
compare: (a, b) => window.opener.myDxccCompare(a.callObj, b.callObj),
|
||||
tableData: (callObj) => ({
|
||||
title: window.opener.g_worldGeoData[window.opener.g_dxccToGeoData[callObj.dxcc]].pp,
|
||||
name: `DXCC (${callObj.dxcc})`,
|
||||
name: `${callObj.dxcc}`,
|
||||
rawAttrs: callObj.style.dxcc,
|
||||
html: window.opener.g_dxccToAltName[callObj.dxcc]
|
||||
html: [window.opener.g_dxccToAltName[callObj.dxcc], callObj.dxccSuffix].join(" ")
|
||||
})
|
||||
},
|
||||
|
||||
|
@ -216,7 +216,7 @@ const ROSTER_COLUMNS = {
|
|||
tableData: (callObj) => ({
|
||||
name: "CQz",
|
||||
rawAttrs: callObj.style.cqz,
|
||||
html: callObj.cqza.join(",")
|
||||
html: [callObj.cqza.join(","), callObj.cqzSuffix].join(" ")
|
||||
})
|
||||
},
|
||||
|
||||
|
@ -397,12 +397,14 @@ const ROSTER_COLUMNS = {
|
|||
}
|
||||
}
|
||||
|
||||
WANTED_ORDER = ["call", "qrz", "cont", "dxcc", "cqz", "ituz", "state", "grid", "cnty", "wpx", "oams"];
|
||||
WANTED_ORDER = ["call", "qrz", "cont", "dxcc", "cqz", "ituz", "dxccMarathon", "cqzMarathon", "state", "grid", "cnty", "wpx", "oams"];
|
||||
WANTED_LABELS = {
|
||||
cont: "Continent",
|
||||
cqz: "CQ Zone",
|
||||
ituz: "ITU Zone",
|
||||
dxcc: "DXCC",
|
||||
dxccMarathon: "Marathon DXCC",
|
||||
cqzMarathon: "Marathon CQ Zone",
|
||||
state: "State",
|
||||
grid: "Grid",
|
||||
cnty: "County",
|
||||
|
@ -424,7 +426,8 @@ function wantedColumnParts(callObj, options)
|
|||
let wanted = callObj.hunting[field];
|
||||
|
||||
if (wanted == "calling") { parts.push("Calling"); }
|
||||
else if (wanted == "hunted" && field == "qrz") { parts.push("QRZ"); }
|
||||
// else if (wanted == "caller") { parts.push("Called"); }
|
||||
else if (wanted == "hunted" && field == "qrz") { parts.push("Caller"); }
|
||||
else if (wanted == "hunted" && field == "oams") { parts.push("OAMS User"); }
|
||||
else if (wanted == "hunted") { parts.push(`${options.html ? "<b>" : ""}New ${WANTED_LABELS[field]}${options.html ? "<b>" : ""}`); }
|
||||
else if (wanted == "worked") { parts.push(`Worked ${WANTED_LABELS[field]}`); }
|
||||
|
@ -433,7 +436,7 @@ function wantedColumnParts(callObj, options)
|
|||
else if (wanted == "worked-and-mixed") { parts.push(`Worked ${callObj.band} ${WANTED_LABELS[field]}`); }
|
||||
})
|
||||
|
||||
if (parts[0] == "Calling" && parts[1] == "Calling")
|
||||
if (parts[0] == "Calling" && parts[1] == "Caller")
|
||||
{
|
||||
parts.shift(); parts.shift();
|
||||
parts.unshift(`${options.html ? "<b>" : ""}Working${options.html ? "<b>" : ""}`);
|
||||
|
|
Ładowanie…
Reference in New Issue