Changeset 9598 for branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/PackingPlans
- Timestamp:
- 06/07/13 15:35:12 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/PackingPlans/PackingPlan3DView.cs
r9593 r9598 44 44 } else { 45 45 Content.Name = "Packing Plan"; 46 for (int i = 0; i < Content.NrOfBins; i++) 47 binSelection.Items.Add(i); 46 int i = 0; 47 foreach (var bp in Content.BinPackings) 48 binSelection.Items.Add(i++ + " (" + Math.Round(bp.PackingDensity * 100, 2) + "%)"); 49 48 50 binSelection.SelectedIndex = 0; 49 51 UpdateModel(); … … 53 55 54 56 private void UpdateModel() { 55 int currentBin = (binSelection != null && binSelection.SelectedItem != null) ? (int)(binSelection.SelectedItem) : 0;57 int currentBin = (binSelection != null) ? (int)(binSelection.SelectedIndex) : 0; 56 58 var bin = Content.BinPackings[currentBin].BinMeasures; 57 59 packingPlan3D.InitializeContainer(bin.Width, bin.Height, bin.Depth); … … 71 73 itemSelection.SelectedIndex = -1; 72 74 itemSelection.Items.Clear(); 73 int currentBin = (binSelection != null && binSelection.SelectedItem != null) ? (int)(binSelection.SelectedItem) : 0;75 int currentBin = (binSelection != null) ? (int)(binSelection.SelectedIndex) : 0; 74 76 //for (int i = 0; i < Content.PackingItemPositions.Count; i++) { 75 77 // if (Content.PackingItemPositions[i].AssignedBin == currentBin) … … 106 108 } else { 107 109 Content.Name = "Packing Plan"; 108 for (int i = 0; i < Content.NrOfBins; i++) 109 binSelection.Items.Add(i); 110 int i = 0; 111 foreach (var bp in Content.BinPackings) 112 binSelection.Items.Add(i++ + " (" + Math.Round(bp.PackingDensity * 100, 2) + "%)"); 110 113 binSelection.SelectedIndex = 0; 111 114 UpdateModel();
Note: See TracChangeset
for help on using the changeset viewer.