Commit 10e6ad23 LN

1

1 个父辈 b48a0a32
......@@ -248,6 +248,23 @@ namespace DeviceLibrary
LogUtil.error(msg);
}
}
else if (AxisManager.IsMoveEnd(axis.DeviceName, axis.GetAxisValue()))
{
int outCount = AxisManager.GetActualtPosition(axis.DeviceName, axis.GetAxisValue());
//判断是否需要重新运动
if (MoveInfo.CanWhileCount > 0)
{
LogUtil.error(MoveInfo.Name + axis.DisplayStr + "运动结束,但回原点未完成,当前位置[" + outCount + "],重新回原点,剩余[" + MoveInfo.CanWhileCount + "]次");
AxisManager.HomeMove(axis.DeviceName, axis.GetAxisValue(), axis.HomeHighSpeed, axis.HomeLowSpeed, axis.HomeAddSpeed);
MoveInfo.CanWhileCount--;
}
else
{
msg = MoveInfo.Name + " " + MoveInfo.MoveStep + axis.DisplayStr + "运动结束,但回原点未完成,当前位置" + outCount + ",需要报警";
LogUtil.error(msg);
}
}
return false;
}
......
......@@ -33,6 +33,11 @@ namespace DeviceLibrary
return instance.IsHomeMoveEnd(portName, slvAddr);
}
public static bool IsMoveEnd(string portName, short slvAddr)
{
return instance.IsMoveEnd(portName, slvAddr);
}
public static bool AbsMoveIsEnd(string portName, short axisNo, int targetPosition, int canErrorCount, out bool countError)
{
return instance.AbsMoveIsEnd(portName, axisNo, targetPosition, canErrorCount, out countError);
......
......@@ -141,5 +141,10 @@ namespace DeviceLibrary
{
return HCBoardManager.GetAxErrCode(slvAddr);
}
public bool IsMoveEnd(string portName, short slvAddr)
{
return HCBoardManager.MoveIsEnd(slvAddr);
}
}
}
......@@ -20,6 +20,8 @@ namespace DeviceLibrary
bool IsHomeMoveEnd(string portName, short slvAddr);
bool IsMoveEnd(string portName, short slvAddr);
bool AbsMoveIsEnd(string portName, short axisNo, int targetPosition, int canErrorCount, out bool countError);
void ServoOn(string portName, short slvAddr);
void ServoOff(string portName, short slvAddr);
......
......@@ -27,7 +27,7 @@ namespace DeviceLibrary
{
if (CheckWait(StoreMoveInfo))
return;
//常规上料扫码流程
switch (StoreMoveInfo.MoveStep)
{
case MoveStep.Wait:
......
......@@ -54,6 +54,10 @@ namespace TheMachine
this.btn_IgnoreX09 = new System.Windows.Forms.Button();
this.btn_PauseBuzzer = new System.Windows.Forms.Button();
this.listView1 = new System.Windows.Forms.ListView();
this.btnResetOut1 = new System.Windows.Forms.Button();
this.btnResetOut2 = new System.Windows.Forms.Button();
this.btnResetOut3 = new System.Windows.Forms.Button();
this.btnResetOut4 = new System.Windows.Forms.Button();
this.menuStrip1.SuspendLayout();
this.tabc.SuspendLayout();
this.tabP1.SuspendLayout();
......@@ -209,6 +213,10 @@ namespace TheMachine
//
// pnl
//
this.pnl.Controls.Add(this.btnResetOut4);
this.pnl.Controls.Add(this.btnResetOut3);
this.pnl.Controls.Add(this.btnResetOut2);
this.pnl.Controls.Add(this.btnResetOut1);
this.pnl.Controls.Add(this.listReelInfo);
this.pnl.Controls.Add(this.groupBox1);
this.pnl.Controls.Add(this.pictureBox2);
......@@ -240,7 +248,7 @@ namespace TheMachine
this.groupBox1.Controls.Add(this.stateView);
this.groupBox1.Location = new System.Drawing.Point(3, 4);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(989, 244);
this.groupBox1.Size = new System.Drawing.Size(849, 244);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "运行状态";
......@@ -256,7 +264,7 @@ namespace TheMachine
this.stateView.Location = new System.Drawing.Point(3, 25);
this.stateView.MultiSelect = false;
this.stateView.Name = "stateView";
this.stateView.Size = new System.Drawing.Size(983, 216);
this.stateView.Size = new System.Drawing.Size(843, 216);
this.stateView.TabIndex = 0;
this.stateView.UseCompatibleStateImageBehavior = false;
//
......@@ -314,6 +322,54 @@ namespace TheMachine
this.listView1.TabIndex = 2;
this.listView1.UseCompatibleStateImageBehavior = false;
//
// btnResetOut1
//
this.btnResetOut1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnResetOut1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnResetOut1.Location = new System.Drawing.Point(862, 16);
this.btnResetOut1.Name = "btnResetOut1";
this.btnResetOut1.Size = new System.Drawing.Size(130, 32);
this.btnResetOut1.TabIndex = 271;
this.btnResetOut1.Text = "出料口1复位";
this.btnResetOut1.UseVisualStyleBackColor = true;
this.btnResetOut1.Click += new System.EventHandler(this.btnResetOut1_Click);
//
// btnResetOut2
//
this.btnResetOut2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnResetOut2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnResetOut2.Location = new System.Drawing.Point(862, 55);
this.btnResetOut2.Name = "btnResetOut2";
this.btnResetOut2.Size = new System.Drawing.Size(130, 32);
this.btnResetOut2.TabIndex = 272;
this.btnResetOut2.Text = "出料口2复位";
this.btnResetOut2.UseVisualStyleBackColor = true;
this.btnResetOut2.Click += new System.EventHandler(this.btnResetOut2_Click);
//
// btnResetOut3
//
this.btnResetOut3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnResetOut3.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnResetOut3.Location = new System.Drawing.Point(862, 94);
this.btnResetOut3.Name = "btnResetOut3";
this.btnResetOut3.Size = new System.Drawing.Size(130, 32);
this.btnResetOut3.TabIndex = 273;
this.btnResetOut3.Text = "出料口3复位";
this.btnResetOut3.UseVisualStyleBackColor = true;
this.btnResetOut3.Click += new System.EventHandler(this.btnResetOut3_Click);
//
// btnResetOut4
//
this.btnResetOut4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnResetOut4.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnResetOut4.Location = new System.Drawing.Point(862, 133);
this.btnResetOut4.Name = "btnResetOut4";
this.btnResetOut4.Size = new System.Drawing.Size(130, 32);
this.btnResetOut4.TabIndex = 274;
this.btnResetOut4.Text = "出料口4复位";
this.btnResetOut4.UseVisualStyleBackColor = true;
this.btnResetOut4.Click += new System.EventHandler(this.btnResetOut4_Click);
//
// FormMain
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......@@ -368,6 +424,10 @@ namespace TheMachine
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ListView listReelInfo;
private System.Windows.Forms.Button btnResetOut1;
private System.Windows.Forms.Button btnResetOut4;
private System.Windows.Forms.Button btnResetOut3;
private System.Windows.Forms.Button btnResetOut2;
}
}
......@@ -654,5 +654,34 @@ namespace TheMachine
Setting_Init.Device_EnableBuzzer = AlarmBuzzer.Enable;
}
private void outSheftReset(string name)
{
OutShelfBean outShelf = RobotManage.mainMachine.getOutShelf(name);
DialogResult result = MessageBox.Show("确定复位出料机构" + name + "?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if (result.Equals(DialogResult.OK))
{
LogUtil.info("手动操作:" + name + "复位");
outShelf.Reset();
}
}
private void btnResetOut1_Click(object sender, EventArgs e)
{
outSheftReset("U1");
}
private void btnResetOut2_Click(object sender, EventArgs e)
{
outSheftReset("U2");
}
private void btnResetOut3_Click(object sender, EventArgs e)
{
outSheftReset("U3");
}
private void btnResetOut4_Click(object sender, EventArgs e)
{
outSheftReset("U4");
}
}
}
\ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!