Commit pirate JS files

This commit is contained in:
2026-04-02 17:39:02 -06:00
parent 7b15a0eb9c
commit d287f8a443
49 changed files with 19149 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
/*
Copyright (c) 2023-forever Douglas Malnati. All rights reserved.
See the /faq/tos page for details.
(If this generated header is stamped on a file which is a 3rd party file or under a different license or copyright, then ignore this copyright statement and use that file's terms.)
*/
import { CandidateFilterBase } from './CandidateFilterBase.js';
import { NonRejectedOnlyFilter } from './WsprMessageCandidate.js';
///////////////////////////////////////////////////////////////////////////
// Candidate Filter - Confirmed
//
// If a slot contains one or more confirmed messages, reject any remaining
// non-confirmed candidates in that same slot.
///////////////////////////////////////////////////////////////////////////
export class CandidateFilterConfirmed
extends CandidateFilterBase
{
constructor(t)
{
super("ByConfirmed", t);
}
OnFilterStart()
{
this.t.Event(`CandidateFilterConfirmed Start`);
}
OnFilterEnd()
{
this.t.Event(`CandidateFilterConfirmed End`);
}
FilterWindowAlgorithm(msgListList)
{
for (let slot = 0; slot < 5; ++slot)
{
let msgList = NonRejectedOnlyFilter(msgListList[slot]);
let hasConfirmed = msgList.some(msg => msg.IsConfirmed());
if (!hasConfirmed)
{
continue;
}
for (let msg of msgList)
{
if (msg.IsCandidate())
{
msg.Reject(
this.type,
`Confirmed message found in slot ${slot}, rejecting unconfirmed candidates in same slot.`
);
}
}
}
}
}