|
|
|
@ -36,7 +36,7 @@ namespace SlnMesnac.TouchSocket
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public delegate void AGVArrivalStart(string message, AGVArrivalSingalEntity aGVArrivalSingalEntity);
|
|
|
|
|
public delegate void AGVArrivalStart(string message, AGVSingalEntity aGVArrivalSingalEntity);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// AGV到位信号刷新
|
|
|
|
|
/// </summary>
|
|
|
|
@ -49,32 +49,12 @@ namespace SlnMesnac.TouchSocket
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[EnableCors("cors")]
|
|
|
|
|
[WebApi(HttpMethodType.POST)]
|
|
|
|
|
public object AGVArrivalSignal(string messageHeader, AGVArrivalSingalEntity aGVArrivalSingalEntity)
|
|
|
|
|
public object AGVSignal(string messageHeader, AGVSingalEntity aGVArrivalSingalEntity)
|
|
|
|
|
{
|
|
|
|
|
AGVArrivalStartEvent?.Invoke(messageHeader, aGVArrivalSingalEntity);
|
|
|
|
|
return "Success";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public delegate void ManipulatorWorkDoneStart(string message, ManipulatorWorkDoneEntity manipulatorWorkDoneEntity);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 机械臂抓取完毕事件刷新
|
|
|
|
|
/// </summary>
|
|
|
|
|
public event ManipulatorWorkDoneStart ManipulatorWorkDoneEvent;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 机械臂抓取完毕信号接口
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="messageHeader"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[EnableCors("cors")]
|
|
|
|
|
[WebApi(HttpMethodType.POST)]
|
|
|
|
|
public object ManipulatorWorkDone(string messageHeader, ManipulatorWorkDoneEntity manipulatorWorkDoneEntity)
|
|
|
|
|
{
|
|
|
|
|
ManipulatorWorkDoneEvent?.Invoke(messageHeader, manipulatorWorkDoneEntity);
|
|
|
|
|
return "Success";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void SubscribeToAGVArrivalEvent()
|
|
|
|
|
{
|
|
|
|
|
// 订阅 AGV 到位事件
|
|
|
|
@ -82,7 +62,7 @@ namespace SlnMesnac.TouchSocket
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 处理 AGV 到位事件的方法
|
|
|
|
|
public void OnAGVArrival(string message, AGVArrivalSingalEntity aGVArrivalSingalEntity)
|
|
|
|
|
public void OnAGVArrival(string message, AGVSingalEntity aGVArrivalSingalEntity)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine($"收到AGV到位信号: {message}");
|
|
|
|
|
Console.WriteLine($"AGV编号: {aGVArrivalSingalEntity.AGVNo}, 到达位置: {aGVArrivalSingalEntity.DestinationNo}");
|
|
|
|
|