Commit 2c170ea6 LN

1

1 个父辈 c5000a07
......@@ -248,12 +248,19 @@ namespace DeviceLibrary
tray = JsonHelper.DeserializeJsonToObject<TrayInfo>(data.data.ToString());
if (tray == null || tray.rfid == "" || tray.rfidLoc == 0)
{
tray = TrayInfo.newNgTray(barcode, "获取位置失败");
//msg = "获取位置失败";
if (tray == null)
{
tray = TrayInfo.newNgTray(barcode, "获取位置失败");
}
tray.ngReel = true;
tray.ngMsg = "获取位置失败";
return tray;
}
}
catch (Exception ex)
{
msg = "http error:" + ex.ToString();
LogUtil.error("http error : " + ex.ToString());
}
//tray.robotNum = robot;
......
......@@ -118,7 +118,7 @@ namespace DeviceLibrary
case MoveStep.IN03_GetPos:
if (GetPosTask == null || GetPosTask.IsCompleted)
{
MoveInfo.NewMove(MoveStep.IN05_ReelReady);
MoveInfo.NextMoveStep(MoveStep.IN05_ReelReady);
MoveInfo.log("料盘已准备好,等待取料");
}
else if (MoveInfo.IsTimeOut(60))
......@@ -143,7 +143,7 @@ namespace DeviceLibrary
{
try
{
MoveInfo.NewMove(MoveStep.IN02_ScanCode);
MoveInfo.NextMoveStep(MoveStep.IN02_ScanCode);
MoveInfo.log("开始扫码");
ScanCodeTask = Task.Factory.StartNew(delegate
{
......@@ -179,7 +179,7 @@ namespace DeviceLibrary
{
try
{
MoveInfo.NewMove(MoveStep.IN03_GetPos);
MoveInfo.NextMoveStep(MoveStep.IN03_GetPos);
string codestr = CodeManager.ProcessCode(LastCode);
if (LastCode.Count <= 0 || codestr.Equals(""))
{
......@@ -211,11 +211,14 @@ namespace DeviceLibrary
if (outMsg.Equals(""))
{
ClearWarnMsg("getLocation");
MoveInfo.log("获取位置成功:" + CurrTray.ToStr());
MoveInfo.log("获取位置完成:" + CurrTray.ToStr());
break;
}
else
{
SetWarnMsg( " getLocation " + outMsg);
MoveInfo.errlog("获取位置失败: " + outMsg + ", 等待3秒后重新获取");
Thread.Sleep(3000);
}
break;
}
......@@ -225,7 +228,7 @@ namespace DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error("IN03_GetPos 扫码出错:", ex);
LogUtil.error("IN03_GetPos 获取库位号出错:", ex);
}
}
......
......@@ -403,7 +403,7 @@ namespace DeviceLibrary
StoreMoveInfo.MoveParam.TargetOutShelf = Setting_Init.R_TargetOutShelf;
StoreMoveInfo.MoveParam.ReelOnFixture = true;
StoreMoveInfo.NewMove(MoveStep.PutReel01_Ready);
StoreMoveInfo.NextMoveStep(MoveStep.PutReel01_Ready);
StoreMoveInfo.log("回原时检测到又滞留物料,设置料已在料叉,重新放料:" + StoreMoveInfo.MoveParam.ToStr()+",重新开始放料");
}
......
......@@ -113,7 +113,7 @@ namespace DeviceLibrary
bool result = boxTransport.Start(null, new BoxStorePosition(Config, targetP, StoreMoveInfo.MoveParam), StoreMoveType.PutReel, true);
if (result)
{
StoreMoveInfo.NewMove(MoveStep.PutReel02_StartM);
StoreMoveInfo.NextMoveStep(MoveStep.PutReel02_StartM);
StoreMoveInfo.log("开始放料(料已在叉子上),保存运行信息:" + StoreMoveInfo.MoveParam.ToStr());
SaveRMoveInfo(StoreMoveInfo.MoveParam);
}
......@@ -125,7 +125,7 @@ namespace DeviceLibrary
bool result = boxTransport.Start(new BoxStorePosition(Config, startP, StoreMoveInfo.MoveParam), new BoxStorePosition(Config, targetP, StoreMoveInfo.MoveParam), StoreMoveType.PutReel, true);
if (result)
{
StoreMoveInfo.NewMove(MoveStep.PutReel02_StartM);
StoreMoveInfo.NextMoveStep(MoveStep.PutReel02_StartM);
StoreMoveInfo.log("开始放料,保存运行信息:" + StoreMoveInfo.MoveParam.ToStr());
SaveRMoveInfo(StoreMoveInfo.MoveParam);
}
......@@ -134,7 +134,7 @@ namespace DeviceLibrary
case MoveStep.PutReel02_StartM:
if (boxTransport.IsTakedReel)
{
StoreMoveInfo.NewMove(MoveStep.PutReel03_GetReelEnd);
StoreMoveInfo.NextMoveStep(MoveStep.PutReel03_GetReelEnd);
StoreMoveInfo.log("取料完成:" + StoreMoveInfo.MoveParam.ToStr());
//入口状态处理
......@@ -149,7 +149,7 @@ namespace DeviceLibrary
case MoveStep.PutReel03_GetReelEnd:
if (boxTransport.IsPutOnOut || boxTransport.IsComplateOrFree)
{
StoreMoveInfo.NewMove(MoveStep.PutReel04_PutReelEnd);
StoreMoveInfo.NextMoveStep(MoveStep.PutReel04_PutReelEnd);
StoreMoveInfo.log("放料完成,清空运行信息:" + StoreMoveInfo.MoveParam.ToStr());
//TODO 通知服务器
......@@ -172,7 +172,7 @@ namespace DeviceLibrary
case MoveStep.PutReel04_PutReelEnd:
if (boxTransport.IsComplateOrFree)
{
StoreMoveInfo.NewMove(MoveStep.PutReel05_End);
StoreMoveInfo.NextMoveStep(MoveStep.PutReel05_End);
StoreMoveInfo.log("放料结束:" + StoreMoveInfo.MoveParam.ToStr());
}
break;
......
......@@ -169,7 +169,7 @@ namespace DeviceLibrary
{
if (ShelfReady())
{
MoveInfo.NewMove(MoveStep.S11_PutReel);
MoveInfo.NextMoveStep(MoveStep.S11_PutReel);
MoveInfo.log("开始放料");
return true;
}
......@@ -230,7 +230,7 @@ namespace DeviceLibrary
else if (IOManager.IOValue(Shelf_Front_Check).Equals(IO_VALUE.HIGH) || IOManager.IOValue(Shelf_Back_Check).Equals(IO_VALUE.HIGH))
{
//默认是进来的料架
MoveInfo.NewMove(MoveStep.S02_LineFRun);
MoveInfo.NextMoveStep(MoveStep.S02_LineFRun);
MoveInfo.log("检测到料架信号,电机正传");
AgvClient.SetToNone(agvId, agvName);
LineFRun();
......@@ -241,7 +241,7 @@ namespace DeviceLibrary
{
//小车已到位
//默认是进来的料架
MoveInfo.NewMove(MoveStep.S02_LineFRun);
MoveInfo.NextMoveStep(MoveStep.S02_LineFRun);
MoveInfo.log("检测到AGV小车,电机正传");
AgvClient.SetToNone(agvId, agvName);
LineFRun();
......@@ -272,11 +272,11 @@ namespace DeviceLibrary
break;
case MoveStep.SR01_LocationDown:
MoveInfo.NewMove(MoveStep.Wait);
MoveInfo.NextMoveStep(MoveStep.Wait);
MoveInfo.log("复位完成");
break;
case MoveStep.S02_LineFRun:
MoveInfo.NewMove(MoveStep.S04_WaitTime);
MoveInfo.NextMoveStep(MoveStep.S04_WaitTime);
MoveInfo.log("检测到料架前端信号,再转动1秒钟");
LineFRun();
//等待后端料格检测
......@@ -293,7 +293,7 @@ namespace DeviceLibrary
}
else
{
MoveInfo.NewMove(MoveStep.S05_LocationUp);
MoveInfo.NextMoveStep(MoveStep.S05_LocationUp);
MoveInfo.log("电机停止,定位气缸上升");
LineStopRun();
locationCylinder.ToHigh(MoveInfo);
......@@ -411,7 +411,7 @@ namespace DeviceLibrary
private void S21_ShelfNeedLeave(string leaveMsg)
{
MoveInfo.NewMove(MoveStep.S21_ShelfNeedLeave);
MoveInfo.NextMoveStep(MoveStep.S21_ShelfNeedLeave);
locationCylinder.ToLow(MoveInfo);
CurrShelf.IsNeedLeave = true;
MoveInfo.log("料架[" + CurrShelf.ToStr() + "]需要离开:" + leaveMsg + ",定位气缸下降");
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!