Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

canon_pre.cc File Reference

#include "canon.hh"
#include <math.h>
#include <stdio.h>
#include <string.h>

Include dependency graph for canon_pre.cc:

Include dependency graph

Go to the source code of this file.

Defines

#define SET_TO   =
#define IS   ==
#define AND   &&
#define OR   ||
#define PRINT0(control)
#define PRINT1(control, arg1)
#define PRINT2(control, arg1, arg2)
#define PRINT3(control, arg1, arg2, arg3)
#define PRINT4(control, arg1, arg2, arg3, arg4)
#define PRINT5(control, arg1, arg2, arg3, arg4, arg5)
#define PRINT6(control, arg1, arg2, arg3, arg4, arg5, arg6)
#define PRINT7(control, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
#define PRINT10(control, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10)

Functions

void rs274ngc_line_text (char *line_text, int max_size)
void print_nc_line_number ()
void SET_ORIGIN_OFFSETS (double x, double y, double z)
void USE_LENGTH_UNITS (CANON_UNITS in_unit)
void SET_TRAVERSE_RATE (double rate)
void STRAIGHT_TRAVERSE (double x, double y, double z)
void SET_FEED_RATE (double rate)
void SET_FEED_REFERENCE (CANON_FEED_REFERENCE reference)
void SET_MOTION_CONTROL_MODE (CANON_MOTION_MODE mode)
void SELECT_PLANE (CANON_PLANE in_plane)
void SET_CUTTER_RADIUS_COMPENSATION (double radius)
void START_CUTTER_RADIUS_COMPENSATION (int side)
void STOP_CUTTER_RADIUS_COMPENSATION ()
void START_SPEED_FEED_SYNCH ()
void STOP_SPEED_FEED_SYNCH ()
void ARC_FEED (double first_end, double second_end, double first_axis, double second_axis, int rotation, double axis_end_point)
void STRAIGHT_FEED (double x, double y, double z)
void STRAIGHT_PROBE (double x, double y, double z)
void DWELL (double seconds)
void SPINDLE_RETRACT_TRAVERSE ()
void START_SPINDLE_CLOCKWISE ()
void START_SPINDLE_COUNTERCLOCKWISE ()
void SET_SPINDLE_SPEED (double rpm)
void STOP_SPINDLE_TURNING ()
void SPINDLE_RETRACT ()
void ORIENT_SPINDLE (double orientation, CANON_DIRECTION direction)
void USE_NO_SPINDLE_FORCE ()
void USE_TOOL_LENGTH_OFFSET (double length)
void CHANGE_TOOL (int slot)
void SELECT_TOOL (int slot)
void CLAMP_AXIS (CANON_AXIS axis)
void COMMENT (char *s)
void DISABLE_FEED_OVERRIDE ()
void DISABLE_SPEED_OVERRIDE ()
void ENABLE_FEED_OVERRIDE ()
void ENABLE_SPEED_OVERRIDE ()
void FLOOD_OFF ()
void FLOOD_ON ()
void INIT_CANON ()
void MESSAGE (char *s)
void MIST_OFF ()
void MIST_ON ()
void PALLET_SHUTTLE ()
void TURN_PROBE_OFF ()
void TURN_PROBE_ON ()
void UNCLAMP_AXIS (CANON_AXIS axis)
void PROGRAM_STOP ()
void OPTIONAL_PROGRAM_STOP ()
void PROGRAM_END ()
double GET_EXTERNAL_FEED_RATE ()
int GET_EXTERNAL_FLOOD ()
double GET_EXTERNAL_LENGTH_UNIT_FACTOR ()
CANON_UNITS GET_EXTERNAL_LENGTH_UNIT_TYPE ()
int GET_EXTERNAL_MIST ()
CANON_MOTION_MODE GET_EXTERNAL_MOTION_CONTROL_MODE ()
void GET_EXTERNAL_PARAMETER_FILE_NAME (char *file_name, int max_size)
CANON_PLANE GET_EXTERNAL_PLANE ()
double GET_EXTERNAL_POSITION_X ()
double GET_EXTERNAL_POSITION_Y ()
double GET_EXTERNAL_POSITION_Z ()
double GET_EXTERNAL_PROBE_POSITION_X ()
double GET_EXTERNAL_PROBE_POSITION_Y ()
double GET_EXTERNAL_PROBE_POSITION_Z ()
double GET_EXTERNAL_PROBE_VALUE ()
int GET_EXTERNAL_QUEUE_EMPTY ()
double GET_EXTERNAL_SPEED ()
CANON_DIRECTION GET_EXTERNAL_SPINDLE ()
int GET_EXTERNAL_TOOL_SLOT ()
int GET_EXTERNAL_TOOL_MAX ()
CANON_TOOL_TABLE GET_EXTERNAL_TOOL_TABLE (int pocket)
double GET_EXTERNAL_TRAVERSE_RATE ()

Variables

FILE * _outfile = NULL
CANON_PLANE _active_plane = CANON_PLANE_XY
int _active_slot = 1
double _feed_rate = 0.0
int _flood = 0
double _length_unit_factor = 1
CANON_UNITS _length_unit_type = CANON_UNITS_MM
int _line_number = 1
int _mist = 0
CANON_MOTION_MODE _motion_mode = CANON_CONTINUOUS
char _parameter_file_name [PARAMETER_FILE_NAME_LENGTH]
double _probe_position_x = 0
double _probe_position_y = 0
double _probe_position_z = 0
double _program_origin_x = 0
double _program_origin_y = 0
double _program_origin_z = 0
double _program_position_x = 0
double _program_position_y = 0
double _program_position_z = 0
double _spindle_speed
CANON_DIRECTION _spindle_turning
int _tool_max = 68
CANON_TOOL_TABLE _tools [CANON_TOOL_MAX]
double _traverse_rate


Define Documentation

#define AND   &&
 

Definition at line 25 of file canon_pre.cc.

#define IS   ==
 

Definition at line 24 of file canon_pre.cc.

#define OR   ||
 

Definition at line 26 of file canon_pre.cc.

#define PRINT0 control   
 

Value:

if (1)                        \
          {{if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  "%5d ", _line_number++); \
           print_nc_line_number();                    \
           {if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  control);                \
          } else

Definition at line 136 of file canon_pre.cc.

#define PRINT1 control,
arg1   
 

Value:

if (1)                  \
          {{if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  "%5d ", _line_number++); \
           print_nc_line_number();                    \
           {if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  control, arg1);          \
          } else

Definition at line 141 of file canon_pre.cc.

#define PRINT10 control,
arg1,
arg2,
arg3,
arg4,
arg5,
arg6,
arg7,
arg8,
arg9,
arg10   
 

Value:

if (1)                                                            \
          {{if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  "%5d ", _line_number++);                       \
           print_nc_line_number();                                          \
           fprintf(_outfile, control,                                       \
                   arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);     \
          } else

Definition at line 177 of file canon_pre.cc.

#define PRINT2 control,
arg1,
arg2   
 

Value:

if (1)            \
          {{if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  "%5d ", _line_number++); \
           print_nc_line_number();                    \
           {if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  control, arg1, arg2);    \
          } else

Definition at line 146 of file canon_pre.cc.

#define PRINT3 control,
arg1,
arg2,
arg3   
 

Value:

if (1)         \
          {{if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  "%5d ", _line_number++);    \
           print_nc_line_number();                       \
           {if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  control, arg1, arg2, arg3); \
          } else

Definition at line 151 of file canon_pre.cc.

#define PRINT4 control,
arg1,
arg2,
arg3,
arg4   
 

Value:

if (1)         \
          {{if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  "%5d ", _line_number++);          \
           print_nc_line_number();                             \
           {if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  control, arg1, arg2, arg3, arg4); \
          } else

Definition at line 156 of file canon_pre.cc.

#define PRINT5 control,
arg1,
arg2,
arg3,
arg4,
arg5   
 

Value:

if (1)         \
          {{if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  "%5d ", _line_number++);                \
           print_nc_line_number();                                   \
           {if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  control, arg1, arg2, arg3, arg4, arg5); \
          } else

Definition at line 161 of file canon_pre.cc.

#define PRINT6 control,
arg1,
arg2,
arg3,
arg4,
arg5,
arg6   
 

Value:

if (1)         \
          {{if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  "%5d ", _line_number++);                      \
           print_nc_line_number();                                         \
           {if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  control, arg1, arg2, arg3, arg4, arg5, arg6); \
          } else

Definition at line 166 of file canon_pre.cc.

#define PRINT7 control,
arg1,
arg2,
arg3,
arg4,
arg5,
arg6,
arg7   
 

Value:

if (1) \
          {{if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  "%5d ", _line_number++);                    \
           print_nc_line_number();                                       \
           {if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  control,                                    \
                           arg1, arg2, arg3, arg4, arg5, arg6, arg7);    \
          } else

Definition at line 171 of file canon_pre.cc.

#define SET_TO   =
 

Definition at line 23 of file canon_pre.cc.


Function Documentation

void ARC_FEED double    first_end,
double    second_end,
double    first_axis,
double    second_axis,
int    rotation,
double    axis_end_point
 

Definition at line 406 of file canon_pre.cc.

Referenced by convert_arc_comp1(), convert_arc_comp2(), and convert_straight_comp2().

00419 {
00420   fprintf(_outfile, "%5d ", _line_number++);
00421   print_nc_line_number();
00422   fprintf(_outfile, "ARC_FEED(%.4f, %.4f, %.4f, %.4f, %d, %.4f"
00423 #ifdef AA
00424          ", %.4f" /*AA*/
00425 #endif
00426 #ifdef BB
00427          ", %.4f" /*BB*/
00428 #endif
00429 #ifdef CC
00430          ", %.4f" /*CC*/
00431 #endif
00432          ")\n", first_end, second_end, first_axis, second_axis,
00433          rotation, axis_end_point
00434 #ifdef AA
00435          , a /*AA*/
00436 #endif
00437 #ifdef BB
00438          , b /*BB*/
00439 #endif
00440 #ifdef CC
00441          , c /*CC*/
00442 #endif
00443          );
00444   if (_active_plane IS CANON_PLANE_XY)
00445     {
00446       _program_position_x SET_TO first_end;
00447       _program_position_y SET_TO second_end;
00448       _program_position_z SET_TO axis_end_point;
00449     }
00450   else if (_active_plane IS CANON_PLANE_YZ)
00451     {
00452       _program_position_x SET_TO axis_end_point;
00453       _program_position_y SET_TO first_end;
00454       _program_position_z SET_TO second_end;
00455     }
00456   else /* if (_active_plane IS CANON_PLANE_XZ) */
00457     {
00458       _program_position_x SET_TO second_end;
00459       _program_position_y SET_TO axis_end_point;
00460       _program_position_z SET_TO first_end;
00461     }
00462 #ifdef AA
00463   _program_position_a SET_TO a; /*AA*/
00464 #endif
00465 #ifdef BB
00466   _program_position_b SET_TO b; /*BB*/
00467 #endif
00468 #ifdef CC
00469   _program_position_c SET_TO c; /*CC*/
00470 #endif
00471 }

void CHANGE_TOOL int    slot
 

Definition at line 669 of file canon_pre.cc.

00670 {
00671   PRINT1("CHANGE_TOOL(%d)\n", slot);
00672   _active_slot SET_TO slot;
00673 }

void CLAMP_AXIS CANON_AXIS    axis
 

Definition at line 681 of file canon_pre.cc.

00682 {PRINT1("CLAMP_AXIS(%s)\n",
00683         (axis IS CANON_AXIS_X) ? "CANON_AXIS_X" :
00684         (axis IS CANON_AXIS_Y) ? "CANON_AXIS_Y" :
00685         (axis IS CANON_AXIS_Z) ? "CANON_AXIS_Z" :
00686         (axis IS CANON_AXIS_A) ? "CANON_AXIS_A" :
00687         (axis IS CANON_AXIS_C) ? "CANON_AXIS_C" : "UNKNOWN");}

void COMMENT char *    s
 

Definition at line 689 of file canon_pre.cc.

Referenced by convert_distance_mode(), convert_feed_mode(), convert_retract_mode(), and find_ends().

00690 {PRINT1("COMMENT(\"%s\")\n", s);}

void DISABLE_FEED_OVERRIDE  
 

Definition at line 692 of file canon_pre.cc.

00693 {PRINT0("DISABLE_FEED_OVERRIDE()\n");}

void DISABLE_SPEED_OVERRIDE  
 

Definition at line 695 of file canon_pre.cc.

00696 {PRINT0("DISABLE_SPEED_OVERRIDE()\n");}

void DWELL double    seconds
 

Definition at line 619 of file canon_pre.cc.

00620 {PRINT1("DWELL(%.4f)\n", seconds);}

void ENABLE_FEED_OVERRIDE  
 

Definition at line 698 of file canon_pre.cc.

00699 {PRINT0("ENABLE_FEED_OVERRIDE()\n");}

void ENABLE_SPEED_OVERRIDE  
 

Definition at line 701 of file canon_pre.cc.

00702 {PRINT0("ENABLE_SPEED_OVERRIDE()\n");}

void FLOOD_OFF  
 

Definition at line 704 of file canon_pre.cc.

00705 {
00706   PRINT0("FLOOD_OFF()\n");
00707   _flood SET_TO 0;
00708 }

void FLOOD_ON  
 

Definition at line 710 of file canon_pre.cc.

00711 {
00712   PRINT0("FLOOD_ON()\n");
00713   _flood SET_TO 1;
00714 }

double GET_EXTERNAL_FEED_RATE  
 

Definition at line 785 of file canon_pre.cc.

00786 {
00787   return _feed_rate;
00788 }

int GET_EXTERNAL_FLOOD  
 

Definition at line 791 of file canon_pre.cc.

00792 {
00793   return _flood;
00794 }

double GET_EXTERNAL_LENGTH_UNIT_FACTOR  
 

Definition at line 797 of file canon_pre.cc.

00798 {
00799   return 1/_length_unit_factor;
00800 }

CANON_UNITS GET_EXTERNAL_LENGTH_UNIT_TYPE  
 

Definition at line 803 of file canon_pre.cc.

00804 {
00805   return _length_unit_type;
00806 }

int GET_EXTERNAL_MIST  
 

Definition at line 809 of file canon_pre.cc.

00810 {
00811   return _mist;
00812 }

CANON_MOTION_MODE GET_EXTERNAL_MOTION_CONTROL_MODE  
 

Definition at line 815 of file canon_pre.cc.

00816 {
00817   return _motion_mode;
00818 }

void GET_EXTERNAL_PARAMETER_FILE_NAME char *    file_name,
int    max_size
 

Definition at line 867 of file canon_pre.cc.

00868                                   : to copy file name into       */
00869  int max_size)           /* maximum number of characters to copy */
00870 {
00871   if (strlen(_parameter_file_name) < max_size)
00872     strcpy(file_name, _parameter_file_name);
00873   else
00874     file_name[0] SET_TO 0;
00875 }

CANON_PLANE GET_EXTERNAL_PLANE  
 

Definition at line 877 of file canon_pre.cc.

00878 {
00879   return _active_plane;
00880 }

double GET_EXTERNAL_POSITION_X  
 

Definition at line 907 of file canon_pre.cc.

00908 {
00909   return _program_position_x;
00910 }

double GET_EXTERNAL_POSITION_Y  
 

Definition at line 913 of file canon_pre.cc.

00914 {
00915   return _program_position_y;
00916 }

double GET_EXTERNAL_POSITION_Z  
 

Definition at line 919 of file canon_pre.cc.

00920 {
00921   return _program_position_z;
00922 }

double GET_EXTERNAL_PROBE_POSITION_X  
 

Definition at line 953 of file canon_pre.cc.

00954 {
00955   return _probe_position_x;
00956 }

double GET_EXTERNAL_PROBE_POSITION_Y  
 

Definition at line 960 of file canon_pre.cc.

00961 {
00962   return _probe_position_y;
00963 }

double GET_EXTERNAL_PROBE_POSITION_Z  
 

Definition at line 967 of file canon_pre.cc.

00968 {
00969   return _probe_position_z;
00970 }

double GET_EXTERNAL_PROBE_VALUE  
 

Definition at line 975 of file canon_pre.cc.

00976 {
00977   return 1.0;
00978 }

int GET_EXTERNAL_QUEUE_EMPTY  
 

Definition at line 982 of file canon_pre.cc.

00983 {
00984   return 1;
00985 }

double GET_EXTERNAL_SPEED  
 

Definition at line 988 of file canon_pre.cc.

00989 {
00990   return _spindle_speed;
00991 }

CANON_DIRECTION GET_EXTERNAL_SPINDLE  
 

Definition at line 994 of file canon_pre.cc.

00995 {
00996   return _spindle_turning;
00997 }

int GET_EXTERNAL_TOOL_MAX  
 

Definition at line 1008 of file canon_pre.cc.

01009 {
01010   return _tool_max;
01011 }

int GET_EXTERNAL_TOOL_SLOT  
 

Definition at line 1002 of file canon_pre.cc.

01003 {
01004   return _active_slot;
01005 }

CANON_TOOL_TABLE GET_EXTERNAL_TOOL_TABLE int    pocket
 

Definition at line 1015 of file canon_pre.cc.

Referenced by rs274ngc_load_tool_table().

01016 {
01017   return _tools[pocket];
01018 }

double GET_EXTERNAL_TRAVERSE_RATE  
 

Definition at line 1021 of file canon_pre.cc.

01022 {
01023   return _traverse_rate;
01024 }

void INIT_CANON  
 

Definition at line 716 of file canon_pre.cc.

00717 {
00718 }

void MESSAGE char *    s
 

Definition at line 720 of file canon_pre.cc.

Referenced by COMMENT().

00721 {PRINT1("MESSAGE(\"%s\")\n", s);}

void MIST_OFF  
 

Definition at line 723 of file canon_pre.cc.

00724 {
00725   PRINT0("MIST_OFF()\n");
00726   _mist SET_TO 0;
00727 }

void MIST_ON  
 

Definition at line 729 of file canon_pre.cc.

00730 {
00731   PRINT0("MIST_ON()\n");
00732   _mist SET_TO 1;
00733 }

void OPTIONAL_PROGRAM_STOP  
 

Definition at line 758 of file canon_pre.cc.

00759 {PRINT0("OPTIONAL_PROGRAM_STOP()\n");}

void ORIENT_SPINDLE double    orientation,
CANON_DIRECTION    direction
 

Definition at line 655 of file canon_pre.cc.

00656 {PRINT2("ORIENT_SPINDLE(%.4f, %s)\n", orientation,
00657         (direction IS CANON_CLOCKWISE) ? "CANON_CLOCKWISE" :
00658                                          "CANON_COUNTERCLOCKWISE");
00659 }

void PALLET_SHUTTLE  
 

Definition at line 735 of file canon_pre.cc.

00736 {PRINT0("PALLET_SHUTTLE()\n");}

void PROGRAM_END  
 

Definition at line 761 of file canon_pre.cc.

00762 {PRINT0("PROGRAM_END()\n");}

void PROGRAM_STOP  
 

Definition at line 755 of file canon_pre.cc.

00756 {PRINT0("PROGRAM_STOP()\n");}

void SELECT_PLANE CANON_PLANE    in_plane
 

Definition at line 377 of file canon_pre.cc.

Referenced by convert_set_plane(), and rs274ngc_init().

00378 {
00379   PRINT1("SELECT_PLANE(CANON_PLANE_%s)\n",
00380          ((in_plane IS CANON_PLANE_XY) ? "XY" :
00381           (in_plane IS CANON_PLANE_YZ) ? "YZ" :
00382           (in_plane IS CANON_PLANE_XZ) ? "XZ" : "UNKNOWN"));
00383   _active_plane SET_TO in_plane;
00384 }

void SELECT_TOOL int    slot
 

Definition at line 675 of file canon_pre.cc.

00676 {PRINT1("SELECT_TOOL(%d)\n", slot);}

void SET_CUTTER_RADIUS_COMPENSATION double    radius
 

Definition at line 386 of file canon_pre.cc.

00387 {PRINT1("SET_CUTTER_RADIUS_COMPENSATION(%.4f)\n", radius);}

void SET_FEED_RATE double    rate
 

Definition at line 344 of file canon_pre.cc.

00345 {
00346   PRINT1("SET_FEED_RATE(%.4f)\n", rate);
00347   _feed_rate SET_TO rate;
00348 }

void SET_FEED_REFERENCE CANON_FEED_REFERENCE    reference
 

Definition at line 350 of file canon_pre.cc.

Referenced by rs274ngc_init().

00351 {
00352   PRINT1("SET_FEED_REFERENCE(%s)\n",
00353          (reference IS CANON_WORKPIECE) ? "CANON_WORKPIECE" : "CANON_XYZ");
00354 }

void SET_MOTION_CONTROL_MODE CANON_MOTION_MODE    mode
 

Definition at line 356 of file canon_pre.cc.

Referenced by INIT_CANON(), and convert_control_mode().

00357 {
00358   if (mode IS CANON_EXACT_STOP)
00359     {
00360       PRINT0("SET_MOTION_CONTROL_MODE(CANON_EXACT_STOP)\n");
00361       _motion_mode SET_TO CANON_EXACT_STOP;
00362     }
00363   else if (mode IS CANON_EXACT_PATH)
00364     {
00365       PRINT0("SET_MOTION_CONTROL_MODE(CANON_EXACT_PATH)\n");
00366       _motion_mode SET_TO CANON_EXACT_PATH;
00367     }
00368   else if (mode IS CANON_CONTINUOUS)
00369     {
00370       PRINT0("SET_MOTION_CONTROL_MODE(CANON_CONTINUOUS)\n");
00371       _motion_mode SET_TO CANON_CONTINUOUS;
00372     }
00373   else
00374     PRINT0("SET_MOTION_CONTROL_MODE(UNKNOWN)\n");
00375 }

void SET_ORIGIN_OFFSETS double    x,
double    y,
double    z
 

Definition at line 187 of file canon_pre.cc.

Referenced by rs274ngc_init().

00199 {
00200   fprintf(_outfile, "%5d ", _line_number++);
00201   print_nc_line_number();
00202   fprintf(_outfile, "SET_ORIGIN_OFFSETS(%.4f, %.4f, %.4f"
00203 #ifdef AA
00204          ", %.4f"  /*AA*/
00205 #endif
00206 #ifdef BB
00207          ", %.4f"  /*BB*/
00208 #endif
00209 #ifdef CC
00210          ", %.4f"  /*CC*/
00211 #endif
00212          ")\n", x, y, z
00213 #ifdef AA
00214          , a  /*AA*/
00215 #endif
00216 #ifdef BB
00217          , b  /*BB*/
00218 #endif
00219 #ifdef CC
00220          , c  /*CC*/
00221 #endif
00222          );
00223   _program_position_x SET_TO _program_position_x + _program_origin_x - x;
00224   _program_position_y SET_TO _program_position_y + _program_origin_y - y;
00225   _program_position_z SET_TO _program_position_z + _program_origin_z - z;
00226 #ifdef AA
00227   _program_position_a SET_TO _program_position_a + _program_origin_a - a;/*AA*/
00228 #endif
00229 #ifdef BB
00230   _program_position_b SET_TO _program_position_b + _program_origin_b - b;/*BB*/
00231 #endif
00232 #ifdef CC
00233   _program_position_c SET_TO _program_position_c + _program_origin_c - c;/*CC*/
00234 #endif
00235 
00236   _program_origin_x SET_TO x;
00237   _program_origin_y SET_TO y;
00238   _program_origin_z SET_TO z;
00239 #ifdef AA
00240   _program_origin_a SET_TO a;  /*AA*/
00241 #endif
00242 #ifdef BB
00243   _program_origin_b SET_TO b;  /*BB*/
00244 #endif
00245 #ifdef CC
00246   _program_origin_c SET_TO c;  /*CC*/
00247 #endif
00248 }

void SET_SPINDLE_SPEED double    rpm
 

Definition at line 640 of file canon_pre.cc.

00641 {
00642   PRINT1("SET_SPINDLE_SPEED(%.4f)\n", rpm);
00643   _spindle_speed SET_TO rpm;
00644 }

void SET_TRAVERSE_RATE double    rate
 

Definition at line 287 of file canon_pre.cc.

00288 {
00289   PRINT1("SET_TRAVERSE_RATE(%.4f)\n", rate);
00290   _traverse_rate SET_TO rate;
00291 }

void SPINDLE_RETRACT  
 

Definition at line 652 of file canon_pre.cc.

00653 {PRINT0("SPINDLE_RETRACT()\n");}

void SPINDLE_RETRACT_TRAVERSE  
 

Definition at line 623 of file canon_pre.cc.

00624 {PRINT0("SPINDLE_RETRACT_TRAVERSE()\n");}

void START_CUTTER_RADIUS_COMPENSATION int    side
 

Definition at line 389 of file canon_pre.cc.

00390 {PRINT1("START_CUTTER_RADIUS_COMPENSATION(%s)\n",
00391         (side IS CANON_SIDE_LEFT)  ? "LEFT"  :
00392         (side IS CANON_SIDE_RIGHT) ? "RIGHT" : "UNKNOWN");
00393 }

void START_SPEED_FEED_SYNCH  
 

Definition at line 398 of file canon_pre.cc.

00399 {PRINT0 ("START_SPEED_FEED_SYNCH()\n");}

void START_SPINDLE_CLOCKWISE  
 

Definition at line 626 of file canon_pre.cc.

00627 {
00628   PRINT0("START_SPINDLE_CLOCKWISE()\n");
00629   _spindle_turning SET_TO ((_spindle_speed IS 0) ? CANON_STOPPED :
00630                                                    CANON_CLOCKWISE);
00631 }

void START_SPINDLE_COUNTERCLOCKWISE  
 

Definition at line 633 of file canon_pre.cc.

00634 {
00635   PRINT0("START_SPINDLE_COUNTERCLOCKWISE()\n");
00636   _spindle_turning SET_TO ((_spindle_speed IS 0) ? CANON_STOPPED :
00637                                                    CANON_COUNTERCLOCKWISE);
00638 }

void STOP_CUTTER_RADIUS_COMPENSATION  
 

Definition at line 395 of file canon_pre.cc.

00396 {PRINT0 ("STOP_CUTTER_RADIUS_COMPENSATION()\n");}

void STOP_SPEED_FEED_SYNCH  
 

Definition at line 401 of file canon_pre.cc.

00402 {PRINT0 ("STOP_SPEED_FEED_SYNCH()\n");}

void STOP_SPINDLE_TURNING  
 

Definition at line 646 of file canon_pre.cc.

00647 {
00648   PRINT0("STOP_SPINDLE_TURNING()\n");
00649   _spindle_turning SET_TO CANON_STOPPED;
00650 }

void STRAIGHT_FEED double    x,
double    y,
double    z
 

Definition at line 473 of file canon_pre.cc.

Referenced by convert_straight_comp1(), and convert_straight_comp2().

00485 {
00486   fprintf(_outfile, "%5d ", _line_number++);
00487   print_nc_line_number();
00488   fprintf(_outfile, "STRAIGHT_FEED(%.4f, %.4f, %.4f"
00489 #ifdef AA
00490          ", %.4f" /*AA*/
00491 #endif
00492 #ifdef BB
00493          ", %.4f" /*BB*/
00494 #endif
00495 #ifdef CC
00496          ", %.4f" /*CC*/
00497 #endif
00498          ")\n", x, y, z
00499 #ifdef AA
00500          , a /*AA*/
00501 #endif
00502 #ifdef BB
00503          , b /*BB*/
00504 #endif
00505 #ifdef CC
00506          , c /*CC*/
00507 #endif
00508          );
00509   _program_position_x SET_TO x;
00510   _program_position_y SET_TO y;
00511   _program_position_z SET_TO z;
00512 #ifdef AA
00513   _program_position_a SET_TO a; /*AA*/
00514 #endif
00515 #ifdef BB
00516   _program_position_b SET_TO b; /*BB*/
00517 #endif
00518 #ifdef CC
00519   _program_position_c SET_TO c; /*CC*/
00520 #endif
00521 }

void STRAIGHT_PROBE double    x,
double    y,
double    z
 

Definition at line 528 of file canon_pre.cc.

00540 {
00541   double distance;
00542   double dx, dy, dz;
00543   double backoff;
00544 
00545   dx SET_TO (_program_position_x - x);
00546   dy SET_TO (_program_position_y - y);
00547   dz SET_TO (_program_position_z - z);
00548   distance SET_TO sqrt((dx * dx) + (dy * dy) + (dz * dz));
00549 
00550   fprintf(_outfile, "%5d ", _line_number++);
00551   print_nc_line_number();
00552   fprintf(_outfile, "STRAIGHT_PROBE(%.4f, %.4f, %.4f"
00553 #ifdef AA
00554          ", %.4f" /*AA*/
00555 #endif
00556 #ifdef BB
00557          ", %.4f" /*BB*/
00558 #endif
00559 #ifdef CC
00560          ", %.4f" /*CC*/
00561 #endif
00562          ")\n", x, y, z
00563 #ifdef AA
00564          , a /*AA*/
00565 #endif
00566 #ifdef BB
00567          , b /*BB*/
00568 #endif
00569 #ifdef CC
00570          , c /*CC*/
00571 #endif
00572          );
00573   _probe_position_x SET_TO x;
00574   _probe_position_y SET_TO y;
00575   _probe_position_z SET_TO z;
00576 #ifdef AA
00577   _probe_position_a SET_TO a; /*AA*/
00578 #endif
00579 #ifdef BB
00580   _probe_position_b SET_TO b; /*BB*/
00581 #endif
00582 #ifdef CC
00583   _probe_position_c SET_TO c; /*CC*/
00584 #endif
00585   if (distance IS 0)
00586     {
00587       _program_position_x SET_TO _program_position_x;
00588       _program_position_y SET_TO _program_position_y;
00589       _program_position_z SET_TO _program_position_z;
00590     }
00591   else
00592     {
00593       backoff SET_TO ((_length_unit_type IS CANON_UNITS_MM) ? 0.254 : 0.01);
00594       _program_position_x SET_TO (x + (backoff * (dx / distance)));
00595       _program_position_y SET_TO (y + (backoff * (dy / distance)));
00596       _program_position_z SET_TO (z + (backoff * (dz / distance)));
00597     }
00598 #ifdef AA
00599   _program_position_a SET_TO a; /*AA*/
00600 #endif
00601 #ifdef BB
00602   _program_position_b SET_TO b; /*BB*/
00603 #endif
00604 #ifdef CC
00605   _program_position_c SET_TO c; /*CC*/
00606 #endif
00607 }

void STRAIGHT_TRAVERSE double    x,
double    y,
double    z
 

Definition at line 293 of file canon_pre.cc.

Referenced by convert_straight_comp1(), and convert_straight_comp2().

00305 {
00306   fprintf(_outfile, "%5d ", _line_number++);
00307   print_nc_line_number();
00308   fprintf(_outfile, "STRAIGHT_TRAVERSE(%.4f, %.4f, %.4f"
00309 #ifdef AA
00310          ", %.4f" /*AA*/
00311 #endif
00312 #ifdef BB
00313          ", %.4f" /*BB*/
00314 #endif
00315 #ifdef CC
00316          ", %.4f" /*CC*/
00317 #endif
00318          ")\n", x, y, z
00319 #ifdef AA
00320          , a /*AA*/
00321 #endif
00322 #ifdef BB
00323          , b /*BB*/
00324 #endif
00325 #ifdef CC
00326          , c /*CC*/
00327 #endif
00328          );
00329   _program_position_x SET_TO x;
00330   _program_position_y SET_TO y;
00331   _program_position_z SET_TO z;
00332 #ifdef AA
00333   _program_position_a SET_TO a; /*AA*/
00334 #endif
00335 #ifdef BB
00336   _program_position_b SET_TO b; /*BB*/
00337 #endif
00338 #ifdef CC
00339   _program_position_c SET_TO c; /*CC*/
00340 #endif
00341 }

void TURN_PROBE_OFF  
 

Definition at line 738 of file canon_pre.cc.

00739 {PRINT0("TURN_PROBE_OFF()\n");}

void TURN_PROBE_ON  
 

Definition at line 741 of file canon_pre.cc.

00742 {PRINT0("TURN_PROBE_ON()\n");}

void UNCLAMP_AXIS CANON_AXIS    axis
 

Definition at line 744 of file canon_pre.cc.

00745 {PRINT1("UNCLAMP_AXIS(%s)\n",
00746         (axis IS CANON_AXIS_X) ? "CANON_AXIS_X" :
00747         (axis IS CANON_AXIS_Y) ? "CANON_AXIS_Y" :
00748         (axis IS CANON_AXIS_Z) ? "CANON_AXIS_Z" :
00749         (axis IS CANON_AXIS_A) ? "CANON_AXIS_A" :
00750         (axis IS CANON_AXIS_B) ? "CANON_AXIS_B" :
00751         (axis IS CANON_AXIS_C) ? "CANON_AXIS_C" : "UNKNOWN");}

void USE_LENGTH_UNITS CANON_UNITS    in_unit
 

Definition at line 250 of file canon_pre.cc.

Referenced by rs274ngc_init().

00251 {
00252   if (in_unit IS CANON_UNITS_INCHES)
00253     {
00254       PRINT0("USE_LENGTH_UNITS(CANON_UNITS_INCHES)\n");
00255       if (_length_unit_type IS CANON_UNITS_MM)
00256         {
00257           _length_unit_type SET_TO CANON_UNITS_INCHES;
00258           _length_unit_factor SET_TO 25.4;
00259           _program_origin_x SET_TO (_program_origin_x / 25.4);
00260           _program_origin_y SET_TO (_program_origin_y / 25.4);
00261           _program_origin_z SET_TO (_program_origin_z / 25.4);
00262           _program_position_x SET_TO (_program_position_x / 25.4);
00263           _program_position_y SET_TO (_program_position_y / 25.4);
00264           _program_position_z SET_TO (_program_position_z / 25.4);
00265         }
00266     }
00267   else if (in_unit IS CANON_UNITS_MM)
00268     {
00269       PRINT0("USE_LENGTH_UNITS(CANON_UNITS_MM)\n");
00270       if (_length_unit_type IS CANON_UNITS_INCHES)
00271         {
00272           _length_unit_type SET_TO CANON_UNITS_MM;
00273           _length_unit_factor SET_TO 1.0;
00274           _program_origin_x SET_TO (_program_origin_x * 25.4);
00275           _program_origin_y SET_TO (_program_origin_y * 25.4);
00276           _program_origin_z SET_TO (_program_origin_z * 25.4);
00277           _program_position_x SET_TO (_program_position_x * 25.4);
00278           _program_position_y SET_TO (_program_position_y * 25.4);
00279           _program_position_z SET_TO (_program_position_z * 25.4);
00280         }
00281     }
00282   else
00283     PRINT0("USE_LENGTH_UNITS(UNKNOWN)\n");
00284 }

void USE_NO_SPINDLE_FORCE  
 

Definition at line 661 of file canon_pre.cc.

00662 {PRINT0("USE_NO_SPINDLE_FORCE()\n");}

void USE_TOOL_LENGTH_OFFSET double    length
 

Definition at line 666 of file canon_pre.cc.

Referenced by convert_tool_length_offset().

00667 {PRINT1("USE_TOOL_LENGTH_OFFSET(%.4f)\n", length);}

void print_nc_line_number  
 

Definition at line 105 of file canon_pre.cc.

00106 {
00107   char text[256];
00108   int k;
00109   int m;
00110 
00111   if(NULL == _outfile)
00112     {
00113       _outfile=stdout;
00114     }
00115 
00116   rs274ngc_line_text(text, 256);
00117   for (k SET_TO 0;
00118        ((k < 256) AND
00119         ((text[k] IS '\t') OR (text[k] IS ' ') OR (text[k] IS '/')));
00120        k++);
00121   if ((k < 256) AND ((text[k] IS 'n') OR (text[k] IS 'N')))
00122     {
00123       fputc('N', _outfile);
00124       for (k++, m SET_TO 0;
00125            ((k < 256) AND (text[k] >= '0') AND (text[k] <= '9'));
00126            k++, m++)
00127         fputc(text[k], _outfile);
00128       for (; m < 6; m++)
00129         fputc(' ', _outfile);
00130     }
00131   else if (k < 256)
00132     fprintf(_outfile, "N..... ");
00133 }

void rs274ngc_line_text char *    line_text,
int    max_size
 

Definition at line 12095 of file rs274ngc_pre.cc.

12096                                   : to copy line into            */
12097  int max_size)           /* maximum number of characters to copy */
12098 {
12099   int n;
12100   char * the_text;
12101 
12102   the_text SET_TO _setup.linetext;
12103   for (n SET_TO 0; n < (max_size - 1); n++)
12104     {
12105       if (the_text[n] ISNT 0)
12106         line_text[n] SET_TO the_text[n];
12107       else
12108         break;
12109     }
12110   line_text[n] SET_TO 0;
12111 }


Variable Documentation

CANON_PLANE _active_plane = CANON_PLANE_XY [static]
 

Definition at line 33 of file canon_pre.cc.

int _active_slot = 1 [static]
 

Definition at line 34 of file canon_pre.cc.

double _feed_rate = 0.0 [static]
 

Definition at line 35 of file canon_pre.cc.

int _flood = 0 [static]
 

Definition at line 36 of file canon_pre.cc.

double _length_unit_factor = 1 [static]
 

Definition at line 37 of file canon_pre.cc.

CANON_UNITS _length_unit_type = CANON_UNITS_MM [static]
 

Definition at line 38 of file canon_pre.cc.

int _line_number = 1 [static]
 

Definition at line 39 of file canon_pre.cc.

int _mist = 0 [static]
 

Definition at line 40 of file canon_pre.cc.

CANON_MOTION_MODE _motion_mode = CANON_CONTINUOUS [static]
 

Definition at line 41 of file canon_pre.cc.

FILE* _outfile = NULL
 

Definition at line 84 of file canon_pre.cc.

char _parameter_file_name[PARAMETER_FILE_NAME_LENGTH]
 

Definition at line 42 of file canon_pre.cc.

double _probe_position_x = 0 [static]
 

Definition at line 52 of file canon_pre.cc.

double _probe_position_y = 0 [static]
 

Definition at line 53 of file canon_pre.cc.

double _probe_position_z = 0 [static]
 

Definition at line 54 of file canon_pre.cc.

double _program_origin_x = 0 [static]
 

Definition at line 64 of file canon_pre.cc.

double _program_origin_y = 0 [static]
 

Definition at line 65 of file canon_pre.cc.

double _program_origin_z = 0 [static]
 

Definition at line 66 of file canon_pre.cc.

double _program_position_x = 0 [static]
 

Definition at line 76 of file canon_pre.cc.

double _program_position_y = 0 [static]
 

Definition at line 77 of file canon_pre.cc.

double _program_position_z = 0 [static]
 

Definition at line 78 of file canon_pre.cc.

double _spindle_speed [static]
 

Definition at line 79 of file canon_pre.cc.

CANON_DIRECTION _spindle_turning [static]
 

Definition at line 80 of file canon_pre.cc.

int _tool_max = 68
 

Definition at line 81 of file canon_pre.cc.

CANON_TOOL_TABLE _tools[CANON_TOOL_MAX]
 

Definition at line 82 of file canon_pre.cc.

double _traverse_rate [static]
 

Definition at line 83 of file canon_pre.cc.


Generated on Sun Dec 2 15:27:49 2001 for EMC by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001