Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ResultParameterConverter.cs @ 17464

Last change on this file since 17464 was 17451, checked in by dpiringe, 5 years ago

#3026:

  • renamed ResultItem to ResultJsonItem
  • implemented RegressionProblemDataConverter
  • added support for "named matrices" (named = rows and columns have names) -> INamedMatrixJsonItem incl. base classes and views
  • added a bool property Active in IJsonItem -> marks items, which should be written into the template
File size: 937 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Threading.Tasks;
6using HeuristicLab.Core;
7using HeuristicLab.Optimization;
8
9namespace HeuristicLab.JsonInterface {
10  public class ResultParameterConverter : BaseConverter {
11    public override int Priority => 5;
12
13    public override Type ConvertableType => typeof(IResultParameter);
14
15    public override IJsonItem Extract(IItem value, IJsonItemConverter root) {
16      IResultParameter res = value as IResultParameter;
17      return new ResultJsonItem() {
18        Name = res.ActualName,
19        ActualName = res.ActualName,
20        Value = res.ActualName,
21        Description = res.Description
22      };
23    }
24
25    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
26      IResultParameter res = item as IResultParameter;
27      res.ActualName = (string)data.Value;
28    }
29  }
30}
Note: See TracBrowser for help on using the repository browser.