Example #1
0
 private void button_ok_Click(object sender, EventArgs e)
 {
     ArcTimData.StaticClass.aqPropTable           = getDataFromDataGridView(this.dataGridView_aqData);
     ArcTimData.StaticClass.aqPropTable.TableName = "AquiferPropertyTable";
     getDataFromShp();
     updateInfoTable();
     getOutputSettings();
     ArcTimData.writexmlFile();
     this.Hide();
 }
Example #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            string xmlFile = this.textBox1.Text;

            ArcTimData.readXMLFile(xmlFile);
            ModelSettingsForm msf = new ModelSettingsForm(m_application, false, m_hookHelper2);

            this.Hide();
            msf.Show();
        }
        public ExistingShapefile2_constant(string shapefileName, string featuretype, IApplication m_application)
        {
            InitializeComponent();
            m_app = m_application;
            IMap      map      = ArcTimData.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.comboBox1.Items.Add(attTable.Columns[i].ColumnName);
            }

            shpFileName = shapefileName;
        }
Example #4
0
        /// <summary>
        /// Occurs when this command is clicked
        /// </summary>
        public override void OnClick()
        {
            SaveFileDialog saveFileDialog1 = new SaveFileDialog();

            saveFileDialog1.Filter = "XML file|*.xml";
            saveFileDialog1.Title  = "Save model file";
            saveFileDialog1.ShowDialog();

            if (saveFileDialog1.FileName != "")
            {
                ArcTimData.StaticClass.infoTable.Rows[0]["ShapefilePath"] = Path.GetDirectoryName(saveFileDialog1.FileName);
                ArcTimData.StaticClass.infoTable.Rows[0]["ModelName"]     = Path.GetFileNameWithoutExtension(saveFileDialog1.FileName);
                //ArcTim5PropertiesMenu.StaticClass.modelXMLfilename = saveFileDialog1.FileName;
                //ModelSettingsWindow ms = new ModelSettingsWindow(m_application, true);
                //ms.saveModelFile();
                ArcTimData.writexmlFile();
                //ArcTim5PropertiesMenu.StaticClass.infoTable.WriteXml(ArcTim5PropertiesMenu.StaticClass.pathName + "//" + ArcTim5PropertiesMenu.StaticClass.modelname + ".xml");
                //ArcTim5PropertiesMenu.StaticClass.shapeFileTable.WriteXml(ArcTim5PropertiesMenu.StaticClass.pathName + "//" + ArcTim5PropertiesMenu.StaticClass.modelname + "_aq.xml");
                //ArcTim5PropertiesMenu.StaticClass.aquiferTable.WriteXml(ArcTim5PropertiesMenu.StaticClass.pathName + "//" + ArcTim5PropertiesMenu.StaticClass.modelname + "_shp.xml");
            }
        }
Example #5
0
        public void loadCBox(IApplication m_app)
        {
            ILayer pLyr;
            IMap   map = ArcTimData.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_SF1.Items.Add(pLyr.Name);
                        this.comboBox_SF2.Items.Add(pLyr.Name);
                        this.comboBox_SF3.Items.Add(pLyr.Name);
                        this.comboBox_SF4.Items.Add(pLyr.Name);
                        this.comboBox_SF5.Items.Add(pLyr.Name);
                        this.comboBox_SF6.Items.Add(pLyr.Name);
                    }
                }
            }
        }
Example #6
0
        public void getOutputSettings()
        {
            DataTable dt = new DataTable();
            double    xmax = 0, xmin = 0, ymax = 0, ymin = 0;
            double    nx = Convert.ToDouble(textBox_xCells.Text), ny = Convert.ToDouble(textBox_yCells.Text);
            double    dx = Convert.ToDouble(textBox_cellsize.Text);

            dt.Columns.Add("MinExtents");
            dt.Columns.Add("MaxExtents");
            dt.Columns.Add("NumCells");
            dt.Columns.Add("Delta");
            IMap        map = ArcTimData.GetMap(m_application);
            IActiveView ia  = m_hookHelper2.ActiveView;

            //get extents data
            if (radioButton_useCurrentExtents.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);
            }

            //get res data
            if (radioButton_res.Checked == true)
            {
                if (radioButton_reslow.Checked == true)
                {
                    dx = 0.01;
                }
                if (radioButton_resmed.Checked == true)
                {
                    dx = 0.008;
                }
                if (radioButton_reshigh.Checked == true)
                {
                    dx = 0.004;
                }
                double xtemp = 0, ytemp = 0, tempnx = 0, tempny = 0;
                tempnx = Math.Truncate((xmax - xmin) * dx);
                tempny = Math.Truncate((ymax - ymin) * dx);
                //xtemp = delx*resx;
                //nx = Math.Truncate(delx/xtemp);
                //if(delx%xtemp!=0)
                //{
                //    nx = Math.Truncate(delx/xtemp)+1;
                //    delx = nx*xtemp;
                //    ny = Math.Truncate(delx/xtemp)+1;
                //    dely = nx*xtemp;
                //}
                //xmax = nx*xtemp+xmin;
                //ymax = nx*xtemp+ymin;
                dx = (xmax - xmin) / tempnx;
                nx = tempnx;
                ny = tempny;
            }
            DataRow rx = dt.NewRow();
            DataRow ry = dt.NewRow();

            rx[0] = xmin;
            ry[0] = ymin;
            rx[1] = xmax;
            ry[1] = ymax;
            rx[2] = nx;
            ry[2] = ny;
            rx[3] = dx;
            ry[3] = dx;
            dt.Rows.Add(rx);
            dt.Rows.Add(ry);
            ArcTimData.StaticClass.outputPropTable           = dt;
            ArcTimData.StaticClass.outputPropTable.TableName = "OutputSettings";
        }