Commit 67d37572 LN
2 个父辈 9008624d 67573a11
...@@ -22,6 +22,10 @@ PRO,0,B面抽屉对位Mark_X坐标,FindPos_Drawer_B_X,991.98,,,,,,,,,,,, ...@@ -22,6 +22,10 @@ PRO,0,B面抽屉对位Mark_X坐标,FindPos_Drawer_B_X,991.98,,,,,,,,,,,,
PRO,0,B面抽屉对位Mark_Y坐标,FindPos_Drawer_B_Y,902.12,,,,,,,,,,,, PRO,0,B面抽屉对位Mark_Y坐标,FindPos_Drawer_B_Y,902.12,,,,,,,,,,,,
PRO,0,B面抽屉验证Mark_X坐标,Validate_Drawer_B_X,1003.86,,,,,,,,,,,, PRO,0,B面抽屉验证Mark_X坐标,Validate_Drawer_B_X,1003.86,,,,,,,,,,,,
PRO,0,B面抽屉验证Mark_Y坐标,Validate_Drawer_B_Y,980.23,,,,,,,,,,,, PRO,0,B面抽屉验证Mark_Y坐标,Validate_Drawer_B_Y,980.23,,,,,,,,,,,,
PRO,0,A面抽屉对位Mark面积,FindPos_Drawer_A_Area,897.49,,,,,,,,,,,,
PRO,0,A面抽屉验证Mark面积,Validate_Drawer_A_Area,897.49,,,,,,,,,,,,
PRO,0,B面抽屉对位Mark面积,FindPos_Drawer_B_Area,897.49,,,,,,,,,,,,
PRO,0,B面抽屉验证Mark面积,Validate_Drawer_B_Area,897.49,,,,,,,,,,,,
PRO,0,B面X方向像素到脉冲的系数,PixelToPulse_B_X,100,,,,,,,,,,,, PRO,0,B面X方向像素到脉冲的系数,PixelToPulse_B_X,100,,,,,,,,,,,,
PRO,0,B面Y方向像素到脉冲的系数,PixelToPulse_B_Y,100,,,,,,,,,,,, PRO,0,B面Y方向像素到脉冲的系数,PixelToPulse_B_Y,100,,,,,,,,,,,,
PRO,0,视觉对位Mark_X方向误差范围,FindPos_Drawer_X_Error,2,,,,,,,,,,,, PRO,0,视觉对位Mark_X方向误差范围,FindPos_Drawer_X_Error,2,,,,,,,,,,,,
...@@ -35,9 +39,13 @@ PRO,0,抽屉列数,Drawer_Columns,6,,,,,,,,,,,, ...@@ -35,9 +39,13 @@ PRO,0,抽屉列数,Drawer_Columns,6,,,,,,,,,,,,
PRO,0,抽屉内行数,Rows_In_Drawer,4,,,,,,,,,,,, PRO,0,抽屉内行数,Rows_In_Drawer,4,,,,,,,,,,,,
PRO,0,抽屉内列数,Cols_In_Drawer,20,,,,,,,,,,,, PRO,0,抽屉内列数,Cols_In_Drawer,20,,,,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
PRO,0,行走机构视觉对位速度,MoveAxis_FindPosSpeed,20,,,,,,,,,,,, PRO,0,行走机构调试速度,MoveAxis_FindPosSpeed,20,,,,,,,,,,,,
PRO,0,升降轴视觉对位速度,UpdownAxis_FindPosSpeed,20,,,,,,,,,,,, PRO,0,升降轴调试速度,UpdownAxis_FindPosSpeed,20,,,,,,,,,,,,
PRO,0,拉取升降轴视觉对位速度,PullAxis_Updown_FindPosSpeed,20,,,,,,,,,,,, PRO,0,拉取升降轴调试速度,PullAxis_Updown_FindPosSpeed,20,,,,,,,,,,,,
PRO,0,拉取进出轴调试速度,PullAxis_InOut_FindPosSpeed,20,,,,,,,,,,,,
PRO,0,移栽X轴调试速度,XAxis_FindPosSpeed,20,,,,,,,,,,,,
PRO,0,压紧轴调试速度,ComAxis_FindPosSpeed,20,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,0,行走机构正极限位置,MoveAxis_PosLimit,20,,,,,,,,,,,, PRO,0,行走机构正极限位置,MoveAxis_PosLimit,20,,,,,,,,,,,,
PRO,0,行走机构负极限位置,MoveAxis_NegLimit,20,,,,,,,,,,,, PRO,0,行走机构负极限位置,MoveAxis_NegLimit,20,,,,,,,,,,,,
PRO,0,升降轴正极限位置,UpdownAxis_PosLimit,20,,,,,,,,,,,, PRO,0,升降轴正极限位置,UpdownAxis_PosLimit,20,,,,,,,,,,,,
......
...@@ -605,19 +605,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -605,19 +605,19 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 库位调试:料屉返回,提升抽屉,料斗拉取升降轴到P3(料屉提取高点) /// 库位调试:料屉返回,提升抽屉,料斗拉取升降轴到P3(料屉提取高点)
/// </summary> /// </summary>
SP_20_LiftTray, SP_20_LiftDrawer,
/// <summary> /// <summary>
/// 库位调试:推到抽屉提取点,料斗拉取进出轴到P2(A/B面料屉提取点) /// 库位调试:推到抽屉提取点,料斗拉取进出轴到P2(A/B面料屉提取点)
/// </summary> /// </summary>
SP_21_PushTray, SP_21_PushDrawer,
/// <summary> /// <summary>
/// 库位调试:料屉水平,料斗拉取升降轴到料屉提取水平点,同时检测X04-X09=1 /// 库位调试:料屉水平,料斗拉取升降轴到料屉提取水平点,同时检测X04-X09=1
/// </summary> /// </summary>
SP_22_PutTrayMiddle, SP_22_PutDrawerMiddle,
/// <summary> /// <summary>
/// 库位调试:放下料屉,料斗拉取升降轴到P4(料屉提取低点) /// 库位调试:放下料屉,料斗拉取升降轴到P4(料屉提取低点)
/// </summary> /// </summary>
SP_23_PutTrayDown, SP_23_PutDrawerDown,
/// <summary> /// <summary>
/// 库位调试:料斗拉取进出轴到P1(待机点),检查是否结束 /// 库位调试:料斗拉取进出轴到P1(待机点),检查是否结束
/// </summary> /// </summary>
...@@ -626,6 +626,26 @@ namespace OnlineStore.DeviceLibrary ...@@ -626,6 +626,26 @@ namespace OnlineStore.DeviceLibrary
/// 库位调试:到下一个库位,移栽X轴到位,进出轴到位 /// 库位调试:到下一个库位,移栽X轴到位,进出轴到位
/// </summary> /// </summary>
SP_25_ToNextGrid, SP_25_ToNextGrid,
/// <summary>
/// 库位调试:到下一个抽屉
/// </summary>
SP_25_ToNextDrawer,
/// <summary>
/// 库位调试:到暂存区
/// </summary>
SP_26_ToBufferArea,
/// <summary>
/// 库位调试:移栽X轴到暂存区
/// </summary>
SP_27_XAxisToBuffer,
/// <summary>
/// 库位调试: 放下料盘
/// </summary>
SP_28_PutReel,
/// <summary>
/// 库位调试:移栽X轴返回待机点
/// </summary>
SP_29_XAxisBack,
#endregion #endregion
#region 入料模块复位 1000 开始 #region 入料模块复位 1000 开始
......
...@@ -100,7 +100,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -100,7 +100,7 @@ namespace OnlineStore.DeviceLibrary
public bool MatchAndSaveImg(Bitmap bitmap,string imgname) public bool MatchAndSaveImg(Bitmap bitmap,string imgname)
{ {
var score = match(bitmap, out string pn, out Bitmap bitmap1); var score = match(bitmap, out string pn, out Bitmap bitmap1);
var pnpath = Path.Combine(temp_path, score > Config.TongsDetectThreshold ? "OK" : "NG"); var pnpath = Path.Combine($"{temp_path}/{DateTime.Now.ToString("yyyyMMdd")}/", score > Config.TongsDetectThreshold ? "OK" : "NG");
Directory.CreateDirectory(pnpath); Directory.CreateDirectory(pnpath);
var simpletemp = Path.Combine(pnpath, $"{imgname}-{score.ToString("##.##")}-{pn}.png"); var simpletemp = Path.Combine(pnpath, $"{imgname}-{score.ToString("##.##")}-{pn}.png");
bitmap.Save(simpletemp, ImageFormat.Png); bitmap.Save(simpletemp, ImageFormat.Png);
......
...@@ -128,9 +128,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -128,9 +128,8 @@ namespace OnlineStore.DeviceLibrary
InitPosititionNumList(); InitPosititionNumList();
InitDrawInfos(); InitDrawInfos();
LoadCameraConfig(); LoadCameraConfig();
//库位测试 //库位调试
//InitPosDebugInfo(); InitPosDebugInfo();
//Test();
} }
void InitRowColumnSig() void InitRowColumnSig()
...@@ -374,8 +373,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -374,8 +373,8 @@ namespace OnlineStore.DeviceLibrary
LogInfo($"复位 {MoveInfo.SLog}:在进出轴待机点取像"); LogInfo($"复位 {MoveInfo.SLog}:在进出轴待机点取像");
Bitmap resetBitMapA = AcqImage("box_A"); Bitmap resetBitMapA = AcqImage("box_A");
Bitmap resetBitMapB = AcqImage("box_B"); Bitmap resetBitMapB = AcqImage("box_B");
resetRtnA = MatchAndSaveImg(resetBitMapA, $"resetA_{DateTime.Now.ToString("yyyyMMddHHmmss")}"); resetRtnA = MatchAndSaveImg(resetBitMapA, $"resetA_{DateTime.Now.ToString("HHmmss")}");
resetRtnB = MatchAndSaveImg(resetBitMapB, $"resetB_{DateTime.Now.ToString("yyyyMMddHHmmss")}"); resetRtnB = MatchAndSaveImg(resetBitMapB, $"resetB_{DateTime.Now.ToString("HHmmss")}");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
break; break;
case StepEnum.BOX_H003_2_CheckDrawerIsInAxis: case StepEnum.BOX_H003_2_CheckDrawerIsInAxis:
......
...@@ -267,7 +267,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -267,7 +267,7 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.NextMoveStep(StepEnum.SI_09_ToTray); MoveInfo.NextMoveStep(StepEnum.SI_09_ToTray);
LogInfo($"入库 {MoveInfo.SLog}:到抽屉提取点,料斗拉取进出轴到料屉提取点P2/P4[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"入库 {MoveInfo.SLog}:到抽屉提取点,料斗拉取进出轴到料屉提取点P2/P4[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
ToTray(); PullAxis_Inout_To_P2_P4();
CamDetectError = false; CamDetectError = false;
IgnoreCamDect = false; IgnoreCamDect = false;
} }
...@@ -292,7 +292,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -292,7 +292,6 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StepEnum.SI_13_GetReel); MoveInfo.NextMoveStep(StepEnum.SI_13_GetReel);
LogInfo($"入库 {MoveInfo.SLog}:进入库位中,移栽升降轴到料屉取放点P7/P13[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"入库 {MoveInfo.SLog}:进入库位中,移栽升降轴到料屉取放点P7/P13[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
UpdownAxisToP7_P13(); UpdownAxisToP7_P13();
SaveSpecifiedImage();
break; break;
case StepEnum.SI_13_GetReel: case StepEnum.SI_13_GetReel:
MoveInfo.NextMoveStep(StepEnum.SI_14_ReleaseCompress); MoveInfo.NextMoveStep(StepEnum.SI_14_ReleaseCompress);
...@@ -313,27 +312,38 @@ namespace OnlineStore.DeviceLibrary ...@@ -313,27 +312,38 @@ namespace OnlineStore.DeviceLibrary
PullAxis_UpdownToHighP3(); PullAxis_UpdownToHighP3();
break; break;
case StepEnum.SI_16_LiftTray: case StepEnum.SI_16_LiftTray:
//MoveInfo.NextMoveStep(StepEnum.SI_17_PushTray); MoveInfo.NextMoveStep(StepEnum.SI_17_PushTray);
LogInfo($"入库 {MoveInfo.SLog}:推到抽屉待机点采集图片,料斗拉取进出轴到P1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
PullAxis_Inout_To_P1();
//MoveInfo.NextMoveStep(StepEnum.SI_18_PutTrayMiddle);
//LogInfo($"入库 {MoveInfo.SLog}:推到抽屉提取点,料斗拉取进出轴到料屉提取点P2[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
//PullAxis_Inout_To_P2_P4();
break;
case StepEnum.SI_17_PushTray:
MoveInfo.NextMoveStep(StepEnum.SI_18_PutTrayMiddle); MoveInfo.NextMoveStep(StepEnum.SI_18_PutTrayMiddle);
LogInfo($"入库 {MoveInfo.SLog}:推到抽屉提取点,料斗拉取进出轴到料屉提取点P2[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"入库 {MoveInfo.SLog}:推到抽屉提取点,料斗拉取进出轴到料屉提取点P2/P4[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
SaveSpecifiedImage();
Bitmap bitmap = AcqImage(CamPosSide(MoveInfo.MoveParam.PosInfo.PosId));
bool rtn = MatchAndSaveImg(bitmap, $"{CamPosSide(MoveInfo.MoveParam.PosInfo.PosId)}_{DateTime.Now.ToString("HHmmss")}");
string res = rtn ? "OK" : "NG";
LogInfo($"入库 {MoveInfo.SLog}:抓手检测结果:{res}[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
PullAxis_Inout_To_P2_P4(); PullAxis_Inout_To_P2_P4();
break;
//case StepEnum.SI_17_PushTray: //PullAxis_UpdownToMiddleP2();
// MoveInfo.NextMoveStep(StepEnum.SI_18_PutTrayMiddle); //if (CheckASide())
// PullAxis_UpdownToMiddleP2(); //{
// if (CheckASide())
// {
// LogInfo($"入库 {MoveInfo.SLog}:料斗拉取升降轴到料屉水平点P2,同时检测{trayAColumns[GetPosColumn()]}=1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); // LogInfo($"入库 {MoveInfo.SLog}:料斗拉取升降轴到料屉水平点P2,同时检测{trayAColumns[GetPosColumn()]}=1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
// if (!GetShieldState(sheidAColmns[GetPosColumn()])) // if (!GetShieldState(sheidAColmns[GetPosColumn()]))
// MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(trayAColumns[GetPosColumn()], IO_VALUE.HIGH)); // MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(trayAColumns[GetPosColumn()], IO_VALUE.HIGH));
// } //}
// else //else
// { //{
// LogInfo($"入库 {MoveInfo.SLog}:料斗拉取升降轴到料屉水平点P2,同时检测{trayBColumns[GetPosColumn()]} = 1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); // LogInfo($"入库 {MoveInfo.SLog}:料斗拉取升降轴到料屉水平点P2,同时检测{trayBColumns[GetPosColumn()]} = 1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
// if (!GetShieldState(sheidBColmns[GetPosColumn()])) // if (!GetShieldState(sheidBColmns[GetPosColumn()]))
// MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(trayBColumns[GetPosColumn()], IO_VALUE.HIGH)); // MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(trayBColumns[GetPosColumn()], IO_VALUE.HIGH));
// } //}
// break; break;
case StepEnum.SI_18_PutTrayMiddle: case StepEnum.SI_18_PutTrayMiddle:
MoveInfo.NextMoveStep(StepEnum.SI_18_PutTrayDown); MoveInfo.NextMoveStep(StepEnum.SI_18_PutTrayDown);
//LogInfo($"入库 {MoveInfo.SLog}:放下料屉,料斗拉取升降轴到料屉提取低点P4[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); //LogInfo($"入库 {MoveInfo.SLog}:放下料屉,料斗拉取升降轴到料屉提取低点P4[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
......
...@@ -66,7 +66,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -66,7 +66,7 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.NextMoveStep(StepEnum.SO_03_ToTray); MoveInfo.NextMoveStep(StepEnum.SO_03_ToTray);
LogInfo($"出库 {MoveInfo.SLog}:到抽屉提取点,料斗拉取进出轴到料屉提取点P2/P4[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"出库 {MoveInfo.SLog}:到抽屉提取点,料斗拉取进出轴到料屉提取点P2/P4[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
ToTray(); PullAxis_Inout_To_P2_P4();
CamDetectError = false; CamDetectError = false;
IgnoreCamDect = false; IgnoreCamDect = false;
} }
...@@ -91,7 +91,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -91,7 +91,6 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StepEnum.SO_07_GetReel); MoveInfo.NextMoveStep(StepEnum.SO_07_GetReel);
LogInfo($"出库 {MoveInfo.SLog}:进入库位中,移栽升降轴到料屉取放点P7/P13[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"出库 {MoveInfo.SLog}:进入库位中,移栽升降轴到料屉取放点P7/P13[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
UpdownAxisToP7_P13(); UpdownAxisToP7_P13();
SaveSpecifiedImage();
break; break;
case StepEnum.SO_07_GetReel: case StepEnum.SO_07_GetReel:
MoveInfo.NextMoveStep(StepEnum.SO_08_StartCompress); MoveInfo.NextMoveStep(StepEnum.SO_08_StartCompress);
...@@ -109,29 +108,42 @@ namespace OnlineStore.DeviceLibrary ...@@ -109,29 +108,42 @@ namespace OnlineStore.DeviceLibrary
PullAxis_UpdownToHighP3(); PullAxis_UpdownToHighP3();
break; break;
case StepEnum.SO_10_LiftTray: case StepEnum.SO_10_LiftTray:
//MoveInfo.NextMoveStep(StepEnum.SO_11_PushTray); MoveInfo.NextMoveStep(StepEnum.SO_11_PushTray);
MoveInfo.NextMoveStep(StepEnum.SO_12_PutTrayMiddle); LogInfo($"出库 {MoveInfo.SLog}:到进出轴待机点拍照,料斗拉取进出轴到料屉待机点P1,移栽旋转轴到取放料水平点P2,移栽X到P1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
LogInfo($"出库 {MoveInfo.SLog}:推到抽屉提取点,料斗拉取进出轴到料屉提取点P2/P4,移栽旋转轴到取放料水平点P2,移栽X到P1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); PullAxis_Inout_To_P1();
PullAxis_Inout_To_P2_P4();
MiddleAxis_To_P2(); MiddleAxis_To_P2();
XAxis_To_P1(); XAxis_To_P1();
//MoveInfo.NextMoveStep(StepEnum.SO_12_PutTrayMiddle);
//LogInfo($"出库 {MoveInfo.SLog}:推到抽屉提取点,料斗拉取进出轴到料屉提取点P2/P4,移栽旋转轴到取放料水平点P2,移栽X到P1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
//PullAxis_Inout_To_P2_P4();
//MiddleAxis_To_P2();
//XAxis_To_P1();
break; break;
//case StepEnum.SO_11_PushTray: case StepEnum.SO_11_PushTray:
// MoveInfo.NextMoveStep(StepEnum.SO_12_PutTrayMiddle); MoveInfo.NextMoveStep(StepEnum.SO_12_PutTrayMiddle);
// PullAxis_UpdownToMiddleP2(); LogInfo($"出库 {MoveInfo.SLog}:推到抽屉提取点,料斗拉取进出轴到料屉提取点P2/P4[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
// if (CheckASide()) SaveSpecifiedImage();
// { Bitmap bitmap = AcqImage(CamPosSide(MoveInfo.MoveParam.PosInfo.PosId));
bool rtn = MatchAndSaveImg(bitmap, $"{CamPosSide(MoveInfo.MoveParam.PosInfo.PosId)}_{DateTime.Now.ToString("HHmmss")}");
string res = rtn ? "OK" : "NG";
LogInfo($"出库 {MoveInfo.SLog}:抓手检测结果:{res}[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
PullAxis_Inout_To_P2_P4();
//PullAxis_UpdownToMiddleP2();
//if (CheckASide())
//{
// LogInfo($"出库 {MoveInfo.SLog}:料斗拉取升降轴到料屉水平点P2,同时检测{trayAColumns[GetPosColumn()]}=1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); // LogInfo($"出库 {MoveInfo.SLog}:料斗拉取升降轴到料屉水平点P2,同时检测{trayAColumns[GetPosColumn()]}=1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
// if (!GetShieldState(sheidAColmns[GetPosColumn()])) // if (!GetShieldState(sheidAColmns[GetPosColumn()]))
// MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(trayAColumns[GetPosColumn()], IO_VALUE.HIGH)); // MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(trayAColumns[GetPosColumn()], IO_VALUE.HIGH));
// } //}
// else //else
// { //{
// LogInfo($"出库 {MoveInfo.SLog}:料斗拉取升降轴到料屉水平点P2,同时检测{trayBColumns[GetPosColumn()]} = 1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); // LogInfo($"出库 {MoveInfo.SLog}:料斗拉取升降轴到料屉水平点P2,同时检测{trayBColumns[GetPosColumn()]} = 1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
// if (!GetShieldState(sheidBColmns[GetPosColumn()])) // if (!GetShieldState(sheidBColmns[GetPosColumn()]))
// MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(trayBColumns[GetPosColumn()], IO_VALUE.HIGH)); // MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(trayBColumns[GetPosColumn()], IO_VALUE.HIGH));
// } //}
// break; break;
case StepEnum.SO_12_PutTrayMiddle: case StepEnum.SO_12_PutTrayMiddle:
MoveInfo.NextMoveStep(StepEnum.SO_12_PutTrayDown); MoveInfo.NextMoveStep(StepEnum.SO_12_PutTrayDown);
//LogInfo($"出库 {MoveInfo.SLog}:放下料屉,料斗拉取升降轴到料屉提取低点P4[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); //LogInfo($"出库 {MoveInfo.SLog}:放下料屉,料斗拉取升降轴到料屉提取低点P4[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
......
...@@ -77,6 +77,27 @@ namespace OnlineStore.DeviceLibrary ...@@ -77,6 +77,27 @@ namespace OnlineStore.DeviceLibrary
drawerResult.ResultCode = code; drawerResult.ResultCode = code;
} }
/// <summary> /// <summary>
/// 通过料格结果得出抽屉结果
/// </summary>
public static int SetDrawerResultWithGrid(string drawername)
{
if (!isInit)
return -1;
DrawerResult drawerResult = DrawerResults.Find(s => s.DrawerName.Equals(drawername));
PosDebugResult posDebugResult = drawerResult.PosResultList.Find(s => s.ResCode.Equals(0) || s.ResCode.Equals(-1));
if (posDebugResult == null)
{
drawerResult.ResultCode = 1;
return 1;
}
else
{
drawerResult.ResultCode = 0;
return 0;
}
}
/// <summary>
/// 设置料格的状态 /// 设置料格的状态
/// </summary> /// </summary>
/// <param name="drawername">抽屉名</param> /// <param name="drawername">抽屉名</param>
......
...@@ -158,7 +158,26 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -158,7 +158,26 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary> /// </summary>
[ConfigProAttribute("Validate_Drawer_Y_Error")] [ConfigProAttribute("Validate_Drawer_Y_Error")]
public float Validate_Drawer_Y_Error { get; set; } public float Validate_Drawer_Y_Error { get; set; }
/// <summary>
/// A面抽屉对位Mark面积
/// </summary>
[ConfigProAttribute("FindPos_Drawer_A_Area")]
public float FindPos_Drawer_A_Area { get; set; }
/// <summary>
/// A面抽屉验证Mark面积
/// </summary>
[ConfigProAttribute("Validate_Drawer_A_Area")]
public float Validate_Drawer_A_Area { get; set; }
/// <summary>
/// B面抽屉对位Mark面积
/// </summary>
[ConfigProAttribute("FindPos_Drawer_B_Area")]
public float FindPos_Drawer_B_Area { get; set; }
/// <summary>
/// B面抽屉验证Mark面积
/// </summary>
[ConfigProAttribute("Validate_Drawer_B_Area")]
public float Validate_Drawer_B_Area { get; set; }
/// <summary> /// <summary>
/// 抽屉行间距 /// 抽屉行间距
...@@ -192,7 +211,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -192,7 +211,7 @@ namespace OnlineStore.LoadCSVLibrary
public int Cols_In_Drawer { get; set; } public int Cols_In_Drawer { get; set; }
/// <summary> /// <summary>
/// 行走机构视觉对位速度 /// 行走机构调试速度
/// </summary> /// </summary>
[ConfigProAttribute("MoveAxis_FindPosSpeed")] [ConfigProAttribute("MoveAxis_FindPosSpeed")]
public int MoveAxis_FindPosSpeed { get; set; } public int MoveAxis_FindPosSpeed { get; set; }
...@@ -208,7 +227,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -208,7 +227,7 @@ namespace OnlineStore.LoadCSVLibrary
public int MoveAxis_NegLimit { get; set; } public int MoveAxis_NegLimit { get; set; }
/// <summary> /// <summary>
/// 升降轴视觉对位速度 /// 升降轴调试速度
/// </summary> /// </summary>
[ConfigProAttribute("UpdownAxis_FindPosSpeed")] [ConfigProAttribute("UpdownAxis_FindPosSpeed")]
public int UpdownAxis_FindPosSpeed { get; set; } public int UpdownAxis_FindPosSpeed { get; set; }
...@@ -223,10 +242,28 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -223,10 +242,28 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("UpdownAxis_NegLimit")] [ConfigProAttribute("UpdownAxis_NegLimit")]
public int UpdownAxis_NegLimit { get; set; } public int UpdownAxis_NegLimit { get; set; }
/// <summary> /// <summary>
/// 拉取升降轴视觉对位速度 /// 拉取升降轴调试速度
/// </summary> /// </summary>
[ConfigProAttribute("PullAxis_Updown_FindPosSpeed")] [ConfigProAttribute("PullAxis_Updown_FindPosSpeed")]
public int PullAxis_Updown_FindPosSpeed { get; set; } public int PullAxis_Updown_FindPosSpeed { get; set; }
/// <summary>
/// 拉取进出轴调试速度
/// </summary>
[ConfigProAttribute("PullAxis_InOut_FindPosSpeed")]
public int PullAxis_InOut_FindPosSpeed { get; set; }
/// <summary>
/// 轴调试速度
/// </summary>
[ConfigProAttribute("XAxis_FindPosSpeed")]
public int XAxis_FindPosSpeed { get; set; }
/// <summary>
/// 压紧轴调试速度
/// </summary>
[ConfigProAttribute("ComAxis_FindPosSpeed")]
public int ComAxis_FindPosSpeed { get; set; }
/// <summary> /// <summary>
/// 拉取升降轴正极限位置 /// 拉取升降轴正极限位置
/// </summary> /// </summary>
......
...@@ -103,6 +103,18 @@ ...@@ -103,6 +103,18 @@
<Compile Include="boxForm\FrmAxisMove.Designer.cs"> <Compile Include="boxForm\FrmAxisMove.Designer.cs">
<DependentUpon>FrmAxisMove.cs</DependentUpon> <DependentUpon>FrmAxisMove.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="boxForm\FrmPosDebug.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="boxForm\FrmPosDebug.Designer.cs">
<DependentUpon>FrmPosDebug.cs</DependentUpon>
</Compile>
<Compile Include="boxForm\FrmPosResult.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="boxForm\FrmPosResult.Designer.cs">
<DependentUpon>FrmPosResult.cs</DependentUpon>
</Compile>
<Compile Include="boxForm\FrmTongsLearn.cs"> <Compile Include="boxForm\FrmTongsLearn.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
...@@ -208,6 +220,12 @@ ...@@ -208,6 +220,12 @@
<EmbeddedResource Include="boxForm\FrmAxisMove.resx"> <EmbeddedResource Include="boxForm\FrmAxisMove.resx">
<DependentUpon>FrmAxisMove.cs</DependentUpon> <DependentUpon>FrmAxisMove.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="boxForm\FrmPosDebug.resx">
<DependentUpon>FrmPosDebug.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="boxForm\FrmPosResult.resx">
<DependentUpon>FrmPosResult.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="boxForm\FrmTongsLearn.resx"> <EmbeddedResource Include="boxForm\FrmTongsLearn.resx">
<DependentUpon>FrmTongsLearn.cs</DependentUpon> <DependentUpon>FrmTongsLearn.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......
...@@ -44,7 +44,9 @@ namespace OnlineStore.XLRStore ...@@ -44,7 +44,9 @@ namespace OnlineStore.XLRStore
FrmAutoFindPos frmAutoFindPos = new FrmAutoFindPos(); FrmAutoFindPos frmAutoFindPos = new FrmAutoFindPos();
AddForm(tabControl1, " 视觉对位 ", frmAutoFindPos); AddForm(tabControl1, " 视觉对位 ", frmAutoFindPos);
FrmTongsLearn learn = new FrmTongsLearn(); FrmTongsLearn learn = new FrmTongsLearn();
AddForm(tabControl1, " 抓手图片训练 ", learn); AddForm(tabControl1, " 抓手训练 ", learn);
FrmPosDebug frmPosDebug = new FrmPosDebug();
AddForm(tabControl1, " 库位调试 ", frmPosDebug);
boxBean.camera_event += BoxBean_camera_event; boxBean.camera_event += BoxBean_camera_event;
IsLoad = true; IsLoad = true;
} }
......
using OnlineStore.DeviceLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace OnlineStore.XLRStore
{
public partial class FrmPosDebug : Form
{
public FrmPosDebug()
{
CheckForIllegalCrossThreadCalls = false;
InitializeComponent();
boxEquip = StoreManager.XLRStore.boxEquip;
}
BoxEquip boxEquip;
private void btnStart_Click(object sender, EventArgs e)
{
if(MessageBox.Show("是否开始库位调试?","提示",MessageBoxButtons.OKCancel).Equals(MessageBoxButtons.OK))
{
boxEquip.posDebugInfo.IsBreak = false;
int startDrawerRow = int.Parse(txtStartDrawerRow.Text);
int startDrawerCol = int.Parse(txtStartDrawerCol.Text);
int endDrawerRow = int.Parse(txtEndDrawerRow.Text);
int endDrawerCol = int.Parse(txtEndDrawerCol.Text);
int startRowInDrawer = int.Parse(txtStartRowInDrawer.Text);
int startColInDrawer = int.Parse(txtStartColInDrawer.Text);
int endRowInDrawer = int.Parse(txtEndRowInDrawer.Text);
int endColInDrawer = int.Parse(txtEndColInDrawer.Text);
boxEquip.posDebugInfo.SetDrawerParam(startDrawerRow,startDrawerCol,endDrawerRow,endDrawerCol);
boxEquip.posDebugInfo.SetGridParam(startRowInDrawer,startColInDrawer,endRowInDrawer,endColInDrawer);
}
}
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
if(radioButton1.Checked)
{
boxEquip.posDebugInfo.PosSide = "AA";
}
if(radioButton2.Checked)
boxEquip.posDebugInfo.PosSide = "BB";
}
private void btnStop_Click(object sender, EventArgs e)
{
if (MessageBox.Show("确认停止库位调试?", "提示", MessageBoxButtons.OKCancel).Equals(MessageBoxButtons.OK))
boxEquip.posDebugInfo.IsBreak = true;
}
FrmPosResult frmPosResult = null;
private void btnPosResult_Click(object sender, EventArgs e)
{
if(frmPosResult ==null)
{
frmPosResult = new FrmPosResult();
frmPosResult.Show();
}
else
{
if(frmPosResult.IsDisposed)
{
frmPosResult = new FrmPosResult();
frmPosResult.Show();
}
else
{
frmPosResult.Activate();
}
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file

namespace OnlineStore.XLRStore
{
partial class FrmPosResult
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.tlpPos = new System.Windows.Forms.TableLayoutPanel();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tlpDrawerA = new System.Windows.Forms.TableLayoutPanel();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.tlpDrawerB = new System.Windows.Forms.TableLayoutPanel();
this.tableLayoutPanel1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.SuspendLayout();
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 2;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 57.86853F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 42.13147F));
this.tableLayoutPanel1.Controls.Add(this.groupBox2, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.groupBox1, 0, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(1004, 721);
this.tableLayoutPanel1.TabIndex = 0;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.tlpPos);
this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox2.Location = new System.Drawing.Point(584, 3);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(417, 715);
this.groupBox2.TabIndex = 1;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "库位结果";
//
// tlpPos
//
this.tlpPos.ColumnCount = 1;
this.tlpPos.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tlpPos.Dock = System.Windows.Forms.DockStyle.Fill;
this.tlpPos.Location = new System.Drawing.Point(3, 17);
this.tlpPos.Name = "tlpPos";
this.tlpPos.RowCount = 1;
this.tlpPos.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tlpPos.Size = new System.Drawing.Size(411, 695);
this.tlpPos.TabIndex = 1;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.tabControl1);
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox1.Location = new System.Drawing.Point(3, 3);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(575, 715);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "抽屉结果";
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(3, 17);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(569, 695);
this.tabControl1.TabIndex = 1;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.tlpDrawerA);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(561, 669);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "A面";
this.tabPage1.UseVisualStyleBackColor = true;
//
// tlpDrawerA
//
this.tlpDrawerA.ColumnCount = 1;
this.tlpDrawerA.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tlpDrawerA.Dock = System.Windows.Forms.DockStyle.Fill;
this.tlpDrawerA.Location = new System.Drawing.Point(3, 3);
this.tlpDrawerA.Name = "tlpDrawerA";
this.tlpDrawerA.RowCount = 1;
this.tlpDrawerA.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tlpDrawerA.Size = new System.Drawing.Size(555, 663);
this.tlpDrawerA.TabIndex = 0;
//
// tabPage2
//
this.tabPage2.Controls.Add(this.tlpDrawerB);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(561, 669);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "B面";
this.tabPage2.UseVisualStyleBackColor = true;
//
// tlpDrawerB
//
this.tlpDrawerB.ColumnCount = 1;
this.tlpDrawerB.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tlpDrawerB.Dock = System.Windows.Forms.DockStyle.Fill;
this.tlpDrawerB.Location = new System.Drawing.Point(3, 3);
this.tlpDrawerB.Name = "tlpDrawerB";
this.tlpDrawerB.RowCount = 1;
this.tlpDrawerB.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tlpDrawerB.Size = new System.Drawing.Size(555, 663);
this.tlpDrawerB.TabIndex = 1;
//
// FrmPosResult
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1004, 721);
this.Controls.Add(this.tableLayoutPanel1);
this.MaximizeBox = false;
this.Name = "FrmPosResult";
this.Text = "库位结果";
this.tableLayoutPanel1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TableLayoutPanel tlpPos;
private System.Windows.Forms.TableLayoutPanel tlpDrawerA;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.TableLayoutPanel tlpDrawerB;
}
}
\ No newline at end of file \ No newline at end of file
using OnlineStore.DeviceLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace OnlineStore.XLRStore
{
public partial class FrmPosResult : Form
{
public FrmPosResult()
{
boxEquip = StoreManager.XLRStore.boxEquip;
DrawerResults = PosDebugResultManager.DrawerResults;
InitializeComponent();
LoadDrawerList();
}
List<DrawerResult> DrawerResults;
BoxEquip boxEquip;
protected Dictionary<string, UCStatusPanel> DrawerControlList = new Dictionary<string, UCStatusPanel>();
private void LoadDrawerList()
{
this.tlpDrawerA.RowStyles.Clear();
this.tlpDrawerA.ColumnStyles.Clear();
this.tlpDrawerA.RowCount = boxEquip.Config.Drawer_Rows;
this.tlpDrawerA.ColumnCount = boxEquip.Config.Drawer_Columns;
string cid = boxEquip.Config.CID;
for (int rowindex = 0; rowindex < boxEquip.Config.Drawer_Rows; rowindex++)
{
tlpDrawerA.RowStyles.Add(new RowStyle(SizeType.Absolute, 38));
for (int colindex = 0; colindex < boxEquip.Config.Drawer_Columns; colindex++)
{
tlpDrawerA.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 87));
UCStatusPanel control = new UCStatusPanel();
control.ControlName = $"{cid}AA{(rowindex+1).ToString("00")}{(colindex+1).ToString("00")}";
control.Click += Control_Click;
this.tlpDrawerA.Controls.Add(control, colindex, rowindex);
DrawerControlList.Add(control.ControlName, control);
}
}
this.tlpDrawerB.RowStyles.Clear();
this.tlpDrawerB.ColumnStyles.Clear();
this.tlpDrawerB.RowCount = boxEquip.Config.Drawer_Rows;
this.tlpDrawerB.ColumnCount = boxEquip.Config.Drawer_Columns;
for (int rowindex = 0; rowindex < boxEquip.Config.Drawer_Rows; rowindex++)
{
tlpDrawerB.RowStyles.Add(new RowStyle(SizeType.Absolute, 38));
for (int colindex = 0; colindex < boxEquip.Config.Drawer_Columns; colindex++)
{
tlpDrawerB.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 87));
UCStatusPanel control = new UCStatusPanel();
control.ControlName = $"{cid}BB{(rowindex+1).ToString("00")}{(colindex+1).ToString("00")}";
control.Click += Control_Click;
this.tlpDrawerB.Controls.Add(control, colindex, rowindex);
DrawerControlList.Add(control.ControlName, control);
}
}
this.tlpPos.RowStyles.Clear();
this.tlpPos.ColumnStyles.Clear();
this.tlpPos.AutoScroll = true;
this.tlpPos.RowCount = boxEquip.Config.Cols_In_Drawer;
this.tlpPos.ColumnCount = boxEquip.Config.Rows_In_Drawer;
for (int rowindex = 0; rowindex < boxEquip.Config.Cols_In_Drawer; rowindex++)
{
tlpPos.RowStyles.Add(new RowStyle(SizeType.Absolute, 38));
for (int colindex = 0; colindex < boxEquip.Config.Rows_In_Drawer; colindex++)
{
tlpPos.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 87));
UCStatusPanel control = new UCStatusPanel();
control.ControlName = $"{(colindex+1).ToString("00")}{(rowindex+1).ToString("00")}";
this.tlpPos.Controls.Add(control, colindex, rowindex);
}
}
this.SuspendLayout();
}
private void Control_Click(object sender, EventArgs e)
{
throw new NotImplementedException();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
 
namespace OnlineStore.XLRStore.boxForm.userControl namespace OnlineStore.XLRStore
{ {
partial class UCStatusPanel partial class UCStatusPanel
{ {
...@@ -38,18 +38,19 @@ namespace OnlineStore.XLRStore.boxForm.userControl ...@@ -38,18 +38,19 @@ namespace OnlineStore.XLRStore.boxForm.userControl
this.lblStatus.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblStatus.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblStatus.Location = new System.Drawing.Point(0, 0); this.lblStatus.Location = new System.Drawing.Point(0, 0);
this.lblStatus.Name = "lblStatus"; this.lblStatus.Name = "lblStatus";
this.lblStatus.Size = new System.Drawing.Size(150, 38); this.lblStatus.Size = new System.Drawing.Size(87, 38);
this.lblStatus.TabIndex = 0; this.lblStatus.TabIndex = 0;
this.lblStatus.Text = "05BB01010101"; this.lblStatus.Text = "05BB0101";
this.lblStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// UCStatusPanel // UCStatusPanel
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
this.Controls.Add(this.lblStatus); this.Controls.Add(this.lblStatus);
this.Name = "UCStatusPanel"; this.Name = "UCStatusPanel";
this.Size = new System.Drawing.Size(150, 38); this.Size = new System.Drawing.Size(87, 38);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
......
...@@ -8,7 +8,7 @@ using System.Text; ...@@ -8,7 +8,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
namespace OnlineStore.XLRStore.boxForm.userControl namespace OnlineStore.XLRStore
{ {
public partial class UCStatusPanel : UserControl public partial class UCStatusPanel : UserControl
{ {
...@@ -16,5 +16,24 @@ namespace OnlineStore.XLRStore.boxForm.userControl ...@@ -16,5 +16,24 @@ namespace OnlineStore.XLRStore.boxForm.userControl
{ {
InitializeComponent(); InitializeComponent();
} }
private string ctlName = "";
public string ControlName { get { return ctlName; } set { ctlName = value;lblStatus.Text = value; } }
public int ResultCode { get; set; }
public void ShowResult()
{
switch(ResultCode)
{
case -1:
this.BackColor = Color.FromArgb(255, 255, 192);
break;
case 0:
this.BackColor = Color.Red;
break;
case 1:
this.BackColor = Color.GreenYellow;
break;
}
}
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!