/ src / emc / rs274ngc / interp_setup.cc
interp_setup.cc
  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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 19   */
 20  #ifndef BOOST_PYTHON_NAX_ARITY
 21  #define BOOST_PYTHON_MAX_ARITY 4
 22  #endif
 23  #include <string.h>
 24  #include "rs274ngc_interp.hh"
 25  #include <boost/python/object.hpp>
 26  
 27  #pragma GCC diagnostic error "-Wmissing-field-initializers"
 28  setup::setup() :
 29      AA_axis_offset(0.0),
 30      AA_current(0.0),
 31      AA_origin_offset(0.0),
 32      BB_axis_offset(0.0),
 33      BB_current(0.0),
 34      BB_origin_offset(0.0),
 35      CC_axis_offset(0.0),
 36      CC_current(0.0),
 37      CC_origin_offset(0.0),
 38  
 39      u_axis_offset(0.0),
 40      u_current(0.0),
 41      u_origin_offset(0.0),
 42  
 43      v_axis_offset(0.0),
 44      v_current(0.0),
 45      v_origin_offset(0.0),
 46  
 47      w_axis_offset(0.0),
 48      w_current(0.0),
 49      w_origin_offset(0.0),
 50  
 51      active_g_codes{},
 52      active_m_codes{},
 53      active_settings{},
 54  
 55      arc_not_allowed(0),
 56  
 57      axis_offset_x(0.0),
 58      axis_offset_y(0.0),
 59      axis_offset_z(0.0),
 60  
 61      blocks{},
 62      remap_level(0),
 63      blocktext{},
 64      control_mode(CANON_EXACT_STOP),
 65      current_pocket(0),
 66  
 67      current_x (0.0),
 68      current_y (0.0),
 69      current_z (0.0),
 70      cutter_comp_radius (0.0),
 71      cutter_comp_orientation(0),
 72      cutter_comp_side(0),
 73      cycle_cc (0.0),
 74      cycle_i (0.0),
 75      cycle_j (0.0),
 76      cycle_k (0.0),
 77      cycle_l(0),
 78      cycle_p (0.0),
 79      cycle_q (0.0),
 80      cycle_r (0.0),
 81      cycle_il (0.0),
 82      cycle_il_flag(0),
 83      distance_mode(MODE_ABSOLUTE),
 84  
 85      ijk_distance_mode(MODE_ABSOLUTE),
 86      feed_mode(0),
 87      feed_override(0),
 88      feed_rate (0.0),
 89      filename{},
 90      file_pointer(NULL),
 91      flood(0),
 92      length_units(CANON_UNITS_INCHES),
 93      line_length(0),
 94      linetext{},
 95      mist(0),
 96      motion_mode(0),
 97      origin_index(0),
 98      origin_offset_x (0.0),
 99      origin_offset_y (0.0),
100      origin_offset_z (0.0),
101      rotation_xy (0.0),
102  
103      parameters{0},
104      parameter_occurrence(0),
105      parameter_numbers{0},
106      parameter_values{0},
107      named_parameter_occurrence(0),
108      named_parameters{nullptr},
109      named_parameter_values{0},
110      percent_flag(0),
111      plane(CANON_PLANE_XY),
112      probe_flag(0),
113      input_flag(0),
114      toolchange_flag(0),
115      input_index(0),
116      input_digital(0),
117      cutter_comp_firstmove(0),
118      program_x (0.0),
119      program_y (0.0),
120      program_z (0.0),
121      retract_mode(R_PLANE),
122      random_toolchanger(0),
123      selected_pocket(0),
124      selected_tool(0),
125      sequence_number(0),
126      speed {0.0},
127      spindle_mode{CONSTANT_RPM},
128      speed_feed_mode{CANON_INDEPENDENT},
129      speed_override{false},
130      spindle_turning{CANON_STOPPED},
131      stack{},
132      stack_index(0),
133      tool_offset{{0,0,0},0,0,0,0,0,0},
134      pockets_max(0),
135      tool_table{},
136      traverse_rate (0.0),
137      orient_offset (0.0),
138  
139      defining_sub(0),
140      sub_name(NULL),
141      doing_continue(0),
142      doing_break(0),
143      executed_if(0),
144  
145      skipping_o(NULL),
146      skipping_to_sub(NULL),
147      skipping_start(0),
148      test_value (0.0),
149      return_value (0.0),
150      value_returned(0),
151      call_level(0),
152      sub_context{},
153      call_state(0),
154      adaptive_feed(0),
155      feed_hold(0),
156      loggingLevel(0),
157      debugmask(0),
158      log_file{},
159      program_prefix{},
160      subroutines{},
161      use_lazy_close(0),
162      lazy_closing(0),
163      wizard_root{},
164      tool_change_at_g30(0),
165      tool_change_quill_up(0),
166      tool_change_with_spindle_on(0),
167      a_axis_wrapped(0),
168      b_axis_wrapped(0),
169      c_axis_wrapped(0),
170  
171      a_indexer_jnum(0),
172      b_indexer_jnum(0),
173      c_indexer_jnum(0),
174  
175      lathe_diameter_mode(0),
176      mdi_interrupt(0),
177      feature_set(0),
178      disable_fanuc_style_sub(false),
179      loop_on_main_m99(false),
180      disable_g92_persistence(0),
181      pythis(),
182      on_abort_command(NULL),
183      init_once(CANON_STOPPED)
184  {
185    std::fill(parameters, parameters + interp_param_global::RS274NGC_MAX_PARAMETERS, 0);
186  }
187  
188  setup::~setup() {
189      assert(!pythis || Py_IsInitialized());
190      if(pythis) delete pythis;
191  }
192  
193  block_struct::block_struct ()
194      : a_flag(0), a_number(0), b_flag(0), b_number(0),
195        c_flag(0), c_number(0), comment{}, d_number_float(0), d_flag(0),
196        e_flag(0), e_number(0), f_flag(0), f_number(0),
197      g_modes{}, h_flag(0), h_number(0), i_flag(0), i_number(0),
198      j_flag(0), j_number(0), k_flag(0), k_number(0),
199      l_number(0), l_flag(0), line_number(0), saved_line_number(0),
200      n_number(0), motion_to_be(0), m_count(0), m_modes{},
201      p_number(0), p_flag(0), q_number(0), q_flag(0),
202      r_flag(0), r_number(0), s_flag(0), s_number(0),
203      t_flag(0), t_number(0), u_flag(0), u_number(0),
204      v_flag(0), v_number(0), w_flag(0), w_number(0),
205      x_flag(0), x_number(0), y_flag(0), y_number(0),
206      z_flag(0), z_number(0),
207  
208      radius_flag(0), radius(0), theta_flag(0), theta(0),
209      offset(0), o_type(0), call_type(0), o_name(NULL),
210      params{}, param_cnt(0), breadcrumbs(),
211      executing_remap(NULL), remappings(), phase(0), builtin_used(0) {
212      }