Example #1
0
        /// <summary>
        /// 通过从CAD返回的点坐标进行Form中的添加及更新操作
        /// </summary>
        /// <param name="point">获取的点</param>
        /// <param name="BEP">起始点为A 结束点为B</param>
        private void OprateFormData(RxTypeList.AcDbArc arc)
        {
            if (SX_AIX.Text == string.Empty || SY_AIX.Text == string.Empty)
            {
                MessageBox.Show("未初始化参考坐标!请先初始化参考坐标系!");
                return;
            }
            int keepValuePoint = Convert.ToInt16(KeepValue.Text);

            double[] StartPoint = CadOprator.TackAix(arc.StartPoint, RefPoint, ApplyPlantAix.Checked);
            double[] EndPoint   = CadOprator.TackAix(arc.EndPoint, RefPoint, ApplyPlantAix.Checked);
            double[] TCenter    = CadOprator.TackAix(arc.Center, RefPoint, ApplyPlantAix.Checked);
            double   Radius     = Math.Round(arc.Radius / 1000 * 20, keepValuePoint);
            double   StartAngle = Math.Round(arc.StartAngle, keepValuePoint);
            double   EndAngle   = Math.Round(arc.EndAngle, keepValuePoint);
            String   Ttrack     = string.Empty;

            if (SingeRoadSelected.Checked)
            {
                Ttrack = "SingerTrack";
            }
            else
            {
                Ttrack = "DoubleTrack";
            }
            if (WriteObjectToDataGrid(StartPoint, TCenter, Radius, StartAngle, EndAngle, "A", Ttrack))
            {
                if (WriteObjectToDataGrid(EndPoint, 0, "B", Ttrack))
                {
                    ///////////////////////////////////////////////////////
                }
            }
            try
            {
                WriteObjectID(arc.StartPoint, arc.EndPoint, (index + "-A"));
            }
            catch (System.Exception)
            {
                //throw;
            }
            string Res = PlantOnline.WriteTrack("A_" + (index < 10?("0" + index):Convert.ToString(index)), StartPoint, EndPoint, Ttrack, StartAngle, TCenter, EndAngle, 0, Radius, RefPoint);

            if (Res != string.Empty)
            {
                SendDataToSocket(Res);
            }
            index += 1;
            return;
        }
Example #2
0
        /// <summary>
        /// 通过从CAD返回的点坐标进行Form中的添加及更新操作
        /// </summary>
        /// <param name="point">获取的点</param>
        /// <param name="BEP">起始点为A 结束点为B</param>
        /// <param name="Line"></param>
        private void OprateFormData(RxTypeList.AcadLine Line)
        {
            if (SX_AIX.Text == string.Empty || SY_AIX.Text == string.Empty)
            {
                MessageBox.Show("未初始化参考坐标!请先初始化参考坐标系!");
                return;
            }
            double[] StartPoint = CadOprator.TackAix(Line.StartPoint, RefPoint, ApplyPlantAix.Checked);
            double[] EndPoint   = CadOprator.TackAix(Line.EndPoint, RefPoint, ApplyPlantAix.Checked);
            String   Ttrack     = string.Empty;

            if (SingeRoadSelected.Checked)
            {
                Ttrack = "SingerTrack";
            }
            else
            {
                Ttrack = "DoubleTrack";
            }
            if (WriteObjectToDataGrid(StartPoint, Line.FwAngle, "A", Ttrack))
            {
                if (WriteObjectToDataGrid(EndPoint, 0, "B", Ttrack))
                {
                    ///////////////////////////////////////////////////////
                }
            }
            try
            {
                WriteObjectID(Line.StartPoint, Line.EndPoint, (index + "-A"));
            }
            catch (System.Exception)
            {
                //throw;
            }
            string Res = PlantOnline.WriteTrack("A_" + (index < 10 ? ("0" + index) : Convert.ToString(index)), StartPoint, EndPoint, Ttrack, 0, new double[] { 0, 0, 0 }, 0, Line.FwAngle, 0, RefPoint);

            if (Res != string.Empty)
            {
                SendDataToSocket(Res);
            }
            index += 1;
        }
Example #3
0
        /// <summary>
        /// 通过从CAD返回的点坐标进行Form中的添加及更新操作
        /// </summary>
        /// <param name="point">获取的点</param>
        /// <param name="BEP">起始点为A 结束点为B</param>
        /// <param name="Line"></param>
        private void OprateFormData(RxTypeList.AcadLine Line)
        {
            if (SX_AIX.Text == string.Empty || SY_AIX.Text == string.Empty)
            {
                MessageBox.Show("未初始化参考坐标!请先初始化参考坐标系!");
                return;
            }
            double[] StartPoint = CadOprator.TackAix(Line.StartPoint, RefPoint, ApplyPlantAix.Checked);
            double[] EndPoint   = CadOprator.TackAix(Line.EndPoint, RefPoint, ApplyPlantAix.Checked);
            String   Ttrack     = string.Empty;

            if (SingeRoadSelected.Checked)
            {
                Ttrack = "SingerTrack";
            }
            else
            {
                Ttrack = "DoubleTrack";
            }
            if (WriteObjectToDataGrid(StartPoint, Line.FwAngle, "A", Ttrack))
            {
                if (WriteObjectToDataGrid(EndPoint, 0, "B", Ttrack))
                {
                    ///////////////////////////////////////////////////////
                }
            }
            try
            {
                WriteObjectID(Line.StartPoint, Line.EndPoint, (index + "-A"));
            }
            catch (System.Exception)
            {
                //throw;
            }
            index += 1;
        }