You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
1.9 KiB
C#

using SlnMesnac.Model.AirportApiEntity;
using System;
5 months ago
using System.Collections.Generic;
using System.Text;
using TouchSocket.Rpc;
using TouchSocket.WebApi;
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
* (c) 2024 WenJY
* CLR4.0.30319.42000
* T14-GEN3-7895
* SlnMesnac.TouchSocket
* 649766cc-308e-4bf3-8d69-dea48ec40642
*
* WenJY
*
* 2024-09-04 10:51:54
* V1.0.0
*
*
*--------------------------------------------------------------------
*
*
*
*
* V1.0.0
*--------------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
namespace SlnMesnac.TouchSocket
{
public class ApiServer: RpcServer
{
public ApiServer()
{
AgvInStoreEvent += OnAGVArrival;
}
5 months ago
public delegate void AGVInStoreDelegate(string agvGuid);
5 months ago
/// <summary>
/// AGV到位信号刷新
5 months ago
/// </summary>
public event AGVInStoreDelegate AgvInStoreEvent;
5 months ago
/// <summary>
/// AGV到位信号接口
5 months ago
/// </summary>
/// <param name="messageHeader"></param>
/// <returns></returns>
[EnableCors("cors")]
[WebApi(HttpMethodType.GET)]
public object AGVInStoreSignal(string agvGuid)
5 months ago
{
AgvInStoreEvent?.Invoke(agvGuid);
return "Success";
5 months ago
}
public void SubscribeToAGVArrivalEvent()
{
// 订阅事件
AgvInStoreEvent += OnAGVArrival;
}
// 处理 AGV 到位事件的方法
public void OnAGVArrival(string agvGuid)
{
// 这里可以处理更多的业务逻辑,比如记录日志、更新系统状态等
}
5 months ago
}
5 months ago
}