Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8693 for trunk/sources


Ignore:
Timestamp:
09/25/12 10:57:42 (12 years ago)
Author:
sforsten
Message:

#1942:

  • fixed type "Shuffel"
  • removed icon and control box
Location:
trunk/sources
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisImportTypeDialog.Designer.cs

    r8601 r8693  
    2424    /// </summary>
    2525    private void InitializeComponent() {
    26       this.ShuffelDataCheckbox = new System.Windows.Forms.CheckBox();
     26      this.ShuffleDataCheckbox = new System.Windows.Forms.CheckBox();
    2727      this.OkButton = new System.Windows.Forms.Button();
    28       this.CancelButton = new System.Windows.Forms.Button();
    2928      this.TrainingTestTrackBar = new System.Windows.Forms.TrackBar();
    3029      this.TrainingTestGroupBox = new System.Windows.Forms.GroupBox();
    3130      this.TestLabel = new System.Windows.Forms.Label();
    3231      this.TrainingLabel = new System.Windows.Forms.Label();
     32      this.CancelButton = new System.Windows.Forms.Button();
     33      this.openFileButton = new System.Windows.Forms.Button();
     34      this.ProblemFileLabel = new System.Windows.Forms.Label();
     35      this.ProblemTextBox = new System.Windows.Forms.TextBox();
     36      this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
    3337      ((System.ComponentModel.ISupportInitialize)(this.TrainingTestTrackBar)).BeginInit();
    3438      this.TrainingTestGroupBox.SuspendLayout();
    3539      this.SuspendLayout();
    3640      //
    37       // ShuffelDataCheckbox
     41      // ShuffleDataCheckbox
    3842      //
    39       this.ShuffelDataCheckbox.AutoSize = true;
    40       this.ShuffelDataCheckbox.Location = new System.Drawing.Point(18, 12);
    41       this.ShuffelDataCheckbox.Name = "ShuffelDataCheckbox";
    42       this.ShuffelDataCheckbox.Size = new System.Drawing.Size(91, 17);
    43       this.ShuffelDataCheckbox.TabIndex = 1;
    44       this.ShuffelDataCheckbox.Text = "Shuffel Data?";
    45       this.ShuffelDataCheckbox.UseVisualStyleBackColor = true;
     43      this.ShuffleDataCheckbox.AutoSize = true;
     44      this.ShuffleDataCheckbox.Location = new System.Drawing.Point(12, 38);
     45      this.ShuffleDataCheckbox.Name = "ShuffleDataCheckbox";
     46      this.ShuffleDataCheckbox.Size = new System.Drawing.Size(91, 17);
     47      this.ShuffleDataCheckbox.TabIndex = 1;
     48      this.ShuffleDataCheckbox.Text = "Shuffle Data?";
     49      this.ShuffleDataCheckbox.UseVisualStyleBackColor = true;
    4650      //
    4751      // OkButton
    4852      //
    4953      this.OkButton.DialogResult = System.Windows.Forms.DialogResult.OK;
    50       this.OkButton.Location = new System.Drawing.Point(18, 121);
     54      this.OkButton.Enabled = false;
     55      this.OkButton.Location = new System.Drawing.Point(61, 147);
    5156      this.OkButton.Name = "OkButton";
    5257      this.OkButton.Size = new System.Drawing.Size(75, 23);
     
    5560      this.OkButton.UseVisualStyleBackColor = true;
    5661      //
    57       // CancelButton
    58       //
    59       this.CancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
    60       this.CancelButton.Location = new System.Drawing.Point(142, 121);
    61       this.CancelButton.Name = "CancelButton";
    62       this.CancelButton.Size = new System.Drawing.Size(75, 23);
    63       this.CancelButton.TabIndex = 3;
    64       this.CancelButton.Text = "&Cancel";
    65       this.CancelButton.UseVisualStyleBackColor = true;
    66       //
    6762      // TrainingTestTrackBar
    6863      //
     64      this.TrainingTestTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     65                  | System.Windows.Forms.AnchorStyles.Right)));
    6966      this.TrainingTestTrackBar.Location = new System.Drawing.Point(6, 19);
    7067      this.TrainingTestTrackBar.Maximum = 100;
    7168      this.TrainingTestTrackBar.Minimum = 1;
    7269      this.TrainingTestTrackBar.Name = "TrainingTestTrackBar";
    73       this.TrainingTestTrackBar.Size = new System.Drawing.Size(210, 45);
     70      this.TrainingTestTrackBar.Size = new System.Drawing.Size(303, 45);
    7471      this.TrainingTestTrackBar.TabIndex = 4;
    7572      this.TrainingTestTrackBar.TickStyle = System.Windows.Forms.TickStyle.None;
     
    8279      this.TrainingTestGroupBox.Controls.Add(this.TrainingLabel);
    8380      this.TrainingTestGroupBox.Controls.Add(this.TrainingTestTrackBar);
    84       this.TrainingTestGroupBox.Location = new System.Drawing.Point(4, 35);
     81      this.TrainingTestGroupBox.Location = new System.Drawing.Point(12, 61);
    8582      this.TrainingTestGroupBox.Name = "TrainingTestGroupBox";
    86       this.TrainingTestGroupBox.Size = new System.Drawing.Size(222, 80);
     83      this.TrainingTestGroupBox.Size = new System.Drawing.Size(315, 80);
    8784      this.TrainingTestGroupBox.TabIndex = 5;
    8885      this.TrainingTestGroupBox.TabStop = false;
     
    9289      //
    9390      this.TestLabel.AutoSize = true;
    94       this.TestLabel.Location = new System.Drawing.Point(108, 51);
     91      this.TestLabel.Location = new System.Drawing.Point(188, 51);
    9592      this.TestLabel.Name = "TestLabel";
    9693      this.TestLabel.Size = new System.Drawing.Size(57, 13);
     
    10198      //
    10299      this.TrainingLabel.AutoSize = true;
    103       this.TrainingLabel.Location = new System.Drawing.Point(11, 51);
     100      this.TrainingLabel.Location = new System.Drawing.Point(50, 51);
    104101      this.TrainingLabel.Name = "TrainingLabel";
    105102      this.TrainingLabel.Size = new System.Drawing.Size(74, 13);
     
    107104      this.TrainingLabel.Text = "Training: 66 %";
    108105      //
     106      // CancelButton
     107      //
     108      this.CancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
     109      this.CancelButton.Location = new System.Drawing.Point(182, 147);
     110      this.CancelButton.Name = "CancelButton";
     111      this.CancelButton.Size = new System.Drawing.Size(75, 23);
     112      this.CancelButton.TabIndex = 3;
     113      this.CancelButton.Text = "&Cancel";
     114      this.CancelButton.UseVisualStyleBackColor = true;
     115      //
     116      // openFileButton
     117      //
     118      this.openFileButton.Location = new System.Drawing.Point(303, 12);
     119      this.openFileButton.Name = "openFileButton";
     120      this.openFileButton.Size = new System.Drawing.Size(24, 24);
     121      this.openFileButton.TabIndex = 8;
     122      this.openFileButton.UseVisualStyleBackColor = true;
     123      this.openFileButton.Click += new System.EventHandler(this.openFileButton_Click);
     124      //
     125      // ProblemFileLabel
     126      //
     127      this.ProblemFileLabel.AutoSize = true;
     128      this.ProblemFileLabel.Location = new System.Drawing.Point(12, 15);
     129      this.ProblemFileLabel.Name = "ProblemFileLabel";
     130      this.ProblemFileLabel.Size = new System.Drawing.Size(67, 13);
     131      this.ProblemFileLabel.TabIndex = 6;
     132      this.ProblemFileLabel.Text = "Problem File:";
     133      //
     134      // ProblemTextBox
     135      //
     136      this.ProblemTextBox.Location = new System.Drawing.Point(85, 12);
     137      this.ProblemTextBox.Name = "ProblemTextBox";
     138      this.ProblemTextBox.ReadOnly = true;
     139      this.ProblemTextBox.Size = new System.Drawing.Size(212, 20);
     140      this.ProblemTextBox.TabIndex = 9;
     141      //
     142      // openFileDialog
     143      //
     144      this.openFileDialog.Filter = "CSV files (*.csv)|*.csv|Text files (*.txt)|*.txt|All files (*.*)|*.*";
     145      //
    109146      // DataAnalysisImportTypeDialog
    110147      //
     148      this.AcceptButton = this.OkButton;
    111149      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    112150      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    113       this.ClientSize = new System.Drawing.Size(229, 151);
     151      this.ClientSize = new System.Drawing.Size(339, 179);
     152      this.ControlBox = false;
     153      this.Controls.Add(this.ProblemTextBox);
     154      this.Controls.Add(this.openFileButton);
     155      this.Controls.Add(this.ProblemFileLabel);
    114156      this.Controls.Add(this.CancelButton);
    115157      this.Controls.Add(this.OkButton);
    116       this.Controls.Add(this.ShuffelDataCheckbox);
     158      this.Controls.Add(this.ShuffleDataCheckbox);
    117159      this.Controls.Add(this.TrainingTestGroupBox);
    118160      this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
     161      this.MaximizeBox = false;
     162      this.MinimizeBox = false;
    119163      this.Name = "DataAnalysisImportTypeDialog";
     164      this.ShowIcon = false;
    120165      this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
    121       this.Text = "DataAnalysisImportTypeDialog";
     166      this.Text = "CSV Import";
    122167      ((System.ComponentModel.ISupportInitialize)(this.TrainingTestTrackBar)).EndInit();
    123168      this.TrainingTestGroupBox.ResumeLayout(false);
     
    130175    #endregion
    131176
    132     protected System.Windows.Forms.CheckBox ShuffelDataCheckbox;
     177    protected System.Windows.Forms.CheckBox ShuffleDataCheckbox;
    133178    protected System.Windows.Forms.Button OkButton;
     179    protected System.Windows.Forms.TrackBar TrainingTestTrackBar;
     180    protected System.Windows.Forms.GroupBox TrainingTestGroupBox;
     181    protected System.Windows.Forms.Label TestLabel;
     182    protected System.Windows.Forms.Label TrainingLabel;
    134183    protected System.Windows.Forms.Button CancelButton;
    135     private System.Windows.Forms.TrackBar TrainingTestTrackBar;
    136     private System.Windows.Forms.GroupBox TrainingTestGroupBox;
    137     private System.Windows.Forms.Label TestLabel;
    138     private System.Windows.Forms.Label TrainingLabel;
     184    protected System.Windows.Forms.OpenFileDialog openFileDialog;
     185    protected System.Windows.Forms.Label ProblemFileLabel;
     186    protected System.Windows.Forms.Button openFileButton;
     187    protected System.Windows.Forms.TextBox ProblemTextBox;
    139188
    140189  }
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisImportTypeDialog.cs

    r8599 r8693  
    2525  public partial class DataAnalysisImportTypeDialog : Form {
    2626
     27    public string Path {
     28      get { return ProblemTextBox.Text; }
     29    }
     30
    2731    public DataAnalysisImportType ImportType {
    2832      get {
    2933        return new DataAnalysisImportType() {
    30           Shuffle = ShuffelDataCheckbox.Checked,
     34          Shuffle = ShuffleDataCheckbox.Checked,
    3135          Training = TrainingTestTrackBar.Value
    3236        };
     
    4246      TestLabel.Text = "Test: " + (TrainingTestTrackBar.Maximum - TrainingTestTrackBar.Value) + " %";
    4347    }
     48
     49    private void openFileButton_Click(object sender, System.EventArgs e) {
     50      if (openFileDialog.ShowDialog(this) == DialogResult.OK) {
     51        ProblemTextBox.Text = openFileDialog.FileName;
     52        OkButton.Enabled = true;
     53      }
     54    }
    4455  }
    4556}
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisInstanceConsumerView.cs

    r8599 r8693  
    4747      var provider = SelectedProvider as DataAnalysisInstanceProvider<T>;
    4848      if (provider != null) {
    49         openFileDialog.FileName = GetProblemType() + " instance";
    50         if (openFileDialog.ShowDialog() == DialogResult.OK) {
     49        DataAnalysisImportTypeDialog importTypeDialog = new DataAnalysisImportTypeDialog();
     50        if (importTypeDialog.ShowDialog() == DialogResult.OK) {
    5151          T instance = default(T);
    5252          try {
    53             DataAnalysisImportTypeDialog importTypeDialog = new DataAnalysisImportTypeDialog();
    54             if (importTypeDialog.ShowDialog() == DialogResult.OK) {
    55               instance = provider.ImportData(openFileDialog.FileName, importTypeDialog.ImportType);
    56             } else {
    57               return;
    58             }
     53            instance = provider.ImportData(importTypeDialog.Path, importTypeDialog.ImportType);
     54
    5955          }
    6056          catch (Exception ex) {
     
    6662          }
    6763          catch (Exception ex) {
    68             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");
     64            MessageBox.Show(String.Format("This problem does not support loading the instance {0}: {1}", Path.GetFileName(importTypeDialog.Path), Environment.NewLine + ex.Message), "Cannot load instance");
    6965          }
     66        } else {
     67          return;
    7068        }
    7169      } else {
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/HeuristicLab.Problems.Instances.DataAnalysis.Views-3.3.csproj

    r8625 r8693  
    116116  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    117117  <PropertyGroup>
    118      <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
     118    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
    119119set ProjectDir=$(ProjectDir)
    120120set SolutionDir=$(SolutionDir)
     
    123123call PreBuildEvent.cmd
    124124</PreBuildEvent>
    125 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
     125    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
    126126export ProjectDir=$(ProjectDir)
    127127export SolutionDir=$(SolutionDir)
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Classification/CSV/ClassifiactionCSVInstanceProvider.cs

    r8685 r8693  
    9696      csvFileParser.Parse(path);
    9797
     98      int trainingPartEnd = (csvFileParser.Rows * type.Training) / 100;
    9899      List<IList> values = csvFileParser.Values;
    99100      if (type.Shuffle) {
     
    106107      // turn of input variables that are constant in the training partition
    107108      var allowedInputVars = new List<string>();
    108       int trainingPartEnd = (csvFileParser.Rows * type.Training) / 100;
    109109      var trainingIndizes = Enumerable.Range(0, trainingPartEnd);
    110110      foreach (var variableName in dataset.DoubleVariables) {
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/HeuristicLab.Problems.Instances.DataAnalysis-3.3.csproj

    r8624 r8693  
    9898  </PropertyGroup>
    9999  <ItemGroup>
    100      <Reference Include="ICSharpCode.SharpZipLib">
    101     <HintPath>..\..\HeuristicLab.PluginInfrastructure\3.3\ICSharpCode.SharpZipLib.dll</HintPath>
    102     <Private>False</Private>
    103   </Reference>
     100    <Reference Include="ICSharpCode.SharpZipLib">
     101      <HintPath>..\..\HeuristicLab.PluginInfrastructure\3.3\ICSharpCode.SharpZipLib.dll</HintPath>
     102      <Private>False</Private>
     103    </Reference>
    104104    <Reference Include="System" />
    105105    <Reference Include="System.Core" />
     
    249249  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    250250  <PropertyGroup>
    251    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
     251    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
    252252set ProjectDir=$(ProjectDir)
    253253set SolutionDir=$(SolutionDir)
     
    255255
    256256call PreBuildEvent.cmd</PreBuildEvent>
    257 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
     257    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
    258258export ProjectDir=$(ProjectDir)
    259259export SolutionDir=$(SolutionDir)
Note: See TracChangeset for help on using the changeset viewer.