Exemplo n.º 1
0
        /// <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));
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Z轴起点再现
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAxisZGoTo1_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;
            }
            res = CpkMove.MoveZHigh(double.Parse(this.txtZStart.Text));
            if (res != Result.OK)
            {
                return;
            }

            //this.move4CpkZ(double.Parse(this.txtZPosX.Text), double.Parse(this.txtZPosY.Text), double.Parse(this.txtZStart.Text));
        }
Exemplo n.º 4
0
        private void DoAxisZCPK()
        {
            if (!this.cbUseLaser.Checked)
            {
                this.checkGage();
            }
            Result res = Result.OK;

            res = CpkMove.MoveZHigh(double.Parse(this.txtZStart.Text));
            if (res != Result.OK)
            {
                return;
            }
            res = CpkMove.MoveZHigh(double.Parse(this.txtZStart.Text));
            if (res != Result.OK)
            {
                return;
            }
            CPKMgr.Instance.ExecuteOne(typeof(AxisZCPK).Name);
        }