Add sensor delay for opening and closing valves
Test / Run tests (push) Successful in 43s

This commit is contained in:
2026-10-16 10:26:17 +02:00
parent d8c2292b24
commit d0c328d97e
10 changed files with 52 additions and 31 deletions
+5 -3
View File
@@ -16,11 +16,13 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
public int Orientation { get; set; }
public bool IsOpen => CallbackIsOpen();
public bool IsOpen => CallbackIsOpen() == true;
public bool IsClosed => CallbackIsOpen() == false;
public bool IsTransitioning => CallbackIsOpen() == null;
public ISet<IEdge> Inputs { get; init; }
public ISet<IEdge> Outputs { get; init; }
protected Func<bool> CallbackIsOpen;
protected Func<bool?> CallbackIsOpen;
protected Rectangle? _background;
protected Polygon? _triangles;
@@ -29,7 +31,7 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
protected ((Point Top, Point Bottom) Closed, (Point Top, Point Bottom) Open) _middlePoints;
protected TextBlock? _text;
public Valve(double x, double y, int orientation, Func<bool> cbOpen) {
public Valve(double x, double y, int orientation, Func<bool?> cbOpen) {
CenterX = x;
CenterY = y;
CallbackIsOpen = cbOpen;