Pipeline/Pump: Change triangle to ISO symbol

This commit is contained in:
2026-09-12 19:50:51 +02:00
parent 3c97d974b5
commit f4ef8d2f16
+8 -6
View File
@@ -26,7 +26,7 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
protected Func<Pump, bool> CallbackSelected; protected Func<Pump, bool> CallbackSelected;
private Ellipse? _circle; private Ellipse? _circle;
private Polygon? _triangle; private Polyline? _triangle;
private TextBlock? _text; private TextBlock? _text;
public Pump(string label, double x, double y, Func<MotorState> cbState, Func<bool> cbClearance, Func<Pump, bool> cbSelected) { public Pump(string label, double x, double y, Func<MotorState> cbState, Func<bool> cbClearance, Func<Pump, bool> cbSelected) {
@@ -45,9 +45,11 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
Fill = Brushes.WhiteSmoke, Fill = Brushes.WhiteSmoke,
Stroke = Brushes.Black, Stroke = Brushes.Black,
}; };
_triangle = new Polygon() { _triangle = new Polyline() {
Fill = Brushes.Transparent,
Stroke = Brushes.Black, Stroke = Brushes.Black,
StrokeStartLineCap = PenLineCap.Square,
StrokeLineJoin = PenLineJoin.Round,
StrokeEndLineCap = PenLineCap.Square,
}; };
_text = new() { _text = new() {
Text = Label, Text = Label,
@@ -63,12 +65,12 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
var border = Graph.ToBorder(scale); var border = Graph.ToBorder(scale);
_circle?.StrokeThickness = border; _circle?.StrokeThickness = border;
Graph.SetCenter(_circle, CenterX, CenterY, DIAMETER, DIAMETER, scale); Graph.SetCenter(_circle, CenterX, CenterY, DIAMETER, DIAMETER, scale);
var dx = Math.Cos(Math.PI / 6) * (DIAMETER / 2); var dx = Math.Cos(Math.PI / 9.5) * (DIAMETER / 2);
var dy = Math.Sin(Math.PI / 6) * (DIAMETER / 2); var dy = Math.Sin(Math.PI / 9.5) * (DIAMETER / 2);
_triangle?.Points = [ _triangle?.Points = [
Graph.ToPx(CenterX - dx, CenterY - dy, scale, dxpx: border, dypx: border / 2, round: false), Graph.ToPx(CenterX - dx, CenterY - dy, scale, dxpx: border, dypx: border / 2, round: false),
Graph.ToPx(CenterX + dx, CenterY - dy, scale, dxpx: -border, dypx: border / 2, round: false),
Graph.ToPx(CenterX, CenterY + DIAMETER / 2, scale, dypx: -border, round: false), Graph.ToPx(CenterX, CenterY + DIAMETER / 2, scale, dypx: -border, round: false),
Graph.ToPx(CenterX + dx, CenterY - dy, scale, dxpx: -border, dypx: border / 2, round: false),
]; ];
_triangle?.StrokeThickness = border; _triangle?.StrokeThickness = border;
_text?.FontSize = 14; _text?.FontSize = 14;