Example #1
0
        /// <summary>
        /// 获取备料
        /// </summary>
        /// <returns></returns>
        private ElectrodePreparationInfo GetElePre()
        {
            ElectrodePreparationInfo prep = new ElectrodePreparationInfo();

            prep.Preparation[0] = int.Parse(this.textBox_preparationX.Text);
            prep.Preparation[1] = int.Parse(this.textBox_preparationY.Text);
            prep.Preparation[2] = int.Parse(this.textBox_preparationZ.Text);
            prep.IsPreparation  = pre.IsPreCriterion(prep.Preparation);
            prep.Material       = this.comboBox_material.Text;
            return(prep);
        }
Example #2
0
        /// <summary>
        /// 反求单齿设置值
        /// </summary>
        /// <param name="setValue"></param>
        /// <param name="pitch"></param>
        /// <param name="pre"></param>
        /// <param name="zDatum"></param>
        /// <returns></returns>
        private Point3d GetSingleHeadSetValue(ElectrodeSetValueInfo setValue, ElectrodePitchInfo pitch, ElectrodePreparationInfo pre, bool zDatum)
        {
            Point3d temp = new Point3d(setValue.EleSetValue[0], setValue.EleSetValue[1], setValue.EleSetValue[2]);
            double  x1   = temp.X - (pitch.PitchXNum - 1) * pitch.PitchX / 2;
            double  y1   = temp.Y - (pitch.PitchYNum - 1) * pitch.PitchY / 2;

            if (zDatum)
            {
                if (pre.Preparation[0] > pre.Preparation[1])
                {
                    x1 = temp.X - (pitch.PitchXNum - 2) * pitch.PitchX / 2;
                }
                else
                {
                    y1 = temp.Y - (pitch.PitchYNum - 2) * pitch.PitchY / 2;
                }
            }
            return(new Point3d(x1, y1, temp.Z));
        }