Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/28/17 22:14:18 (7 years ago)
Author:
gkronber
Message:

#2588 merged r13682, r13683, r13684, r13690:13693, r13709, r13746 from trunk to stable

Location:
stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Clients.OKB/3.3/RunCreation/OKBProblem.cs

    r14186 r15082  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Drawing;
    25 using System.IO;
    2622using HeuristicLab.Common;
    2723using HeuristicLab.Core;
     
    2925using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3026using HeuristicLab.Persistence.Default.Xml;
     27using System;
     28using System.Collections.Generic;
     29using System.Drawing;
     30using System.IO;
     31using System.Linq;
    3132
    3233namespace HeuristicLab.Clients.OKB.RunCreation {
     
    6364            OnOperatorsChanged();
    6465            OnReset();
     66
     67            solutions.Clear();
    6568          }
    6669        }
    6770      }
     71    }
     72
     73    [Storable]
     74    private ItemList<OKBSolution> solutions;
     75    public ItemList<OKBSolution> Solutions {
     76      get { return solutions; }
    6877    }
    6978
     
    135144      problemId = original.problemId;
    136145      problem = cloner.Clone(original.problem);
     146      solutions = cloner.Clone(original.solutions);
    137147      RegisterProblemEvents();
    138148    }
     
    142152      problemId = -1;
    143153      problem = initialProblem;
     154      solutions = new ItemList<OKBSolution>();
    144155      RegisterProblemEvents();
    145156    }
     
    148159      if (this.problemId != problemId) {
    149160        IHeuristicOptimizationProblem problem;
    150         byte[] problemData = RunCreationClient.GetProblemData(problemId);
     161        byte[] problemData = RunCreationClient.Instance.GetProblemData(problemId);
    151162        using (MemoryStream stream = new MemoryStream(problemData)) {
    152163          problem = XmlParser.Deserialize<IHeuristicOptimizationProblem>(stream);
     
    157168        }
    158169      }
     170    }
     171
     172    public void RefreshSolutions() {
     173      if (ProblemId != -1) {
     174        var sols = RunCreationClient.Instance.GetSolutions(ProblemId).Select(OKBSolution.Convert).ToList();
     175        foreach (var sol in sols) sol.DownloadData();
     176        Solutions.Replace(sols);
     177      } else Solutions.Clear();
    159178    }
    160179
Note: See TracChangeset for help on using the changeset viewer.