Commit pirate JS files
This commit is contained in:
69
js/CandidateFilterHighResLocation.js
Normal file
69
js/CandidateFilterHighResLocation.js
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
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 - HighResLocation
|
||||
//
|
||||
// Reject HighResLocation messages whose Reference field is not an
|
||||
// established value.
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export class CandidateFilterHighResLocation
|
||||
extends CandidateFilterBase
|
||||
{
|
||||
constructor(t)
|
||||
{
|
||||
super("HighResLocation", t);
|
||||
}
|
||||
|
||||
OnFilterStart()
|
||||
{
|
||||
this.t.Event(`CandidateFilterHighResLocation Start`);
|
||||
}
|
||||
|
||||
OnFilterEnd()
|
||||
{
|
||||
this.t.Event(`CandidateFilterHighResLocation End`);
|
||||
}
|
||||
|
||||
FilterWindowAlgorithm(msgListList)
|
||||
{
|
||||
for (let slot = 0; slot < 5; ++slot)
|
||||
{
|
||||
for (let msg of NonRejectedOnlyFilter(msgListList[slot]))
|
||||
{
|
||||
if (!msg.IsTelemetryExtended())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
let codec = msg.GetCodec();
|
||||
if (codec.GetHdrTypeEnum() != 3)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (slot == 0)
|
||||
{
|
||||
msg.Reject(this.type, `HighResLocation is not supported in Slot 0.`);
|
||||
continue;
|
||||
}
|
||||
|
||||
let referenceEnum = codec.GetReferenceEnum();
|
||||
if (referenceEnum != 1)
|
||||
{
|
||||
msg.Reject(this.type, `HighResLocation Reference (${referenceEnum}) is not an established value.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user