Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/06/12 01:43:06 (12 years ago)
Author:
abeham
Message:

#1782: trunk integration of problem instance development

  • Adapted TSP and QAP to use the new feature
  • Moved the TSPLIB importer dialog from the TSP plugin to the TSPLIB instances plugin (created a view for that provider)
  • Created it as a default view for IHeuristicOptimizationProblem in order not to interfere with other problems do not yet work with this
Location:
trunk/sources/HeuristicLab.Problems.TravelingSalesman.Views/3.3
Files:
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.TravelingSalesman.Views/3.3/HeuristicLab.Problems.TravelingSalesman.Views-3.3.csproj

    r6866 r7558  
    128128      <DependentUpon>TravelingSalesmanProblemView.cs</DependentUpon>
    129129    </Compile>
    130     <Compile Include="TSPLIBImportDialog.cs">
    131       <SubType>Form</SubType>
    132     </Compile>
    133     <Compile Include="TSPLIBImportDialog.Designer.cs">
    134       <DependentUpon>TSPLIBImportDialog.cs</DependentUpon>
    135     </Compile>
    136130    <Compile Include="Properties\AssemblyInfo.cs" />
    137131  </ItemGroup>
     
    147141      <Private>False</Private>
    148142    </ProjectReference>
    149     <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
    150       <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>
    151       <Name>HeuristicLab.Common.Resources-3.3</Name>
    152       <Private>False</Private>
    153     </ProjectReference>
    154143    <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
    155144      <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
     
    206195      <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
    207196      <Private>False</Private>
     197    </ProjectReference>
     198    <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj">
     199      <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project>
     200      <Name>HeuristicLab.Problems.Instances-3.3</Name>
    208201    </ProjectReference>
    209202    <ProjectReference Include="..\..\HeuristicLab.Problems.TravelingSalesman\3.3\HeuristicLab.Problems.TravelingSalesman-3.3.csproj">
  • trunk/sources/HeuristicLab.Problems.TravelingSalesman.Views/3.3/Plugin.cs.frame

    r7259 r7558  
    2929  [PluginFile("HeuristicLab.Problems.TravelingSalesman.Views-3.3.dll", PluginFileType.Assembly)]
    3030  [PluginDependency("HeuristicLab.Common", "3.3")]
    31   [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
    3231  [PluginDependency("HeuristicLab.Core", "3.3")]
    3332  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
     
    3736  [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
    3837  [PluginDependency("HeuristicLab.Optimization", "3.3")]
     38  [PluginDependency("HeuristicLab.Optimization.Views", "3.3")]
    3939  [PluginDependency("HeuristicLab.Parameters", "3.3")]
    4040  [PluginDependency("HeuristicLab.Problems.TravelingSalesman", "3.3")]
  • trunk/sources/HeuristicLab.Problems.TravelingSalesman.Views/3.3/TravelingSalesmanProblemView.Designer.cs

    r7259 r7558  
    2727    private System.ComponentModel.IContainer components = null;
    2828
     29    protected override void Dispose(bool disposing) {
     30      if (disposing) {
     31        if (components != null) components.Dispose();
     32      }
     33      base.Dispose(disposing);
     34    }
     35
    2936    #region Component Designer generated code
    3037
     
    3441    /// </summary>
    3542    private void InitializeComponent() {
    36       this.importButton = new System.Windows.Forms.Button();
    3743      this.tabControl = new HeuristicLab.MainForm.WindowsForms.DragOverTabControl();
    3844      this.parametersTabPage = new System.Windows.Forms.TabPage();
    39       this.parameterCollectionView = new HeuristicLab.Core.Views.ParameterCollectionView();
    4045      this.visualizationTabPage = new System.Windows.Forms.TabPage();
    4146      this.pathTSPTourView = new HeuristicLab.Problems.TravelingSalesman.Views.PathTSPTourView();
     
    4651      this.SuspendLayout();
    4752      //
     53      // problemInstanceProviderViewHost
     54      //
     55      this.problemInstanceProviderViewHost.Size = new System.Drawing.Size(270, 21);
     56      //
     57      // parameterCollectionView
     58      //
     59      this.parameterCollectionView.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)));
     60      this.parameterCollectionView.Dock = System.Windows.Forms.DockStyle.Fill;
     61      this.parameterCollectionView.Location = new System.Drawing.Point(3, 3);
     62      this.parameterCollectionView.Size = new System.Drawing.Size(515, 332);
     63      //
    4864      // nameTextBox
    4965      //
    5066      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    5167      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
    52       this.nameTextBox.Location = new System.Drawing.Point(58, 0);
    53       this.nameTextBox.Size = new System.Drawing.Size(446, 20);
     68      this.nameTextBox.Size = new System.Drawing.Size(454, 20);
    5469      //
    5570      // infoLabel
    5671      //
    57       this.infoLabel.Location = new System.Drawing.Point(510, 3);
    58       //
    59       // importButton
    60       //
    61       this.importButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    62                   | System.Windows.Forms.AnchorStyles.Right)));
    63       this.importButton.Location = new System.Drawing.Point(0, 26);
    64       this.importButton.Name = "importButton";
    65       this.importButton.Size = new System.Drawing.Size(529, 23);
    66       this.importButton.TabIndex = 3;
    67       this.importButton.Text = "&Import from TSPLIB";
    68       this.importButton.UseVisualStyleBackColor = true;
    69       this.importButton.Click += new System.EventHandler(this.importButton_Click);
     72      this.infoLabel.Location = new System.Drawing.Point(510, 35);
    7073      //
    7174      // tabControl
    7275      //
    7376      this.tabControl.AllowDrop = true;
    74       this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    75                   | System.Windows.Forms.AnchorStyles.Left)
    76                   | System.Windows.Forms.AnchorStyles.Right)));
     77      this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     78            | System.Windows.Forms.AnchorStyles.Left)
     79            | System.Windows.Forms.AnchorStyles.Right)));
    7780      this.tabControl.Controls.Add(this.parametersTabPage);
    7881      this.tabControl.Controls.Add(this.visualizationTabPage);
    79       this.tabControl.Location = new System.Drawing.Point(0, 55);
     82      this.tabControl.Location = new System.Drawing.Point(0, 58);
    8083      this.tabControl.Name = "tabControl";
    8184      this.tabControl.SelectedIndex = 0;
    82       this.tabControl.Size = new System.Drawing.Size(529, 367);
     85      this.tabControl.Size = new System.Drawing.Size(529, 364);
    8386      this.tabControl.TabIndex = 4;
    8487      //
     
    8992      this.parametersTabPage.Name = "parametersTabPage";
    9093      this.parametersTabPage.Padding = new System.Windows.Forms.Padding(3);
    91       this.parametersTabPage.Size = new System.Drawing.Size(521, 315);
     94      this.parametersTabPage.Size = new System.Drawing.Size(521, 338);
    9295      this.parametersTabPage.TabIndex = 0;
    9396      this.parametersTabPage.Text = "Parameters";
    9497      this.parametersTabPage.UseVisualStyleBackColor = true;
    95       //
    96       // parameterCollectionView
    97       //
    98       this.parameterCollectionView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    99                   | System.Windows.Forms.AnchorStyles.Left)
    100                   | System.Windows.Forms.AnchorStyles.Right)));
    101       this.parameterCollectionView.Caption = "ParameterCollection View";
    102       this.parameterCollectionView.Content = null;
    103       this.parameterCollectionView.Location = new System.Drawing.Point(6, 6);
    104       this.parameterCollectionView.Name = "parameterCollectionView";
    105       this.parameterCollectionView.ReadOnly = false;
    106       this.parameterCollectionView.Size = new System.Drawing.Size(509, 303);
    107       this.parameterCollectionView.TabIndex = 0;
    10898      //
    10999      // visualizationTabPage
     
    113103      this.visualizationTabPage.Name = "visualizationTabPage";
    114104      this.visualizationTabPage.Padding = new System.Windows.Forms.Padding(3);
    115       this.visualizationTabPage.Size = new System.Drawing.Size(521, 341);
     105      this.visualizationTabPage.Size = new System.Drawing.Size(521, 338);
    116106      this.visualizationTabPage.TabIndex = 1;
    117107      this.visualizationTabPage.Text = "Visualization";
     
    120110      // pathTSPTourView
    121111      //
    122       this.pathTSPTourView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    123                   | System.Windows.Forms.AnchorStyles.Left)
    124                   | System.Windows.Forms.AnchorStyles.Right)));
     112      this.pathTSPTourView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     113            | System.Windows.Forms.AnchorStyles.Left)
     114            | System.Windows.Forms.AnchorStyles.Right)));
    125115      this.pathTSPTourView.Caption = "PathTSPTour View";
    126116      this.pathTSPTourView.Content = null;
     
    136126      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    137127      this.Controls.Add(this.tabControl);
    138       this.Controls.Add(this.importButton);
    139128      this.Name = "TravelingSalesmanProblemView";
    140129      this.Size = new System.Drawing.Size(529, 422);
     130      this.Controls.SetChildIndex(this.libraryInfoButton, 0);
     131      this.Controls.SetChildIndex(this.libraryLabel, 0);
     132      this.Controls.SetChildIndex(this.problemInstanceProviderComboBox, 0);
     133      this.Controls.SetChildIndex(this.problemInstanceProviderViewHost, 0);
    141134      this.Controls.SetChildIndex(this.infoLabel, 0);
    142       this.Controls.SetChildIndex(this.importButton, 0);
    143135      this.Controls.SetChildIndex(this.nameTextBox, 0);
    144136      this.Controls.SetChildIndex(this.tabControl, 0);
     
    155147    #endregion
    156148
    157     private System.Windows.Forms.Button importButton;
    158149    private HeuristicLab.MainForm.WindowsForms.DragOverTabControl tabControl;
    159150    private System.Windows.Forms.TabPage parametersTabPage;
    160151    private System.Windows.Forms.TabPage visualizationTabPage;
    161     private HeuristicLab.Core.Views.ParameterCollectionView parameterCollectionView;
    162152    private PathTSPTourView pathTSPTourView;
    163 
    164153  }
    165154}
  • trunk/sources/HeuristicLab.Problems.TravelingSalesman.Views/3.3/TravelingSalesmanProblemView.cs

    r7259 r7558  
    2222using System;
    2323using System.Windows.Forms;
    24 using HeuristicLab.Core;
    25 using HeuristicLab.Core.Views;
    2624using HeuristicLab.MainForm;
    27 using HeuristicLab.PluginInfrastructure;
     25using HeuristicLab.Optimization.Views;
    2826
    2927namespace HeuristicLab.Problems.TravelingSalesman.Views {
     
    3331  [View("Traveling Salesman Problem View")]
    3432  [Content(typeof(TravelingSalesmanProblem), true)]
    35   public sealed partial class TravelingSalesmanProblemView : NamedItemView {
    36     private TSPLIBImportDialog tsplibImportDialog;
    37 
     33  public sealed partial class TravelingSalesmanProblemView : HeuristicOptimizationProblemView {
    3834    public new TravelingSalesmanProblem Content {
    3935      get { return (TravelingSalesmanProblem)base.Content; }
     
    4642    public TravelingSalesmanProblemView() {
    4743      InitializeComponent();
    48     }
    49 
    50     protected override void Dispose(bool disposing) {
    51       if (disposing) {
    52         if (tsplibImportDialog != null) tsplibImportDialog.Dispose();
    53         if (components != null) components.Dispose();
    54       }
    55       base.Dispose(disposing);
    5644    }
    5745
     
    7260      base.OnContentChanged();
    7361      if (Content == null) {
    74         parameterCollectionView.Content = null;
    7562        pathTSPTourView.Content = null;
    7663      } else {
    77         parameterCollectionView.Content = ((IParameterizedNamedItem)Content).Parameters;
    7864        pathTSPTourView.Content = new PathTSPTour(Content.Coordinates, Content.BestKnownSolution, Content.BestKnownQuality);
    7965      }
     
    8268    protected override void SetEnabledStateOfControls() {
    8369      base.SetEnabledStateOfControls();
    84       parameterCollectionView.Enabled = Content != null;
    8570      pathTSPTourView.Enabled = Content != null;
    86       importButton.Enabled = Content != null && !ReadOnly;
    87     }
    88 
    89     private void importButton_Click(object sender, System.EventArgs e) {
    90       if (tsplibImportDialog == null) tsplibImportDialog = new TSPLIBImportDialog();
    91 
    92       if (tsplibImportDialog.ShowDialog(this) == DialogResult.OK) {
    93         try {
    94           if (tsplibImportDialog.Quality == null)
    95             Content.ImportFromTSPLIB(tsplibImportDialog.TSPFileName, tsplibImportDialog.TourFileName);
    96           else
    97             Content.ImportFromTSPLIB(tsplibImportDialog.TSPFileName, tsplibImportDialog.TourFileName, (double)tsplibImportDialog.Quality);
    98         }
    99         catch (Exception ex) {
    100           ErrorHandling.ShowErrorDialog(this, ex);
    101         }
    102       }
    10371    }
    10472
Note: See TracChangeset for help on using the changeset viewer.