Pipeline: Change Valve symbol and add abstract Valve
Test / Run tests (push) Successful in 15s

This commit is contained in:
2026-09-12 19:54:49 +02:00
parent f4ef8d2f16
commit 3d24c65758
6 changed files with 231 additions and 190 deletions
@@ -349,7 +349,7 @@ namespace PamhagenSysCtrl.Windows {
}
foreach (var c in clicked) {
if (App.Plant?.ManualControlMode ?? false) {
if (c is Valve v) {
if (c is ControlledValve v) {
if (v.WantOpen) {
App.Plant.CloseV(v.Nr);
} else {
@@ -564,14 +564,14 @@ namespace PamhagenSysCtrl.Windows {
if (Graph.SelectedPaths.Select(p => (Path?)p).FirstOrDefault(p => p?.Start == Graph.MW1) is Path pmw1) {
MP1_Target.Text = "\u2b9e " + string.Join(" \u2b9e ", pmw1.Hops
.Select(h => h.Node is Valve || h.Node is Pump || h.Node is CenterValve ? null : h.Node.Label)
.Select(h => h.Node is Valve || h.Node is Pump ? null : h.Node.Label)
.Where(l => !string.IsNullOrWhiteSpace(l)));
} else {
MP1_Target.Text = "Vor";
}
if (Graph.SelectedPaths.Select(p => (Path?)p).FirstOrDefault(p => p?.Start == Graph.MW2) is Path pmw2) {
MP2_Target.Text = "\u2b9e " + string.Join(" \u2b9e ", pmw2.Hops
.Select(h => h.Node is Valve || h.Node is Pump || h.Node is CenterValve ? null : h.Node.Label)
.Select(h => h.Node is Valve || h.Node is Pump ? null : h.Node.Label)
.Where(l => !string.IsNullOrWhiteSpace(l)));
} else {
MP2_Target.Text = "Vor";
@@ -605,7 +605,7 @@ namespace PamhagenSysCtrl.Windows {
App.Plant?.CloseV(i);
}
foreach (var p in add) {
if (p.Hops.Any(h => h.Node is Valve v && v.IsLocked)) continue;
if (p.Hops.Any(h => h.Node is ControlledValve v && v.IsLocked)) continue;
Graph.AddPath(p);
}
}
@@ -617,7 +617,7 @@ namespace PamhagenSysCtrl.Windows {
foreach (var src in sources) {
var paths = new List<Path>();
foreach (var sink in sinks) {
paths.AddRange(Graph.GetPaths(src, sink, null, (n) => n is not ISink && (n is not Valve v || p.WantValveOpen(v.Nr))));
paths.AddRange(Graph.GetPaths(src, sink, null, (n) => n is not ISink && (n is not ControlledValve v || p.WantValveOpen(v.Nr))));
}
if (paths.Count == 1)
yield return paths.First();