Changeset 4352 for trunk/sources/HeuristicLab.Problems.VehicleRouting.Views
- Timestamp:
- 09/01/10 11:13:46 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.VehicleRouting.Views
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting.Views
-
Property
svn:mergeinfo
set to
/branches/VRP/HeuristicLab.Problems.VehicleRouting.Views merged eligible
-
Property
svn:mergeinfo
set to
-
trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.3/VRPSolutionView.Designer.cs
r4185 r4352 50 50 this.valueTabPage = new System.Windows.Forms.TabPage(); 51 51 this.tourGroupBox = new System.Windows.Forms.GroupBox(); 52 this.tour ViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();52 this.tourGridView = new System.Windows.Forms.DataGridView(); 53 53 this.tabControl.SuspendLayout(); 54 54 this.visualizationTabPage.SuspendLayout(); … … 56 56 this.valueTabPage.SuspendLayout(); 57 57 this.tourGroupBox.SuspendLayout(); 58 ((System.ComponentModel.ISupportInitialize)(this.tourGridView)).BeginInit(); 58 59 this.SuspendLayout(); 59 60 // … … 100 101 this.valueTabPage.Name = "valueTabPage"; 101 102 this.valueTabPage.Padding = new System.Windows.Forms.Padding(3); 102 this.valueTabPage.Size = new System.Drawing.Size(415, 398);103 this.valueTabPage.Size = new System.Drawing.Size(415, 532); 103 104 this.valueTabPage.TabIndex = 1; 104 105 this.valueTabPage.Text = "Value"; … … 107 108 // tourGroupBox 108 109 // 109 this.tourGroupBox.Controls.Add(this.tour ViewHost);110 this.tourGroupBox.Controls.Add(this.tourGridView); 110 111 this.tourGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; 111 112 this.tourGroupBox.Location = new System.Drawing.Point(3, 3); 112 113 this.tourGroupBox.Name = "tourGroupBox"; 113 this.tourGroupBox.Size = new System.Drawing.Size(409, 392);114 this.tourGroupBox.Size = new System.Drawing.Size(409, 526); 114 115 this.tourGroupBox.TabIndex = 0; 115 116 this.tourGroupBox.TabStop = false; 116 117 this.tourGroupBox.Text = "Tour"; 117 118 // 118 // tour ViewHost119 // tourGridView 119 120 // 120 this.tourViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 121 | System.Windows.Forms.AnchorStyles.Left) 122 | System.Windows.Forms.AnchorStyles.Right))); 123 this.tourViewHost.Caption = "View"; 124 this.tourViewHost.Content = null; 125 this.tourViewHost.Location = new System.Drawing.Point(6, 19); 126 this.tourViewHost.Name = "tourViewHost"; 127 this.tourViewHost.ReadOnly = false; 128 this.tourViewHost.Size = new System.Drawing.Size(397, 367); 129 this.tourViewHost.TabIndex = 0; 130 this.tourViewHost.ViewType = null; 121 this.tourGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; 122 this.tourGridView.Dock = System.Windows.Forms.DockStyle.Fill; 123 this.tourGridView.Location = new System.Drawing.Point(3, 16); 124 this.tourGridView.Name = "tourGridView"; 125 this.tourGridView.Size = new System.Drawing.Size(403, 507); 126 this.tourGridView.TabIndex = 0; 131 127 // 132 128 // VRPSolutionView … … 142 138 this.valueTabPage.ResumeLayout(false); 143 139 this.tourGroupBox.ResumeLayout(false); 140 ((System.ComponentModel.ISupportInitialize)(this.tourGridView)).EndInit(); 144 141 this.ResumeLayout(false); 145 142 … … 153 150 private System.Windows.Forms.TabPage valueTabPage; 154 151 private System.Windows.Forms.GroupBox tourGroupBox; 155 private MainForm.WindowsForms.ViewHost tourViewHost;152 private System.Windows.Forms.DataGridView tourGridView; 156 153 157 154 -
trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.3/VRPSolutionView.cs
r4185 r4352 27 27 using HeuristicLab.MainForm; 28 28 using HeuristicLab.Problems.VehicleRouting.Encodings; 29 using HeuristicLab.Parameters; 30 using System.Linq; 29 31 30 32 namespace HeuristicLab.Problems.VehicleRouting.Views { … … 67 69 } else { 68 70 GenerateImage(); 69 tourViewHost.Content = Content.Solution;71 UpdateTourView(); 70 72 } 71 73 } … … 80 82 pictureBox.Enabled = Content != null; 81 83 tourGroupBox.Enabled = Content != null; 84 } 85 86 private void UpdateTourView() { 87 tourGridView.Rows.Clear(); 88 tourGridView.ColumnCount = Content.Coordinates.Rows - 1; 89 90 if (Content != null && Content.Solution != null) { 91 foreach (Tour tour in Content.Solution.GetTours(new ValueLookupParameter<DoubleMatrix>("DistanceMatrix", Content.DistanceMatrix))) { 92 int row = tourGridView.Rows.Add(); 93 int cell = 0; 94 foreach (int city in tour.Cities) { 95 tourGridView.Rows[row].Cells[cell].Value = city; 96 cell++; 97 } 98 } 99 } 82 100 } 83 101 … … 119 137 if (Content.Solution != null) { 120 138 int currentTour = 0; 121 foreach (Tour tour in Content.Solution. Tours) {139 foreach (Tour tour in Content.Solution.GetTours(new ValueLookupParameter<DoubleMatrix>("DistanceMatrix", distanceMatrix))) { 122 140 double t = 0.0; 123 141 Point[] tourPoints = new Point[tour.Cities.Count + 2]; … … 202 220 else { 203 221 GenerateImage(); 204 tourViewHost.Content = Content.Solution;222 UpdateTourView(); 205 223 } 206 224 } -
trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.3/VehicleRoutingProblemView.Designer.cs
r4185 r4352 29 29 this.parameterCollectionView = new HeuristicLab.Core.Views.ParameterCollectionView(); 30 30 this.tabPage2 = new System.Windows.Forms.TabPage(); 31 this.importButton2 = new System.Windows.Forms.Button(); 32 this.importButton3 = new System.Windows.Forms.Button(); 31 33 this.vrpSolutionView = new HeuristicLab.Problems.VehicleRouting.Views.VRPSolutionView(); 32 34 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); … … 43 45 // importButton 44 46 // 45 this.importButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)46 | System.Windows.Forms.AnchorStyles.Right)));47 47 this.importButton.Location = new System.Drawing.Point(0, 55); 48 48 this.importButton.Name = "importButton"; 49 this.importButton.Size = new System.Drawing.Size( 490, 23);49 this.importButton.Size = new System.Drawing.Size(139, 23); 50 50 this.importButton.TabIndex = 5; 51 51 this.importButton.Text = "Import from Solomon"; … … 63 63 this.tabControl1.Name = "tabControl1"; 64 64 this.tabControl1.SelectedIndex = 0; 65 this.tabControl1.Size = new System.Drawing.Size(490, 338);65 this.tabControl1.Size = new System.Drawing.Size(490, 265); 66 66 this.tabControl1.TabIndex = 6; 67 67 // … … 72 72 this.tabPage1.Name = "tabPage1"; 73 73 this.tabPage1.Padding = new System.Windows.Forms.Padding(3); 74 this.tabPage1.Size = new System.Drawing.Size(482, 312);74 this.tabPage1.Size = new System.Drawing.Size(482, 239); 75 75 this.tabPage1.TabIndex = 0; 76 76 this.tabPage1.Text = "Parameters"; … … 85 85 this.parameterCollectionView.Name = "parameterCollectionView"; 86 86 this.parameterCollectionView.ReadOnly = false; 87 this.parameterCollectionView.Size = new System.Drawing.Size(476, 306);87 this.parameterCollectionView.Size = new System.Drawing.Size(476, 233); 88 88 this.parameterCollectionView.TabIndex = 1; 89 89 // … … 94 94 this.tabPage2.Name = "tabPage2"; 95 95 this.tabPage2.Padding = new System.Windows.Forms.Padding(3); 96 this.tabPage2.Size = new System.Drawing.Size(482, 312);96 this.tabPage2.Size = new System.Drawing.Size(482, 239); 97 97 this.tabPage2.TabIndex = 1; 98 98 this.tabPage2.Text = "Visualization"; 99 99 this.tabPage2.UseVisualStyleBackColor = true; 100 // 101 // importButton2 102 // 103 this.importButton2.Location = new System.Drawing.Point(145, 55); 104 this.importButton2.Name = "importButton2"; 105 this.importButton2.Size = new System.Drawing.Size(126, 23); 106 this.importButton2.TabIndex = 7; 107 this.importButton2.Text = "Import from TSPLib"; 108 this.importButton2.UseVisualStyleBackColor = true; 109 this.importButton2.Click += new System.EventHandler(this.importButton2_Click); 110 // 111 // importButton3 112 // 113 this.importButton3.Location = new System.Drawing.Point(277, 55); 114 this.importButton3.Name = "importButton3"; 115 this.importButton3.Size = new System.Drawing.Size(131, 23); 116 this.importButton3.TabIndex = 8; 117 this.importButton3.Text = "Import from ORLib"; 118 this.importButton3.UseVisualStyleBackColor = true; 119 this.importButton3.Click += new System.EventHandler(this.importButton3_Click); 100 120 // 101 121 // vrpSolutionView … … 107 127 this.vrpSolutionView.Name = "vrpSolutionView"; 108 128 this.vrpSolutionView.ReadOnly = false; 109 this.vrpSolutionView.Size = new System.Drawing.Size(476, 306);129 this.vrpSolutionView.Size = new System.Drawing.Size(476, 233); 110 130 this.vrpSolutionView.TabIndex = 0; 111 131 // … … 113 133 // 114 134 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 135 this.Controls.Add(this.importButton3); 136 this.Controls.Add(this.importButton2); 115 137 this.Controls.Add(this.importButton); 116 138 this.Controls.Add(this.tabControl1); 117 139 this.Name = "VehicleRoutingProblemView"; 118 this.Size = new System.Drawing.Size(490, 422);140 this.Size = new System.Drawing.Size(490, 352); 119 141 this.Controls.SetChildIndex(this.tabControl1, 0); 120 142 this.Controls.SetChildIndex(this.importButton, 0); … … 123 145 this.Controls.SetChildIndex(this.descriptionLabel, 0); 124 146 this.Controls.SetChildIndex(this.descriptionTextBox, 0); 147 this.Controls.SetChildIndex(this.importButton2, 0); 148 this.Controls.SetChildIndex(this.importButton3, 0); 125 149 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 126 150 this.tabControl1.ResumeLayout(false); … … 140 164 private Core.Views.ParameterCollectionView parameterCollectionView; 141 165 private VRPSolutionView vrpSolutionView; 166 private System.Windows.Forms.Button importButton2; 167 private System.Windows.Forms.Button importButton3; 142 168 } 143 169 } -
trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.3/VehicleRoutingProblemView.cs
r4185 r4352 64 64 parameterCollectionView.Enabled = Content != null; 65 65 vrpSolutionView.Enabled = Content != null; 66 importButton.Enabled = Content != null && !ReadOnly;66 importButton.Enabled = importButton2.Enabled = importButton3.Enabled = Content != null && !ReadOnly; 67 67 } 68 68 69 69 private void importButton_Click(object sender, EventArgs e) { 70 70 OpenFileDialog dialog = new OpenFileDialog(); 71 dialog. DefaultExt = "txt";71 dialog.Filter = "Solomon files (*.txt)|*.txt"; 72 72 73 73 if (dialog.ShowDialog() == DialogResult.OK) { … … 76 76 } 77 77 78 private void importButton2_Click(object sender, EventArgs e) { 79 OpenFileDialog dialog = new OpenFileDialog(); 80 dialog.Filter = "TSPLib files (*.vrp)|*.vrp"; 81 82 if (dialog.ShowDialog() == DialogResult.OK) { 83 Content.ImportFromTSPLib(dialog.FileName); 84 } 85 } 86 87 private void importButton3_Click(object sender, EventArgs e) { 88 OpenFileDialog dialog = new OpenFileDialog(); 89 dialog.Filter = "ORLib files (*.txt)|*.txt"; 90 91 if (dialog.ShowDialog() == DialogResult.OK) { 92 Content.ImportFromORLib(dialog.FileName); 93 } 94 } 95 78 96 private void CoordinatesParameter_ValueChanged(object sender, EventArgs e) { 79 97 vrpSolutionView.Content.Coordinates = Content.Coordinates; 80 } 98 } 81 99 } 82 100 }
Note: See TracChangeset
for help on using the changeset viewer.