Exemplo n.º 1
0
        private void getBasicInformation()
        {
            DataTable dt = Extract("select * from ave_annual_basin");

            if (dt.Rows.Count == 0)
            {
                return;
            }

            foreach (DataRow r in dt.Rows)
            {
                RowItem item = new RowItem(r);
                string  name = item.getColumnValue_String("NAME");
                if (name.Equals("START_YEAR_OUTPUT"))
                {
                    _startYear = item.getColumnValue_Int("VALUE");
                }
                else if (name.Equals("END_YEAR"))
                {
                    _endYear = item.getColumnValue_Int("VALUE");
                }
                else if (name.Equals("OUTPUT_INTERVAL"))
                {
                    _interval = (SWATResultIntervalType)(item.getColumnValue_Int("VALUE"));
                }
            }
        }
Exemplo n.º 2
0
        private void calculateDate(DataRow r)
        {
            DateTime d     = DateTime.Now;
            RowItem  item  = new RowItem(r);
            int      year  = item.getColumnValue_Int(COLUMN_NAME_YEAR);
            int      month = 1;
            int      day   = 1;

            if (Interval == SWATResultIntervalType.MONTHLY || Interval == SWATResultIntervalType.DAILY)
            {
                month = item.getColumnValue_Int(COLUMN_NAME_MONTH);
            }
            if (Interval == SWATResultIntervalType.DAILY)
            {
                day = item.getColumnValue_Int(COLUMN_NAME_DAY);
            }

            r["TIME"] = new DateTime(year, month, day);
        }
Exemplo n.º 3
0
        private void getBasicInformation()
        {
            DataTable dt = Extract("select * from ave_annual_basin");

            if (dt.Rows.Count == 0)
            {
                return;
            }

            foreach (DataRow r in dt.Rows)
            {
                RowItem item = new RowItem(r);
                string  name = item.getColumnValue_String("NAME");
                if (name.Equals("START_YEAR_OUTPUT"))
                {
                    _startYear = item.getColumnValue_Int("VALUE");
                }
                else if (name.Equals("END_YEAR"))
                {
                    _endYear = item.getColumnValue_Int("VALUE");
                }
                else if (name.Equals("OUTPUT_INTERVAL"))
                {
                    _interval = (OutputIntervalType)(item.getColumnValue_Int("VALUE"));
                }
            }

            dt        = Extract("select * from hru_info");
            _numofHRU = dt.Rows.Count;

            dt        = Extract("select * from sub_info");
            _numofSub = dt.Rows.Count;

            dt = Extract("select * from sqlite_master where name = 'rsv_info'");
            if (dt.Rows.Count > 0)
            {
                dt        = Extract("select * from rsv_info");
                _numofSub = dt.Rows.Count;
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Get time from year, month and day
        /// </summary>
        /// <param name="r"></param>
        private void calculateDate(DataTable dt)
        {
            dt.Columns.Add("TIME", typeof(DateTime));
            foreach (DataRow r in dt.Rows)
            {
                DateTime d     = DateTime.Now;
                RowItem  item  = new RowItem(r);
                int      year  = item.getColumnValue_Int(COLUMN_NAME_YEAR);
                int      month = 1;
                int      day   = 1;
                if (Interval == OutputIntervalType.MON || Interval == OutputIntervalType.DAY)
                {
                    month = item.getColumnValue_Int(COLUMN_NAME_MONTH);
                }
                if (Interval == OutputIntervalType.DAY)
                {
                    day = item.getColumnValue_Int(COLUMN_NAME_DAY);
                }

                r["TIME"] = new DateTime(year, month, day);
            }
        }
        private void getBasicInformation()
        {
            DataTable dt = Extract("select * from ave_annual_basin");
            if (dt.Rows.Count == 0) return;

            foreach (DataRow r in dt.Rows)
            {
                RowItem item = new RowItem(r);
                string name = item.getColumnValue_String("NAME");
                if (name.Equals("START_YEAR_OUTPUT"))
                    _startYear = item.getColumnValue_Int("VALUE");
                else if (name.Equals("END_YEAR"))
                    _endYear = item.getColumnValue_Int("VALUE");
                else if (name.Equals("OUTPUT_INTERVAL"))
                    _interval = (OutputIntervalType)(item.getColumnValue_Int("VALUE"));
            }

            dt = Extract("select * from hru_info");
            _numofHRU = dt.Rows.Count;

            dt = Extract("select * from sub_info");
            _numofSub = dt.Rows.Count;

            dt = Extract("select * from sqlite_master where name = 'rsv_info'");
            if (dt.Rows.Count > 0)
            {
                dt = Extract("select * from rsv_info");
                _numofSub = dt.Rows.Count;
            }
        }
        /// <summary>
        /// Get time from year, month and day
        /// </summary>
        /// <param name="r"></param>
        private void calculateDate(DataTable dt)
        {
            dt.Columns.Add("TIME", typeof(DateTime));
            foreach (DataRow r in dt.Rows)
            {
                DateTime d = DateTime.Now;
                RowItem item = new RowItem(r);
                int year = item.getColumnValue_Int(COLUMN_NAME_YEAR);
                int month = 1;
                int day = 1;
                if (Interval == OutputIntervalType.MON || Interval == OutputIntervalType.DAY)
                    month = item.getColumnValue_Int(COLUMN_NAME_MONTH);
                if (Interval == OutputIntervalType.DAY)
                    day = item.getColumnValue_Int(COLUMN_NAME_DAY);

                r["TIME"] = new DateTime(year, month, day);
            }
        }