Show the cluster's solar weather in a bandmap status bar
The reader follows N1MM's rules for WWV and WCY lines and the sh/wwv table. The bar is hidden until the cluster has sent some. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
namespace Nonemm.Spotting.Tests;
|
||||
|
||||
public class SolarReaderTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("WWV de VE7CC <18Z> : SFI=140, A=5, K=2, No Storms -> No Storms\a\a")]
|
||||
[InlineData("WCY de DK0WCY-1 <19> : K=2 expK=2 A=5 R=0 SFI=140 SA=qui GMF=qui Au=no")]
|
||||
[InlineData("WWV: SFI=140 A=5 K=2")]
|
||||
public void AnnouncementLinesAreKeptAsTheNodeSentThem(string line) =>
|
||||
Assert.Equal(line.TrimEnd('\a'), new SolarReader().Read(line));
|
||||
|
||||
[Fact]
|
||||
public void TheLineUnderAShWwvHeaderIsLabelled()
|
||||
{
|
||||
SolarReader reader = new();
|
||||
|
||||
Assert.Null(reader.Read("Date Hour SFI A K Forecast Logger"));
|
||||
Assert.Equal("SFI/A/K: 24-Oct-2026 1200Z 140 5 2 No Storms", reader.Read("24-Oct-2026 1200Z 140 5 2 No Storms"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ASpotCancelsTheHeader()
|
||||
{
|
||||
SolarReader reader = new();
|
||||
reader.Read("Date Hour SFI A K Forecast Logger");
|
||||
reader.Read("DX de K1TTT: 14025.0 JA1XYZ CW 1205Z");
|
||||
|
||||
Assert.Null(reader.Read("some other line"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OrdinaryLinesAreNotSolarWeather() =>
|
||||
Assert.Null(new SolarReader().Read("DX de K1TTT: 14025.0 JA1XYZ CW 26 dB 1205Z"));
|
||||
}
|
||||
Reference in New Issue
Block a user