Ejemplo n.º 1
0
        private void PingMianToDaDiM(int inRecCount)
        {
            try
            {

                DaDiPingMianTransferParameter paramter = new DaDiPingMianTransferParameter();
                paramter.TuoQiuJiChu = this.cbSource.SelectedItem as TuoQiuJiChu;
                for (int i = 0; i < inRecCount; i++)
                {
                    paramter.X = double.Parse(this.dataGridView1.Rows[i].Cells[1].Value.ToString().Trim());
                    paramter.Y = double.Parse(this.dataGridView1.Rows[i].Cells[2].Value.ToString().Trim());

                    //���Zֵδ����
                    if (this.dataGridView1.Rows[i].Cells[3].Value == null)
                    {
                        paramter.Z = 0;
                    }
                    else
                    {
                        paramter.Z = double.Parse(this.dataGridView1.Rows[i].Cells[3].Value.ToString().Trim());
                    }

                    if (this.m_Central_Meridian == -1)
                    {
                        MessageBox.Show("����������������");
                        return;
                    }

                    paramter.Central_Meridian = this.m_Central_Meridian;

                    DaDiPingMianTransfer transfer = new DaDiPingMianTransfer(paramter);
                    transfer.PingMianToDaDi();

                    int index = this.dataGridView2.Rows.Add();
                    DataGridViewRow row = this.dataGridView2.Rows[index] as DataGridViewRow;

                    this.dataGridView2.Rows[i].Cells[0].Value = this.dataGridView1.Rows[i].Cells[0].Value;
                    this.dataGridView2.Rows[i].Cells[1].Value = transfer.Paramters.B.ToString();
                    this.dataGridView2.Rows[i].Cells[2].Value = transfer.Paramters.L.ToString();
                    this.dataGridView2.Rows[i].Cells[3].Value = transfer.Paramters.Z.ToString();
                }
            }
            catch (Exception exx)
            {
                MessageBox.Show(exx.Message);
            }
        }
Ejemplo n.º 2
0
 public DaDiPingMianTransfer(DaDiPingMianTransferParameter paramter)
 {
     this.m_paramter = paramter;
 }
Ejemplo n.º 3
0
        private void DaDiToPingMianM(int inRecCount)
        {
            try
            {
                DaDiPingMianTransferParameter paramter = new DaDiPingMianTransferParameter();
                paramter.TuoQiuJiChu = this.cbSource.SelectedItem as TuoQiuJiChu;

                for (int i = 0; i < inRecCount; i++)
                {
                    paramter.B = double.Parse(this.dataGridView1.Rows[i].Cells[1].Value.ToString().Trim());
                    paramter.L = double.Parse(this.dataGridView1.Rows[i].Cells[2].Value.ToString().Trim());
                    paramter.H = double.Parse(this.dataGridView1.Rows[i].Cells[3].Value.ToString().Trim());

                    if (this.m_Central_Meridian == -1)
                    {
                        MessageBox.Show("����������������!");
                        return;
                    }

                    paramter.Central_Meridian = this.m_Central_Meridian;

                    DaDiPingMianTransfer transfer = new DaDiPingMianTransfer(paramter);
                    transfer.DaDiToPingMian();

                    int index = this.dataGridView2.Rows.Add();
                    DataGridViewRow row = this.dataGridView2.Rows[index] as DataGridViewRow;

                    this.dataGridView2.Rows[i].Cells[0].Value = this.dataGridView1.Rows[i].Cells[0].Value;
                    this.dataGridView2.Rows[i].Cells[1].Value = transfer.Paramters.X.ToString();
                    this.dataGridView2.Rows[i].Cells[2].Value = transfer.Paramters.Y.ToString();
                    this.dataGridView2.Rows[i].Cells[3].Value = transfer.Paramters.H.ToString();
                }
            }
            catch (Exception exx)
            {
                MessageBox.Show(exx.Message);
            }
        }