Exemplo n.º 1
0
        static void MakeCookbook()
        {
            Console.WriteLine("making cookbook...");
            Stopwatch stopwatch       = Stopwatch.StartNew();
            string    outputFolder    = System.IO.Path.GetFullPath($"./{ScottPlot.Tools.GetVersionString()}");
            var       reportGeneratpr = new ScottPlot.Demo.ReportGenerator(outputFolder: outputFolder);

            Console.WriteLine($"Preparing output folder...");
            reportGeneratpr.ClearFolders();

            Console.Write("Generating cookbook figures");
            var recipes = ScottPlot.Demo.Reflection.GetPlots();

            foreach (var recipe in recipes)
            {
                Console.Write(".");
                reportGeneratpr.CreateImage(recipe);
            }
            Console.WriteLine();

            Console.WriteLine($"Creating reports...");
            reportGeneratpr.MakeReports();

            double elapsedSec = (double)stopwatch.ElapsedTicks / Stopwatch.Frequency;

            Console.WriteLine($"Cookbook finished ({recipes.Length} figures generated in {elapsedSec:0.00} seconds)");
            Console.WriteLine(outputFolder);

            // launch the folder
            System.Diagnostics.Process.Start("explorer.exe", outputFolder);
        }
Exemplo n.º 2
0
        private void CookbookWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            string outputFolder = System.IO.Path.GetFullPath($"./{ScottPlot.Tools.GetVersionString()}");

            var reportGeneratpr = new ScottPlot.Demo.ReportGenerator(outputFolder: outputFolder);

            (sender as BackgroundWorker).ReportProgress(0, $"preparing folders");
            reportGeneratpr.ClearFolders();
            foreach (var recipe in ScottPlot.Demo.Reflection.GetPlots())
            {
                (sender as BackgroundWorker).ReportProgress(0, recipe.id);
                reportGeneratpr.CreateImage(recipe);
            }

            (sender as BackgroundWorker).ReportProgress(0, $"creating reports");
            reportGeneratpr.MakeReports();
        }