Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/08/21 15:53:37 (3 years ago)
Author:
dpiringe
Message:

#3026

  • added a new protected virtual property in CheckedItemListView to be able to change the text of the groupBox
  • removed event handling in ResultCollectionPostProcessorControl and overwrote the new property GroupBoxText
  • added a new section in ExportJsonDialog for result collection processors
  • renamed IResultCollectionPostProcessor to IResultCollectionProcessor + all connected classes
  • added/changed the workflow of ResultCollectionProcessors in JsonTemplateGenerator and JsonTemplateInstantiator
    • also changed Constants.cs -> added a new section in template ResultCollectionProcessorItems
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.App/Runner.cs

    r18046 r18050  
    2929    }
    3030
    31     private static void WriteResultsToFile(string file, IOptimizer optimizer, IEnumerable<IResultJsonItem> configuredResultItem, IEnumerable<IResultCollectionPostProcessor> postProcessors) {
     31    private static void WriteResultsToFile(string file, IOptimizer optimizer, IEnumerable<IResultJsonItem> configuredResultItem, IEnumerable<IResultCollectionProcessor> postProcessors) {
    3232      if (optimizer.Runs.Count > 0)
    3333        File.WriteAllText(file, FetchResults(optimizer, configuredResultItem, postProcessors));
     
    4141      ResultFormatter?.Where(x => x.GetType().FullName == fullName).Last();
    4242
    43     private static string FetchResults(IOptimizer optimizer, IEnumerable<IResultJsonItem> configuredResultItems, IEnumerable<IResultCollectionPostProcessor> postProcessors) {
     43    private static string FetchResults(IOptimizer optimizer, IEnumerable<IResultJsonItem> configuredResultItems, IEnumerable<IResultCollectionProcessor> postProcessors) {
    4444      JArray arr = new JArray();
    4545      IEnumerable<string> configuredResults = configuredResultItems.Select(x => x.Name);
     
    6767        }
    6868
    69         IDictionary<string, string> resultDict = new Dictionary<string, string>();
    70         foreach (var processor in postProcessors) {
    71           processor.Apply(run.Results, resultDict);
    72         }
    73         foreach(var kvp in resultDict) {
    74           obj.Add(kvp.Key, kvp.Value);
    75         }
     69        foreach (var processor in postProcessors)
     70          processor.Apply(run.Results);
     71
     72        foreach(var result in run.Results)
     73          obj.Add(result.Key, result.Value.ToString());
    7674      }
    7775      return SingleLineArrayJsonWriter.Serialize(arr);
Note: See TracChangeset for help on using the changeset viewer.