Commit f34cacc2 LN

点料接口修改。

去掉取码气缸前进->>后退动作。
1 个父辈 0fd210bf
......@@ -75,5 +75,96 @@
</summary>
<returns></returns>
</member>
<member name="M:Asa.CarerayImage.GetLocalCount(System.String,System.Double,System.Int32,System.Int32@,Asa.API.EyemImage@)">
<summary>
本地文件小器件点料
</summary>
<param name="path"></param>
<param name="dOffset"></param>
<param name="iWinSize"></param>
<param name="iObjCount"></param>
<param name="tpDstImg"></param>
<returns></returns>
</member>
<member name="M:Asa.CarerayImage.GetLocalCountHuge(System.String,System.Double,System.Int32,System.Int32@,Asa.API.EyemImage@)">
<summary>
本地文件大器件点料
</summary>
<param name="path"></param>
<param name="dOffset"></param>
<param name="iWinSize"></param>
<param name="iObjCount"></param>
<param name="tpDstImg"></param>
<returns></returns>
</member>
<member name="M:Asa.CarerayImage.GetLocalCountIrregular(System.String,System.Double,System.Int32,System.Int32,System.Int32@,Asa.API.EyemImage@)">
<summary>
本地文件异性器件点料
</summary>
<param name="path"></param>
<param name="dOffset"></param>
<param name="type"></param>
<param name="iWinSize"></param>
<param name="iObjCount"></param>
<param name="tpDstImg"></param>
<returns></returns>
</member>
<member name="M:Asa.API.eyemImageRead(System.String,System.Int32,Asa.API.EyemImage@)">
<summary>
读取图像
</summary>
<param name="filename"></param>
<param name="iFalgs"></param>
<param name="ucpImage"></param>
<returns></returns>
</member>
<member name="M:Asa.API.eyemImageFree(System.IntPtr)">
<summary>
释放图像资源
</summary>
<param name="ipImage"></param>
</member>
<member name="M:Asa.API.eyemCountObject(Asa.API.EyemImage,System.String,System.Double,System.Int32,System.Int32,System.Int32,System.Int32@,Asa.API.EyemImage@)">
<summary>
小盘点料
</summary>
<param name="tpSrcImg"></param>
<param name="fileName"></param>
<param name="dOffset"></param>
<param name="iMinArea"></param>
<param name="iMaxArea"></param>
<param name="iWinSize"></param>
<param name="iObjCount"></param>
<param name="tpDstImg"></param>
<returns></returns>
</member>
<member name="M:Asa.API.eyemCountObject4Huge(Asa.API.EyemImage,System.String,System.Double,System.Int32,System.Int32,System.Int32,System.Int32@,Asa.API.EyemImage@)">
<summary>
大盘点料
</summary>
<param name="tpSrcImg"></param>
<param name="fileName"></param>
<param name="dOffset"></param>
<param name="iMinArea"></param>
<param name="iMaxArea"></param>
<param name="iWinSize"></param>
<param name="iObjCount"></param>
<param name="tpDstImg"></param>
<returns></returns>
</member>
<member name="M:Asa.API.eyemCountObjectIrregularParts(Asa.API.EyemImage,System.String,System.Double,System.Int32,System.Int32,System.Int32,System.Int32@,Asa.API.EyemImage@)">
<summary>
异性器件
</summary>
<param name="tpSrcImg"></param>
<param name="fileName"></param>
<param name="dOffset"></param>
<param name="iType"></param>
<param name="iMaxArea"></param>
<param name="iWinSize"></param>
<param name="iObjCount"></param>
<param name="tpDstImg"></param>
<returns></returns>
</member>
</members>
</doc>
CboType.ItemAdd("小器件", "大器件", "异形三角器件", "异形三脚大器件", "异形长条形器件");
if (DeviceType == 0)
{
n = Common.careray.GetLocalCount(imagePath, 1, 1, out iCount, out Asa.API.EyemImage dst);
}
else if (DeviceType == 1)
{
n = Common.careray.GetLocalCountHuge(imagePath, 1, 1, out iCount, out Asa.API.EyemImage dst);
}
else
{
n = Common.careray.GetLocalCountIrregular(imagePath, 1, DeviceType - 2, 1, out iCount, out Asa.API.EyemImage dst);
}
\ No newline at end of file
......@@ -55,8 +55,8 @@
this.tabPage3 = new System.Windows.Forms.TabPage();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.groupBox8 = new System.Windows.Forms.GroupBox();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.cmbType = new System.Windows.Forms.ComboBox();
this.label4 = new System.Windows.Forms.Label();
this.btnSelImage = new System.Windows.Forms.Button();
this.txtImage = new System.Windows.Forms.TextBox();
this.numWSize = new System.Windows.Forms.NumericUpDown();
......@@ -587,8 +587,8 @@
//
// groupBox8
//
this.groupBox8.Controls.Add(this.radioButton2);
this.groupBox8.Controls.Add(this.radioButton1);
this.groupBox8.Controls.Add(this.cmbType);
this.groupBox8.Controls.Add(this.label4);
this.groupBox8.Controls.Add(this.btnSelImage);
this.groupBox8.Controls.Add(this.txtImage);
this.groupBox8.Controls.Add(this.numWSize);
......@@ -599,34 +599,32 @@
this.groupBox8.Controls.Add(this.label2);
this.groupBox8.Controls.Add(this.label1);
this.groupBox8.Controls.Add(this.btnWorkTest);
this.groupBox8.Location = new System.Drawing.Point(600, 306);
this.groupBox8.Location = new System.Drawing.Point(531, 306);
this.groupBox8.Name = "groupBox8";
this.groupBox8.Size = new System.Drawing.Size(660, 168);
this.groupBox8.Size = new System.Drawing.Size(729, 168);
this.groupBox8.TabIndex = 288;
this.groupBox8.TabStop = false;
this.groupBox8.Text = "点料测试";
//
// radioButton2
// cmbType
//
this.radioButton2.AutoSize = true;
this.radioButton2.Location = new System.Drawing.Point(108, 134);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(50, 21);
this.radioButton2.TabIndex = 298;
this.radioButton2.Text = "大料";
this.radioButton2.UseVisualStyleBackColor = true;
this.cmbType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbType.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.cmbType.FormattingEnabled = true;
this.cmbType.Location = new System.Drawing.Point(88, 130);
this.cmbType.Name = "cmbType";
this.cmbType.Size = new System.Drawing.Size(121, 28);
this.cmbType.TabIndex = 300;
this.cmbType.SelectedIndexChanged += new System.EventHandler(this.cmbType_SelectedIndexChanged);
//
// radioButton1
// label4
//
this.radioButton1.AutoSize = true;
this.radioButton1.Checked = true;
this.radioButton1.Location = new System.Drawing.Point(26, 134);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(50, 21);
this.radioButton1.TabIndex = 297;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "小料";
this.radioButton1.UseVisualStyleBackColor = true;
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(14, 136);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(68, 17);
this.label4.TabIndex = 299;
this.label4.Text = "元器类型:";
//
// btnSelImage
//
......@@ -694,7 +692,7 @@
this.btnSaveTh.BackColor = System.Drawing.Color.White;
this.btnSaveTh.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSaveTh.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSaveTh.Location = new System.Drawing.Point(201, 63);
this.btnSaveTh.Location = new System.Drawing.Point(244, 72);
this.btnSaveTh.Name = "btnSaveTh";
this.btnSaveTh.Size = new System.Drawing.Size(130, 35);
this.btnSaveTh.TabIndex = 290;
......@@ -705,7 +703,7 @@
// txtResult
//
this.txtResult.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtResult.Location = new System.Drawing.Point(399, 115);
this.txtResult.Location = new System.Drawing.Point(442, 124);
this.txtResult.Name = "txtResult";
this.txtResult.Size = new System.Drawing.Size(82, 26);
this.txtResult.TabIndex = 289;
......@@ -713,7 +711,7 @@
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(349, 120);
this.label2.Location = new System.Drawing.Point(392, 129);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(44, 17);
this.label2.TabIndex = 288;
......@@ -733,7 +731,7 @@
this.btnWorkTest.BackColor = System.Drawing.Color.White;
this.btnWorkTest.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnWorkTest.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnWorkTest.Location = new System.Drawing.Point(201, 111);
this.btnWorkTest.Location = new System.Drawing.Point(244, 120);
this.btnWorkTest.Name = "btnWorkTest";
this.btnWorkTest.Size = new System.Drawing.Size(130, 35);
this.btnWorkTest.TabIndex = 285;
......@@ -748,7 +746,7 @@
this.groupBox7.Controls.Add(this.btnXStop);
this.groupBox7.Location = new System.Drawing.Point(294, 306);
this.groupBox7.Name = "groupBox7";
this.groupBox7.Size = new System.Drawing.Size(300, 168);
this.groupBox7.Size = new System.Drawing.Size(225, 168);
this.groupBox7.TabIndex = 283;
this.groupBox7.TabStop = false;
this.groupBox7.Text = "X光测试";
......@@ -758,7 +756,7 @@
this.btnImage.BackColor = System.Drawing.Color.White;
this.btnImage.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnImage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnImage.Location = new System.Drawing.Point(158, 63);
this.btnImage.Location = new System.Drawing.Point(69, 73);
this.btnImage.Name = "btnImage";
this.btnImage.Size = new System.Drawing.Size(130, 35);
this.btnImage.TabIndex = 287;
......@@ -771,7 +769,7 @@
this.btnXStart.BackColor = System.Drawing.Color.White;
this.btnXStart.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnXStart.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnXStart.Location = new System.Drawing.Point(22, 39);
this.btnXStart.Location = new System.Drawing.Point(22, 24);
this.btnXStart.Name = "btnXStart";
this.btnXStart.Size = new System.Drawing.Size(130, 35);
this.btnXStart.TabIndex = 286;
......@@ -784,7 +782,7 @@
this.btnXStop.BackColor = System.Drawing.Color.White;
this.btnXStop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnXStop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnXStop.Location = new System.Drawing.Point(22, 96);
this.btnXStop.Location = new System.Drawing.Point(22, 122);
this.btnXStop.Name = "btnXStop";
this.btnXStop.Size = new System.Drawing.Size(130, 35);
this.btnXStop.TabIndex = 285;
......@@ -1025,8 +1023,8 @@
private System.Windows.Forms.TextBox txtImage;
private System.Windows.Forms.Button btnSelImage;
private System.IO.FileSystemWatcher fileSystemWatcher1;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.ComboBox cmbType;
private System.Windows.Forms.Label label4;
}
}
......@@ -22,6 +22,7 @@ namespace OnlineStore.AutoCountClient
{
internal partial class FrmXRay : FrmEquipBase
{
private int DeviceType = 0;
private bool IsLoad = false;
private X_RAY_Equip equipBean;
......@@ -35,6 +36,8 @@ namespace OnlineStore.AutoCountClient
}
private void FrmStoreIOStatus_Load(object sender, EventArgs e)
{
cmbType.Items.AddRange(new string[] { "小器件", "大器件", "异形三角器件", "异形三脚大器件", "异形长条形器件" });
cmbType.SelectedIndex = DeviceType;
chbDebug.Checked = equipBean.IsDebug;
lblCom.Text = "X射线端口号:" + equipBean.Config.XRay_Port;
......@@ -446,14 +449,19 @@ namespace OnlineStore.AutoCountClient
int outCount = 0;
// equipBean.countImage.GetCount(th, out outCount);
int n = 0;
if (radioButton1.Checked)
if (DeviceType.Equals(0))
{
n = equipBean.carerayImage.GetLocalCount(filePath, th, wsize, out outCount, out Asa.API.EyemImage tpDstImg);
}
else
else if(DeviceType.Equals(1))
{
n = equipBean.carerayImage.GetLocalCountHuge(filePath, th, wsize, out outCount, out Asa.API.EyemImage tpDstImg);
}
else
{
int type = DeviceType - 2;
n = equipBean.carerayImage.GetLocalCountIrregular(filePath, th, type, wsize, out outCount, out Asa.API.EyemImage dst);
}
txtResult.Text = outCount.ToString();
LogUtil.info(equipBean.Name + "用户点击 点料测试【" + filePath + "】【" + th + "】【" + wsize + "】 结果[" + n + "]:" + outCount);
}
......@@ -488,6 +496,20 @@ namespace OnlineStore.AutoCountClient
}
txtImage.Text = openDialog.FileName;
}
private void cmbType_SelectedIndexChanged(object sender, EventArgs e)
{
if (!IsLoad)
{
return;
}
int index = cmbType.SelectedIndex;
if (index >= 0)
{
DeviceType = index;
LogUtil.info(Name + " " + equipBean.Name + " 更改 equipBean.DeviceType=" + index);
}
}
}
}
......
......@@ -91,3 +91,8 @@ data=1,IFneed=需要
2.图片名称+RID
3.两侧都需要取目标位置。
20200803
点料接口修改。
去掉取码气缸前进->>后退动作。
IO_Type.TakeCode_Back, IO_Type.TakeCode_Forward
\ No newline at end of file
......@@ -328,10 +328,10 @@ namespace OnlineStore.DeviceLibrary
SecMoveInfo.MoveParam = param;
NeedPrint = ConfigAppSettings.GetIntValue(Setting_Init.NeedPrintLabel).Equals(1);
SecMoveInfo.NextMoveStep(StepEnum.OL01_Paste_Back);
SecWorkLog(" 启动贴标: 贴标气缸后退,吸盘停止输出,贴标Z轴到待机点P1,取码气缸前进");
SecWorkLog(" 启动贴标: 贴标气缸后退,吸盘停止输出,贴标Z轴到待机点P1 ");
IOMove(IO_Type.Nozzle_Work, IO_VALUE.LOW);
CylinderMove(SecMoveInfo, IO_Type.PasteCode_Forward, IO_Type.PasteCode_Back);
CylinderMove(SecMoveInfo, IO_Type.TakeCode_Back, IO_Type.TakeCode_Forward);
//CylinderMove(SecMoveInfo, IO_Type.TakeCode_Back, IO_Type.TakeCode_Forward);
if (!LabelZAxis.IsInPosition(Config.LabelZ_P1))
{
LabelZAxis.AbsMove(SecMoveInfo, Config.LabelZ_P1, Config.LabelZ_P1Speed);
......@@ -384,8 +384,8 @@ namespace OnlineStore.DeviceLibrary
if (isPrintOk || isTimeOut || (!NeedPrint))
{
SecMoveInfo.NextMoveStep(StepEnum.OL05_TakeBack);
SecWorkLog("贴标: 打印结束[" + RobotManager.LastPrintStatus + "][" + (isTimeOut ? "超时120秒" : "") + "],取码气缸后退");
CylinderMove(SecMoveInfo, IO_Type.TakeCode_Forward, IO_Type.TakeCode_Back);
SecWorkLog("贴标: 打印结束[" + RobotManager.LastPrintStatus + "][" + (isTimeOut ? "超时120秒" : "") + "], ");
//CylinderMove(SecMoveInfo, IO_Type.TakeCode_Forward, IO_Type.TakeCode_Back);
}
}else if (MoveInfo.IsTimeOut(120))
{
......@@ -509,11 +509,11 @@ namespace OnlineStore.DeviceLibrary
else if (SecMoveInfo.IsStep(StepEnum.OL18_LableBack))
{
SecMoveInfo.NextMoveStep(StepEnum.OL19_XYRBackToP2);
SecWorkLog("贴标: XYR返回待机点P2,取码气缸前进");
SecWorkLog("贴标: XYR返回待机点P2, ");
LabelXAxis.AbsMove(SecMoveInfo, Config.LabelX_P2, Config.LabelX_P2Speed);
LabelYAxis.AbsMove(SecMoveInfo, Config.LabelY_P2, Config.LabelY_P2Speed);
LabelRAxis.AbsMove(SecMoveInfo, Config.LabelR_P2, Config.LabelR_P2Speed);
CylinderMove(SecMoveInfo, IO_Type.TakeCode_Back, IO_Type.TakeCode_Forward);
//CylinderMove(SecMoveInfo, IO_Type.TakeCode_Back, IO_Type.TakeCode_Forward);
}
else if (SecMoveInfo.IsStep(StepEnum.OL19_XYRBackToP2))
{
......
......@@ -354,11 +354,17 @@ namespace OnlineStore.DeviceLibrary
WorkLog("点料:开始调用 carerayImage.GetLocalCount ");
n = carerayImage.GetLocalCount(fileP, lastParam.Threshold, lastParam.WindowSize, out count, out Asa.API.EyemImage tpDstImg);
}
else
else if(lastParam.Sign.Equals(1))
{
WorkLog("点料:开始调用 carerayImage.GetLocalCountHuge ");
n = carerayImage.GetLocalCountHuge(fileP, lastParam.Threshold, lastParam.WindowSize, out count, out Asa.API.EyemImage tpDstImg);
}
else
{
int type = lastParam.Sign - 2;
WorkLog("点料:开始调用 carerayImage.GetLocalCountIrregular ");
n = carerayImage.GetLocalCountIrregular(fileP, lastParam.Threshold, type, lastParam.WindowSize, out count, out Asa.API.EyemImage dst);
}
bool isNg = false;
string NgMsg = "";
......
......@@ -251,38 +251,7 @@ namespace OnlineStore.LoadCSVLibrary
/// DO,3,打码机取码气缸后退SOL,TakeCode_Back,9,PRO_AOI_IP_3,Y40,,,,,,,,,,
/// </summary>
public static string TakeCode_Back = "TakeCode_Back";
///// <summary>
///// DO,3,下料机构入口线体顶升上升SOL,O_ELine_TopUp,10,PRO_AOI_IP_3,Y41,,,,,,,,,,
///// </summary>
//public static string O_ELine_TopUp = "O_ELine_TopUp";
///// <summary>
///// DO,3,下料机构入口线体顶升下降SOL,O_ELine_TopDown,11,PRO_AOI_IP_3,Y42,,,,,,,,,,
///// </summary>
//public static string O_ELine_TopDown = "O_ELine_TopDown";
///// <summary>
///// DI,3,下料机构急停,SuddenStop_BTN,0,PRO_AOI_IP_4,X51,,,,,,,,,,
///// </summary>
//public static string SuddenStop_BTN = "SuddenStop_BTN";
///// <summary>
///// DI,3,下料机构复位,Reset_BTN,1,PRO_AOI_IP_4,X52,,,,,,,,,,
///// </summary>
//public static string Reset_BTN = "Reset_BTN";
///// <summary>
///// DI,3,下料机构联动,Start_BTN,2,PRO_AOI_IP_4,X53,,,,,,,,,,
///// </summary>
//public static string Start_BTN = "Start_BTN";
///// <summary>
///// DI,3,打码机取码气缸前进端,TakeCode_Forward,3,PRO_AOI_IP_4,X54,,,,,,,,,,
///// </summary>
//public static string TakeCode_Forward = "TakeCode_Forward";
///// <summary>
///// DI,3,打码机取码气缸后退端,TakeCode_Back,4,PRO_AOI_IP_4,X55,,,,,,,,,,
///// </summary>
//public static string TakeCode_Back = "TakeCode_Back";
///// <summary>
///// DI,3,X光点料机皮带出口检测,XRay_OutCheck,5,PRO_AOI_IP_4,X56,,,,,,,,,,
///// </summary>
//public static string XRay_OutCheck = "XRay_OutCheck";
/// <summary>
/// DI,3,出口皮带线料盘检测,Out_TrayCheck,6,PRO_AOI_IP_4,X57,,,,,,,,,,
/// </summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!