Пример #1
0
        private void 批量转换为高斯投影坐标ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int izCount = listView1.Items.Count;

            listView2.Items.Clear();
            for (int i = 0; i < izCount; i++)
            {
                string       strName = listView1.Items[i].SubItems[1].Text;
                string       strL    = listView1.Items[i].SubItems[2].Text;
                string       strB    = listView1.Items[i].SubItems[3].Text;
                string       strL0   = listView1.Items[i].SubItems[5].Text;
                double       L       = double.Parse(strL);
                double       B       = double.Parse(strB);
                double       L0      = double.Parse(strL0);
                AngleConvert aL      = null;
                aL       = new DmsToRad();
                aL.Angle = L;
                L        = aL.GetAngle;
                AngleConvert aB = null;
                aB       = new DmsToRad();
                aB.Angle = B;
                B        = aB.GetAngle;
                AngleConvert aL0 = null;
                aL0       = new DmsToRad();
                aL0.Angle = L0;
                L0        = aL0.GetAngle;
                double a  = double.Parse(textBox11.Text);
                double b  = double.Parse(textBox10.Text);
                double e1 = double.Parse(textBox9.Text);
                double e2 = double.Parse(textBox8.Text);
                Gauss  A  = new Gauss(a, b, e1, e2);
                A.GetGauss(B, L, L0);
                ListViewItem lvi = new ListViewItem();
                lvi.Text = (i + 1).ToString();
                lvi.SubItems.Add(strName);
                lvi.SubItems.Add(A.x.ToString());
                lvi.SubItems.Add(A.y.ToString());
                this.listView2.Items.Add(lvi);
            }
        }
Пример #2
0
        public AngleContext(int iselect)
        {
            bok = true;
            switch (iselect)
            {
            case 0:
            {
                ac = new DecToDms();
                break;
            }

            case 1:
            {
                ac = new DmsToDec();
                break;
            }

            case 2:
            {
                ac = new RadToDec();
                break;
            }

            case 3:
            {
                ac = new DecToRad();
                break;
            }

            default:
            {
                bok = false;
                break;
            }
            }
        }
Пример #3
0
        private void 度带转6度带ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int izCount = listView3.Items.Count;

            listView1.Items.Clear();
            for (int i = 0; i < izCount; i++)
            {
                string       strName = listView3.Items[i].SubItems[1].Text;
                string       strX    = listView3.Items[i].SubItems[2].Text;
                string       strY    = listView3.Items[i].SubItems[3].Text;
                string       strL0   = listView3.Items[i].SubItems[4].Text;
                double       X       = double.Parse(strX);
                double       Y       = double.Parse(strY);
                double       L0      = double.Parse(strL0);
                AngleConvert aL0     = null;
                aL0       = new DmsToRad();
                aL0.Angle = L0;
                L0        = aL0.GetAngle;
                double a  = double.Parse(textBox11.Text);
                double b  = double.Parse(textBox10.Text);
                double e1 = double.Parse(textBox9.Text);
                double e2 = double.Parse(textBox8.Text);
                Gauss  A  = new Gauss(a, b, e1, e2);
                A.GetGPS(X, Y, L0);
                AngleConvert aL = null;
                aL       = new RadToDms();
                aL.Angle = A.L;
                A.L      = aL.GetAngle;
                AngleConvert aB = null;
                aB       = new RadToDms();
                aB.Angle = A.B;
                A.B      = aB.GetAngle;
                ListViewItem lvi = new ListViewItem();
                lvi.Text = (i + 1).ToString();
                lvi.SubItems.Add(strName);
                lvi.SubItems.Add(A.L.ToString());
                lvi.SubItems.Add(A.B.ToString());
                this.listView2.Items.Add(lvi);
            }
            int izCount1 = listView2.Items.Count;

            for (int q = 0; q < izCount1; q++)
            {
                string       strName1 = listView2.Items[q].SubItems[1].Text;
                string       strL     = listView2.Items[q].SubItems[2].Text;
                string       strB     = listView2.Items[q].SubItems[3].Text;
                string       strL2    = listView3.Items[q].SubItems[4].Text;
                double       L        = double.Parse(strL);
                double       B        = double.Parse(strB);
                double       L2       = double.Parse(strL2);
                AngleConvert aL1      = null;
                aL1       = new DmsToRad();
                aL1.Angle = L;
                L         = aL1.GetAngle;
                AngleConvert aB1 = null;
                aB1       = new DmsToRad();
                aB1.Angle = B;
                B         = aB1.GetAngle;
                AngleConvert aL2 = null;
                aL2       = new DmsToRad();
                aL2.Angle = L2;
                L2        = aL2.GetAngle;
                double a1  = double.Parse(textBox11.Text);
                double b1  = double.Parse(textBox10.Text);
                double e11 = double.Parse(textBox9.Text);
                double e21 = double.Parse(textBox8.Text);
                Gauss  A1  = new Gauss(a1, b1, e11, e21);
                A1.GetGauss(B, L, L2);
                ListViewItem lvi1 = new ListViewItem();
                lvi1.Text = (q + 1).ToString();
                lvi1.SubItems.Add(strName1);
                lvi1.SubItems.Add(A1.x.ToString());
                lvi1.SubItems.Add(A1.y.ToString());
                this.listView4.Items.Add(lvi1);
            }
            listView2.Items.Clear();
        }
Пример #4
0
 public AngleContext(AngleConvert ac)
 {
     this.ac = ac;
     bok     = true;
 }