Esempio n. 1
0
 protected PiscesObject()
 {
     catalog = new TimeSeriesDatabaseDataSet.SeriesCatalogDataTable();
     row     = catalog.NewSeriesCatalogRow();
     row.id  = -1;
     // Catalog.Rows.Add(row);
     // Console.WriteLine("PiscesObject()");
 }
Esempio n. 2
0
 protected PiscesObject(TimeSeriesDatabaseDataSet.SeriesCatalogRow row)
 {
     if (row.RowState == System.Data.DataRowState.Detached)
     {
         catalog = new TimeSeriesDatabaseDataSet.SeriesCatalogDataTable();
     }
     else
     {
         catalog = (TimeSeriesDatabaseDataSet.SeriesCatalogDataTable)row.Table;//
     }
     this.row = row;
 }
Esempio n. 3
0
 public void ChangeParent(PiscesObject piscesObject, PiscesFolder piscesFolder)
 {
     if (piscesObject.Parent.ID == piscesFolder.ID)
     {
         return; // nothing to do
     }
     TimeSeriesDatabaseDataSet.SeriesCatalogRow r = GetSeriesRow(piscesObject.ID);
     r.ParentID = piscesFolder.ID;
     SaveSeriesRow(r);
     OnDatabaseChanged(GetPathArray(piscesObject.Parent));
     OnDatabaseChanged(GetPathArray(piscesFolder));
 }
Esempio n. 4
0
 public UrgwomSeries(TimeSeriesDatabase db, TimeSeriesDatabaseDataSet.SeriesCatalogRow sr)
     : base(db, sr)
 {
     TimeInterval       = TimeSeries.TimeInterval.Daily;
     ExternalDataSource = true;
     ReadOnly           = true;
     Provider           = "UrgwomSeries";
     ScenarioName       = "ScenarioName";
     xlsFilename        = ConnectionStringUtility.GetFileName(ConnectionString, m_db.DataSource);
     sheetName          = ConnectionStringToken("SheetName");
     dateColumn         = ConnectionStringToken("DateColumn");
     valueColumn        = ConnectionStringToken("ValueColumn");
 }
Esempio n. 5
0
        /// <summary>
        /// define path based on  root/sitecatalog.type/siteid/interval
        /// </summary>
        /// <param name="row"></param>
        /// <returns></returns>
        private List <string> GetDefaultPath(string root, TimeSeriesDatabaseDataSet.SeriesCatalogRow row)
        {
            var selectedPath = new List <string>();

            selectedPath.Add(root);

            var siteRow = m_siteCatalog.FindBysiteid(row.siteid);

            if (siteRow != null)
            {
                selectedPath.Add(siteRow.type);
            }
            else
            {
                Console.WriteLine("no site defined... in sitecatalog.");
                selectedPath.Add("unknown");
            }
            selectedPath.Add(row.siteid);
            selectedPath.Add(GetIntervalPath(row));
            return(selectedPath);
        }
Esempio n. 6
0
        ///// <summary>
        ///// determines if the child is inside the root
        ///// </summary>
        ///// <param name="selectedPath">root path </param>
        ///// <param name="rowPath"></param>
        ///// <returns></returns>
        // private bool IsChildInRoot(List<string> root, List<string> child)
        // {
        //     if (root.Count > child.Count)
        //         return false;

        //     for (int i = 0; i < root.Count; i++)
        //     {
        //         if (root[i] != child[i])
        //             return false;
        //     }
        //     return true;
        // }

        private static string GetIntervalPath(TimeSeriesDatabaseDataSet.SeriesCatalogRow row)
        {
            TimeSeriesName tn       = new TimeSeriesName(row.TableName);
            var            interval = "instant";

            if (row.TimeInterval == "Irregular" || row.TimeInterval == "Hourly")
            {
                interval = "instant";
            }
            else
            {
                interval = row.TimeInterval.ToLower();
            }

            if (TimeSeriesDatabase.IsQuality(tn.pcode))
            {
                interval = "quality";
            }

            return(interval);
        }
Esempio n. 7
0
 public CalculationSeries(TimeSeriesDatabase db, TimeSeriesDatabaseDataSet.SeriesCatalogRow sr) : base(db, sr)
 {
     m_parser = db.Parser;
     m_db     = db;
     Init();
 }
Esempio n. 8
0
 public PiscesFolder(TimeSeriesDatabase db,
                     TimeSeriesDatabaseDataSet.SeriesCatalogRow sr) : base(sr)
 {
     this.m_db = db;
 }