Show local spots in bold and name the computer that made them
A spot an operator put on a bandmap, here or on another computer, is drawn in bold. Its hover text names the computer instead of the spotter's callsign. A spot from another computer carries the name from the ADDSPOT message. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -79,7 +79,10 @@ public sealed partial class AppSession
|
||||
DateTime.UtcNow,
|
||||
SpotSource.Operator,
|
||||
position.Me.Callsign,
|
||||
$"Local spot by {Settings.CurrentOperator}");
|
||||
$"Local spot by {Settings.CurrentOperator}")
|
||||
{
|
||||
Computer = ComputerName,
|
||||
};
|
||||
heardAt.Remove(position);
|
||||
Bandmap.Add(spot);
|
||||
SendSpots([spot]);
|
||||
@@ -113,6 +116,7 @@ public sealed partial class AppSession
|
||||
shared.Comment)
|
||||
{
|
||||
Qsx = shared.Qsx,
|
||||
Computer = shared.Computer,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ public sealed class BandmapView : Control
|
||||
private static readonly IBrush OutsideBrush = new SolidColorBrush(Color.FromRgb(0xC0, 0x39, 0x2B), 0.13);
|
||||
|
||||
private readonly Typeface typeface = new(Fonts.Mono);
|
||||
private readonly Typeface boldTypeface = new(Fonts.Mono, FontStyle.Normal, FontWeight.Bold);
|
||||
private IReadOnlyList<BandmapLabel> placed = [];
|
||||
private BandmapScale scale = new(Bands.Band20M.Low, Bands.Band20M.High, 1);
|
||||
|
||||
@@ -176,7 +177,7 @@ public sealed class BandmapView : Control
|
||||
new Point(ScaleX + 2, label.MarkY),
|
||||
new Point(LabelX - 2, label.LabelY + (LabelHeight / 2)));
|
||||
context.DrawText(
|
||||
Text(label.Spot.Call.Text, colour, TextSize),
|
||||
Text(label.Spot.Call.Text, colour, TextSize, label.Spot.IsLocal),
|
||||
new Point(LabelX, label.LabelY + (LabelPadding / 2)));
|
||||
}
|
||||
|
||||
@@ -216,8 +217,8 @@ public sealed class BandmapView : Control
|
||||
FrequencyPicked?.Invoke(this, scale.At(at.Y - Inset));
|
||||
}
|
||||
|
||||
private FormattedText Text(string text, IBrush brush, double size) =>
|
||||
new(text, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, typeface, size, brush);
|
||||
private FormattedText Text(string text, IBrush brush, double size, bool bold = false) =>
|
||||
new(text, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, bold ? boldTypeface : typeface, size, brush);
|
||||
|
||||
/// The form's text colour, which the theme sets in both light and dark.
|
||||
private IBrush Foreground() =>
|
||||
|
||||
@@ -499,7 +499,7 @@ public sealed partial class EntryWindow
|
||||
string comment = MessageExpander.Expand(
|
||||
session.Settings.SpotComment, Logging, session.Other(Logging));
|
||||
_ = cluster.SendSpotAsync(Logging.Frequency, me, comment);
|
||||
session.Bandmap.Add(new Spot(me, Logging.Frequency, DateTime.UtcNow, SpotSource.Operator));
|
||||
session.Bandmap.Add(new Spot(me, Logging.Frequency, DateTime.UtcNow, SpotSource.Operator) { Computer = session.ComputerName });
|
||||
Status($"spotted {me.Text} on {Logging.Frequency.Kilohertz:0.0}");
|
||||
}
|
||||
|
||||
|
||||
@@ -385,7 +385,7 @@ public sealed partial class EntryWindow
|
||||
return;
|
||||
}
|
||||
await cluster.SendSpotAsync(where, call, MessageExpander.Expand(session.Settings.SpotComment, Logging, session.Other(Logging)));
|
||||
session.Bandmap.Add(new Spot(call, where, DateTime.UtcNow, SpotSource.Operator));
|
||||
session.Bandmap.Add(new Spot(call, where, DateTime.UtcNow, SpotSource.Operator) { Computer = session.ComputerName });
|
||||
Status($"{call.Text} spotted on {where.Kilohertz:0.0}");
|
||||
}
|
||||
|
||||
@@ -428,7 +428,10 @@ public sealed partial class EntryWindow
|
||||
DateTime.UtcNow,
|
||||
SpotSource.Operator,
|
||||
session.Settings.Station.Callsign,
|
||||
"Local spot"));
|
||||
"Local spot")
|
||||
{
|
||||
Computer = session.ComputerName,
|
||||
});
|
||||
Status($"{call.Text} stored on {Logging.Frequency.Kilohertz:0.0}");
|
||||
boxes[0].Focus();
|
||||
}
|
||||
|
||||
@@ -1295,7 +1295,10 @@ public sealed partial class EntryWindow : Window
|
||||
Logging.Frequency,
|
||||
DateTime.UtcNow,
|
||||
Nonemm.Spotting.SpotSource.Operator,
|
||||
Logging.Me.Callsign));
|
||||
Logging.Me.Callsign)
|
||||
{
|
||||
Computer = session.ComputerName,
|
||||
});
|
||||
Status($"{Logging.Entry.Call.Trim()} put on the bandmap");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user