Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/04/19 13:00:24 (5 years ago)
Author:
mkommend
Message:

#2955: Merged r16241, r16243, r16244, r16763 into stable.

Location:
stable
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Problems.DataAnalysis

  • stable/HeuristicLab.Problems.DataAnalysis/3.4

  • stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs

    r16164 r17054  
    207207      if (listeners != null) listeners(this, EventArgs.Empty);
    208208    }
    209 
    210     protected virtual bool IsProblemDataCompatible(IDataAnalysisProblemData problemData, out string errorMessage) {
    211       errorMessage = string.Empty;
    212       if (problemData == null) throw new ArgumentNullException("problemData", "The provided problemData is null.");
    213 
    214       //check allowed input variables
    215       StringBuilder message = new StringBuilder();
    216       var variables = new HashSet<string>(problemData.InputVariables.Select(x => x.Value));
    217       foreach (var item in AllowedInputVariables) {
    218         if (!variables.Contains(item))
    219           message.AppendLine("Input variable '" + item + "' is not present in the new problem data.");
    220       }
    221 
    222       if (message.Length != 0) {
    223         errorMessage = message.ToString();
    224         return false;
    225       }
    226       return true;
    227 
    228     }
    229 
    230     public virtual void AdjustProblemDataProperties(IDataAnalysisProblemData problemData) {
    231       DataAnalysisProblemData data = problemData as DataAnalysisProblemData;
    232       if (data == null) throw new ArgumentException("The problem data is not a data analysis problem data. Instead a " + problemData.GetType().GetPrettyName() + " was provided.", "problemData");
    233 
    234       string errorMessage;
    235       if (!data.IsProblemDataCompatible(this, out errorMessage)) {
    236         throw new InvalidOperationException(errorMessage);
    237       }
    238 
    239       foreach (var inputVariable in InputVariables) {
    240         var variable = data.InputVariables.FirstOrDefault(i => i.Value == inputVariable.Value);
    241         InputVariables.SetItemCheckedState(inputVariable, variable != null && data.InputVariables.ItemChecked(variable));
    242       }
    243     }
    244209  }
    245210}
Note: See TracChangeset for help on using the changeset viewer.