/// <summary> /// Z轴终点再现 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAxisZGoTo2_Click(object sender, EventArgs e) { Result res = Result.OK; //res = Machine.Instance.Robot.MovePosXYAndReply(double.Parse(this.txtZPosX.Text), double.Parse(this.txtZPosY.Text)); res = Machine.Instance.Robot.ManualMovePosXYAndReply(double.Parse(this.txtZPosX.Text), double.Parse(this.txtZPosY.Text)); if (res != Result.OK) { return; } AxisZCPK cpk = CPKMgr.Instance.FindByName(typeof(AxisZCPK).Name) as AxisZCPK; if (cpk != null) { double z = cpk.calPoint(); res = CpkMove.MoveZHigh(z); if (!res.IsOk) { return; } res = CpkMove.MoveZSlowly(double.Parse(this.txtZEnd.Text)); if (!res.IsOk) { return; } } //this.move4CpkZ(double.Parse(this.txtZPosX.Text), double.Parse(this.txtZPosY.Text), double.Parse(this.txtZEnd.Text)); }
private void moveAndRead() { Result res = Result.OK; double height; this.isStop = false; dataInput.Clear(); for (int i = 0; i < this.CpkPrm.ZPointsNum; i++) { res = CpkMove.MoveZHigh(ZStart); if (res != Result.OK) { return; } if (this.isStop) { this.isStop = false; break; } res = CpkMove.MoveZHigh(pointTrans); if (!res.IsOk) { return; } res = CpkMove.MoveZSlowly(ZEnd); if (!res.IsOk) { return; } Thread.Sleep(3000); if (this.CpkMeasureType == 1) { //读取高度 Result result = Machine.Instance.MeasureHeight(out height); if (!result.IsOk) { return; } } else { //读取高度 int retCode = Machine.Instance.DigitalGage.DigitalGagable.ReadHeight(out height); if (retCode != 0) { return; } } dataInput.Add(height); } }