Changeset 1277
- Timestamp:
- 03/06/09 15:27:32 (16 years ago)
- Location:
- branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/ProblemView.Designer.cs
r1043 r1277 54 54 this.testSamplesStartTextBox = new System.Windows.Forms.TextBox(); 55 55 this.testLabel = new System.Windows.Forms.Label(); 56 this.datasetView = new HeuristicLab.DataAnalysis.DatasetView();57 56 this.targetsListBox = new System.Windows.Forms.CheckedListBox(); 58 57 this.inputsListBox = new System.Windows.Forms.CheckedListBox(); … … 62 61 this.partitioningGroupBox = new System.Windows.Forms.GroupBox(); 63 62 this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); 64 this.modelType = new System.Windows.Forms.ComboBox(); 65 this.taskLabel = new System.Windows.Forms.Label(); 63 this.classificationRadioButton = new System.Windows.Forms.RadioButton(); 64 this.regressionRadioButton = new System.Windows.Forms.RadioButton(); 65 this.timeSeriesRadioButton = new System.Windows.Forms.RadioButton(); 66 this.minTimeOffsetLabel = new System.Windows.Forms.Label(); 67 this.minTimeOffsetTextBox = new System.Windows.Forms.TextBox(); 68 this.learningTaskGroupBox = new System.Windows.Forms.GroupBox(); 69 this.autoregressiveLabel = new System.Windows.Forms.Label(); 70 this.maxTimeOffsetLabel = new System.Windows.Forms.Label(); 71 this.maxTimeOffsetTextBox = new System.Windows.Forms.TextBox(); 72 this.datasetView = new HeuristicLab.DataAnalysis.DatasetView(); 66 73 this.targetsGroupBox.SuspendLayout(); 67 74 this.inputsGroupBox.SuspendLayout(); 68 75 this.partitioningGroupBox.SuspendLayout(); 76 this.learningTaskGroupBox.SuspendLayout(); 69 77 this.SuspendLayout(); 70 78 // … … 127 135 // 128 136 this.validationLabel.AutoSize = true; 129 this.validationLabel.Location = new System.Drawing.Point(5, 4 8);137 this.validationLabel.Location = new System.Drawing.Point(5, 46); 130 138 this.validationLabel.Name = "validationLabel"; 131 139 this.validationLabel.Size = new System.Drawing.Size(97, 13); … … 159 167 this.testLabel.TabIndex = 14; 160 168 this.testLabel.Text = "Test samples:"; 161 //162 // datasetView163 //164 this.datasetView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)165 | System.Windows.Forms.AnchorStyles.Left)166 | System.Windows.Forms.AnchorStyles.Right)));167 this.datasetView.Caption = "Editor";168 this.datasetView.Dataset = null;169 this.datasetView.Filename = null;170 this.datasetView.Location = new System.Drawing.Point(3, 32);171 this.datasetView.Name = "datasetView";172 this.datasetView.Size = new System.Drawing.Size(326, 176);173 this.datasetView.TabIndex = 17;174 169 // 175 170 // targetsListBox … … 199 194 // autoregressiveCheckBox 200 195 // 201 this.autoregressiveCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));196 this.autoregressiveCheckBox.Anchor = System.Windows.Forms.AnchorStyles.Top; 202 197 this.autoregressiveCheckBox.AutoSize = true; 203 this.autoregressiveCheckBox. CheckAlign = System.Drawing.ContentAlignment.MiddleRight;204 this.autoregressiveCheckBox.Location = new System.Drawing.Point( 215, 424);198 this.autoregressiveCheckBox.Enabled = false; 199 this.autoregressiveCheckBox.Location = new System.Drawing.Point(131, 83); 205 200 this.autoregressiveCheckBox.Name = "autoregressiveCheckBox"; 206 this.autoregressiveCheckBox.Size = new System.Drawing.Size(1 02, 17);201 this.autoregressiveCheckBox.Size = new System.Drawing.Size(15, 14); 207 202 this.autoregressiveCheckBox.TabIndex = 22; 208 this.autoregressiveCheckBox.Text = "Auto regressive:";209 203 this.autoregressiveCheckBox.UseVisualStyleBackColor = true; 210 204 this.autoregressiveCheckBox.CheckedChanged += new System.EventHandler(this.autoregressiveCheckBox_CheckedChanged); … … 214 208 this.targetsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 215 209 this.targetsGroupBox.Controls.Add(this.targetsListBox); 216 this.targetsGroupBox.Location = new System.Drawing.Point( 3, 320);210 this.targetsGroupBox.Location = new System.Drawing.Point(29, 515); 217 211 this.targetsGroupBox.Name = "targetsGroupBox"; 218 212 this.targetsGroupBox.Size = new System.Drawing.Size(167, 100); … … 225 219 this.inputsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 226 220 this.inputsGroupBox.Controls.Add(this.inputsListBox); 227 this.inputsGroupBox.Location = new System.Drawing.Point( 176, 320);221 this.inputsGroupBox.Location = new System.Drawing.Point(202, 515); 228 222 this.inputsGroupBox.Name = "inputsGroupBox"; 229 223 this.inputsGroupBox.Size = new System.Drawing.Size(153, 100); … … 244 238 this.partitioningGroupBox.Controls.Add(this.testSamplesStartTextBox); 245 239 this.partitioningGroupBox.Controls.Add(this.testLabel); 246 this.partitioningGroupBox.Location = new System.Drawing.Point( 3, 214);240 this.partitioningGroupBox.Location = new System.Drawing.Point(29, 409); 247 241 this.partitioningGroupBox.Name = "partitioningGroupBox"; 248 242 this.partitioningGroupBox.Size = new System.Drawing.Size(326, 100); … … 258 252 this.openFileDialog.Title = "Import data set from file"; 259 253 // 260 // modelType 261 // 262 this.modelType.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 263 this.modelType.FormattingEnabled = true; 264 this.modelType.Location = new System.Drawing.Point(88, 422); 265 this.modelType.Name = "modelType"; 266 this.modelType.Size = new System.Drawing.Size(121, 21); 267 this.modelType.TabIndex = 26; 268 this.modelType.SelectedValueChanged += new System.EventHandler(this.modelType_SelectedValueChanged); 269 // 270 // taskLabel 271 // 272 this.taskLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 273 this.taskLabel.AutoSize = true; 274 this.taskLabel.Location = new System.Drawing.Point(8, 425); 275 this.taskLabel.Name = "taskLabel"; 276 this.taskLabel.Size = new System.Drawing.Size(74, 13); 277 this.taskLabel.TabIndex = 27; 278 this.taskLabel.Text = "Learning task:"; 254 // classificationRadioButton 255 // 256 this.classificationRadioButton.AutoSize = true; 257 this.classificationRadioButton.Checked = true; 258 this.classificationRadioButton.Location = new System.Drawing.Point(6, 16); 259 this.classificationRadioButton.Name = "classificationRadioButton"; 260 this.classificationRadioButton.Size = new System.Drawing.Size(86, 17); 261 this.classificationRadioButton.TabIndex = 28; 262 this.classificationRadioButton.TabStop = true; 263 this.classificationRadioButton.Text = "Classification"; 264 this.classificationRadioButton.UseVisualStyleBackColor = true; 265 this.classificationRadioButton.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChanged); 266 // 267 // regressionRadioButton 268 // 269 this.regressionRadioButton.AutoSize = true; 270 this.regressionRadioButton.Location = new System.Drawing.Point(6, 39); 271 this.regressionRadioButton.Name = "regressionRadioButton"; 272 this.regressionRadioButton.Size = new System.Drawing.Size(78, 17); 273 this.regressionRadioButton.TabIndex = 29; 274 this.regressionRadioButton.Text = "Regression"; 275 this.regressionRadioButton.UseVisualStyleBackColor = true; 276 this.regressionRadioButton.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChanged); 277 // 278 // timeSeriesRadioButton 279 // 280 this.timeSeriesRadioButton.AutoSize = true; 281 this.timeSeriesRadioButton.Location = new System.Drawing.Point(6, 62); 282 this.timeSeriesRadioButton.Name = "timeSeriesRadioButton"; 283 this.timeSeriesRadioButton.Size = new System.Drawing.Size(119, 17); 284 this.timeSeriesRadioButton.TabIndex = 30; 285 this.timeSeriesRadioButton.Text = "Time series forecast"; 286 this.timeSeriesRadioButton.UseVisualStyleBackColor = true; 287 this.timeSeriesRadioButton.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChanged); 288 // 289 // minTimeOffsetLabel 290 // 291 this.minTimeOffsetLabel.AutoSize = true; 292 this.minTimeOffsetLabel.Enabled = false; 293 this.minTimeOffsetLabel.Location = new System.Drawing.Point(38, 106); 294 this.minTimeOffsetLabel.Name = "minTimeOffsetLabel"; 295 this.minTimeOffsetLabel.Size = new System.Drawing.Size(87, 13); 296 this.minTimeOffsetLabel.TabIndex = 31; 297 this.minTimeOffsetLabel.Text = "Min. Time Offset:"; 298 // 299 // minTimeOffsetTextBox 300 // 301 this.minTimeOffsetTextBox.Enabled = false; 302 this.minTimeOffsetTextBox.Location = new System.Drawing.Point(131, 103); 303 this.minTimeOffsetTextBox.Name = "minTimeOffsetTextBox"; 304 this.minTimeOffsetTextBox.Size = new System.Drawing.Size(96, 20); 305 this.minTimeOffsetTextBox.TabIndex = 32; 306 this.minTimeOffsetTextBox.Validated += new System.EventHandler(this.timeOffsetTextBox_Validated); 307 this.minTimeOffsetTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.timeOffsetTextBox_Validating); 308 // 309 // learningTaskGroupBox 310 // 311 this.learningTaskGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 312 this.learningTaskGroupBox.Controls.Add(this.autoregressiveLabel); 313 this.learningTaskGroupBox.Controls.Add(this.classificationRadioButton); 314 this.learningTaskGroupBox.Controls.Add(this.minTimeOffsetLabel); 315 this.learningTaskGroupBox.Controls.Add(this.minTimeOffsetTextBox); 316 this.learningTaskGroupBox.Controls.Add(this.maxTimeOffsetLabel); 317 this.learningTaskGroupBox.Controls.Add(this.regressionRadioButton); 318 this.learningTaskGroupBox.Controls.Add(this.maxTimeOffsetTextBox); 319 this.learningTaskGroupBox.Controls.Add(this.timeSeriesRadioButton); 320 this.learningTaskGroupBox.Controls.Add(this.autoregressiveCheckBox); 321 this.learningTaskGroupBox.Location = new System.Drawing.Point(29, 621); 322 this.learningTaskGroupBox.Name = "learningTaskGroupBox"; 323 this.learningTaskGroupBox.Size = new System.Drawing.Size(326, 163); 324 this.learningTaskGroupBox.TabIndex = 35; 325 this.learningTaskGroupBox.TabStop = false; 326 this.learningTaskGroupBox.Text = "Learning task"; 327 // 328 // autoregressiveLabel 329 // 330 this.autoregressiveLabel.AutoSize = true; 331 this.autoregressiveLabel.Enabled = false; 332 this.autoregressiveLabel.Location = new System.Drawing.Point(45, 83); 333 this.autoregressiveLabel.Name = "autoregressiveLabel"; 334 this.autoregressiveLabel.Size = new System.Drawing.Size(80, 13); 335 this.autoregressiveLabel.TabIndex = 35; 336 this.autoregressiveLabel.Text = "Autoregressive:"; 337 // 338 // maxTimeOffsetLabel 339 // 340 this.maxTimeOffsetLabel.AutoSize = true; 341 this.maxTimeOffsetLabel.Enabled = false; 342 this.maxTimeOffsetLabel.Location = new System.Drawing.Point(35, 132); 343 this.maxTimeOffsetLabel.Name = "maxTimeOffsetLabel"; 344 this.maxTimeOffsetLabel.Size = new System.Drawing.Size(90, 13); 345 this.maxTimeOffsetLabel.TabIndex = 33; 346 this.maxTimeOffsetLabel.Text = "Max. Time Offset:"; 347 // 348 // maxTimeOffsetTextBox 349 // 350 this.maxTimeOffsetTextBox.Enabled = false; 351 this.maxTimeOffsetTextBox.Location = new System.Drawing.Point(131, 129); 352 this.maxTimeOffsetTextBox.Name = "maxTimeOffsetTextBox"; 353 this.maxTimeOffsetTextBox.Size = new System.Drawing.Size(96, 20); 354 this.maxTimeOffsetTextBox.TabIndex = 34; 355 this.maxTimeOffsetTextBox.Validated += new System.EventHandler(this.timeOffsetTextBox_Validated); 356 this.maxTimeOffsetTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.timeOffsetTextBox_Validating); 357 // 358 // datasetView 359 // 360 this.datasetView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 361 | System.Windows.Forms.AnchorStyles.Left) 362 | System.Windows.Forms.AnchorStyles.Right))); 363 this.datasetView.Caption = "Editor"; 364 this.datasetView.Dataset = null; 365 this.datasetView.Filename = null; 366 this.datasetView.Location = new System.Drawing.Point(3, 32); 367 this.datasetView.Name = "datasetView"; 368 this.datasetView.Size = new System.Drawing.Size(395, 371); 369 this.datasetView.TabIndex = 17; 279 370 // 280 371 // ProblemView … … 282 373 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 283 374 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 284 this.Controls.Add(this.taskLabel); 285 this.Controls.Add(this.modelType); 375 this.Controls.Add(this.learningTaskGroupBox); 286 376 this.Controls.Add(this.partitioningGroupBox); 287 377 this.Controls.Add(this.inputsGroupBox); 288 378 this.Controls.Add(this.targetsGroupBox); 289 this.Controls.Add(this.autoregressiveCheckBox);290 379 this.Controls.Add(this.datasetView); 291 380 this.Controls.Add(this.importButton); 292 381 this.Name = "ProblemView"; 293 this.Size = new System.Drawing.Size( 337, 446);382 this.Size = new System.Drawing.Size(406, 787); 294 383 this.targetsGroupBox.ResumeLayout(false); 295 384 this.inputsGroupBox.ResumeLayout(false); 296 385 this.partitioningGroupBox.ResumeLayout(false); 297 386 this.partitioningGroupBox.PerformLayout(); 387 this.learningTaskGroupBox.ResumeLayout(false); 388 this.learningTaskGroupBox.PerformLayout(); 298 389 this.ResumeLayout(false); 299 this.PerformLayout();300 390 301 391 } … … 321 411 private System.Windows.Forms.GroupBox partitioningGroupBox; 322 412 private System.Windows.Forms.OpenFileDialog openFileDialog; 323 private System.Windows.Forms.ComboBox modelType; 324 private System.Windows.Forms.Label taskLabel; 413 private System.Windows.Forms.RadioButton classificationRadioButton; 414 private System.Windows.Forms.RadioButton regressionRadioButton; 415 private System.Windows.Forms.RadioButton timeSeriesRadioButton; 416 private System.Windows.Forms.Label minTimeOffsetLabel; 417 private System.Windows.Forms.TextBox minTimeOffsetTextBox; 418 private System.Windows.Forms.GroupBox learningTaskGroupBox; 419 private System.Windows.Forms.Label maxTimeOffsetLabel; 420 private System.Windows.Forms.TextBox maxTimeOffsetTextBox; 421 private System.Windows.Forms.Label autoregressiveLabel; 325 422 } 326 423 } -
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/ProblemView.cs
r1215 r1277 39 39 this.problem = problem; 40 40 InitializeComponent(); 41 foreach (LearningTask l in Enum.GetValues(typeof(LearningTask))) {42 modelType.Items.Add(l);43 }44 41 UpdateControls(); 45 42 } … … 54 51 testSamplesStartTextBox.Text = problem.TestSamplesStart.ToString(); 55 52 testSamplesEndTextBox.Text = problem.TestSamplesEnd.ToString(); 53 minTimeOffsetTextBox.Text = problem.MinTimeOffset.ToString(); 54 maxTimeOffsetTextBox.Text = problem.MaxTimeOffset.ToString(); 56 55 autoregressiveCheckBox.Checked = problem.AutoRegressive; 57 for (int i = 0; i < modelType.Items.Count; i++) { 58 if ((LearningTask)modelType.Items[i] == problem.LearningTask) { 59 modelType.SelectedIndex = i; 60 break; 61 } 56 switch (problem.LearningTask) { 57 case LearningTask.Classification: classificationRadioButton.Checked = true; break; 58 case LearningTask.Regression: regressionRadioButton.Checked = true; break; 59 case LearningTask.TimeSeries: timeSeriesRadioButton.Checked = true; break; 62 60 } 63 61 targetsListBox.Items.Clear(); … … 219 217 } 220 218 221 private void modelType_SelectedValueChanged(object sender, EventArgs e) { 222 if ((LearningTask)modelType.SelectedItem == LearningTask.TimeSeries) autoregressiveCheckBox.Enabled = true; 223 else autoregressiveCheckBox.Enabled = false; 224 problem.LearningTask = (LearningTask)modelType.SelectedItem; 225 } 219 #region gui events 220 private void radioButton_CheckedChanged(object sender, EventArgs e) { 221 minTimeOffsetLabel.Enabled = timeSeriesRadioButton.Checked; 222 minTimeOffsetTextBox.Enabled = timeSeriesRadioButton.Checked; 223 maxTimeOffsetLabel.Enabled = timeSeriesRadioButton.Checked; 224 maxTimeOffsetTextBox.Enabled = timeSeriesRadioButton.Checked; 225 autoregressiveCheckBox.Enabled = timeSeriesRadioButton.Checked; 226 autoregressiveLabel.Enabled = timeSeriesRadioButton.Checked; 227 if (timeSeriesRadioButton.Checked) problem.LearningTask = LearningTask.TimeSeries; 228 else if (classificationRadioButton.Checked) problem.LearningTask = LearningTask.Classification; 229 else if (regressionRadioButton.Checked) problem.LearningTask = LearningTask.Regression; 230 } 231 232 private void timeOffsetTextBox_Validating(object sender, CancelEventArgs e) { 233 int min, max; 234 e.Cancel = !int.TryParse(minTimeOffsetTextBox.Text, out min); 235 e.Cancel = !int.TryParse(maxTimeOffsetTextBox.Text, out max); 236 e.Cancel = min > max; 237 } 238 private void timeOffsetTextBox_Validated(object sender, EventArgs e) { 239 problem.MinTimeOffset = int.Parse(minTimeOffsetTextBox.Text); 240 problem.MaxTimeOffset = int.Parse(maxTimeOffsetTextBox.Text); 241 } 242 #endregion 226 243 } 227 244 }
Note: See TracChangeset
for help on using the changeset viewer.