forked from patkan/pcb2gcode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.hpp
111 lines (96 loc) · 2.94 KB
/
options.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/*!\defgroup OPTIONS*/
/******************************************************************************/
/*!
\file options.hpp
\brief
\version
2013 - Erik Schuster - erik@muenchen-ist-toll.de\n
- Prepared documenting the code with doxygen.
- Formatted the code.
\version
1.1.4 - 2009, 2010 Patrick Birnzain <pbirnzain@users.sourceforge.net> and others
\copyright pcb2gcode is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
pcb2gcode is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with pcb2gcode. If not, see <http://www.gnu.org/licenses/>.
\ingroup OPTIONS
*/
/******************************************************************************/
#ifndef OPTIONS_HPP
#define OPTIONS_HPP
#include <stdexcept>
#include <boost/shared_ptr.hpp>
using boost::shared_ptr;
#include <boost/program_options.hpp>
namespace po = boost::program_options;
#include <boost/noncopyable.hpp>
#include <istream>
#include <string>
using std::string;
enum ErrorCodes
{
ERR_NOZWORK = 1,
ERR_NOCUTTERDIAMETER = 2,
ERR_NOZSAFE = 3,
ERR_NOOFFSET = 4,
ERR_NOZCUT = 5,
ERR_NOCUTFEED = 6,
ERR_NOCUTSPEED = 7,
ERR_NOCUTINFEED = 8,
ERR_NOZDRILL = 9,
ERR_NOZCHANGE = 10,
ERR_NODRILLFEED = 11,
ERR_NODRILLSPEED = 12,
ERR_NOMILLFEED = 13,
ERR_NOMILLSPEED = 14,
ERR_ZSAFELOWERZWORK = 15,
ERR_NEGATIVEMILLFEED = 16,
ERR_NEGATIVEMILLSPEED = 17,
ERR_ZSAFELOWERZDRILL = 18,
ERR_ZSAFELOWERZCHANGE = 19,
ERR_NEGATIVEDRILLFEED = 20,
ERR_ZSAFELOWERZCUT = 21,
ERR_NEGATIVECUTFEED = 22,
ERR_NEGATIVESPINDLESPEED = 23,
ERR_LOWCUTINFEED = 24,
ERR_NOOUTLINEWIDTH = 25,
ERR_NEGATIVEOUTLINEWIDTH = 26,
ERR_ZEROOUTLINEWIDTH = 27,
ERR_NEGATIVEDRILLSPEED = 28,
ERR_NOSOFTWARE = 29,
ERR_NOALX = 30,
ERR_NOALY = 31,
ERR_NOALPROBEFEED = 32,
ERR_NEGATIVEBRIDGE = 33,
ERR_BRIDGENOOPTIMISE = 34,
ERR_INVALIDPARAMETER = 100,
ERR_UNKNOWNPARAMETER = 101
};
/******************************************************************************/
/*
*/
/******************************************************************************/
class options: boost::noncopyable {
public:
static void parse(int argc, char** argv);
static void parse_files();
static void check_parameters();
static po::variables_map& get_vm() {
return instance().vm;
}
;
static string help();
private:
options();
po::variables_map vm;
po::options_description cli_options; //!< CLI options
po::options_description cfg_options; //!< generic options
static options& instance();
};
#endif // OPTIONS_HPP