|
|
@ -91,7 +91,46 @@ namespace Rs.MotionPlat.SysConfig
|
|
|
|
|
|
|
|
|
|
|
|
private void Move_Click(object sender, EventArgs e)
|
|
|
|
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)
|
|
|
|
protected void btnIoOut_Click(object sender, EventArgs e)
|
|
|
|