Example #1
0
        public void Add(string[] cbttPcodeList, DateTime t1, DateTime t2,
                        HydrometHost svr = HydrometHost.PNLinux, TimeInterval interval = TimeInterval.Monthly, int back = 0)
        {
            // make cbttPcodeList unique.
            List <string> lst = new List <string>(cbttPcodeList);

            cbttPcodeList = lst.Distinct().ToArray();

            //minT = t1;
            //maxT = t2;
            m_interval = interval;

            string query = String.Join(",", cbttPcodeList);

            if (query.Length > 0)
            {
                DataTable m_table = new DataTable();
                if (interval == TimeInterval.Monthly && svr != HydrometHost.GreatPlains)
                {
                    m_table = HydrometDataUtility.MPollTable(svr, query, t1, t2);
                }
                else if (interval == TimeInterval.Daily)
                {
                    m_table = HydrometDataUtility.ArchiveTable(svr, query, t1, t2, back);
                }
                else if (interval == TimeInterval.Irregular)
                {
                    m_table = HydrometDataUtility.DayFilesTable(svr, query, t1, t2, back);
                }
                m_table.ExtendedProperties.Add("interval", interval.ToString());
                s_counter++;
                m_table.TableName = svr.ToString() + "_" + interval.ToString() + s_counter;
                m_dataSet.Tables.Add(m_table);
            }
        }
Example #2
0
        public void Add(string[] cbttPcodeList, DateTime t1, DateTime t2,
            HydrometHost svr = HydrometHost.PN, TimeInterval interval = TimeInterval.Monthly, int back=0)
        {
            // make cbttPcodeList unique.
            List<string> lst = new List<string>(cbttPcodeList);
            cbttPcodeList =  lst.Distinct().ToArray();

            //minT = t1;
            //maxT = t2;
            m_interval = interval;

            string query = String.Join(",",cbttPcodeList);

            if (query.Length >0)
            {
                DataTable m_table = new DataTable();
                if (interval == TimeInterval.Monthly)
                {
                    m_table = HydrometDataUtility.MPollTable(svr, query, t1, t2);
                }
                else if (interval == TimeInterval.Daily)
                {
                    m_table = HydrometDataUtility.ArchiveTable(svr, query, t1, t2,back);
                }
                else if (interval == TimeInterval.Irregular)
                {
                    m_table = HydrometDataUtility.DayFilesTable(svr, query, t1, t2,back);
                }
                m_table.ExtendedProperties.Add("interval", interval.ToString());
                s_counter++;
                m_table.TableName = svr.ToString()+"_"+interval.ToString() + s_counter;
                m_dataSet.Tables.Add(m_table);
            }
        }
Example #3
0
 private void Init(string cbtt, string pcode, HydrometHost server)
 {
     this.server          = server;
     this.cbtt            = cbtt;
     this.pcode           = pcode;
     this.Table.TableName = TimeSeriesName.GetTableName(server.ToString(), TimeSeries.TimeInterval.Irregular,
                                                        cbtt, pcode);
     Parameter                  = pcode;
     Units                      = HydrometInfoUtility.LookupDayfileUnits(pcode);
     Name                       = HydrometInfoUtility.LookupSiteDescription(cbtt) + " " + Units;
     Source                     = "Hydromet";
     Provider                   = "HydrometInstantSeries";
     this.SiteID                = HydrometInfoUtility.LookupSiteDescription(cbtt);
     this.TimeInterval          = TimeSeries.TimeInterval.Irregular;
     ReadOnly                   = true;
     this.Appearance.LegendText = cbtt + " " + pcode;
     ConnectionString           = "server=" + server
                                  + ";cbtt=" + cbtt + ";pcode=" + pcode;// +";LastUpdate=" + DateTime.Now.ToString(DateTimeFormat_Instantaneous);
 }
        public HydrometMonthlySeries(string cbtt, string pcode, HydrometHost server = HydrometHost.PNLinux)
        {
            this.TimeInterval    = TimeSeries.TimeInterval.Monthly;
            this.Units           = "";
            ReadOnly             = true;
            this.m_cbtt          = cbtt;
            this.m_pcode         = pcode;
            this.Table.TableName = TimeSeriesName.GetTableName(server.ToString(), TimeSeries.TimeInterval.Monthly,
                                                               cbtt, pcode);
            this.Name                  = FindName(cbtt);
            this.Parameter             = pcode;
            this.HasFlags              = true;
            this.Units                 = LookupUnits(pcode);
            this.Appearance.LegendText = cbtt + " " + pcode;
            this.server                = server;
            Provider         = "HydrometMonthlySeries";
            ConnectionString = "server=" + server.ToString()
                               + ";cbtt=" + cbtt + ";pcode=" + pcode + ";LastUpdate=" + DateTime.Now.ToString(DateTimeFormatInstantaneous);

            this.Table.TableName = "monthly_" + cbtt + "_" + pcode;
        }