Commit e8dd2942 张东亮

更新包装仓入库逻辑(针对料盘尺寸与料仓不匹配情况)

1 个父辈 3e714c06
此文件的差异太大,无法显示。
......@@ -24,7 +24,7 @@ namespace OnlineStore.ACPackingStore
{
public AC_BOX_Bean BoxBean = null;
// public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public FrmBox()
{
Control.CheckForIllegalCrossThreadCalls = false;
......@@ -49,7 +49,7 @@ namespace OnlineStore.ACPackingStore
{
if (BoxBean == null)
{
LogUtil.error( "找不到对应的料仓");
LogUtil.error("找不到对应的料仓");
this.Close();
return;
}
......@@ -99,18 +99,19 @@ namespace OnlineStore.ACPackingStore
txtInoutP11.Text = BoxBean.Config.InOutAxis_P11_Position.ToString();
//txtInOutP2.Text = BoxBean.Config.InOutAxis_DoorPosition_P2.ToString();
txtUpDownP1.Text = BoxBean.Config.UpDownAxis_P1.ToString();
LoadPData(ktkPosition);
LoadPData(ktkPosition);
chbDebug.Checked = BoxBean.IsDebug;
this.ShowInTaskbar = true;
try
{
int num =Convert.ToInt32( BoxBean.CID.Substring(BoxBean.CID.Length - 2, 2));
int num = Convert.ToInt32(BoxBean.CID.Substring(BoxBean.CID.Length - 2, 2));
if (num >= 18 && num <= 24)
{
numericUpDown1.Value = num;
}
}catch(Exception ex)
}
catch (Exception ex)
{
}
......@@ -152,14 +153,14 @@ namespace OnlineStore.ACPackingStore
LoadOk = true;
}
lblTemp.Text = BoxBean.humBean.currTempStr;
lblWarnMsg.Text = BoxBean.GetWarnMsg();
lblMoveInfo.Text = BoxBean.GetMoveStr();
if ( BoxBean.MoveInfo.MoveType.Equals(StoreMoveType.InStore))
{
if (BoxBean.MoveInfo.MoveType.Equals(StoreMoveType.InStore))
{
lblMoveEquipInfo.Text = "入库:" + BoxBean.MoveInfo.MoveParam.ToShortStr();
}
else if (BoxBean.MoveInfo.MoveType.Equals(StoreMoveType.OutStore) )
else if (BoxBean.MoveInfo.MoveType.Equals(StoreMoveType.OutStore))
{
lblMoveEquipInfo.Text = "出库:" + BoxBean.MoveInfo.MoveParam.ToShortStr();
}
......@@ -241,6 +242,14 @@ namespace OnlineStore.ACPackingStore
// lblWarnMsg.Text = "";
btnStartAuTo.Text = "开始自动出入库";
}
if(BoxBean.CompressSigTimeOut)
{
btnClearcurState.Visible = true;
}
else
{
btnClearcurState.Visible = false;
}
}
private void btnOutStore_Click(object sender, EventArgs e)
......@@ -250,7 +259,7 @@ namespace OnlineStore.ACPackingStore
string selectPositionNum = cmbPosition.Text;
string sleShelfNum = cmbShelfPosition.Text;
LineMoveP ktk = LoadPostion();
InOutParam param = new InOutParam("", selectPositionNum,sleShelfNum, ktk);
InOutParam param = new InOutParam("", selectPositionNum, sleShelfNum, ktk);
BoxBean.StartOutStoreMove(param);
}
else
......@@ -312,7 +321,7 @@ namespace OnlineStore.ACPackingStore
if (cmbPosition.SelectedIndex >= 0)
{
string selectPositionNum = cmbPosition.Text;
ACBoxPosition ktkPosition = CSVPositionReader<ACBoxPosition>.GetPositon(selectPositionNum);
ACBoxPosition ktkPosition = CSVPositionReader<ACBoxPosition>.GetPositon(selectPositionNum);
LoadPData(ktkPosition);
}
......@@ -360,10 +369,10 @@ namespace OnlineStore.ACPackingStore
ktkPosition.UpdownAxis_IL_P4 = FormUtil.GetIntValue(txtUpDownP4);
ktkPosition.InoutAxis_P3 = FormUtil.GetIntValue(txtInOutP3);
// ktkPosition.ComAxis_P3 = FormUtil.GetIntValue(txtComP3);
// ktkPosition.ComAxis_P3 = FormUtil.GetIntValue(txtComP3);
ktkPosition.UpdownAxis_OH_P5 = FormUtil.GetIntValue(txtUpDownP5);
ktkPosition.UpdownAxis_OL_P6 = FormUtil.GetIntValue(txtUpDownP6);
// ktkPosition.ComAxis_P2 = FormUtil.GetIntValue(txtComP2);
// ktkPosition.ComAxis_P2 = FormUtil.GetIntValue(txtComP2);
//ktkPosition.InOutAxis_P11 = FormUtil.GetIntValue(txtInoutP11);
//ktkPosition.UpDownAxis_P2 = FormUtil.GetIntValue(txtUpDownP2);
//ktkPosition.UpDownAxis_DoorOBPosition_P7 = FormUtil.GetIntValue(txtUpDownP7);
......@@ -614,7 +623,7 @@ namespace OnlineStore.ACPackingStore
string poText = cmbPosition.Text;
BoxBean.AutoInout.autoMsg = "自动出库:" + poText;
LogUtil.info( BoxBean.Name + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!");
LogUtil.info(BoxBean.Name + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!");
//BoxBean.StartOutStoreMove(new InOutStoreParam("", poText));
BoxBean.StartInStoreMove(new InOutParam("", poText, cmbShelfPosition.Text));
......@@ -661,7 +670,7 @@ namespace OnlineStore.ACPackingStore
}
catch (Exception ex)
{
LogUtil.error( "出错:" + ex.StackTrace);
LogUtil.error("出错:" + ex.StackTrace);
}
}
......@@ -806,8 +815,8 @@ namespace OnlineStore.ACPackingStore
private void btnScanTest_Click(object sender, EventArgs e)
{
BoxBean. IOMove(IO_Type.Camera_Led, IO_VALUE.HIGH);
List<string> codes = CodeManager.CameraScan(BoxBean.Config.GetCameraList(),BoxBean.Name);
BoxBean.IOMove(IO_Type.Camera_Led, IO_VALUE.HIGH);
List<string> codes = CodeManager.CameraScan(BoxBean.Config.GetCameraList(), BoxBean.Name);
BoxBean.IOMove(IO_Type.Camera_Led, IO_VALUE.LOW);
string result = "";
if (codes.Count > 0)
......@@ -822,7 +831,7 @@ namespace OnlineStore.ACPackingStore
else
{
MessageBox.Show("未扫到二维码" );
MessageBox.Show("未扫到二维码");
}
}
......@@ -886,7 +895,7 @@ namespace OnlineStore.ACPackingStore
ioIndex = BoxBean.Config.DIList[IO_Type.Compress_Check].GetIOAddr();
}
FrmPositionTool frm = new FrmPositionTool(PortName, slvAddr, ioIP, ioIndex, Text, BoxBean.DeviceID);
frm.ShowDialog();
frm.ShowDialog();
}
private void btnSaveCom_Click(object sender, EventArgs e)
......@@ -970,7 +979,7 @@ namespace OnlineStore.ACPackingStore
private void btnComP4_Click(object sender, EventArgs e)
{
int value = FormUtil.GetIntValue(txtComP4 );
int value = FormUtil.GetIntValue(txtComP4);
AxisABSMove(BoxBean.Config.Comp_Axis, value, BoxBean.Config.CompAxis_P4_Speed);
}
......@@ -1005,7 +1014,7 @@ namespace OnlineStore.ACPackingStore
{
return;
}
DialogResult result = MessageBox.Show("确定将库位改为【4D" + num.ToString().PadLeft(2,'0') + "XXXXXX】的格式?", "", MessageBoxButtons.YesNo);
DialogResult result = MessageBox.Show("确定将库位改为【4D" + num.ToString().PadLeft(2, '0') + "XXXXXX】的格式?", "", MessageBoxButtons.YesNo);
if (result.Equals(DialogResult.Yes))
{
string appPath = Application.StartupPath;
......@@ -1015,7 +1024,7 @@ namespace OnlineStore.ACPackingStore
{
string nameStr = BoxBean.DeviceID.ToString();
positionConfigFile = positionConfigFile.Replace(".csv", "_" + nameStr + ".csv");
}
}
if (!CSVPositionReader<ACBoxPosition>.UpdatePostion(positionConfigFile, num))
{
MessageBox.Show("更新文件【" + positionConfigFile + "】失败!");
......@@ -1060,7 +1069,21 @@ namespace OnlineStore.ACPackingStore
{
int value = FormUtil.GetIntValue(txtInoutP101);
AxisABSMove(BoxBean.Config.InOut_Axis, value, BoxBean.Config.InOutAxis_P101_Speed );
AxisABSMove(BoxBean.Config.InOut_Axis, value, BoxBean.Config.InOutAxis_P101_Speed);
}
/// <summary>
/// 忽略料叉信号,使出库继续运行
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnClearcurState_Click(object sender, EventArgs e)
{
if (BoxBean.MoveInfo.MoveStep.Equals(StoreMoveStep.SO_07_CheckComSig))
{
BoxBean.IsIgnoreComSig = true;
BoxBean.MoveInfo.EndStepWait();
}
}
}
}
......@@ -15,6 +15,7 @@ namespace OnlineStore.DeviceLibrary
{
#region 出入库结果验证
public bool CompressSigTimeOut = false;
private void CheckWait()
{
List<WaitResultInfo> list = MoveInfo.WaitList;
......@@ -81,6 +82,10 @@ namespace OnlineStore.DeviceLibrary
isOk = false;
break;
}
if(wait.IoType.Equals(IO_Type.Compress_Check) && MoveInfo.MoveStep.Equals(StoreMoveStep.SO_07_CheckComSig))
{
CompressSigTimeOut = true;
}
}
}
else if (wait.WaitType.Equals(WaitEnum.W003_Time))
......@@ -351,6 +356,13 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove(Config.Middle_Axis, MoveInfo.MoveParam.MoveP.Middle_P11, Config.MiddleAxis_P1_Speed);
}
private void StartMoveTrayBack(string str = "料盘不属于该仓库")
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_08_ToShelfPosition);
InOutStoreLog("送出料盘 " + MoveInfo.SLog + ":" + str + ",走到料架位置,旋转轴至P101,升降轴至P102");
ACAxisMove(Config.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_HP102, Config.UpDownAxis_P102_Speed);
ACAxisMove(Config.Middle_Axis, MoveInfo.MoveParam.MoveP.Middle_P101, Config.MiddleAxis_P101_Speed);
}
protected override void InStoreProcess()
{
LineMoveP moveP = MoveInfo.MoveParam.MoveP;
......@@ -363,24 +375,46 @@ namespace OnlineStore.DeviceLibrary
return;
}
#region 料架取料盘扫码获取POSID
if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_10_StartGetTray))
{
if (MoveInfo.NextShelfPos())
if(MoveInfo.IsShelfLocked)
{
//新的料架库位
startInStoreTime = DateTime.Now;
MoveInfo.NextMoveStep(StoreMoveStep.BI_11_InoutToP1);
InOutStoreLog("料架取料 " + MoveInfo.SLog + ":叉子后退到待机点P1, 重置盘信息");
ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed);
ClearLastTrayInfo();
if (MoveInfo.NextLockedShelfPos())
{
//新的料架库位
startInStoreTime = DateTime.Now;
MoveInfo.SingleInstore = false;
MoveInfo.NextMoveStep(StoreMoveStep.BI_11_InoutToP1);
InOutStoreLog("料架取料 " + MoveInfo.SLog + ":叉子后退到待机点P1, 重置盘信息");
ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed);
ClearLastTrayInfo();
}
else
{
//所有料盘已取料完成,送出料架
StartShelfOut();
}
}
else
{
//所有料盘已取料完成,送出料架
StartShelfOut();
if (MoveInfo.NextShelfPos())
{
//新的料架库位
startInStoreTime = DateTime.Now;
MoveInfo.SingleInstore = false;
MoveInfo.NextMoveStep(StoreMoveStep.BI_11_InoutToP1);
InOutStoreLog("料架取料 " + MoveInfo.SLog + ":叉子后退到待机点P1, 重置盘信息");
ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed);
ClearLastTrayInfo();
}
else
{
//所有料盘已取料完成,送出料架
StartShelfOut();
}
}
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_11_InoutToP1))
{
......@@ -443,9 +477,9 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_17_InoutBack))
{
if (MoveInfo.SingleInstore)
if (MoveInfo.SingleInstore || MoveInfo.IsShelfLocked)
{
//单盘入库,不需要扫码
//单盘入库或者该料架已锁定库位,不需要扫码
StartMoveToBag();
}
else
......@@ -553,11 +587,19 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StoreMoveStep.BI_30_SetInstoreParam);
InOutStoreLog("扫码 " + MoveInfo.SLog + ": 获取库位号");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(10000));
bool result = GetPosIdByCode();
if (!result)
bool result = GetPosIdByCode(MoveInfo.currShelfIndex,out CodeResultType codeResult);
if (!result)//获取库位失败
{
MoveInfo.MoveParam.PosID = "";
StartSendTray("获取入库库位失败");
if(codeResult == CodeResultType.NotFoundPos)//库位不在该料仓,将该料盘放回料架
{
//MoveInfo.MoveParam.PosID = "";
StartMoveTrayBack("此料盘不属于该仓库,放回料架");
}
else//无法获取库位信息
{
MoveInfo.MoveParam.PosID = "";
StartSendTray("获取入库库位失败");
}
}
else
{
......@@ -678,6 +720,38 @@ namespace OnlineStore.DeviceLibrary
}
#endregion
#region 把料盘送回料架逻辑
else if (MoveInfo.MoveStep == StoreMoveStep.SO_08_ToShelfPosition)
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_11_ToShelf);
InOutStoreLog("送出料盘 " + MoveInfo.SLog + ":叉子进出料口,进出轴至P101");
ACAxisMove(Config.InOut_Axis, moveP.InOut_P101, Config.InOutAxis_P101_Speed);
}
else if (MoveInfo.MoveStep == StoreMoveStep.SO_11_ToShelf)
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_12_PutReel);
InOutStoreLog("送出料盘 " + MoveInfo.SLog + ":放下物品,压紧轴到P1,升降轴至P101,清空 taskData=null ");
ACAxisMove(Config.Comp_Axis, moveP.ComPress_P1, Config.CompAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_LP101, Config.UpDownAxis_P101_Speed);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
}
else if (MoveInfo.MoveStep == StoreMoveStep.SO_12_PutReel)
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_13_InoutBack);
InOutStoreLog("送出料盘 " + MoveInfo.SLog + ":叉子从出料口返回, 进出轴到P1 ");
InOutBackToP1(moveP.InOut_P1);
}
else if (MoveInfo.MoveStep == StoreMoveStep.SO_13_InoutBack)
{
MoveInfo.NextMoveStep(StoreMoveStep.BI_10_StartGetTray);
InOutStoreLog("送出料盘结束 " + MoveInfo.SLog + ": 升降轴返回,升降轴到P1,顶升下降,继续循环料架取料盘");
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
}
#endregion
//料架进入逻辑
else if (MoveInfo.MoveStep < StoreMoveStep.BI_10_StartGetTray)
{
......@@ -747,7 +821,7 @@ namespace OnlineStore.DeviceLibrary
#region 出库
private DateTime startOutStoreTime = DateTime.Now;
public bool IsIgnoreComSig = false; //忽略料叉压紧信号
private void StartExecuctOut(InOutParam param)
{
......@@ -910,19 +984,22 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.MoveStep == StoreMoveStep.SO_06_InoutBack)
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_08_ToShelfPosition);
InOutStoreLog("出库 " + MoveInfo.SLog + ":走到料架位置,旋转轴至P101,升降轴至P102, ");
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_HP102, Config.UpDownAxis_P102_Speed);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P101, Config.MiddleAxis_P101_Speed);
MoveInfo.NextMoveStep(StoreMoveStep.SO_07_CheckComSig);
InOutStoreLog("出库 " + MoveInfo.SLog + ":等待料叉压紧信号 ");
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Compress_Check, IO_VALUE.HIGH));
}
else if (MoveInfo.MoveStep == StoreMoveStep.SO_07_LocationUp)
else if (MoveInfo.MoveStep == StoreMoveStep.SO_07_CheckComSig)
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_08_ToShelfPosition);
InOutStoreLog("出库 " + MoveInfo.SLog + ":走到料架位置,旋转轴至P101,升降轴至P102 ");
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_HP102, Config.UpDownAxis_P102_Speed);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P101, Config.MiddleAxis_P101_Speed);
if(IOValue(IO_Type.Compress_Check).Equals(IO_VALUE.HIGH) || IsIgnoreComSig)
{
IsIgnoreComSig = false;
CompressSigTimeOut = false;
MoveInfo.NextMoveStep(StoreMoveStep.SO_08_ToShelfPosition);
InOutStoreLog("出库 " + MoveInfo.SLog + ":走到料架位置,旋转轴至P101,升降轴至P102 ");
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_HP102, Config.UpDownAxis_P102_Speed);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P101, Config.MiddleAxis_P101_Speed);
}
}
else if (MoveInfo.MoveStep == StoreMoveStep.SO_08_ToShelfPosition)
{
......
......@@ -50,7 +50,7 @@
<HintPath>..\..\dll\CodeLibrary.dll</HintPath>
</Reference>
<Reference Include="halcondotnet">
<HintPath>..\..\..\RC32-SZBOSCH-ACSingleStore\dll\halcondotnet.dll</HintPath>
<HintPath>..\..\dll\halcondotnet.dll</HintPath>
</Reference>
<Reference Include="HFReader9CSharp">
<HintPath>..\..\dll\RFID\HFReader9CSharp.dll</HintPath>
......
......@@ -141,3 +141,4 @@ PRO,温湿度端口号,Humiture_Port,COM5,,,,,,,
PRO,扫码的相机名称(多个用#分隔),CameraNameList,GigE:MV-CE200-10GC (00D76546875),,,,,,,
PRO,RFID读卡器IP,RFID_IP,192.168.104.101,,,,,,,
PRO,是否是调试状态,IsInDebug,0,,,,,,,
PRO,所有料仓的CID(用#号分隔),All_CIDs,packing-1#packing-2#packing-3#packing-4#packing-5#packing-6#packing-7#packing-8,,,,,,,
......@@ -141,3 +141,4 @@ PRO,温湿度端口号,Humiture_Port,COM5,,,,,,,
PRO,扫码的相机名称(多个用#分隔),CameraNameList,GigE:MV-CE200-10GC (00D76546940),,,,,,,
PRO,RFID读卡器IP,RFID_IP,192.168.104.102,,,,,,,
PRO,是否是调试状态,IsInDebug,0,,,,,,,
PRO,所有料仓的CID(用#号分隔),All_CIDs,packing-2#packing-3#packing-4#packing-5#packing-6#packing-7#packing-8#packing-1,,,,,,,
\ No newline at end of file
......@@ -192,6 +192,41 @@ namespace OnlineStore.DeviceLibrary
MoveP.UpDown_P5 = position.UpdownAxis_OH_P5;
MoveP.UpDown_P6 = position.UpdownAxis_OL_P6;
}
internal void UpdatePosIdAndShelfId(string wareNo,string rfid,string posId, string ShelfPosID)
{
WareCode = wareNo;
this.ShelfPosID = ShelfPosID;
this.rfid = rfid;
ShelfPosition sp = CSVPositionReader<ShelfPosition>.GetPositon(ShelfPosID);
if (sp == null)
{
LogUtil.error("GetPositon[" + ShelfPosID + "]=null,没有库位不能执行出入库");
}
MoveP.InOut_P101 = sp.InoutAxis_P101;
MoveP.UpDown_LP101 = sp.UpDownAxis_LP101;
MoveP.UpDown_HP102 = sp.UpDownAxis_HP102;
MoveP.Middle_P101 = sp.MiddleAxis_P101;
PosID = posId;
ACBoxPosition position = CSVPositionReader<ACBoxPosition>.GetPositon(posId);
if (position == null)
{
LogUtil.error("GetPositon[" + posId + "] =null,没有库位不能执行出入库");
}
//MoveP.ComPress_P2 = comP2;
//MoveP.ComPress_P3 = comP3;
MoveP.InOut_P3 = position.InoutAxis_P3;
MoveP.Middle_P2 = position.MiddleAxis_P2;
MoveP.UpDown_P3 = position.UpdownAxis_IH_P3;
MoveP.UpDown_P4 = position.UpdownAxis_IL_P4;
MoveP.UpDown_P5 = position.UpdownAxis_OH_P5;
MoveP.UpDown_P6 = position.UpdownAxis_OL_P6;
}
}
}
......@@ -240,9 +240,9 @@ namespace OnlineStore.DeviceLibrary
SO_06_InoutBack = 2006,
/// <summary>
/// 料仓出库,定位气缸伸出(有压紧轴的不需要此步骤 )
/// 料仓出库,等待压紧信号确认
/// </summary>
SO_07_LocationUp = 2007,
SO_07_CheckComSig = 2007,
/// <summary>
/// 料仓出库,走到料架位置,旋转轴至P20,升降轴至P102,
......
......@@ -6,7 +6,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OnlineStore.DeviceLibrary
{
......@@ -22,15 +22,15 @@ namespace OnlineStore.DeviceLibrary
public StoreMoveInfo(int storeId)
{
moveType = StoreMoveType.None;
MoveParam = new InOutParam();
this.storeId = storeId;
this.moveStep = StoreMoveStep.Wait;
IsInWait = false;
// MoveNum = 0;
// MoveNum = 0;
}
// public int MoveNum { get; set; }
// public int MoveNum { get; set; }
public DateTime LastSetpTime { get; set; }
......@@ -44,7 +44,7 @@ namespace OnlineStore.DeviceLibrary
get { return " " + MoveStep + " "; }
}
/// <summary>
/// 操作类型
/// </summary>
......@@ -67,7 +67,7 @@ namespace OnlineStore.DeviceLibrary
/// 是否再当前步骤等待中
/// </summary>
public bool IsInWait { get; set; }
/// <summary>
/// 当前执行到的步骤
/// </summary>
......@@ -85,12 +85,12 @@ namespace OnlineStore.DeviceLibrary
}
public bool SingleInstore = false;
public void NextMoveStep(StoreMoveStep step)
{
// PreMoveStep = moveStep;
// PreMoveStep = moveStep;
moveStep = step;
LastSetpTime = DateTime.Now;
LastSetpTime = DateTime.Now;
IsInWait = true;
WaitList = new List<WaitResultInfo>();
OneWaitCanEndStep = false;
......@@ -122,7 +122,7 @@ namespace OnlineStore.DeviceLibrary
param = new InOutParam();
}
this.MoveParam = param;
LastSetpTime = DateTime.Now;
LastSetpTime = DateTime.Now;
WaitList = new List<WaitResultInfo>();
currShelfIndex = -1;
SingleInstore = false;
......@@ -130,7 +130,7 @@ namespace OnlineStore.DeviceLibrary
public void EndMove()
{
this.moveType = StoreMoveType.None;
this.MoveParam = null;
this.MoveParam = null;
moveStep = StoreMoveStep.Wait;
LastSetpTime = DateTime.Now;
IsInWait = false;
......@@ -149,7 +149,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public List<string> ShelfPositionList = new List<string>();
private string currShelfPosId = "";
private int currShelfIndex = -1;
public int currShelfIndex = -1;
public bool NextShelfPos()
{
......@@ -164,6 +164,33 @@ namespace OnlineStore.DeviceLibrary
MoveParam.UpdateShelfPosId(currShelfPosId);
return true;
}
/// <summary>
/// 入库时,料架已锁定库位的位置,无需扫码
/// </summary>
public bool IsShelfLocked = false;//料架是否锁定
/// <summary>
/// 料架锁定位置的料
/// </summary>
public List<ShelfLockData> shelfLockDatas =null;
public bool NextLockedShelfPos()
{
currShelfIndex++;
if (currShelfIndex >= shelfLockDatas.Count)
{
shelfLockDatas = null;
return false;
}
currShelfPosId = ShelfPositionList[shelfLockDatas[currShelfIndex].rfidLoc];
//设置取料位置
MoveParam.UpdatePosIdAndShelfId(shelfLockDatas[currShelfIndex].barcode,
shelfLockDatas[currShelfIndex].rfid,
shelfLockDatas[currShelfIndex].lockPos, currShelfPosId);
return true;
}
}
public class WaitResultInfo
......@@ -174,30 +201,30 @@ namespace OnlineStore.DeviceLibrary
CanWhileMoveCount = 0;
}
public static WaitResultInfo WaitIO(string ioType, IO_VALUE ioValue)
public static WaitResultInfo WaitIO(string ioType, IO_VALUE ioValue)
{
WaitResultInfo wait = new WaitResultInfo();
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = WaitEnum.W002_IOValue;
wait.IoType = ioType;
wait.IoValue = ioValue;
wait.IoValue = ioValue;
return wait;
}
public static WaitResultInfo WaitAxis(ConfigMoveAxis axis,int targetPosition,int targetSpeed )
public static WaitResultInfo WaitAxis(ConfigMoveAxis axis, int targetPosition, int targetSpeed)
{
WaitResultInfo wait = new WaitResultInfo();
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = WaitEnum.W001_AxisMove;
wait.AxisInfo = axis;
wait.IsHomeMove = false;
wait.TargetPosition = targetPosition;
wait.TargetSpeed = targetSpeed;
wait.TargetSpeed = targetSpeed;
return wait;
}
public static WaitResultInfo WaitAxis(ConfigMoveAxis axis, bool isHomeMove)
{
WaitResultInfo wait = new WaitResultInfo();
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = WaitEnum.W001_AxisMove;
wait.AxisInfo = axis;
wait.IsHomeMove = true;
wait.IsHomeMove = true;
return wait;
}
//public static WaitResultInfo WaitStell(byte slvAddr, int targetPosition, int speed)
......@@ -222,16 +249,16 @@ namespace OnlineStore.DeviceLibrary
// wait.TargetSpeed = speed;
// return wait;
//}
//public static WaitResultInfo WaitShuoKe(int slvAddr, int targetPosition, bool isHome)
//{
// WaitResultInfo wait = new WaitResultInfo();
// wait.CanWhileMoveCount = 0;
// wait.WaitType = WaitEnum.W005_ShuoKe;
// wait.SlvAddr =(byte) slvAddr;
// wait.TargetPosition = targetPosition;
// wait.IsHomeMove = isHome;
// return wait;
//}
//public static WaitResultInfo WaitShuoKe(int slvAddr, int targetPosition, bool isHome)
//{
// WaitResultInfo wait = new WaitResultInfo();
// wait.CanWhileMoveCount = 0;
// wait.WaitType = WaitEnum.W005_ShuoKe;
// wait.SlvAddr =(byte) slvAddr;
// wait.TargetPosition = targetPosition;
// wait.IsHomeMove = isHome;
// return wait;
//}
public static WaitResultInfo WaitTime(int MScends)
{
WaitResultInfo wait = new WaitResultInfo();
......@@ -241,9 +268,9 @@ namespace OnlineStore.DeviceLibrary
wait.IsEnd = false;
return wait;
}
public static WaitResultInfo WaitAxisOrg(ConfigMoveAxis axis,IO_VALUE value )
public static WaitResultInfo WaitAxisOrg(ConfigMoveAxis axis, IO_VALUE value)
{
WaitResultInfo wait = new WaitResultInfo();
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = WaitEnum.W006_AxisOrg;
wait.AxisInfo = axis;
wait.IsHomeMove = true;
......@@ -251,35 +278,35 @@ namespace OnlineStore.DeviceLibrary
wait.IsEnd = false;
return wait;
}
public static WaitResultInfo WaitComAxis(ConfigMoveAxis axis, int targetPosition, int targetSpeed)
public static WaitResultInfo WaitComAxis(ConfigMoveAxis axis, int targetPosition, int targetSpeed)
{
WaitResultInfo wait = new WaitResultInfo();
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = WaitEnum.W008_Compress;
wait.AxisInfo = axis;
wait.IsHomeMove = false;
wait.TargetPosition = targetPosition;
wait.TargetSpeed = targetSpeed;
wait.TargetSpeed = targetSpeed;
return wait;
}
internal static WaitResultInfo WaitCode()
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = WaitEnum.W009_ScanCode;
wait.IsHomeMove = false;
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = WaitEnum.W009_ScanCode;
wait.IsHomeMove = false;
return wait;
}
public static WaitResultInfo WaitAgvAction(int arrive)
{
WaitResultInfo wait = new WaitResultInfo();
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = WaitEnum.W010_AgvStatus;
wait.AgvAction = arrive;
wait.AgvAction = arrive;
return wait;
}
public static WaitResultInfo WaitDoorClose()
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = WaitEnum.W011_DoorCloseEvent;
wait.WaitType = WaitEnum.W011_DoorCloseEvent;
return wait;
}
public string ToStr()
......@@ -320,19 +347,22 @@ namespace OnlineStore.DeviceLibrary
return "料盘高度【" + TargetPosition + "】 ";
}
else if (WaitType.Equals(WaitEnum.W008_Compress))
{
{
return "压紧轴压紧到位";
}else if (WaitType.Equals(WaitEnum.W009_ScanCode))
}
else if (WaitType.Equals(WaitEnum.W009_ScanCode))
{
return "扫码完成";
}else if (WaitType.Equals(WaitEnum.W010_AgvStatus))
}
else if (WaitType.Equals(WaitEnum.W010_AgvStatus))
{
return " Agv_" + (ClientAction)AgvAction+" ";
}else if (WaitType.Equals(WaitEnum.W011_DoorCloseEvent))
{
return "Agv_DoorClose事件" ;
return " Agv_" + (ClientAction)AgvAction + " ";
}
else
else if (WaitType.Equals(WaitEnum.W011_DoorCloseEvent))
{
return "Agv_DoorClose事件";
}
else
{
return "Wait位置类型:WaitType=【" + WaitType + "】";
}
......@@ -356,11 +386,11 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// IO类型
/// </summary>
public String IoType { get; set; }
public String IoType { get; set; }
/// <summary>
/// IO值
/// </summary>
public IO_VALUE IoValue { get; set; }
public IO_VALUE IoValue { get; set; }
/// <summary>
/// 等待的毫秒
/// </summary>
......@@ -381,11 +411,11 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 是否已经结束
/// </summary>
public bool IsEnd{ get; set; }
public bool IsEnd { get; set; }
public int AgvAction = 0;
}
internal class WaitEnum
{
......@@ -420,7 +450,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 压紧轴压紧到位
/// </summary>
internal static int W008_Compress= 8;
internal static int W008_Compress = 8;
/// <summary>
/// 扫码完成
/// </summary>
......
......@@ -556,6 +556,12 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
[ConfigProAttribute("CompAxis_Max_P3")]
public int CompAxis_Max_P3 { get; set; }
/// <summary>
/// PRO 所有料仓的CID(用#号分隔) All_CIDs packing-1#packing-2#packing-3#packing-4#packing-5#packing-6#packing-7#packing-8
/// </summary>
[ConfigProAttribute("All_CIDs")]
public string All_CIDs { get; set; }
private List< ComP2Info> ComP2List = null;
public ComP2Info GetComP2(int plateh)
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!