Commit f7c25fd2 LN

叉子前进前增加验证。

1 个父辈 536c7edc
......@@ -252,7 +252,7 @@ namespace OnlineStore.ACSingleStore
string msg = "等待入库:";
foreach (string s in list)
{
msg += s + "\t";
msg += s + " ";
}
lblWarnMsg.Text = msg;
}
......
......@@ -32,20 +32,20 @@ namespace OnlineStore.Common
return;
}
log.Info(log.Logger.Name + " - " + msg);
log.Info( msg);
AddToBox(msg, Color.Black);
//clear();
}
public static void info(ILog log,string msg, Color color)
{
log.Info(log.Logger.Name + " - " + msg);
log.Info( msg);
AddToBox(msg, color);
}
public static void debug(ILog log, string msg, Color color)
{
log.Debug(log.Logger.Name + " - " + msg);
log.Debug( msg);
if (debug_opened)
{
AddToBox(msg, color);
......@@ -53,7 +53,7 @@ namespace OnlineStore.Common
}
public static void debug(ILog log, string msg)
{
log.Debug(log.Logger.Name + " - " + msg);
log.Debug( msg);
if (debug_opened)
{
AddToBox(msg, Color.Gray);
......@@ -93,7 +93,7 @@ namespace OnlineStore.Common
}
public static void error(ILog log, string errorMsg)
{
log.Error(log.Logger.Name + " - " + errorMsg);
log.Error( errorMsg);
AddToBox(errorMsg, Color.Red);
}
private static void AddToBox(string msg, Color color)
......
......@@ -406,16 +406,24 @@ namespace OnlineStore.DeviceLibrary
OpenAndCloseSTB(portName, slvAddr);
}
public static bool isInPosition(ConfigMoveAxis Axis, int PPosition)
public static bool isInPosition(ConfigMoveAxis Axis, int PPosition,bool isLog=false )
{
int outCount = ACServerManager.GetActualtPosition(Axis.DeviceName, Axis.GetAxisValue());
int errorCount = Math.Abs(outCount - PPosition);
int errorCount = Math.Abs(outCount - PPosition);
if (errorCount <= Axis.CanErrorCountMin)
{
if (isLog)
{
LogUtil.info("【" + Axis.GetNameStr() + "】isInPosition【" + PPosition + "】,当前实时位置:【" + outCount + "】 return true");
}
return true;
}
else
{
if (isLog)
{
LogUtil.info("【" + Axis.GetNameStr() + "】isInPosition【" + PPosition + "】,当前实时位置:【" + outCount + "】 return false");
}
return false;
}
}
......
......@@ -344,9 +344,25 @@ namespace OnlineStore.DeviceLibrary
StoreMove.NextMoveStep(StoreMoveStep.SI_02_InOutAxisHome);
OpenDoor();
InOutBackToP1(moveP.InOut_P1);
}
}
private void SI_05_DeviceToDoor()
{
if (!ACServerManager.isInPosition(Config.UpDown_Axis, StoreMove.MoveParam.MoveP.UpDown_P1,true))
{
StoreMove.NextMoveStep(StoreMoveStep.SI_03_ReturnHome);
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(500));
InStoreLog("入库:SI_03已结束,发现升降轴不在待机点,重新运动 升降轴到P1 [" + StoreMove.MoveParam.MoveP.UpDown_P1 + "] ");
ACAxisMove(Config.UpDown_Axis, StoreMove.MoveParam.MoveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
return;
}
if (!ACServerManager.isInPosition(Config.Middle_Axis, StoreMove.MoveParam.MoveP.Middle_P1))
{
StoreMove.NextMoveStep(StoreMoveStep.SI_03_ReturnHome);
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(500));
InStoreLog("入库:SI_03已结束,发现旋转轴不在待机点,重新运动 旋转轴到P1 [" + StoreMove.MoveParam.MoveP.Middle_P1 + "]");
ACAxisMove(Config.Middle_Axis, StoreMove.MoveParam.MoveP.Middle_P1, Config.MiddleAxis_P1_Speed);
return;
}
if (DoorIsOpen())
{
//判断仓门是否打开
......@@ -412,39 +428,38 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(CodeMsg);
}
StoreMove.NextMoveStep(StoreMoveStep.SI_03_ReturnHome);
InStoreLog("入库:SI_03 所有轴回到待机点,升降轴到P1 [" + moveP.UpDown_P1 + "],旋转轴到P1 [" + moveP.Middle_P1 + "],,压紧轴到P3 [" + moveP.ComPress_P3 + "]");
InStoreLog("入库:SI_03 所有轴回到待机点,升降轴到P1 [" + moveP.UpDown_P1 + "],旋转轴到P1 [" + moveP.Middle_P1 + "],,压紧轴到P3 [" + moveP.ComPress_P3 + "],打开仓门");
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(1000));
ComMoveToPosition(moveP.ComPress_P3, Config.CompAxis_P3_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_03_ReturnHome)
{
if (!ACServerManager.isInPosition(Config.UpDown_Axis, moveP.UpDown_P1))
{
StoreMove.NextMoveStep(StoreMoveStep.SI_03_ReturnHome);
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(500));
InStoreLog("入库:SI_03已结束,发现升降轴不在待机点,重新运动 升降轴到P1 [" + moveP.UpDown_P1 + "] ");
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
return;
}
else
{
InStoreLog("入库:SI_03 升降轴已在P1[" + moveP.UpDown_P1 + "]");
}
if (!ACServerManager.isInPosition(Config.Middle_Axis, moveP.Middle_P1))
{
StoreMove.NextMoveStep(StoreMoveStep.SI_03_ReturnHome);
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(500));
InStoreLog("入库:SI_03已结束,发现旋转轴不在待机点,重新运动 旋转轴到P1 [" + moveP.Middle_P1 + "]");
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
return;
}
if (IsHasCompress_Axis)
else
{
StoreMove.NextMoveStep(StoreMoveStep.SI_04_CompressWare);
InStoreLog("入库:SI_04_CompressWare 压紧轴至P3(压紧前点)[" + moveP.ComPress_P3 + "] 开始");
ComMoveToPosition(moveP.ComPress_P3, Config.CompAxis_P3_Speed);
OpenDoor();
InStoreLog("入库:SI_03 旋转轴已在P1 [" + moveP.Middle_P1 + "]");
}
else
OpenDoor();
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_03_ReturnHome)
{
//if (IsHasCompress_Axis)
//{
//StoreMove.NextMoveStep(StoreMoveStep.SI_04_CompressWare);
//InStoreLog("入库:SI_04_CompressWare 压紧轴至P3(压紧前点)[" + moveP.ComPress_P3 + "] 开始");
//ComMoveToPosition(moveP.ComPress_P3, Config.CompAxis_P3_Speed);
//OpenDoor();
//}
//else
{
SI_05_DeviceToDoor();
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!