public RegionFieldWindow(string parameterName, IParameter1DimensionalTypeless <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 Tuple <string, double>(p.Dimension1.ToString(), p.Value);

            chart1.Title = parameterName;

            var mySeries = new ColumnSeries();

            mySeries.IndependentValueBinding = new Binding("Item1");
            mySeries.DependentValueBinding   = new Binding("Item2");
            mySeries.ItemsSource             = data;
            chart1.Series.Add(mySeries);

            var axis = new LinearAxis();

            axis.Orientation = AxisOrientation.Y;
            axis.Minimum     = data.Select(i => i.Item2).Min();
            axis.Maximum     = data.Select(i => i.Item2).Max();
            chart1.Axes.Add(axis);
        }
示例#2
0
 public static void WriteParameterToFile <T>(string filename, IParameter1DimensionalTypeless <T> parameter)
 {
     using (var f = File.CreateText(filename))
     {
         OutputHelper.WriteParameterToFile <T>(f, parameter);
     }
 }
示例#3
0
        public RegionFieldWindow(string parameterName, IParameter1DimensionalTypeless<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 Tuple<string, double>(p.Dimension1.ToString(), p.Value);

            chart1.Title = parameterName;

            var mySeries = new ColumnSeries();
            mySeries.IndependentValueBinding = new Binding("Item1");
            mySeries.DependentValueBinding = new Binding("Item2");
            mySeries.ItemsSource = data;
            chart1.Series.Add(mySeries);

            var axis = new LinearAxis();
            axis.Orientation = AxisOrientation.Y;
            axis.Minimum = data.Select(i => i.Item2).Min();
            axis.Maximum = data.Select(i => i.Item2).Max();
            chart1.Axes.Add(axis);
        }
示例#4
0
 public static void WriteParameterToFile <T>(TextWriter file, IParameter1DimensionalTypeless <T> parameter)
 {
     OutputHelper.WriteParameterToFile <T>(file, parameter.GetEnumerator());
 }