Commit a9301e4f LN

1

1 个父辈 ce40dc4c
......@@ -20,7 +20,7 @@
<add key="Store_Position_Config" value="\StoreConfig\AC\linePositions.csv"/>
<add key="Store_ConfigPath" value="\StoreConfig\AC\StoreConfig.csv"/>
<add key="Store_Type" value="RC_AC_SA"/>
<add key="Store_CID" value="rc1246ac-4"/>
<add key="Store_CID" value="rc1250ac-4"/>
<add key ="Store_ID" value ="4"/>
<!--end one store config-->
<add key="ACBaudRate" value="115200" />
......@@ -40,7 +40,7 @@
</appSettings>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="logs/ACStore-RC1246-1.log"/>
<file value="logs/ACStore-RC1250-1.log"/>
<param name="Encoding" value="UTF-8" />
<appendToFile value="true"/>
<rollingStyle value="Date"/>
......
......@@ -465,10 +465,10 @@ namespace OnlineStore.DeviceLibrary
return value;
}
private Box_Addr GetAddr(ushort StartAddress)
{
return (Box_Addr)(StartAddress);
}
//private Box_Addr GetAddr(ushort StartAddress)
//{
// return (Box_Addr)(StartAddress);
//}
private Box_Sta GetBox_Sta(IO_VALUE onOff)
{
if (onOff.Equals(IO_VALUE.HIGH))
......
......@@ -1002,7 +1002,8 @@ namespace OnlineStore.DeviceLibrary
{
try
{
if (CurrInOutACount >= this.Config.Box_ResetACount)
bool noInStore = LineConnect.WaitInStoreList.Count <= 0;
if (CurrInOutACount >= this.Config.Box_ResetACount &&noInStore)
{
if (storeRunStatus < StoreRunStatus.Runing || StoreMove.MoveType == StoreMoveType.InStore || StoreMove.MoveType == StoreMoveType.OutStore)
{
......@@ -1014,7 +1015,7 @@ namespace OnlineStore.DeviceLibrary
Reset();
}
}
else if (CurrInOutCount >= this.Config.Box_ResetMCount)
else if (CurrInOutCount >= this.Config.Box_ResetMCount && noInStore)
{
if (storeRunStatus < StoreRunStatus.Runing || StoreMove.MoveType == StoreMoveType.InStore || StoreMove.MoveType == StoreMoveType.OutStore)
{
......@@ -1522,11 +1523,6 @@ namespace OnlineStore.DeviceLibrary
lineOperation.msg = "叉子料盘检测有料,请检查";
}
}
if (boxStatus.msg.Equals("") && IOManager.IOValue(IO_Type.DoorLimit).Equals(IO_VALUE.LOW))
{
boxStatus.msg = "未检测到门禁信号,请检查";
lineOperation.msg = "未检测到门禁信号,请检查";
}
CodeMsg = "";
//WarnMsg = "";
//状态
......
......@@ -151,7 +151,7 @@ namespace OnlineStore.DeviceLibrary
{
wait.IsEnd = IOManager.IOValue(wait.IoType).Equals(wait.IoValue);
int timeOutMs = Config.IOSingle_TimerOut;
if (StoreMove.MoveStep == StoreMoveStep.SO_14_WaitTake)
if (StoreMove.MoveStep .Equals( StoreMoveStep.SO_14_WaitTake))
{
timeOutMs = 650000;
}
......@@ -164,6 +164,11 @@ namespace OnlineStore.DeviceLibrary
isOk = false;
break;
}
else if ((!wait.IsEnd) && StoreMove.MoveStep.Equals(StoreMoveStep.SO_14_WaitTake) && LineConnect.CanReSend())
{
//判断是否需要重发入库结束命令
SendOutStoreEnd(StoreMove);
}
}
else if (wait.WaitType == 3)
{
......@@ -651,17 +656,7 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
CloseDoor();
//发送消息给流水线
int hasTray =(int) IOManager.IOValue(IO_Type.TrayCheck_Door);
int ss = (int)storeStatus;
if (IsDebug)
{
ss = (int)StoreStatus.Debugging;
}
StoreSendBean store = new StoreSendBean(Config.Id, Config.CID, (int)storeStatus, (int)storeRunStatus, hasTray, (int)alarmType);
store.PosId = StoreMove.MoveParam.PositionNum;
store.PlateH = StoreMove.MoveParam.PlateH;
store.PlateW = StoreMove.MoveParam.PlateW;
LineConnect.OutStoreEnd(store);
SendOutStoreEnd(StoreMove);
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_13_GoBack)
{
......@@ -695,6 +690,22 @@ namespace OnlineStore.DeviceLibrary
}
}
private void SendOutStoreEnd(StoreMoveInfo storeMove)
{
int hasTray = (int)IOManager.IOValue(IO_Type.TrayCheck_Door);
int ss = (int)storeStatus;
if (IsDebug)
{
ss = (int)StoreStatus.Debugging;
}
StoreSendBean store = new StoreSendBean(Config.Id, Config.CID, (int)storeStatus, (int)storeRunStatus, hasTray, (int)alarmType);
store.PosId = StoreMove.MoveParam.PositionNum;
store.PlateH = StoreMove.MoveParam.PlateH;
store.PlateW = StoreMove.MoveParam.PlateW;
LineConnect.OutStoreEnd(store);
}
private void SO_10_DeviceToDoorPro()
{
LineMoveP moveP = StoreMove.MoveParam.MoveP;
......
......@@ -64,7 +64,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error("SendHeart 出错:" + ex.ToString());
}
}
private static DateTime LastOutStoreEndTime = DateTime.Now;
public static void OutStoreEnd(StoreSendBean store)
{
if (client == null)
......@@ -73,6 +73,7 @@ namespace OnlineStore.DeviceLibrary
}
try
{
LastOutStoreEndTime = DateTime.Now;
store.Cmd = cmd_outend;
string msg = ToParamStr(store);
LogUtil.info("OutStoreEnd:" + msg);
......@@ -180,6 +181,19 @@ namespace OnlineStore.DeviceLibrary
}
return false;
}
/// <summary>
/// 是否可以重发消息
/// </summary>
/// <returns></returns>
public static bool CanReSend()
{
TimeSpan span = DateTime.Now - LastOutStoreEndTime;
if (span.TotalSeconds > 8)
{
return true;
}
return false;
}
}
public class StoreReviceBean
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!