- Timestamp:
- 09/25/12 10:57:42 (12 years ago)
- Location:
- trunk/sources
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisImportTypeDialog.Designer.cs
r8601 r8693 24 24 /// </summary> 25 25 private void InitializeComponent() { 26 this.Shuff elDataCheckbox = new System.Windows.Forms.CheckBox();26 this.ShuffleDataCheckbox = new System.Windows.Forms.CheckBox(); 27 27 this.OkButton = new System.Windows.Forms.Button(); 28 this.CancelButton = new System.Windows.Forms.Button();29 28 this.TrainingTestTrackBar = new System.Windows.Forms.TrackBar(); 30 29 this.TrainingTestGroupBox = new System.Windows.Forms.GroupBox(); 31 30 this.TestLabel = new System.Windows.Forms.Label(); 32 31 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(); 33 37 ((System.ComponentModel.ISupportInitialize)(this.TrainingTestTrackBar)).BeginInit(); 34 38 this.TrainingTestGroupBox.SuspendLayout(); 35 39 this.SuspendLayout(); 36 40 // 37 // Shuff elDataCheckbox41 // ShuffleDataCheckbox 38 42 // 39 this.Shuff elDataCheckbox.AutoSize = true;40 this.Shuff elDataCheckbox.Location = new System.Drawing.Point(18, 12);41 this.Shuff elDataCheckbox.Name = "ShuffelDataCheckbox";42 this.Shuff elDataCheckbox.Size = new System.Drawing.Size(91, 17);43 this.Shuff elDataCheckbox.TabIndex = 1;44 this.Shuff elDataCheckbox.Text = "ShuffelData?";45 this.Shuff elDataCheckbox.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; 46 50 // 47 51 // OkButton 48 52 // 49 53 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); 51 56 this.OkButton.Name = "OkButton"; 52 57 this.OkButton.Size = new System.Drawing.Size(75, 23); … … 55 60 this.OkButton.UseVisualStyleBackColor = true; 56 61 // 57 // CancelButton58 //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 //67 62 // TrainingTestTrackBar 68 63 // 64 this.TrainingTestTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 65 | System.Windows.Forms.AnchorStyles.Right))); 69 66 this.TrainingTestTrackBar.Location = new System.Drawing.Point(6, 19); 70 67 this.TrainingTestTrackBar.Maximum = 100; 71 68 this.TrainingTestTrackBar.Minimum = 1; 72 69 this.TrainingTestTrackBar.Name = "TrainingTestTrackBar"; 73 this.TrainingTestTrackBar.Size = new System.Drawing.Size( 210, 45);70 this.TrainingTestTrackBar.Size = new System.Drawing.Size(303, 45); 74 71 this.TrainingTestTrackBar.TabIndex = 4; 75 72 this.TrainingTestTrackBar.TickStyle = System.Windows.Forms.TickStyle.None; … … 82 79 this.TrainingTestGroupBox.Controls.Add(this.TrainingLabel); 83 80 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); 85 82 this.TrainingTestGroupBox.Name = "TrainingTestGroupBox"; 86 this.TrainingTestGroupBox.Size = new System.Drawing.Size( 222, 80);83 this.TrainingTestGroupBox.Size = new System.Drawing.Size(315, 80); 87 84 this.TrainingTestGroupBox.TabIndex = 5; 88 85 this.TrainingTestGroupBox.TabStop = false; … … 92 89 // 93 90 this.TestLabel.AutoSize = true; 94 this.TestLabel.Location = new System.Drawing.Point(1 08, 51);91 this.TestLabel.Location = new System.Drawing.Point(188, 51); 95 92 this.TestLabel.Name = "TestLabel"; 96 93 this.TestLabel.Size = new System.Drawing.Size(57, 13); … … 101 98 // 102 99 this.TrainingLabel.AutoSize = true; 103 this.TrainingLabel.Location = new System.Drawing.Point( 11, 51);100 this.TrainingLabel.Location = new System.Drawing.Point(50, 51); 104 101 this.TrainingLabel.Name = "TrainingLabel"; 105 102 this.TrainingLabel.Size = new System.Drawing.Size(74, 13); … … 107 104 this.TrainingLabel.Text = "Training: 66 %"; 108 105 // 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 // 109 146 // DataAnalysisImportTypeDialog 110 147 // 148 this.AcceptButton = this.OkButton; 111 149 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 112 150 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); 114 156 this.Controls.Add(this.CancelButton); 115 157 this.Controls.Add(this.OkButton); 116 this.Controls.Add(this.Shuff elDataCheckbox);158 this.Controls.Add(this.ShuffleDataCheckbox); 117 159 this.Controls.Add(this.TrainingTestGroupBox); 118 160 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; 161 this.MaximizeBox = false; 162 this.MinimizeBox = false; 119 163 this.Name = "DataAnalysisImportTypeDialog"; 164 this.ShowIcon = false; 120 165 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 121 this.Text = " DataAnalysisImportTypeDialog";166 this.Text = "CSV Import"; 122 167 ((System.ComponentModel.ISupportInitialize)(this.TrainingTestTrackBar)).EndInit(); 123 168 this.TrainingTestGroupBox.ResumeLayout(false); … … 130 175 #endregion 131 176 132 protected System.Windows.Forms.CheckBox Shuff elDataCheckbox;177 protected System.Windows.Forms.CheckBox ShuffleDataCheckbox; 133 178 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; 134 183 protected System.Windows.Forms.Button CancelButton; 135 pr ivate System.Windows.Forms.TrackBar TrainingTestTrackBar;136 pr ivate System.Windows.Forms.GroupBox TrainingTestGroupBox;137 pr ivate System.Windows.Forms.Label TestLabel;138 pr ivate 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; 139 188 140 189 } -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisImportTypeDialog.cs
r8599 r8693 25 25 public partial class DataAnalysisImportTypeDialog : Form { 26 26 27 public string Path { 28 get { return ProblemTextBox.Text; } 29 } 30 27 31 public DataAnalysisImportType ImportType { 28 32 get { 29 33 return new DataAnalysisImportType() { 30 Shuffle = Shuff elDataCheckbox.Checked,34 Shuffle = ShuffleDataCheckbox.Checked, 31 35 Training = TrainingTestTrackBar.Value 32 36 }; … … 42 46 TestLabel.Text = "Test: " + (TrainingTestTrackBar.Maximum - TrainingTestTrackBar.Value) + " %"; 43 47 } 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 } 44 55 } 45 56 } -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisInstanceConsumerView.cs
r8599 r8693 47 47 var provider = SelectedProvider as DataAnalysisInstanceProvider<T>; 48 48 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) { 51 51 T instance = default(T); 52 52 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 59 55 } 60 56 catch (Exception ex) { … … 66 62 } 67 63 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"); 69 65 } 66 } else { 67 return; 70 68 } 71 69 } else { -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/HeuristicLab.Problems.Instances.DataAnalysis.Views-3.3.csproj
r8625 r8693 116 116 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 117 117 <PropertyGroup> 118 118 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 119 119 set ProjectDir=$(ProjectDir) 120 120 set SolutionDir=$(SolutionDir) … … 123 123 call PreBuildEvent.cmd 124 124 </PreBuildEvent> 125 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">125 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' "> 126 126 export ProjectDir=$(ProjectDir) 127 127 export SolutionDir=$(SolutionDir) -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Classification/CSV/ClassifiactionCSVInstanceProvider.cs
r8685 r8693 96 96 csvFileParser.Parse(path); 97 97 98 int trainingPartEnd = (csvFileParser.Rows * type.Training) / 100; 98 99 List<IList> values = csvFileParser.Values; 99 100 if (type.Shuffle) { … … 106 107 // turn of input variables that are constant in the training partition 107 108 var allowedInputVars = new List<string>(); 108 int trainingPartEnd = (csvFileParser.Rows * type.Training) / 100;109 109 var trainingIndizes = Enumerable.Range(0, trainingPartEnd); 110 110 foreach (var variableName in dataset.DoubleVariables) { -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/HeuristicLab.Problems.Instances.DataAnalysis-3.3.csproj
r8624 r8693 98 98 </PropertyGroup> 99 99 <ItemGroup> 100 101 102 103 100 <Reference Include="ICSharpCode.SharpZipLib"> 101 <HintPath>..\..\HeuristicLab.PluginInfrastructure\3.3\ICSharpCode.SharpZipLib.dll</HintPath> 102 <Private>False</Private> 103 </Reference> 104 104 <Reference Include="System" /> 105 105 <Reference Include="System.Core" /> … … 249 249 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 250 250 <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) 252 252 set ProjectDir=$(ProjectDir) 253 253 set SolutionDir=$(SolutionDir) … … 255 255 256 256 call PreBuildEvent.cmd</PreBuildEvent> 257 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">257 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' "> 258 258 export ProjectDir=$(ProjectDir) 259 259 export SolutionDir=$(SolutionDir)
Note: See TracChangeset
for help on using the changeset viewer.