Changeset 15280 for branches/Async/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/AbstractFeatureCorrelationView.cs
- Timestamp:
- 07/23/17 00:52:14 (7 years ago)
- Location:
- branches/Async
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Async
- Property svn:mergeinfo changed
-
branches/Async/HeuristicLab.Problems.DataAnalysis.Views
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis.Views (added) merged: 13397,13439,13592,13705,13711,13715,13764,13766,13938,13942,13958,13992
- Property svn:mergeinfo changed
-
branches/Async/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/AbstractFeatureCorrelationView.cs
r12151 r15280 37 37 public const string TESTSAMPLES = "Test Samples"; 38 38 39 public static readonly IList<string> Partitions = new List<string>() { ALLSAMPLES, TRAININGSAMPLES, TESTSAMPLES } ;39 public static readonly IList<string> Partitions = new List<string>() { ALLSAMPLES, TRAININGSAMPLES, TESTSAMPLES }.AsReadOnly(); 40 40 41 protected FeatureCorrelationCalculator fcc;41 protected AbstractFeatureCorrelationCalculator CorrelationCalculator { get; set; } 42 42 43 43 public new DataAnalysisProblemData Content { … … 49 49 InitializeComponent(); 50 50 dataView.FormatPattern = "0.000"; 51 fcc = new FeatureCorrelationCalculator();52 51 var calculators = ApplicationManager.Manager.GetInstances<IDependencyCalculator>(); 53 52 var calcList = calculators.OrderBy(c => c.Name).Select(c => new { Name = c.Name, Calculator = c }).ToList(); … … 55 54 correlationCalcComboBox.DisplayMember = "Name"; 56 55 correlationCalcComboBox.DataSource = calcList; 57 correlationCalcComboBox.SelectedItem = calcList.First(c => c.Calculator.GetType() .Equals(typeof(PearsonsRDependenceCalculator)));56 correlationCalcComboBox.SelectedItem = calcList.First(c => c.Calculator.GetType() == typeof(PearsonsRDependenceCalculator)); 58 57 partitionComboBox.DataSource = Partitions; 59 58 partitionComboBox.SelectedItem = TRAININGSAMPLES; … … 61 60 } 62 61 62 protected override void OnClosing(FormClosingEventArgs e) { 63 base.OnClosing(e); 64 CorrelationCalculator.TryCancelCalculation(); 65 } 66 63 67 protected override void RegisterContentEvents() { 64 68 base.RegisterContentEvents(); 65 fcc.ProgressCalculation += new FeatureCorrelationCalculator.ProgressCalculationHandler(Content_ProgressCalculation);66 fcc.CorrelationCalculationFinished += new FeatureCorrelationCalculator.CorrelationCalculationFinishedHandler(Content_CorrelationCalculationFinished);69 CorrelationCalculator.ProgressChanged += FeatureCorrelation_ProgressChanged; 70 CorrelationCalculator.CorrelationCalculationFinished += FeatureCorrelation_CalculationFinished; 67 71 } 68 72 69 73 protected override void DeregisterContentEvents() { 70 fcc.CorrelationCalculationFinished -= new FeatureCorrelationCalculator.CorrelationCalculationFinishedHandler(Content_CorrelationCalculationFinished);71 fcc.ProgressCalculation -= new FeatureCorrelationCalculator.ProgressCalculationHandler(Content_ProgressCalculation);74 CorrelationCalculator.ProgressChanged -= FeatureCorrelation_ProgressChanged; 75 CorrelationCalculator.CorrelationCalculationFinished -= FeatureCorrelation_CalculationFinished; 72 76 base.DeregisterContentEvents(); 73 77 } … … 75 79 protected override void OnContentChanged() { 76 80 base.OnContentChanged(); 77 fcc.TryCancelCalculation();81 CorrelationCalculator.TryCancelCalculation(); 78 82 if (Content != null) { 79 fcc.ProblemData = Content;80 83 CalculateCorrelation(); 81 84 } else { … … 106 109 107 110 protected abstract void CalculateCorrelation(); 108 protected abstract void Content_CorrelationCalculationFinished(object sender, FeatureCorrelationCalculator.CorrelationCalculationFinishedArgs e); 111 112 protected abstract void FeatureCorrelation_CalculationFinished(object sender, 113 AbstractFeatureCorrelationCalculator.CorrelationCalculationFinishedArgs e); 109 114 110 115 protected void UpdateDataView(DoubleMatrix correlation) { … … 121 126 } 122 127 123 protected void Content_ProgressCalculation(object sender, ProgressChangedEventArgs e) {128 protected void FeatureCorrelation_ProgressChanged(object sender, ProgressChangedEventArgs e) { 124 129 if (!progressPanel.Visible && e.ProgressPercentage != progressBar.Maximum) { 125 130 progressPanel.Show();
Note: See TracChangeset
for help on using the changeset viewer.