コード例 #1
0
        /// <summary>
        /// Update the observed status when the data is loaded or deleted.
        /// </summary>
        /// <param name="unitType"></param>
        /// <param name="id"></param>
        public void updateObservedStatus(ArcSWAT.SWATUnitType unitType, int id)
        {
            FeatureType feaType = FeatureType.Line;

            if (unitType == ArcSWAT.SWATUnitType.RES)
            {
                feaType = FeatureType.Point;
            }

            foreach (IFeatureLayer layer in Layers)
            {
                if (layer.DataSet.FeatureType == feaType)
                {
                    DataRow[] rows = layer.DataSet.DataTable.Select(string.Format("{0}={1}", ID_COLUMN_NAME, id));
                    if (rows == null || rows.Length == 0)
                    {
                        continue;
                    }

                    DataRow r = rows[0];
                    if (_project.Observation(Interval).getObservedData(unitType, id).Count > 0)
                    {
                        r[OBSERVED_COLUMN] = 1;
                    }
                    else
                    {
                        r[OBSERVED_COLUMN] = 0;
                    }

                    //re-draw all feature using defined categories
                    layer.ApplyScheme(layer.Symbology);
                }
            }
        }
コード例 #2
0
ファイル: ProjectView.cs プロジェクト: gudaleon/swat-eclipse
        private void updateTableAndChart()
        {
            tableView1.DataTable             = null;
            outputDisplayChart1.ObservedData = null;
            yearCtrl1.ObservedData           = null;
            _observedData = null;
            _statistics   = "";

            if (_col != null && _id > 0)
            {
                _observedData = _prj.Observation(_interval).getObservedData(_unitType, _id, _col);
                if (_observedData != null)
                {
                    //show the data
                    ArcSWAT.SWATUnitColumnYearObservationData observedData = _observedData.getObservedData(_year);
                    tableView1.ObservedData          = observedData;
                    outputDisplayChart1.ObservedData = observedData;
                    yearCtrl1.ObservedData           = _observedData.getObservedData(-1);

                    if (onDataStatisticsChanged != null)
                    {
                        _statistics = observedData.Statistics.ToString();
                        onDataStatisticsChanged(this, new EventArgs());
                    }
                }
            }
        }