Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/08/12 12:10:38 (11 years ago)
Author:
sforsten
Message:

#1292: implemented changes suggested by mkommend in comment:49:ticket:1292

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/AbstractFeatureCorrelationView.cs

    r8874 r8880  
    2020#endregion
    2121
     22using System.Collections.Generic;
    2223using System.ComponentModel;
    2324using System.Linq;
     
    3233  [Content(typeof(DataAnalysisProblemData), false)]
    3334  public abstract partial class AbstractFeatureCorrelationView : AsynchronousContentView {
     35    public const string ALLSAMPLES = "All Samples";
     36    public const string TRAININGSAMPLES = "Training Samples";
     37    public const string TESTSAMPLES = "Test Samples";
     38
     39    public static readonly IList<string> Partitions = new List<string>() { ALLSAMPLES, TRAININGSAMPLES, TESTSAMPLES };
     40
    3441    protected FeatureCorrelationCalculator fcc;
    3542
     
    4451      var calculators = ApplicationManager.Manager.GetInstances<IDependencyCalculator>();
    4552      var calcList = calculators.OrderBy(c => c.Name).Select(c => new { Name = c.Name, Calculator = c }).ToList();
    46       CorrelationCalcComboBox.ValueMember = "Calculator";
    47       CorrelationCalcComboBox.DisplayMember = "Name";
    48       CorrelationCalcComboBox.DataSource = calcList;
    49       CorrelationCalcComboBox.SelectedItem = calcList.First(c => c.Calculator.GetType().Equals(typeof(PearsonsRDependenceCalculator)));
    50       PartitionComboBox.DataSource = FeatureCorrelationPartitions.Partitions;
    51       PartitionComboBox.SelectedItem = FeatureCorrelationPartitions.TRAININGSAMPLES;
     53      correlationCalcComboBox.ValueMember = "Calculator";
     54      correlationCalcComboBox.DisplayMember = "Name";
     55      correlationCalcComboBox.DataSource = calcList;
     56      correlationCalcComboBox.SelectedItem = calcList.First(c => c.Calculator.GetType().Equals(typeof(PearsonsRDependenceCalculator)));
     57      partitionComboBox.DataSource = Partitions;
     58      partitionComboBox.SelectedItem = TRAININGSAMPLES;
    5259    }
    5360
     
    5966
    6067    protected override void DeregisterContentEvents() {
    61       fcc.CorrelationCalculationFinished += new FeatureCorrelationCalculator.CorrelationCalculationFinishedHandler(Content_CorrelationCalculationFinished);
    62       fcc.ProgressCalculation += new FeatureCorrelationCalculator.ProgressCalculationHandler(Content_ProgressCalculation);
     68      fcc.CorrelationCalculationFinished -= new FeatureCorrelationCalculator.CorrelationCalculationFinishedHandler(Content_CorrelationCalculationFinished);
     69      fcc.ProgressCalculation -= new FeatureCorrelationCalculator.ProgressCalculationHandler(Content_ProgressCalculation);
    6370      base.DeregisterContentEvents();
    6471    }
     
    99106
    100107    protected void UpdateDataView(DoubleMatrix correlation) {
    101       IDependencyCalculator calc = (IDependencyCalculator)CorrelationCalcComboBox.SelectedValue;
     108      IDependencyCalculator calc = (IDependencyCalculator)correlationCalcComboBox.SelectedValue;
    102109      maximumLabel.Text = calc.Maximum.ToString();
    103110      minimumLabel.Text = calc.Minimum.ToString();
     
    111118
    112119    protected void Content_ProgressCalculation(object sender, ProgressChangedEventArgs e) {
    113       if (!CalculatingPanel.Visible && e.ProgressPercentage != HeatMapProgressBar.Maximum) {
    114         CalculatingPanel.Show();
    115       } else if (e.ProgressPercentage == HeatMapProgressBar.Maximum) {
    116         CalculatingPanel.Hide();
     120      if (!calculatingPanel.Visible && e.ProgressPercentage != heatMapProgressBar.Maximum) {
     121        calculatingPanel.Show();
     122      } else if (e.ProgressPercentage == heatMapProgressBar.Maximum) {
     123        calculatingPanel.Hide();
    117124      }
    118       HeatMapProgressBar.Value = e.ProgressPercentage;
     125      heatMapProgressBar.Value = e.ProgressPercentage;
    119126    }
    120127  }
Note: See TracChangeset for help on using the changeset viewer.