Commit dd1c87f4 刘韬

1

1 个父辈 254093c8
...@@ -241,7 +241,10 @@ namespace DeviceLibrary ...@@ -241,7 +241,10 @@ namespace DeviceLibrary
} }
if (resultOperation.op.Equals(1)) if (resultOperation.op.Equals(1))
{ {
ReviceInStoreProcess(resultOperation.data["barcode"], resultOperation); var barcode = "";
if (resultOperation.data.ContainsKey(barcode))
barcode = resultOperation.data["barcode"];
ReviceInStoreProcess(barcode, resultOperation);
} }
else if (resultOperation.op.Equals(2)) else if (resultOperation.op.Equals(2))
{ {
...@@ -284,7 +287,7 @@ namespace DeviceLibrary ...@@ -284,7 +287,7 @@ namespace DeviceLibrary
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因 //出入库没有找到服务器发送的库位,需要打印日志方便查询原因
//SetWarnMsg(ResourceControl.InStoreNoPosition, message, posId); //SetWarnMsg(ResourceControl.InStoreNoPosition, message, posId);
WarnMsg = "入库未找到库位:二维码【" + message + "】库位【" + posId + "】 "; WarnMsg = "入库未找到库位:二维码【" + message + "】库位【" + posId + "】 ";
LogUtil.info( "收到服务器入库命令:入库未找到库位:二维码【" + message + "】库位【" + posId + "】"); LogUtil.info("收到服务器入库命令:入库未找到库位:二维码【" + message + "】库位【" + posId + "】");
return; return;
} }
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器; //TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
...@@ -301,6 +304,12 @@ namespace DeviceLibrary ...@@ -301,6 +304,12 @@ namespace DeviceLibrary
SendStoreState("", StoreStatus.InStoreError); SendStoreState("", StoreStatus.InStoreError);
} }
} }
else if (RobotManage.mainMachine.InMoveInfo.MoveStep==MoveStep.InWaitServerCallback)
{
SendStoreState("", StoreStatus.InStoreError);
RobotManage.mainMachine.InMoveInfo.NewMove(MoveStep.Wait);
LogUtil.info("服务器没有正确返回库位.");
}
} }
......
...@@ -23,6 +23,7 @@ namespace DeviceLibrary ...@@ -23,6 +23,7 @@ namespace DeviceLibrary
/// </summary> /// </summary>
public event Func<int,int,(bool,string)> interference; public event Func<int,int,(bool,string)> interference;
public string AxisName; public string AxisName;
public bool ForceSafeCheck = false;
public AxisBean(ConfigMoveAxis axisConfig, string deviceName) public AxisBean(ConfigMoveAxis axisConfig, string deviceName)
{ {
this.Config = axisConfig; this.Config = axisConfig;
...@@ -112,6 +113,14 @@ namespace DeviceLibrary ...@@ -112,6 +113,14 @@ namespace DeviceLibrary
if (IsInPosition(targetPosition)) if (IsInPosition(targetPosition))
return; return;
if (ForceSafeCheck && !IsSafe(targetPosition,out string msg))
{
Msg.add(msg, MsgLevel.alarm);
RobotManage.UserPause(msg);
return;
}
if (MoveInfo == null) if (MoveInfo == null)
{ {
AbsMove(targetPosition, targetSpeed); AbsMove(targetPosition, targetSpeed);
......
...@@ -65,6 +65,8 @@ namespace DeviceLibrary ...@@ -65,6 +65,8 @@ namespace DeviceLibrary
MoveInfo.NewMove(MoveStep.StoreTS01); MoveInfo.NewMove(MoveStep.StoreTS01);
MoveInfo.log($"{storeMoveType}:开始运输周转箱,从:{from.posid},到:{to.posid}"); MoveInfo.log($"{storeMoveType}:开始运输周转箱,从:{from.posid},到:{to.posid}");
} }
MoveInfo.MoveParam.WareCode = WareCode;
MoveInfo.MoveParam.PosID = $"{From.posid}=>{To.posid}";
ErrMsgTxt = ""; ErrMsgTxt = "";
return true; return true;
//thread = new Thread(new ThreadStart(Run)); //thread = new Thread(new ThreadStart(Run));
......
...@@ -177,7 +177,7 @@ namespace DeviceLibrary ...@@ -177,7 +177,7 @@ namespace DeviceLibrary
} }
break; break;
case MoveStep.In07: case MoveStep.In07:
if (IOValue(IO_Type.InOverHead_Check).Equals(IO_VALUE.LOW)) { if (RobotManage.StoreType == StoreType.TypeA && IOValue(IO_Type.InOverHead_Check).Equals(IO_VALUE.LOW)) {
LineIn.LineStop("work"); LineIn.LineStop("work");
InMoveInfo.log($"X18检测到物料超高,停止滚筒"); InMoveInfo.log($"X18检测到物料超高,停止滚筒");
InMoveInfo.NextMoveStep(MoveStep.InOverHead); InMoveInfo.NextMoveStep(MoveStep.InOverHead);
......
...@@ -97,6 +97,7 @@ namespace DeviceLibrary ...@@ -97,6 +97,7 @@ namespace DeviceLibrary
#region 初始化伺服轴 #region 初始化伺服轴
XAxis = new AxisBean(Config.XAxis, Name); XAxis = new AxisBean(Config.XAxis, Name);
XAxis.interference += XAxis_interference; XAxis.interference += XAxis_interference;
XAxis.ForceSafeCheck = true;
YAxis = new AxisBean(Config.YAxis, Name); YAxis = new AxisBean(Config.YAxis, Name);
YAxis.interference += YAxis_interference; YAxis.interference += YAxis_interference;
ZAxis = new AxisBean(Config.ZAxis, Name); ZAxis = new AxisBean(Config.ZAxis, Name);
...@@ -296,23 +297,27 @@ namespace DeviceLibrary ...@@ -296,23 +297,27 @@ namespace DeviceLibrary
return; return;
} }
ResetMoveInfo.NextMoveStep(MoveStep.H03_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H03_HomeReset);
ResetMoveInfo.log("开始回原,行走机构,回原"); ResetMoveInfo.log("正在回原,料叉P1待机点");
XAxis.HomeMove(ResetMoveInfo, forceHome); ZAxis.AbsMove(ResetMoveInfo, Config.Zaxis_P1, Config.Zaxis_P1_speed);
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500)); ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
break; break;
case MoveStep.H03_HomeReset: case MoveStep.H03_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H04_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H04_HomeReset);
YAxis.HomeMove(ResetMoveInfo, forceHome); ResetMoveInfo.log("开始回原,行走机构,回原");
ResetMoveInfo.log("正在回原 ,升降轴,回原"); XAxis.HomeMove(ResetMoveInfo, forceHome);
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
break; break;
case MoveStep.H04_HomeReset: case MoveStep.H04_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H05_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H05_HomeReset);
ResetMoveInfo.log("正在回原,料叉P1待机点"); YAxis.HomeMove(ResetMoveInfo, forceHome);
XAxis.AbsMove(ResetMoveInfo, Config.Zaxis_P1, Config.Zaxis_P1_speed); ResetMoveInfo.log("正在回原 ,升降轴,回原");
break; break;
case MoveStep.H05_HomeReset: case MoveStep.H05_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H06_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H06_HomeReset);
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
break;
case MoveStep.H06_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H07_HomeReset);
ResetMoveInfo.log("正在回原,行走机构,升降轴,到P1待机点,入口顶升下降,出口顶升上升"); ResetMoveInfo.log("正在回原,行走机构,升降轴,到P1待机点,入口顶升下降,出口顶升上升");
YAxis.AbsMove(ResetMoveInfo, Config.Yaxis_P1,Config.Yaxis_P1_speed); YAxis.AbsMove(ResetMoveInfo, Config.Yaxis_P1,Config.Yaxis_P1_speed);
XAxis.AbsMove(ResetMoveInfo, Config.Xaxis_P1,Config.Xaxis_P1_speed); XAxis.AbsMove(ResetMoveInfo, Config.Xaxis_P1,Config.Xaxis_P1_speed);
...@@ -322,10 +327,10 @@ namespace DeviceLibrary ...@@ -322,10 +327,10 @@ namespace DeviceLibrary
CylinderMove(InMoveInfo, IO_Type.OutStop_Down, IO_Type.OutStop_Up, IO_VALUE.HIGH); CylinderMove(InMoveInfo, IO_Type.OutStop_Down, IO_Type.OutStop_Up, IO_VALUE.HIGH);
CylinderMove(InMoveInfo, IO_Type.OutExitStop_Down, IO_Type.OutExitStop_Up, IO_VALUE.HIGH); CylinderMove(InMoveInfo, IO_Type.OutExitStop_Down, IO_Type.OutExitStop_Up, IO_VALUE.HIGH);
break; break;
case MoveStep.H06_HomeReset: case MoveStep.H07_HomeReset:
if (IOValue(IO_Type.ForkMaterial_Check).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.ForkMaterial_Check).Equals(IO_VALUE.HIGH))
{ {
ResetMoveInfo.NextMoveStep(MoveStep.H07_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H08_HomeReset);
ResetMoveInfo.log("进出轴X09上有周转箱"); ResetMoveInfo.log("进出轴X09上有周转箱");
} }
...@@ -341,15 +346,15 @@ namespace DeviceLibrary ...@@ -341,15 +346,15 @@ namespace DeviceLibrary
ResetMoveInfo.log("进出轴上没有周转箱"); ResetMoveInfo.log("进出轴上没有周转箱");
} }
break; break;
case MoveStep.H07_HomeReset: case MoveStep.H08_HomeReset:
if (OutMoveInfo.MoveStep == MoveStep.Wait && IsOutLiftEmpty) { if (OutMoveInfo.MoveStep == MoveStep.Wait && IsOutLiftEmpty) {
ResetMoveInfo.NextMoveStep(MoveStep.H08_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H09_HomeReset);
boxTransport.Start(null, new BoxStorePosition(Config, StoreSide.B), StoreMoveType.ReturnHome, "ReturnHome"); boxTransport.Start(null, new BoxStorePosition(Config, StoreSide.B), StoreMoveType.ReturnHome, "ReturnHome");
ResetMoveInfo.log("进出轴上有周转箱,开始送到出口"); ResetMoveInfo.log("进出轴上有周转箱,开始送到出口");
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100)); ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
} }
break; break;
case MoveStep.H08_HomeReset: case MoveStep.H09_HomeReset:
boxTransport.Process(); boxTransport.Process();
if (boxTransport.IsComplateOrFree) if (boxTransport.IsComplateOrFree)
{ {
......
...@@ -20,6 +20,7 @@ namespace DeviceLibrary ...@@ -20,6 +20,7 @@ namespace DeviceLibrary
H06_HomeReset, H06_HomeReset,
H07_HomeReset, H07_HomeReset,
H08_HomeReset, H08_HomeReset,
H09_HomeReset,
HEND_HomeReset, HEND_HomeReset,
InPre01, InPre01,
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!