Exemplo n.º 1
0
        public static string LevelingRecord(int dataCount, int backCount, DataType.Data approximateDataType, DataType.LeftOrRight LorR, ref TableLayoutPanel tableLayoutPanel)
        {
            List <string> list = new List <string>();
            List <string> col0 = new List <string>();
            List <string> col1 = new List <string>();
            List <string> col2 = new List <string>();
            List <string> col3 = new List <string>();
            List <string> col6 = new List <string>();

            if (tableLayoutPanel == null)
            {
                return(null);
            }
            foreach (Control item in tableLayoutPanel.Controls)
            {
                TextBox txtBox = item as TextBox;
                if (txtBox != null)
                {
                    if (txtBox.Text != "")
                    {
                        list.Add(txtBox.Text);
                    }
                    else
                    {
                        MessageBox.Show("请将数据填写完整!");
                        return(null);
                    }
                }
            }
            for (int i = 0; i < (tableLayoutPanel.RowCount - 3) / (backCount * 2); i++)
            {
                col0.Add(list[i]);
            }
            for (int i = col0.Count; i < col0.Count + tableLayoutPanel.RowCount - 3; i++)
            {
                col1.Add(list[i]);
            }
            for (int i = col0.Count + col1.Count; i < col0.Count + col1.Count + tableLayoutPanel.RowCount - 3; i++)
            {
                col2.Add(list[i]);
            }
            for (int i = col0.Count + col1.Count + col2.Count; i < col0.Count + col1.Count + col2.Count + tableLayoutPanel.RowCount - 3; i++)
            {
                col3.Add(list[i]);
            }
            if (approximateDataType == DataType.Data.ConnectingTraverse)
            {
                int j = col0.Count + col1.Count + col2.Count + col3.Count;
                col6.Add(list[j]);
                col6.Add(list[j + 1]);//col6第二个数存放的是最后一个数据
            }
            else
            {
                int j = col0.Count + col1.Count + col2.Count + col3.Count;
                col6.Add(list[j]);
            }
            return(ApproximateAdjustment.GetLeveling(col0, col1, col2, col3, col6, dataCount, backCount, approximateDataType, LorR));
        }
Exemplo n.º 2
0
 private void tsbtnFormat_Click(object sender, EventArgs e)
 {
     if (isCalculate == true)
     {
         isCalculate = false;
     }
     if (dataType == DataType.DataType.ApproximateAdjustment || dataType == DataType.DataType.HandMade)
     {
         FormFormat frm = new FormFormat();
         if (frm.ShowDialog() == DialogResult.OK)
         {
             dataCount           = frm.DataCount;
             backCount           = frm.BackCount;
             approximateDataType = frm.TraverseDataType;
             lorR   = frm.LorR;
             LvlWet = frm.LvlWet;
         }
     }
     else if (dataType == DataType.DataType.TotalStation)
     {
         FormAccuracy frm = new FormAccuracy();
         frm.lblPointName = col0[col0.Count - 2];
         frm.pointX       = Convert.ToDouble(col1[col1.Count - 2]);
         frm.pointY       = Convert.ToDouble(col2[col2.Count - 2]);
         frm.Init();
         if (frm.ShowDialog() == DialogResult.OK)
         {
             accuracy[0] = frm.direction;
             accuracy[1] = frm.side;
             accuracy[2] = frm.sidePercent;
             accuracy[3] = frm.angle;
             accuracy[4] = frm.pointX;
             accuracy[5] = frm.pointY;
         }
     }
     else if (dataType == DataType.DataType.Geodetic || dataType == DataType.DataType.Gauss)
     {
         FormCoordinate frm = new FormCoordinate();
         if (frm.ShowDialog() == DialogResult.OK)
         {
             gKNo         = frm.gKNo;      //高斯投影坐标分带
             gKOrCoord    = frm.gKOrCoord; //高斯投影正反算还是坐标换带转换
             inputMidLon  = frm.inputMidLon;
             outputMidLon = frm.outputMidLon;
         }
     }
 }
Exemplo n.º 3
0
        public static string GetTraverse(List <string> col0, List <string> col1, List <string> col2, List <string> col3, List <string> col6, List <string> col7, List <string> col9, List <string> col10, int dataCount, int backCount, DataType.Data approximateDataType, DataType.LeftOrRight LorR)
        {
            List <string> col4 = new List <string>();
            List <string> col5 = new List <string>();
            List <string> col8 = new List <string>();
            double        coordinateCloseError = 0;
            double        angleCloseError      = 0;

            for (int i = 0; i < dataCount; i += 2)
            {
                double left;
                double right;
                if (ConvertAngle.SecondFromString(col2[i + 1]) >= ConvertAngle.SecondFromString(col2[i]) && ConvertAngle.SecondFromString(col3[i + 1]) >= ConvertAngle.SecondFromString(col3[i]))
                {
                    left  = ConvertAngle.SecondFromString(col2[i + 1]) - ConvertAngle.SecondFromString(col2[i]);
                    right = ConvertAngle.SecondFromString(col3[i + 1]) - ConvertAngle.SecondFromString(col3[i]);
                    col4.Add(Math.Abs(left - right).ToString());
                }
                else if (ConvertAngle.SecondFromString(col2[i + 1]) >= ConvertAngle.SecondFromString(col2[i]) && ConvertAngle.SecondFromString(col3[i + 1]) < ConvertAngle.SecondFromString(col3[i]))
                {
                    left  = ConvertAngle.SecondFromString(col2[i + 1]) - ConvertAngle.SecondFromString(col2[i]);
                    right = ConvertAngle.SecondFromString(col3[i + 1]) - ConvertAngle.SecondFromString(col3[i]) + 360 * 3600;
                    col4.Add(Math.Abs(left - right).ToString());
                }
                else if (ConvertAngle.SecondFromString(col2[i + 1]) < ConvertAngle.SecondFromString(col2[i]) && ConvertAngle.SecondFromString(col3[i + 1]) >= ConvertAngle.SecondFromString(col3[i]))
                {
                    left  = ConvertAngle.SecondFromString(col2[i + 1]) - ConvertAngle.SecondFromString(col2[i]) + 360 * 3600;
                    right = ConvertAngle.SecondFromString(col3[i + 1]) - ConvertAngle.SecondFromString(col3[i]);
                    col4.Add(Math.Abs(left - right).ToString());
                }
                else
                {
                    left  = ConvertAngle.SecondFromString(col2[i + 1]) - ConvertAngle.SecondFromString(col2[i]) + 360 * 3600;
                    right = ConvertAngle.SecondFromString(col3[i + 1]) - ConvertAngle.SecondFromString(col3[i]) + 360 * 3600;
                    col4.Add(Math.Abs(left - right).ToString());
                }
            }
            for (int i = 0; i < dataCount; i += (backCount * 2))
            {
                double allSecond = 0;
                for (int j = 0; j < backCount * 2; j += 2)
                {
                    double left;
                    double right;
                    if (ConvertAngle.SecondFromString(col2[i + j + 1]) >= ConvertAngle.SecondFromString(col2[i + j]) && ConvertAngle.SecondFromString(col3[i + j + 1]) >= ConvertAngle.SecondFromString(col3[i + j]))
                    {
                        left       = ConvertAngle.SecondFromString(col2[i + j + 1]) - ConvertAngle.SecondFromString(col2[i + j]);
                        right      = ConvertAngle.SecondFromString(col3[i + j + 1]) - ConvertAngle.SecondFromString(col3[i + j]);
                        allSecond += (left + right);
                    }
                    else if (ConvertAngle.SecondFromString(col2[i + j + 1]) >= ConvertAngle.SecondFromString(col2[i + j]) && ConvertAngle.SecondFromString(col3[i + j + 1]) < ConvertAngle.SecondFromString(col3[i + j]))
                    {
                        left       = ConvertAngle.SecondFromString(col2[i + j + 1]) - ConvertAngle.SecondFromString(col2[i + j]);
                        right      = ConvertAngle.SecondFromString(col3[i + j + 1]) - ConvertAngle.SecondFromString(col3[i + j]) + 360 * 3600;
                        allSecond += (left + right);
                    }
                    else if (ConvertAngle.SecondFromString(col2[i + j + 1]) < ConvertAngle.SecondFromString(col2[i + j]) && ConvertAngle.SecondFromString(col3[i + j + 1]) >= ConvertAngle.SecondFromString(col3[i + j]))
                    {
                        left       = ConvertAngle.SecondFromString(col2[i + j + 1]) - ConvertAngle.SecondFromString(col2[i + j]) + 360 * 3600;
                        right      = ConvertAngle.SecondFromString(col3[i + j + 1]) - ConvertAngle.SecondFromString(col3[i + j]);
                        allSecond += (left + right);
                    }
                    else
                    {
                        left       = ConvertAngle.SecondFromString(col2[i + j + 1]) - ConvertAngle.SecondFromString(col2[i + j]) + 360 * 3600;
                        right      = ConvertAngle.SecondFromString(col3[i + j + 1]) - ConvertAngle.SecondFromString(col3[i + j]) + 360 * 3600;
                        allSecond += (left + right);
                    }
                }
                col5.Add(ConvertAngle.SecondToString(allSecond / (backCount * 2)));
            }
            if (LorR == DataType.LeftOrRight.Left)//1代表左角
            {
                if ((ConvertAngle.SecondFromString(col6[0]) + ConvertAngle.SecondFromString(col5[0])) + 180 * 3600 <= 360 * 3600)
                {
                    col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[0]) + ConvertAngle.SecondFromString(col5[0])) + 180 * 3600));
                }
                else
                {
                    col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[0]) + ConvertAngle.SecondFromString(col5[0])) - 180 * 3600));
                }
                if (approximateDataType == DataType.Data.ConnectingTraverse)//闭附和导线
                {
                    for (int i = 0; i < dataCount / backCount / 2 - 1; i++)
                    {
                        if ((ConvertAngle.SecondFromString(col6[i + 2]) + ConvertAngle.SecondFromString(col5[i + 1])) + 180 * 3600 <= 360 * 3600)
                        {
                            col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 2]) + ConvertAngle.SecondFromString(col5[i + 1])) + 180 * 3600));
                        }
                        else
                        {
                            col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 2]) + ConvertAngle.SecondFromString(col5[i + 1])) - 180 * 3600));
                        }
                    }
                    //还要进行平差,左角平差,将闭合差相加
                    angleCloseError = ConvertAngle.SecondFromString(col6[1]) - ConvertAngle.SecondFromString(col6[col6.Count - 1]);
                    for (int i = 0; i < Math.Abs(angleCloseError); i++)
                    {
                        if (angleCloseError < 0)
                        {
                            if (ConvertAngle.SecondFromString(col5[i % (dataCount / 2 / backCount)]) + 1 < 360 * 3600)
                            {
                                col5[i % (dataCount / 2 / backCount)] = ConvertAngle.SecondToString(ConvertAngle.SecondFromString(col5[i % (dataCount / 2 / backCount)]) + 1);
                            }
                            else
                            {
                                col5[i % (dataCount / 2 / backCount)] = ConvertAngle.SecondToString(ConvertAngle.SecondFromString(col5[i % (dataCount / 2 / backCount)]) + 1 - 360 * 3600);
                            }
                        }
                        if (angleCloseError > 0)
                        {
                            if (ConvertAngle.SecondFromString(col5[i % (dataCount / 2 / backCount)]) - 1 > 0)
                            {
                                col5[i % (dataCount / 2 / backCount)] = ConvertAngle.SecondToString(ConvertAngle.SecondFromString(col5[i % (dataCount / 2 / backCount)]) - 1);
                            }
                            else
                            {
                                col5[i % (dataCount / 2 / backCount)] = ConvertAngle.SecondToString(ConvertAngle.SecondFromString(col5[i % (dataCount / 2 / backCount)]) - 1 + 360 * 3600);
                            }
                        }
                    }
                    if ((ConvertAngle.SecondFromString(col6[0]) + ConvertAngle.SecondFromString(col5[0])) + 180 * 3600 <= 360 * 3600)
                    {
                        col6[2] = ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[0]) + ConvertAngle.SecondFromString(col5[0])) + 180 * 3600);
                    }
                    else
                    {
                        col6[2] = ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[0]) + ConvertAngle.SecondFromString(col5[0])) - 180 * 3600);
                    }
                    for (int i = 1; i < col6.Count - 3; i++)
                    {
                        if ((ConvertAngle.SecondFromString(col6[i + 1]) + ConvertAngle.SecondFromString(col5[i])) + 180 * 3600 <= 360 * 3600)
                        {
                            col6[i + 2] = ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 1]) + ConvertAngle.SecondFromString(col5[i])) + 180 * 3600);
                        }
                        else
                        {
                            col6[i + 2] = ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 1]) + ConvertAngle.SecondFromString(col5[i])) - 180 * 3600);
                        }
                    }
                }
                else if (approximateDataType == DataType.Data.OpenTraverse)//支导线
                {
                    for (int i = 0; i < dataCount / backCount / 2 - 1; i++)
                    {
                        if ((ConvertAngle.SecondFromString(col6[i + 1]) + ConvertAngle.SecondFromString(col5[i + 1])) + 180 * 3600 <= 360 * 3600)
                        {
                            col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 1]) + ConvertAngle.SecondFromString(col5[i + 1])) + 180 * 3600));
                        }
                        else
                        {
                            col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 1]) + ConvertAngle.SecondFromString(col5[i + 1])) - 180 * 3600));
                        }
                    }
                }
            }
            else if (LorR == DataType.LeftOrRight.Right)//2代表右角
            {
                if ((ConvertAngle.SecondFromString(col6[0]) - ConvertAngle.SecondFromString(col5[0])) - 180 * 3600 > 0)
                {
                    col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[0]) - ConvertAngle.SecondFromString(col5[0])) - 180 * 3600));
                }
                else if ((ConvertAngle.SecondFromString(col6[0]) - ConvertAngle.SecondFromString(col5[0])) + 180 * 3600 > 0)
                {
                    col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[0]) - ConvertAngle.SecondFromString(col5[0])) + 180 * 3600));
                }
                else
                {
                    col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[0]) - ConvertAngle.SecondFromString(col5[0])) + 540 * 3600));
                }
                if (approximateDataType == DataType.Data.ConnectingTraverse)//闭附和导线
                {
                    for (int i = 0; i < dataCount / backCount / 2 - 1; i++)
                    {
                        if ((ConvertAngle.SecondFromString(col6[i + 2]) - ConvertAngle.SecondFromString(col5[i + 1])) - 180 * 3600 >= 0)
                        {
                            col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 2]) - ConvertAngle.SecondFromString(col5[i + 1])) - 180 * 3600));
                        }
                        else if ((ConvertAngle.SecondFromString(col6[i + 2]) - ConvertAngle.SecondFromString(col5[i + 1])) > -180 * 3600)
                        {
                            col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 2]) - ConvertAngle.SecondFromString(col5[i + 1])) + 180 * 3600));
                        }
                        else
                        {
                            col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 2]) - ConvertAngle.SecondFromString(col5[i + 1])) + 540 * 3600));
                        }
                    }
                    //右角平差将闭合差相减
                    angleCloseError = ConvertAngle.SecondFromString(col6[1]) - ConvertAngle.SecondFromString(col6[col6.Count - 1]);
                    for (int i = 0; i < Math.Abs(angleCloseError); i++)
                    {
                        if (angleCloseError > 0)
                        {
                            if (ConvertAngle.SecondFromString(col5[i % (dataCount / 2 / backCount)]) - 1 > 0)
                            {
                                col5[i % (dataCount / 2 / backCount)] = ConvertAngle.SecondToString(ConvertAngle.SecondFromString(col5[i % (dataCount / 2 / backCount)]) - 1);
                            }
                            else
                            {
                                col5[i % (dataCount / 2 / backCount)] = ConvertAngle.SecondToString(ConvertAngle.SecondFromString(col5[i % (dataCount / 2 / backCount)]) - 1 + 360 * 3600);
                            }
                        }
                        if (angleCloseError < 0)
                        {
                            if (ConvertAngle.SecondFromString(col5[i % (dataCount / 2 / backCount)]) + 1 < 360 * 3600)
                            {
                                col5[i % (dataCount / 2 / backCount)] = ConvertAngle.SecondToString(ConvertAngle.SecondFromString(col5[i % (dataCount / 2 / backCount)]) + 1);
                            }
                            else
                            {
                                col5[i % (dataCount / 2 / backCount)] = ConvertAngle.SecondToString(ConvertAngle.SecondFromString(col5[i % (dataCount / 2 / backCount)]) + 1 - 360 * 3600);
                            }
                        }
                    }
                    if ((ConvertAngle.SecondFromString(col6[0]) - ConvertAngle.SecondFromString(col5[0])) - 180 * 3600 > 0)
                    {
                        col6[2] = ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[0]) - ConvertAngle.SecondFromString(col5[0])) - 180 * 3600);
                    }
                    else if ((ConvertAngle.SecondFromString(col6[0]) - ConvertAngle.SecondFromString(col5[0])) + 180 * 3600 > 0)
                    {
                        col6[2] = ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[0]) - ConvertAngle.SecondFromString(col5[0])) + 180 * 3600);
                    }
                    else
                    {
                        col6[2] = ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[0]) - ConvertAngle.SecondFromString(col5[0])) + 540 * 3600);
                    }
                    for (int i = 1; i < col6.Count - 3; i++)
                    {
                        if ((ConvertAngle.SecondFromString(col6[i + 2]) - ConvertAngle.SecondFromString(col5[i + 1])) - 180 * 3600 >= 0)
                        {
                            col6[i + 2] = ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 1]) - ConvertAngle.SecondFromString(col5[i])) - 180 * 3600);
                        }
                        else if ((ConvertAngle.SecondFromString(col6[i + 2]) - ConvertAngle.SecondFromString(col5[i + 1])) > -180 * 3600)
                        {
                            col6[i + 2] = ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 1]) - ConvertAngle.SecondFromString(col5[i])) + 180 * 3600);
                        }
                        else
                        {
                            col6[i + 2] = ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 2]) - ConvertAngle.SecondFromString(col5[i + 1])) + 540 * 3600);
                        }
                    }
                }
                else//支导线
                {
                    for (int i = 0; i < dataCount / backCount / 2 - 1; i++)
                    {
                        if ((ConvertAngle.SecondFromString(col6[i]) - ConvertAngle.SecondFromString(col5[i])) - 180 * 3600 >= 0)
                        {
                            col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i]) - ConvertAngle.SecondFromString(col5[i])) - 180 * 3600));
                        }
                        else
                        {
                            col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i]) - ConvertAngle.SecondFromString(col5[i])) + 180 * 3600));
                        }
                    }
                }
            }
            //计算平均距离
            for (int i = 0; i < dataCount / 2; i += backCount)
            {
                double hDistance = 0;
                for (int j = 0; j < backCount; j++)
                {
                    hDistance += Convert.ToDouble(col7[i + j]);
                }
                col8.Add((hDistance / backCount).ToString());
            }
            //计算坐标
            if (approximateDataType == DataType.Data.ConnectingTraverse)
            {
                for (int i = 0; i < dataCount / backCount / 2 - 1; i++)
                {
                    //平差后,最后一个值用于计算闭合差
                    col9.Add(Math.Round((Convert.ToDouble(col8[i]) * Math.Cos(ConvertAngle.DegreeToRadian(col6[i + 2])) + double.Parse(col9[i])), 3).ToString());
                    col10.Add(Math.Round((Convert.ToDouble(col8[i]) * Math.Sin(ConvertAngle.DegreeToRadian(col6[i + 2])) + double.Parse(col10[i])), 3).ToString());
                }
                double x = Math.Round(double.Parse(col9[1]) - double.Parse(col9[col9.Count - 1]), 3);
                double y = Math.Round(double.Parse(col10[1]) - double.Parse(col10[col10.Count - 1]), 3);
                coordinateCloseError = Math.Round(Math.Sqrt(x * x + y * y), 3);
                for (int i = 0; i < (int)Math.Abs(x * 1000); i++)
                {
                    if (x > 0)
                    {
                        col9[(i % (dataCount / backCount / 2 - 2)) + 2] = (Convert.ToDouble(col9[(i % (dataCount / backCount / 2 - 2)) + 2]) - 0.001).ToString();
                    }
                    else if (x < 0)
                    {
                        col9[(i % (dataCount / backCount / 2 - 2)) + 2] = (Convert.ToDouble(col9[(i % (dataCount / backCount / 2 - 2)) + 2]) + 0.001).ToString();
                    }
                }
                for (int i = 0; i < (int)Math.Abs(y * 1000); i++)
                {
                    if (y > 0)
                    {
                        col10[(i % (dataCount / backCount / 2 - 2)) + 2] = (Convert.ToDouble(col10[(i % (dataCount / backCount / 2 - 2)) + 2]) - 0.001).ToString();
                    }
                    else if (y < 0)
                    {
                        col10[(i % (dataCount / backCount / 2 - 2)) + 2] = (Convert.ToDouble(col10[(i % (dataCount / backCount / 2 - 2)) + 2]) + 0.001).ToString();
                    }
                }
            }
            else if (approximateDataType == DataType.Data.OpenTraverse)
            {
                for (int i = 0; i < dataCount / backCount / 2 - 1; i++)
                {
                    //最后一个值必须保留
                    col9.Add(Math.Round((Convert.ToDouble(col8[i]) * Math.Cos(ConvertAngle.DegreeToRadian(col6[i + 1])) + double.Parse(col9[i])), 3).ToString());
                    col10.Add(Math.Round((Convert.ToDouble(col8[i]) * Math.Sin(ConvertAngle.DegreeToRadian(col6[i + 1])) + double.Parse(col10[i])), 3).ToString());
                }
            }
            return(PrintResult(col0, col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, approximateDataType, coordinateCloseError, angleCloseError));
        }
Exemplo n.º 4
0
        public static string GetLeveling(List <string> col0, List <string> col1, List <string> col2, List <string> col3, List <string> col6, int dataCount, int backCount, DataType.Data approximateDataType, DataType.LeftOrRight LorR)
        {
            List <string> col4 = new List <string>();
            List <string> col5 = new List <string>();
            double        coordinateCloseError = 0;
            double        angleCloseError      = 0;

            for (int i = 0; i < dataCount; i += 2)
            {
                double left;
                double right;
                if (ConvertAngle.SecondFromString(col2[i + 1]) >= ConvertAngle.SecondFromString(col2[i]) && ConvertAngle.SecondFromString(col3[i + 1]) >= ConvertAngle.SecondFromString(col3[i]))
                {
                    left  = ConvertAngle.SecondFromString(col2[i + 1]) - ConvertAngle.SecondFromString(col2[i]);
                    right = ConvertAngle.SecondFromString(col3[i + 1]) - ConvertAngle.SecondFromString(col3[i]);
                    col4.Add(Math.Abs(left - right).ToString());
                }
                else if (ConvertAngle.SecondFromString(col2[i + 1]) >= ConvertAngle.SecondFromString(col2[i]) && ConvertAngle.SecondFromString(col3[i + 1]) < ConvertAngle.SecondFromString(col3[i]))
                {
                    left  = ConvertAngle.SecondFromString(col2[i + 1]) - ConvertAngle.SecondFromString(col2[i]);
                    right = ConvertAngle.SecondFromString(col3[i + 1]) - ConvertAngle.SecondFromString(col3[i]) + 360 * 3600;
                    col4.Add(Math.Abs(left - right).ToString());
                }
                else if (ConvertAngle.SecondFromString(col2[i + 1]) < ConvertAngle.SecondFromString(col2[i]) && ConvertAngle.SecondFromString(col3[i + 1]) >= ConvertAngle.SecondFromString(col3[i]))
                {
                    left  = ConvertAngle.SecondFromString(col2[i + 1]) - ConvertAngle.SecondFromString(col2[i]) + 360 * 3600;
                    right = ConvertAngle.SecondFromString(col3[i + 1]) - ConvertAngle.SecondFromString(col3[i]);
                    col4.Add(Math.Abs(left - right).ToString());
                }
                else
                {
                    left  = ConvertAngle.SecondFromString(col2[i + 1]) - ConvertAngle.SecondFromString(col2[i]) + 360 * 3600;
                    right = ConvertAngle.SecondFromString(col3[i + 1]) - ConvertAngle.SecondFromString(col3[i]) + 360 * 3600;
                    col4.Add(Math.Abs(left - right).ToString());
                }
            }
            for (int i = 0; i < dataCount; i += (backCount * 2))
            {
                double allSecond = 0;
                for (int j = 0; j < backCount * 2; j += 2)
                {
                    double left;
                    double right;
                    if (ConvertAngle.SecondFromString(col2[i + j + 1]) >= ConvertAngle.SecondFromString(col2[i + j]) && ConvertAngle.SecondFromString(col3[i + j + 1]) >= ConvertAngle.SecondFromString(col3[i + j]))
                    {
                        left       = ConvertAngle.SecondFromString(col2[i + j + 1]) - ConvertAngle.SecondFromString(col2[i + j]);
                        right      = ConvertAngle.SecondFromString(col3[i + j + 1]) - ConvertAngle.SecondFromString(col3[i + j]);
                        allSecond += (left + right);
                    }
                    else if (ConvertAngle.SecondFromString(col2[i + j + 1]) >= ConvertAngle.SecondFromString(col2[i + j]) && ConvertAngle.SecondFromString(col3[i + j + 1]) < ConvertAngle.SecondFromString(col3[i + j]))
                    {
                        left       = ConvertAngle.SecondFromString(col2[i + j + 1]) - ConvertAngle.SecondFromString(col2[i + j]);
                        right      = ConvertAngle.SecondFromString(col3[i + j + 1]) - ConvertAngle.SecondFromString(col3[i + j]) + 360 * 3600;
                        allSecond += (left + right);
                    }
                    else if (ConvertAngle.SecondFromString(col2[i + j + 1]) < ConvertAngle.SecondFromString(col2[i + j]) && ConvertAngle.SecondFromString(col3[i + j + 1]) >= ConvertAngle.SecondFromString(col3[i + j]))
                    {
                        left       = ConvertAngle.SecondFromString(col2[i + j + 1]) - ConvertAngle.SecondFromString(col2[i + j]) + 360 * 3600;
                        right      = ConvertAngle.SecondFromString(col3[i + j + 1]) - ConvertAngle.SecondFromString(col3[i + j]);
                        allSecond += (left + right);
                    }
                    else
                    {
                        left       = ConvertAngle.SecondFromString(col2[i + j + 1]) - ConvertAngle.SecondFromString(col2[i + j]) + 360 * 3600;
                        right      = ConvertAngle.SecondFromString(col3[i + j + 1]) - ConvertAngle.SecondFromString(col3[i + j]) + 360 * 3600;
                        allSecond += (left + right);
                    }
                }
                col5.Add(ConvertAngle.SecondToString(allSecond / (backCount * 2)));
            }
            if (LorR == DataType.LeftOrRight.Left)//1代表左角
            {
                if ((ConvertAngle.SecondFromString(col6[0]) + ConvertAngle.SecondFromString(col5[0])) + 180 * 3600 <= 360 * 3600)
                {
                    col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[0]) + ConvertAngle.SecondFromString(col5[0])) + 180 * 3600));
                }
                else
                {
                    col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[0]) + ConvertAngle.SecondFromString(col5[0])) - 180 * 3600));
                }
                if (approximateDataType == DataType.Data.ConnectingTraverse)//闭附和导线
                {
                    for (int i = 0; i < dataCount / backCount / 2 - 1; i++)
                    {
                        if ((ConvertAngle.SecondFromString(col6[i + 2]) + ConvertAngle.SecondFromString(col5[i + 1])) + 180 * 3600 <= 360 * 3600)
                        {
                            col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 2]) + ConvertAngle.SecondFromString(col5[i + 1])) + 180 * 3600));
                        }
                        else
                        {
                            col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 2]) + ConvertAngle.SecondFromString(col5[i + 1])) - 180 * 3600));
                        }
                    }
                    //还要进行平差,左角平差,将闭合差相加
                    angleCloseError = ConvertAngle.SecondFromString(col6[1]) - ConvertAngle.SecondFromString(col6[col6.Count - 1]);
                    for (int i = 0; i < Math.Abs(angleCloseError); i++)
                    {
                        if (angleCloseError < 0)
                        {
                            if (ConvertAngle.SecondFromString(col5[i % (dataCount / 2 / backCount)]) + ConvertAngle.SecondFromString(col6[(i % dataCount / 2 / backCount + 2)]) + 1 < 360 * 3600)
                            {
                                col5[i % (dataCount / 2 / backCount)] = ConvertAngle.SecondToString(ConvertAngle.SecondFromString(col5[i % (dataCount / 2 / backCount)]) + 1);
                            }
                            else
                            {
                                col5[i % (dataCount / 2 / backCount)] = ConvertAngle.SecondToString(ConvertAngle.SecondFromString(col5[i % (dataCount / 2 / backCount)]) + 1 - 360 * 3600);
                            }
                        }
                        if (angleCloseError > 0)
                        {
                            if (ConvertAngle.SecondFromString(col5[i % (dataCount / 2 / backCount)]) + ConvertAngle.SecondFromString(col6[i % (dataCount / backCount / 2 + 2)]) - 1 < 360 * 3600)
                            {
                                col5[i % (dataCount / 2 / backCount)] = ConvertAngle.SecondToString(ConvertAngle.SecondFromString(col5[i % (dataCount / 2 / backCount)]) - 1);
                            }
                            else
                            {
                                col5[i % (dataCount / 2 / backCount)] = ConvertAngle.SecondToString(ConvertAngle.SecondFromString(col5[i % (dataCount / 2 / backCount)]) - 1 + 360 * 3600);
                            }
                        }
                    }
                }
                else//支导线
                {
                    for (int i = 0; i < dataCount / backCount / 2 - 1; i++)
                    {
                        if ((ConvertAngle.SecondFromString(col6[i + 1]) + ConvertAngle.SecondFromString(col5[i + 1])) + 180 * 3600 <= 360 * 3600)
                        {
                            col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 1]) + ConvertAngle.SecondFromString(col5[i + 1])) + 180 * 3600));
                        }
                        else
                        {
                            col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 1]) + ConvertAngle.SecondFromString(col5[i + 1])) - 180 * 3600));
                        }
                    }
                }
            }
            else if (LorR == DataType.LeftOrRight.Right)//2代表右角
            {
                if ((ConvertAngle.SecondFromString(col6[0]) - ConvertAngle.SecondFromString(col5[0])) - 180 * 3600 >= 0)
                {
                    col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[0]) - ConvertAngle.SecondFromString(col5[0])) - 180 * 3600));
                }
                else if ((ConvertAngle.SecondFromString(col6[0]) - ConvertAngle.SecondFromString(col5[0])) > -180 * 3600)
                {
                    col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[0]) - ConvertAngle.SecondFromString(col5[0])) + 180 * 3600));
                }
                else
                {
                    col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[0]) - ConvertAngle.SecondFromString(col5[0])) + 540 * 3600));
                }
                if (approximateDataType == DataType.Data.ConnectingTraverse)//闭附和导线
                {
                    for (int i = 0; i < dataCount / backCount / 2 - 1; i++)
                    {
                        if ((ConvertAngle.SecondFromString(col6[i + 2]) - ConvertAngle.SecondFromString(col5[i + 1])) - 180 * 3600 >= 0)
                        {
                            col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 2]) - ConvertAngle.SecondFromString(col5[i + 1])) - 180 * 3600));
                        }
                        else if ((ConvertAngle.SecondFromString(col6[i + 2]) - ConvertAngle.SecondFromString(col5[i + 1])) > -180 * 3600)
                        {
                            col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 2]) - ConvertAngle.SecondFromString(col5[i + 1])) + 180 * 3600));
                        }
                        else
                        {
                            col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 2]) - ConvertAngle.SecondFromString(col5[i + 1])) + 540 * 3600));
                        }
                    }
                    //右角平差将闭合差相减
                    angleCloseError = ConvertAngle.SecondFromString(col6[1]) - ConvertAngle.SecondFromString(col6[col6.Count - 1]);
                    for (int i = 0; i < Math.Abs(angleCloseError); i++)
                    {
                        if (angleCloseError > 0)
                        {
                            if (ConvertAngle.SecondFromString(col5[i % (dataCount / 2 / backCount)]) - 1 > 0)
                            {
                                col5[i % (dataCount / 2 / backCount)] = ConvertAngle.SecondToString(ConvertAngle.SecondFromString(col5[i % (dataCount / 2 / backCount)]) - 1);
                            }
                            else
                            {
                                col5[i % (dataCount / 2 / backCount)] = ConvertAngle.SecondToString(ConvertAngle.SecondFromString(col5[i % (dataCount / 2 / backCount)]) - 1 + 360 * 3600);
                            }
                        }
                        if (angleCloseError < 0)
                        {
                            if (ConvertAngle.SecondFromString(col5[i % (dataCount / 2 / backCount)]) + 1 < 360 * 3600)
                            {
                                col5[i % (dataCount / 2 / backCount)] = ConvertAngle.SecondToString(ConvertAngle.SecondFromString(col5[i % (dataCount / 2 / backCount)]) + 1);
                            }
                            else
                            {
                                col5[i % (dataCount / 2 / backCount)] = ConvertAngle.SecondToString(ConvertAngle.SecondFromString(col5[i % (dataCount / 2 / backCount)]) + 1 - 360 * 3600);
                            }
                        }
                    }
                }
                else//支导线
                {
                    for (int i = 0; i < dataCount / backCount / 2 - 1; i++)
                    {
                        if ((ConvertAngle.SecondFromString(col6[i]) - ConvertAngle.SecondFromString(col5[i])) - 180 * 3600 >= 0)
                        {
                            col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i]) - ConvertAngle.SecondFromString(col5[i])) - 180 * 3600));
                        }
                        else
                        {
                            col6.Add(ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i]) - ConvertAngle.SecondFromString(col5[i])) + 180 * 3600));
                        }
                    }
                }
            }
            if (LorR == DataType.LeftOrRight.Left)
            {
                if ((ConvertAngle.SecondFromString(col6[0]) + ConvertAngle.SecondFromString(col5[0])) + 180 * 3600 <= 360 * 3600)
                {
                    col6[2] = ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[0]) + ConvertAngle.SecondFromString(col5[0])) + 180 * 3600);
                }
                else
                {
                    col6[2] = ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[0]) + ConvertAngle.SecondFromString(col5[0])) - 180 * 3600);
                }
                for (int i = 0; i < dataCount / backCount / 2 - 2; i++)
                {
                    if (approximateDataType == DataType.Data.ConnectingTraverse)//闭附和导线
                    {
                        if ((ConvertAngle.SecondFromString(col6[i + 2]) + ConvertAngle.SecondFromString(col5[i + 1])) + 180 * 3600 <= 360 * 3600)
                        {
                            col6[i + 3] = ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 2]) + ConvertAngle.SecondFromString(col5[i + 1])) + 180 * 3600);
                        }
                        else
                        {
                            col6[i + 3] = ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 2]) + ConvertAngle.SecondFromString(col5[i + 1])) - 180 * 3600);
                        }
                    }
                    else//支导线
                    {
                        if ((ConvertAngle.SecondFromString(col6[i + 1]) + ConvertAngle.SecondFromString(col5[i + 1])) + 180 * 3600 <= 360 * 3600)
                        {
                            col6[i + 1] = ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 1]) + ConvertAngle.SecondFromString(col5[i + 1])) + 180 * 3600);
                        }
                        else
                        {
                            col6[i + 1] = ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 1]) + ConvertAngle.SecondFromString(col5[i + 1])) - 180 * 3600);
                        }
                    }
                }
            }
            else if (LorR == DataType.LeftOrRight.Right)
            {
                if ((ConvertAngle.SecondFromString(col6[0]) - ConvertAngle.SecondFromString(col5[0])) - 180 * 3600 >= 0)
                {
                    col6[2] = ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[0]) - ConvertAngle.SecondFromString(col5[0])) - 180 * 3600);
                }
                else if ((ConvertAngle.SecondFromString(col6[0]) - ConvertAngle.SecondFromString(col5[0])) > -180 * 3600)
                {
                    col6[2] = ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[0]) - ConvertAngle.SecondFromString(col5[0])) + 180 * 3600);
                }
                else
                {
                    col6[2] = ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[0]) - ConvertAngle.SecondFromString(col5[0])) + 540 * 3600);
                }
                for (int i = 0; i < dataCount / backCount / 2 - 1; i++)
                {
                    if ((ConvertAngle.SecondFromString(col6[i + 2]) - ConvertAngle.SecondFromString(col5[i + 1])) - 180 * 3600 >= 0)
                    {
                        col6[i + 3] = ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 2]) - ConvertAngle.SecondFromString(col5[i + 1])) - 180 * 3600);
                    }
                    else if ((ConvertAngle.SecondFromString(col6[i + 2]) - ConvertAngle.SecondFromString(col5[i + 1])) > -180 * 3600)
                    {
                        col6[i + 3] = ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 2]) - ConvertAngle.SecondFromString(col5[i + 1])) + 180 * 3600);
                    }
                    else
                    {
                        col6[i + 3] = ConvertAngle.SecondToString((ConvertAngle.SecondFromString(col6[i + 2]) - ConvertAngle.SecondFromString(col5[i + 1])) + 540 * 3600);
                    }
                }
            }
            return(PrintResult(col0, col1, col2, col3, col4, col5, col6, null, null, null, null, approximateDataType, coordinateCloseError, angleCloseError));
        }
Exemplo n.º 5
0
        public static string PrintResult(List <string> col0, List <string> col1, List <string> col2, List <string> col3, List <string> col4, List <string> col5, List <string> col6, List <string> col7, List <string> col8, List <string> col9, List <string> col10, DataType.Data approximateDataType, double coordinateCloseError, double angleCloseError)
        {
            string dataType = null;

            if (approximateDataType == DataType.Data.ConnectingTraverse)
            {
                dataType = "ConnectingTraverse";
            }
            else if (approximateDataType == DataType.Data.OpenTraverse)
            {
                dataType = "OpenTraverse";
            }
            string filePath = Path.GetTempFileName();

            using (StreamWriter sw = new StreamWriter(filePath, false, Encoding.Default))
            {
                sw.WriteLine(dataType);
                sw.WriteLine(coordinateCloseError.ToString());
                sw.WriteLine(angleCloseError.ToString());
                foreach (string strItem in col0)
                {
                    sw.Write("{0},", strItem);
                }
                sw.WriteLine();
                foreach (string strItem in col1)
                {
                    sw.Write("{0},", strItem);
                }
                sw.WriteLine();
                foreach (string strItem in col2)
                {
                    sw.Write("{0},", strItem);
                }
                sw.WriteLine();
                foreach (string strItem in col3)
                {
                    sw.Write("{0},", strItem);
                }
                sw.WriteLine();
                foreach (string strItem in col4)
                {
                    sw.Write("{0},", strItem);
                }
                sw.WriteLine();
                foreach (string strItem in col5)
                {
                    sw.Write("{0},", strItem);
                }
                sw.WriteLine();
                foreach (string strItem in col6)
                {
                    sw.Write("{0},", strItem);
                }
                if (col7 != null)
                {
                    sw.WriteLine();
                    foreach (string strItem in col7)
                    {
                        sw.Write("{0},", strItem);
                    }
                    sw.WriteLine();
                    foreach (string strItem in col8)
                    {
                        sw.Write("{0},", strItem);
                    }
                    sw.WriteLine();
                    foreach (string strItem in col9)
                    {
                        sw.Write("{0},", strItem);
                    }
                    sw.WriteLine();
                    foreach (string strItem in col10)
                    {
                        sw.Write("{0},", strItem);
                    }
                }
            }
            return(filePath);
        }
        internal static void GetData(System.Windows.Forms.Panel pnlResult, int dataCount, int backCount, DataType.Data ApproximateDataType, ref System.Windows.Forms.TableLayoutPanel tableLayoutPanel)
        {
            if (dataCount < 1)
            {
                return;
            }

            //绘制标题记录项
            pnlResult.Controls.Clear();
            TextBox txtTitle = new TextBox();

            txtTitle.Location    = new Point(45, 45);
            txtTitle.BorderStyle = BorderStyle.None;
            txtTitle.Width       = 606;
            txtTitle.Text        = "水平角观测记录";
            txtTitle.TextAlign   = HorizontalAlignment.Center;
            txtTitle.Font        = new Font("宋体", 12, FontStyle.Bold);
            TextBox txtProjectName = new TextBox();

            txtProjectName.Location    = new Point(45, 76);
            txtProjectName.BorderStyle = BorderStyle.None;
            txtProjectName.Width       = 194;
            txtProjectName.Text        = "工程名称:";
            TextBox txtInstrument = new TextBox();

            txtInstrument.Location    = new Point(246, 76);
            txtInstrument.BorderStyle = BorderStyle.None;
            txtInstrument.Width       = 194;
            txtInstrument.Text        = "仪器:";
            TextBox txtWeather = new TextBox();

            txtWeather.Location    = new Point(447, 76);
            txtWeather.BorderStyle = BorderStyle.None;
            txtWeather.Width       = 194;
            txtWeather.Text        = "天气:";
            TextBox txtObserver = new TextBox();

            txtObserver.Location    = new Point(45, 97);
            txtObserver.BorderStyle = BorderStyle.None;
            txtObserver.Width       = 194;
            txtObserver.Text        = "观测者:";
            TextBox txtRecorder = new TextBox();

            txtRecorder.Location    = new Point(246, 97);
            txtRecorder.BorderStyle = BorderStyle.None;
            txtRecorder.Width       = 194;
            txtRecorder.Text        = "记录者:";
            TextBox txtDate = new TextBox();

            txtDate.Location    = new Point(447, 97);
            txtDate.BorderStyle = BorderStyle.None;
            txtDate.Width       = 194;
            txtDate.Text        = "日期:" + DateTime.Now.ToString("yyyy-MM-dd");

            //测站点
            for (int i = 2; i < tableLayoutPanel.RowCount - 1; i += (2 * backCount))
            {
                TextBox txtBoxCol0 = new TextBox();
                txtBoxCol0.Multiline   = true;
                txtBoxCol0.Margin      = new Padding(0);
                txtBoxCol0.Name        = "txtBoxCol1" + i;
                txtBoxCol0.Width       = 56;
                txtBoxCol0.Height      = backCount * 44;
                txtBoxCol0.TextAlign   = HorizontalAlignment.Center;
                txtBoxCol0.BorderStyle = BorderStyle.None;
                tableLayoutPanel.Controls.Add(txtBoxCol0, 0, i);
                Control[] ctrlTxtBoxCol0 = tableLayoutPanel.Controls.Find(txtBoxCol0.Name, false);
                tableLayoutPanel.SetRowSpan(ctrlTxtBoxCol0[0], backCount * 2);
            }
            //照准点
            for (int i = 2; i < tableLayoutPanel.RowCount - 1; i++)
            {
                TextBox txtBoxCol = new TextBox();
                txtBoxCol.Margin      = new Padding(0);
                txtBoxCol.Width       = 56;
                txtBoxCol.Height      = 21;
                txtBoxCol.TextAlign   = HorizontalAlignment.Center;
                txtBoxCol.BorderStyle = BorderStyle.None;
                tableLayoutPanel.Controls.Add(txtBoxCol, 1, i);
            }
            //盘左
            for (int i = 2; i < tableLayoutPanel.RowCount - 1; i++)
            {
                TextBox txtBoxCol = new TextBox();
                txtBoxCol.Margin      = new Padding(0);
                txtBoxCol.Width       = 108;
                txtBoxCol.Height      = 21;
                txtBoxCol.TextAlign   = HorizontalAlignment.Center;
                txtBoxCol.BorderStyle = BorderStyle.None;
                tableLayoutPanel.Controls.Add(txtBoxCol, 2, i);
            }
            //盘右
            for (int i = 2; i < tableLayoutPanel.RowCount - 1; i++)
            {
                TextBox txtBoxCol = new TextBox();
                txtBoxCol.Margin      = new Padding(0);
                txtBoxCol.Width       = 108;
                txtBoxCol.Height      = 21;
                txtBoxCol.TextAlign   = HorizontalAlignment.Center;
                txtBoxCol.BorderStyle = BorderStyle.None;
                tableLayoutPanel.Controls.Add(txtBoxCol, 3, i);
            }
            //根据数据类型决定已知点的个数并生成相应的单元格
            if (ApproximateDataType == DataType.Data.ConnectingTraverse)//闭附和导线
            {
                TextBox txtBoxCol6f = new TextBox();
                txtBoxCol6f.Name        = "txtBoxCol6f";
                txtBoxCol6f.Multiline   = true;
                txtBoxCol6f.Margin      = new Padding(0);
                txtBoxCol6f.Width       = 108;
                txtBoxCol6f.Height      = backCount * 21;
                txtBoxCol6f.TextAlign   = HorizontalAlignment.Center;
                txtBoxCol6f.BorderStyle = BorderStyle.None;
                tableLayoutPanel.Controls.Add(txtBoxCol6f, 6, 2);
                Control[] ctrlTxtBxoCol6f = tableLayoutPanel.Controls.Find(txtBoxCol6f.Name, false);
                tableLayoutPanel.SetRowSpan(ctrlTxtBxoCol6f[0], backCount);
                TextBox txtBoxCol6l = new TextBox();
                txtBoxCol6l.Name        = "txtBoxCol6l";
                txtBoxCol6l.Multiline   = true;
                txtBoxCol6l.Margin      = new Padding(0);
                txtBoxCol6l.Width       = 108;
                txtBoxCol6l.Height      = backCount * 44;
                txtBoxCol6l.TextAlign   = HorizontalAlignment.Center;
                txtBoxCol6l.BorderStyle = BorderStyle.None;
                tableLayoutPanel.Controls.Add(txtBoxCol6l, 6, tableLayoutPanel.RowCount - 1 - backCount * 2);
                Control[] ctrlTxtBoxCol6l = tableLayoutPanel.Controls.Find(txtBoxCol6l.Name, false);
                tableLayoutPanel.SetRowSpan(ctrlTxtBoxCol6l[0], backCount * 2);
            }
            else if (ApproximateDataType == DataType.Data.OpenTraverse)//支导线
            {
                TextBox txtBoxCol6 = new TextBox();
                txtBoxCol6.Name        = "txtBoxCol6";
                txtBoxCol6.Multiline   = true;
                txtBoxCol6.Margin      = new Padding(0);
                txtBoxCol6.Width       = 108;
                txtBoxCol6.Height      = 22 * backCount;
                txtBoxCol6.TextAlign   = HorizontalAlignment.Center;
                txtBoxCol6.BorderStyle = BorderStyle.None;
                tableLayoutPanel.Controls.Add(txtBoxCol6, 6, 2);
                tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 21f));
                Control[] ctrlTxtBoxCol6 = tableLayoutPanel.Controls.Find(txtBoxCol6.Name, false);
                tableLayoutPanel.SetRowSpan(ctrlTxtBoxCol6[0], backCount);
            }
            //表末尾备注
            TextBox txtCalculate = new TextBox();

            txtCalculate.Location    = new Point(48, tableLayoutPanel.Height + 125);
            txtCalculate.Width       = 195;
            txtCalculate.Height      = 21;
            txtCalculate.Text        = "计算者:";
            txtCalculate.BorderStyle = BorderStyle.None;
            pnlResult.Controls.Add(txtCalculate);
            TextBox txtAssessment = new TextBox();

            txtAssessment.Location    = new Point(246, tableLayoutPanel.Height + 125);
            txtAssessment.Width       = 195;
            txtAssessment.Height      = 21;
            txtAssessment.Text        = "审核者:";
            txtAssessment.BorderStyle = BorderStyle.None;
            pnlResult.Controls.Add(txtAssessment);
            TextBox txtDataEnd = new TextBox();

            txtDataEnd.Location    = new Point(442, tableLayoutPanel.Height + 125);
            txtDataEnd.Width       = 195;
            txtDataEnd.Height      = 21;
            txtDataEnd.Text        = "日期:" + DateTime.Now.ToString("yyyy-MM-dd");
            txtDataEnd.BorderStyle = BorderStyle.None;
            pnlResult.Controls.Add(txtDataEnd);
            Label lbl = new Label();

            lbl.Location = new Point(45, 171 + tableLayoutPanel.Height);

            //将控件添加到panel
            pnlResult.Controls.Add(txtTitle);
            pnlResult.Controls.Add(txtProjectName);
            pnlResult.Controls.Add(txtInstrument);
            pnlResult.Controls.Add(txtWeather);
            pnlResult.Controls.Add(txtObserver);
            pnlResult.Controls.Add(txtRecorder);
            pnlResult.Controls.Add(txtDate);
            pnlResult.Controls.Add(tableLayoutPanel);
            pnlResult.Controls.Add(lbl);
        }
Exemplo n.º 7
0
        internal static string ParameterAdjustment(List <string> col0, List <string> col1, List <string> col2, ref List <string> col4, ref List <string> col5, double[] accuracy, DataType.Data approximateDataType, DataType.LeftOrRight lorR, ref TableLayoutPanel tableLayoutPanel)
        {
            List <double> azimuth = new List <double>();

            for (int i = 0; i < col0.Count - 1; i++)
            {
                double deltaX = Convert.ToDouble(col1[i + 1]) - Convert.ToDouble(col1[i]);
                double deltaY = Convert.ToDouble(col2[i + 1]) - Convert.ToDouble(col2[i]);
                col4.Add(Math.Sqrt(Math.Abs(deltaX) * Math.Abs(deltaX) + Math.Abs(deltaY) * Math.Abs(deltaY)).ToString("#.000000"));
                TextBox txtSide = new TextBox();
                txtSide.Text        = col4[i];
                txtSide.Margin      = new Padding(0);
                txtSide.Width       = 60;
                txtSide.Height      = 21;
                txtSide.TextAlign   = HorizontalAlignment.Center;
                txtSide.BorderStyle = BorderStyle.None;
                tableLayoutPanel.Controls.Add(txtSide, 3, i + 2);
            }
            for (int i = 0; i < col0.Count - 1; i++)
            {
                double xf     = Convert.ToDouble(col1[i]);
                double xa     = Convert.ToDouble(col1[i + 1]);
                double yf     = Convert.ToDouble(col2[i]);
                double ya     = Convert.ToDouble(col2[i + 1]);
                double deltaX = Math.Round(xa - xf, 3);
                double deltaY = Math.Round(ya - yf, 3);
                double rian   = Math.Atan2(deltaY, deltaX);
                if (rian >= 0)
                {
                    azimuth.Add(rian);
                    col5.Add(ConvertAngle.DegreeToString(rian * 180 / Math.PI));
                }
                else
                {
                    azimuth.Add(2 * Math.PI + rian);
                    col5.Add(ConvertAngle.DegreeToString(360 + rian * 180 / Math.PI));
                }
                TextBox txtAngle = new TextBox();
                txtAngle.Text        = col5[i];
                txtAngle.Margin      = new Padding(0);
                txtAngle.Width       = 60;
                txtAngle.Height      = 21;
                txtAngle.TextAlign   = HorizontalAlignment.Center;
                txtAngle.BorderStyle = BorderStyle.None;
                tableLayoutPanel.Controls.Add(txtAngle, 4, i + 2);
            }
            string tempFile = Path.GetTempFileName();

            using (StreamWriter sw = new StreamWriter(tempFile))
            {
                sw.WriteLine("{0} {1} {2} {3} {4} {5}", col0.Count, 4, col0.Count - 2, (col0.Count - 2) * 2, col0.Count - 3, 1);
                sw.WriteLine("{0} {1} {2} {3}", accuracy[0], accuracy[1], accuracy[2], accuracy[3]);
                sw.WriteLine("{0} {1} {2}", col0[0], col1[0], col2[0]);
                sw.WriteLine("{0} {1} {2}", col0[1], col1[1], col2[1]);
                sw.WriteLine("{0} {1} {2}", col0[col0.Count - 2], accuracy[4], accuracy[5]);
                sw.WriteLine("{0} {1} {2}", col0[col0.Count - 1], col1[col1.Count - 1], col2[col2.Count - 1]);
                for (int i = 1; i < col0.Count - 1; i++)
                {
                    sw.WriteLine("{0} {1}", col0[i], 2);
                    sw.WriteLine("{0} {1}", col0[i - 1], 0);
                    sw.WriteLine("{0} {1}", col0[i + 1], Math.PI - azimuth[i - 1] + azimuth[i]);
                }
                for (int i = 1; i < col0.Count - 2; i++)
                {
                    sw.WriteLine("{0} {1} {2}", col0[i], col0[i + 1], col4[i]);
                }
                sw.WriteLine("{0} {1} {2}", col0[2], col0[3], azimuth[2]);
            }
            return(Adjustment.ParameterAdjustment.Calculate(tempFile));
        }
Exemplo n.º 8
0
 internal void OutputLevelAngle(string path, DataType.Data approximateDataType, int backCount, double angleCloseError, List <string> col0, List <string> col1, List <string> col2, List <string> col3, List <string> col4, List <string> col5, List <string> col6)
 {
     using (StreamWriter sw = new StreamWriter(path, true))
     {
         sw.WriteLine();
         sw.WriteLine("{0,38}", "水平角观测记录");
         sw.WriteLine("{0,-25}{1,-27}{2,-26}", "工程名称:", "仪器:", "天气:");
         sw.WriteLine("{0,-26}{1,-26}{2,-26}", "观测者:", "记录者:", "日期:" + DateTime.Now.ToString("yyyy-MM-dd"));
         sw.WriteLine("---------------------------------------------------------------------------|");
         sw.WriteLine("| 测站名 | 照准点 |  盘左读数  |  盘右读数  | 2C |    角值    |    方位角  |");
         if (approximateDataType == DataType.Data.ConnectingTraverse)
         {
             sw.WriteLine("|--------|--------|------------|------------|----|------------|------------|");
             for (int i = 0; i < backCount * 2; i++)
             {
                 if (i == 0)
                 {
                     sw.WriteLine("|{0,8}|{1,8}|{2,12}|{3,12}|{4,4}|{5,12}|{6,12}|", col0[i], col1[i], col2[i], col3[i], col4[i], col5[i], col6[i]);
                     continue;
                 }
                 if (i == backCount)
                 {
                     sw.WriteLine("|{0,8}|{1,8}|{2,12}|{3,12}|{4,4}|{5,12}|{6,12}|", " ", col1[i], col2[i], col3[i], " ", " ", col6[2]);
                     continue;
                 }
                 if (i % 2 == 0 && i != 0 && i != backCount)
                 {
                     sw.WriteLine("|{0,8}|{1,8}|{2,12}|{3,12}|{4,4}|{5,12}|{6,12}|", " ", col1[i], col2[i], col3[i], col4[i / 2], " ", " ");
                     continue;
                 }
                 sw.WriteLine("|{0,8}|{1,8}|{2,12}|{3,12}|{4,4}|{5,12}|{6,12}|", " ", col1[i], col2[i], col3[i], " ", " ", " ");
             }
             for (int i = 1; i < col2.Count / backCount / 2 - 1; i++)
             {
                 sw.WriteLine("|--------|--------|------------|------------|----|------------|------------|");
                 for (int j = 0; j < backCount * 2; j++)
                 {
                     if (j == 0)
                     {
                         sw.WriteLine("|{0,8}|{1,8}|{2,12}|{3,12}|{4,4}|{5,12}|{6,12}|", col0[i], col1[i * backCount * 2 + j], col2[i * backCount * 2 + j], col3[i * backCount * 2 + j], col4[(i * backCount * 2 + j) / 2], col5[i], col6[i + 2]);
                         continue;
                     }
                     if (j % 2 == 0 && i != 0)
                     {
                         sw.WriteLine("|{0,8}|{1,8}|{2,12}|{3,12}|{4,4}|{5,12}|{6,12}|", " ", col1[i * backCount * 2 + j], col2[i * backCount * 2 + j], col3[i * backCount * 2 + j], col4[(i * backCount * 2 + j) / 2], " ", " ");
                         continue;
                     }
                     sw.WriteLine("|{0,8}|{1,8}|{2,12}|{3,12}|{4,4}|{5,12}|{6,12}|", " ", col1[i * backCount * 2 + j], col2[i * backCount * 2 + j], col3[i * backCount * 2 + j], " ", " ", " ");
                 }
             }
             sw.WriteLine("|--------|--------|------------|------------|----|------------|------------|");
             for (int i = col2.Count - backCount * 2; i < col2.Count; i++)
             {
                 if (i == col2.Count - backCount * 2)
                 {
                     sw.WriteLine("|{0,8}|{1,8}|{2,12}|{3,12}|{4,4}|{5,12}|{6,12}|", col0[i / backCount / 2], col1[i], col2[i], col3[i], col4[i / 2], col5[i / backCount / 2], col6[1]);
                     continue;
                 }
                 if (i % 2 == 0 && i != col2.Count - backCount * 2)
                 {
                     sw.WriteLine("|{0,8}|{1,8}|{2,12}|{3,12}|{4,4}|{5,12}|{6,12}|", " ", col1[i], col2[i], col3[i], col4[i / 2], " ", " ");
                     continue;
                 }
                 sw.WriteLine("|{0,8}|{1,8}|{2,12}|{3,12}|{4,4}|{5,12}|{6,12}|", " ", col1[i], col2[i], col3[i], " ", " ", " ");
             }
             sw.WriteLine("|--------|-----------------------------------------------------------------|");
             sw.WriteLine("|  备注  |类型:闭附合路线   角度闭合差:f = {0,-32}|", angleCloseError);
             sw.WriteLine("---------------------------------------------------------------------------|");
         }
         else
         {
             //支导线
             sw.WriteLine("|--------|--------|------------|------------|----|------------|------------|");
             for (int i = 0; i < backCount * 2; i++)
             {
                 if (i == 0)
                 {
                     sw.WriteLine("|{0,8}|{1,8}|{2,12}|{3,12}|{4,4}|{5,12}|{6,12}|", col0[i], col1[i], col2[i], col3[i], col4[i], col5[i], col6[i]);
                     continue;
                 }
                 if (i == backCount)
                 {
                     sw.WriteLine("|{0,8}|{1,8}|{2,12}|{3,12}|{4,4}|{5,12}|{6,12}|", " ", col1[i], col2[i], col3[i], " ", " ", col6[1]);
                     continue;
                 }
                 if (i % 2 == 0 && i != 0 && i != backCount)
                 {
                     sw.WriteLine("|{0,8}|{1,8}|{2,12}|{3,12}|{4,4}|{5,12}|{6,12}|", " ", col1[i], col2[i], col3[i], col4[i / 2], " ", " ");
                     continue;
                 }
                 sw.WriteLine("|{0,8}|{1,8}|{2,12}|{3,12}|{4,4}|{5,12}|{6,12}|", " ", col1[i], col2[i], col3[i], " ", " ", " ");
             }
             for (int i = 1; i < col2.Count / backCount / 2; i++)
             {
                 sw.WriteLine("|--------|--------|------------|------------|----|------------|------------|");
                 for (int j = 0; j < backCount * 2; j++)
                 {
                     if (j == 0)
                     {
                         sw.WriteLine("|{0,8}|{1,8}|{2,12}|{3,12}|{4,4}|{5,12}|{6,12}|", col0[i], col1[i * backCount * 2 + j], col2[i * backCount * 2 + j], col3[i * backCount * 2 + j], col4[(i * backCount * 2 + j) / 2], col5[i], col6[i + 1]);
                         continue;
                     }
                     if (j % 2 == 0 && i != 0)
                     {
                         sw.WriteLine("|{0,8}|{1,8}|{2,12}|{3,12}|{4,4}|{5,12}|{6,12}|", " ", col1[i * backCount * 2 + j], col2[i * backCount * 2 + j], col3[i * backCount * 2 + j], col4[(i * backCount * 2 + j) / 2], " ", " ");
                         continue;
                     }
                     sw.WriteLine("|{0,8}|{1,8}|{2,12}|{3,12}|{4,4}|{5,12}|{6,12}|", " ", col1[i * backCount * 2 + j], col2[i * backCount * 2 + j], col3[i * backCount * 2 + j], " ", " ", " ");
                 }
             }
             sw.WriteLine("|--------|-----------------------------------------------------------------|");
             sw.WriteLine("|  备注  |类型:支导线路线                                                  |");
             sw.WriteLine("---------------------------------------------------------------------------|");
         }
         sw.WriteLine("{0,-26}{1,-26}{2,-26}", "计算者:", "审核者:", "日期:" + DateTime.Now.ToString("yyyy-MM-dd"));
     }
 }
Exemplo n.º 9
0
 internal void OutputTraverse(string path, DataType.Data approximateDataType, int backCount, double angleCloseError, double coordinateCloseError, double k, List <string> col0, List <string> col1, List <string> col2, List <string> col3, List <string> col4, List <string> col5, List <string> col6, List <string> col7, List <string> col8, List <string> col9, List <string> col10)
 {
     using (StreamWriter sw = new StreamWriter(path, true))
     {
         sw.WriteLine();
         sw.WriteLine("{0,42}", "导线观测记录");
         sw.WriteLine("{0,-27}{1,-29}{2,-28}", "工程名称:", "仪器:", "天气:");
         sw.WriteLine("{0,-28}{1,-28}{2,-28}", "观测者:", "记录者:", "日期:" + DateTime.Now.ToString("yyyy-MM-dd"));
         sw.WriteLine("----------------------------------------------------------------------------------------------------------------|");
         sw.WriteLine("|测站名 | 照准点 | 盘左读数  | 盘右读数  | 2C | 角值      | 方位角    | 平距 | 平均距离 | X         | Y         |");
         if (approximateDataType == DataType.Data.ConnectingTraverse)
         {
             sw.WriteLine("|-------|--------|-----------|-----------|----|-----------|-----------|------|----------|-----------|-----------|");
             for (int i = 0; i < backCount * 2; i++)
             {
                 if (i == 0)
                 {
                     sw.WriteLine("|{0,7}|{1,8}|{2,11}|{3,11}|{4,4}|{5,11}|{6,11}|{7,6}|{8,10}|{9,11}|{10,11}|", col0[i], col1[i], col2[i], col3[i], col4[i], col5[i], col6[i], col7[i], col8[i], col9[i], col10[i]);
                     continue;
                 }
                 if (i == backCount)
                 {
                     sw.WriteLine("|{0,7}|{1,8}|{2,11}|{3,11}|{4,4}|{5,11}|{6,11}|{7,6}|{8,10}|{9,11}|{10,11}|", " ", col1[i], col2[i], col3[i], " ", " ", col6[2], col7[i / 2], " ", " ", " ");
                     continue;
                 }
                 if (i % 2 == 0 && i != 0 && i != backCount)
                 {
                     sw.WriteLine("|{0,7}|{1,8}|{2,11}|{3,11}|{4,4}|{5,11}|{6,11}|{7,6}|{8,10}|{9,11}|{10,11}|", " ", col1[i], col2[i], col3[i], col4[i / 2], " ", " ", col7[i / 2], " ", " ", " ");
                     continue;
                 }
                 sw.WriteLine("|{0,7}|{1,8}|{2,11}|{3,11}|{4,4}|{5,11}|{6,11}|{7,6}|{8,10}|{9,11}|{10,11}|", " ", col1[i], col2[i], col3[i], " ", " ", " ", " ", " ", " ", " ");
             }
             for (int i = 1; i < col2.Count / backCount / 2 - 1; i++)
             {
                 sw.WriteLine("|-------|--------|-----------|-----------|----|-----------|-----------|------|----------|-----------|-----------|");
                 for (int j = 0; j < backCount * 2; j++)
                 {
                     if (j == 0)
                     {
                         sw.WriteLine("|{0,7}|{1,8}|{2,11}|{3,11}|{4,4}|{5,11}|{6,11}|{7,6}|{8,10}|{9,11}|{10,11}|", col0[i], col1[i * backCount * 2 + j], col2[i * backCount * 2 + j], col3[i * backCount * 2 + j], col4[(i * backCount * 2 + j) / 2], col5[i], col6[i + 2], col7[(i * backCount * 2 + j) / 2], col8[i], col9[i + 1], col10[i + 1]);
                         continue;
                     }
                     if (j % 2 == 0 && i != 0)
                     {
                         sw.WriteLine("|{0,7}|{1,8}|{2,11}|{3,11}|{4,4}|{5,11}|{6,11}|{7,6}|{8,10}|{9,11}|{10,11}|", " ", col1[i * backCount * 2 + j], col2[i * backCount * 2 + j], col3[i * backCount * 2 + j], col4[(i * backCount * 2 + j) / 2], " ", " ", col7[(i * backCount * 2 + j) / 2], " ", " ", " ");
                         continue;
                     }
                     sw.WriteLine("|{0,7}|{1,8}|{2,11}|{3,11}|{4,4}|{5,11}|{6,11}|{7,6}|{8,10}|{9,11}|{10,11}|", " ", col1[i * backCount * 2 + j], col2[i * backCount * 2 + j], col3[i * backCount * 2 + j], " ", " ", " ", " ", " ", " ", " ");
                 }
             }
             sw.WriteLine("|-------|--------|-----------|-----------|----|-----------|-----------|------|----------|-----------|-----------|");
             for (int i = col2.Count - backCount * 2; i < col2.Count; i++)
             {
                 if (i == col2.Count - backCount * 2)
                 {
                     sw.WriteLine("|{0,7}|{1,8}|{2,11}|{3,11}|{4,4}|{5,11}|{6,11}|{7,6}|{8,10}|{9,11}|{10,11}|", col0[i / backCount / 2], col1[i], col2[i], col3[i], col4[i / 2], col5[i / backCount / 2], col6[1], col7[i / 2], col8[i / backCount / 2], col9[1], col10[1]);
                     continue;
                 }
                 if (i % 2 == 0 && i != col2.Count - backCount * 2)
                 {
                     sw.WriteLine("|{0,7}|{1,8}|{2,11}|{3,11}|{4,4}|{5,11}|{6,11}|{7,6}|{8,10}|{9,11}|{10,11}|", " ", col1[i], col2[i], col3[i], col4[i / 2], " ", " ", col7[i / 2], " ", " ", " ");
                     continue;
                 }
                 sw.WriteLine("|{0,7}|{1,8}|{2,11}|{3,11}|{4,4}|{5,11}|{6,11}|{7,6}|{8,10}|{9,11}|{10,11}|", " ", col1[i], col2[i], col3[i], " ", " ", " ", " ", " ", " ", " ");
             }
             sw.WriteLine("|-------|-------------------------------------------------------------------------------------------------------|");
             sw.WriteLine("| 备注  |类型:闭附和路线  角度闭合差:{0,-14} 坐标增量闭合差:±{1,-17} K ≈ {2,-20}|", angleCloseError, coordinateCloseError, "1/" + k);
             sw.WriteLine("----------------------------------------------------------------------------------------------------------------|");
         }
         else if (approximateDataType == DataType.Data.OpenTraverse)
         {
             //支导线
             sw.WriteLine("|-------|--------|-----------|-----------|----|-----------|-----------|------|----------|-----------|-----------|");
             for (int i = 0; i < backCount * 2; i++)
             {
                 if (i == 0)
                 {
                     sw.WriteLine("|{0,7}|{1,8}|{2,11}|{3,11}|{4,4}|{5,11}|{6,11}|{7,6}|{8,10}|{9,11}|{10,11}|", col0[i], col1[i], col2[i], col3[i], col4[i], col5[i], col6[i], col7[i], col8[i], col9[i], col10[i]);
                     continue;
                 }
                 if (i == backCount)
                 {
                     sw.WriteLine("|{0,7}|{1,8}|{2,11}|{3,11}|{4,4}|{5,11}|{6,11}|{7,6}|{8,10}|{9,11}|{10,11}|", " ", col1[i], col2[i], col3[i], " ", " ", col6[1], col7[i / 2], " ", " ", " ");
                     continue;
                 }
                 if (i % 2 == 0 && i != 0 && i != backCount)
                 {
                     sw.WriteLine("|{0,7}|{1,8}|{2,11}|{3,11}|{4,4}|{5,11}|{6,11}|{7,6}|{8,10}|{9,11}|{10,11}|", " ", col1[i], col2[i], col3[i], col4[i / 2], " ", " ", col7[i / 2], " ", " ", " ");
                     continue;
                 }
                 sw.WriteLine("|{0,7}|{1,8}|{2,11}|{3,11}|{4,4}|{5,11}|{6,11}|{7,6}|{8,10}|{9,11}|{10,11}|", " ", col1[i], col2[i], col3[i], " ", " ", " ", " ", " ", " ", " ");
             }
             for (int i = 1; i < col2.Count / backCount / 2; i++)
             {
                 sw.WriteLine("|-------|--------|-----------|-----------|----|-----------|-----------|------|----------|-----------|-----------|");
                 for (int j = 0; j < backCount * 2; j++)
                 {
                     if (j == 0)
                     {
                         sw.WriteLine("|{0,7}|{1,8}|{2,11}|{3,11}|{4,4}|{5,11}|{6,11}|{7,6}|{8,10}|{9,11}|{10,11}|", col0[i], col1[i * backCount * 2 + j], col2[i * backCount * 2 + j], col3[i * backCount * 2 + j], col4[(i * backCount * 2 + j) / 2], col5[i], col6[i + 1], col7[(i * backCount * 2 + j) / 2], col8[i], col9[i], col10[i]);
                         continue;
                     }
                     if (j % 2 == 0 && i != 0)
                     {
                         sw.WriteLine("|{0,7}|{1,8}|{2,11}|{3,11}|{4,4}|{5,11}|{6,11}|{7,6}|{8,10}|{9,11}|{10,11}|", " ", col1[i * backCount * 2 + j], col2[i * backCount * 2 + j], col3[i * backCount * 2 + j], col4[(i * backCount * 2 + j) / 2], " ", " ", col7[(i * backCount * 2 + j) / 2], " ", " ", " ");
                         continue;
                     }
                     sw.WriteLine("|{0,7}|{1,8}|{2,11}|{3,11}|{4,4}|{5,11}|{6,11}|{7,6}|{8,10}|{9,11}|{10,11}|", " ", col1[i * backCount * 2 + j], col2[i * backCount * 2 + j], col3[i * backCount * 2 + j], " ", " ", " ", " ", " ", " ", " ");
                 }
             }
             sw.WriteLine("|-------|-------------------------------------------------------------------------------------------------------|");
             sw.WriteLine("| 备注  |类型:支导线路线                                                                                        |");
             sw.WriteLine("----------------------------------------------------------------------------------------------------------------|");
         }
         sw.WriteLine("{0,-28}{1,-28}{2,-28}", "计算者:", "审核者:", "日期:" + DateTime.Now.ToString("yyyy-MM-dd"));
     }
 }