Commit 16cf7bbc 几米阳光

出入库流程优化

1 个父辈 f28a4149
...@@ -1720,21 +1720,24 @@ namespace OnlineStore.AutoInOutStore ...@@ -1720,21 +1720,24 @@ namespace OnlineStore.AutoInOutStore
string poText = cmbPosition.Text; string poText = cmbPosition.Text;
ConfigAppSettings.SaveValue(Setting_Init.DebugPosId, poText); ConfigAppSettings.SaveValue(Setting_Init.DebugPosId, poText);
store.autoMsg = "自动入库:" + poText; store.autoMsg = "自动出入库:" + poText;
string msg = AutomaticBaiting.doStartBatchIn(); store.autoNext = true;
if (msg.Equals("")) LogUtil.info(LOGGER, store.StoreName + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + "");
{ btnStart.Text = StopAuto;
store.autoNext = true; //string msg = AutomaticBaiting.doStartBatchIn();
btnStart.Text = StopAuto; //if (msg.Equals(""))
LogUtil.info(LOGGER, store.StoreName + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!"); //{
} // store.autoNext = true;
else // btnStart.Text = StopAuto;
{ // LogUtil.info(LOGGER, store.StoreName + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!");
MessageBox.Show(msg); //}
store.autoNext = false; //else
btnStart.Text = StartAuto; //{
LogUtil.info(LOGGER, store.StoreName + "自动出入库失败【"+msg+"】,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!"); // MessageBox.Show(msg);
} // store.autoNext = false;
// btnStart.Text = StartAuto;
// LogUtil.info(LOGGER, store.StoreName + "自动出入库失败【"+msg+"】,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!");
//}
DebugStatus(false); DebugStatus(false);
} }
} }
......
...@@ -250,6 +250,6 @@ namespace OnlineStore.Common ...@@ -250,6 +250,6 @@ namespace OnlineStore.Common
/// </summary> /// </summary>
public static string batchAxis = "device_batchAxis"; public static string batchAxis = "device_batchAxis";
public static string posName = "posName"; public static string inPos = "inPos";
} }
} }
using OnlineStore.Common; using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO.Ports; using System.IO.Ports;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
namespace OnlineStore.DeviceLibrary namespace OnlineStore.DeviceLibrary
{ {
...@@ -390,6 +391,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -390,6 +391,21 @@ namespace OnlineStore.DeviceLibrary
//Thread.Sleep(SleepMSendons); //Thread.Sleep(SleepMSendons);
OpenAndCloseSTB(portName, slvAddr); OpenAndCloseSTB(portName, slvAddr);
} }
public static bool isInPosition(ConfigMoveAxis Axis, int PPosition)
{
int outCount = ACServerManager.GetActualtPosition(Axis.DeviceName, Axis.GetAxisValue());
int errorCount = Math.Abs(outCount - PPosition);
if (errorCount <= Axis.CanErrorCountMin)
{
return true;
}
else
{
return false;
}
}
public static void AbsMove(string portName, int slvAddr, int targetPosition, int targetSpeed) public static void AbsMove(string portName, int slvAddr, int targetPosition, int targetSpeed)
{ {
//先更新速度 //先更新速度
......
...@@ -341,7 +341,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -341,7 +341,19 @@ namespace OnlineStore.DeviceLibrary
byte[] reviceData = SendData(slvAddr, ShuoKeCMD.GetAbsPosition, 0x00, 0, 9); byte[] reviceData = SendData(slvAddr, ShuoKeCMD.GetAbsPosition, 0x00, 0, 9);
return DataToPosition(reviceData); return DataToPosition(reviceData);
} }
public static bool IsInPosition(int slvAddr,int position)
{
int outCount = GetABSPosition(slvAddr);
int errorCount = Math.Abs(outCount - position);
if (errorCount <= 100)
{
return true;
}
else
{
return false;
}
}
// <param name="homeType">0=反方向,1=正方向</param> // <param name="homeType">0=反方向,1=正方向</param>
public static void HomeMove(int slvAddr, byte homeType) public static void HomeMove(int slvAddr, byte homeType)
{ {
......
...@@ -1348,12 +1348,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1348,12 +1348,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public bool CanStarInOut() public bool CanStarInOut()
{ {
//if (isInSuddenDown || isNoAirCheck ||
// (!storeRunStatus.Equals(StoreRunStatus.Runing))
// || storeStatus.Equals(StoreStatus.InStoreExecute) || storeStatus.Equals(StoreStatus.OutStoreExecute)
// || storeStatus.Equals(StoreStatus.InStoreEnd) || storeStatus.Equals(StoreStatus.OutStoreBoxEnd))
if ((isInSuddenDown.Equals(false)) && (isNoAirCheck.Equals(false)) && (StoreMove.MoveType.Equals(StoreMoveType.None)) if ((isInSuddenDown.Equals(false)) && (isNoAirCheck.Equals(false)) && (StoreMove.MoveType.Equals(StoreMoveType.None))
&& (storeRunStatus.Equals(StoreRunStatus.Runing))) && (storeRunStatus.Equals(StoreRunStatus.Runing)))
{ {
......
...@@ -333,8 +333,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -333,8 +333,9 @@ namespace OnlineStore.DeviceLibrary
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I06_SuckingDisc_Up); StoreMove.NextMoveStep(StoreMoveStep.AUTO_I06_SuckingDisc_Up);
LogUtil.info(Name + "入料: 吸盘上升"); LogUtil.info(Name + "入料: 吸盘上升");
CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down, true); CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down, false );
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SuckingDisc_Down, IO_VALUE.LOW)); StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SuckingDisc_Down, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(1500));
} }
else if (SuckingDisc_WorkCount < 3) else if (SuckingDisc_WorkCount < 3)
......
...@@ -232,19 +232,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -232,19 +232,15 @@ namespace OnlineStore.DeviceLibrary
LogUtil.debug(wait.ToStr() + " 检测到【" + wait.IoType + "】信号,可以停止运动"); LogUtil.debug(wait.ToStr() + " 检测到【" + wait.IoType + "】信号,可以停止运动");
result = true; result = true;
} }
else if (IOManager.IOValue(IO_Type.BatchAxis_Limit).Equals(IO_VALUE.HIGH)) else if (IOManager.IOValue(IO_Type.BatchAxis_Limit).Equals(IO_VALUE.HIGH))
//else if (ACServerManager.GetLimitPositiveSingle(wait.AxisInfo).Equals(1))
{ {
LogUtil.debug(wait.ToStr() + " 检测到正极限信号,可以停止运动"); LogUtil.debug(wait.ToStr() + " 检测到正极限信号,可以停止运动");
//ACServerManager.SuddenStop(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue());
//Thread.Sleep(50);
result = true; result = true;
} }
if (result) if (result)
{ {
//AutoAxisIsMove = 0;
LogUtil.debug(wait.ToStr() + " 停止运动"); LogUtil.debug(wait.ToStr() + " 停止运动");
ACServerManager.SuddenStop(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()); ACServerManager.SuddenStop(wait.AxisInfo);
} }
return result; return result;
} }
...@@ -389,7 +385,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -389,7 +385,7 @@ namespace OnlineStore.DeviceLibrary
string autoposId = StoreManager.Store.GetAutoPosid(true); string autoposId = StoreManager.Store.GetAutoPosid(true);
if (StoreManager.Store.autoNext && (!String.IsNullOrEmpty(autoposId))) if (StoreManager.Store.autoNext && (!String.IsNullOrEmpty(autoposId)))
{ {
operation.data.Add(ParamDefine.posName, autoposId); operation.data.Add(ParamDefine.inPos, autoposId);
LogUtil.info("添加自动入库库位号:"+autoposId); LogUtil.info("添加自动入库库位号:"+autoposId);
} }
string server = ConfigAppSettings.GetValue(Setting_Init.http_server); string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!