Exemplo n.º 1
0
        string result = "";//生成结果报告

        /// <summary>
        /// 环闭合差和附和路线闭合差计算方法。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void 闭合差计算ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (CLevelingAdjust.levelingPoints.Count == 0 || CLevelingAdjust.levelingLines.Count == 0)
            {
                MessageBox.Show("请先导入或输入数据再进行闭合差计算!");
                return;
            }
            else
            {
                CLevelingAdjust.m_Pnumber = CLevelingAdjust.levelingPoints.Count;
                CLevelingAdjust.m_Lnumber = CLevelingAdjust.levelingLines.Count;
                //统计该网中已知点的数量。
                for (int i = 0; i < CLevelingAdjust.levelingPoints.Count; i++)
                {
                    if (CLevelingAdjust.levelingPoints[i].PointNature == PointNature.known)
                    {
                        CLevelingAdjust.m_kownPnumber++;
                    }
                }
                CLevelingAdjust.strLoopClosure.Clear(); //调用环闭合差计算方法和附和路线闭合差计算方法之前应清空该值。
                CLevelingAdjust.LoopClosure();          //调用环闭合差计算方法。
                CLevelingAdjust.LineClosure();          //调用附和路线闭合差计算方法。
            }

            string[] jieguo = CLevelingAdjust.strLoopClosure.ToArray();
            result = string.Join("", jieguo);
            // textBox1.Text = result;
            rtxtReport.Text = result;
            近似高程计算ToolStripMenuItem.Enabled = true;
            tabControl1.SelectedIndex       = 2;
        }
Exemplo n.º 2
0
        private void 近似高程计算ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (CLevelingAdjust.levelingPoints.Count == 0 || CLevelingAdjust.levelingLines.Count == 0)
            {
                MessageBox.Show("请先导入或输入数据再进行近似高程计算!");
                return;
            }
            CLevelingAdjust.Cal_H0();//调用高程近似值计算方法。
            //初始化表格
            dtPoint = new DataTable();
            dtPoint.Columns.Add("点名");
            dtPoint.Columns.Add("属性");
            dtPoint.Columns.Add("高程(m)");
            dgvCtrolPointsInfo.DataSource = dtPoint;
            //.更新表格数据
            for (int i = 0; i < CLevelingAdjust.levelingPoints.Count; i++)
            {
                DataRow row = dtPoint.NewRow();
                row["点名"] = CLevelingAdjust.levelingPoints[i].StrLevelingPointName;

                if (CLevelingAdjust.levelingPoints[i].PointNature == PointNature.known)
                {
                    row["属性"] = "01";
                }
                if (CLevelingAdjust.levelingPoints[i].PointNature == PointNature.unknow)
                {
                    row["属性"] = "00";
                }
                row["高程(m)"] = Math.Round(CLevelingAdjust.levelingPoints[i].LevelingHeight, 3);
                dtPoint.Rows.Add(row);
            }
            tabControl1.SelectedIndex = 0;
        }