|
|
|
@ -31,6 +31,10 @@ namespace SlnMesnac.TouchSocket
|
|
|
|
|
{
|
|
|
|
|
public class ApiServer: RpcServer
|
|
|
|
|
{
|
|
|
|
|
public ApiServer()
|
|
|
|
|
{
|
|
|
|
|
SubscribeToAGVArrivalEvent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public delegate void AGVArrivalStart(string message, AGVArrivalSingalEntity aGVArrivalSingalEntity);
|
|
|
|
|
/// <summary>
|
|
|
|
@ -70,6 +74,21 @@ namespace SlnMesnac.TouchSocket
|
|
|
|
|
return "Success";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void SubscribeToAGVArrivalEvent()
|
|
|
|
|
{
|
|
|
|
|
// 订阅 AGV 到位事件
|
|
|
|
|
AGVArrivalStartEvent += OnAGVArrival;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 处理 AGV 到位事件的方法
|
|
|
|
|
public void OnAGVArrival(string message, AGVArrivalSingalEntity aGVArrivalSingalEntity)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine($"收到AGV到位信号: {message}");
|
|
|
|
|
Console.WriteLine($"AGV编号: {aGVArrivalSingalEntity.AGVNo}, 到达位置: {aGVArrivalSingalEntity.DestinationNo}");
|
|
|
|
|
// 这里可以处理更多的业务逻辑,比如记录日志、更新系统状态等
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|