Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/13/12 15:33:19 (12 years ago)
Author:
sforsten
Message:

#1784:

  • added export button and corrected the LoadData in RegressionInstanceProvider
  • added RegressionProblemView
Location:
branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Optimization.Views/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Optimization.Views/3.3/HeuristicLab.Optimization.Views-3.3.csproj

    r7558 r7610  
    5050    <DebugType>pdbonly</DebugType>
    5151    <Optimize>true</Optimize>
    52     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     52    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    5353    <DefineConstants>TRACE</DefineConstants>
    5454    <ErrorReport>prompt</ErrorReport>
     
    9999  </PropertyGroup>
    100100  <ItemGroup>
     101    <Reference Include="HeuristicLab.Collections-3.3">
     102      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
     103    </Reference>
     104    <Reference Include="HeuristicLab.Common-3.3">
     105      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
     106    </Reference>
     107    <Reference Include="HeuristicLab.Common.Resources-3.3">
     108      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath>
     109    </Reference>
     110    <Reference Include="HeuristicLab.Core-3.3">
     111      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
     112    </Reference>
     113    <Reference Include="HeuristicLab.Core.Views-3.3">
     114      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core.Views-3.3.dll</HintPath>
     115    </Reference>
     116    <Reference Include="HeuristicLab.Data-3.3">
     117      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
     118    </Reference>
     119    <Reference Include="HeuristicLab.Data.Views-3.3">
     120      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data.Views-3.3.dll</HintPath>
     121    </Reference>
     122    <Reference Include="HeuristicLab.MainForm-3.3">
     123      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.MainForm-3.3.dll</HintPath>
     124    </Reference>
     125    <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3">
     126      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
     127    </Reference>
     128    <Reference Include="HeuristicLab.Optimization-3.3">
     129      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
     130    </Reference>
     131    <Reference Include="HeuristicLab.Persistence-3.3">
     132      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
     133    </Reference>
     134    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
     135      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
     136    </Reference>
     137    <Reference Include="HeuristicLab.Visualization.ChartControlsExtensions-3.3">
     138      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Visualization.ChartControlsExtensions-3.3.dll</HintPath>
     139    </Reference>
    101140    <Reference Include="Microsoft.CSharp" />
    102141    <Reference Include="System" />
     
    115154    <Reference Include="System.Data" />
    116155    <Reference Include="System.Xml" />
    117     <Reference Include="WeifenLuo.WinFormsUI.Docking-2.3.1, Version=2.3.1.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" />
     156    <Reference Include="WeifenLuo.WinFormsUI.Docking-2.3.1">
     157      <HintPath>..\..\..\..\trunk\sources\bin\WeifenLuo.WinFormsUI.Docking-2.3.1.dll</HintPath>
     158    </Reference>
    118159  </ItemGroup>
    119160  <ItemGroup>
     
    289330  </ItemGroup>
    290331  <ItemGroup>
    291     <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
    292       <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
    293       <Name>HeuristicLab.Collections-3.3</Name>
    294       <Private>False</Private>
    295     </ProjectReference>
    296     <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
    297       <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>
    298       <Name>HeuristicLab.Common.Resources-3.3</Name>
    299       <Private>False</Private>
    300     </ProjectReference>
    301     <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
    302       <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
    303       <Name>HeuristicLab.Common-3.3</Name>
    304       <Private>False</Private>
    305     </ProjectReference>
    306     <ProjectReference Include="..\..\HeuristicLab.Core.Views\3.3\HeuristicLab.Core.Views-3.3.csproj">
    307       <Project>{E226881D-315F-423D-B419-A766FE0D8685}</Project>
    308       <Name>HeuristicLab.Core.Views-3.3</Name>
    309       <Private>False</Private>
    310     </ProjectReference>
    311     <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
    312       <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
    313       <Name>HeuristicLab.Core-3.3</Name>
    314       <Private>False</Private>
    315     </ProjectReference>
    316     <ProjectReference Include="..\..\HeuristicLab.Data.Views\3.3\HeuristicLab.Data.Views-3.3.csproj">
    317       <Project>{72104A0B-90E7-42F3-9ABE-9BBBADD4B943}</Project>
    318       <Name>HeuristicLab.Data.Views-3.3</Name>
    319       <Private>False</Private>
    320     </ProjectReference>
    321     <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
    322       <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
    323       <Name>HeuristicLab.Data-3.3</Name>
    324       <Private>False</Private>
    325     </ProjectReference>
    326     <ProjectReference Include="..\..\HeuristicLab.MainForm.WindowsForms\3.3\HeuristicLab.MainForm.WindowsForms-3.3.csproj">
    327       <Project>{AB687BBE-1BFE-476B-906D-44237135431D}</Project>
    328       <Name>HeuristicLab.MainForm.WindowsForms-3.3</Name>
    329       <Private>False</Private>
    330     </ProjectReference>
    331     <ProjectReference Include="..\..\HeuristicLab.MainForm\3.3\HeuristicLab.MainForm-3.3.csproj">
    332       <Project>{3BD61258-31DA-4B09-89C0-4F71FEF5F05A}</Project>
    333       <Name>HeuristicLab.MainForm-3.3</Name>
    334       <Private>False</Private>
    335     </ProjectReference>
    336     <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
    337       <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
    338       <Name>HeuristicLab.Optimization-3.3</Name>
    339       <Private>False</Private>
    340     </ProjectReference>
    341     <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
    342       <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
    343       <Name>HeuristicLab.Persistence-3.3</Name>
    344       <Private>False</Private>
    345     </ProjectReference>
    346     <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
    347       <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
    348       <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
    349       <Private>False</Private>
    350     </ProjectReference>
    351332    <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj">
    352333      <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project>
    353334      <Name>HeuristicLab.Problems.Instances-3.3</Name>
    354     </ProjectReference>
    355     <ProjectReference Include="..\..\HeuristicLab.Visualization.ChartControlsExtensions\3.3\HeuristicLab.Visualization.ChartControlsExtensions-3.3.csproj">
    356       <Project>{315BDA09-3F4F-49B3-9790-B37CFC1C5750}</Project>
    357       <Name>HeuristicLab.Visualization.ChartControlsExtensions-3.3</Name>
    358       <Private>False</Private>
    359335    </ProjectReference>
    360336  </ItemGroup>
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Optimization.Views/3.3/ProblemInstanceProviderView.Designer.cs

    r7558 r7610  
    5252      this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
    5353      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
     54      this.exportButton = new System.Windows.Forms.Button();
     55      this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
    5456      this.SuspendLayout();
    5557      //
     
    5759      //
    5860      this.loadButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    59       this.loadButton.Location = new System.Drawing.Point(549, -1);
     61      this.loadButton.Location = new System.Drawing.Point(601, -1);
    6062      this.loadButton.Name = "loadButton";
    6163      this.loadButton.Size = new System.Drawing.Size(26, 23);
     
    7678      // instancesComboBox
    7779      //
    78       this.instancesComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
     80      this.instancesComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    7981            | System.Windows.Forms.AnchorStyles.Right)));
    8082      this.instancesComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     
    8284      this.instancesComboBox.Location = new System.Drawing.Point(54, 0);
    8385      this.instancesComboBox.Name = "instancesComboBox";
    84       this.instancesComboBox.Size = new System.Drawing.Size(489, 21);
     86      this.instancesComboBox.Size = new System.Drawing.Size(541, 21);
    8587      this.instancesComboBox.TabIndex = 7;
    8688      this.instancesComboBox.DataSourceChanged += new System.EventHandler(this.comboBox_DataSourceChanged);
     
    8991      //
    9092      this.importButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    91       this.importButton.Location = new System.Drawing.Point(581, -1);
     93      this.importButton.Location = new System.Drawing.Point(633, -1);
    9294      this.importButton.Name = "importButton";
    9395      this.importButton.Size = new System.Drawing.Size(26, 23);
     
    102104      this.openFileDialog.Filter = "All files|*.*";
    103105      //
     106      // exportButton
     107      //
     108      this.exportButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     109      this.exportButton.Location = new System.Drawing.Point(665, -1);
     110      this.exportButton.Name = "exportButton";
     111      this.exportButton.Size = new System.Drawing.Size(26, 23);
     112      this.exportButton.TabIndex = 8;
     113      this.exportButton.Text = "Export";
     114      this.exportButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
     115      this.exportButton.UseVisualStyleBackColor = true;
     116      this.exportButton.Click += new System.EventHandler(this.exportButton_Click);
     117      //
     118      // saveFileDialog
     119      //
     120      this.saveFileDialog.Filter = "CSV files|*.csv|All files|*.*";
     121      this.saveFileDialog.Title = "Save RegressionInstance...";
     122      //
    104123      // ProblemInstanceProviderView
    105124      //
    106125      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    107126      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     127      this.Controls.Add(this.exportButton);
    108128      this.Controls.Add(this.instancesComboBox);
    109129      this.Controls.Add(this.importButton);
     
    111131      this.Controls.Add(this.instanceLabel);
    112132      this.Name = "ProblemInstanceProviderView";
    113       this.Size = new System.Drawing.Size(610, 21);
     133      this.Size = new System.Drawing.Size(694, 21);
    114134      this.ResumeLayout(false);
    115135      this.PerformLayout();
     
    125145    protected System.Windows.Forms.ComboBox instancesComboBox;
    126146    protected System.Windows.Forms.Button importButton;
     147    protected System.Windows.Forms.Button exportButton;
     148    private System.Windows.Forms.SaveFileDialog saveFileDialog;
    127149
    128150  }
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Optimization.Views/3.3/ProblemInstanceProviderView.cs

    r7558 r7610  
    2727using HeuristicLab.MainForm;
    2828using HeuristicLab.MainForm.WindowsForms;
     29using HeuristicLab.PluginInfrastructure;
    2930using HeuristicLab.Problems.Instances;
    3031
     
    4445      importButton.Image = VSImageLibrary.Open;
    4546      toolTip.SetToolTip(importButton, "Import a " + GetProblemType() + " instance from file.");
     47      exportButton.Text = String.Empty;
     48      exportButton.Image = VSImageLibrary.Save;
     49      toolTip.SetToolTip(exportButton, "Export a " + GetProblemType() + " instance to a file.");
    4650      loadButton.Text = String.Empty;
    4751      loadButton.Image = VSImageLibrary.Checkout;
     
    7074      try {
    7175        Content.Consumer.Load(instance);
    72       } catch (Exception ex) {
     76      }
     77      catch (Exception ex) {
    7378        MessageBox.Show(String.Format("This problem does not support loading the instance {0}: {1}", descriptor.Name, Environment.NewLine + ex.Message), "Cannot load instance");
    7479      }
     
    8186        try {
    8287          instance = Content.LoadData(openFileDialog.FileName);
    83         } catch (Exception ex) {
     88        }
     89        catch (Exception ex) {
    8490          MessageBox.Show(String.Format("There was an error parsing the file: {0}", Environment.NewLine + ex.Message), "Error while parsing", MessageBoxButtons.OK, MessageBoxIcon.Error);
    8591          return;
     
    8793        try {
    8894          Content.Consumer.Load(instance);
    89         } catch (Exception ex) {
     95        }
     96        catch (Exception ex) {
    9097          MessageBox.Show(String.Format("This problem does not support loading the instance {0}: {1}", Path.GetFileName(openFileDialog.FileName), Environment.NewLine + ex.Message), "Cannot load instance");
     98        }
     99      }
     100    }
     101
     102    protected virtual void exportButton_Click(object sender, EventArgs e) {
     103      if (saveFileDialog.ShowDialog(this) == DialogResult.OK) {
     104        try {
     105          var descriptor = (IDataDescriptor)instancesComboBox.SelectedItem;
     106          var instance = Content.LoadData(descriptor);
     107          Content.SaveData(instance, saveFileDialog.FileName);
     108        }
     109        catch (Exception ex) {
     110          ErrorHandling.ShowErrorDialog(this, ex);
    91111        }
    92112      }
Note: See TracChangeset for help on using the changeset viewer.