rs274ngc.hh

来自「CNC 的开放码,EMC2 V2.2.8版」· HH 代码 · 共 473 行 · 第 1/2 页

HH
473
字号
/********************************************************************* Description: rs274ngc.hh**   Derived from a work by Thomas Kramer** Author:* License: GPL Version 2* System: Linux*    * Copyright (c) 2004 All rights reserved.** Last change:* $Revision: 1.29 $* $Author: cradek $* $Date: 2007/11/02 20:13:39 $********************************************************************/#ifndef RS274NGC_HH#define RS274NGC_HH/* Size of certain arrays */#define ACTIVE_G_CODES 14#define ACTIVE_M_CODES 10#define ACTIVE_SETTINGS 3/**********************//* INCLUDE DIRECTIVES *//**********************/#include <stdio.h>#include "canon.hh"typedef struct setup_struct setup;typedef setup *setup_pointer;typedef struct block_struct block;typedef block *block_pointer;typedef bool ON_OFF;// Declare class so that we can use it in the typedef.class Interp;typedef int (Interp::*read_function_pointer) (char *, int *, block_pointer, double *);#define DEBUG_EMC#if 0#define LOG(level, fmt, args...) \       doLog("%02d(%d):%s:%d -- " fmt "\n", \       level, getpid(), __FILE__, __LINE__ , ## args)#else#define LOG(level, fmt, args...) \       if(level < _setup.loggingLevel)doLog("%02d(%d):%s:%d -- " fmt "\n", \       level, getpid(), __FILE__, __LINE__ , ## args)#endif#define logDebug(fmt, args...) LOG(0, fmt, ## args)class Interp {public:/* Interface functions to call to tell the interpreter what to do.   Return values indicate status of execution.   These functions may change the state of the interpreter. */// close the currently open NC code file int close();// execute a line of NC code#ifndef NOT_OLD_EMC_INTERP_COMPATIBLE int execute(const char *command = 0);#else int execute();#endif// stop running int exit();// get ready to run int init();// load a tool table int load_tool_table();// open a file of NC code int open(const char *filename);// read the mdi or the next line of the open NC code file int read(const char *mdi = 0);// reset yourself int reset();// restore interpreter variables from a file int restore_parameters(const char *filename);// save interpreter variables to file int save_parameters(const char *filename,                                    const double parameters[]);// synchronize your internal model with the external world int synch();/* Interface functions to call to get information from the interpreter.   If a function has a return value, the return value contains the information.   If a function returns nothing, information is copied into one of the   arguments to the function. These functions do not change the state of   the interpreter. */// copy active G codes into array [0]..[11] void active_g_codes(int *codes);// copy active M codes into array [0]..[6] void active_m_codes(int *codes);// copy active F, S settings into array [0]..[2] void active_settings(double *settings);// copy the text of the error message whose number is error_code into the// error_text array, but stop at max_size if the text is longer. void error_text(int error_code, char *error_text,                                int max_size); void setError(const char *fmt, ...);// copy the name of the currently open file into the file_name array,// but stop at max_size if the name is longer void file_name(char *file_name, int max_size);// return the length of the most recently read line int line_length();// copy the text of the most recently read line into the line_text array,// but stop at max_size if the text is longer void line_text(char *line_text, int max_size);// return the current sequence number (how many lines read) int sequence_number();// copy the function name from the stack_index'th position of the// function call stack at the time of the most recent error into// the function name string, but stop at max_size if the name is longer void stack_name(int stack_index, char *function_name,                                int max_size);// Get the parameter file name from the ini file. int ini_load(const char *filename); int line() { return sequence_number(); } char *command(char *buf, int len) { line_text(buf, len); return buf; } char *file(char *buf, int len) { file_name(buf, len); return buf; }private:/* Function prototypes for all  functions */ int arc_data_comp_ijk(int move, int plane, int side, double tool_radius,                          double current_x, double current_y, double end_x,                          double end_y, double i_number, double j_number,                          double *center_x, double *center_y, int *turn,                          double tolerance); int arc_data_comp_r(int move, int plane, int side, double tool_radius,                        double current_x, double current_y, double end_x,                        double end_y, double big_radius, double *center_x,                        double *center_y, int *turn, double tolerance); int arc_data_ijk(int move, int plane, double current_x, double current_y,                     double end_x, double end_y, double i_number,                     double j_number, double *center_x, double *center_y,                     int *turn, double tolerance); int arc_data_r(int move, int plane, double current_x, double current_y,                      double end_x, double end_y, double radius,                      double *center_x, double *center_y, int *turn,		      double tolerance); int check_g_codes(block_pointer block, setup_pointer settings); int check_items(block_pointer block, setup_pointer settings); int check_m_codes(block_pointer block); int check_other_codes(block_pointer block); int close_and_downcase(char *line); int convert_arc(int move, block_pointer block, setup_pointer settings); int convert_arc2(int move, block_pointer block,                  setup_pointer settings,                   double *current1, double *current2, double *current3,                   double end1, double end2, double end3,                  double AA_end, double BB_end, double CC_end,                   double u_end, double v_end, double w_end,                   double offset1, double offset2); int convert_arc_comp1(int move, block_pointer block,                       setup_pointer settings,                       double end_x, double end_y, double end_z,                       double AA_end, double BB_end, double CC_end,                        double u_end, double v_end, double w_end); int convert_arc_comp2(int move, block_pointer block,                       setup_pointer settings,                       double end_x, double end_y, double end_z,                       double AA_end, double BB_end, double CC_end,                       double u_end, double v_end, double w_end); char arc_axis1(int plane); char arc_axis2(int plane); int convert_axis_offsets(int g_code, block_pointer block,                                setup_pointer settings); int convert_param_comment(char *comment, char *expanded, int len); int convert_comment(char *comment); int convert_control_mode(int g_code, double tolerance, setup_pointer settings); int convert_adaptive_mode(int g_code, setup_pointer settings); int convert_coordinate_system(int g_code, setup_pointer settings); int convert_cutter_compensation(int g_code, block_pointer block,                                       setup_pointer settings); int convert_cutter_compensation_off(setup_pointer settings); int convert_cutter_compensation_on(int side, block_pointer block,                                          setup_pointer settings); int convert_cycle(int motion, block_pointer block,                         setup_pointer settings); int convert_cycle_g81(CANON_PLANE plane, double x, double y,                             double clear_z, double bottom_z); int convert_cycle_g82(CANON_PLANE plane, double x, double y,                             double clear_z, double bottom_z, double dwell); int convert_cycle_g83(CANON_PLANE plane, double x, double y,                             double r, double clear_z, double bottom_z,                             double delta); int convert_cycle_g84(CANON_PLANE plane, double x, double y,                             double clear_z, double bottom_z,                             CANON_DIRECTION direction,                             CANON_SPEED_FEED_MODE mode); int convert_cycle_g85(CANON_PLANE plane, double x, double y,                             double clear_z, double bottom_z); int convert_cycle_g86(CANON_PLANE plane, double x, double y,                             double clear_z, double bottom_z, double dwell,                             CANON_DIRECTION direction); int convert_cycle_g87(CANON_PLANE plane, double x, double offset_x,                             double y, double offset_y, double r,                             double clear_z, double middle_z, double bottom_z,                             CANON_DIRECTION direction); int convert_cycle_g88(CANON_PLANE plane, double x, double y,                             double bottom_z, double dwell,                             CANON_DIRECTION direction);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?