|
@@ -55,7 +55,7 @@ namespace WCS.Service.Extensions
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
Ltc.Log(ex.GetBaseException().Message);
|
|
|
- InfoLog.INFO_ERROR($"[{Entity.CODE}]--{ex.Message}--{ex.StackTrace}");
|
|
|
+ InfoLog.INFO_ERROR($"[{Entity.CODE}]--{ex.Message}");
|
|
|
//LogHelper.AddWCS_EXCEPTION(ex.Message, Entity.CODE, WCS_EXCEPTIONTYPE.无.ToString());
|
|
|
}
|
|
|
finally
|
|
@@ -67,7 +67,7 @@ namespace WCS.Service.Extensions
|
|
|
/// <summary>
|
|
|
/// 当前设备可用的RGV
|
|
|
/// </summary>
|
|
|
- private List<RGVDevice> RgvList
|
|
|
+ public List<RGVDevice> RgvList
|
|
|
{
|
|
|
get
|
|
|
{
|
|
@@ -75,6 +75,18 @@ namespace WCS.Service.Extensions
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 当前设备环穿组
|
|
|
+ /// </summary>
|
|
|
+ private List<StationLocation> LoncationList
|
|
|
+ {
|
|
|
+ get
|
|
|
+ {
|
|
|
+ var dev = StationLocation.ALLlocations.FirstOrDefault(v => v.Station == Entity.CODE);
|
|
|
+ return StationLocation.ALLlocations.Where(v => v.PLC == dev.PLC).ToList();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 设备组自身的位置
|
|
|
/// </summary>
|
|
@@ -158,6 +170,16 @@ namespace WCS.Service.Extensions
|
|
|
return Math.Abs((Position - rgv.Position + Length) % Length);
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 计算两个站台之间的距离
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="rgv"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public float Distance(StationDeviceGroup dev)
|
|
|
+ {
|
|
|
+ return Math.Abs((Position - dev.Position + Length) % Length);
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 当前RGV
|
|
|
/// </summary>
|
|
@@ -179,7 +201,7 @@ namespace WCS.Service.Extensions
|
|
|
var rgvs = Device.Where(v => v.IsRGV()).Select(v => v.Device<IRGV521>());
|
|
|
var code = Entity.CODE.Replace("G", "").ToShort();
|
|
|
if (rgvs.Any(v => v.Data.DestPosition_1 == code && v.Data.SystemStatus != RGVRunStatus.空闲))
|
|
|
- throw new Exception(LogHelper.SpliceLogMessage("已有RGV执行中", Entity.CODE, WCS_EXCEPTIONTYPE.逻辑异常, GetType()));
|
|
|
+ throw new WarnException("已有RGV执行中");
|
|
|
foreach (var item in Items)
|
|
|
{
|
|
|
if (item.Data3.Status.HasFlag(StationStatus.运行状态位)) return false;
|
|
@@ -267,7 +289,7 @@ namespace WCS.Service.Extensions
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
Ltc.Log(ex.GetBaseException().Message);
|
|
|
- InfoLog.INFO_ERROR($"[{Entity.CODE}]--{ex.Message}--{ex.StackTrace}");
|
|
|
+ InfoLog.INFO_ERROR($"[{Entity.CODE}]--{ex.Message}");
|
|
|
//LogHelper.AddWCS_EXCEPTION(ex.Message, Entity.CODE, WCS_EXCEPTIONTYPE.无.ToString());
|
|
|
}
|
|
|
finally
|
|
@@ -366,7 +388,7 @@ namespace WCS.Service.Extensions
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
Ltc.Log(ex.GetBaseException().Message);
|
|
|
- InfoLog.INFO_ERROR($"[{Entity.CODE}]--{ex.Message}--{ex.StackTrace}");
|
|
|
+ InfoLog.INFO_ERROR($"[{Entity.CODE}]--{ex.Message}");
|
|
|
//LogHelper.AddWCS_EXCEPTION(ex.Message, Entity.CODE, WCS_EXCEPTIONTYPE.无.ToString());
|
|
|
}
|
|
|
finally
|
|
@@ -427,8 +449,9 @@ namespace WCS.Service.Extensions
|
|
|
/// <param name="addr">目标地址</param>
|
|
|
public void Move(StationDeviceGroup addr)
|
|
|
{
|
|
|
+ Data.TaskID_1 = addr.Entity.CODE.Replace("G", "").ToShort();
|
|
|
Data.TaskType_1 = RGVTaskType.移动;
|
|
|
- Data.DestPosition_1 = addr.Entity.CODE.ToShort();
|
|
|
+ Data.DestPosition_1 = addr.Entity.CODE.Replace("G", "").ToShort();
|
|
|
Data.Trigger_1++;
|
|
|
}
|
|
|
|
|
@@ -613,7 +636,7 @@ namespace WCS.Service.Extensions
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
Ltc.Log(ex.GetBaseException().Message);
|
|
|
- InfoLog.INFO_ERROR($"[{Entity.CODE}]--{ex.Message}--{ex.StackTrace}");
|
|
|
+ InfoLog.INFO_ERROR($"[{Entity.CODE}]--{ex.Message}");
|
|
|
//LogHelper.AddWCS_EXCEPTION(ex.Message, Entity.CODE, WCS_EXCEPTIONTYPE.无.ToString());
|
|
|
}
|
|
|
finally
|
|
@@ -796,17 +819,17 @@ namespace WCS.Service.Extensions
|
|
|
new StationLocation("G1214",0,"RGV1",0),
|
|
|
new StationLocation("G1222",0,"RGV1",0),
|
|
|
new StationLocation("G1164",0,"RGV1",0),
|
|
|
- new StationLocation("G1285",0,"RGV3",0),
|
|
|
- new StationLocation("G1401",0,"RGV3",0),
|
|
|
- new StationLocation("G1294",0,"RGV3",0),
|
|
|
- new StationLocation("G1410",0,"RGV3",0),
|
|
|
- new StationLocation("G1303",0,"RGV3",0),
|
|
|
- new StationLocation("G1417",0,"RGV3",0),
|
|
|
- new StationLocation("G1412",0,"RGV3",0),
|
|
|
- new StationLocation("G1426",0,"RGV3",0),
|
|
|
- new StationLocation("G1332",0,"RGV3",0),
|
|
|
- new StationLocation("G1391",0,"RGV3",0),
|
|
|
- new StationLocation("G1399",0,"RGV3",0),
|
|
|
+ new StationLocation("G1",486326,"RGV3",0),
|
|
|
+ new StationLocation("G2",694439,"RGV3",0),
|
|
|
+ new StationLocation("G3",789931,"RGV3",0),
|
|
|
+ new StationLocation("G4",961595,"RGV3",0),
|
|
|
+ new StationLocation("G5",1013350,"RGV3",0),
|
|
|
+ new StationLocation("G6",1069938,"RGV3",0),
|
|
|
+ new StationLocation("G7",1126338,"RGV3",0),
|
|
|
+ new StationLocation("G8",1178355,"RGV3",0),
|
|
|
+ new StationLocation("G9",1256875,"RGV3",0),
|
|
|
+ new StationLocation("G10",1313239,"RGV3",0),
|
|
|
+ new StationLocation("G11",1369970,"RGV3",0),
|
|
|
});
|
|
|
}
|
|
|
|