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#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using SlnMesnac.Model.AirportApiEntity;
using System;
using System.Collections.Generic;
using System.Text;
using TouchSocket.Rpc;
using TouchSocket.WebApi;
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
* 版权所有 (c) 2024 WenJY 保留所有权利。
* CLR版本4.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;
}
public delegate void AGVInStoreDelegate(string agvGuid);
/// <summary>
/// AGV到位信号刷新
/// </summary>
public event AGVInStoreDelegate AgvInStoreEvent;
/// <summary>
/// AGV到位信号接口
/// </summary>
/// <param name="messageHeader"></param>
/// <returns></returns>
[EnableCors("cors")]
[WebApi(HttpMethodType.GET)]
public object AGVInStoreSignal(string agvGuid)
{
AgvInStoreEvent?.Invoke(agvGuid);
return "Success";
}
public void SubscribeToAGVArrivalEvent()
{
// 订阅事件
AgvInStoreEvent += OnAGVArrival;
}
// 处理 AGV 到位事件的方法
public void OnAGVArrival(string agvGuid)
{
// 这里可以处理更多的业务逻辑,比如记录日志、更新系统状态等
}
}
}