Esempio n. 1
0
        /*
         * private async void buttonOutputPlt_Click(object sender, RoutedEventArgs e)
         * {
         * // Pltファイルを出力する。
         * var dialog = new Microsoft.Win32.SaveFileDialog { Filter = "pltファイル(*.plt)|*.plt" };
         * if (dialog.ShowDialog() == true)
         * {
         *      var csv_destination = labelOutputDepthCsvDestination.Content.ToString();
         *      var chart_destination = labelOutputDepthChartDestination.Content.ToString();
         *
         *      using (var writer = new StreamWriter(dialog.FileName))
         *      {
         *              await WritePltCommands(writer, csv_destination, chart_destination, ChartFormat.Png);
         *      }
         * }
         * }
         */


        #region DepthProfile関連

        //DepthProfile _depthProfileData;

        #region *DepthProfileのチャートを表示(DisplayDepthChart)
        async void DisplayDepthChart(string source, string destination, ChartFormat format)
        {
            var gnuplot = new Gnuplot
            {
                Format      = format,
                Width       = 800,
                Height      = 600,
                FontScale   = 1.6,
                Destination = destination,
                XTitle      = "K.E. / eV",
                YTitle      = "Intensity"
            };

            gnuplot.DataSeries.Add(new LineChartSeries
            {
                SourceFile = source,
                XColumn    = 1,
                YColumn    = 2,
                Title      = "Layer 0",
                Style      = new LineChartSeriesStyle(LineChartStyle.Lines)
                {
                    Style = new LinePointStyle
                    {
                        LineColor = "#FF0000",
                        LineWidth = 3,
                    }
                }
            });
            gnuplot.DataSeries.Add(new LineChartSeries
            {
                SourceFile = source,
                XColumn    = 1,
                YColumn    = 3,
                Title      = "Layer 1",
                Style      = new LineChartSeriesStyle(LineChartStyle.Lines)
                {
                    Style = new LinePointStyle
                    {
                        LineColor = "#CC0000",
                        LineWidth = 2,
                    }
                }
            });
            gnuplot.DataSeries.Add(new LineChartSeries
            {
                SourceFile = source,
                XColumn    = 1,
                YColumn    = 4,
                Title      = "Layer 2",
                Style      = new LineChartSeriesStyle(LineChartStyle.Lines)
                {
                    Style = new LinePointStyle
                    {
                        LineColor = "#AA0000"
                    }
                }
            });


            await gnuplot.Draw();

            //imageChart.Source = new BitmapImage(new Uri(destination));
        }