Add fast select buttons
Test / Run tests (push) Successful in 14s

This commit is contained in:
2026-08-11 00:26:27 +02:00
parent 3983393e10
commit f0accc8df8
5 changed files with 276 additions and 65 deletions
@@ -54,6 +54,14 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
return p;
}
public Path? GetFreePath(IEnumerable<INode> points, bool overrideStart = false) {
if (overrideStart) {
return GetPath(points, (n) => n is not ISink && (n is not Valve v || !v.LockedForPaths.Any(p => p.Start != points.First())));
} else {
return GetPath(points, (n) => n is not ISink && (n is not Valve v || !v.IsLocked));
}
}
public Path? GetPath(IEnumerable<INode> points, Func<INode, bool>? valid = null) {
if (points.Count() < 2) return null;
var start = points.First();
+3 -1
View File
@@ -14,7 +14,9 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
public string Label => $"V{Nr}";
public Brush? Highlight { get; set; }
public bool IsLocked { get; set; }
public readonly ISet<Path> LockedForPaths = new HashSet<Path>();
public bool IsLocked => LockedForPaths.Any();
public bool IsOpen => CallbackIsOpen();
public bool WantOpen => CallbackWantOpen(this);
public ISet<IEdge> Inputs { get; init; }