Commit c5000a07 LN

1

1 个父辈 79191892
...@@ -297,7 +297,7 @@ namespace DeviceLibrary ...@@ -297,7 +297,7 @@ namespace DeviceLibrary
Task.Delay(ii * 700).Wait(); Task.Delay(ii * 700).Wait();
} }
while (!cameraTask[0].IsCompleted || !cameraTask[1].IsCompleted) while (!cameraTask[0].IsCompleted )
{ {
Application.DoEvents(); Application.DoEvents();
Thread.Sleep(100); Thread.Sleep(100);
......
...@@ -14,9 +14,9 @@ namespace DeviceLibrary ...@@ -14,9 +14,9 @@ namespace DeviceLibrary
{ {
} }
private static string Addr_updateDeviceAlarmMsg = "/rest/api/device/shelf/updateDeviceAlarmMsg"; private static string Addr_updateDeviceAlarmMsg = "/rest/api/device/shelf/updateDeviceAlarmMsg";
private static string Addr_ShelfFinish = "/rest/api/device/shelf/putShelfFinished"; private static string Addr_ShelfFinish = "/rest/api/shelf/putShelfFinished";
private static string Addr_getLocation = "/rest/api/device/shelf/getLocation"; private static string Addr_getLocation = "/rest/api/shelf/getLocation";
private static string Addr_getShelfEmptySlot = "/rest/api/device/shelf/getShelfEmptySlot"; private static string Addr_getShelfEmptySlot = "/rest/api/shelf/getShelfEmptySlot";
/// <summary> /// <summary>
/// rest/api/dcs/device/getShelfEmptySlot /// rest/api/dcs/device/getShelfEmptySlot
/// 获取当前任务数及料架的剩余空位 /// 获取当前任务数及料架的剩余空位
...@@ -110,7 +110,7 @@ namespace DeviceLibrary ...@@ -110,7 +110,7 @@ namespace DeviceLibrary
} }
public static string GetAddr(string addr, Dictionary<string, string> paramsMap) public static string GetAddr(string addr, Dictionary<string, string> paramsMap)
{ {
string server = ConfigAppSettings.GetValue(Setting_Init.Device_Server_Address); string server = Setting_Init.Device_Server_Address;
if (server.EndsWith("/")) if (server.EndsWith("/"))
{ {
server = server.Substring(0, server.Length - 1); server = server.Substring(0, server.Length - 1);
...@@ -236,8 +236,10 @@ namespace DeviceLibrary ...@@ -236,8 +236,10 @@ namespace DeviceLibrary
{ {
int h = getIntData(data.data, "h"); int h = getIntData(data.data, "h");
int w = getIntData(data.data, "w"); int w = getIntData(data.data, "w");
string nBarcode = getData(data.data, "barcode");
tray.h = h; tray.h = h;
tray.w = w; tray.w = w;
tray.barcode = nBarcode;
} }
return tray; return tray;
......
...@@ -120,12 +120,12 @@ public class ReelParam ...@@ -120,12 +120,12 @@ public class ReelParam
{ {
if (IsNg) if (IsNg)
{ {
return $":{NgMsg}[{WareCode}][{RFID}][{PlateW}x{PlateH}]"; return $":NG[{NgMsg}][{StartPos}->{TargetPos}][{WareCode}][{RFID}][{PlateW}x{PlateH}]";
} }
else else
{ {
return $":[{TargetPos}][{WareCode}][{RFID}][{PlateW}x{PlateH}]"; return $":[{StartPos}->{TargetPos}][{WareCode}][{RFID}][{PlateW}x{PlateH}]";
} }
} }
bool islog = false; bool islog = false;
......
...@@ -159,6 +159,7 @@ namespace DeviceLibrary ...@@ -159,6 +159,7 @@ namespace DeviceLibrary
if (LastCode.Count > 0) if (LastCode.Count > 0)
{ {
MoveInfo.log("扫码完成:"+CodeManager.ProcessCode(LastCode)); MoveInfo.log("扫码完成:"+CodeManager.ProcessCode(LastCode));
break;
} }
else else
{ {
...@@ -192,7 +193,7 @@ namespace DeviceLibrary ...@@ -192,7 +193,7 @@ namespace DeviceLibrary
{ {
while (MoveInfo.MoveStep.Equals(MoveStep.IN03_GetPos)) while (MoveInfo.MoveStep.Equals(MoveStep.IN03_GetPos))
{ {
string shelfRfid = RobotManage.mainMachine.getReadyShelf(); string shelfRfid = RobotManage.mainMachine.getReadyShelf(";");
if (String.IsNullOrEmpty(shelfRfid)) if (String.IsNullOrEmpty(shelfRfid))
{ {
//无可用料架 //无可用料架
......
...@@ -57,18 +57,18 @@ namespace DeviceLibrary ...@@ -57,18 +57,18 @@ namespace DeviceLibrary
if (FixtureConfig.GetFixtureHeight(aCStorePosition.BagWidth, aCStorePosition.BagHigh, out int actualheight)) if (FixtureConfig.GetFixtureHeight(aCStorePosition.BagWidth, aCStorePosition.BagHigh, out int actualheight))
BagHigh = actualheight; BagHigh = actualheight;
Comp_PH = Config.Comp_P2 - Config.Comp_PoToMM * (BagHigh - 70 + Config.Comp_PH_MM); Comp_PH = Config.Comp_P2 - Config.Comp_PoToMM * (BagHigh - 8 + Config.Comp_PH_MM);
int ReelHeight = reel.PlateH; int ReelHeight = reel.PlateH;
if (FixtureConfig.GetFixtureHeight(reel.PlateW, reel.PlateH, out int actualheight1)) if (FixtureConfig.GetFixtureHeight(reel.PlateW, reel.PlateH, out int actualheight1))
ReelHeight = actualheight1; ReelHeight = actualheight1;
Comp_PL = Config.Comp_P2 - Config.Comp_PoToMM * (ReelHeight - 70); Comp_PL = Config.Comp_P2 - Config.Comp_PoToMM * (ReelHeight - 8);
Comp_PH = Comp_PH < 0 ? 0 : Comp_PH; Comp_PH = Comp_PH < 0 ? 0 : Comp_PH;
Comp_PL = Comp_PL < 0 ? 0 : Comp_PL; Comp_PL = Comp_PL < 0 ? 0 : Comp_PL;
posid = aCStorePosition.PositionNum; posid = aCStorePosition.PositionNum;
Reel = reel.clone(); Reel = reel.clone();
LogUtil.info($"BSP:{posid},Comp_PH:{Comp_PH}={Config.Comp_P2}-({BagHigh}-{70}+{Config.Comp_PH_MM})*{Config.Comp_PoToMM},Comp_PL:{Comp_PL}={ReelHeight},{JsonHelper.SerializeObject(this)}"); LogUtil.info($"BSP:{posid},Comp_PH:{Comp_PH}={Config.Comp_P2}-({BagHigh}-{8}+{Config.Comp_PH_MM})*{Config.Comp_PoToMM},Comp_PL:{Comp_PL}={ReelHeight},{JsonHelper.SerializeObject(this)}");
} }
//public const string ngdoor = "单料口"; //public const string ngdoor = "单料口";
......
...@@ -663,9 +663,13 @@ namespace DeviceLibrary ...@@ -663,9 +663,13 @@ namespace DeviceLibrary
{ {
if (bean.ShelfValid()) if (bean.ShelfValid())
{ {
rfid += bean.CurrShelf.realRFID; rfid += bean.CurrShelf.realRFID+split;
} }
} }
if (rfid.EndsWith(split))
{
rfid = rfid.Substring(0, rfid.Length - 1);
}
return rfid; return rfid;
} }
private DateTime lastEmptyTime = DateTime.Now; private DateTime lastEmptyTime = DateTime.Now;
...@@ -696,7 +700,7 @@ namespace DeviceLibrary ...@@ -696,7 +700,7 @@ namespace DeviceLibrary
ShelfInfo shelf = outShelfBeans[key].CurrShelf; ShelfInfo shelf = outShelfBeans[key].CurrShelf;
if (outShelfBeans[key].ShelfValid()) if (outShelfBeans[key].ShelfValid())
{ {
string realRfid = outShelfBeans[key].CurrShelf.rfid; string realRfid = outShelfBeans[key].CurrShelf.realRFID;
if (emptyMap.TryGetValue(realRfid, out int emptyP)) if (emptyMap.TryGetValue(realRfid, out int emptyP))
{ {
outShelfBeans[key].CurrShelf.EmptyPos = emptyP; outShelfBeans[key].CurrShelf.EmptyPos = emptyP;
......
...@@ -56,6 +56,7 @@ namespace DeviceLibrary ...@@ -56,6 +56,7 @@ namespace DeviceLibrary
//送料到NG //送料到NG
StoreMoveInfo.NewMove(MoveStep.PutReel01_Ready); StoreMoveInfo.NewMove(MoveStep.PutReel01_Ready);
StoreMoveInfo.MoveParam = new ReelParam(tray.barcode, tray.w, tray.h, 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.MoveParam.ReelOnFixture = false;
StoreMoveInfo.log("NG料准备放料:" + StoreMoveInfo.MoveParam.ToStr()); StoreMoveInfo.log("NG料准备放料:" + StoreMoveInfo.MoveParam.ToStr());
break; break;
} }
...@@ -70,6 +71,7 @@ namespace DeviceLibrary ...@@ -70,6 +71,7 @@ namespace DeviceLibrary
//送料到料架 //送料到料架
StoreMoveInfo.NewMove(MoveStep.PutReel01_Ready); StoreMoveInfo.NewMove(MoveStep.PutReel01_Ready);
StoreMoveInfo.MoveParam = new ReelParam(tray.barcode, tray.w, tray.h, 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.MoveParam.ReelOnFixture = false;
StoreMoveInfo.log("出库料准备放料:" + StoreMoveInfo.MoveParam.ToStr()); StoreMoveInfo.log("出库料准备放料:" + StoreMoveInfo.MoveParam.ToStr());
break; break;
} }
......
...@@ -85,9 +85,9 @@ namespace DeviceLibrary ...@@ -85,9 +85,9 @@ namespace DeviceLibrary
{ {
if (CurrShelf.realRFID.Equals(CurrTray.realRfid)) if (CurrShelf.realRFID.Equals(CurrTray.realRfid))
{ {
if (String.IsNullOrEmpty(CurrShelf.rfid)) if (String.IsNullOrEmpty(CurrShelf.xnRfid))
{ {
CurrShelf.rfid = CurrTray.rfid; CurrShelf.xnRfid = CurrTray.rfid;
LogUtil.info(Name + "增加虚拟料架号绑定:" + CurrShelf.ToStr()); LogUtil.info(Name + "增加虚拟料架号绑定:" + CurrShelf.ToStr());
} }
ShelfPosId = CurrTray.getShelfLoc(Name); ShelfPosId = CurrTray.getShelfLoc(Name);
...@@ -95,7 +95,7 @@ namespace DeviceLibrary ...@@ -95,7 +95,7 @@ namespace DeviceLibrary
} }
else if (String.IsNullOrEmpty(CurrTray.realRfid)) else if (String.IsNullOrEmpty(CurrTray.realRfid))
{ {
if ((!CurrShelf.rfid.Equals("")) && CurrShelf.rfid.Equals(CurrTray.rfid)) if ((!CurrShelf.xnRfid.Equals("")) && CurrShelf.xnRfid.Equals(CurrTray.rfid))
{ {
CurrTray.realRfid = CurrShelf.realRFID; CurrTray.realRfid = CurrShelf.realRFID;
ShelfPosId = CurrTray.getShelfLoc(Name); ShelfPosId = CurrTray.getShelfLoc(Name);
...@@ -110,9 +110,9 @@ namespace DeviceLibrary ...@@ -110,9 +110,9 @@ namespace DeviceLibrary
return false; return false;
} }
} }
if (CurrShelf.rfid.Equals("")) if (CurrShelf.xnRfid.Equals(""))
{ {
CurrShelf.rfid = CurrTray.rfid; CurrShelf.xnRfid = CurrTray.rfid;
CurrTray.realRfid = CurrShelf.realRFID; CurrTray.realRfid = CurrShelf.realRFID;
LogUtil.info(Name + "增加虚拟料架号绑定:" + CurrShelf.ToStr()); LogUtil.info(Name + "增加虚拟料架号绑定:" + CurrShelf.ToStr());
ShelfPosId = CurrTray.getShelfLoc(Name); ShelfPosId = CurrTray.getShelfLoc(Name);
...@@ -186,10 +186,11 @@ namespace DeviceLibrary ...@@ -186,10 +186,11 @@ namespace DeviceLibrary
{ {
if (taskInfo.smallEmpty == 0 && taskInfo.bigEmpty == 0) if (taskInfo.smallEmpty == 0 && taskInfo.bigEmpty == 0)
{ {
MoveInfo.NextMoveStep(MoveStep.S10_ShelfReady); //MoveInfo.NextMoveStep(MoveStep.S10_ShelfReady);
//CurrShelf.IsNeedLeave = true;
//当前工单任务已完成,直接送料架离开 //当前工单任务已完成,直接送料架离开
MoveInfo.log("放料完成,当前工单任务已完成,更改料架为需要离开状态:" + taskInfo.ToStr()); MoveInfo.log("放料完成,当前工单任务已完成,剩余空位=0,料架需要离开:" + taskInfo.ToStr());
CurrShelf.IsNeedLeave = true; S21_ShelfNeedLeave("剩余空位=0");
} }
else else
{ {
...@@ -213,7 +214,12 @@ namespace DeviceLibrary ...@@ -213,7 +214,12 @@ namespace DeviceLibrary
else if (locationCylinder.IsLow()) else if (locationCylinder.IsLow())
{ {
if (CheckShelf(IO_VALUE.HIGH)) //如果是料架等待离开
if (CurrShelf != null && CurrShelf.IsNeedLeave)
{
}
else if (CheckShelf(IO_VALUE.HIGH))
{ {
//料架已到位 //料架已到位
MoveInfo.NewMove(MoveStep.S04_WaitTime); MoveInfo.NewMove(MoveStep.S04_WaitTime);
...@@ -317,7 +323,7 @@ namespace DeviceLibrary ...@@ -317,7 +323,7 @@ namespace DeviceLibrary
case MoveStep.S21_ShelfNeedLeave: case MoveStep.S21_ShelfNeedLeave:
MoveInfo.NextMoveStep(MoveStep.S22_WaitAGV); MoveInfo.NextMoveStep(MoveStep.S22_WaitAGV);
AgvClient.NeedLeave(agvId, agvName, CurrShelf.rfid); AgvClient.NeedLeave(agvId, agvName, CurrShelf.realRFID);
MoveInfo.log("呼叫AGV小车,结束"); MoveInfo.log("呼叫AGV小车,结束");
MoveInfo.EndMove(); MoveInfo.EndMove();
break; break;
...@@ -386,7 +392,7 @@ namespace DeviceLibrary ...@@ -386,7 +392,7 @@ namespace DeviceLibrary
MoveInfo.log("读取RFID"); MoveInfo.log("读取RFID");
if (ReadShelfId()) if (ReadShelfId())
{ {
if (CurrShelf.rfid == "") if (CurrShelf.realRFID == "")
{ {
S21_ShelfNeedLeave("未读取到RFID"); S21_ShelfNeedLeave("未读取到RFID");
} }
...@@ -407,6 +413,7 @@ namespace DeviceLibrary ...@@ -407,6 +413,7 @@ namespace DeviceLibrary
{ {
MoveInfo.NewMove(MoveStep.S21_ShelfNeedLeave); MoveInfo.NewMove(MoveStep.S21_ShelfNeedLeave);
locationCylinder.ToLow(MoveInfo); locationCylinder.ToLow(MoveInfo);
CurrShelf.IsNeedLeave = true;
MoveInfo.log("料架[" + CurrShelf.ToStr() + "]需要离开:" + leaveMsg + ",定位气缸下降"); MoveInfo.log("料架[" + CurrShelf.ToStr() + "]需要离开:" + leaveMsg + ",定位气缸下降");
} }
private bool ReadShelfId() private bool ReadShelfId()
...@@ -536,8 +543,9 @@ namespace DeviceLibrary ...@@ -536,8 +543,9 @@ namespace DeviceLibrary
public class ShelfInfo public class ShelfInfo
{ {
//public ShelfTaskInfo TaskInfo = null; //public ShelfTaskInfo TaskInfo = null;
public string realRFID = ""; public string realRFID = "";
public string rfid = ""; public string xnRfid = "";
public bool IsNeedLeave = false; public bool IsNeedLeave = false;
public bool IsBusy = false; public bool IsBusy = false;
public int EmptyPos = 100; public int EmptyPos = 100;
...@@ -545,14 +553,14 @@ namespace DeviceLibrary ...@@ -545,14 +553,14 @@ namespace DeviceLibrary
public ShelfInfo(string shelfId = "", string xnId = "", bool needLeave = false, bool busy = false) public ShelfInfo(string shelfId = "", string xnId = "", bool needLeave = false, bool busy = false)
{ {
this.realRFID = shelfId; this.realRFID = shelfId;
this.rfid = xnId; this.xnRfid = xnId;
this.IsNeedLeave = needLeave; this.IsNeedLeave = needLeave;
this.IsBusy = busy; this.IsBusy = busy;
EmptyPos = 100; EmptyPos = 100;
} }
public string ToStr() public string ToStr()
{ {
string result = "[" + realRFID + "_" + rfid + "]"; string result = "[" + realRFID + "_" + xnRfid + "]";
result += "[空位 " + EmptyPos + "]"; result += "[空位 " + EmptyPos + "]";
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!