Move and batch spots the way N1MM does
Two differences from N1MM in the spot path, both found by reading Packet.cs. Randomising moved every CW spot. PacketSpot.Randomize moves a spot only when it is not a dupe, not a self spot, not on a CQ frequency, is on CW and is not working split, and Packet skips it altogether for a station passed to another band. Moving a dupe or a split station makes it harder to find, not easier, so this now leaves the same ones alone. Whether a station has been worked comes from the log, so AppSession asks it before moving a spot. Split needed knowing where a station is listening, which is in the comment. Qsx reads it by N1MM's rules: QSX, UP, DOWN, DN, U or D, the word standing alone or after a space, a bare number after QSX meaning kilohertz inside the band and anything else an offset from the spot, an offset over a hundred kilohertz refused unless it says QSX, DN70 read as a grid square rather than five down, and a listening frequency outside the band thrown away. Spots reached the bandmap one at a time, each one redrawing every window that watches it. N1MM queues them and flushes the queue once a second, which is what this does now: the filters and the randomiser run over the batch, and the bandmap takes it in one call and raises one change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -43,6 +43,27 @@ public sealed class Bandmap
|
||||
Changed?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
/// A batch of spots in one go, so a busy node redraws the windows once
|
||||
/// rather than once a spot. N1MM collects arriving spots the same way.
|
||||
public void AddRange(IEnumerable<Spot> spots)
|
||||
{
|
||||
int added = 0;
|
||||
lock (guard)
|
||||
{
|
||||
foreach (Spot spot in spots)
|
||||
{
|
||||
string key = Key(spot);
|
||||
this.spots[key] = spot;
|
||||
arrived[key] = clock();
|
||||
added++;
|
||||
}
|
||||
}
|
||||
if (added > 0)
|
||||
{
|
||||
Changed?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
public void Remove(Callsign call, Band band)
|
||||
{
|
||||
string key = $"{call.Text}|{band.Name}";
|
||||
|
||||
Reference in New Issue
Block a user