コード例 #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));
        }
コード例 #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);
        }
コード例 #3
0
        /// <summary>
        /// Z轴起点示教
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAxisZTeach1_Click(object sender, EventArgs e)
        {
            this.txtZStart.Text = Machine.Instance.Robot.PosZ.ToString("F3");
            AxisZCPK cpk = CPKMgr.Instance.FindByName(typeof(AxisZCPK).Name) as AxisZCPK;

            if (cpk != null)
            {
                cpk.ZStart = double.Parse(this.txtZStart.Text);
            }
        }
コード例 #4
0
        /// <summary>
        /// Z轴终点示教
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAxisZTeach2_Click(object sender, EventArgs e)
        {
            this.txtZEnd.Text  = Machine.Instance.Robot.PosZ.ToString("F3");
            this.txtZPosX.Text = Machine.Instance.Robot.PosX.ToString("F3");
            this.txtZPosY.Text = Machine.Instance.Robot.PosY.ToString("F3");
            AxisZCPK cpk = CPKMgr.Instance.FindByName(typeof(AxisZCPK).Name) as AxisZCPK;

            if (cpk != null)
            {
                cpk.ZEnd = double.Parse(this.txtZEnd.Text);
                cpk.Pos  = new PointD(double.Parse(this.txtZPosX.Text), double.Parse(this.txtZPosY.Text));
            }
        }