Commit 0acddeec 几米阳光

AI3作为检测料盘大小的信号

1 个父辈 a3002d6c
...@@ -85,12 +85,13 @@ ...@@ -85,12 +85,13 @@
// //
// btnMiddleMove // btnMiddleMove
// //
this.btnMiddleMove.BackColor = System.Drawing.SystemColors.Control;
this.btnMiddleMove.Location = new System.Drawing.Point(266, 70); this.btnMiddleMove.Location = new System.Drawing.Point(266, 70);
this.btnMiddleMove.Name = "btnMiddleMove"; this.btnMiddleMove.Name = "btnMiddleMove";
this.btnMiddleMove.Size = new System.Drawing.Size(131, 36); this.btnMiddleMove.Size = new System.Drawing.Size(131, 36);
this.btnMiddleMove.TabIndex = 4; this.btnMiddleMove.TabIndex = 4;
this.btnMiddleMove.Text = "旋转轴+(顺时针)"; this.btnMiddleMove.Text = "旋转轴+(顺时针)";
this.btnMiddleMove.UseVisualStyleBackColor = true; this.btnMiddleMove.UseVisualStyleBackColor = false;
this.btnMiddleMove.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnMiddleMove_MouseDown); this.btnMiddleMove.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnMiddleMove_MouseDown);
this.btnMiddleMove.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnMiddleMove_MouseUp); this.btnMiddleMove.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnMiddleMove_MouseUp);
// //
...@@ -117,56 +118,61 @@ ...@@ -117,56 +118,61 @@
// //
// btnUpDownMove // btnUpDownMove
// //
this.btnUpDownMove.BackColor = System.Drawing.SystemColors.Control;
this.btnUpDownMove.Location = new System.Drawing.Point(266, 124); this.btnUpDownMove.Location = new System.Drawing.Point(266, 124);
this.btnUpDownMove.Name = "btnUpDownMove"; this.btnUpDownMove.Name = "btnUpDownMove";
this.btnUpDownMove.Size = new System.Drawing.Size(131, 36); this.btnUpDownMove.Size = new System.Drawing.Size(131, 36);
this.btnUpDownMove.TabIndex = 9; this.btnUpDownMove.TabIndex = 9;
this.btnUpDownMove.Text = "升降轴+(上升)"; this.btnUpDownMove.Text = "升降轴+(上升)";
this.btnUpDownMove.UseVisualStyleBackColor = true; this.btnUpDownMove.UseVisualStyleBackColor = false;
this.btnUpDownMove.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnUpDownMove_MouseDown); this.btnUpDownMove.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnUpDownMove_MouseDown);
this.btnUpDownMove.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnUpDownMove_MouseUp); this.btnUpDownMove.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnUpDownMove_MouseUp);
// //
// btnInOutMove // btnInOutMove
// //
this.btnInOutMove.BackColor = System.Drawing.SystemColors.Control;
this.btnInOutMove.Location = new System.Drawing.Point(266, 177); this.btnInOutMove.Location = new System.Drawing.Point(266, 177);
this.btnInOutMove.Name = "btnInOutMove"; this.btnInOutMove.Name = "btnInOutMove";
this.btnInOutMove.Size = new System.Drawing.Size(131, 36); this.btnInOutMove.Size = new System.Drawing.Size(131, 36);
this.btnInOutMove.TabIndex = 10; this.btnInOutMove.TabIndex = 10;
this.btnInOutMove.Text = "进出轴+(前进)"; this.btnInOutMove.Text = "进出轴+(前进)";
this.btnInOutMove.UseVisualStyleBackColor = true; this.btnInOutMove.UseVisualStyleBackColor = false;
this.btnInOutMove.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnInOutMove_MouseDown); this.btnInOutMove.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnInOutMove_MouseDown);
this.btnInOutMove.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnInOutMove_MouseUp); this.btnInOutMove.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnInOutMove_MouseUp);
// //
// btnInOutMovej // btnInOutMovej
// //
this.btnInOutMovej.BackColor = System.Drawing.SystemColors.Control;
this.btnInOutMovej.Location = new System.Drawing.Point(401, 177); this.btnInOutMovej.Location = new System.Drawing.Point(401, 177);
this.btnInOutMovej.Name = "btnInOutMovej"; this.btnInOutMovej.Name = "btnInOutMovej";
this.btnInOutMovej.Size = new System.Drawing.Size(131, 36); this.btnInOutMovej.Size = new System.Drawing.Size(131, 36);
this.btnInOutMovej.TabIndex = 14; this.btnInOutMovej.TabIndex = 14;
this.btnInOutMovej.Text = "进出轴-(后退)"; this.btnInOutMovej.Text = "进出轴-(后退)";
this.btnInOutMovej.UseVisualStyleBackColor = true; this.btnInOutMovej.UseVisualStyleBackColor = false;
this.btnInOutMovej.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnInOutMovej_MouseDown); this.btnInOutMovej.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnInOutMovej_MouseDown);
this.btnInOutMovej.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnInOutMovej_MouseUp); this.btnInOutMovej.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnInOutMovej_MouseUp);
// //
// btnUpDownMovej // btnUpDownMovej
// //
this.btnUpDownMovej.BackColor = System.Drawing.SystemColors.Control;
this.btnUpDownMovej.Location = new System.Drawing.Point(401, 124); this.btnUpDownMovej.Location = new System.Drawing.Point(401, 124);
this.btnUpDownMovej.Name = "btnUpDownMovej"; this.btnUpDownMovej.Name = "btnUpDownMovej";
this.btnUpDownMovej.Size = new System.Drawing.Size(131, 36); this.btnUpDownMovej.Size = new System.Drawing.Size(131, 36);
this.btnUpDownMovej.TabIndex = 13; this.btnUpDownMovej.TabIndex = 13;
this.btnUpDownMovej.Text = "升降轴-(下降)"; this.btnUpDownMovej.Text = "升降轴-(下降)";
this.btnUpDownMovej.UseVisualStyleBackColor = true; this.btnUpDownMovej.UseVisualStyleBackColor = false;
this.btnUpDownMovej.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnUpDownMovej_MouseDown); this.btnUpDownMovej.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnUpDownMovej_MouseDown);
this.btnUpDownMovej.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnUpDownMovej_MouseUp); this.btnUpDownMovej.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnUpDownMovej_MouseUp);
// //
// btnMiddleMovej // btnMiddleMovej
// //
this.btnMiddleMovej.BackColor = System.Drawing.SystemColors.Control;
this.btnMiddleMovej.Location = new System.Drawing.Point(401, 70); this.btnMiddleMovej.Location = new System.Drawing.Point(401, 70);
this.btnMiddleMovej.Name = "btnMiddleMovej"; this.btnMiddleMovej.Name = "btnMiddleMovej";
this.btnMiddleMovej.Size = new System.Drawing.Size(131, 36); this.btnMiddleMovej.Size = new System.Drawing.Size(131, 36);
this.btnMiddleMovej.TabIndex = 12; this.btnMiddleMovej.TabIndex = 12;
this.btnMiddleMovej.Text = "旋转轴-(逆时针)"; this.btnMiddleMovej.Text = "旋转轴-(逆时针)";
this.btnMiddleMovej.UseVisualStyleBackColor = true; this.btnMiddleMovej.UseVisualStyleBackColor = false;
this.btnMiddleMovej.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnMiddleMovej_MouseDown); this.btnMiddleMovej.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnMiddleMovej_MouseDown);
this.btnMiddleMovej.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnMiddleMovej_MouseUp); this.btnMiddleMovej.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnMiddleMovej_MouseUp);
// //
...@@ -233,23 +239,25 @@ ...@@ -233,23 +239,25 @@
// //
// btnComMovej // btnComMovej
// //
this.btnComMovej.BackColor = System.Drawing.SystemColors.Control;
this.btnComMovej.Location = new System.Drawing.Point(401, 235); this.btnComMovej.Location = new System.Drawing.Point(401, 235);
this.btnComMovej.Name = "btnComMovej"; this.btnComMovej.Name = "btnComMovej";
this.btnComMovej.Size = new System.Drawing.Size(131, 36); this.btnComMovej.Size = new System.Drawing.Size(131, 36);
this.btnComMovej.TabIndex = 25; this.btnComMovej.TabIndex = 25;
this.btnComMovej.Text = "压紧轴-(向下)"; this.btnComMovej.Text = "压紧轴-(向下)";
this.btnComMovej.UseVisualStyleBackColor = true; this.btnComMovej.UseVisualStyleBackColor = false;
this.btnComMovej.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnComMovej_MouseDown); this.btnComMovej.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnComMovej_MouseDown);
this.btnComMovej.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnComMovej_MouseUp); this.btnComMovej.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnComMovej_MouseUp);
// //
// btnComMove // btnComMove
// //
this.btnComMove.BackColor = System.Drawing.SystemColors.Control;
this.btnComMove.Location = new System.Drawing.Point(266, 235); this.btnComMove.Location = new System.Drawing.Point(266, 235);
this.btnComMove.Name = "btnComMove"; this.btnComMove.Name = "btnComMove";
this.btnComMove.Size = new System.Drawing.Size(131, 36); this.btnComMove.Size = new System.Drawing.Size(131, 36);
this.btnComMove.TabIndex = 24; this.btnComMove.TabIndex = 24;
this.btnComMove.Text = "压紧轴+(向上)"; this.btnComMove.Text = "压紧轴+(向上)";
this.btnComMove.UseVisualStyleBackColor = true; this.btnComMove.UseVisualStyleBackColor = false;
this.btnComMove.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnComMove_MouseDown); this.btnComMove.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnComMove_MouseDown);
this.btnComMove.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnComMove_MouseUp); this.btnComMove.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnComMove_MouseUp);
// //
......
...@@ -61,6 +61,8 @@ ...@@ -61,6 +61,8 @@
this.label4 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label();
this.txtAI1 = new System.Windows.Forms.TextBox(); this.txtAI1 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.txtSize = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.groupBox4.SuspendLayout(); this.groupBox4.SuspendLayout();
this.groupBox3.SuspendLayout(); this.groupBox3.SuspendLayout();
...@@ -462,6 +464,8 @@ ...@@ -462,6 +464,8 @@
// //
// groupBox2 // groupBox2
// //
this.groupBox2.Controls.Add(this.txtSize);
this.groupBox2.Controls.Add(this.label10);
this.groupBox2.Controls.Add(this.txtHeight); this.groupBox2.Controls.Add(this.txtHeight);
this.groupBox2.Controls.Add(this.label9); this.groupBox2.Controls.Add(this.label9);
this.groupBox2.Controls.Add(this.label8); this.groupBox2.Controls.Add(this.label8);
...@@ -485,10 +489,10 @@ ...@@ -485,10 +489,10 @@
// //
this.txtHeight.Enabled = false; this.txtHeight.Enabled = false;
this.txtHeight.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.txtHeight.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtHeight.Location = new System.Drawing.Point(113, 116); this.txtHeight.Location = new System.Drawing.Point(89, 116);
this.txtHeight.MaxLength = 10; this.txtHeight.MaxLength = 10;
this.txtHeight.Name = "txtHeight"; this.txtHeight.Name = "txtHeight";
this.txtHeight.Size = new System.Drawing.Size(211, 23); this.txtHeight.Size = new System.Drawing.Size(71, 23);
this.txtHeight.TabIndex = 254; this.txtHeight.TabIndex = 254;
this.txtHeight.Text = "0"; this.txtHeight.Text = "0";
// //
...@@ -499,9 +503,9 @@ ...@@ -499,9 +503,9 @@
this.label9.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; this.label9.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label9.Location = new System.Drawing.Point(15, 119); this.label9.Location = new System.Drawing.Point(15, 119);
this.label9.Name = "label9"; this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(92, 17); this.label9.Size = new System.Drawing.Size(68, 17);
this.label9.TabIndex = 253; this.label9.TabIndex = 253;
this.label9.Text = "实时料盘高度:"; this.label9.Text = "料盘高度:";
this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
// //
// label8 // label8
...@@ -618,6 +622,29 @@ ...@@ -618,6 +622,29 @@
this.label1.Text = "1:"; this.label1.Text = "1:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
// //
// txtSize
//
this.txtSize.Enabled = false;
this.txtSize.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtSize.Location = new System.Drawing.Point(253, 116);
this.txtSize.MaxLength = 10;
this.txtSize.Name = "txtSize";
this.txtSize.Size = new System.Drawing.Size(71, 23);
this.txtSize.TabIndex = 256;
this.txtSize.Text = "0";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label10.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label10.Location = new System.Drawing.Point(179, 119);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(68, 17);
this.label10.TabIndex = 255;
this.label10.Text = "料盘尺寸:";
this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// FrmIOStatus // FrmIOStatus
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
...@@ -694,6 +721,8 @@ ...@@ -694,6 +721,8 @@
private System.Windows.Forms.Label label8; private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox txtHeight; private System.Windows.Forms.TextBox txtHeight;
private System.Windows.Forms.TextBox txtSize;
private System.Windows.Forms.Label label10;
} }
} }
...@@ -226,6 +226,7 @@ namespace OnlineStore.ACSingleStore ...@@ -226,6 +226,7 @@ namespace OnlineStore.ACSingleStore
txtAIResult3.Text = KNDAIManager.ConvertAI(ai3Value, boxBean.Config.AIDI3_DefaultPosition).ToString(); txtAIResult3.Text = KNDAIManager.ConvertAI(ai3Value, boxBean.Config.AIDI3_DefaultPosition).ToString();
txtHeight.Text = boxBean.GetHeight().ToString(); txtHeight.Text = boxBean.GetHeight().ToString();
txtSize.Text = boxBean.GetSize().ToString();
} }
private void btnReadAllDi_Click(object sender, EventArgs e) private void btnReadAllDi_Click(object sender, EventArgs e)
......
...@@ -967,10 +967,20 @@ namespace OnlineStore.DeviceLibrary ...@@ -967,10 +967,20 @@ namespace OnlineStore.DeviceLibrary
{ {
isWaitScan = false; isWaitScan = false;
IsScanCode = true; IsScanCode = true;
LogUtil.info(StoreName + "检测到料盘信号且等待1秒,开始扫码");
//BeginScannering(); //BeginScannering();
//判断料盘尺寸
if (GetSize()<=7)
{
LogUtil.info(StoreName + "检测到寸料盘,开始扫码");
GetCameraCode(); GetCameraCode();
} }
else
{
LogUtil.info(StoreName + "检测到大于7寸的料盘,请放入正确的料盘");
IsScanCode = false ;
}
}
} }
else else
{ {
...@@ -1374,15 +1384,43 @@ namespace OnlineStore.DeviceLibrary ...@@ -1374,15 +1384,43 @@ namespace OnlineStore.DeviceLibrary
#endregion #endregion
#region 高度传感器处理 #region 高度传感器处理
public int GetSize()
{
int result = 0;
double Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, 3), Config.AIDI3_DefaultPosition);
if (Value > 14)
{
result = 16;
}
else if (Value >= 10)
{
result = 12;
}
else if (Value >= 4)
{
result = 8;
}
else
{
result = 0;
}
if (result > 0)
{
return 13;
}else
{
return 7;
}
}
public int GetHeight() public int GetHeight()
{ {
int result = 0; int result = 0;
double ai1Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, 1), Config.AIDI1_DefaultPosition); double ai1Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, 1), Config.AIDI1_DefaultPosition);
double ai2Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, 2), Config.AIDI2_DefaultPosition); double ai2Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, 2), Config.AIDI2_DefaultPosition);
double ai3Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, 3), Config.AIDI3_DefaultPosition); //double ai3Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, 3), Config.AIDI3_DefaultPosition);
double Value = Math.Round((ai1Value + ai2Value + ai3Value) / 3, 1); double Value = Math.Round((ai1Value + ai2Value ) / 2, 1);
//int radValue =(int) ( Value / 4); //int radValue =(int) ( Value / 4);
//double mValue = (Value % 4); //double mValue = (Value % 4);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!