Beispiel #1
0
 public static void WriteParameterToFile <D1, T>(string filename, IParameter1Dimensional <D1, T> parameter)
 {
     using (var f = File.CreateText(filename))
     {
         OutputHelper.WriteParameterToFile(f, parameter);
     }
 }
Beispiel #2
0
        public YearFieldWindow(string parameterName, IParameter1Dimensional<Timestep, double> parameterToDisplay)
        {
            InitializeComponent();

            _parameter = parameterToDisplay;
            _parameterName = parameterName;

            plotterHeader.Content = parameterName;
            //var l = new System.Windows.Controls.DataVisualization.Charting.LineSeries();
            var data = from p in parameterToDisplay.GetEnumerator()
                       where !Double.IsNaN(p.Value) && !double.IsInfinity(p.Value)
                       select new Point(p.Dimension1.Index + 1950, p.Value);

            var d = data.AsDataSource();

            plotter.AddLineGraph(d);
        }
        public YearFieldWindow(string parameterName, IParameter1Dimensional <Timestep, double> parameterToDisplay)
        {
            InitializeComponent();

            _parameter     = parameterToDisplay;
            _parameterName = parameterName;

            plotterHeader.Content = parameterName;
            //var l = new System.Windows.Controls.DataVisualization.Charting.LineSeries();
            var data = from p in parameterToDisplay.GetEnumerator()
                       where !Double.IsNaN(p.Value) && !double.IsInfinity(p.Value)
                       select new Point(p.Dimension1.Index + 1950, p.Value);


            var d = data.AsDataSource();

            plotter.AddLineGraph(d);
        }
Beispiel #4
0
        public void Add1DimensionalParameter <D1, T>(string componentName, string fieldName, IParameter1Dimensional <D1, T> parameter)
        {
            var key = new Tuple <string, string>(componentName.ToLowerInvariant(), fieldName.ToLowerInvariant());

            if (_variables.ContainsKey(key))
            {
                throw new ArgumentException();
            }

            _variables.Add(key, parameter);
        }
Beispiel #5
0
 public override void SetSource(object value)
 {
     _values = (IParameter1Dimensional <D1, T>)value;
 }