diff --git a/changelog.d/+lagekarte-bereitstellungsraum.added.md b/changelog.d/+lagekarte-bereitstellungsraum.added.md
new file mode 100644
index 00000000..d383f8ac
--- /dev/null
+++ b/changelog.d/+lagekarte-bereitstellungsraum.added.md
@@ -0,0 +1 @@
+A Bereitstellungsraum from the Organisation can be placed on the Lagekarte with its own sign, shows the name recorded there, follows every edit made there and opens its details from the map (#966).
diff --git a/src/LageBuch.App.Shared/Controls/TacticalSignControl.cs b/src/LageBuch.App.Shared/Controls/TacticalSignControl.cs
index f2ede12e..ae6fe564 100644
--- a/src/LageBuch.App.Shared/Controls/TacticalSignControl.cs
+++ b/src/LageBuch.App.Shared/Controls/TacticalSignControl.cs
@@ -18,6 +18,8 @@ namespace LageBuch.App.Shared.Controls;
/// it draws the Verbindungsstrich back to the unit's pin, which stands
/// away (§1.5: a sign moved aside "mit Verbindungsstrichen zur jeweiligen
/// Örtlichkeit"). The strich leaves the control's bounds on purpose; only the sign takes the pointer.
+/// A Bereitstellungsraum (#966) is drawn instead as its DV 102 sign from the same set, a yellow
+/// circle holding a vehicle's outline, around the same .
///
public sealed class TacticalSignControl : Control
{
@@ -32,10 +34,18 @@ public sealed class TacticalSignControl : Control
public static readonly StyledProperty TitleProperty =
AvaloniaProperty.Register(nameof(Title));
+ public static readonly StyledProperty IsBereitstellungsraumProperty =
+ AvaloniaProperty.Register(nameof(IsBereitstellungsraum));
+
private const double WheelRadius = 2.4;
private const double SymbolHeight = BodyHeight + 7;
private const double Gap = 4;
+ // The Bereitstellungsraum's circle: a little taller than the vehicle's body, centred where it is.
+ // The set draws it with radius 64 around (128, 128) of its 256 units.
+ private const double StelleRadius = (BodyHeight / 2) + 1;
+ private const double StelleScale = StelleRadius / 64;
+
// The body's top edge sags towards the middle, as on the DV 102 Kraftfahrzeug sign.
private const double Sag = 3.5;
@@ -48,6 +58,10 @@ public sealed class TacticalSignControl : Control
private const double SmallCodeLeft = 1.8;
private static readonly IBrush Red = new ImmutableSolidColorBrush(Color.FromRgb(0xFF, 0x00, 0x00));
+ private static readonly IBrush Yellow = new ImmutableSolidColorBrush(Color.FromRgb(0xFF, 0xFF, 0x00));
+
+ // The set's 5-unit black line, at the Bereitstellungsraum's scale.
+ private static readonly IPen StelleLine = new ImmutablePen(Brushes.Black, 5 * StelleScale);
// Twice the edge's width: clipped to the body, only its inner half shows, just inside the outline.
private static readonly IPen InnerEdge = new ImmutablePen(Brushes.White, 3.2);
@@ -69,8 +83,8 @@ public sealed class TacticalSignControl : Control
static TacticalSignControl()
{
- AffectsMeasure(VehicleTypeProperty, TitleProperty);
- AffectsRender(VehicleTypeProperty, TitleProperty, MapMarkerPanel.ResolvedOffsetProperty);
+ AffectsMeasure(VehicleTypeProperty, TitleProperty, IsBereitstellungsraumProperty);
+ AffectsRender(VehicleTypeProperty, TitleProperty, IsBereitstellungsraumProperty, MapMarkerPanel.ResolvedOffsetProperty);
}
/// The body's middle: where the sign is anchored to its offset from the pin.
@@ -89,6 +103,13 @@ public string? Title
set => SetValue(TitleProperty, value);
}
+ /// Draws the Bereitstellungsraum's circle instead of a vehicle; is ignored then.
+ public bool IsBereitstellungsraum
+ {
+ get => GetValue(IsBereitstellungsraumProperty);
+ set => SetValue(IsBereitstellungsraumProperty, value);
+ }
+
protected override Size MeasureOverride(Size availableSize) => Layout().Size;
public override void Render(DrawingContext context)
@@ -105,6 +126,12 @@ public override void Render(DrawingContext context)
context.DrawLine(Strich, SymbolCenter, pin);
}
+ if (IsBereitstellungsraum)
+ {
+ DrawBereitstellungsraum(context, layout);
+ return;
+ }
+
var body = Body();
context.DrawGeometry(Red, null, body);
using (context.PushGeometryClip(body))
@@ -139,6 +166,11 @@ public override void Render(DrawingContext context)
context.DrawText(code, origin);
}
+ DrawLines(context, layout);
+ }
+
+ private static void DrawLines(DrawingContext context, SignLayout layout)
+ {
foreach (var (text, origin) in layout.Lines)
{
context.FillRectangle(TextBackground, new Rect(origin.X - 2, origin.Y, text.Width + 4, text.Height), 2);
@@ -146,6 +178,33 @@ public override void Render(DrawingContext context)
}
}
+ // The DV 102 sign Bereitstellungsraum, traced from the set's Einrichtungen/Bereitstellungsraum:
+ // a yellow circle edged in black, holding the outline of a vehicle's body, unfilled.
+ private static void DrawBereitstellungsraum(DrawingContext context, SignLayout layout)
+ {
+ var circle = new EllipseGeometry(new Rect(
+ SymbolCenter.X - StelleRadius, SymbolCenter.Y - StelleRadius, StelleRadius * 2, StelleRadius * 2));
+ context.DrawGeometry(Yellow, StelleLine, circle);
+
+ var vehicle = new StreamGeometry();
+ using (var g = vehicle.Open())
+ {
+ g.BeginFigure(InStelle(85, 105), isFilled: false);
+ g.LineTo(InStelle(85, 151));
+ g.LineTo(InStelle(171, 151));
+ g.LineTo(InStelle(171, 105));
+ g.QuadraticBezierTo(InStelle(128, 128), InStelle(85, 105));
+ g.EndFigure(isClosed: true);
+ }
+
+ context.DrawGeometry(null, StelleLine, vehicle);
+ DrawLines(context, layout);
+ }
+
+ // A point of the set's Bereitstellungsraum drawing, in this control's pixels.
+ private static Point InStelle(double x, double y) =>
+ new(SymbolCenter.X + ((x - 128) * StelleScale), SymbolCenter.Y + ((y - 128) * StelleScale));
+
// The marks inside the body, traced from the set's SVGs in its 256-unit coordinates.
private static void DrawMark(DrawingContext context, VehicleMark mark)
{
@@ -271,6 +330,10 @@ private static StreamGeometry Body()
private SignLayout Layout()
{
var bold = new Typeface(FontFamily.Default, FontStyle.Normal, FontWeight.Bold);
+ if (IsBereitstellungsraum)
+ {
+ return WithTitle(code: null, codeIsSmall: false, SymbolCenter.X + StelleRadius + Gap + 2, bold);
+ }
// Where the code goes depends on the mark: in the middle of a bare sign, small above the
// line of one that has a line, and nowhere on the ladder and the hose, which say it already.
@@ -301,12 +364,18 @@ private SignLayout Layout()
code.Trimming = TextTrimming.CharacterEllipsis;
}
+ return WithTitle(code, codeIsSmall, SymbolWidth + Gap + 2, bold);
+ }
+
+ // The name to the right of the sign, from titleLeft.
+ private SignLayout WithTitle(FormattedText? code, bool codeIsSmall, double titleLeft, Typeface bold)
+ {
var lines = new List<(FormattedText Text, Point Origin)>();
var width = SymbolWidth;
if (!string.IsNullOrWhiteSpace(Title))
{
var title = new FormattedText(Title, Culture, FlowDirection.LeftToRight, bold, 12, TextInk);
- var origin = new Point(SymbolWidth + Gap + 2, (BodyHeight - title.Height) / 2);
+ var origin = new Point(titleLeft, (BodyHeight - title.Height) / 2);
lines.Add((title, origin));
width = Math.Max(width, origin.X + title.Width + 2);
}
diff --git a/src/LageBuch.App.Shared/Views/LagekarteView.axaml b/src/LageBuch.App.Shared/Views/LagekarteView.axaml
index 98449b45..59ad1db2 100644
--- a/src/LageBuch.App.Shared/Views/LagekarteView.axaml
+++ b/src/LageBuch.App.Shared/Views/LagekarteView.axaml
@@ -301,6 +301,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/LageBuch.AppLogic/LocalIncidentSession.cs b/src/LageBuch.AppLogic/LocalIncidentSession.cs
index 8c4316b5..0a22490f 100644
--- a/src/LageBuch.AppLogic/LocalIncidentSession.cs
+++ b/src/LageBuch.AppLogic/LocalIncidentSession.cs
@@ -209,6 +209,12 @@ public void SetForceUnitVehicleType(Guid unitId, string? vehicleType) =>
public void MoveForceUnitLabel(Guid unitId, LabelOffset? offset) =>
Mutate(() => Incident.MoveForceUnitLabel(_clock, RequireOperator(), unitId, offset));
+ public void PlaceCommandNode(Guid nodeId, GeoPoint? position) =>
+ Mutate(() => Incident.PlaceCommandNode(_clock, RequireOperator(), nodeId, position));
+
+ public void MoveCommandNodeLabel(Guid nodeId, LabelOffset? offset) =>
+ Mutate(() => Incident.MoveCommandNodeLabel(_clock, RequireOperator(), nodeId, offset));
+
public void PlaceRoleAssignment(Guid assignmentId, Guid? nodeId, RoleSlot slot) =>
Mutate(() => Incident.PlaceRoleAssignment(_clock, RequireOperator(), assignmentId, nodeId, slot));
diff --git a/src/LageBuch.AppLogic/ViewModels/IncidentWorkspaceViewModel.cs b/src/LageBuch.AppLogic/ViewModels/IncidentWorkspaceViewModel.cs
index d1b57db4..ed654bd4 100644
--- a/src/LageBuch.AppLogic/ViewModels/IncidentWorkspaceViewModel.cs
+++ b/src/LageBuch.AppLogic/ViewModels/IncidentWorkspaceViewModel.cs
@@ -1149,7 +1149,18 @@ private void BuildChildren()
OfferUndo,
OpenDispatchChannelDialog);
- Lagekarte = new LagekarteViewModel(_session, OnChanged, _mapPacks, _mapNightMode, _dialogs, RequestConfirm, _weather, _clock, _luftbild);
+ // A Bereitstellungsraum's details open in the Organisation's dialog, so they are edited in one place (#966).
+ Lagekarte = new LagekarteViewModel(
+ _session,
+ OnChanged,
+ _mapPacks,
+ _mapNightMode,
+ _dialogs,
+ RequestConfirm,
+ _weather,
+ _clock,
+ _luftbild,
+ nodeId => OpenCommandNodeDialog(CommandNodeDialogViewModel.ForEdit(_session, _masterData, nodeId, OnChanged)));
LeadershipTabs = new LeadershipTabsViewModel(Leadership, Roles, Forces, Lagekarte, reopenTab);
diff --git a/src/LageBuch.AppLogic/ViewModels/LagekarteViewModel.cs b/src/LageBuch.AppLogic/ViewModels/LagekarteViewModel.cs
index fcdf1459..e75afa68 100644
--- a/src/LageBuch.AppLogic/ViewModels/LagekarteViewModel.cs
+++ b/src/LageBuch.AppLogic/ViewModels/LagekarteViewModel.cs
@@ -6,6 +6,7 @@
using LageBuch.AppLogic.Services.Weather;
using LageBuch.Domain;
using LageBuch.Domain.Etb;
+using LageBuch.Domain.Leadership;
using LageBuch.Domain.Time;
using LageBuch.Domain.ValueObjects;
using LageBuch.Persistence.Map;
@@ -20,6 +21,8 @@ namespace LageBuch.AppLogic.ViewModels;
/// survive another device's Kartenpaket -- the packs are only the backdrop, and every pack on
/// the device is drawn as one map. The pack also brings
/// the Hydranten drawn over the map and the addresses an Einsatzort can be found by, offline.
+/// The Bereitstellungsräume come from the Organisation (#966): the map keeps only where each one
+/// stands, and shows its name and opens its details from the node, so they are edited in one place.
///
public sealed partial class LagekarteViewModel : ObservableObject, INarrowAware, IDisposable
{
@@ -39,6 +42,7 @@ public sealed partial class LagekarteViewModel : ObservableObject, INarrowAware,
private readonly IRegionPackLibrary? _library;
private readonly MapNightMode _nightMode;
private readonly Action? _requestConfirm;
+ private readonly Action? _editCommandNode;
private IReadOnlyList _packs = [];
// Screen coordinates stay independent of the view's UI toolkit.
@@ -64,12 +68,15 @@ public LagekarteViewModel(
Action? requestConfirm = null,
IWeatherSource? weather = null,
IClock? clock = null,
- LdbvImageryClient? luftbild = null)
+ LdbvImageryClient? luftbild = null,
+ Action? editCommandNode = null)
{
ArgumentNullException.ThrowIfNull(session);
ArgumentNullException.ThrowIfNull(onChanged);
_session = session;
_onChanged = onChanged;
+ _requestConfirm = requestConfirm;
+ _editCommandNode = editCommandNode;
IsReadOnly = session.IsReadOnly;
_library = mapPacks;
_nightMode = nightMode ?? new MapNightMode();
@@ -160,7 +167,12 @@ public void Dispose()
/// Every unit of the Einsatz, by Funkrufname, each saying whether it is on the map.
public ObservableCollection Units { get; } = new();
- /// What the map draws over the tiles: the Einsatzort and each placed unit's pin.
+ /// The live Bereitstellungsräume of the Organisation, in its order, each saying whether it is on the map.
+ public ObservableCollection Bereitstellungen { get; } = new();
+
+ public bool HasNoBereitstellungen => Bereitstellungen.Count == 0;
+
+ /// What the map draws over the tiles: the Einsatzort and each placed unit's and Bereitstellungsraum's pin.
public ObservableCollection Markers { get; } = new();
/// Where every pin stands, the Einsatzort's included: what a sign placed by the map keeps clear of.
@@ -456,7 +468,7 @@ partial void OnShowWaterPointsChanged(bool value)
public string? PlacingHint => Placing is { } target ? $"Auf die Karte tippen: {target.Label} platzieren" : null;
[RelayCommand]
- private void PlaceEinsatzort() => Pick(new LagekarteTarget(null, "Einsatzort"));
+ private void PlaceEinsatzort() => Pick(LagekarteTarget.Einsatzort);
[RelayCommand]
private void PlaceUnit(LagekarteUnitRow? row)
@@ -467,6 +479,56 @@ private void PlaceUnit(LagekarteUnitRow? row)
}
}
+ [RelayCommand]
+ private void PlaceBereitstellung(LagekarteBereitstellungRow? row)
+ {
+ if (row is not null)
+ {
+ Pick(new LagekarteTarget(null, row.Title, row.NodeId));
+ }
+ }
+
+ /// Opens the Bereitstellungsraum's details, the same dialog the Organisation edits them in.
+ [RelayCommand]
+ private void EditBereitstellung(LagekarteBereitstellungRow? row)
+ {
+ if (row is not null)
+ {
+ _editCommandNode?.Invoke(row.NodeId);
+ }
+ }
+
+ /// Takes a Bereitstellungsraum off the map once confirmed; the Organisation keeps it.
+ [RelayCommand]
+ private void RemoveBereitstellung(LagekarteBereitstellungRow? row)
+ {
+ if (row is not { IsPlaced: true } || !CanEdit)
+ {
+ return;
+ }
+
+ void Remove() => Run(() => _session.PlaceCommandNode(row.NodeId, null));
+ if (_requestConfirm is null)
+ {
+ Remove();
+ return;
+ }
+
+ _requestConfirm(
+ "Bereitstellungsraum von der Karte nehmen?",
+ $"„{row.Title}“ von der Lagekarte nehmen? In der Organisation bleibt er bestehen.",
+ Remove);
+ }
+
+ [RelayCommand]
+ private void CenterOnBereitstellung(LagekarteBereitstellungRow? row)
+ {
+ if (row?.Position is { } position)
+ {
+ Map.ChangeViewCommand.Execute(new MapViewChange(position, Map.Zoom));
+ }
+ }
+
[RelayCommand]
private void CancelPlacing() => Placing = null;
@@ -489,7 +551,7 @@ private void MapTapped(GeoPoint? point)
}
Placing = null;
- Place(target.UnitId, point);
+ Place(target, point);
}
/// Places what was picked in the middle of the map, for a keyboard or a hand that cannot tap precisely.
@@ -499,7 +561,7 @@ private void PlaceAtCenter()
if (Placing is { } target)
{
Placing = null;
- Place(target.UnitId, Map.Center);
+ Place(target, Map.Center);
}
}
@@ -551,8 +613,9 @@ public bool EndMarkerDrag((double X, double Y) at, Func
{
MoveLabel(marker, offset);
}
- else if (screenToGeo(at.X, at.Y) is { } position && MapTappedCommand.CanExecute(position))
+ else if (!OpenDetails(marker) && screenToGeo(at.X, at.Y) is { } position && MapTappedCommand.CanExecute(position))
{
MapTappedCommand.Execute(position);
}
@@ -647,7 +710,7 @@ public void MoveMarker(LagekarteMarker marker, GeoPoint position)
ArgumentNullException.ThrowIfNull(position);
if (CanEdit)
{
- Place(marker.UnitId, position);
+ Place(marker.Target, position);
}
}
@@ -656,10 +719,34 @@ public void MoveLabel(LagekarteMarker marker, LabelOffset offset)
{
ArgumentNullException.ThrowIfNull(marker);
ArgumentNullException.ThrowIfNull(offset);
- if (CanEdit && marker.UnitId is { } id)
+ if (!CanEdit)
+ {
+ return;
+ }
+
+ if (marker.UnitId is { } id)
{
Run(() => _session.MoveForceUnitLabel(id, offset));
}
+ else if (marker.NodeId is { } nodeId)
+ {
+ Run(() => _session.MoveCommandNodeLabel(nodeId, offset));
+ }
+ }
+
+ // A tap on a Bereitstellungsraum's pin or sign while nothing is picked to place opens its
+ // details, from the Organisation, instead of tapping the map there.
+ private bool OpenDetails(LagekarteMarker marker)
+ {
+ if (Placing is not null || marker.NodeId is not { } nodeId || _editCommandNode is null)
+ {
+ return false;
+ }
+
+ _editCommandNode(nodeId);
+
+ // Stryker disable once Boolean : the map tap it would let through has nothing picked to place; see EndMarkerDrag.
+ return true;
}
/// Puts every mark back where the incident has it, after a drag that was abandoned.
@@ -743,7 +830,7 @@ private void ChooseAddress(LagekarteAddressRow? row)
if (CanEdit)
{
Placing = null;
- if (!Place(null, row.Position))
+ if (!Place(LagekarteTarget.Einsatzort, row.Position))
{
return;
}
@@ -822,11 +909,14 @@ private void Pick(LagekarteTarget target)
}
}
- private bool Place(Guid? unitId, GeoPoint position)
+ private bool Place(LagekarteTarget target, GeoPoint position)
{
- return unitId is { } id
- ? Run(() => _session.PlaceForceUnit(id, position))
- : Run(() => _session.SetIncidentLocation(position));
+ return target switch
+ {
+ { UnitId: { } id } => Run(() => _session.PlaceForceUnit(id, position)),
+ { NodeId: { } nodeId } => Run(() => _session.PlaceCommandNode(nodeId, position)),
+ _ => Run(() => _session.SetIncidentLocation(position)),
+ };
}
private bool Run(Action command)
@@ -894,6 +984,20 @@ private void Refresh()
Signs.Add(marker);
}
+ // Built from the node on every change, so a rename in the Organisation is the map's at once.
+ var bereitstellungen = incident.CommandNodes.Where(n => n is { IsLive: true, Kind: CommandNodeKind.Bereitstellung }).ToList();
+ Bereitstellungen.Clear();
+ foreach (var node in bereitstellungen)
+ {
+ Bereitstellungen.Add(new LagekarteBereitstellungRow(node));
+ if (node.Position is not null)
+ {
+ var marker = LagekarteMarker.For(node);
+ Markers.Add(marker);
+ Signs.Add(marker);
+ }
+ }
+
PinPositions = Markers.Select(m => m.Position).ToList();
EinsatzortPosition = incident.Location;
Terrain.Einsatzort = incident.Location;
@@ -906,9 +1010,16 @@ private void Refresh()
Placing = null;
}
+ // Nor a Bereitstellungsraum dissolved meanwhile.
+ if (Placing is { NodeId: { } pickedNode } && bereitstellungen.All(n => n.Id != pickedNode))
+ {
+ Placing = null;
+ }
+
OnPropertyChanged(nameof(HasEinsatzort));
OnPropertyChanged(nameof(EinsatzortLabel));
OnPropertyChanged(nameof(HasNoUnits));
+ OnPropertyChanged(nameof(HasNoBereitstellungen));
}
private GeoPoint? FirstMark() =>
@@ -1026,8 +1137,48 @@ private bool FitsPlace(string? place) =>
private static bool Same(string a, string b) => string.Equals(a.Trim(), b.Trim(), StringComparison.OrdinalIgnoreCase);
}
-/// What a tap on the map is about to place: a unit, or the Einsatzort when is null.
-public sealed record LagekarteTarget(Guid? UnitId, string Label);
+///
+/// What a tap on the map is about to place: a unit, a Bereitstellungsraum by its ,
+/// or the Einsatzort when neither is set.
+///
+public sealed record LagekarteTarget(Guid? UnitId, string Label, Guid? NodeId = null)
+{
+ public static LagekarteTarget Einsatzort { get; } = new(null, "Einsatzort");
+}
+
+/// A Bereitstellungsraum of the Organisation in the list beside the map (#966).
+public sealed class LagekarteBereitstellungRow
+{
+ private readonly CommandNode _node;
+
+ public LagekarteBereitstellungRow(CommandNode node)
+ {
+ ArgumentNullException.ThrowIfNull(node);
+ _node = node;
+ }
+
+ public Guid NodeId => _node.Id;
+
+ public string Title => _node.Name;
+
+ /// The Standort as the Organisation records it, and the Rufname; empty without either.
+ public string Detail => string.Join(" · ", new[] { _node.Standort, _node.Rufname }.OfType());
+
+ public bool HasDetail => Detail.Length > 0;
+
+ public GeoPoint? Position => _node.Position;
+
+ public bool IsPlaced => Position is not null;
+
+ /// What the place button does, naming the Raum: the list holds several icons alike.
+ public string PlaceLabel => IsPlaced ? $"{Title} versetzen" : $"{Title} auf Karte setzen";
+
+ public string EditLabel => $"{Title}: Angaben bearbeiten";
+
+ public string CenterLabel => $"{Title} auf der Karte zeigen";
+
+ public string RemoveLabel => $"{Title} von der Karte nehmen";
+}
/// A unit in the list beside the map.
public sealed class LagekarteUnitRow
@@ -1060,12 +1211,16 @@ public LagekarteUnitRow(ForceUnit unit)
public string PlaceLabel => IsPlaced ? "Versetzen" : "Auf Karte setzen";
}
-/// A mark on the map: the Einsatzort, or a unit when is set.
+///
+/// A mark on the map: a unit when is set, a Bereitstellungsraum when
+/// is, the Einsatzort otherwise.
+///
public sealed partial class LagekarteMarker : ObservableObject
{
- private LagekarteMarker(Guid? unitId, string title, GeoPoint position, string? vehicleType = null, LabelOffset? labelOffset = null)
+ private LagekarteMarker(Guid? unitId, string title, GeoPoint position, string? vehicleType = null, LabelOffset? labelOffset = null, Guid? nodeId = null)
{
UnitId = unitId;
+ NodeId = nodeId;
Title = title;
VehicleType = vehicleType;
_position = position;
@@ -1074,7 +1229,15 @@ private LagekarteMarker(Guid? unitId, string title, GeoPoint position, string? v
public Guid? UnitId { get; }
- public bool IsEinsatzort => UnitId is null;
+ /// The Bereitstellungsraum's node in the Organisation; null for every other mark.
+ public Guid? NodeId { get; }
+
+ public bool IsEinsatzort => UnitId is null && NodeId is null;
+
+ /// Drawn with the Bereitstellungsraum's sign rather than a vehicle's.
+ public bool IsBereitstellung => NodeId is not null;
+
+ internal LagekarteTarget Target => new(UnitId, Title, NodeId);
public string Title { get; }
@@ -1093,9 +1256,9 @@ private LagekarteMarker(Guid? unitId, string title, GeoPoint position, string? v
[ObservableProperty]
private LabelOffset? _labelOffset;
- public string AutomationName => IsEinsatzort ? "Einsatzort" : $"{Title}: Standort";
+ public string AutomationName => IsEinsatzort ? "Einsatzort" : IsBereitstellung ? $"Bereitstellungsraum {Title}: Standort" : $"{Title}: Standort";
- public string SignAutomationName => $"{Title}: taktisches Zeichen";
+ public string SignAutomationName => IsBereitstellung ? $"Bereitstellungsraum {Title}: taktisches Zeichen" : $"{Title}: taktisches Zeichen";
public static LagekarteMarker Einsatzort(GeoPoint location) => new(null, "Einsatzort", location);
@@ -1105,4 +1268,11 @@ public static LagekarteMarker For(ForceUnit unit)
var position = unit.Position ?? throw new ArgumentException("Die Einheit steht nicht auf der Karte.", nameof(unit));
return new(unit.Id, unit.CallSign ?? unit.Brigade, position, unit.VehicleType, unit.LabelOffset);
}
+
+ public static LagekarteMarker For(CommandNode node)
+ {
+ ArgumentNullException.ThrowIfNull(node);
+ var position = node.Position ?? throw new ArgumentException("Der Bereitstellungsraum steht nicht auf der Karte.", nameof(node));
+ return new(null, node.Name, position, labelOffset: node.LabelOffset, nodeId: node.Id);
+ }
}
diff --git a/src/LageBuch.Domain/Incident.cs b/src/LageBuch.Domain/Incident.cs
index b2330a1a..61a76813 100644
--- a/src/LageBuch.Domain/Incident.cs
+++ b/src/LageBuch.Domain/Incident.cs
@@ -1627,6 +1627,64 @@ public ForceUnit PlaceForceUnit(IClock clock, SessionOperator op, Guid unitId, G
return updated;
}
+ ///
+ /// Puts a live Bereitstellungsraum on the Lagekarte at , or takes it
+ /// off with null (#966). Its name and details stay the Organisation's: the map shows them from
+ /// the node. Like a unit, the ETB records the first placement and the removal, not each drag.
+ ///
+ public CommandNode PlaceCommandNode(IClock clock, SessionOperator op, Guid nodeId, GeoPoint? position)
+ {
+ EnsureOpen();
+ ArgumentNullException.ThrowIfNull(clock);
+ ArgumentNullException.ThrowIfNull(op);
+
+ var index = FindCommandNodeIndex(nodeId);
+ var previous = _commandNodes[index];
+ if (previous.Kind != CommandNodeKind.Bereitstellung)
+ {
+ throw new InvalidOperationException("Nur ein Bereitstellungsraum steht auf der Lagekarte.");
+ }
+
+ if (!previous.IsLive)
+ {
+ throw new InvalidOperationException("Bereitstellungsraum ist aufgelöst.");
+ }
+
+ if (previous.Position == position)
+ {
+ return previous;
+ }
+
+ var updated = previous.WithPosition(position);
+ _commandNodes[index] = updated;
+ if (previous.Position is null)
+ {
+ AppendSystemEntry(clock, op, $"Bereitstellungsraum {updated.Name} auf der Lagekarte eingetragen");
+ }
+ else if (position is null)
+ {
+ AppendSystemEntry(clock, op, $"Bereitstellungsraum {updated.Name} von der Lagekarte genommen");
+ }
+
+ return updated;
+ }
+
+ ///
+ /// Moves a Bereitstellungsraum's sign relative to its pin, or back to the default place with
+ /// null. Only the picture changes, so like a unit's sign it writes nothing to the ETB.
+ ///
+ public CommandNode MoveCommandNodeLabel(IClock clock, SessionOperator op, Guid nodeId, LabelOffset? offset)
+ {
+ EnsureOpen();
+ ArgumentNullException.ThrowIfNull(clock);
+ ArgumentNullException.ThrowIfNull(op);
+
+ var index = FindCommandNodeIndex(nodeId);
+ var updated = _commandNodes[index].WithLabelOffset(offset);
+ _commandNodes[index] = updated;
+ return updated;
+ }
+
private int FindCommandNodeIndex(Guid nodeId)
{
var index = _commandNodes.FindIndex(n => n.Id == nodeId);
diff --git a/src/LageBuch.Domain/Leadership/CommandNode.cs b/src/LageBuch.Domain/Leadership/CommandNode.cs
index 936f7664..0d36a7e1 100644
--- a/src/LageBuch.Domain/Leadership/CommandNode.cs
+++ b/src/LageBuch.Domain/Leadership/CommandNode.cs
@@ -1,3 +1,5 @@
+using LageBuch.Domain.ValueObjects;
+
namespace LageBuch.Domain.Leadership;
///
@@ -53,6 +55,15 @@ private CommandNode()
public DateTimeOffset? DissolvedAt { get; private init; }
+ ///
+ /// Where a Bereitstellungsraum stands on the Lagekarte (#966); null while it is not on the map,
+ /// and for every other kind. Kept when the node is dissolved, as history: the map shows live nodes only.
+ ///
+ public GeoPoint? Position { get; private init; }
+
+ /// How far its taktisches Zeichen was dragged from its pin; null for the place the map finds.
+ public LabelOffset? LabelOffset { get; private init; }
+
public bool IsLive => DissolvedAt is null;
public static CommandNode Create(CommandNodeKind kind, string name, Guid? parentId)
@@ -85,7 +96,9 @@ public static CommandNode Rehydrate(
string? telefon,
DateTimeOffset? dissolvedAt,
Funkgruppen? funkgruppen = null,
- string? fuehrungsfahrzeug = null)
+ string? fuehrungsfahrzeug = null,
+ GeoPoint? position = null,
+ LabelOffset? labelOffset = null)
=> new()
{
Id = id,
@@ -100,6 +113,8 @@ public static CommandNode Rehydrate(
DissolvedAt = dissolvedAt,
Funkgruppen = funkgruppen ?? Funkgruppen.Empty,
Fuehrungsfahrzeug = fuehrungsfahrzeug,
+ Position = position,
+ LabelOffset = labelOffset,
};
///
@@ -174,6 +189,13 @@ public CommandNode WithDetails(
_ => throw new InvalidOperationException("Nur ein Abschnitt liegt in einem Abschnitt."),
};
+ /// Returns a copy at on the Lagekarte; off it with null, which forgets the sign's offset too.
+ public CommandNode WithPosition(GeoPoint? position) =>
+ this with { Position = position, LabelOffset = position is null ? null : LabelOffset };
+
+ /// Returns a copy whose sign stands at from its pin; null for the default place.
+ public CommandNode WithLabelOffset(LabelOffset? offset) => this with { LabelOffset = offset };
+
/// Returns a copy dissolved at ; a node can be dissolved only once.
public CommandNode DissolvedAtTime(DateTimeOffset at)
{
diff --git a/src/LageBuch.Domain/Leadership/CommandNodeRepair.cs b/src/LageBuch.Domain/Leadership/CommandNodeRepair.cs
index 51a60e86..de089f54 100644
--- a/src/LageBuch.Domain/Leadership/CommandNodeRepair.cs
+++ b/src/LageBuch.Domain/Leadership/CommandNodeRepair.cs
@@ -44,5 +44,7 @@ private static CommandNode Rebuild(CommandNode n, CommandNodeKind kind, Guid? pa
n.Telefon,
n.DissolvedAt,
n.Funkgruppen,
- n.Fuehrungsfahrzeug);
+ n.Fuehrungsfahrzeug,
+ n.Position,
+ n.LabelOffset);
}
diff --git a/src/LageBuch.Persistence/IncidentRepository.cs b/src/LageBuch.Persistence/IncidentRepository.cs
index e3b93a70..00ba4974 100644
--- a/src/LageBuch.Persistence/IncidentRepository.cs
+++ b/src/LageBuch.Persistence/IncidentRepository.cs
@@ -521,7 +521,7 @@ private static void WriteCommandNodes(InsertCommands inserts, Incident incident)
var n = incident.CommandNodes[i];
Run(
inserts,
- "INSERT INTO command_nodes (id, ordinal, kind, name, parent_id, auftrag, standort, funkgruppe, rufname, telefon, dissolved_at, funkgruppen, fuehrungsfahrzeug) " + "VALUES ($id,$o,$kind,$name,$parent,$auftrag,$standort,$funk,$ruf,$tel,$dissolved,$funkgruppen,$fahrzeug);",
+ "INSERT INTO command_nodes (id, ordinal, kind, name, parent_id, auftrag, standort, funkgruppe, rufname, telefon, dissolved_at, funkgruppen, fuehrungsfahrzeug, position_lat, position_lon, label_dx, label_dy) " + "VALUES ($id,$o,$kind,$name,$parent,$auftrag,$standort,$funk,$ruf,$tel,$dissolved,$funkgruppen,$fahrzeug,$lat,$lon,$ldx,$ldy);",
p =>
{
p("$id", n.Id.ToString());
@@ -537,6 +537,10 @@ private static void WriteCommandNodes(InsertCommands inserts, Incident incident)
p("$dissolved", (object?)n.DissolvedAt?.ToString(Iso) ?? DBNull.Value);
p("$funkgruppen", (object?)FunkgruppenJson.Write(n.Funkgruppen) ?? DBNull.Value);
p("$fahrzeug", (object?)n.Fuehrungsfahrzeug ?? DBNull.Value);
+ p("$lat", (object?)n.Position?.Latitude ?? DBNull.Value);
+ p("$lon", (object?)n.Position?.Longitude ?? DBNull.Value);
+ p("$ldx", (object?)n.LabelOffset?.Dx ?? DBNull.Value);
+ p("$ldy", (object?)n.LabelOffset?.Dy ?? DBNull.Value);
});
}
}
@@ -1047,7 +1051,7 @@ public static Incident Load(string path)
var commandNodes = ReadAll(
cn,
- "SELECT id, kind, name, parent_id, auftrag, standort, funkgruppe, rufname, telefon, dissolved_at, funkgruppen, fuehrungsfahrzeug FROM command_nodes ORDER BY ordinal;",
+ "SELECT id, kind, name, parent_id, auftrag, standort, funkgruppe, rufname, telefon, dissolved_at, funkgruppen, fuehrungsfahrzeug, position_lat, position_lon, label_dx, label_dy FROM command_nodes ORDER BY ordinal;",
r => Domain.Leadership.CommandNode.Rehydrate(
Guid.Parse(r.GetString(0)),
LeadershipKeys.KindFrom(Str(r, 1)),
@@ -1060,7 +1064,9 @@ public static Incident Load(string path)
Str(r, 8),
NullableDate(r, 9),
FunkgruppenJson.Read(Str(r, 10)),
- Str(r, 11)));
+ Str(r, 11),
+ Domain.ValueObjects.GeoPoint.TryCreate(NullableDouble(r, 12), NullableDouble(r, 13)),
+ Domain.ValueObjects.LabelOffset.TryCreate(NullableDouble(r, 14), NullableDouble(r, 15))));
// A row whose ids do not read is dropped rather than refused: losing one Ebene beats an
// Einsatz that will not open.
diff --git a/src/LageBuch.Persistence/Sqlite/Migrations.cs b/src/LageBuch.Persistence/Sqlite/Migrations.cs
index 3652eb1c..0a876e56 100644
--- a/src/LageBuch.Persistence/Sqlite/Migrations.cs
+++ b/src/LageBuch.Persistence/Sqlite/Migrations.cs
@@ -8,7 +8,7 @@ namespace LageBuch.Persistence.Sqlite;
public static class Migrations
{
- public const int CurrentVersion = 47;
+ public const int CurrentVersion = 48;
public static int GetVersion(SqliteConnection cn)
{
@@ -320,6 +320,15 @@ public static void Migrate(SqliteConnection cn)
ApplyV47(cn, tx);
}
+ // Stryker disable all : V48 only adds nullable columns that SchemaGuard.Reconcile below
+ // adds identically on every open; see V26.
+ if (version < 48)
+ {
+ ApplyV48(cn, tx);
+
+ // Stryker restore all
+ }
+
// The version gate above is not proof that the steps it skipped ever ran: a build from a
// parallel branch numbers its own migrations too, so a file can carry a marker this lineage
// never put there and be missing a column no `version < N` will ever add back. Reconcile the
@@ -1402,6 +1411,19 @@ private static void ApplyV47(SqliteConnection cn, SqliteTransaction tx)
// Stryker restore all
}
+ // Where a Bereitstellungsraum stands on the Lagekarte, and how far its sign was moved (#966), in
+ // the same columns force_units uses. Additive and nullable: an older file's nodes read back off the map.
+ // Stryker disable all : SchemaGuard.Reconcile adds these same columns on every open (see V26).
+ private static void ApplyV48(SqliteConnection cn, SqliteTransaction tx)
+ {
+ SchemaHelpers.AddColumnIfMissing(cn, tx, "command_nodes", "position_lat", "REAL");
+ SchemaHelpers.AddColumnIfMissing(cn, tx, "command_nodes", "position_lon", "REAL");
+ SchemaHelpers.AddColumnIfMissing(cn, tx, "command_nodes", "label_dx", "REAL");
+ SchemaHelpers.AddColumnIfMissing(cn, tx, "command_nodes", "label_dy", "REAL");
+
+ // Stryker restore all
+ }
+
[SuppressMessage(
"Security",
"CA2100",
diff --git a/src/LageBuch.Persistence/Sqlite/SchemaGuard.cs b/src/LageBuch.Persistence/Sqlite/SchemaGuard.cs
index da7070fa..ec8452f1 100644
--- a/src/LageBuch.Persistence/Sqlite/SchemaGuard.cs
+++ b/src/LageBuch.Persistence/Sqlite/SchemaGuard.cs
@@ -97,6 +97,10 @@ internal static class SchemaGuard
new("command_nodes", "dissolved_at", "TEXT", false, null),
new("command_nodes", "funkgruppen", "TEXT", false, null),
new("command_nodes", "fuehrungsfahrzeug", "TEXT", false, null),
+ new("command_nodes", "position_lat", "REAL", false, null),
+ new("command_nodes", "position_lon", "REAL", false, null),
+ new("command_nodes", "label_dx", "REAL", false, null),
+ new("command_nodes", "label_dy", "REAL", false, null),
new("etb_entries", "from_party", "TEXT", false, null),
new("etb_entries", "to_party", "TEXT", false, null),
new("etb_entries", "section_id", "TEXT", false, null),
diff --git a/src/LageBuch.Sync/CommandApplier.cs b/src/LageBuch.Sync/CommandApplier.cs
index fd8c3df6..b2444ded 100644
--- a/src/LageBuch.Sync/CommandApplier.cs
+++ b/src/LageBuch.Sync/CommandApplier.cs
@@ -125,6 +125,12 @@ public static class CommandApplier
case MoveForceUnitLabelCommand c:
incident.MoveForceUnitLabel(clock, Operator(c.Operator), c.UnitId, Offset(c.Dx, c.Dy));
break;
+ case PlaceCommandNodeCommand c:
+ incident.PlaceCommandNode(clock, Operator(c.Operator), c.NodeId, Position(c.Latitude, c.Longitude));
+ break;
+ case MoveCommandNodeLabelCommand c:
+ incident.MoveCommandNodeLabel(clock, Operator(c.Operator), c.NodeId, Offset(c.Dx, c.Dy));
+ break;
case SetNavVisibilityCommand c:
incident.SetNavVisibility(c.Key, c.Visible);
break;
diff --git a/src/LageBuch.Sync/IIncidentSession.cs b/src/LageBuch.Sync/IIncidentSession.cs
index b28ed977..d3de8045 100644
--- a/src/LageBuch.Sync/IIncidentSession.cs
+++ b/src/LageBuch.Sync/IIncidentSession.cs
@@ -141,6 +141,12 @@ void UpdateCommandNode(
/// Moves a unit's sign relative to its pin; null puts it back at the default place. See Incident.MoveForceUnitLabel.
void MoveForceUnitLabel(Guid unitId, LabelOffset? offset);
+ /// Puts a Bereitstellungsraum on the Lagekarte; null takes it off. See Incident.PlaceCommandNode.
+ void PlaceCommandNode(Guid nodeId, GeoPoint? position);
+
+ /// Moves a Bereitstellungsraum's sign relative to its pin; null puts it back. See Incident.MoveCommandNodeLabel.
+ void MoveCommandNodeLabel(Guid nodeId, LabelOffset? offset);
+
/// Places a running Funktion in a node and board slot; a null is the Einsatzleitung.
void PlaceRoleAssignment(Guid assignmentId, Guid? nodeId, RoleSlot slot);
diff --git a/src/LageBuch.Sync/IncidentSnapshot.cs b/src/LageBuch.Sync/IncidentSnapshot.cs
index deea90cd..746533ab 100644
--- a/src/LageBuch.Sync/IncidentSnapshot.cs
+++ b/src/LageBuch.Sync/IncidentSnapshot.cs
@@ -277,7 +277,9 @@ public sealed record CommandNodeDto(
Guid Id, CommandNodeKind Kind, string Name, Guid? ParentId, string? Auftrag, string? Standort,
string? Funkgruppe, string? Rufname, string? Telefon, DateTimeOffset? DissolvedAt,
IReadOnlyList? FunkgruppenTmo = null, IReadOnlyList? FunkgruppenDmo = null,
- string? Fuehrungsfahrzeug = null);
+ string? Fuehrungsfahrzeug = null,
+ double? PositionLatitude = null, double? PositionLongitude = null,
+ double? LabelDx = null, double? LabelDy = null);
public sealed record BuildingDto(
Guid Id, string Name, int FloorCount, int ApartmentsPerFloor,
diff --git a/src/LageBuch.Sync/RemoteIncidentSession.cs b/src/LageBuch.Sync/RemoteIncidentSession.cs
index e0d3d3e8..f75f9bee 100644
--- a/src/LageBuch.Sync/RemoteIncidentSession.cs
+++ b/src/LageBuch.Sync/RemoteIncidentSession.cs
@@ -533,6 +533,12 @@ public void SetForceUnitVehicleType(Guid unitId, string? vehicleType) =>
public void MoveForceUnitLabel(Guid unitId, LabelOffset? offset) =>
Send(new MoveForceUnitLabelCommand(Op(), unitId, offset?.Dx, offset?.Dy));
+ public void PlaceCommandNode(Guid nodeId, GeoPoint? position) =>
+ Send(new PlaceCommandNodeCommand(Op(), nodeId, position?.Latitude, position?.Longitude));
+
+ public void MoveCommandNodeLabel(Guid nodeId, LabelOffset? offset) =>
+ Send(new MoveCommandNodeLabelCommand(Op(), nodeId, offset?.Dx, offset?.Dy));
+
public void PlaceRoleAssignment(Guid assignmentId, Guid? nodeId, RoleSlot slot) =>
Send(new PlaceRoleAssignmentCommand(Op(), assignmentId, nodeId, slot));
diff --git a/src/LageBuch.Sync/SnapshotMapper.cs b/src/LageBuch.Sync/SnapshotMapper.cs
index 286e8930..567ebd33 100644
--- a/src/LageBuch.Sync/SnapshotMapper.cs
+++ b/src/LageBuch.Sync/SnapshotMapper.cs
@@ -149,7 +149,11 @@ public static IncidentSnapshot ToSnapshot(Incident incident)
n.DissolvedAt,
n.Funkgruppen.Tmo,
n.Funkgruppen.Dmo,
- n.Fuehrungsfahrzeug)).ToList(),
+ n.Fuehrungsfahrzeug,
+ n.Position?.Latitude,
+ n.Position?.Longitude,
+ n.LabelOffset?.Dx,
+ n.LabelOffset?.Dy)).ToList(),
ElStandort: incident.LeadershipPost.Standort,
ElRufname: incident.LeadershipPost.Rufname,
ElTelefon: incident.LeadershipPost.Telefon,
@@ -302,7 +306,9 @@ public static Incident FromSnapshot(IncidentSnapshot snapshot)
n.Telefon,
n.DissolvedAt,
Funkgruppen.FromRecord(n.FunkgruppenTmo, n.FunkgruppenDmo),
- n.Fuehrungsfahrzeug)),
+ n.Fuehrungsfahrzeug,
+ GeoPoint.TryCreate(n.PositionLatitude, n.PositionLongitude),
+ LabelOffset.TryCreate(n.LabelDx, n.LabelDy))),
new LeadershipPost(
snapshot.ElStandort,
snapshot.ElRufname,
diff --git a/src/LageBuch.Sync/SyncCommand.cs b/src/LageBuch.Sync/SyncCommand.cs
index 152c6f79..3883bbd1 100644
--- a/src/LageBuch.Sync/SyncCommand.cs
+++ b/src/LageBuch.Sync/SyncCommand.cs
@@ -32,6 +32,8 @@ namespace LageBuch.Sync;
[JsonDerivedType(typeof(PlaceForceUnitCommand), "placeForceUnit")]
[JsonDerivedType(typeof(SetForceUnitVehicleTypeCommand), "setForceUnitVehicleType")]
[JsonDerivedType(typeof(MoveForceUnitLabelCommand), "moveForceUnitLabel")]
+[JsonDerivedType(typeof(PlaceCommandNodeCommand), "placeCommandNode")]
+[JsonDerivedType(typeof(MoveCommandNodeLabelCommand), "moveCommandNodeLabel")]
[JsonDerivedType(typeof(AddMapOverlayCommand), "addMapOverlay")]
[JsonDerivedType(typeof(RemoveMapOverlayCommand), "removeMapOverlay")]
[JsonDerivedType(typeof(PlaceRoleAssignmentCommand), "placeRoleAssignment")]
@@ -175,6 +177,12 @@ public sealed record SetForceUnitVehicleTypeCommand(OperatorDto Operator, Guid U
public sealed record MoveForceUnitLabelCommand(OperatorDto Operator, Guid UnitId, double? Dx, double? Dy) : SyncCommand;
+// Protocol 48: a Bereitstellungsraum on the Lagekarte (#966), the same pair as a unit's. Both
+// coordinates null take it off the map; both offsets null put its sign back at its default place.
+public sealed record PlaceCommandNodeCommand(OperatorDto Operator, Guid NodeId, double? Latitude, double? Longitude) : SyncCommand;
+
+public sealed record MoveCommandNodeLabelCommand(OperatorDto Operator, Guid NodeId, double? Dx, double? Dy) : SyncCommand;
+
// Protocol 38: Kartenebenen. Metadata only, like AddFileCommand: the client PUTs the file's bytes to
// SyncProtocol.FilesPath(FileId) afterwards. Name and times are what the client read from the file;
// the host checks their shape (MapOverlay.Create), and every device draws from the file itself.
diff --git a/src/LageBuch.Sync/SyncProtocol.cs b/src/LageBuch.Sync/SyncProtocol.cs
index 3fc6718d..c288b442 100644
--- a/src/LageBuch.Sync/SyncProtocol.cs
+++ b/src/LageBuch.Sync/SyncProtocol.cs
@@ -272,15 +272,20 @@ public static class SyncProtocol
/// 47: a client may send setTaskTimer, the time until an Aufgabe's reminder typed in
/// minutes (#964). A host at 46 does not know it, so the floor rises to 47.
///
+ ///
+ /// 48: a Bereitstellungsraum on the Lagekarte (#966). A client may send placeCommandNode
+ /// and moveCommandNodeLabel, which a host at 47 does not know, so the floor rises to 48.
+ /// The snapshot's command nodes carry an optional position and sign offset.
+ ///
///
- public const int ProtocolVersion = 47;
+ public const int ProtocolVersion = 48;
///
/// The oldest contract this build still speaks. A peer below it is refused with a message naming
/// which end to update; a peer at or above it is served. See for
/// when to raise this.
///
- public const int MinimumProtocolVersion = 47;
+ public const int MinimumProtocolVersion = 48;
///
/// What an absent or zero protocol number on the wire means: the contract as it stood at v0.6.1,
diff --git a/tests/LageBuch.Acceptance.Tests/LagekarteRenderTests.cs b/tests/LageBuch.Acceptance.Tests/LagekarteRenderTests.cs
index a47ed25f..af4f76dd 100644
--- a/tests/LageBuch.Acceptance.Tests/LagekarteRenderTests.cs
+++ b/tests/LageBuch.Acceptance.Tests/LagekarteRenderTests.cs
@@ -584,6 +584,42 @@ public void A_unit_s_pin_sits_on_its_spot_and_its_sign_stands_at_the_offset_tied
Assert.Equal("Florian Musterstadt 40/1: Standort", Avalonia.Automation.AutomationProperties.GetName(pin.GetVisualDescendants().OfType().First()));
}
+ [AvaloniaFact]
+ public void A_Bereitstellungsraum_of_the_Organisation_stands_on_the_map_as_its_sign_and_follows_a_rename()
+ {
+ var (window, view, vm, session) = Show();
+ session.SetIncidentLocation(Marktplatz);
+ session.PlaceForceUnit(session.Incident.Forces[0].Id, new GeoPoint(48.1792, 11.2541));
+ session.AddCommandNode(Domain.Leadership.CommandNodeKind.Bereitstellung, "BR Nord", standort: "Parkplatz Sportplatz");
+ session.AddCommandNode(Domain.Leadership.CommandNodeKind.Bereitstellung, "BR Süd");
+ var nodeId = session.Incident.CommandNodes[0].Id;
+ session.PlaceCommandNode(nodeId, new GeoPoint(48.1801, 11.2533));
+ vm.CenterOnEinsatzortCommand.Execute(null);
+ Dispatcher.UIThread.RunJobs();
+
+ Assert.Equal(3, Pins(view).Children.Count);
+ var list = view.GetVisualDescendants().OfType().Single(i => i.Name == "BereitstellungList");
+ Assert.Equal(2, list.ItemCount);
+ Assert.False(view.GetVisualDescendants().OfType().Single(t => t.Name == "NoBereitstellungenHint").IsVisible);
+ var sign = view.GetVisualDescendants().OfType().Single(s => s.IsBereitstellungsraum);
+ Assert.Equal("BR Nord", sign.Title);
+ Assert.Equal("Bereitstellungsraum BR Nord: taktisches Zeichen", Avalonia.Automation.AutomationProperties.GetName(sign));
+ Assert.Contains(
+ view.GetVisualDescendants().OfType