Changeset 5902 for branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/Query/Views/QueryView.cs
- Timestamp:
- 03/31/11 03:24:02 (13 years ago)
- 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 3 3 *.user 4 4 HeuristicLabClientsOKBPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/Query/Views/QueryView.cs
r5674 r5902 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 0Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 75 75 private void LoadResultsAsync(int batchSize) { 76 76 bool includeBinaryValues = includeBinaryValuesCheckBox.Checked; 77 bool deserialize = deserializeBlobsCheckBox.Checked;78 77 79 78 Cursor = Cursors.AppStarting; … … 100 99 while (ids.Count() > 0) { 101 100 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))); 103 102 ids = ids.Skip(batchSize); 104 103 Invoke(new Action(() => { … … 182 181 } 183 182 184 private Optimization.IRun ConvertToOptimizationRun(Run run , bool deserialize) {183 private Optimization.IRun ConvertToOptimizationRun(Run run) { 185 184 Optimization.Run optRun = new Optimization.Run(); 186 185 foreach (Value value in run.ParameterValues) 187 optRun.Parameters.Add(value.Name, ConvertToItem(value , deserialize));186 optRun.Parameters.Add(value.Name, ConvertToItem(value)); 188 187 foreach (Value value in run.ResultValues) 189 optRun.Results.Add(value.Name, ConvertToItem(value , deserialize));188 optRun.Results.Add(value.Name, ConvertToItem(value)); 190 189 return optRun; 191 190 } 192 191 193 private IItem ConvertToItem(Value value , bool deserialize) {192 private IItem ConvertToItem(Value value) { 194 193 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)) { 198 198 try { 199 199 item = XmlParser.Deserialize<IItem>(stream); … … 202 202 stream.Close(); 203 203 } 204 return item != null ? item : new Data.StringValue(value.DataType.Name);205 } else {206 return new Data.StringValue(value.DataType.Name);207 204 } 205 return item != null ? item : new Data.StringValue(value.DataType.Name); 208 206 } else if (value is BoolValue) { 209 207 return new Data.BoolValue(((BoolValue)value).Value);
Note: See TracChangeset
for help on using the changeset viewer.