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:
@@ -914,6 +914,7 @@ public sealed partial class AppSession : IDisposable
|
||||
public void ConnectCluster()
|
||||
{
|
||||
cluster?.Dispose();
|
||||
SetSolar("");
|
||||
cluster = new ClusterClient(
|
||||
Settings.ClusterHost,
|
||||
Settings.ClusterPort,
|
||||
@@ -923,14 +924,28 @@ public sealed partial class AppSession : IDisposable
|
||||
autoLogon: Settings.ClusterAutoLogon,
|
||||
keepAliveInterval: TimeSpan.FromMinutes(Math.Max(1, Settings.ClusterKeepAliveMinutes)));
|
||||
cluster.SpotArrived += (_, spot) => TakeSpot(spot);
|
||||
cluster.SolarArrived += (_, text) => SetSolar(text);
|
||||
cluster.ConnectionChanged += (_, _) => Changed?.Invoke(this, EventArgs.Empty);
|
||||
cluster.Start();
|
||||
}
|
||||
|
||||
/// The latest solar weather the cluster sent, or empty when it has sent
|
||||
/// none on this connection.
|
||||
public string Solar { get; private set; } = "";
|
||||
|
||||
public event EventHandler? SolarChanged;
|
||||
|
||||
private void SetSolar(string text)
|
||||
{
|
||||
Solar = text;
|
||||
SolarChanged?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
public void DisconnectCluster()
|
||||
{
|
||||
cluster?.Dispose();
|
||||
cluster = null;
|
||||
SetSolar("");
|
||||
Changed?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user