优化移动到治具上方时,大于安全位时先移动Y1轴

master
lhiven 10 months ago
parent 718a4956cd
commit 0da55a5f42

@ -91,7 +91,46 @@ namespace Rs.MotionPlat.SysConfig
private void Move_Click(object sender, EventArgs e)
{
PositionHelper.Move2This(this, sender, "", GlobalVar.WholeSpeed);
Button btn=(Button)sender;
string name = "txt" + btn.Name.Replace("btnMove", "");
Control control = ControlManager.FindControl(groupBox22, name);
if (control != null)
{
string axisname = ((TextBox)control).Tag.ToString();
double gotoPos = double.Parse(((TextBox)control).Text);
//DialogResult dr = Msg.ShowQuestion($"Are you sure to move {axisname} to postion at: {gotoPos}");
EButtonType btnType = Msgbox.ShowTipDialog(EButtonType.Ok | EButtonType.Cancel, $"Are you sure to move {axisname} to postion at: {gotoPos}");
//if (dr == DialogResult.OK)
if (btnType == EButtonType.Ok)
{
TargetPosition target = new TargetPosition();
if(axisname.ToLower()=="loadx")
{
target.X = gotoPos;
target.Y1 = GlobalVar.FixtureSideY1;
target.Y2 = Ops.GetCurPosition(AxisControl.LoadY2);
GroupAxisMove.XY1Y2MovePos(target, GlobalVar.WholeSpeed, EGoWhichSide.FixtureSide);
}
else if(axisname.ToLower()=="loady2")
{
target.X = Ops.GetCurPosition(AxisControl.LoadX);
target.Y1 = GlobalVar.FixtureSideY1;
target.Y2 = gotoPos;
GroupAxisMove.XY1Y2MovePos(target, GlobalVar.WholeSpeed, EGoWhichSide.FixtureSide);
}
//Motion.ErrorCode errCode = AxisControl.GetAxis(axisname).MovePos(gotoPos, speed);
//if (errCode > Motion.ErrorCode.Ok)
//{
// //Msg.ShowError($"axis {axisname} move fail {errCode}");
// Msgbox.ShowTipDialog(EButtonType.Ok, $"axis {axisname} move fail {errCode}", "move", true);
//}
}
}
//PositionHelper.Move2This(this, sender, "", GlobalVar.WholeSpeed);
}
protected void btnIoOut_Click(object sender, EventArgs e)

Loading…
Cancel
Save