コード例 #1
0
        private void Button_TestConfiguration_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new ConfigurationSelectionDialog();

            if (dialog.ShowDialog() != true)
            {
                return;
            }

            var caibration_mode     = Helpers.GetCalibrationMode(dialog.GetSelectedConfiguration());
            var calibration_manager = Helpers.SetupCalibrationManager(caibration_mode);

            var data_set = (Builder == null ? DataSet.LoadEverything() : DataSet.LoadSingleSection(Builder.name));

            int avg_time;
            var results = Helpers.RunPerfTest(
                calibration_manager,
                data_set,
                caibration_mode.additional_dimensions_configuration,
                out avg_time);

            calibration_manager.SaveInDirectory(Utils.DataFolder);

            string results_text = "";

            foreach (var item in results)
            {
                results_text += item.ToText();
            }

            MessageBox.Show(
                "Configuration: " + (dialog.GetSelectedConfiguration() ?? "User Data") + ". " + results_text +
                ". \nAvg time:" + avg_time);
        }
コード例 #2
0
        private void Button_TestConfiguration_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new ConfigurationSelectionDialog();

            if (dialog.ShowDialog() != true || SelectedDataSet == null)
            {
                return;
            }

            var caibration_mode     = Helpers.GetCalibrationMode(dialog.GetSelectedConfiguration());
            var calibration_manager = Helpers.SetupCalibrationManager(caibration_mode);

            int avg_time;
            var result = Helpers.RunPerfTest(
                calibration_manager,
                SelectedDataSet.data_points,
                caibration_mode.additional_dimensions_configuration,
                out avg_time);

            calibration_manager.SaveInDirectory(Utils.DataFolder);

            using (var writer = new StreamWriter(
                       System.IO.Path.Combine(SelectedDataSet.DataSetResultsFolder,
                                              (dialog.GetSelectedConfiguration() ?? "User Data") + ".csv")))
            {
                using (var csv = new CsvHelper.CsvWriter(writer, System.Globalization.CultureInfo.InvariantCulture))
                {
                    csv.WriteRecords(result.errors);
                }
            }

            MessageBox.Show(
                "Configuration: " + (dialog.GetSelectedConfiguration() ?? "User Data") + ". " + result.ToString() +
                ". \nAvg time:" + avg_time);
        }
コード例 #3
0
        private void Button_TestConfigurationVisually_Click(object sender, RoutedEventArgs e)
        {
            var configuration_selection_dialog = new ConfigurationSelectionDialog();

            if (configuration_selection_dialog.ShowDialog() != true || Builder == null)
            {
                return;
            }

            ConfigurationTestVisualisationWindow data_visualisation_window =
                new ConfigurationTestVisualisationWindow(
                    configuration_selection_dialog.GetSelectedConfiguration(),
                    Builder.data_points);

            data_visualisation_window.ShowDialog();
        }