Commit 8903455d 张东亮

春初机构-库位调试开启

1 个父辈 bd392c11
......@@ -595,8 +595,8 @@ namespace OnlineStore.DeviceLibrary
{
int row = 1;
int col = 1;
string side = "BB";
string PosId = "05BB01010101";
string side = "BB";
string PosId = CID+"BB01010101";
for (int i = 1; i <= trayRows.Length; i++)
{
if (i == trayRows.Length)
......@@ -621,7 +621,7 @@ namespace OnlineStore.DeviceLibrary
side = "BB";
atBside = true;
col = i;
PosId = $"05{side}{row.ToString().PadLeft(2, '0')}{col.ToString().PadLeft(2, '0')}0101";
PosId = $"{CID}{side}{row.ToString().PadLeft(2, '0')}{col.ToString().PadLeft(2, '0')}0101";
MoveInfo.MoveParam = new InOutParam(new InOutPosInfo("Reset", PosId));
MoveInfo.MoveParam.MoveP = new LineMoveP(Config, MoveInfo.MoveParam.PosInfo.PosId);
return true;
......@@ -640,14 +640,14 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info($"复位 检测到料屉在A面[col={i}]");
side = "AA";
col = i;
PosId = $"05{side}{row.ToString().PadLeft(2, '0')}{col.ToString().PadLeft(2, '0')}0101";
PosId = $"{CID}{side}{row.ToString().PadLeft(2, '0')}{col.ToString().PadLeft(2, '0')}0101";
MoveInfo.MoveParam = new InOutParam(new InOutPosInfo("Reset", PosId));
MoveInfo.MoveParam.MoveP = new LineMoveP(Config, MoveInfo.MoveParam.PosInfo.PosId);
return true;
}
}
}
PosId = $"05{side}{row.ToString().PadLeft(2, '0')}{col.ToString().PadLeft(2, '0')}0101";
PosId = $"{CID}{side}{row.ToString().PadLeft(2, '0')}{col.ToString().PadLeft(2, '0')}0101";
MoveInfo.MoveParam = new InOutParam(new InOutPosInfo("Reset", PosId));
MoveInfo.MoveParam.MoveP = new LineMoveP(Config, MoveInfo.MoveParam.PosInfo.PosId);
return false;
......
......@@ -36,37 +36,37 @@ namespace OnlineStore.DeviceLibrary
PullAxis_Inout_To_P1();
}
public void Test()
{
Random random = new Random();
Task.Factory.StartNew(new Action(delegate
{
while (!posDebugInfo.IsLastDrawer())
{
while (!posDebugInfo.IsLastGrid())
{
PosDebugResultManager.SetGridResult(posDebugInfo.CurGrid, 1);
posDebugInfo.NextGrid();
System.Threading.Thread.Sleep(500);
}
PosDebugResultManager.SetGridResult(posDebugInfo.CurGrid, 1);
PosDebugResultManager.SetDrawerResult(posDebugInfo.CurDrawer, 1);
PosDebugResultManager.SetDrawerResultWithGrid(posDebugInfo.CurDrawer);
posDebugInfo.NextDrawer();
System.Threading.Thread.Sleep(500);
}
while (!posDebugInfo.IsLastGrid())
{
PosDebugResultManager.SetGridResult(posDebugInfo.CurGrid, 1);//random.Next(0, 2)
posDebugInfo.NextGrid();
System.Threading.Thread.Sleep(500);
}
PosDebugResultManager.SetGridResult(posDebugInfo.CurGrid, 1);
PosDebugResultManager.SetDrawerResultWithGrid(posDebugInfo.CurDrawer);
posDebugInfo.NextDrawer();
}));
PosDebugResultManager.SaveResult();
}
//public void Test()
//{
// Random random = new Random();
// Task.Factory.StartNew(new Action(delegate
// {
// while (!posDebugInfo.IsLastDrawer())
// {
// while (!posDebugInfo.IsLastGrid())
// {
// PosDebugResultManager.SetGridResult(posDebugInfo.CurGrid, 1);
// posDebugInfo.NextGrid();
// System.Threading.Thread.Sleep(500);
// }
// PosDebugResultManager.SetGridResult(posDebugInfo.CurGrid, 1);
// PosDebugResultManager.SetDrawerResult(posDebugInfo.CurDrawer, 1);
// PosDebugResultManager.SetDrawerResultWithGrid(posDebugInfo.CurDrawer);
// posDebugInfo.NextDrawer();
// System.Threading.Thread.Sleep(500);
// }
// while (!posDebugInfo.IsLastGrid())
// {
// PosDebugResultManager.SetGridResult(posDebugInfo.CurGrid, 1);//random.Next(0, 2)
// posDebugInfo.NextGrid();
// System.Threading.Thread.Sleep(500);
// }
// PosDebugResultManager.SetGridResult(posDebugInfo.CurGrid, 1);
// PosDebugResultManager.SetDrawerResultWithGrid(posDebugInfo.CurDrawer);
// posDebugInfo.NextDrawer();
// }));
// PosDebugResultManager.SaveResult();
//}
/// <summary>
/// 更新移动信息
/// </summary>
......@@ -120,13 +120,13 @@ namespace OnlineStore.DeviceLibrary
XAxis_To_P1(true);
break;
case StepEnum.SP_01_ToBufferArea:
if (!InDoorCheck(MoveInfo.MoveParam))
{
SetWarnMsg($"库位调试 {MoveInfo.SLog}:入口料盘无信息[barcode={MoveInfo.MoveParam.PosInfo.barcode},PosSide={MoveInfo.MoveParam.PosInfo.GetPosSide()}],结束调试");
SetBoxStatus(DeviceStatus.Debugging, RunStatus.Runing);
MoveInfo.EndMove();
}
else
//if (!InDoorCheck(MoveInfo.MoveParam))
//{
// SetWarnMsg($"库位调试 {MoveInfo.SLog}:入口料盘无信息[barcode={MoveInfo.MoveParam.PosInfo.barcode},PosSide={MoveInfo.MoveParam.PosInfo.GetPosSide()}],结束调试");
// SetBoxStatus(DeviceStatus.Debugging, RunStatus.Runing);
// MoveInfo.EndMove();
//}
//else
{
MoveInfo.NextMoveStep(StepEnum.SP_02_VerifyBufferState);
LogInfo($"库位调试 {MoveInfo.SLog}:入料口料盘信息确认[barcode={MoveInfo.MoveParam.PosInfo.barcode}][posId={MoveInfo.MoveParam.PosInfo.PosId}][{MoveInfo.MoveParam.PosInfo.GetPosSide()}面],开始取料");
......@@ -134,17 +134,17 @@ namespace OnlineStore.DeviceLibrary
break;
case StepEnum.SP_02_VerifyBufferState:
if (!CheckInputMiddleAxisInBuff())
//if (!CheckInputMiddleAxisInBuff())
{
MoveInfo.NextMoveStep(StepEnum.SP_03_XAxisToBuff);
LogInfo($"库位调试 {MoveInfo.SLog}:移栽X轴到暂存区取放点P2,行走机构到取放点P2[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
XAxis_To_P2(true);
MoveAxisToP2(true);
}
else if (MoveInfo.IsTimeOut())
{
SetWarnMsg($"等待上料机构旋转轴离开{MoveInfo.MoveParam.PosInfo.GetPosSide()}面暂存区超时");
}
//else if (MoveInfo.IsTimeOut())
//{
// SetWarnMsg($"等待上料机构旋转轴离开{MoveInfo.MoveParam.PosInfo.GetPosSide()}面暂存区超时");
//}
break;
case StepEnum.SP_03_XAxisToBuff:
......@@ -261,15 +261,15 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(StepEnum.SP_19_CheckDrawerFinish);
int drawerRescode = PosDebugResultManager.SetDrawerResultWithGrid(posDebugInfo.CurDrawer);
LogInfo($"库位调试 {MoveInfo.SLog}:{posDebugInfo.CurDrawer}{posDebugInfo.CurGrid}是抽屉的最后一个库位,统计抽屉结果:{drawerRescode}[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
LogInfo($"库位调试 {MoveInfo.SLog}:{posDebugInfo.CurGrid}是抽屉的最后一个库位,统计抽屉结果:{drawerRescode}[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
}
else
{
MoveInfo.NextMoveStep(StepEnum.SP_25_ToNextGrid);
PosDebugResultManager.SetGridResult(posDebugInfo.CurGrid, 1);
LogInfo($"库位调试 {MoveInfo.SLog}:{posDebugInfo.CurDrawer}{posDebugInfo.CurGrid}库位调试OK,切换到下一个库位[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
LogInfo($"库位调试 {MoveInfo.SLog}:{posDebugInfo.CurGrid}库位调试OK,切换到下一个库位[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
posDebugInfo.NextGrid();
UpdateMoveInfo(posDebugInfo.CurDrawer + posDebugInfo.CurGrid);
UpdateMoveInfo(posDebugInfo.CurGrid);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
}
break;
......@@ -318,7 +318,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StepEnum.SP_25_ToNextDrawer);
LogInfo($"库位调试 {MoveInfo.SLog}:{posDebugInfo.CurDrawer}调试结束,切换到下一个抽屉[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
posDebugInfo.NextDrawer();
UpdateMoveInfo(posDebugInfo.CurDrawer + posDebugInfo.CurGrid);
UpdateMoveInfo(posDebugInfo.CurGrid);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
}
......@@ -335,7 +335,7 @@ namespace OnlineStore.DeviceLibrary
PullAxis_Inout_To_P3_P5(true);
break;
case StepEnum.SP_26_ToBufferArea:
if (!CheckInputMiddleAxisInBuff())
//if (!CheckInputMiddleAxisInBuff())
{
MoveInfo.NextMoveStep(StepEnum.SP_27_XAxisToBuffer);
LogInfo($"库位调试 {MoveInfo.SLog}:到下暂存区碗里,移栽X轴到进出料暂存区取放点P2,行走机构到进出料机构取放点P2[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
......@@ -343,10 +343,10 @@ namespace OnlineStore.DeviceLibrary
MoveAxisToP2(true);
}
else if (MoveInfo.IsTimeOut())
{
SetWarnMsg($"等待上料机构旋转轴离开{MoveInfo.MoveParam.PosInfo.GetPosSide()}面暂存区超时");
}
//else if (MoveInfo.IsTimeOut())
//{
// SetWarnMsg($"等待上料机构旋转轴离开{MoveInfo.MoveParam.PosInfo.GetPosSide()}面暂存区超时");
//}
break;
case StepEnum.SP_27_XAxisToBuffer:
......
......@@ -24,7 +24,7 @@
<add key="ConfigPath_TrayList" value="\LineConfig\TrayList.data" />
<add key="ConfigPath_PosDebugInfo" value="\Config\PosDebugInfo.json" />
<add key="ImagePath" value="\Images\" />
<add key="Line_CID" value="05" />
<add key="Line_CID" value="04" />
<!--end one store config-->
<!--二维码类型列表配置,用#分割,一维码=Barcode 二维码: QR Code#Data Matrix ECC 200#Micro QR Code-->
<add key="CodeType" value="Data Matrix ECC 200#QR Code" />
......
......@@ -147,7 +147,7 @@ namespace OnlineStore.XLRStore
private void button10_Click(object sender, EventArgs e)
{
boxEquip.autoFindPos.SetParam(int.Parse(txtCurRow.Text), int.Parse(txtCurCol.Text), int.Parse(txtStartRow.Text), int.Parse(txtStartCol.Text), float.Parse(txtCoffX.Text), float.Parse(txtCoofY.Text));
StringBuilder head2 = new StringBuilder(boxEquip.CID + posSide + txtStartRow.Text.PadLeft(2, '0') + txtStartCol.Text.PadLeft(2, '0'));
StringBuilder head2 = new StringBuilder(boxEquip.CID + posSide + txtCurRow.Text.PadLeft(2, '0') + txtCurCol.Text.PadLeft(2, '0'));
head2.Append("0101");
LineMoveP lineMoveP = new LineMoveP();
lineMoveP.UpdatePosById(head2.ToString());
......
......@@ -43,8 +43,8 @@ namespace OnlineStore.XLRStore
chbDebug.Checked = boxBean.IsDebug;
FrmAutoFindPos frmAutoFindPos = new FrmAutoFindPos();
AddForm(tabControl1, " 视觉对位 ", frmAutoFindPos);
FrmTongsLearn learn = new FrmTongsLearn();
AddForm(tabControl1, " 抓手训练 ", learn);
//FrmTongsLearn learn = new FrmTongsLearn();
//AddForm(tabControl1, " 抓手训练 ", learn);
FrmPosDebug frmPosDebug = new FrmPosDebug();
AddForm(tabControl1, " 库位调试 ", frmPosDebug);
boxBean.camera_event += BoxBean_camera_event;
......
......@@ -36,7 +36,9 @@ namespace OnlineStore.XLRStore
int endColInDrawer = int.Parse(txtEndColInDrawer.Text);
boxEquip.posDebugInfo.SetDrawerParam(startDrawerRow,startDrawerCol,endDrawerRow,endDrawerCol);
boxEquip.posDebugInfo.SetGridParam(startRowInDrawer,startColInDrawer,endRowInDrawer,endColInDrawer);
boxEquip.Test();
InOutParam inOutParam = new InOutParam(new InOutPosInfo("PosDebug", $"{boxEquip.posDebugInfo.CurGrid}"));
//boxEquip.Test();
boxEquip.StartPosDebug(inOutParam);
}
}
......@@ -52,7 +54,7 @@ namespace OnlineStore.XLRStore
private void btnStop_Click(object sender, EventArgs e)
{
if (MessageBox.Show("确认停止库位调试?", "提示", MessageBoxButtons.OKCancel).Equals(MessageBoxButtons.OK))
if (MessageBox.Show("确认停止库位调试?", "提示", MessageBoxButtons.OKCancel).Equals(DialogResult.OK))
boxEquip.posDebugInfo.IsBreak = true;
}
FrmPosResult frmPosResult = null;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!