23 lines
762 B
C#
23 lines
762 B
C#
using System.Windows;
|
|
using System.Windows.Media;
|
|
|
|
namespace PamhagenSysCtrl.Helpers.Pipeline {
|
|
public class ExternalValve : Valve {
|
|
|
|
public override string Label { get; }
|
|
|
|
public ExternalValve(string label, double x, double y, int orientation, Func<bool> cbOpen) :
|
|
base(x, y, orientation, cbOpen) {
|
|
Label = label;
|
|
}
|
|
|
|
public override void Update(bool isHovering, bool isPressed) {
|
|
_text?.Visibility = isHovering || (App.Plant?.ManualControlMode ?? false) ? Visibility.Visible : Visibility.Hidden;
|
|
_triangles?.Fill =
|
|
!IsOpen ? PamhagenBrushes.Red :
|
|
IsOpen ? PamhagenBrushes.Green :
|
|
Highlight ?? Brushes.DarkGray;
|
|
}
|
|
}
|
|
}
|