1 |
|
/* |
2 |
|
* Copyright: 2013-4 |
3 |
|
* Author: Jeff Epler <jepler@unpythonic.net> |
4 |
|
* Author: Michael Haberler <git@mah.priv.at> |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
8 |
|
* the Free Software Foundation; either version 2 of the License, or |
9 |
|
* (at your option) any later version. |
10 |
|
* |
11 |
|
* This program is distributed in the hope that it will be useful, |
12 |
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
|
* GNU General Public License for more details. |
15 |
|
* |
16 |
|
* You should have received a copy of the GNU General Public License |
17 |
|
* along with this program; if not, write to the Free Software |
18 |
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 |
|
*/ |
20 |
|
#include <string.h> |
21 |
|
#include "rs274ngc_interp.hh" |
22 |
|
#include <boost/python/object.hpp> |
23 |
|
|
24 |
|
#pragma GCC diagnostic error "-Wmissing-field-initializers" |
25 |
68 |
setup::setup() : |
26 |
|
AA_axis_offset(0.0), |
27 |
|
AA_current(0.0), |
28 |
|
AA_origin_offset(0.0), |
29 |
|
BB_axis_offset(0.0), |
30 |
|
BB_current(0.0), |
31 |
|
BB_origin_offset(0.0), |
32 |
|
CC_axis_offset(0.0), |
33 |
|
CC_current(0.0), |
34 |
|
CC_origin_offset(0.0), |
35 |
|
|
36 |
|
u_axis_offset(0.0), |
37 |
|
u_current(0.0), |
38 |
|
u_origin_offset(0.0), |
39 |
|
|
40 |
|
v_axis_offset(0.0), |
41 |
|
v_current(0.0), |
42 |
|
v_origin_offset(0.0), |
43 |
|
|
44 |
|
w_axis_offset(0.0), |
45 |
|
w_current(0.0), |
46 |
|
w_origin_offset(0.0), |
47 |
|
|
48 |
|
active_g_codes{}, |
49 |
|
active_m_codes{}, |
50 |
|
active_settings{}, |
51 |
|
|
52 |
|
arc_not_allowed(0), |
53 |
|
|
54 |
|
axis_offset_x(0.0), |
55 |
|
axis_offset_y(0.0), |
56 |
|
axis_offset_z(0.0), |
57 |
|
|
58 |
|
blocks{}, |
59 |
|
remap_level(0), |
60 |
|
blocktext{}, |
61 |
|
control_mode(0), |
62 |
|
current_pocket(0), |
63 |
|
|
64 |
|
current_x (0.0), |
65 |
|
current_y (0.0), |
66 |
|
current_z (0.0), |
67 |
|
cutter_comp_radius (0.0), |
68 |
|
cutter_comp_orientation(0), |
69 |
|
cutter_comp_side(0), |
70 |
|
cycle_cc (0.0), |
71 |
|
cycle_i (0.0), |
72 |
|
cycle_j (0.0), |
73 |
|
cycle_k (0.0), |
74 |
|
cycle_l(0), |
75 |
|
cycle_p (0.0), |
76 |
|
cycle_q (0.0), |
77 |
|
cycle_r (0.0), |
78 |
|
cycle_il (0.0), |
79 |
|
cycle_il_flag(0), |
80 |
|
distance_mode(MODE_ABSOLUTE), |
81 |
|
|
82 |
|
ijk_distance_mode(MODE_ABSOLUTE), |
83 |
|
feed_mode(0), |
84 |
|
feed_override(0), |
85 |
|
feed_rate (0.0), |
86 |
|
filename{}, |
87 |
|
file_pointer(NULL), |
88 |
|
flood(0), |
89 |
|
length_units(0), |
90 |
|
line_length(0), |
91 |
|
linetext{}, |
92 |
|
mist(0), |
93 |
|
motion_mode(0), |
94 |
|
origin_index(0), |
95 |
|
origin_offset_x (0.0), |
96 |
|
origin_offset_y (0.0), |
97 |
|
origin_offset_z (0.0), |
98 |
|
rotation_xy (0.0), |
99 |
|
|
100 |
|
parameters{}, |
101 |
|
parameter_occurrence(0), |
102 |
|
parameter_numbers{}, |
103 |
|
parameter_values{}, |
104 |
|
named_parameter_occurrence(0), |
105 |
|
named_parameters{}, |
106 |
|
named_parameter_values{}, |
107 |
|
percent_flag(0), |
108 |
|
plane(0), |
109 |
|
probe_flag(0), |
110 |
|
input_flag(0), |
111 |
|
toolchange_flag(0), |
112 |
|
input_index(0), |
113 |
|
input_digital(0), |
114 |
|
cutter_comp_firstmove(0), |
115 |
|
program_x (0.0), |
116 |
|
program_y (0.0), |
117 |
|
program_z (0.0), |
118 |
|
retract_mode(R_PLANE), |
119 |
|
random_toolchanger(0), |
120 |
|
selected_pocket(0), |
121 |
|
selected_tool(0), |
122 |
|
sequence_number(0), |
123 |
|
speed (0.0), |
124 |
|
spindle_mode(CONSTANT_RPM), |
125 |
|
speed_feed_mode(0), |
126 |
|
speed_override(0), |
127 |
|
spindle_turning(0), |
128 |
|
stack{}, |
129 |
|
stack_index(0), |
130 |
|
tool_offset{{0,0,0},0,0,0,0,0,0}, |
131 |
|
pockets_max(0), |
132 |
|
tool_table{}, |
133 |
|
traverse_rate (0.0), |
134 |
|
orient_offset (0.0), |
135 |
|
|
136 |
|
defining_sub(0), |
137 |
|
sub_name(NULL), |
138 |
|
doing_continue(0), |
139 |
|
doing_break(0), |
140 |
|
executed_if(0), |
141 |
|
|
142 |
|
skipping_o(NULL), |
143 |
|
skipping_to_sub(NULL), |
144 |
|
skipping_start(0), |
145 |
|
test_value (0.0), |
146 |
|
return_value (0.0), |
147 |
|
value_returned(0), |
148 |
|
call_level(0), |
149 |
|
sub_context{}, |
150 |
|
call_state(0), |
151 |
|
adaptive_feed(0), |
152 |
|
feed_hold(0), |
153 |
|
loggingLevel(0), |
154 |
|
debugmask(0), |
155 |
|
log_file{}, |
156 |
|
program_prefix{}, |
157 |
|
subroutines{}, |
158 |
|
use_lazy_close(0), |
159 |
|
lazy_closing(0), |
160 |
|
wizard_root{}, |
161 |
|
tool_change_at_g30(0), |
162 |
|
tool_change_quill_up(0), |
163 |
|
tool_change_with_spindle_on(0), |
164 |
|
a_axis_wrapped(0), |
165 |
|
b_axis_wrapped(0), |
166 |
|
c_axis_wrapped(0), |
167 |
|
|
168 |
|
a_indexer_jnum(0), |
169 |
|
b_indexer_jnum(0), |
170 |
|
c_indexer_jnum(0), |
171 |
|
|
172 |
|
lathe_diameter_mode(0), |
173 |
|
mdi_interrupt(0), |
174 |
|
feature_set(0), |
175 |
|
disable_g92_persistence(0), |
176 |
|
pythis(), |
177 |
|
on_abort_command(NULL), |
178 |
340 |
init_once(0) |
179 |
|
{ |
180 |
68 |
} |
181 |
|
|
182 |
|
setup::~setup() { |
183 |
|
assert(!pythis || Py_IsInitialized()); |
184 |
|
if(pythis) delete pythis; |
185 |
|
} |
186 |
|
|
187 |
680 |
block_struct::block_struct () |
188 |
|
: a_flag(0), a_number(0), b_flag(0), b_number(0), |
189 |
|
c_flag(0), c_number(0), comment{}, d_number_float(0), d_flag(0), |
190 |
|
e_flag(0), e_number(0), f_flag(0), f_number(0), |
191 |
|
g_modes{}, h_flag(0), h_number(0), i_flag(0), i_number(0), |
192 |
|
j_flag(0), j_number(0), k_flag(0), k_number(0), |
193 |
|
l_number(0), l_flag(0), line_number(0), saved_line_number(0), |
194 |
|
n_number(0), motion_to_be(0), m_count(0), m_modes{}, |
195 |
|
p_number(0), p_flag(0), q_number(0), q_flag(0), |
196 |
|
r_flag(0), r_number(0), s_flag(0), s_number(0), |
197 |
|
t_flag(0), t_number(0), u_flag(0), u_number(0), |
198 |
|
v_flag(0), v_number(0), w_flag(0), w_number(0), |
199 |
|
x_flag(0), x_number(0), y_flag(0), y_number(0), |
200 |
|
z_flag(0), z_number(0), |
201 |
|
|
202 |
|
radius_flag(0), radius(0), theta_flag(0), theta(0), |
203 |
|
offset(0), o_type(0), call_type(0), o_name(NULL), |
204 |
|
params{}, param_cnt(0), breadcrumbs(), |
205 |
2040 |
executing_remap(NULL), remappings(), phase(0), builtin_used(0) { |
206 |
887 |
} |