Commit e7c7b2c1 LN

夹爪修改

1 个父辈 3493e779
......@@ -30,16 +30,18 @@ namespace OnlineStore.AssemblyLine.useControl
private void InitializeComponent()
{
this.groupClamp = new System.Windows.Forms.GroupBox();
this.lblIsMoving = new System.Windows.Forms.Label();
this.btnReset = new System.Windows.Forms.Button();
this.lblErrorCode = new System.Windows.Forms.Label();
this.lblEmpty = new System.Windows.Forms.Label();
this.btnHome = new System.Windows.Forms.Button();
this.lblMoveOk = new System.Windows.Forms.Label();
this.lblReached = new System.Windows.Forms.Label();
this.lblPosition = new System.Windows.Forms.Label();
this.lblForce = new System.Windows.Forms.Label();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.btnClampWork = new System.Windows.Forms.Button();
this.btnClampRelax = new System.Windows.Forms.Button();
this.lblErrorCode = new System.Windows.Forms.Label();
this.btnReset = new System.Windows.Forms.Button();
this.lblSensor = new System.Windows.Forms.Label();
this.groupClamp.SuspendLayout();
this.SuspendLayout();
//
......@@ -48,11 +50,13 @@ namespace OnlineStore.AssemblyLine.useControl
this.groupClamp.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupClamp.Controls.Add(this.lblSensor);
this.groupClamp.Controls.Add(this.lblIsMoving);
this.groupClamp.Controls.Add(this.btnReset);
this.groupClamp.Controls.Add(this.lblErrorCode);
this.groupClamp.Controls.Add(this.lblEmpty);
this.groupClamp.Controls.Add(this.btnHome);
this.groupClamp.Controls.Add(this.lblMoveOk);
this.groupClamp.Controls.Add(this.lblReached);
this.groupClamp.Controls.Add(this.lblPosition);
this.groupClamp.Controls.Add(this.lblForce);
this.groupClamp.Controls.Add(this.linkLabel1);
......@@ -66,10 +70,41 @@ namespace OnlineStore.AssemblyLine.useControl
this.groupClamp.TabStop = false;
this.groupClamp.Text = "夹爪操作";
//
// lblIsMoving
//
this.lblIsMoving.AutoSize = true;
this.lblIsMoving.Location = new System.Drawing.Point(149, 131);
this.lblIsMoving.Name = "lblIsMoving";
this.lblIsMoving.Size = new System.Drawing.Size(56, 17);
this.lblIsMoving.TabIndex = 293;
this.lblIsMoving.Text = "运动中?";
//
// btnReset
//
this.btnReset.BackColor = System.Drawing.Color.White;
this.btnReset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnReset.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnReset.Location = new System.Drawing.Point(12, 141);
this.btnReset.Name = "btnReset";
this.btnReset.Size = new System.Drawing.Size(120, 34);
this.btnReset.TabIndex = 292;
this.btnReset.Text = "夹爪复位";
this.btnReset.UseVisualStyleBackColor = false;
this.btnReset.Click += new System.EventHandler(this.btnReset_Click);
//
// lblErrorCode
//
this.lblErrorCode.AutoSize = true;
this.lblErrorCode.ForeColor = System.Drawing.Color.Red;
this.lblErrorCode.Location = new System.Drawing.Point(149, 154);
this.lblErrorCode.Name = "lblErrorCode";
this.lblErrorCode.Size = new System.Drawing.Size(0, 17);
this.lblErrorCode.TabIndex = 291;
//
// lblEmpty
//
this.lblEmpty.AutoSize = true;
this.lblEmpty.Location = new System.Drawing.Point(159, 71);
this.lblEmpty.Location = new System.Drawing.Point(149, 85);
this.lblEmpty.Name = "lblEmpty";
this.lblEmpty.Size = new System.Drawing.Size(44, 17);
this.lblEmpty.TabIndex = 290;
......@@ -80,7 +115,7 @@ namespace OnlineStore.AssemblyLine.useControl
this.btnHome.BackColor = System.Drawing.Color.White;
this.btnHome.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnHome.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnHome.Location = new System.Drawing.Point(18, 24);
this.btnHome.Location = new System.Drawing.Point(12, 24);
this.btnHome.Name = "btnHome";
this.btnHome.Size = new System.Drawing.Size(120, 34);
this.btnHome.TabIndex = 289;
......@@ -88,19 +123,19 @@ namespace OnlineStore.AssemblyLine.useControl
this.btnHome.UseVisualStyleBackColor = false;
this.btnHome.Click += new System.EventHandler(this.btnHome_Click);
//
// lblMoveOk
// lblReached
//
this.lblMoveOk.AutoSize = true;
this.lblMoveOk.Location = new System.Drawing.Point(159, 97);
this.lblMoveOk.Name = "lblMoveOk";
this.lblMoveOk.Size = new System.Drawing.Size(68, 17);
this.lblMoveOk.TabIndex = 288;
this.lblMoveOk.Text = "运动到位?";
this.lblReached.AutoSize = true;
this.lblReached.Location = new System.Drawing.Point(149, 108);
this.lblReached.Name = "lblReached";
this.lblReached.Size = new System.Drawing.Size(68, 17);
this.lblReached.TabIndex = 288;
this.lblReached.Text = "到达目标?";
//
// lblPosition
//
this.lblPosition.AutoSize = true;
this.lblPosition.Location = new System.Drawing.Point(159, 45);
this.lblPosition.Location = new System.Drawing.Point(149, 39);
this.lblPosition.Name = "lblPosition";
this.lblPosition.Size = new System.Drawing.Size(68, 17);
this.lblPosition.TabIndex = 287;
......@@ -109,7 +144,7 @@ namespace OnlineStore.AssemblyLine.useControl
// lblForce
//
this.lblForce.AutoSize = true;
this.lblForce.Location = new System.Drawing.Point(159, 19);
this.lblForce.Location = new System.Drawing.Point(149, 16);
this.lblForce.Name = "lblForce";
this.lblForce.Size = new System.Drawing.Size(68, 17);
this.lblForce.TabIndex = 286;
......@@ -119,12 +154,13 @@ namespace OnlineStore.AssemblyLine.useControl
//
this.linkLabel1.AutoSize = true;
this.linkLabel1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.linkLabel1.Location = new System.Drawing.Point(159, 149);
this.linkLabel1.Location = new System.Drawing.Point(230, 155);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(37, 20);
this.linkLabel1.TabIndex = 285;
this.linkLabel1.TabStop = true;
this.linkLabel1.Text = "查询";
this.linkLabel1.Visible = false;
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
//
// btnClampWork
......@@ -132,7 +168,7 @@ namespace OnlineStore.AssemblyLine.useControl
this.btnClampWork.BackColor = System.Drawing.Color.White;
this.btnClampWork.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClampWork.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnClampWork.Location = new System.Drawing.Point(18, 102);
this.btnClampWork.Location = new System.Drawing.Point(12, 102);
this.btnClampWork.Name = "btnClampWork";
this.btnClampWork.Size = new System.Drawing.Size(120, 34);
this.btnClampWork.TabIndex = 282;
......@@ -145,7 +181,7 @@ namespace OnlineStore.AssemblyLine.useControl
this.btnClampRelax.BackColor = System.Drawing.Color.White;
this.btnClampRelax.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClampRelax.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnClampRelax.Location = new System.Drawing.Point(18, 63);
this.btnClampRelax.Location = new System.Drawing.Point(12, 63);
this.btnClampRelax.Name = "btnClampRelax";
this.btnClampRelax.Size = new System.Drawing.Size(120, 34);
this.btnClampRelax.TabIndex = 281;
......@@ -153,27 +189,14 @@ namespace OnlineStore.AssemblyLine.useControl
this.btnClampRelax.UseVisualStyleBackColor = false;
this.btnClampRelax.Click += new System.EventHandler(this.btnClampRelax_Click);
//
// lblErrorCode
//
this.lblErrorCode.AutoSize = true;
this.lblErrorCode.ForeColor = System.Drawing.Color.Red;
this.lblErrorCode.Location = new System.Drawing.Point(159, 123);
this.lblErrorCode.Name = "lblErrorCode";
this.lblErrorCode.Size = new System.Drawing.Size(0, 17);
this.lblErrorCode.TabIndex = 291;
//
// btnReset
// lblSensor
//
this.btnReset.BackColor = System.Drawing.Color.White;
this.btnReset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnReset.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnReset.Location = new System.Drawing.Point(18, 141);
this.btnReset.Name = "btnReset";
this.btnReset.Size = new System.Drawing.Size(120, 34);
this.btnReset.TabIndex = 292;
this.btnReset.Text = "夹爪复位";
this.btnReset.UseVisualStyleBackColor = false;
this.btnReset.Click += new System.EventHandler(this.btnReset_Click);
this.lblSensor.AutoSize = true;
this.lblSensor.Location = new System.Drawing.Point(149, 62);
this.lblSensor.Name = "lblSensor";
this.lblSensor.Size = new System.Drawing.Size(80, 17);
this.lblSensor.TabIndex = 294;
this.lblSensor.Text = "传感器读数:";
//
// ClampJawControl
//
......@@ -196,10 +219,12 @@ namespace OnlineStore.AssemblyLine.useControl
private System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.Label lblPosition;
private System.Windows.Forms.Label lblForce;
private System.Windows.Forms.Label lblMoveOk;
private System.Windows.Forms.Label lblReached;
private System.Windows.Forms.Button btnHome;
private System.Windows.Forms.Label lblEmpty;
private System.Windows.Forms.Label lblErrorCode;
private System.Windows.Forms.Button btnReset;
private System.Windows.Forms.Label lblIsMoving;
private System.Windows.Forms.Label lblSensor;
}
}
......@@ -30,6 +30,13 @@ namespace OnlineStore.AssemblyLine.useControl
{
JName = clampJaw.config.Explain + "_" + clampJaw.config.PortName + "_" + clampJaw.config.AxisNo;
groupClamp.Text = JName;
lblReached.Text = "";
lblIsMoving.Text = "";
lblErrorCode.Text = "";
lblEmpty.Text = "";
lblForce.Text = "";
lblPosition.Text = "";
lblSensor.Text = "";
}
}
......@@ -42,11 +49,19 @@ namespace OnlineStore.AssemblyLine.useControl
{
if (clampJaw.IsReached())
{
lblMoveOk.Text = "运动到位 ✔";
lblReached.Text = "到达目标 ✔";
}
else
{
lblReached.Text = " ";
}
if (clampJaw.IsMoving())
{
lblIsMoving.Text = "运动中 ✔";
}
else
{
lblMoveOk.Text = " ";
lblIsMoving.Text = " ";
}
if (clampJaw.HasReel())
{
......@@ -58,6 +73,7 @@ namespace OnlineStore.AssemblyLine.useControl
}
lblPosition.Text = "实时位置:" + clampJaw.GetPosition();
lblForce.Text = "实时出力:" + clampJaw.GetTorque();
lblSensor.Text = "传感器读数:" + clampJaw.GetForceSensor();
int code = clampJaw.GetErrorCode();
if (code > 0)
{
......
......@@ -514,7 +514,7 @@ namespace OnlineStore.DeviceLibrary
ConfigIO io = baseConfig.getWaitIO(wait.IoType);
WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "] 等待" + NotOkMsg + " 超时 " + Math.Round(span.TotalSeconds, 1) + "秒";
LogUtil.error( WarnMsg, DeviceID * 1000 + 13);
LogUtil.error(WarnMsg, DeviceID * 1000 + 13);
if (NoAlarm())
{
Alarm(LineAlarmType.IoSingleTimeOut);
......@@ -554,20 +554,20 @@ namespace OnlineStore.DeviceLibrary
else if (wait.WaitType.Equals(WaitEnum.W003_Time))
{
wait.IsEnd = (span.TotalMilliseconds >= wait.TimeMSeconds);
}else if (wait.WaitType.Equals(WaitEnum.W004_ClampReached))
} else if (wait.WaitType.Equals(WaitEnum.W004_ClampReached))
{
if (ClampJwa != null)
{
if (ClampJwa.IsReached())
{
float currp = ClampJwa.GetPosition() -(float) wait.TargetPosition;
float currp = ClampJwa.GetPosition() - (float)wait.TargetPosition;
if (currp < 1)
{
wait.IsEnd = true;
}
}
}
}else if (wait.WaitType.Equals(WaitEnum.W005_WaitHasReel))
} else if (wait.WaitType.Equals(WaitEnum.W005_WaitHasReel))
{
if (ClampJwa != null)
{
......@@ -578,13 +578,19 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(Name + " 用户点击了:忽略夹爪有料信号,继续出入库动作");
wait.IsEnd = true;
}
//如果出力>=0.3,且已等待5秒
float torque = ClampJwa.GetTorque();
if ((!wait.IsEnd) && torque > 0.25 && span.TotalSeconds > 5)
//如果是运动中,且到达目标,认为有料
if ((!wait.IsEnd) && ClampJwa.IsMoving() && ClampJwa.IsReached() && span.TotalSeconds > 3)
{
LogUtil.info(Name + " 无料,但力度为[" + torque + "]>=0.25认为有料");
LogUtil.info(Name + " 无料,但在运动中,且运动到位,认为有料");
wait.IsEnd = true;
}
////如果出力>=0.3,且已等待5秒
//float torque = ClampJwa.GetTorque();
//if ((!wait.IsEnd) && torque > 0.25 && span.TotalSeconds > 5)
//{
// LogUtil.info(Name + " 无料,但力度为[" + torque + "]>=0.25认为有料");
// wait.IsEnd = true;
//}
}
}
else if (wait.WaitType.Equals(WaitEnum.W008_InStoreCheckOK))
......@@ -600,7 +606,7 @@ namespace OnlineStore.DeviceLibrary
{
storeId = 7;
}
wait.IsEnd = LineServer.BoxCanReviceTray(storeId,out NotOkMsg);
wait.IsEnd = LineServer.BoxCanReviceTray(storeId, out NotOkMsg);
}
else
{
......
......@@ -82,6 +82,21 @@ namespace OnlineStore.DeviceLibrary
}
return false;
}
public bool IsMoving()
{
try
{
if (rmaxis != null && rmaxis.IsPortOpen)
{
return rmaxis.IsMoving;
}
}
catch (Exception ex)
{
LogUtil.error(Name + " IsMoving error :" + ex.ToString());
}
return false;
}
public bool HasReel()
{
try
......@@ -121,7 +136,30 @@ namespace OnlineStore.DeviceLibrary
moveInfo.WaitList.Add(WaitResultInfo.WaitClampReached(0));
}
}
public float GetForceSensor()
{
try
{
return rmaxis.GetForceSensor();
}
catch (Exception ex)
{
LogUtil.error(Name + " GetForceSensor error :" + ex.ToString());
}
return -1;
}
public float GetVelocity()
{
try
{
return rmaxis.GetVelocity();
}
catch (Exception ex)
{
LogUtil.error(Name + " GetVelocity error :" + ex.ToString());
}
return -1;
}
public float GetPosition()
{
try
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!