Changeset 8648 for branches/ParameterConfigurationEncoding
- Timestamp:
- 09/14/12 10:01:48 (12 years ago)
- Location:
- branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding.Views/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding.Views/3.3/OptimizableView.cs
r8535 r8648 58 58 Invoke(new EventHandler(Content_OptimizeChanged), sender, e); 59 59 } else { 60 this.optimizeCheckBox.Checked = Content.Optimize;60 optimizeCheckBox.Checked = Content.Optimize; 61 61 if (Content.Optimize) { 62 this.viewHost.ViewType = null;62 viewHost.ViewType = null; 63 63 64 64 var pc = Content as IParameterConfiguration; … … 67 67 if (pc != null) { 68 68 if (pc is SingleValuedParameterConfiguration) { 69 this.viewHost.Content = ((ParameterizedValueConfiguration)pc.ValueConfigurations.Single()).ParameterConfigurations;69 viewHost.Content = ((ParameterizedValueConfiguration)pc.ValueConfigurations.Single()).ParameterConfigurations; 70 70 } else { 71 this.viewHost.Content = pc.ValueConfigurations;71 viewHost.Content = pc.ValueConfigurations; 72 72 } 73 73 } else if (vc != null) { … … 77 77 Content.ActualValue.ValueDataType == typeof(DoubleValue) || 78 78 Content.ActualValue.ValueDataType == typeof(PercentValue)) { 79 this.viewHost.ViewsLabelVisible = true;80 this.viewHost.Content = rvc.RangeConstraint;79 viewHost.ViewsLabelVisible = true; 80 viewHost.Content = rvc.RangeConstraint; 81 81 } else if (Content.ActualValue.ValueDataType == typeof(BoolValue)) { 82 this.viewHost.Content = null; // no configuration required82 viewHost.Content = null; // no configuration required 83 83 } 84 84 } … … 86 86 var pvc = Content as ParameterizedValueConfiguration; 87 87 if (pvc != null) { 88 this.viewHost.ViewsLabelVisible = false;89 this.viewHost.Content = pvc.ParameterConfigurations;88 viewHost.ViewsLabelVisible = false; 89 viewHost.Content = pvc.ParameterConfigurations; 90 90 } 91 91 } else { … … 93 93 } 94 94 } else { 95 this.viewHost.ViewsLabelVisible = false;95 viewHost.ViewsLabelVisible = false; 96 96 if (Content.ValuesReadOnly) { 97 this.viewHost.Content = new MessageItem("Cannot modify value directly. Please modify the value in the list of problems.");97 viewHost.Content = new MessageItem("Cannot modify value directly. Please modify the value in the list of problems."); 98 98 } else { 99 this.viewHost.Content = Content.ActualValue; 99 // the content's valid values get lost after optimize is set to true because the constrained value 100 // does not contain the earlier valid values; therefore, the same constrained value with the correct 101 // set of valid values is created before the assignment below 102 var configuration = viewHost.Content as CheckedValueConfigurationList; 103 if (configuration != null) { 104 Content.ActualValue = new ConstrainedValue(Content.ActualValue.Value, 105 Content.ActualValue.ValueDataType, 106 configuration.ValidValues, 107 Content.ActualValue.IsNullable); 108 } 109 viewHost.Content = Content.ActualValue; 100 110 } 101 111 } … … 117 127 Content_OptimizeChanged(this, EventArgs.Empty); 118 128 } else { 119 this.viewHost.Content = null;129 viewHost.Content = null; 120 130 } 121 131 } … … 124 134 base.SetEnabledStateOfControls(); 125 135 if (Content != null) { 126 this.optimizeCheckBox.Enabled = !this.ReadOnly && Content.IsOptimizable;136 optimizeCheckBox.Enabled = !ReadOnly && Content.IsOptimizable; 127 137 } 128 138 } -
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding.Views/3.3/ValueConfigurationViews/ValueView.cs
r8544 r8648 65 65 66 66 private void setValueButton_Click(object sender, EventArgs e) { 67 // TODO: valid values get lost if the value was set to be optimized before68 67 var withoutNullValue = Content.ValidValues.Where(x => x != null && !(x is NullValue)); 69 68 var typeSelectorDialog = new TypeSelectorDialog();
Note: See TracChangeset
for help on using the changeset viewer.