46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
using System.Windows.Controls;
|
|
using System.Windows.Media;
|
|
using System.Windows.Shapes;
|
|
|
|
namespace PamhagenSysCtrl.Helpers.Pipeline {
|
|
public class Pump : INode {
|
|
|
|
public const double RADIUS = 24;
|
|
|
|
public double CenterX { get; set; }
|
|
public double CenterY { get; set; }
|
|
public string Label { get; set; }
|
|
|
|
public ISet<IEdge> Inputs { get; init; }
|
|
public ISet<IEdge> Outputs { get; init; }
|
|
|
|
private Ellipse? _circle;
|
|
private TextBlock? _text;
|
|
|
|
public Pump(string label, double x, double y) {
|
|
CenterX = x;
|
|
CenterY = y;
|
|
Label = label;
|
|
Inputs = new HashSet<IEdge>();
|
|
Outputs = new HashSet<IEdge>();
|
|
}
|
|
|
|
public void Draw(Canvas canvas) {
|
|
_circle = new() {
|
|
Height = RADIUS,
|
|
Width = RADIUS,
|
|
Fill = Brushes.WhiteSmoke,
|
|
Stroke = Brushes.Black,
|
|
StrokeThickness = 2,
|
|
};
|
|
_circle.SetValue(Canvas.LeftProperty, CenterX - RADIUS / 2);
|
|
_circle.SetValue(Canvas.TopProperty, CenterY - RADIUS / 2);
|
|
canvas.Children.Add(_circle);
|
|
}
|
|
|
|
public bool Update(double x, double y) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|