Changeset 8880 for trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/AbstractFeatureCorrelationView.cs
- Timestamp:
- 11/08/12 12:10:38 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/AbstractFeatureCorrelationView.cs
r8874 r8880 20 20 #endregion 21 21 22 using System.Collections.Generic; 22 23 using System.ComponentModel; 23 24 using System.Linq; … … 32 33 [Content(typeof(DataAnalysisProblemData), false)] 33 34 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 34 41 protected FeatureCorrelationCalculator fcc; 35 42 … … 44 51 var calculators = ApplicationManager.Manager.GetInstances<IDependencyCalculator>(); 45 52 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; 52 59 } 53 60 … … 59 66 60 67 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); 63 70 base.DeregisterContentEvents(); 64 71 } … … 99 106 100 107 protected void UpdateDataView(DoubleMatrix correlation) { 101 IDependencyCalculator calc = (IDependencyCalculator) CorrelationCalcComboBox.SelectedValue;108 IDependencyCalculator calc = (IDependencyCalculator)correlationCalcComboBox.SelectedValue; 102 109 maximumLabel.Text = calc.Maximum.ToString(); 103 110 minimumLabel.Text = calc.Minimum.ToString(); … … 111 118 112 119 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(); 117 124 } 118 HeatMapProgressBar.Value = e.ProgressPercentage;125 heatMapProgressBar.Value = e.ProgressPercentage; 119 126 } 120 127 }
Note: See TracChangeset
for help on using the changeset viewer.