Add the Avalonia application and the station network
The entry window types contacts and colours them as they are typed; the log, check, bandmap, score and packet windows read the same session. Contacts are shared with the other stations of a multi-operator entry in N1MM's contact message, so an N1MM station on the same network sees them too. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
using Avalonia.Media;
|
||||
using Nonemm.Contests;
|
||||
using Nonemm.Core;
|
||||
|
||||
namespace Nonemm.App.Windows;
|
||||
|
||||
/// One line of the log window. It carries the colour so the log is coloured by
|
||||
/// the same scorer as the entry window and the bandmap.
|
||||
public sealed record LogRow(Qso Qso, Verdict? Verdict)
|
||||
{
|
||||
public string Time => Qso.TimestampUtc.ToString("MM-dd HH:mm");
|
||||
|
||||
public string Call => Qso.Call.Text;
|
||||
|
||||
public string Frequency => Qso.Frequency.Kilohertz.ToString("0.0");
|
||||
|
||||
public string Mode => Qso.Mode.Name;
|
||||
|
||||
public string Sent => $"{Qso.SentReport} {SentExchange()}".Trim();
|
||||
|
||||
public string Received => $"{Qso.ReceivedReport} {ReceivedExchange()}".Trim();
|
||||
|
||||
public string Country => Qso.CountryPrefix;
|
||||
|
||||
public int Points => Qso.Points;
|
||||
|
||||
public string Multipliers => string.Concat(
|
||||
Qso.IsMultiplier1 ? "1" : "",
|
||||
Qso.IsMultiplier2 ? "2" : "",
|
||||
Qso.IsMultiplier3 ? "3" : "");
|
||||
|
||||
public string Operator => Qso.Operator;
|
||||
|
||||
public IBrush Colour => Verdicts.Colour(Verdict);
|
||||
|
||||
private string SentExchange() =>
|
||||
Qso.SentNumber > 0 ? Qso.SentNumber.ToString() : "";
|
||||
|
||||
private string ReceivedExchange()
|
||||
{
|
||||
List<string> parts = [];
|
||||
if (Qso.ReceivedNumber > 0)
|
||||
{
|
||||
parts.Add(Qso.ReceivedNumber.ToString());
|
||||
}
|
||||
if (Qso.Zone > 0)
|
||||
{
|
||||
parts.Add(Qso.Zone.ToString());
|
||||
}
|
||||
foreach (string value in new[] { Qso.Section, Qso.Exchange1, Qso.Name, Qso.GridSquare, Qso.MiscText })
|
||||
{
|
||||
if (value.Length > 0)
|
||||
{
|
||||
parts.Add(value);
|
||||
}
|
||||
}
|
||||
return string.Join(' ', parts);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user