1 | #region License Information
|
---|
2 | /* HeuristicLab
|
---|
3 | * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
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.Text;
|
---|
25 | using System.Windows.Forms;
|
---|
26 | using HeuristicLab.Data;
|
---|
27 |
|
---|
28 | namespace HeuristicLab.Problems.VehicleRouting.Views {
|
---|
29 | public enum VRPFormat { Empty, TSPLib, Solomon, ORLib }
|
---|
30 |
|
---|
31 | public sealed partial class VRPImportDialog : Form {
|
---|
32 | private string vrpFileName;
|
---|
33 | public string VRPFileName {
|
---|
34 | get { return vrpFileName; }
|
---|
35 | }
|
---|
36 | private string tourFileName;
|
---|
37 | public string TourFileName {
|
---|
38 | get { return tourFileName; }
|
---|
39 | }
|
---|
40 | private VRPFormat format;
|
---|
41 | public VRPFormat Format {
|
---|
42 | get { return format; }
|
---|
43 | }
|
---|
44 |
|
---|
45 | public VRPImportDialog() {
|
---|
46 | InitializeComponent();
|
---|
47 | vrpFileName = string.Empty;
|
---|
48 | tourFileName = string.Empty;
|
---|
49 | format = VRPFormat.Empty;
|
---|
50 | }
|
---|
51 |
|
---|
52 | private void openVRPFileButton_Click(object sender, EventArgs e) {
|
---|
53 | if (openVRPFileDialog.ShowDialog(this) == DialogResult.OK) {
|
---|
54 | tspFileTextBox.Text = openVRPFileDialog.FileName;
|
---|
55 | tspFileTextBox.Enabled = true;
|
---|
56 | vrpFileName = openVRPFileDialog.FileName;
|
---|
57 | okButton.Enabled = true;
|
---|
58 |
|
---|
59 | tourFileTextBox.Text = string.Empty;
|
---|
60 | tourFileName = string.Empty;
|
---|
61 |
|
---|
62 | format = (VRPFormat)(openVRPFileDialog.FilterIndex);
|
---|
63 | }
|
---|
64 | }
|
---|
65 | private void openTourFileButton_Click(object sender, EventArgs e) {
|
---|
66 | if (openTourFileDialog.ShowDialog(this) == DialogResult.OK) {
|
---|
67 | tourFileTextBox.Text = openTourFileDialog.FileName;
|
---|
68 | tourFileTextBox.Enabled = true;
|
---|
69 | tourFileName = openTourFileDialog.FileName;
|
---|
70 | }
|
---|
71 | }
|
---|
72 | private void clearTourFileButton_Click(object sender, EventArgs e) {
|
---|
73 | tourFileTextBox.Text = string.Empty;
|
---|
74 | tourFileTextBox.Enabled = false;
|
---|
75 | tourFileName = string.Empty;
|
---|
76 | }
|
---|
77 |
|
---|
78 | private void VRPImportDialog_HelpButtonClicked(object sender, CancelEventArgs e) {
|
---|
79 | if (MessageBox.Show("Do you want to open the HeuristicLab wiki website?", "Help",
|
---|
80 | MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.Yes) {
|
---|
81 | System.Diagnostics.Process.Start("http://dev.heuristiclab.com/trac/hl/core/wiki/Vehicle%20Routing%20Problem");
|
---|
82 | }
|
---|
83 | }
|
---|
84 | }
|
---|
85 | }
|
---|