|
@@ -0,0 +1,572 @@
|
|
|
+using System.ComponentModel;
|
|
|
+using Microsoft.AspNetCore.Mvc;
|
|
|
+using Newtonsoft.Json;
|
|
|
+using PlcSiemens.Core.Extension;
|
|
|
+using ServiceCenter;
|
|
|
+using ServiceCenter.Extensions;
|
|
|
+using ServiceCenter.Redis;
|
|
|
+using ServiceCenter.SqlSugars;
|
|
|
+using System.Net.NetworkInformation;
|
|
|
+using System.Text;
|
|
|
+using SqlSugar;
|
|
|
+using WCS.Core;
|
|
|
+using WCS.Entity;
|
|
|
+using WCS.Entity.Protocol.DataStructure;
|
|
|
+using WCS.Entity.Protocol.HUB;
|
|
|
+using WCS.Entity.Protocol.Protocol.Robot;
|
|
|
+using WCS.Entity.Protocol.SRM;
|
|
|
+using WCS.WorkEngineering.Extensions;
|
|
|
+using WCS.WorkEngineering.Systems;
|
|
|
+using WCS.WorkEngineering.WebApi.Models.WCS.Request;
|
|
|
+using WCS.WorkEngineering.WebApi.Models.WCS.Response;
|
|
|
+using WCS.WorkEngineering.WebApi.Models.WMS.Response;
|
|
|
+using TaskStatus = WCS.Entity.TaskStatus;
|
|
|
+using static Dm.net.buffer.ByteArrayBuffer;
|
|
|
+using System.Security.Claims;
|
|
|
+using WCS.Entity.Protocol.Truss;
|
|
|
+
|
|
|
+// ReSharper disable PossibleLossOfFraction
|
|
|
+
|
|
|
+namespace WCS.WorkEngineering.WebApi.Controllers
|
|
|
+{
|
|
|
+ /// <summary>
|
|
|
+ /// 设备Ip通讯检测结构
|
|
|
+ /// </summary>
|
|
|
+ public class DeviceIpTestResults
|
|
|
+ {
|
|
|
+ public string Ip { get; set; }
|
|
|
+
|
|
|
+ public bool Result { get; set; }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// WCS相关接口控制器
|
|
|
+ /// </summary>
|
|
|
+ [ApiController]
|
|
|
+ [Route("api/[controller]/[action]")]
|
|
|
+ public class WcsController : ControllerBase
|
|
|
+ {
|
|
|
+ /// <summary>
|
|
|
+ /// 获取设备配置信息接口
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet]
|
|
|
+ public List<Device> GetDeviceList()
|
|
|
+ {
|
|
|
+ return Device.All.ToList();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 获取设备运行状态
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="req"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ public List<RunInfo> GetDevRunInfo([FromBody] DevRunInfoViewMode req)
|
|
|
+ {
|
|
|
+ var runInfos = new List<RunInfo>();
|
|
|
+ var db = new SqlSugarHelper().Default;
|
|
|
+ var plcEx = new SqlSugarHelper().PLCEX;
|
|
|
+ var type = "";
|
|
|
+ switch (req.Type)
|
|
|
+ {
|
|
|
+ case DevType.Robot: //机械臂
|
|
|
+ type = DevType.Robot.ToString();
|
|
|
+ //获取时段内设备的运行状态
|
|
|
+ var runInfoList = plcEx.Queryable<DevRunInfo>().Where(x => x.Type == type && x.Frame >= req.StateTime && x.Frame < req.EndTime).ToList().GroupBy(x => x.Code);
|
|
|
+ foreach (var runInfo in runInfoList)
|
|
|
+ {
|
|
|
+ var info = new RunInfo()
|
|
|
+ {
|
|
|
+ Code = runInfo.Key,
|
|
|
+ EnterDepot = db.Queryable<WCS_TaskOld>().With(SqlWith.NoLock)
|
|
|
+ .Where(x => x.Status == TaskStatus.Finish && x.Type == TaskType.SetPlate &&
|
|
|
+ x.Device == runInfo.Key && x.EndTime >= req.StateTime &&
|
|
|
+ x.EndTime < req.EndTime)
|
|
|
+ .SplitTable(x => x.Take(2))
|
|
|
+ .Count(),
|
|
|
+ OutDepot = db.Queryable<WCS_TaskOld>().With(SqlWith.NoLock)
|
|
|
+ .Where(x => x.Status == TaskStatus.Finish && x.Type == TaskType.OutDepot &&
|
|
|
+ x.Device == runInfo.Key && x.EndTime >= req.StateTime &&
|
|
|
+ x.EndTime < req.EndTime)
|
|
|
+ .SplitTable(x => x.Take(2))
|
|
|
+ .Count(),
|
|
|
+ Free = runInfo.Where(x =>
|
|
|
+ x.RunMode == RobotMode.Automatic.GetDescription() &&
|
|
|
+ x.RunStatus == RobotRunStatus.Idle.GetDescription()).Sum(x => x.Duration) / 1000 / 60,
|
|
|
+ Alarm = runInfo.Where(x => x.RunMode == RobotMode.Alarm.GetDescription())
|
|
|
+ .Sum(x => x.Duration) / 1000 / 60,
|
|
|
+ Manual = runInfo.Where(x => x.RunMode == RobotMode.Manua.GetDescription())
|
|
|
+ .Sum(x => x.Duration) / 1000 / 60,
|
|
|
+ Automatic = runInfo.Where(x => x.RunMode == RobotMode.Automatic.GetDescription()
|
|
|
+ && x.RunStatus != RobotRunStatus.Idle.GetDescription()
|
|
|
+ && x.RunStatus != RobotRunStatus.Maintain.GetDescription())
|
|
|
+ .Sum(x => x.Duration) / 1000 / 60,
|
|
|
+ };
|
|
|
+
|
|
|
+ #region 开始分析设备动作,不计算停止时间
|
|
|
+
|
|
|
+ var devActions = new List<DevActionViewMode>();
|
|
|
+ double totalTime = 0; //总耗时
|
|
|
+ double totalCount = 0; //总次数
|
|
|
+ //入库
|
|
|
+ var infos = runInfo.Where(x => x.RunMode == RobotMode.Automatic.GetDescription()).OrderBy(x => x.Frame).ToList();
|
|
|
+ totalTime = infos.Where(x => x.RunStatus == RobotRunStatus.InboundCrawling.GetDescription() || x.RunStatus == RobotRunStatus.InStorage.GetDescription()).Sum(x => x.Duration);
|
|
|
+ totalCount = infos.Count(x => x.RunStatus == RobotRunStatus.InboundCrawling.GetDescription());
|
|
|
+ devActions.Add(new DevActionViewMode()
|
|
|
+ {
|
|
|
+ Type = DevActionType.In.GetDescription(),
|
|
|
+ ActionAmount = totalCount,
|
|
|
+ ActionTime = totalTime == 0 ? 0 : Math.Round(totalTime / totalCount, 2),
|
|
|
+ });
|
|
|
+ //出库
|
|
|
+ infos = runInfo.Where(x => x.RunMode == RobotMode.Automatic.GetDescription()).ToList();
|
|
|
+ totalTime = infos.Where(x => x.RunStatus == RobotRunStatus.OutBoundCrawling.GetDescription() || x.RunStatus == RobotRunStatus.OutStorage.GetDescription()).Sum(x => x.Duration);
|
|
|
+ totalCount = infos.Count(x => x.RunStatus == RobotRunStatus.OutBoundCrawling.GetDescription());
|
|
|
+ devActions.Add(new DevActionViewMode()
|
|
|
+ {
|
|
|
+ Type = DevActionType.Out.GetDescription(),
|
|
|
+ ActionAmount = totalCount,
|
|
|
+ ActionTime = totalTime == 0 ? 0 : Math.Round(totalTime / totalCount, 2),
|
|
|
+ });
|
|
|
+ info.DevAction = devActions;
|
|
|
+
|
|
|
+ #endregion 开始分析设备动作,不计算停止时间
|
|
|
+
|
|
|
+ #region 计算任务的工位使用数量
|
|
|
+
|
|
|
+ var stationCounts = new List<StationCount>();
|
|
|
+ type = DevType.RobotTaskSum.ToString();
|
|
|
+ var taskSum = plcEx.Queryable<DevRunInfo>().Where(x => x.Code == runInfo.Key && x.Type == type && x.Frame >= req.StateTime && x.Frame < req.EndTime)
|
|
|
+ .ToList().Select(x =>
|
|
|
+ {
|
|
|
+ var item = x;
|
|
|
+ item.Duration = long.Parse(item.RunStatus.Split("--")[2]);
|
|
|
+ return item;
|
|
|
+ }).ToList();
|
|
|
+
|
|
|
+ //入库
|
|
|
+ stationCounts.Add(new StationCount()
|
|
|
+ {
|
|
|
+ Type = DevActionType.In.GetDescription(),
|
|
|
+ StationNum = taskSum.Count(x => x is { Duration: 3, RunMode: "1" }),
|
|
|
+ StationIndex = 1
|
|
|
+ });
|
|
|
+ stationCounts.Add(new StationCount()
|
|
|
+ {
|
|
|
+ Type = DevActionType.In.GetDescription(),
|
|
|
+ StationNum = taskSum.Count(x => x is { Duration: 3, RunMode: "2" }),
|
|
|
+ StationIndex = 2
|
|
|
+ });
|
|
|
+ //出库
|
|
|
+ stationCounts.Add(new StationCount()
|
|
|
+ {
|
|
|
+ Type = DevActionType.Out.GetDescription(),
|
|
|
+ StationNum = taskSum.Count(x => x is { Duration: 4, RunMode: "1" }),
|
|
|
+ StationIndex = 1
|
|
|
+ });
|
|
|
+ stationCounts.Add(new StationCount()
|
|
|
+ {
|
|
|
+ Type = DevActionType.Out.GetDescription(),
|
|
|
+ StationNum = taskSum.Count(x => x is { Duration: 4, RunMode: "2" }),
|
|
|
+ StationIndex = 2
|
|
|
+ });
|
|
|
+ info.StationCount = stationCounts;
|
|
|
+
|
|
|
+ #endregion 计算任务的工位使用数量
|
|
|
+
|
|
|
+ runInfos.Add(info);
|
|
|
+ }
|
|
|
+
|
|
|
+ break;
|
|
|
+
|
|
|
+ case DevType.Truss:
|
|
|
+ type = DevType.Truss.ToString();
|
|
|
+ //获取时段内设备的运行状态
|
|
|
+ var trussInfoList = plcEx.Queryable<DevRunInfo>().Where(x => x.Type == type && x.Frame >= req.StateTime && x.Frame < req.EndTime).ToList().GroupBy(x => x.Code);
|
|
|
+ foreach (var runInfo in trussInfoList)
|
|
|
+ {
|
|
|
+ var info = new RunInfo()
|
|
|
+ {
|
|
|
+ Code = runInfo.Key,
|
|
|
+ EnterDepot = db.Queryable<WCS_TaskOld>().With(SqlWith.NoLock)
|
|
|
+ .Where(x => x.Status == TaskStatus.Finish && x.Type == TaskType.SetPlate &&
|
|
|
+ x.Device == runInfo.Key && x.EndTime >= req.StateTime &&
|
|
|
+ x.EndTime < req.EndTime)
|
|
|
+ .SplitTable(x => x.Take(2))
|
|
|
+ .Count(),
|
|
|
+ Free = runInfo.Where(x => x.RunMode == TrussStatus.Idle.GetDescription()).Sum(x => x.Duration) / 1000 / 60,
|
|
|
+ Alarm = runInfo.Where(x => x.RunMode == TrussStatus.Alarm.GetDescription()).Sum(x => x.Duration) / 1000 / 60,
|
|
|
+ Manual = runInfo.Where(x => x.RunMode == TrussStatus.Manual.GetDescription() || x.RunMode == TrussStatus.KeepInRepair.GetDescription()).Sum(x => x.Duration) / 1000 / 60,
|
|
|
+ Automatic = runInfo.Where(x => x.RunMode == TrussStatus.Execute.GetDescription()).Sum(x => x.Duration) / 1000 / 60,
|
|
|
+ };
|
|
|
+
|
|
|
+ #region 开始分析设备动作,不计算停止时间
|
|
|
+
|
|
|
+ var devActions = new List<DevActionViewMode>();
|
|
|
+ double totalTime = 0; //总耗时
|
|
|
+ double totalCount = 0; //总次数
|
|
|
+ //入库
|
|
|
+ var infos = runInfo.Where(x => x.RunMode == TrussStatus.Execute.GetDescription()).ToList();
|
|
|
+ totalTime = infos.Where(x => x.RunMode == TrussStatus.Execute.GetDescription()).Sum(x => x.Duration);
|
|
|
+ totalCount = infos.Count(x => x.RunMode == TrussStatus.Execute.GetDescription());
|
|
|
+ devActions.Add(new DevActionViewMode()
|
|
|
+ {
|
|
|
+ Type = DevActionType.In.GetDescription(),
|
|
|
+ ActionAmount = totalCount,
|
|
|
+ ActionTime = totalTime == 0 ? 0 : Math.Round(totalTime / totalCount, 2),
|
|
|
+ });
|
|
|
+
|
|
|
+ info.DevAction = devActions;
|
|
|
+
|
|
|
+ #endregion 开始分析设备动作,不计算停止时间
|
|
|
+
|
|
|
+ #region 计算任务的工位使用数量
|
|
|
+
|
|
|
+ var stationCounts = new List<StationCount>();
|
|
|
+ type = DevType.TrussTaskSum.ToString();
|
|
|
+ var taskSum = plcEx.Queryable<DevRunInfo>().Where(x => x.Code == runInfo.Key && x.Type == type && x.Frame >= req.StateTime && x.Frame < req.EndTime)
|
|
|
+ .ToList();
|
|
|
+
|
|
|
+ //入库
|
|
|
+ stationCounts.Add(new StationCount()
|
|
|
+ {
|
|
|
+ Type = DevActionType.In.GetDescription(),
|
|
|
+ StationNum = taskSum.Count(x => x is { RunMode: "1" }),
|
|
|
+ StationIndex = 1
|
|
|
+ });
|
|
|
+ stationCounts.Add(new StationCount()
|
|
|
+ {
|
|
|
+ Type = DevActionType.In.GetDescription(),
|
|
|
+ StationNum = taskSum.Count(x => x is { RunMode: "2" }),
|
|
|
+ StationIndex = 2
|
|
|
+ });
|
|
|
+ stationCounts.Add(new StationCount()
|
|
|
+ {
|
|
|
+ Type = DevActionType.In.GetDescription(),
|
|
|
+ StationNum = taskSum.Count(x => x is { RunMode: "3" }),
|
|
|
+ StationIndex = 3
|
|
|
+ });
|
|
|
+ stationCounts.Add(new StationCount()
|
|
|
+ {
|
|
|
+ Type = DevActionType.In.GetDescription(),
|
|
|
+ StationNum = taskSum.Count(x => x is { RunMode: "4" }),
|
|
|
+ StationIndex = 4
|
|
|
+ });
|
|
|
+ stationCounts.Add(new StationCount()
|
|
|
+ {
|
|
|
+ Type = DevActionType.In.GetDescription(),
|
|
|
+ StationNum = taskSum.Count(x => x is { RunMode: "5" }),
|
|
|
+ StationIndex = 5
|
|
|
+ });
|
|
|
+ stationCounts.Add(new StationCount()
|
|
|
+ {
|
|
|
+ Type = DevActionType.In.GetDescription(),
|
|
|
+ StationNum = taskSum.Count(x => x is { RunMode: "6" }),
|
|
|
+ StationIndex = 6
|
|
|
+ });
|
|
|
+ stationCounts.Add(new StationCount()
|
|
|
+ {
|
|
|
+ Type = DevActionType.In.GetDescription(),
|
|
|
+ StationNum = taskSum.Count(x => x is { RunMode: "7" }),
|
|
|
+ StationIndex = 7
|
|
|
+ });
|
|
|
+ stationCounts.Add(new StationCount()
|
|
|
+ {
|
|
|
+ Type = DevActionType.In.GetDescription(),
|
|
|
+ StationNum = taskSum.Count(x => x is { RunMode: "8" }),
|
|
|
+ StationIndex = 8
|
|
|
+ });
|
|
|
+ stationCounts.Add(new StationCount()
|
|
|
+ {
|
|
|
+ Type = DevActionType.In.GetDescription(),
|
|
|
+ StationNum = taskSum.Count(x => x is { RunMode: "9" }),
|
|
|
+ StationIndex = 9
|
|
|
+ });
|
|
|
+ stationCounts.Add(new StationCount()
|
|
|
+ {
|
|
|
+ Type = DevActionType.In.GetDescription(),
|
|
|
+ StationNum = taskSum.Count(x => x is { RunMode: "10" }),
|
|
|
+ StationIndex = 10
|
|
|
+ });
|
|
|
+
|
|
|
+ info.StationCount = stationCounts;
|
|
|
+
|
|
|
+ #endregion 计算任务的工位使用数量
|
|
|
+
|
|
|
+ runInfos.Add(info);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ return runInfos;
|
|
|
+ }
|
|
|
+
|
|
|
+ #region 设备IP相关
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 检查Ip是否正常联通
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="strIpOrDName">输入参数,表示IP地址或域名</param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet]
|
|
|
+ public static bool PingIpOrDomainName(string strIpOrDName)
|
|
|
+ {
|
|
|
+ try
|
|
|
+
|
|
|
+ {
|
|
|
+ var objPingSender = new Ping();
|
|
|
+
|
|
|
+ var objPinOptions = new PingOptions
|
|
|
+ {
|
|
|
+ DontFragment = true
|
|
|
+ };
|
|
|
+
|
|
|
+ const string data = "";
|
|
|
+
|
|
|
+ var buffer = Encoding.UTF8.GetBytes(data);
|
|
|
+
|
|
|
+ const int intTimeout = 120;
|
|
|
+
|
|
|
+ var objPinReply = objPingSender.Send(strIpOrDName, intTimeout, buffer, objPinOptions);
|
|
|
+
|
|
|
+ var strInfo = objPinReply.Status.ToString();
|
|
|
+
|
|
|
+ return strInfo == "Success";
|
|
|
+ }
|
|
|
+ catch (Exception)
|
|
|
+
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 获取设备IP检测结果
|
|
|
+ /// </summary>
|
|
|
+ /// <returns>设备IP检测结果</returns>
|
|
|
+ [HttpGet]
|
|
|
+ public List<DeviceIpTestResults> DeviceIpTest()
|
|
|
+ {
|
|
|
+ if (!ServiceHub.DeviceIPList.Any()) throw new Exception("未配置任何Ip");
|
|
|
+ var deviceIpTestResults = new List<DeviceIpTestResults>();
|
|
|
+ ServiceHub.DeviceIPList.ForEach(ip =>
|
|
|
+ {
|
|
|
+ deviceIpTestResults.Add(new DeviceIpTestResults
|
|
|
+ {
|
|
|
+ Ip = ip,
|
|
|
+ Result = PingIpOrDomainName(ip)
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ return deviceIpTestResults;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 获取设备Ip集合
|
|
|
+ /// </summary>
|
|
|
+ /// <returns>设备Ip集合</returns>
|
|
|
+ [HttpGet]
|
|
|
+ public List<string> GetDeviceIpList()
|
|
|
+ {
|
|
|
+ if (!ServiceHub.DeviceIPList.Any()) throw new Exception("未配置任何Ip");
|
|
|
+ return ServiceHub.DeviceIPList;
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion 设备IP相关
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 设备运行状态
|
|
|
+ /// </summary>
|
|
|
+ public class DevRunInfoViewMode
|
|
|
+ {
|
|
|
+ /// <summary>
|
|
|
+ /// 类型
|
|
|
+ /// </summary>
|
|
|
+ public DevType Type { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 开始时间
|
|
|
+ /// </summary>
|
|
|
+ public DateTime StateTime { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 结束时间
|
|
|
+ /// </summary>
|
|
|
+ public DateTime EndTime { get; set; }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 分页参数
|
|
|
+ /// </summary>
|
|
|
+ public class PagedInfo<T>
|
|
|
+ {
|
|
|
+ /// <summary>
|
|
|
+ /// 每页行数
|
|
|
+ /// </summary>
|
|
|
+ public int PageSize { get; set; } = 10;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 当前页
|
|
|
+ /// </summary>
|
|
|
+ public int PageIndex { get; set; } = 1;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 总记录数
|
|
|
+ /// </summary>
|
|
|
+ public int TotalNum { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 总页数
|
|
|
+ /// </summary>
|
|
|
+ public int TotalPage
|
|
|
+ {
|
|
|
+ get
|
|
|
+ {
|
|
|
+ if (TotalNum > 0)
|
|
|
+ {
|
|
|
+ return TotalNum % this.PageSize == 0 ? TotalNum / this.PageSize : TotalNum / this.PageSize + 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ set { }
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<T> Result { get; set; }
|
|
|
+ public Dictionary<string, object> Extra { get; set; } = new Dictionary<string, object>();
|
|
|
+
|
|
|
+ public PagedInfo()
|
|
|
+ {
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public class RunInfo
|
|
|
+ {
|
|
|
+ public string Code { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 出库任务
|
|
|
+ /// </summary>
|
|
|
+ public int OutDepot { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 入库任务
|
|
|
+ /// </summary>
|
|
|
+ public int EnterDepot { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 移库任务
|
|
|
+ /// </summary>
|
|
|
+ public int MoveDepot { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 空闲
|
|
|
+ /// </summary>
|
|
|
+ public double Free { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 手动
|
|
|
+ /// </summary>
|
|
|
+ public double Manual { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 自动
|
|
|
+ /// </summary>
|
|
|
+ public double Automatic { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 报警
|
|
|
+ /// </summary>
|
|
|
+ public double Alarm { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 运行
|
|
|
+ /// </summary>
|
|
|
+ public double Working { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 交互总耗时
|
|
|
+ /// </summary>
|
|
|
+ public double InteractTotal { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 设备执行分析
|
|
|
+ /// </summary>
|
|
|
+ public List<DevActionViewMode> DevAction { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 任务执行工位使用数量
|
|
|
+ /// </summary>
|
|
|
+ public List<StationCount> StationCount { get; set; }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 设备动作分析
|
|
|
+ /// </summary>
|
|
|
+ public class DevActionViewMode
|
|
|
+ {
|
|
|
+ /// <summary>
|
|
|
+ /// 动作次数
|
|
|
+ /// </summary>
|
|
|
+ public double ActionAmount { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 动作平均耗时
|
|
|
+ /// </summary>
|
|
|
+ public double ActionTime { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 动作类型
|
|
|
+ /// </summary>
|
|
|
+ public string Type { get; set; }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 设备动作类型
|
|
|
+ /// </summary>
|
|
|
+ public enum DevActionType
|
|
|
+ {
|
|
|
+ /// <summary>
|
|
|
+ /// 入库
|
|
|
+ /// </summary>
|
|
|
+ [Description("入库")]
|
|
|
+ In = 0,
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 出库
|
|
|
+ /// </summary>
|
|
|
+ [Description("出库")]
|
|
|
+ Out = 1,
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 移库
|
|
|
+ /// </summary>
|
|
|
+ [Description("移库")]
|
|
|
+ Move = 2,
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 任务执行工位数量
|
|
|
+ /// </summary>
|
|
|
+ public class StationCount
|
|
|
+ {
|
|
|
+ /// <summary>
|
|
|
+ /// 执行数量
|
|
|
+ /// </summary>
|
|
|
+ public double StationNum { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 工位数
|
|
|
+ /// </summary>
|
|
|
+ public double StationIndex { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 任务类型
|
|
|
+ /// </summary>
|
|
|
+ public string Type { get; set; }
|
|
|
+ }
|
|
|
+}
|