Newer
Older
EMS_REFACTOR / FrmRedlineResult.cs
nn-203 on 26 Jul 2017 3 KB first commit
using System;
using System.Collections;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using GeoScene.Globe;

namespace Cyberpipe
{
    public partial class FrmRedlineResult : Office2007Form
    {
        GSOGlobeControl globeControl1;
        ArrayList rr = new ArrayList(); 
        int idx; 
        GSOLayer layerTemp;

        MainFrm mfrm;

        public FrmRedlineResult(ArrayList _rr, GSOGlobeControl _globeControl1)
        {
            globeControl1 = _globeControl1;
            rr = _rr; 
            InitializeComponent();

        }
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FrmRedlineResult_Load(object sender, EventArgs e)
        {
            mfrm = (MainFrm)Owner;
            layerTemp = globeControl1.Globe.Layers.Add(Application.StartupPath + "\\tempLgdData.lgd");
         
            //加载问题红线
            for (int i = 0; i < rr.Count; i++) {
                RedlineResult redlineresult = (RedlineResult)rr[i]; 
                idx = dataGridView1.Rows.Add();
                 
                dataGridView1.Rows[idx].Cells["Column1"].Value = redlineresult.layertype;
                dataGridView1.Rows[idx].Cells["Column4"].Value = redlineresult.maxdis;
                dataGridView1.Rows[idx].Cells["Column8"].Value = redlineresult.mindis;
                dataGridView1.Rows[idx].Cells["Column9"].Value = redlineresult.distance;
                dataGridView1.Rows[idx].Cells["Column10"].Value = redlineresult.area;
                  
            } 
        }

      
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            //string pipeid = ""; string layername = "";
            //GSOPoint3d locationpt = new GSOPoint3d();

            //if (dataGridView1.SelectedCells.Count > 0)
            //{
            //    DataGridViewRow row = dataGridView1.Rows[dataGridView1.SelectedCells[0].RowIndex];
            //    layername = row.Cells["Column1"].Value.ToString();
            //    pipeid = row.Cells["Column2"].Value.ToString();
            //    locationpt.X = Double.Parse(row.Cells["Column5"].Value.ToString());
            //    locationpt.Y=Double.Parse(row.Cells["Column6"].Value.ToString());
            //    locationpt.Z = Double.Parse(row.Cells["Column7"].Value.ToString());
            //}
            //GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(layername);
            //GSOFeatures feats=layer.GetAllFeatures();
            //for (int i = 0; i < feats.Length; i++) { 
            //    GSOFeature feat = feats[i];
            //    if (feat.Name == pipeid)
            //    {
            //        //globeControl1.Globe.JumpToFeature(feat, 30);
            //        globeControl1.Globe.JumpToPosition(locationpt,EnumAltitudeMode.RelativeToGround,10);
            //    }
            //    else {
            //        continue;
            //    }
            //}


        }
         
        private void FrmRedlineResult_FormClosing(object sender, FormClosingEventArgs e)
        {
            mfrm.frmRedlineResult = false;
            Hide();
        }

        private void FrmRedlineResult_FormClosed(object sender, FormClosedEventArgs e)
        {
            mfrm.frmRedlineResult = false;
            Hide();

        }


    }
}