dengjunjie
5 小时以前 441b6f8d257a01b2998253ef0515a201777d7e68
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core.Helper;
 
namespace WIDESEAWCS_DTO.TaskInfo
{
    public class AGVInterfaceAddress
    {
        public static readonly string ip = AppSettings.Configuration["AGVIP"];
 
        /// <summary>
        /// 下发AGV任务
        /// </summary>
        public static string taskSent => GetInterfaceAddress(nameof(taskSent));
        /// <summary>
        /// 查询任务结果
        /// </summary>
        public static string taskResult => GetInterfaceAddress(nameof(taskResult));
 
        static string GetInterfaceAddress(string MethodName)
        {
            string agvInterfaceAddress = AppSettings.Configuration[nameof(agvInterfaceAddress)];
            if (!string.IsNullOrEmpty(agvInterfaceAddress))
            {
                List<string> InterfaceAddresses = agvInterfaceAddress.Split(',').ToList();
                return ip + InterfaceAddresses.Where(x => x.Contains(MethodName)).FirstOrDefault();
            }
            return "";
        }
    }
}