Commit e82005d2 LN

夹爪增加复位和错误码展示功能。

1 个父辈 4ee510c8
......@@ -305,7 +305,7 @@
this.btnCloseAll.BackColor = System.Drawing.Color.White;
this.btnCloseAll.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCloseAll.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCloseAll.Location = new System.Drawing.Point(320, 242);
this.btnCloseAll.Location = new System.Drawing.Point(320, 231);
this.btnCloseAll.Name = "btnCloseAll";
this.btnCloseAll.Size = new System.Drawing.Size(140, 34);
this.btnCloseAll.TabIndex = 259;
......@@ -393,7 +393,7 @@
this.groupDO.Controls.Add(this.SL_MoveCylinder_Take);
this.groupDO.Location = new System.Drawing.Point(468, 119);
this.groupDO.Name = "groupDO";
this.groupDO.Size = new System.Drawing.Size(501, 300);
this.groupDO.Size = new System.Drawing.Size(501, 274);
this.groupDO.TabIndex = 255;
this.groupDO.TabStop = false;
this.groupDO.Text = "IO操作测试";
......@@ -416,7 +416,7 @@
this.SL_MoveCylinder_Give.BackColor = System.Drawing.Color.White;
this.SL_MoveCylinder_Give.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.SL_MoveCylinder_Give.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.SL_MoveCylinder_Give.Location = new System.Drawing.Point(169, 242);
this.SL_MoveCylinder_Give.Location = new System.Drawing.Point(169, 231);
this.SL_MoveCylinder_Give.Name = "SL_MoveCylinder_Give";
this.SL_MoveCylinder_Give.Size = new System.Drawing.Size(140, 34);
this.SL_MoveCylinder_Give.TabIndex = 279;
......@@ -429,7 +429,7 @@
this.SL_LocationCylinder_Down.BackColor = System.Drawing.Color.White;
this.SL_LocationCylinder_Down.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.SL_LocationCylinder_Down.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.SL_LocationCylinder_Down.Location = new System.Drawing.Point(320, 190);
this.SL_LocationCylinder_Down.Location = new System.Drawing.Point(320, 186);
this.SL_LocationCylinder_Down.Name = "SL_LocationCylinder_Down";
this.SL_LocationCylinder_Down.Size = new System.Drawing.Size(140, 34);
this.SL_LocationCylinder_Down.TabIndex = 278;
......@@ -442,7 +442,7 @@
this.SL_FixedCylinder_Down.BackColor = System.Drawing.Color.White;
this.SL_FixedCylinder_Down.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.SL_FixedCylinder_Down.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.SL_FixedCylinder_Down.Location = new System.Drawing.Point(169, 190);
this.SL_FixedCylinder_Down.Location = new System.Drawing.Point(169, 186);
this.SL_FixedCylinder_Down.Name = "SL_FixedCylinder_Down";
this.SL_FixedCylinder_Down.Size = new System.Drawing.Size(140, 34);
this.SL_FixedCylinder_Down.TabIndex = 277;
......@@ -455,7 +455,7 @@
this.SL_TopCylinder_Down.BackColor = System.Drawing.Color.White;
this.SL_TopCylinder_Down.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.SL_TopCylinder_Down.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.SL_TopCylinder_Down.Location = new System.Drawing.Point(17, 190);
this.SL_TopCylinder_Down.Location = new System.Drawing.Point(17, 186);
this.SL_TopCylinder_Down.Name = "SL_TopCylinder_Down";
this.SL_TopCylinder_Down.Size = new System.Drawing.Size(140, 34);
this.SL_TopCylinder_Down.TabIndex = 276;
......@@ -468,7 +468,7 @@
this.SL_TopCylinder_Up.BackColor = System.Drawing.Color.White;
this.SL_TopCylinder_Up.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.SL_TopCylinder_Up.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.SL_TopCylinder_Up.Location = new System.Drawing.Point(17, 150);
this.SL_TopCylinder_Up.Location = new System.Drawing.Point(17, 146);
this.SL_TopCylinder_Up.Name = "SL_TopCylinder_Up";
this.SL_TopCylinder_Up.Size = new System.Drawing.Size(140, 34);
this.SL_TopCylinder_Up.TabIndex = 274;
......@@ -481,7 +481,7 @@
this.SL_FixedCylinder_Up.BackColor = System.Drawing.Color.White;
this.SL_FixedCylinder_Up.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.SL_FixedCylinder_Up.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.SL_FixedCylinder_Up.Location = new System.Drawing.Point(169, 150);
this.SL_FixedCylinder_Up.Location = new System.Drawing.Point(169, 146);
this.SL_FixedCylinder_Up.Name = "SL_FixedCylinder_Up";
this.SL_FixedCylinder_Up.Size = new System.Drawing.Size(140, 34);
this.SL_FixedCylinder_Up.TabIndex = 273;
......@@ -585,7 +585,7 @@
this.SL_LocationCylinder_Up.BackColor = System.Drawing.Color.White;
this.SL_LocationCylinder_Up.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.SL_LocationCylinder_Up.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.SL_LocationCylinder_Up.Location = new System.Drawing.Point(320, 150);
this.SL_LocationCylinder_Up.Location = new System.Drawing.Point(320, 146);
this.SL_LocationCylinder_Up.Name = "SL_LocationCylinder_Up";
this.SL_LocationCylinder_Up.Size = new System.Drawing.Size(140, 34);
this.SL_LocationCylinder_Up.TabIndex = 256;
......@@ -598,7 +598,7 @@
this.SL_MoveCylinder_Take.BackColor = System.Drawing.Color.White;
this.SL_MoveCylinder_Take.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.SL_MoveCylinder_Take.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.SL_MoveCylinder_Take.Location = new System.Drawing.Point(17, 242);
this.SL_MoveCylinder_Take.Location = new System.Drawing.Point(17, 231);
this.SL_MoveCylinder_Take.Name = "SL_MoveCylinder_Take";
this.SL_MoveCylinder_Take.Size = new System.Drawing.Size(140, 34);
this.SL_MoveCylinder_Take.TabIndex = 252;
......@@ -747,9 +747,9 @@
//
// clampJawControl1
//
this.clampJawControl1.Location = new System.Drawing.Point(462, 422);
this.clampJawControl1.Location = new System.Drawing.Point(464, 395);
this.clampJawControl1.Name = "clampJawControl1";
this.clampJawControl1.Size = new System.Drawing.Size(507, 167);
this.clampJawControl1.Size = new System.Drawing.Size(507, 208);
this.clampJawControl1.TabIndex = 280;
//
// tabPage2
......
......@@ -46,7 +46,6 @@
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.label7 = new System.Windows.Forms.Label();
this.txtPosId = new System.Windows.Forms.TextBox();
this.btnClear = new System.Windows.Forms.Button();
this.clampJawControl1 = new OnlineStore.AssemblyLine.useControl.ClampJawControl();
......@@ -163,7 +162,7 @@
this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox1.Location = new System.Drawing.Point(414, 187);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(269, 148);
this.groupBox1.Size = new System.Drawing.Size(286, 148);
this.groupBox1.TabIndex = 105;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "DO写入";
......@@ -360,7 +359,7 @@
this.groupDO.Controls.Add(this.BeforeAfterCylinder_Before);
this.groupDO.Controls.Add(this.TopCylinder_Up);
this.groupDO.Controls.Add(this.UpDownCylinder_Up);
this.groupDO.Location = new System.Drawing.Point(414, 338);
this.groupDO.Location = new System.Drawing.Point(414, 402);
this.groupDO.Name = "groupDO";
this.groupDO.Size = new System.Drawing.Size(556, 111);
this.groupDO.TabIndex = 255;
......@@ -519,28 +518,18 @@
//
this.groupBox5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox5.Controls.Add(this.label7);
this.groupBox5.Controls.Add(this.txtPosId);
this.groupBox5.Controls.Add(this.btnClear);
this.groupBox5.Location = new System.Drawing.Point(414, 451);
this.groupBox5.Location = new System.Drawing.Point(414, 337);
this.groupBox5.Name = "groupBox5";
this.groupBox5.Size = new System.Drawing.Size(407, 61);
this.groupBox5.Size = new System.Drawing.Size(286, 61);
this.groupBox5.TabIndex = 280;
this.groupBox5.TabStop = false;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(14, 28);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(47, 17);
this.label7.TabIndex = 284;
this.label7.Text = "库位号:";
//
// txtPosId
//
this.txtPosId.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtPosId.Location = new System.Drawing.Point(72, 23);
this.txtPosId.Location = new System.Drawing.Point(5, 23);
this.txtPosId.Name = "txtPosId";
this.txtPosId.Size = new System.Drawing.Size(150, 26);
this.txtPosId.TabIndex = 283;
......@@ -549,7 +538,7 @@
//
this.btnClear.BackColor = System.Drawing.Color.White;
this.btnClear.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClear.Location = new System.Drawing.Point(233, 19);
this.btnClear.Location = new System.Drawing.Point(166, 19);
this.btnClear.Name = "btnClear";
this.btnClear.Size = new System.Drawing.Size(105, 35);
this.btnClear.TabIndex = 286;
......@@ -559,9 +548,9 @@
//
// clampJawControl1
//
this.clampJawControl1.Location = new System.Drawing.Point(686, 182);
this.clampJawControl1.Location = new System.Drawing.Point(703, 182);
this.clampJawControl1.Name = "clampJawControl1";
this.clampJawControl1.Size = new System.Drawing.Size(291, 157);
this.clampJawControl1.Size = new System.Drawing.Size(274, 220);
this.clampJawControl1.TabIndex = 279;
//
// groupBox6
......@@ -1142,7 +1131,6 @@
private System.Windows.Forms.Label lblP3List;
private useControl.ClampJawControl clampJawControl1;
private System.Windows.Forms.GroupBox groupBox5;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox txtPosId;
private System.Windows.Forms.Button btnClear;
private System.Windows.Forms.GroupBox groupBox7;
......
......@@ -58,7 +58,15 @@ namespace OnlineStore.AssemblyLine.useControl
}
lblPosition.Text = "实时位置:" + clampJaw.GetPosition();
lblForce.Text = "实时出力:" + clampJaw.GetTorque();
int code = clampJaw.GetErrorCode();
if (code > 0)
{
lblErrorCode.Text = "错误码:" + code;
}
else
{
lblErrorCode.Text = "";
}
}
private void btnClampRelax_Click(object sender, EventArgs e)
......@@ -78,5 +86,11 @@ namespace OnlineStore.AssemblyLine.useControl
LogUtil.info(JName + "界面点击:" + btnHome.Text);
clampJaw.GoHome();
}
private void btnReset_Click(object sender, EventArgs e)
{
LogUtil.info(JName + "界面点击:" + btnReset.Text);
clampJaw.Reset();
}
}
}
......@@ -115,6 +115,7 @@ namespace OnlineStore.DeviceLibrary
{
LogInfo("复位前,清理出库高度:" + OutStoreHeight);
}
ClampJwa.Reset();
//复位时设置状态为none
AgvClient.SetStatus(Config.AgvInName);
AgvClient.SetStatus(Config.AgvOutName);
......@@ -131,7 +132,7 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.SL_Out_StopDown, IO_VALUE.LOW);
//夹紧气缸放松
//CylinderMove(null, IO_Type.SL_ClampCylinder_Work, IO_Type.SL_ClampCylinder_Relax);
ClampJwa.GoHome();
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_Entry_StopDown, IO_VALUE.LOW));
......
......@@ -95,6 +95,7 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.StopDown1, IO_VALUE.LOW);
IOMove(IO_Type.StopDown2, IO_VALUE.LOW);
}
ClampJwa.Reset();
isInPro = false;
}
......
......@@ -14,7 +14,7 @@ namespace OnlineStore.DeviceLibrary
public string Name = "";
public ConfigClampJaw config = null;
public Rmaxis rmaxis = null;
public ClampJawBean (ConfigClampJaw config)
public ClampJawBean(ConfigClampJaw config)
{
this.config = config;
Name = config.DisplayStr + "(" + config.PortName + "_" + config.AxisNo + ")";
......@@ -28,7 +28,7 @@ namespace OnlineStore.DeviceLibrary
}
if (rmaxis == null)
{
rmaxis = new Rmaxis("Rmaxis");
rmaxis = new Rmaxis("Rmaxis");
}
if (!rmaxis.IsPortOpen)
{
......@@ -70,7 +70,7 @@ namespace OnlineStore.DeviceLibrary
public bool IsReached()
{
try
{
{
if (rmaxis != null && rmaxis.IsPortOpen)
{
return rmaxis.IsReached;
......@@ -152,5 +152,21 @@ namespace OnlineStore.DeviceLibrary
rmaxis.Push(force, distance, config.Velocity);
}
}
public void Reset()
{
if (rmaxis != null && rmaxis.IsPortOpen)
{
rmaxis.ResetError();
}
}
public int GetErrorCode()
{
if (rmaxis != null && rmaxis.IsPortOpen)
{
return rmaxis.ErrorCode;
}
return 0;
}
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!