Пример #1
0
        public override Series CreateScenario(TimeSeriesDatabaseDataSet.ScenarioRow scenario)
        {
            if (ScenarioName == scenario.Name)
            {
                return(this);
            }

            var sr = m_db.GetNewSeriesRow(false);

            sr.ItemArray = SeriesCatalogRow.ItemArray;


            string cs = sr.ConnectionString;
            string scenario_model_run_id   = ConnectionStringUtility.GetToken(scenario.Path, "model_run_id", "-1");
            string scenario_model_run_name = ConnectionStringUtility.GetToken(scenario.Path, "model_run_name", "");
            string scenario_run_date       = ConnectionStringUtility.GetToken(scenario.Path, "run_date", "");

            cs = ConnectionStringUtility.Modify(cs, "model_run_id", scenario_model_run_id);
            cs = ConnectionStringUtility.Modify(cs, "model_run_name", scenario_model_run_name);
            cs = ConnectionStringUtility.Modify(cs, "run_date", scenario_run_date);

            sr.ConnectionString = cs;
            var s = new HdbModelSeries(m_db, sr);

            s.Appearance.LegendText = BuildScenairoName(scenario_model_run_name, scenario_model_run_id, scenario_run_date)
                                      + " " + Name;
            return(s);
        }
Пример #2
0
        public override Series CreateScenario(TimeSeriesDatabaseDataSet.ScenarioRow scenario)
        {
            if (scenario.Name == ScenarioName)
            {
                return(this);
            }
            else
            {
                string fn = ConnectionStringUtility.GetFileName(scenario.Path, m_db.DataSource);
                Logger.WriteLine("Reading series from " + fn);
                var sr = m_db.GetNewSeriesRow(false);
                sr.ItemArray = SeriesCatalogRow.ItemArray;

                sr.ConnectionString = ConnectionStringUtility.Modify(sr.ConnectionString, "FileName", fn);
                Series s = new HydrossSeries(m_db, sr);
                s.ReadOnly     = true;
                s.ScenarioName = scenario.Name;
                return(s);
            }
        }