Add switcher

This commit is contained in:
2026-08-04 23:56:32 +02:00
parent ec07d91631
commit d9c1b79563
7 changed files with 143 additions and 36 deletions
@@ -16,6 +16,7 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
public ISet<IEdge> Inputs { get; init; }
public ISet<IEdge> Outputs { get; init; }
public bool IsClickable { get; private set; }
public bool IsActive => CallbackActive();
public bool IsAnimationActive {
get => _animationActive;
@@ -33,12 +34,13 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
private Auger? _auger;
private TextBlock? _text;
public EncasedAuger(string label, double x, double y, Func<bool> cbActive, double angle = 0) {
public EncasedAuger(string label, double x, double y, Func<bool> cbActive, double angle = 0, bool clickable = true) {
CenterX = x;
CenterY = y;
Label = label;
Angle = angle;
CallbackActive = cbActive;
IsClickable = clickable;
Inputs = new HashSet<IEdge>();
Outputs = new HashSet<IEdge>();
}
@@ -84,6 +86,7 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
}
public void Update(bool isHovering, bool isPressed) {
isHovering = isHovering && IsClickable;
IsAnimationActive = IsActive;
_inner?.Fill =
IsAnimationActive && isHovering && isPressed ? PamhagenBrushes.Red :