Ejemplo n.º 1
0
        /// <summary>
        /// Y轴终点再现
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAxisYGoTo2_Click(object sender, EventArgs e)
        {
            double diff = double.Parse(this.txtYEndX.Text) - double.Parse(this.txtYStartX.Text);

            if (Math.Abs(diff) > 5)
            {
                MessageBox.Show("示教时请确保设备X轴固定", "", MessageBoxButtons.OKCancel);
                return;
            }
            Result res = Result.OK;

            res = Machine.Instance.Robot.MovePosZAndReply(double.Parse(this.txtPosZ2.Text));
            if (!res.IsOk)
            {
                return;
            }
            AxisYCPK cpk = CPKMgr.Instance.FindByName(typeof(AxisYCPK).Name) as AxisYCPK;

            if (cpk != null)
            {
                PointD p = cpk.calPoint();
                res = CpkMove.MoveToPosHigh(p.X, p.Y);
                if (!res.IsOk)
                {
                    return;
                }
                res = CpkMove.MoveToPosSlowly(double.Parse(this.txtYEndX.Text), double.Parse(this.txtYEndY.Text));
                if (!res.IsOk)
                {
                    return;
                }
            }
            //CpkMove.moveToPosDown(double.Parse(this.txtYEndX.Text), double.Parse(this.txtYEndY.Text), double.Parse(this.txtPosZ2.Text));
        }
Ejemplo n.º 2
0
        public void Initial()
        {
            WorkBook workBook = new  WorkBook();

            workBook.AddSheet(SheetName.Valve1Weight.ToString());
            workBook.AddSheet(SheetName.Valve2Weight.ToString());
            workBook.AddSheet(SheetName.X轴.ToString());
            workBook.AddSheet(SheetName.Y轴.ToString());
            workBook.AddSheet(SheetName.XY轴联动.ToString());
            workBook.AddSheet(SheetName.Z轴.ToString());

            ICPKable cpk;

            cpk = new Valve1WeightCPK(workBook.FindSheetByName(SheetName.Valve1Weight.ToString()), this.Prm);
            this.cpkDicAdd(typeof(Valve1WeightCPK).Name, cpk);

            cpk = new Valve2WeightCPK(workBook.FindSheetByName(SheetName.Valve2Weight.ToString()), this.Prm);
            this.cpkDicAdd(typeof(Valve2WeightCPK).Name, cpk);

            cpk = new AxisXCPK(workBook.FindSheetByName(SheetName.X轴.ToString()), this.Prm);
            this.cpkDicAdd(typeof(AxisXCPK).Name, cpk);

            cpk = new AxisYCPK(workBook.FindSheetByName(SheetName.Y轴.ToString()), this.Prm);
            this.cpkDicAdd(typeof(AxisYCPK).Name, cpk);

            cpk = new AxisXYCPK(workBook.FindSheetByName(SheetName.XY轴联动.ToString()), this.Prm);
            this.cpkDicAdd(typeof(AxisXYCPK).Name, cpk);

            cpk = new AxisZCPK(workBook.FindSheetByName(SheetName.Z轴.ToString()), this.Prm);
            this.cpkDicAdd(typeof(AxisZCPK).Name, cpk);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Y 轴起点示教
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAxisYTeach1_Click(object sender, EventArgs e)
        {
            this.txtYStartX.Text = Machine.Instance.Robot.PosX.ToString("F3");
            this.txtYStartY.Text = Machine.Instance.Robot.PosY.ToString("F3");

            AxisYCPK cpk = CPKMgr.Instance.FindByName(typeof(AxisYCPK).Name) as AxisYCPK;

            if (cpk != null)
            {
                cpk.Start = new PointD(double.Parse(this.txtYStartX.Text), double.Parse(this.txtYStartY.Text));
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Y轴起点再现
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAxisYGoTo1_Click(object sender, EventArgs e)
        {
            Result res = Result.OK;

            res = Machine.Instance.Robot.MovePosZAndReply(double.Parse(this.txtPosZ2.Text));
            if (!res.IsOk)
            {
                return;
            }
            AxisYCPK cpk = CPKMgr.Instance.FindByName(typeof(AxisYCPK).Name) as AxisYCPK;

            if (cpk != null)
            {
                res = CpkMove.MoveToPosHigh(double.Parse(this.txtYStartX.Text), double.Parse(this.txtYStartY.Text));
                if (!res.IsOk)
                {
                    return;
                }
            }
            //CpkMove.moveToPos(double.Parse(this.txtYStartX.Text), double.Parse(this.txtYStartY.Text), double.Parse(this.txtPosZ2.Text));
        }