Skip to content

Commit 38d5561

Browse files
committed
Reworked IAxesController with support of multiple axes
1 parent 6f30228 commit 38d5561

File tree

3 files changed

+54
-15
lines changed

3 files changed

+54
-15
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Copyright (c) 2025, Phoenix Contact GmbH & Co. KG
2+
// Licensed under the Apache License, Version 2.0
3+
4+
using Moryx.AbstractionLayer.Hardware;
5+
6+
namespace Moryx.AbstractionLayer.Drivers.Axis;
7+
8+
/// <summary>
9+
/// Defines a axis movement
10+
/// </summary>
11+
public class AxisMovement
12+
{
13+
/// <summary>
14+
/// The axis which should be moved
15+
/// </summary>
16+
public Axes Axis { get; }
17+
18+
/// <summary>
19+
/// Target position of the axis to move to
20+
/// </summary>
21+
public double? TargetPosition { get; }
22+
23+
/// <summary>
24+
/// Predefined position of the axis to move to
25+
/// </summary>
26+
public AxisPosition? PredefinedPosition { get; set; }
27+
28+
/// <summary>
29+
/// Creates a new instance of <see cref="AxisMovement"/> with a target position
30+
/// </summary>
31+
/// <param name="axis">The axis which should be moved</param>
32+
/// <param name="targetPosition">Target position of the axis to move to</param>
33+
public AxisMovement(Axes axis, double targetPosition)
34+
{
35+
Axis = axis;
36+
TargetPosition = targetPosition;
37+
}
38+
39+
/// <summary>
40+
/// Creates a new instance of <see cref="AxisMovement"/> with a predefined position
41+
/// </summary>
42+
/// <param name="axis">The axis which should be moved</param>
43+
/// <param name="predefinedPosition">Predefined position of the axis to move to</param>
44+
public AxisMovement(Axes axis, AxisPosition predefinedPosition)
45+
{
46+
Axis = axis;
47+
PredefinedPosition = predefinedPosition;
48+
}
49+
}

src/Moryx.AbstractionLayer/Drivers/Axis/AxisMovementResponse.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace Moryx.AbstractionLayer.Drivers.Axis
66
/// <summary>
77
/// Response of the marking file setup
88
/// </summary>
9-
public class AxisMovementResponse : TransmissionResult
9+
public class AxisMovementResponse : DriverResponse
1010
{
1111
/// <summary>
1212
/// Successfull movement of the axis
@@ -20,7 +20,7 @@ public AxisMovementResponse() : base()
2020
/// Faulty movement of the axis
2121
/// </summary>
2222
/// <param name="errorMessage">Occured error</param>
23-
public AxisMovementResponse(string errorMessage) : base(new TransmissionError(errorMessage))
23+
public AxisMovementResponse(string errorMessage) : base(errorMessage)
2424
{
2525

2626
}
Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright (c) 2025, Phoenix Contact GmbH & Co. KG
22
// Licensed under the Apache License, Version 2.0
33

4-
using Moryx.AbstractionLayer.Hardware;
5-
64
namespace Moryx.AbstractionLayer.Drivers.Axis
75
{
86
/// <summary>
@@ -11,17 +9,9 @@ namespace Moryx.AbstractionLayer.Drivers.Axis
119
public interface IAxesController : IDriver
1210
{
1311
/// <summary>
14-
/// Will move the axis of the laser to the given position
15-
/// </summary>
16-
/// <param name="axis">The axis which should be moved</param>
17-
/// <param name="targetPosition">The target position of the axis</param>
18-
Task<AxisMovementResponse> MoveAxis(Axes axis, double targetPosition);
19-
20-
/// <summary>
21-
/// Will move the axis of the laser to the given position
12+
/// Will move the axes of the system to the given position
2213
/// </summary>
23-
/// <param name="axis">The axis which should be moved</param>
24-
/// <param name="targetPosition">The target position of the axis</param>
25-
Task<AxisMovementResponse> MoveAxis(Axes axis, AxisPosition targetPosition);
14+
/// <param name="movement">Array of axes which should be moved</param>
15+
Task<AxisMovementResponse> MoveAxes(params AxisMovement[] movement);
2616
}
2717
}

0 commit comments

Comments
 (0)