Changeset 15510 for branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Views/3.3
- Timestamp:
- 12/11/17 22:10:01 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Views/3.3/GQAPAssignmentView.cs
r15504 r15510 61 61 protected override void OnContentChanged() { 62 62 base.OnContentChanged(); 63 UpdateQuality(); 64 UpdateFlowDistanceQuality(); 65 UpdateInstallationQuality(); 66 UpdateOverbookedCapacity(); 63 UpdateEvaluation(); 67 64 UpdateAssignment(); 68 65 if (Content != null) assignmentView.Content = Content.Assignment; … … 77 74 private void Content_PropertyChanged(object sender, PropertyChangedEventArgs e) { 78 75 switch (e.PropertyName) { 79 case "Quality": UpdateQuality(); break; 80 case "FlowDistanceQuality": UpdateFlowDistanceQuality(); break; 81 case "InstallationQuality": UpdateInstallationQuality(); break; 82 case "OverbookedCapacity": UpdateOverbookedCapacity(); break; 83 case "Assignment": UpdateAssignment(); break; 84 case "EquipmentNames": UpdateAssignment(); break; 85 case "LocationNames": UpdateAssignment(); break; 76 case nameof(Content.Evaluation): UpdateEvaluation(); break; 77 case nameof(Content.Assignment): UpdateAssignment(); break; 78 case nameof(Content.ProblemInstance): UpdateEvaluation(); UpdateAssignment(); break; 86 79 default: break; 87 80 } … … 124 117 125 118 #region Helpers 126 private void Update Quality() {127 if (InvokeRequired) Invoke((Action)Update Quality);119 private void UpdateEvaluation() { 120 if (InvokeRequired) Invoke((Action)UpdateEvaluation); 128 121 else { 129 122 if (Content == null) { 130 123 qualityLabel.Text = "-"; 124 flowDistanceQualityLabel.Text = "-"; 125 installationQualityLabel.Text = "-"; 126 overbookedCapacityLabel.Text = "-"; 131 127 } else { 132 128 qualityLabel.Text = Content.ProblemInstance.ToSingleObjective(Content.Evaluation).ToString(); 133 }134 }135 }136 137 private void UpdateFlowDistanceQuality() {138 if (InvokeRequired) Invoke((Action)UpdateFlowDistanceQuality);139 else {140 if (Content == null || Content.Evaluation == null) {141 flowDistanceQualityLabel.Text = "-";142 } else {143 129 flowDistanceQualityLabel.Text = Content.Evaluation.FlowCosts.ToString(); 144 }145 }146 }147 148 private void UpdateInstallationQuality() {149 if (InvokeRequired) Invoke((Action)UpdateInstallationQuality);150 else {151 if (Content == null || Content.Evaluation == null) {152 installationQualityLabel.Text = "-";153 } else {154 130 installationQualityLabel.Text = Content.Evaluation.InstallationCosts.ToString(); 155 }156 }157 }158 159 private void UpdateOverbookedCapacity() {160 if (InvokeRequired) Invoke((Action)UpdateOverbookedCapacity);161 else {162 if (Content == null || Content.Evaluation == null) {163 overbookedCapacityLabel.Text = "-";164 } else {165 131 overbookedCapacityLabel.Text = Content.Evaluation.ExcessDemand.ToString(); 166 132 }
Note: See TracChangeset
for help on using the changeset viewer.