Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/21/10 23:55:23 (14 years ago)
Author:
swagner
Message:

Implemented import of optimal TSP solutions (#924).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.TSP.Views/3.3/TSPView.cs

    r2998 r3151  
    3333  [Content(typeof(TSP), true)]
    3434  public sealed partial class TSPView : ProblemView {
     35    private TSPLIBImportDialog tsplibImportDialog;
     36
    3537    public new TSP Content {
    3638      get { return (TSP)base.Content; }
     
    6365
    6466    private void importButton_Click(object sender, System.EventArgs e) {
    65       if (openFileDialog.ShowDialog(this) == DialogResult.OK) {
     67      if (tsplibImportDialog == null) tsplibImportDialog = new TSPLIBImportDialog();
     68
     69      if (tsplibImportDialog.ShowDialog(this) == DialogResult.OK) {
    6670        try {
    67           Content.ImportFromTSPLIB(openFileDialog.FileName);
     71          if (tsplibImportDialog.Quality == null)
     72            Content.ImportFromTSPLIB(tsplibImportDialog.TSPFileName, tsplibImportDialog.TourFileName);
     73          else
     74            Content.ImportFromTSPLIB(tsplibImportDialog.TSPFileName, tsplibImportDialog.TourFileName, (double)tsplibImportDialog.Quality);
    6875        }
    6976        catch (Exception ex) {
Note: See TracChangeset for help on using the changeset viewer.