Display flow arrows when selecting a path

This commit is contained in:
2026-07-31 14:22:00 +02:00
parent 79e8640ac0
commit 19deed4fd7
7 changed files with 178 additions and 1 deletions
@@ -11,11 +11,14 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
public bool IsTwoWay => false;
public bool Orientation { get; set; }
public Brush? Highlight { get; set; }
public (bool TowardEnd, double PathOffset)? Flow { get; set; }
public double FlowLength => _flowArrow?.Length ?? 0;
private Line? _outer1;
private Line? _outer2;
private Line? _inner1;
private Line? _inner2;
private FlowArrow? _flowArrow;
public Inlet(INode start, ISink end, bool orientation = false) {
Start = start;
@@ -74,11 +77,13 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
canvas.Children.Add(_outer2);
canvas.Children.Add(_inner1);
canvas.Children.Add(_inner2);
_flowArrow = FlowArrow.Create(canvas, _inner1!, _inner2!);
}
public void Update() {
_inner1?.Stroke = Highlight ?? Brushes.DarkGray;
_inner2?.Stroke = Highlight ?? Brushes.DarkGray;
_flowArrow?.Update(Highlight == PamhagenBrushes.Green ? Flow : null);
}
}
}