Beispiel #1
0
        public VariableSummary(AbstractFunctionVariable v, RiverSystemScenario scenario)
        {
            Scenario     = scenario;
            Variable     = v;
            Name         = v.Name;
            FullName     = v.FullName;
            ID           = v.id;
            VariableType = v.GetType().Name;

            if (v is BilinearVariable)
            {
                VeneerSupported = false;
            }
            else if (v is ContextVariable)
            {
                VeneerSupported = false;
            }
            else if (v is ModelledVariable)
            {
                VeneerSupported = false;
            }
            else if (v is PatternVariable)
            {
                VeneerSupported = false;
            }
            else if (v is LinearVariable)
            {
                VeneerSupported       = true;
                PiecewiseFunctionData = new SimplePiecewise(v as LinearVariable);
                PiecewiseFunction     = String.Format("/variables/{0}/Piecewise", FullName.Replace("$", ""));
            }
            else if (v is TimeSeriesVariable)
            {
                VeneerSupported = true;
                var tsV = (TimeSeriesVariable)v;
                VeneerDebugInfo += kvp("DisplayName", tsV.DisplayName) +
                                   kvp("ResultUnit", tsV.ResultUnit.Name);
                TimeSeriesData = new SimpleTimeSeries(FindTimeSeries());
                TimeSeries     = String.Format("/variables/{0}/TimeSeries", FullName.Replace("$", ""));
            }
        }
Beispiel #2
0
        public VariableSummary(AbstractFunctionVariable v,RiverSystemScenario scenario)
        {
            Scenario = scenario;
            Variable = v;
            Name = v.Name;
            FullName = v.FullName;
            ID = v.id;
            VariableType = v.GetType().Name;
 
            if (v is BilinearVariable)
            {
                VeneerSupported = false;
            }
            else if (v is ContextVariable)
            {
                VeneerSupported = false;
            }
            else if (v is ModelledVariable)
            {
                VeneerSupported = false;
            }
            else if (v is PatternVariable)
            {
                VeneerSupported = false;
            }
            else if (v is LinearVariable)
            {
                VeneerSupported = true;
                PiecewiseFunctionData = new SimplePiecewise(v as LinearVariable);
                PiecewiseFunction = String.Format("/variables/{0}/Piecewise", FullName.Replace("$", ""));
            }
            else if (v is TimeSeriesVariable)
            {
                VeneerSupported = true;
                var tsV = (TimeSeriesVariable) v;
                VeneerDebugInfo += kvp("DisplayName", tsV.DisplayName) +
                                   kvp("ResultUnit", tsV.ResultUnit.Name);
                TimeSeriesData = new SimpleTimeSeries(FindTimeSeries());
                TimeSeries = String.Format("/variables/{0}/TimeSeries", FullName.Replace("$", ""));
            }
        }