Commit d8c07ab2 LN

接口修改

1 个父辈 36a8cd24
......@@ -13,10 +13,10 @@ namespace DeviceLibrary
public HttpServer()
{
}
private static string Addr_updateDeviceAlarmMsg = "/rest/api/qisda/device/updateDeviceAlarmMsg";
private static string Addr_ShelfFinish = "/rest/api/qisda/device/putShelfFinished";
private static string Addr_getLocation = "/rest/api/qisda/device/getLocation";
private static string Addr_getShelfEmptySlot = "/rest/api/dcs/device/getShelfEmptySlot";
private static string Addr_updateDeviceAlarmMsg = "/rest/api/device/shelf/updateDeviceAlarmMsg";
private static string Addr_ShelfFinish = "/rest/api/device/shelf/putShelfFinished";
private static string Addr_getLocation = "/rest/api/device/shelf/getLocation";
private static string Addr_getShelfEmptySlot = "/rest/api/device/shelf/getShelfEmptySlot";
/// <summary>
/// rest/api/dcs/device/getShelfEmptySlot
/// 获取当前任务数及料架的剩余空位
......@@ -152,7 +152,7 @@ namespace DeviceLibrary
/// <param name="rfidLoc"></param>
/// <param name="robotIndex"></param>
/// <returns></returns>
public static ShelfTaskInfo ShelfFinish(string rfid, string barcode = "", string rfidLoc = "", string robotIndex = "1")
public static ShelfTaskInfo ShelfFinish(string rfid, string barcode = "", string rfidLoc = "" )
{
ShelfTaskInfo task = new ShelfTaskInfo();
task.rfid = rfid;
......@@ -165,7 +165,7 @@ namespace DeviceLibrary
paramMap.Add("barcode", barcode);
paramMap.Add("rfid", rfid);
paramMap.Add("rfidLoc", rfidLoc);
paramMap.Add("robotIndex", robotIndex);
//paramMap.Add("robotIndex", robotIndex);
//string url = httpAddr + api + "?barcode=" + barcode + "&rfid=" + rfid + "&rfidLoc=" + rfidLoc + "&robotIndex=" + robotIndex;
string url = GetAddr(api, paramMap);
LogUtil.debug("http :URL:" + url);
......@@ -231,11 +231,20 @@ namespace DeviceLibrary
if (data == null || data.code != 0)
{
tray = TrayInfo.newNgTray(barcode, data.msg);
if (data.data != null)
{
int h = getIntData(data.data, "h");
int w = getIntData(data.data, "w");
tray.h = h;
tray.w = w;
}
return tray;
}
tray = JsonHelper.DeserializeJsonToObject<TrayInfo>(data.data.ToString());
if (tray == null || tray.rfid == "" || tray.shelfP == 0)
if (tray == null || tray.rfid == "" || tray.rfidLoc == 0)
{
tray = TrayInfo.newNgTray(barcode, "获取位置失败");
return tray;
......@@ -257,7 +266,7 @@ namespace DeviceLibrary
/// <summary>
/// 料架位置,1-31
/// </summary>
public int shelfP = 0;
public int rfidLoc = 0;
/// <summary>
/// 虚拟料架号
/// </summary>
......@@ -265,7 +274,7 @@ namespace DeviceLibrary
/// <summary>
/// 真实料架号
/// </summary>
public string realRFID = "";
public string realRfid = "";
/// <summary>
/// 条码信息
/// </summary>
......@@ -275,8 +284,8 @@ namespace DeviceLibrary
/// </summary>
public string usedRfidList = "";
public int plateW = 7;
public int plageH = 8;
public int w = 7;
public int h = 8;
public bool ngReel = false;
......@@ -286,11 +295,11 @@ namespace DeviceLibrary
{
if (ngReel)
{
return "NGReel: [" + barcode + "] [" + ngMsg + "] [" + updateTime.ToLongTimeString() + "]";
return "NGReel: [" + barcode + "]["+w+"X"+h+"] [" + ngMsg + "] [" + updateTime.ToLongTimeString() + "]";
}
else
{
return " [" + barcode + "] [" + shelfP + "] [" + rfid + "] [" + realRFID + "] [" + usedRfidList + "] [" + updateTime.ToLongTimeString() + "]";
return " [" + barcode + "] [" + w + "X" + h + "] [" + rfidLoc + "] [" + rfid + "] [" + realRfid + "] [" + usedRfidList + "] [" + updateTime.ToLongTimeString() + "]";
}
}
public DateTime updateTime = DateTime.Now;
......
......@@ -701,22 +701,23 @@ namespace DeviceLibrary
internal string GetShelfPosId(TrayInfo tray)
{
string targetPosName = "";
if (tray != null)
{
foreach (OutShelfBean obj in outShelfBeans.Values)
{
string targetPosName = "";
if (obj.IsRightShelf(tray, out targetPosName))
{
//料架对应位置存在的话使用料架对应位置
string pName = targetPosName + "_" + tray.realRFID;
string pName = targetPosName + "_" + tray.realRfid;
ACStorePosition position = CSVPositionReader<ACStorePosition>.GetPositon(pName);
if (position == null)
{
//判断库位号是否存在
position = CSVPositionReader<ACStorePosition>.GetPositon(targetPosName);
position = CSVPositionReader<ACStorePosition>.GetPositon(targetPosName);
if (position == null)
{
LogUtil.error(Name + " " + tray.ToStr() + " 找到匹配料架,但未找到库位号:" + position);
......@@ -733,7 +734,10 @@ namespace DeviceLibrary
}
}
}
return targetPosName;
return "";
}
public void MsgEvent(List<Msg> msgs)
......
......@@ -43,7 +43,7 @@ namespace DeviceLibrary
//NG门关上再放料
if (IOManager.IOValue(IO_Type.Left_NGDoor_Close_Check).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.Right_NGDoor_Close_Check).Equals(IO_VALUE.HIGH))
{
string ngPos = getNextNgPos(tray.plateW);
string ngPos = getNextNgPos(tray.w);
if (ngPos == "")
{
//暂无NG空位
......@@ -54,7 +54,7 @@ namespace DeviceLibrary
{
//送料到NG
StoreMoveInfo.NewMove(MoveStep.PutReel01_Ready);
StoreMoveInfo.MoveParam = new ReelParam(tray.barcode, tray.plateW, tray.plageH, inReel.PosName, ngPos, tray.ngReel, tray.ngMsg);
StoreMoveInfo.MoveParam = new ReelParam(tray.barcode, tray.w, tray.h, inReel.PosName, ngPos, tray.ngReel, tray.ngMsg);
StoreMoveInfo.log("NG料准备放料:" + StoreMoveInfo.MoveParam.ToStr());
break;
}
......@@ -68,14 +68,24 @@ namespace DeviceLibrary
{
//送料到料架
StoreMoveInfo.NewMove(MoveStep.PutReel01_Ready);
StoreMoveInfo.MoveParam = new ReelParam(tray.barcode, tray.plateW, tray.plageH, inReel.PosName, pos, tray.ngReel, tray.ngMsg);
StoreMoveInfo.MoveParam = new ReelParam(tray.barcode, tray.w, tray.h, inReel.PosName, pos, tray.ngReel, tray.ngMsg);
StoreMoveInfo.log("出库料准备放料:" + StoreMoveInfo.MoveParam.ToStr());
break;
}
else
{
{
string msg = "[" + inReel.Name + "]未找到匹配库位";
if (string.IsNullOrEmpty(tray.realRfid))
{
msg = "[" + inReel.Name + "]未找到匹配库位,需要新料架["+tray.rfid+"]";
}
else
{
msg = "[" + inReel.Name + "]未找到匹配库位,找不到料架["+tray.realRfid + "]";
}
//暂无NG空位
Msg.add("[" + inReel.Name + "]未找到匹配库位", MsgLevel.warning, ErrInfo.Empty);
Msg.add("[" + inReel.Name + "]未找到匹配库位["+ tray .ToStr()+ "]", MsgLevel.warning, ErrInfo.Empty);
ProcessMsgEvent?.Invoke(Msg.get());
}
}
......
......@@ -65,22 +65,22 @@ namespace DeviceLibrary
}
if (ShelfValid())
{
if (CurrShelf.realRFID.Equals(CurrTray.realRFID))
if (CurrShelf.realRFID.Equals(CurrTray.realRfid))
{
if (String.IsNullOrEmpty(CurrShelf.rfid))
{
CurrShelf.rfid = CurrTray.rfid;
LogUtil.info(Name + "增加虚拟料架号绑定:" + CurrShelf.ToStr());
}
ShelfPosId = Name + "_" + +CurrTray.shelfP;
ShelfPosId = Name + "_" + +CurrTray.rfidLoc;
return true;
}
else if (String.IsNullOrEmpty(CurrTray.realRFID))
else if (String.IsNullOrEmpty(CurrTray.realRfid))
{
if ((!CurrShelf.rfid.Equals("")) && CurrShelf.rfid.Equals(CurrTray.rfid))
{
CurrTray.realRFID = CurrShelf.realRFID;
ShelfPosId = Name + "_" + +CurrTray.shelfP;
CurrTray.realRfid = CurrShelf.realRFID;
ShelfPosId = Name + "_" + +CurrTray.rfidLoc;
return true;
}
if (!String.IsNullOrEmpty(CurrTray.usedRfidList))
......@@ -95,9 +95,9 @@ namespace DeviceLibrary
if (CurrShelf.rfid.Equals(""))
{
CurrShelf.rfid = CurrTray.rfid;
CurrTray.realRFID = CurrShelf.realRFID;
CurrTray.realRfid = CurrShelf.realRFID;
LogUtil.info(Name + "增加虚拟料架号绑定:" + CurrShelf.ToStr());
ShelfPosId = Name + "_" + CurrTray.shelfP;
ShelfPosId = Name + "_" + CurrTray.rfidLoc;
return true;
}
}
......@@ -133,6 +133,16 @@ namespace DeviceLibrary
}
return false;
}
public bool HasShelf()
{
if (MoveInfo.MoveStep.Equals(MoveStep.Wait)&& IOManager.IOValue(Shelf_Front_Check).Equals(IO_VALUE.LOW )&& IOManager.IOValue(Shelf_Back_Check).Equals(IO_VALUE.HIGH))
{
return false;
}
return true;
}
public bool StartPutReel()
{
if (ShelfReady())
......
......@@ -15,8 +15,8 @@
如果你的应用程序需要此虚拟化来实现向后兼容性,则删除此
元素。
-->
<!--<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<!--<requestedExecutionLevel level="asInvoker" uiAccess="false" />-->
</requestedPrivileges>
</security>
</trustInfo>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!