From 0da55a5f42599ba954e18b2429e05d587d7bacfd Mon Sep 17 00:00:00 2001 From: lhiven Date: Tue, 6 Aug 2024 12:06:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=A7=BB=E5=8A=A8=E5=88=B0?= =?UTF-8?q?=E6=B2=BB=E5=85=B7=E4=B8=8A=E6=96=B9=E6=97=B6=EF=BC=8C=E5=A4=A7?= =?UTF-8?q?=E4=BA=8E=E5=AE=89=E5=85=A8=E4=BD=8D=E6=97=B6=E5=85=88=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8Y1=E8=BD=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.DeweyTester/SysConfig/FixtureConfig.cs | 41 ++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/Rs.DeweyTester/SysConfig/FixtureConfig.cs b/Rs.DeweyTester/SysConfig/FixtureConfig.cs index 35e94ba..5f19cd1 100644 --- a/Rs.DeweyTester/SysConfig/FixtureConfig.cs +++ b/Rs.DeweyTester/SysConfig/FixtureConfig.cs @@ -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)