add - 接口测试方法

master
SoulStar 2 months ago
parent 4edefeec12
commit 9419ec6e28

@ -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}");
// 这里可以处理更多的业务逻辑,比如记录日志、更新系统状态等
}
}
}

@ -34,6 +34,11 @@ namespace SlnMesnac.WPF
{
var a = AirPorthttpClient.ManipulatorStateRequest(new ManipulatorStateRequestEntity());
var b = AirPorthttpClient.AGVStateRequest(new AGVStateRequestEntity());
return;
}
}

Loading…
Cancel
Save