[4860] | 1 | #region License Information
|
---|
| 2 | /* HeuristicLab
|
---|
[17181] | 3 | * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
[4860] | 4 | *
|
---|
| 5 | * This file is part of HeuristicLab.
|
---|
| 6 | *
|
---|
| 7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
| 8 | * it under the terms of the GNU General Public License as published by
|
---|
| 9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
| 10 | * (at your option) any later version.
|
---|
| 11 | *
|
---|
| 12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 15 | * GNU General Public License for more details.
|
---|
| 16 | *
|
---|
| 17 | * You should have received a copy of the GNU General Public License
|
---|
| 18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
| 19 | */
|
---|
| 20 | #endregion
|
---|
| 21 |
|
---|
| 22 | using System;
|
---|
| 23 | using System.ComponentModel;
|
---|
| 24 | using System.Windows.Forms;
|
---|
| 25 |
|
---|
| 26 | namespace HeuristicLab.Problems.VehicleRouting.Views {
|
---|
[6851] | 27 | public enum VRPFormat { Empty, TSPLib, Solomon, ORLib, LiLim, Cordeau }
|
---|
[4860] | 28 |
|
---|
| 29 | public sealed partial class VRPImportDialog : Form {
|
---|
| 30 | private string vrpFileName;
|
---|
| 31 | public string VRPFileName {
|
---|
| 32 | get { return vrpFileName; }
|
---|
| 33 | }
|
---|
| 34 | private string tourFileName;
|
---|
| 35 | public string TourFileName {
|
---|
| 36 | get { return tourFileName; }
|
---|
| 37 | }
|
---|
| 38 | private VRPFormat format;
|
---|
| 39 | public VRPFormat Format {
|
---|
| 40 | get { return format; }
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | public VRPImportDialog() {
|
---|
| 44 | InitializeComponent();
|
---|
| 45 | vrpFileName = string.Empty;
|
---|
| 46 | tourFileName = string.Empty;
|
---|
| 47 | format = VRPFormat.Empty;
|
---|
| 48 | }
|
---|
| 49 |
|
---|
| 50 | private void openVRPFileButton_Click(object sender, EventArgs e) {
|
---|
| 51 | if (openVRPFileDialog.ShowDialog(this) == DialogResult.OK) {
|
---|
| 52 | tspFileTextBox.Text = openVRPFileDialog.FileName;
|
---|
| 53 | tspFileTextBox.Enabled = true;
|
---|
| 54 | vrpFileName = openVRPFileDialog.FileName;
|
---|
| 55 | okButton.Enabled = true;
|
---|
| 56 |
|
---|
| 57 | tourFileTextBox.Text = string.Empty;
|
---|
| 58 | tourFileName = string.Empty;
|
---|
| 59 |
|
---|
| 60 | format = (VRPFormat)(openVRPFileDialog.FilterIndex);
|
---|
| 61 | }
|
---|
| 62 | }
|
---|
| 63 | private void openTourFileButton_Click(object sender, EventArgs e) {
|
---|
| 64 | if (openTourFileDialog.ShowDialog(this) == DialogResult.OK) {
|
---|
| 65 | tourFileTextBox.Text = openTourFileDialog.FileName;
|
---|
| 66 | tourFileTextBox.Enabled = true;
|
---|
| 67 | tourFileName = openTourFileDialog.FileName;
|
---|
| 68 | }
|
---|
| 69 | }
|
---|
| 70 | private void clearTourFileButton_Click(object sender, EventArgs e) {
|
---|
| 71 | tourFileTextBox.Text = string.Empty;
|
---|
| 72 | tourFileTextBox.Enabled = false;
|
---|
| 73 | tourFileName = string.Empty;
|
---|
| 74 | }
|
---|
| 75 |
|
---|
| 76 | private void VRPImportDialog_HelpButtonClicked(object sender, CancelEventArgs e) {
|
---|
| 77 | if (MessageBox.Show("Do you want to open the HeuristicLab wiki website?", "Help",
|
---|
| 78 | MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.Yes) {
|
---|
[8053] | 79 | System.Diagnostics.Process.Start("http://dev.heuristiclab.com/trac/hl/core/wiki/Vehicle%20Routing%20Problem");
|
---|
[4860] | 80 | }
|
---|
| 81 | }
|
---|
| 82 | }
|
---|
| 83 | }
|
---|