Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/02/13 15:13:37 (10 years ago)
Author:
mkommend
Message:

#1758: Added check of target and inputvariables of dropped ProblemData.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationSolutionView.cs

    r10173 r10174  
    2020#endregion
    2121
     22using System;
    2223using System.Windows.Forms;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.MainForm;
     26using HeuristicLab.PluginInfrastructure;
    2527
    2628namespace HeuristicLab.Problems.DataAnalysis.Views {
     
    5153    }
    5254    #endregion
     55
     56    protected override bool CheckCompatibilityOfProblemData(IDataAnalysisProblemData problemData) {
     57      IClassificationProblemData classificationProblemData = (IClassificationProblemData)problemData;
     58
     59      if (!classificationProblemData.TargetVariable.Equals(Content.ProblemData.TargetVariable)) {
     60        string message = "The target variables are not matching. Old target variable: '"
     61                         + Content.ProblemData.TargetVariable
     62                         + "'. New targetvariable: '" + classificationProblemData.TargetVariable + "'";
     63        ErrorHandling.ShowErrorDialog(this, new InvalidOperationException(message));
     64        return false;
     65      }
     66
     67      return base.CheckCompatibilityOfProblemData(problemData);
     68    }
    5369  }
    5470}
Note: See TracChangeset for help on using the changeset viewer.