Rearrange graph
Test / Run tests (push) Successful in 15s

This commit is contained in:
2026-08-07 11:49:38 +02:00
parent 4f8c401cae
commit 96bb51807d
4 changed files with 26 additions and 22 deletions
+5 -4
View File
@@ -16,17 +16,17 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
public bool IsLocked { get; set; }
public bool IsOpen => CallbackIsOpen();
public bool WantOpen => CallbackWantOpen();
public bool WantOpen => CallbackWantOpen(this);
public ISet<IEdge> Inputs { get; init; }
public ISet<IEdge> Outputs { get; init; }
protected Func<bool> CallbackIsOpen;
protected Func<bool> CallbackWantOpen;
protected Func<Valve, bool> CallbackWantOpen;
private Shape? _circle;
private TextBlock? _text;
public Valve(int nr, double x, double y, Func<bool> cbOpen, Func<bool> cbWant) {
public Valve(int nr, double x, double y, Func<bool> cbOpen, Func<Valve, bool> cbWant) {
CenterX = x;
CenterY = y;
Nr = nr;
@@ -53,8 +53,9 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
Height = DIAMETER,
TextAlignment = TextAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
SnapsToDevicePixels = true,
};
_text.SetValue(Canvas.LeftProperty, CenterX - DIAMETER / 2);
_text.SetValue(Canvas.LeftProperty, CenterX - DIAMETER / 2 + 0.5);
_text.SetValue(Canvas.TopProperty, CenterY - DIAMETER / 2 + 5.5);
canvas.Children.Add(_circle);
canvas.Children.Add(_text);