Free cookie consent management tool by TermsFeed Policy Generator

source: stable/HeuristicLab.Problems.VehicleRouting.Views/3.4/VRPImportDialog.cs @ 10037

Last change on this file since 10037 was 9456, checked in by swagner, 11 years ago

Updated copyright year and added some missing license headers (#1889)

File size: 3.0 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2013 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
22using System;
23using System.ComponentModel;
24using System.Windows.Forms;
25
26namespace HeuristicLab.Problems.VehicleRouting.Views {
27  public enum VRPFormat { Empty, TSPLib, Solomon, ORLib, LiLim, Cordeau }
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) {
79        System.Diagnostics.Process.Start("http://dev.heuristiclab.com/trac/hl/core/wiki/Vehicle%20Routing%20Problem");
80      }
81    }
82  }
83}
Note: See TracBrowser for help on using the repository browser.