Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/31/11 03:24:02 (13 years ago)
Author:
swagner
Message:

Worked on OKB (#1174)

Location:
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3

    • Property svn:ignore
      •  

        old new  
        33*.user
        44HeuristicLabClientsOKBPlugin.cs
         5*.vs10x
  • branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/Query/Views/QueryView.cs

    r5674 r5902  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    7575    private void LoadResultsAsync(int batchSize) {
    7676      bool includeBinaryValues = includeBinaryValuesCheckBox.Checked;
    77       bool deserialize = deserializeBlobsCheckBox.Checked;
    7877
    7978      Cursor = Cursors.AppStarting;
     
    10099        while (ids.Count() > 0) {
    101100          cancellationToken.ThrowIfCancellationRequested();
    102           runs.AddRange(QueryClient.Instance.GetRuns(ids.Take(batchSize), includeBinaryValues).Select(x => ConvertToOptimizationRun(x, deserialize)));
     101          runs.AddRange(QueryClient.Instance.GetRuns(ids.Take(batchSize), includeBinaryValues).Select(x => ConvertToOptimizationRun(x)));
    103102          ids = ids.Skip(batchSize);
    104103          Invoke(new Action(() => {
     
    182181    }
    183182
    184     private Optimization.IRun ConvertToOptimizationRun(Run run, bool deserialize) {
     183    private Optimization.IRun ConvertToOptimizationRun(Run run) {
    185184      Optimization.Run optRun = new Optimization.Run();
    186185      foreach (Value value in run.ParameterValues)
    187         optRun.Parameters.Add(value.Name, ConvertToItem(value, deserialize));
     186        optRun.Parameters.Add(value.Name, ConvertToItem(value));
    188187      foreach (Value value in run.ResultValues)
    189         optRun.Results.Add(value.Name, ConvertToItem(value, deserialize));
     188        optRun.Results.Add(value.Name, ConvertToItem(value));
    190189      return optRun;
    191190    }
    192191
    193     private IItem ConvertToItem(Value value, bool deserialize) {
     192    private IItem ConvertToItem(Value value) {
    194193      if (value is BinaryValue) {
    195         if (deserialize) {
    196           IItem item = null;
    197           using (MemoryStream stream = new MemoryStream(((BinaryValue)value).Value)) {
     194        IItem item = null;
     195        BinaryValue binaryValue = (BinaryValue)value;
     196        if (binaryValue.Value != null) {
     197          using (MemoryStream stream = new MemoryStream(binaryValue.Value)) {
    198198            try {
    199199              item = XmlParser.Deserialize<IItem>(stream);
     
    202202            stream.Close();
    203203          }
    204           return item != null ? item : new Data.StringValue(value.DataType.Name);
    205         } else {
    206           return new Data.StringValue(value.DataType.Name);
    207204        }
     205        return item != null ? item : new Data.StringValue(value.DataType.Name);
    208206      } else if (value is BoolValue) {
    209207        return new Data.BoolValue(((BoolValue)value).Value);
Note: See TracChangeset for help on using the changeset viewer.