From f37059f12eabcc38a16989ec423a08970656ae95 Mon Sep 17 00:00:00 2001 From: Christian Bayer Date: Sun, 18 Feb 2024 09:24:31 -0500 Subject: [PATCH] Canadian century club award added --- package.nw/data/awards.json | 49 +++++++++++++++++++++++++++++++++++++ package.nw/lib/gt.js | 2 +- package.nw/lib/roster.js | 42 ++++++++++++++++++++++++++++++- 3 files changed, 91 insertions(+), 2 deletions(-) diff --git a/package.nw/data/awards.json b/package.nw/data/awards.json index 40438a3..cc53bd3 100644 --- a/package.nw/data/awards.json +++ b/package.nw/data/awards.json @@ -10504,6 +10504,55 @@ }, "sponsor": "RAC", "tooltip": "Worked All North America Award" + }, + "CCC": { + "name": "CCC - Canadian Century Club", + "rule": { + "band": [ + "Mixed" + ], + "dxcc": "1", + "state": [ + "BC", + "QC", + "PE", + "ON", + "AB", + "MB", + "NS", + "SK", + "NU", + "NT", + "NL", + "YT", + "NB" + ], + "count": [ + 100 + ], + "endorse": [ + "2m", + "6m", + "10m", + "12m", + "15m", + "17m", + "20m", + "30m", + "40m", + "60m", + "80m", + "160m" + ], + "mode": [ + "Digital", + "Phone", + "Mixed" + ], + "type": "call" + }, + "sponsor": "RAC", + "tooltip": "Canadian Century Club Award" } }, "compiledBy": "WA4YA", diff --git a/package.nw/lib/gt.js b/package.nw/lib/gt.js index a0efdb4..c150311 100644 --- a/package.nw/lib/gt.js +++ b/package.nw/lib/gt.js @@ -5923,7 +5923,7 @@ function finalWsjtxDecode(newMessage, isFox = false, foxMessage) canPath = true; } - if (theirQTH in GT.liveGrids) + if (theirQTH in GT.liveGrids) { GT.liveGrids[theirQTH].age = GT.timeNow; } diff --git a/package.nw/lib/roster.js b/package.nw/lib/roster.js index b1e9540..e4587ea 100644 --- a/package.nw/lib/roster.js +++ b/package.nw/lib/roster.js @@ -2733,7 +2733,8 @@ function buildAwardTypeHandlers() cont2band: { name: "Continents per Band" }, calls2band: { name: "Stations per Band" }, dxcc2band: { name: "DXCC per Band" }, - states2band: { name: "States per Band" } + states2band: { name: "States per Band" }, + ccc: { name: "Canada Century Award" } }; CR.awardTypes.IOTA.score = scoreAIOTA; @@ -2757,6 +2758,7 @@ function buildAwardTypeHandlers() CR.awardTypes.calls2band.score = scoreAcalls2band; CR.awardTypes.dxcc2band.score = scoreAdxcc2band; CR.awardTypes.states2band.score = scoreAstates2band; + CR.awardTypes.ccc.score = scoreAccc; CR.awardTypes.IOTA.test = testAIOTA; CR.awardTypes.call.test = testAcall; @@ -2779,6 +2781,7 @@ function buildAwardTypeHandlers() CR.awardTypes.calls2band.test = testAcalls2band; CR.awardTypes.dxcc2band.test = testAdxcc2band; CR.awardTypes.states2band.test = testAstates; + CR.awardTypes.ccc.test = testAccc; CR.awardTypes.IOTA.compile = singleCompile; CR.awardTypes.call.compile = singleCompile; @@ -2801,6 +2804,7 @@ function buildAwardTypeHandlers() CR.awardTypes.calls2band.compile = doubleCompile; CR.awardTypes.dxcc2band.compile = doubleCompile; CR.awardTypes.states2band.compile = doubleCompile; + CR.awardTypes.ccc.compile = doubleCompile; } function scoreAstates(award, obj) @@ -2885,6 +2889,28 @@ function scoreAcont(award, obj) } return false; } +function scoreAccc(award, obj) +{ + if (obj.dxcc && obj.state) + { + let dxcc = obj.dxcc; + if (dxcc === 1) + { + let state = obj.state; + if (!(state in award.stat)) award.stat[state] = newAwardCountObject(); + if (award.stat[state].unique.length > 20) return false; + return workAwardObject( + award.stat[state], + obj.band, + obj.mode, + obj.digital, + obj.phone, + obj.DEcall + ); + } + } + return false; +} function testAcont(award, obj, baseHash) { @@ -2901,6 +2927,20 @@ function testAcont(award, obj, baseHash) return true; } +function testAccc(award, obj, baseHash) +{ + if (obj.dxcc && obj.state) + { + let dxcc = obj.dxcc; + let state = obj.state; + if (dxcc + baseHash in CR.tracker[award.test.look].dxcc && state + baseHash in CR.tracker[award.test.look].state) + { + return false; + } + } + return true; +} + function scoreAcont5(award, obj, baseHash) { if (obj.cont)