Commit 321f205e 几米阳光

1

1 个父辈 615e6b79
...@@ -298,6 +298,8 @@ namespace OnlineStore.AutoInOutStore ...@@ -298,6 +298,8 @@ namespace OnlineStore.AutoInOutStore
lblWaitTragGo.Visible = true; lblWaitTragGo.Visible = true;
btnBatchInStore.Enabled = false; btnBatchInStore.Enabled = false;
btnBatchInStore.Enabled = false; btnBatchInStore.Enabled = false;
btnOpenDoor.Enabled = false;
btnCloseDoor.Enabled = false;
} }
else else
{ {
...@@ -307,19 +309,19 @@ namespace OnlineStore.AutoInOutStore ...@@ -307,19 +309,19 @@ namespace OnlineStore.AutoInOutStore
{ {
lblDoorStatus.Text = "仓门状态:关闭"; lblDoorStatus.Text = "仓门状态:关闭";
UpdateFormDoorStats(false); UpdateFormDoorStats(false);
if (store.StoreMove.MoveType.Equals(StoreMoveType.None) && AutomaticBaiting.StoreMove.MoveType.Equals(StoreMoveType.None)) //if (store.StoreMove.MoveType.Equals(StoreMoveType.None) && AutomaticBaiting.StoreMove.MoveType.Equals(StoreMoveType.None))
{ //{
if (AutomaticBaiting.BatchOutStoreCount > 0) // if (AutomaticBaiting.BatchOutStoreCount > 0)
{ // {
btnGetOutTray.Enabled = true; // btnGetOutTray.Enabled = true;
btnBatchInStore.Enabled = false; // btnBatchInStore.Enabled = false;
} // }
else // else
{ // {
btnGetOutTray.Enabled = false; // btnGetOutTray.Enabled = false;
btnBatchInStore.Enabled = true; // btnBatchInStore.Enabled = true;
} // }
} //}
} }
else else
{ {
...@@ -345,9 +347,11 @@ namespace OnlineStore.AutoInOutStore ...@@ -345,9 +347,11 @@ namespace OnlineStore.AutoInOutStore
private void UpdateFormDoorStats(bool dooIsOpen) private void UpdateFormDoorStats(bool dooIsOpen)
{ {
btnBatchInStore.Enabled = !dooIsOpen; btnOpenDoor.Enabled = !dooIsOpen;
btnBatchInStore.Enabled = dooIsOpen;
btnGetOutTray.Enabled = !dooIsOpen; btnGetOutTray.Enabled = !dooIsOpen;
btnStartBatchInStore.Enabled = dooIsOpen; btnCloseDoor.Enabled = dooIsOpen;
btnBatchReset.Enabled = !dooIsOpen; btnBatchReset.Enabled = !dooIsOpen;
} }
......
...@@ -703,7 +703,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -703,7 +703,7 @@ namespace OnlineStore.DeviceLibrary
//private DateTime preProcessTime = DateTime.Now; //private DateTime preProcessTime = DateTime.Now;
private bool IsChongfu = false; private bool IsChongfu = false;
private Stopwatch stopwatch = new Stopwatch(); private Stopwatch stopwatch = new Stopwatch();
private object TimerLock = ""; //private object TimerLock = "";
protected override void timersTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) protected override void timersTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{ {
...@@ -717,14 +717,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -717,14 +717,12 @@ namespace OnlineStore.DeviceLibrary
{ {
LogUtil.error("主定时器:InProcess已等待" + stopwatch.Elapsed.ToString() + "重新处理"); LogUtil.error("主定时器:InProcess已等待" + stopwatch.Elapsed.ToString() + "重新处理");
IsChongfu = true; IsChongfu = true;
Monitor.Exit(TimerLock);
} }
} }
InProcess = true; InProcess = true;
stopwatch.Restart(); stopwatch.Restart();
if (Monitor.TryEnter(TimerLock))
{
try try
{ {
IoCheckProcess(); IoCheckProcess();
...@@ -747,16 +745,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -747,16 +745,6 @@ namespace OnlineStore.DeviceLibrary
{ {
LOGGER.Error(StoreName + "定时处理出错:" + ex.ToString()); LOGGER.Error(StoreName + "定时处理出错:" + ex.ToString());
} }
finally
{
Monitor.Exit(TimerLock);
}
}
else
{
LOGGER.Error(StoreName + "定时处理未得到锁");
}
IsChongfu = false; IsChongfu = false;
InProcess = false; InProcess = false;
} }
......
...@@ -165,8 +165,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -165,8 +165,8 @@ namespace OnlineStore.DeviceLibrary
break; break;
case StoreMoveStep.AUTO_R03_AutoAxisHome: case StoreMoveStep.AUTO_R03_AutoAxisHome:
//if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.LOW)) if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.LOW))
if (ACServerManager.GetLimitPositiveSingle(StoreManager.Config.Batch_Axis).Equals(1)) //if (ACServerManager.GetLimitPositiveSingle(StoreManager.Config.Batch_Axis).Equals(1))
{ {
LogUtil.info(Name + "复位中: 没有料盘,不需要上料,上料轴回0点"); LogUtil.info(Name + "复位中: 没有料盘,不需要上料,上料轴回0点");
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R04_AutoBack); StoreMove.NextMoveStep(StoreMoveStep.AUTO_R04_AutoBack);
...@@ -366,8 +366,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -366,8 +366,8 @@ namespace OnlineStore.DeviceLibrary
LastSize = 0; LastSize = 0;
LastPosId = ""; LastPosId = "";
SuckingDisc_WorkCount = 0; SuckingDisc_WorkCount = 0;
if (ACServerManager.GetLimitPositiveSingle(StoreManager.Config.Batch_Axis).Equals(0)) // if (ACServerManager.GetLimitPositiveSingle(StoreManager.Config.Batch_Axis).Equals(0))
//if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH)) if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH))
{ {
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I01_ScanCode); StoreMove.NextMoveStep(StoreMoveStep.AUTO_I01_ScanCode);
LogUtil.info(Name + "入料: 开始扫码 "); LogUtil.info(Name + "入料: 开始扫码 ");
......
...@@ -19,7 +19,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -19,7 +19,7 @@ namespace OnlineStore.DeviceLibrary
AutoAxisIsMove = 1; AutoAxisIsMove = 1;
StartMovePosition = ACServerManager.GetActualtPosition(moveAxis.DeviceName, moveAxis.GetAxisValue()); StartMovePosition = ACServerManager.GetActualtPosition(moveAxis.DeviceName, moveAxis.GetAxisValue());
EndMovePosition = StartMovePosition; EndMovePosition = StartMovePosition;
StoreMove.WaitList.Add(WaitResultInfo.WaitAutoAxisStop(moveAxis)); StoreMove.WaitList.Add(WaitResultInfo.WaitBatchAxisStop(moveAxis));
ACServerManager.SpeedMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetSpeed); ACServerManager.SpeedMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetSpeed);
} }
...@@ -247,19 +247,22 @@ namespace OnlineStore.DeviceLibrary ...@@ -247,19 +247,22 @@ namespace OnlineStore.DeviceLibrary
bool result = false; bool result = false;
if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH)) if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH))
{ {
LogUtil.info(wait.ToStr()+"检测到上料机构料盘信号,可以停止运动");
result = true; result = true;
} }
else else
{ {
IO_VALUE LimitN = (IO_VALUE)ACServerManager.GetLimitNegativeSingle(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()); IO_VALUE LimitN = (IO_VALUE)ACServerManager.GetLimitPositiveSingle(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue());
if (LimitN.Equals(IO_VALUE.HIGH)) if (LimitN.Equals(IO_VALUE.HIGH))
{ {
LogUtil.info(wait.ToStr() + "检测到正极限信号,可以停止运动");
result = true; result = true;
} }
} }
if (result) if (result)
{ {
AutoAxisIsMove = 0; AutoAxisIsMove = 0;
LogUtil.info(wait.ToStr() + " 停止运动");
ACServerManager.SuddenStop(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()); ACServerManager.SuddenStop(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue());
} }
return result; return result;
...@@ -294,10 +297,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -294,10 +297,6 @@ namespace OnlineStore.DeviceLibrary
if (codeList.Count <= 0) if (codeList.Count <= 0)
{ {
codeList = CodeManager.CameraScan(); codeList = CodeManager.CameraScan();
}else if(StoreManager.Store.IsDebug)
{
codeList = new List<string>() { "NoCode"};
LogUtil.info(Name+"未扫到二维码,默认为NoCode");
} }
foreach (string str in codeList) foreach (string str in codeList)
{ {
...@@ -307,9 +306,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -307,9 +306,18 @@ namespace OnlineStore.DeviceLibrary
LastCode = message; LastCode = message;
if (LastCode.Equals("")) if (LastCode.Equals(""))
{ {
LastCode = "NoCode";
LogUtil.info(Name + "未扫到二维码,默认为NoCode");
}
if (LastCode.Equals(""))
{
LogUtil.error("未扫到二维码,请拿走料盘"); LogUtil.error("未扫到二维码,请拿走料盘");
WarnMsg = "未扫到二维码,请拿走料盘"; WarnMsg = "未扫到二维码,请拿走料盘";
} }
else
{
LogUtil.info("扫到二维码:" + LastCode);
}
KND.IOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW); KND.IOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW);
// StoreManager.Store.onCodeReceived(message); // StoreManager.Store.onCodeReceived(message);
}); });
......
...@@ -274,10 +274,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -274,10 +274,10 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 10=等待料轴运动 停止 /// 10=等待批量上下料轴运动 停止
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public static WaitResultInfo WaitAutoAxisStop(ConfigMoveAxis moveAxis) public static WaitResultInfo WaitBatchAxisStop(ConfigMoveAxis moveAxis)
{ {
WaitResultInfo wait = new WaitResultInfo(); WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 0; wait.CanWhileMoveCount = 0;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!