Пример #1
0
        public ExistingShapefile2_well(string shapefileName, string featuretype, IApplication m_application)
        {
            InitializeComponent();

            m_app = m_application;
            IMap      map      = ArcTimUtilities.GetMap(m_application);
            ShapeFile shp      = new ShapeFile(ArcTimData.StaticClass.infoTable.Rows[0]["ShapefilePath"].ToString() + "\\" + shapefileName + ".shp");
            DataTable attTable = shp.AttributeTable;
            int       numCol   = attTable.Columns.Count;

            for (int i = 0; i < numCol; i++)
            {
                this.comboBox_Flow.Items.Add(attTable.Columns[i].ColumnName);
                this.comboBox_Radius.Items.Add(attTable.Columns[i].ColumnName);
                this.comboBox_Name.Items.Add(attTable.Columns[i].ColumnName);
            }
            shpFileName = shapefileName;
        }
Пример #2
0
        public void loadCBox(IApplication m_app)
        {
            ILayer pLyr;
            IMap   map = ArcTimUtilities.GetMap(m_app);

            if (map != null)
            {
                int iLyrCount = map.LayerCount;
                for (int i = 0; i < iLyrCount; i++)
                {
                    pLyr = map.get_Layer(i);
                    if (pLyr is IFeatureLayer)
                    {
                        this.comboBox_esf.Items.Add(pLyr.Name);
                    }
                }
            }
        }
Пример #3
0
        private void button_outputOK_Click(object sender, EventArgs e)
        {
            IMap        map        = ArcTimUtilities.GetMap(m_application);
            IActiveView ia         = m_hookHelper2.ActiveView;
            DataSet     oD         = new DataSet("OutputData");
            DataTable   outputData = new DataTable("Output");
            double      xmax       = 0;
            double      xmin       = 0;
            double      ymax       = 0;
            double      ymin       = 0;
            double      nx         = Convert.ToDouble(textBox_xCells.Text);
            double      ny         = Convert.ToDouble(textBox_yCells.Text);

            outputData.Columns.Add("MinExtents");
            outputData.Columns.Add("MaxExtents");
            outputData.Columns.Add("NumCells");
            double resx = 0;

            // getextentsData
            if (radioButton_currentExtents.Checked == true)
            {
                xmax = ia.Extent.XMax;
                xmin = ia.Extent.XMin;
                ymax = ia.Extent.YMax;
                ymin = ia.Extent.YMin;
            }
            else if (radioButton_defineExtents.Checked == true)
            {
                xmax = Convert.ToDouble(textBox_xMax.Text);
                xmin = Convert.ToDouble(textBox_xMin.Text);
                ymax = Convert.ToDouble(textBox_yMax.Text);
                ymin = Convert.ToDouble(textBox_yMin.Text);
            }
            //getResolutionData
            if (radioButton_res.Checked == true)
            {
                if (radioButton_low.Checked == true)
                {
                    resx = 0.01;
                }
                if (radioButton_med.Checked == true)
                {
                    resx = 0.008;
                }
                if (radioButton_high.Checked == true)
                {
                    resx = 0.004;
                }
                double xtemp = 0;
                double ytemp = 0;
                double delx  = 0;
                double dely  = 0;


                delx = xmax - xmin;
                //dely = ymax - ymin;

                xtemp = delx * resx;
                //ytemp = dely * resx;

                //ny = Convert.ToInt64(dely / ytemp);
                nx = Convert.ToInt64(delx / xtemp);

                //if (dely % ytemp != 0)
                //{
                //    ny = Convert.ToInt64(dely / ytemp) + 1;
                //    dely = ny * ytemp;
                //}
                if (delx % xtemp != 0)
                {
                    nx   = Convert.ToInt64(delx / xtemp) + 1;
                    delx = nx * xtemp;
                    ny   = Convert.ToInt64(delx / xtemp) + 1;
                    dely = nx * xtemp;
                }
                //if (delx < dely)
                //{
                xmax = nx * xtemp + xmin;
                ymax = nx * xtemp + ymin;
                //}
                //if (dely < delx)
                //{
                //    xmax = nx * xtemp + xmin;
                //    ymax = ny * xtemp + ymin;
                //}
            }
            DataRow rx = outputData.NewRow();
            DataRow ry = outputData.NewRow();

            rx[0] = xmin;
            ry[0] = ymin;
            rx[1] = xmax;
            ry[1] = ymax;
            rx[2] = nx;
            ry[2] = ny;
            outputData.Rows.Add(rx);
            outputData.Rows.Add(ry);
            oD.Tables.Add(outputData);
            oD.WriteXml(ArcTimData.StaticClass.infoTable.Rows[0]["ModelPath"] + "\\outputSettings.xml");
            this.Hide();
        }