⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 emc_nml.hh

📁 CNC 的开放码,EMC2 V2.2.8版
💻 HH
📖 第 1 页 / 共 4 页
字号:
// EMC_SPINDLE status base classclass EMC_SPINDLE_STAT_MSG:public RCS_STAT_MSG {  public:    EMC_SPINDLE_STAT_MSG(NMLTYPE t, size_t s):RCS_STAT_MSG(t, s) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_SPINDLE_STAT:public EMC_SPINDLE_STAT_MSG {  public:    EMC_SPINDLE_STAT();    // For internal NML/CMS use only.    void update(CMS * cms);    double speed;		// spindle speed in RPMs    int direction;		// 0 stopped, 1 forward, -1 reverse    int brake;			// 0 released, 1 engaged    int increasing;		// 1 increasing, -1 decreasing, 0 neither    int enabled;		// non-zero means enabled};class EMC_MOTION_STAT:public EMC_MOTION_STAT_MSG {  public:    EMC_MOTION_STAT():EMC_MOTION_STAT_MSG(EMC_MOTION_STAT_TYPE,					  sizeof(EMC_MOTION_STAT)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);    // aggregate of motion-related status classes    EMC_TRAJ_STAT traj;    EMC_AXIS_STAT axis[EMC_AXIS_MAX];    EMC_SPINDLE_STAT spindle;    int synch_di[EMC_MAX_DIO];  // motion inputs queried by interp    double analog_input[EMC_MAX_AIO]; //motion analog inputs queried by interp    int debug;			// copy of EMC_DEBUG global};// declarations for EMC_TASK classes// EMC_TASK command base classclass EMC_TASK_CMD_MSG:public RCS_CMD_MSG {  public:    EMC_TASK_CMD_MSG(NMLTYPE t, size_t s):RCS_CMD_MSG(t, s) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_TASK_INIT:public EMC_TASK_CMD_MSG {  public:    EMC_TASK_INIT():EMC_TASK_CMD_MSG(EMC_TASK_INIT_TYPE,				     sizeof(EMC_TASK_INIT)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_TASK_HALT:public EMC_TASK_CMD_MSG {  public:    EMC_TASK_HALT():EMC_TASK_CMD_MSG(EMC_TASK_HALT_TYPE,				     sizeof(EMC_TASK_HALT)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_TASK_ABORT:public EMC_TASK_CMD_MSG {  public:    EMC_TASK_ABORT():EMC_TASK_CMD_MSG(EMC_TASK_ABORT_TYPE,				      sizeof(EMC_TASK_ABORT)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_TASK_SET_MODE:public EMC_TASK_CMD_MSG {  public:    EMC_TASK_SET_MODE():EMC_TASK_CMD_MSG(EMC_TASK_SET_MODE_TYPE,					 sizeof(EMC_TASK_SET_MODE)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);    enum EMC_TASK_MODE_ENUM mode;};class EMC_TASK_SET_STATE:public EMC_TASK_CMD_MSG {  public:    EMC_TASK_SET_STATE():EMC_TASK_CMD_MSG(EMC_TASK_SET_STATE_TYPE,					  sizeof(EMC_TASK_SET_STATE)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);    enum EMC_TASK_STATE_ENUM state;};class EMC_TASK_PLAN_OPEN:public EMC_TASK_CMD_MSG {  public:    EMC_TASK_PLAN_OPEN():EMC_TASK_CMD_MSG(EMC_TASK_PLAN_OPEN_TYPE,					  sizeof(EMC_TASK_PLAN_OPEN)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);    char file[LINELEN];};class EMC_TASK_PLAN_RUN:public EMC_TASK_CMD_MSG {  public:    EMC_TASK_PLAN_RUN():EMC_TASK_CMD_MSG(EMC_TASK_PLAN_RUN_TYPE,					 sizeof(EMC_TASK_PLAN_RUN)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);    int line;			// line to run from; 0 or 1 means from start,    // negative means run through to verify};class EMC_TASK_PLAN_READ:public EMC_TASK_CMD_MSG {  public:    EMC_TASK_PLAN_READ():EMC_TASK_CMD_MSG(EMC_TASK_PLAN_READ_TYPE,					  sizeof(EMC_TASK_PLAN_READ)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_TASK_PLAN_EXECUTE:public EMC_TASK_CMD_MSG {  public:    EMC_TASK_PLAN_EXECUTE():EMC_TASK_CMD_MSG(EMC_TASK_PLAN_EXECUTE_TYPE,					     sizeof(EMC_TASK_PLAN_EXECUTE))    {    };    // For internal NML/CMS use only.    void update(CMS * cms);    char command[LINELEN];};class EMC_TASK_PLAN_PAUSE:public EMC_TASK_CMD_MSG {  public:    EMC_TASK_PLAN_PAUSE():EMC_TASK_CMD_MSG(EMC_TASK_PLAN_PAUSE_TYPE,					   sizeof(EMC_TASK_PLAN_PAUSE)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_TASK_PLAN_STEP:public EMC_TASK_CMD_MSG {  public:    EMC_TASK_PLAN_STEP():EMC_TASK_CMD_MSG(EMC_TASK_PLAN_STEP_TYPE,					  sizeof(EMC_TASK_PLAN_STEP)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_TASK_PLAN_RESUME:public EMC_TASK_CMD_MSG {  public:    EMC_TASK_PLAN_RESUME():EMC_TASK_CMD_MSG(EMC_TASK_PLAN_RESUME_TYPE,					    sizeof(EMC_TASK_PLAN_RESUME)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_TASK_PLAN_END:public EMC_TASK_CMD_MSG {  public:    EMC_TASK_PLAN_END():EMC_TASK_CMD_MSG(EMC_TASK_PLAN_END_TYPE,					 sizeof(EMC_TASK_PLAN_END)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_TASK_PLAN_CLOSE:public EMC_TASK_CMD_MSG {  public:    EMC_TASK_PLAN_CLOSE():EMC_TASK_CMD_MSG(EMC_TASK_PLAN_CLOSE_TYPE,					   sizeof(EMC_TASK_PLAN_CLOSE)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_TASK_PLAN_INIT:public EMC_TASK_CMD_MSG {  public:    EMC_TASK_PLAN_INIT():EMC_TASK_CMD_MSG(EMC_TASK_PLAN_INIT_TYPE,					  sizeof(EMC_TASK_PLAN_INIT)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_TASK_PLAN_SYNCH:public EMC_TASK_CMD_MSG {  public:    EMC_TASK_PLAN_SYNCH():EMC_TASK_CMD_MSG(EMC_TASK_PLAN_SYNCH_TYPE,					   sizeof(EMC_TASK_PLAN_SYNCH)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_TASK_PLAN_SET_OPTIONAL_STOP:public EMC_TASK_CMD_MSG {  public:    EMC_TASK_PLAN_SET_OPTIONAL_STOP():EMC_TASK_CMD_MSG(EMC_TASK_PLAN_SET_OPTIONAL_STOP_TYPE,					   sizeof(EMC_TASK_PLAN_SET_OPTIONAL_STOP)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);        bool state; //state == ON, optional stop is on (e.g. we stop on any stops)};class EMC_TASK_PLAN_SET_BLOCK_DELETE:public EMC_TASK_CMD_MSG {  public:    EMC_TASK_PLAN_SET_BLOCK_DELETE():EMC_TASK_CMD_MSG(EMC_TASK_PLAN_SET_BLOCK_DELETE_TYPE,					   sizeof(EMC_TASK_PLAN_SET_BLOCK_DELETE)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);        bool state; //state == ON, block delete is on, we ignore lines starting with "/"};class EMC_TASK_PLAN_OPTIONAL_STOP:public EMC_TASK_CMD_MSG {  public:    EMC_TASK_PLAN_OPTIONAL_STOP():EMC_TASK_CMD_MSG(EMC_TASK_PLAN_OPTIONAL_STOP_TYPE,					   sizeof(EMC_TASK_PLAN_OPTIONAL_STOP)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);    };// EMC_TASK status base classclass EMC_TASK_STAT_MSG:public RCS_STAT_MSG {  public:    EMC_TASK_STAT_MSG(NMLTYPE t, size_t s):RCS_STAT_MSG(t, s) {	heartbeat = 0;    };    // For internal NML/CMS use only.    void update(CMS * cms);    unsigned long int heartbeat;};class EMC_TASK_STAT:public EMC_TASK_STAT_MSG {  public:    EMC_TASK_STAT();    // For internal NML/CMS use only.    void update(CMS * cms);    enum EMC_TASK_MODE_ENUM mode;	// EMC_TASK_MODE_MANUAL, etc.    enum EMC_TASK_STATE_ENUM state;	// EMC_TASK_STATE_ESTOP, etc.    enum EMC_TASK_EXEC_ENUM execState;	// EMC_DONE,WAITING_FOR_MOTION, etc.    enum EMC_TASK_INTERP_ENUM interpState;	// EMC_IDLE,READING,PAUSED,WAITING    int motionLine;		// line motion is executing-- may lag    int currentLine;		// line currently executing    int readLine;		// line interpreter has read to    bool optional_stop_state;	// state of optional stop (== ON means we stop on M1)    bool block_delete_state;	// state of block delete (== ON means we ignore lines starting with "/")    bool input_timeout;		// has a timeout happened on digital input    char file[LINELEN];    char command[LINELEN];    EmcPose origin;		// origin, in user units, currently active    EmcPose toolOffset;		// tool offset, in general pose form    int activeGCodes[ACTIVE_G_CODES];    int activeMCodes[ACTIVE_M_CODES];    double activeSettings[ACTIVE_SETTINGS];    CANON_UNITS programUnits;	// CANON_UNITS_INCHES,MM,CM    int interpreter_errcode;	// return value from rs274ngc function     // (only useful for new interpreter.)};// declarations for EMC_TOOL classes// EMC_TOOL command base classclass EMC_TOOL_CMD_MSG:public RCS_CMD_MSG {  public:    EMC_TOOL_CMD_MSG(NMLTYPE t, size_t s):RCS_CMD_MSG(t, s) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_TOOL_INIT:public EMC_TOOL_CMD_MSG {  public:    EMC_TOOL_INIT():EMC_TOOL_CMD_MSG(EMC_TOOL_INIT_TYPE,				     sizeof(EMC_TOOL_INIT)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_TOOL_HALT:public EMC_TOOL_CMD_MSG {  public:    EMC_TOOL_HALT():EMC_TOOL_CMD_MSG(EMC_TOOL_HALT_TYPE,				     sizeof(EMC_TOOL_HALT)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_TOOL_ABORT:public EMC_TOOL_CMD_MSG {  public:    EMC_TOOL_ABORT():EMC_TOOL_CMD_MSG(EMC_TOOL_ABORT_TYPE,				      sizeof(EMC_TOOL_ABORT)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_TOOL_PREPARE:public EMC_TOOL_CMD_MSG {  public:    EMC_TOOL_PREPARE():EMC_TOOL_CMD_MSG(EMC_TOOL_PREPARE_TYPE,					sizeof(EMC_TOOL_PREPARE)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);    int tool;};class EMC_TOOL_LOAD:public EMC_TOOL_CMD_MSG {  public:    EMC_TOOL_LOAD():EMC_TOOL_CMD_MSG(EMC_TOOL_LOAD_TYPE,				     sizeof(EMC_TOOL_LOAD)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_TOOL_UNLOAD:public EMC_TOOL_CMD_MSG {  public:    EMC_TOOL_UNLOAD():EMC_TOOL_CMD_MSG(EMC_TOOL_UNLOAD_TYPE,				       sizeof(EMC_TOOL_UNLOAD)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_TOOL_LOAD_TOOL_TABLE:public EMC_TOOL_CMD_MSG {  public:    EMC_TOOL_LOAD_TOOL_TABLE():EMC_TOOL_CMD_MSG	(EMC_TOOL_LOAD_TOOL_TABLE_TYPE, sizeof(EMC_TOOL_LOAD_TOOL_TABLE)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);    char file[LINELEN];		// name of tool table, empty means default};class EMC_TOOL_SET_OFFSET:public EMC_TOOL_CMD_MSG {  public:    EMC_TOOL_SET_OFFSET():EMC_TOOL_CMD_MSG(EMC_TOOL_SET_OFFSET_TYPE,					   sizeof(EMC_TOOL_SET_OFFSET)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);    int tool;    double length;    double diameter;};// EMC_TOOL status base classclass EMC_TOOL_STAT_MSG:public RCS_STAT_MSG {  public:    EMC_TOOL_STAT_MSG(NMLTYPE t, size_t s):RCS_STAT_MSG(t, s) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_TOOL_STAT:public EMC_TOOL_STAT_MSG {  public:    EMC_TOOL_STAT();    // For internal NML/CMS use only.    void update(CMS * cms);    EMC_TOOL_STAT operator =(EMC_TOOL_STAT s);	// need this for [] members    int toolPrepped;		// tool ready for loading, 0 is no tool    int toolInSpindle;		// tool loaded, 0 is no tool    CANON_TOOL_TABLE toolTable[CANON_TOOL_MAX + 1];};// EMC_AUX type declarations// EMC_AUX command base classclass EMC_AUX_CMD_MSG:public RCS_CMD_MSG {  public:    EMC_AUX_CMD_MSG(NMLTYPE t, size_t s):RCS_CMD_MSG(t, s) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_AUX_INIT:public EMC_AUX_CMD_MSG {  public:    EMC_AUX_INIT():EMC_AUX_CMD_MSG(EMC_AUX_INIT_TYPE, sizeof(EMC_AUX_INIT)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_AUX_HALT:public EMC_AUX_CMD_MSG {  public:    EMC_AUX_HALT():EMC_AUX_CMD_MSG(EMC_AUX_HALT_TYPE, sizeof(EMC_AUX_HALT)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_AUX_ABORT:public EMC_AUX_CMD_MSG {  public:    EMC_AUX_ABORT():EMC_AUX_CMD_MSG(EMC_AUX_ABORT_TYPE,				    sizeof(EMC_AUX_ABORT)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_AUX_DIO_WRITE:public EMC_AUX_CMD_MSG {  public:    EMC_AUX_DIO_WRITE():EMC_AUX_CMD_MSG(EMC_AUX_DIO_WRITE_TYPE,					sizeof(EMC_AUX_DIO_WRITE)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);    int index;    int value;};class EMC_AUX_AIO_WRITE:public EMC_AUX_CMD_MSG {  public:    EMC_AUX_AIO_WRITE():EMC_AUX_CMD_MSG(EMC_AUX_AIO_WRITE_TYPE,					sizeof(EMC_AUX_AIO_WRITE)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);    int index;    double value;};class EMC_AUX_ESTOP_ON:public EMC_AUX_CMD_MSG {  public:    EMC_AUX_ESTOP_ON():EMC_AUX_CMD_MSG(EMC_AUX_ESTOP_ON_TYPE,				       sizeof(EMC_AUX_ESTOP_ON)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_AUX_ESTOP_OFF:public EMC_AUX_CMD_MSG {  public:    EMC_AUX_ESTOP_OFF():EMC_AUX_CMD_MSG(EMC_AUX_ESTOP_OFF_TYPE,					sizeof(EMC_AUX_ESTOP_OFF)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_AUX_ESTOP_RESET:public EMC_AUX_CMD_MSG {  public:    EMC_AUX_ESTOP_RESET():EMC_AUX_CMD_MSG(EMC_AUX_ESTOP_RESET_TYPE,					sizeof(EMC_AUX_ESTOP_RESET)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};class EMC_AUX_INPUT_WAIT:public EMC_AUX_CMD_MSG {  public:    EMC_AUX_INPUT_WAIT():EMC_AUX_CMD_MSG(EMC_AUX_INPUT_WAIT_TYPE,					sizeof(EMC_AUX_INPUT_WAIT)) {    };    // For internal NML/CMS use only.    void update(CMS * cms);    int index;			// input channel to wait for    int input_type;		// DIGITAL or ANALOG    int wait_type;		// 0 - immediate, 1- rise, 2 - fall, 3 - be high, 4 - be low    int timeout;		// timeout for waiting};// EMC_AUX status base classclass EMC_AUX_STAT_MSG:public RCS_STAT_MSG {  public:    EMC_AUX_STAT_MSG(NMLTYPE t, size_t s):RCS_STAT_MSG(t, s) {    };    // For internal NML/CMS use only.    void update(CMS * cms);};#define EMC_AUX_MAX_DOUT 4	// digital out bytes#define EMC_AUX_MAX_DIN  4	// digital in bytes#define EMC_AUX_MAX_AOUT 32	// analog out points#define EMC_AUX_MAX_AIN  32	// analog in pointsclass EMC_AUX_STAT:public EMC_AUX_STAT_MSG {  public:    EMC_AUX_STAT();    // For internal NML/CMS use only.    void update(CMS * cms);    EMC_AUX_STAT operator =(EMC_AUX_STAT s);	// need this for [] members    int estop;			// non-zero means estopped    unsigned char dout[EMC_AUX_MAX_DOUT];	// digital output readings    unsigned char din[EMC_AUX_MAX_DIN];	// digital input readings

⌨️ 快捷键说明

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