46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
using XP.Hardware.MotionControl.Abstractions;
|
|
using XP.Hardware.MotionControl.Abstractions.Enums;
|
|
|
|
namespace XP.Hardware.MotionControl.Implementations
|
|
{
|
|
/// <summary>
|
|
/// 虚拟安全门实现 | Simulated Safety Door Implementation
|
|
/// 始终报告门已关闭(安全状态),所有操作返回成功
|
|
/// Always reports door as closed (safe state), all operations return success
|
|
/// </summary>
|
|
public class SimulatedSafetyDoor : ISafetyDoor
|
|
{
|
|
/// <inheritdoc/>
|
|
public DoorStatus Status { get; private set; } = DoorStatus.Closed;
|
|
|
|
/// <inheritdoc/>
|
|
public bool IsInterlocked => false;
|
|
|
|
/// <inheritdoc/>
|
|
public MotionResult Open()
|
|
{
|
|
Status = DoorStatus.Open;
|
|
return MotionResult.Ok();
|
|
}
|
|
|
|
/// <inheritdoc/>
|
|
public MotionResult Close()
|
|
{
|
|
Status = DoorStatus.Closed;
|
|
return MotionResult.Ok();
|
|
}
|
|
|
|
/// <inheritdoc/>
|
|
public MotionResult Stop()
|
|
{
|
|
return MotionResult.Ok();
|
|
}
|
|
|
|
/// <inheritdoc/>
|
|
public void UpdateStatus()
|
|
{
|
|
// 虚拟安全门无需从 PLC 轮询状态 | No PLC polling needed for simulated safety door
|
|
}
|
|
}
|
|
}
|