void report_error( /* ARGUMENTS */ int error_code, /* the code number of the error message */ int print_stack) /* print stack if ON, otherwise not */ { char buffer[RS274NGC_TEXT_SIZE]; int k; rs274ngc_error_text(error_code, buffer, sizeof(buffer), 5); /* for coverage of code */ rs274ngc_error_text(error_code, buffer, sizeof(buffer), RS274NGC_TEXT_SIZE); fprintf(stderr, "%s\n", ((buffer[0] IS 0) ? "Unknown error, bad error code" : buffer)); rs274ngc_line_text(buffer, RS274NGC_TEXT_SIZE); fprintf(stderr, "%s\n", buffer); if (print_stack IS ON) { for (k SET_TO 0; ; k++) { rs274ngc_stack_name(k, buffer, RS274NGC_TEXT_SIZE); if (buffer[0] ISNT 0) fprintf(stderr, "%s\n", buffer); else break; } } }
int CGCodeInterpreter::rs274ErrorExit(int status) { char ErrDescr[200]; ErrDescr[0]='\0'; rs274ngc_close(); if (CoordMotion->GetAbort()) { if (CoordMotion->m_AxisDisabled) { strcpy(ErrDescr,"Axis Disabled - GCode Aborted"); status=1000; } else { strcpy(ErrDescr,"GCode Aborted"); status=1001; } } else { rs274ngc_error_text(status,ErrDescr,200); } strcat(ErrorOutput,ErrDescr); return status; }