Index: setup.py =================================================================== RCS file: /store/cvs/axis/setup.py,v retrieving revision 1.29 retrieving revision 1.29.2.4 diff -u -r1.29 -r1.29.2.4 --- setup.py 1 Jan 2006 19:47:18 -0000 1.29 +++ setup.py 11 Jan 2006 23:49:28 -0000 1.29.2.4 @@ -29,7 +29,7 @@ import distutils.command.install name="axis" -version="1.1" +version="1.1.1rc4" DOCDIR="share/doc/%s-%s" % (name, version) SHAREDIR="share/%s" % (name) Index: extensions/gcodemodule.cc =================================================================== RCS file: /store/cvs/axis/extensions/gcodemodule.cc,v retrieving revision 1.17 retrieving revision 1.17.2.1 diff -u -r1.17 -r1.17.2.1 --- extensions/gcodemodule.cc 1 Jan 2006 15:12:07 -0000 1.17 +++ extensions/gcodemodule.cc 10 Jan 2006 02:01:50 -0000 1.17.2.1 @@ -477,8 +477,30 @@ return retval; } +extern char * _rs274ngc_errors[]; + +static int maxerror = -1; + +static int find_maxerror(void) { + int i=0; + for(;;i++) { + if(!_rs274ngc_errors[i] || !strcmp(_rs274ngc_errors[i], "The End")) + return i; + } +} + +static PyObject *rs274_strerror(PyObject *s, PyObject *o) { + int err; + if(!PyArg_ParseTuple(o, "i", &err)) return NULL; + if(err < 0 || err >= maxerror) { + return PyString_FromString("Error number out of range"); + } + return PyString_FromString(_rs274ngc_errors[err]); +} + PyMethodDef gcode_methods[] = { {"parse", (PyCFunction)parse_file, METH_VARARGS, "Parse a G-Code file"}, + {"strerror", (PyCFunction)rs274_strerror, METH_VARARGS, "Convert a numeric error to a string"}, {NULL} }; @@ -488,4 +510,7 @@ "Interface to EMC rs274ngc interpreter"); PyType_Ready(&LineCodeType); PyModule_AddObject(m, "linecode", (PyObject*)&LineCodeType); + maxerror = find_maxerror(); + PyObject_SetAttrString(m, "RS274NGC_MAX_ERROR", PyInt_FromLong(maxerror)); + PyObject_SetAttrString(m, "RS274NGC_MIN_ERROR", PyInt_FromLong(3)); // XXX } Index: lib/nf.py =================================================================== RCS file: /store/cvs/axis/lib/nf.py,v retrieving revision 1.5 retrieving revision 1.5.2.2 diff -u -r1.5 -r1.5.2.2 --- lib/nf.py 1 Jan 2006 15:12:07 -0000 1.5 +++ lib/nf.py 8 Jan 2006 17:14:05 -0000 1.5.2.2 @@ -112,11 +112,10 @@ source_lib_tcl(r, "combobox.tcl") source_lib_tcl(r, "dialog.tcl") - source_lib_tcl(r, "sb.tcl"); r.tk.call("sb::install") source_lib_tcl(r, "rb.tcl"); r.tk.call("rb::install") source_lib_tcl(r, "cb.tcl"); r.tk.call("cb::install") - r.tk.call("package", "require", "BWidget") + r.tk.call("package", "require", "BWidget", "1.7") r.tk.call("namespace", "import", "combobox::combobox") # vim:ts=8:sts=4:et: Index: rs274/errorlist.py =================================================================== RCS file: /store/cvs/axis/rs274/errorlist.py,v retrieving revision 1.4 retrieving revision 1.4.2.3 diff -u -r1.4 -r1.4.2.3 --- rs274/errorlist.py 1 Jan 2006 15:12:07 -0000 1.4 +++ rs274/errorlist.py 10 Jan 2006 02:01:50 -0000 1.4.2.3 @@ -15,206 +15,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -errorlist = { - 0: "RS274NGC_OK", - 1: "RS274NGC_EXIT", - 2: "RS274NGC_EXECUTE_FINISH", - 3: "Unexpected end of file", - 4: "Internal error: A file is already open", - 5: "All axes missing with G92", - 6: "All axes missing with motion code", - 7: "Arc radius too small to reach endpoint", - 8: "Argument to ACOS out of range", - 9: "Argument to ASIN out of range", - 10: "Division by zero", - 11: "Attempt to raise negative number to non-integer power", - 12: "Bad character", - 13: "Non-digit found where integer expected", - 14: "Unexpected character found where +, -, . or digit expected", - 15: "Internal error: NCE_BUG_BAD_G_CODE_MODAL_GROUP_0", - 16: "Internal error: NCE_BUG_CODE_NOT_G0_OR_G1", - 17: "Internal error: NCE_BUG_CODE_NOT_G17_G18_OR_G19", - 18: "Internal error: NCE_BUG_CODE_NOT_G20_OR_G21", - 19: "Internal error: NCE_BUG_CODE_NOT_G28_OR_G30", - 20: "Internal error: NCE_BUG_CODE_NOT_G2_OR_G3", - 21: "Internal error: NCE_BUG_CODE_NOT_G40_G41_OR_G42", - 22: "Internal error: NCE_BUG_CODE_NOT_G43_OR_G49", - 23: "Internal error: NCE_BUG_CODE_NOT_G4_G10_G28_G30_G53_OR_G92_SERIES", - 24: "Internal error: NCE_BUG_CODE_NOT_G61_G61_1_OR_G64", - 25: "Internal error: NCE_BUG_CODE_NOT_G90_OR_G91", - 26: "Internal error: NCE_BUG_CODE_NOT_G93_OR_G94", - 27: "Internal error: NCE_BUG_CODE_NOT_G98_OR_G99", - 28: "Internal error: NCE_BUG_CODE_NOT_IN_G92_SERIES", - 29: "Internal error: NCE_BUG_CODE_NOT_IN_RANGE_G54_TO_G593", - 30: "Internal error: NCE_BUG_CODE_NOT_M0_M1_M2_M30_M60", - 31: "Internal error: NCE_BUG_DISTANCE_MODE_NOT_G90_OR_G91", - 32: "Internal error: NCE_BUG_FUNCTION_SHOULD_NOT_HAVE_BEEN_CALLED", - 33: "Internal error: NCE_BUG_IN_TOOL_RADIUS_COMP", - 34: "Internal error: NCE_BUG_PLANE_NOT_XY_YZ_OR_XZ", - 35: "Internal error: NCE_BUG_SIDE_NOT_RIGHT_OR_LEFT", - 36: "Internal error: NCE_BUG_UNKNOWN_MOTION_CODE", - 37: "Internal error: NCE_BUG_UNKNOWN_OPERATION", - 38: "Cannot change axis offsets with cutter radius compensation", - 39: "Cannot change units with cutter radius compensation", - 40: "Internal error: NCE_CANNOT_CREATE_BACKUP_FILE", - 41: "Cannot do G1 with zero feed rate", - 42: "Cannot do zero repeats of a cycle", - 43: "Cannot do arc with zero feed rate", - 44: "Cannot move rotary axes while probing", - 45: "Internal error: NCE_CANNOT_OPEN_BACKUP_FILE", - 46: "Internal error: NCE_CANNOT_OPEN_VARIABLE_FILE", - 47: "Cannot probe in inverse time feed mode", - 48: "Cannot probe with cutter radius compensation", - 49: "Cannot probe with zero feed rate", - 50: "Cannot put a B in a canned cycle", - 51: "Cannot put a C in a canned cycle", - 52: "Cannot put an A in a canned cycle", - 53: "Cannot turn cutter radius compensation on when out of XY plane (G17)", - 54: "Cannot turn cutter radius on when it is already on", - 55: "Cannot put an A word here", - 56: "Cannot use axis values with G80", - 57: "Cannot use an axis word without a G code that uses them", - 58: "Cannot put a B word here", - 59: "Cannot put a C word here", - 60: "Cannot use G28 or G30 with cutter radius compensation", - 61: "Cannot use G53 with incremental mode", - 62: "Cannot use G53 with cutter compensation", - 63: "Cannot use two G codes that use axis words", - 64: "Cannot use XZ plane with cutter radius compensation", - 65: "Cannot use YZ plane with cutter radius compensation", - 66: "Line too long", - 67: "Cannot have concave corners with cutter radius compensation", - 68: "Parameter 5220 (work coordinate system index) out of range", - 69: "Cannot start and end an R-format arc at the same place", - 70: "Arc would result in gouging with cutter radius compensation", - 71: "Cannot put a D word here (requires G41 or G42)", - 72: "Dwell time required with G4", - 73: "Dwell time required with G82", - 74: "Dwell time required with G86", - 75: "Dwell time required with G88", - 76: "Dwell time required with G89", - 77: "Equal sign missing in parameter setting", - 78: "F word required with inverse time arc move", - 79: "F word required with inverse time G1 move", - 80: "File ended with no percent sign", - 81: "File ended with no percent sign or program end", - 82: "Internal error: NCE_FILE_NAME_TOO_LONG", - 83: "Internal error: NCE_FILE_NOT_OPEN", - 84: "G code out of range", - 85: "Cannot put a H word here (requires G43)", - 86: "Cannot put an I word here (invalid plane)", - 87: "I word required with G87", - 88: "Cannot put an I word here (Only G2, G3, G87)", - 89: "Cannot put a J word here (invalid plane)", - 90: "I word reqired with G87", - 91: "Cannot put a J word here (Only G2, G3, G87)", - 92: "Cannot put a K word here (invalid plane)", - 93: "K word required with G87", - 94: "Cannot put a K word here (Only G2, G3, G87)", - 95: "L word requires canned cycle or G10", - 96: "Left bracket missing after slash with ATAN", - 97: "Left bracket missing after unary operation", - 98: "Line number greater than 99999", - 99: "NCE_LINE_WITH_G10_DOES_NOT_HAVE_L2", - 100: "M code out of range (Must not be greater than 199)", - 101: "R word and I/J/K words may not appear together for an arc", - 102: "Multiple A words on line", - 103: "Multiple B words on line", - 104: "Multiple C words on line", - 105: "Multiple D words on line", - 106: "Multiple F words on line", - 107: "Multiple H words on line", - 108: "Multiple I words on line", - 109: "Multiple J words on line", - 110: "Multiple K words on line", - 111: "Multiple L words on line", - 112: "Multiple P words on line", - 113: "Multiple Q words on line", - 114: "Multiple R words on line", - 115: "Multiple S words on line", - 116: "Multiple T words on line", - 117: "Multiple X words on line", - 118: "Multiple Y words on line", - 119: "Multiple Z words on line", - 120: "Must use G0 or G1 with G53", - 121: "Negative argument to SQRT", - 122: "Negative D word tool radius index used", - 123: "Negative F word used", - 124: "Negative G word used", - 125: "Negative H word tool length offset index used", - 126: "Negative L word used", - 127: "Negative M code used", - 128: "Negative or zero Q value used", - 129: "Negative P word used", - 130: "Negative spindle speed used", - 131: "Negative tool ID used", - 132: "Nested comment found", - 133: "No characters found when reading real value", - 134: "No digits found where real number should be", - 135: "Non-integer value found where integer required", - 136: "Internal error: NCE_NULL_MISSING_AFTER_NEWLINE", - 137: "Offset index missing", - 138: "P must be an integer with G10 L2", - 139: "P out of range with G10 L2", - 140: "P word with no G4, G10, G82, G86, G88, or G89", - 141: "Internal error: NCE_PARAMETER_FILE_OUT_OF_ORDER", - 142: "Parameter number out of range", - 143: "Q word missing with G83", - 144: "Q word without G83", - 145: "Internal error: NCE_QUEUE_IS_NOT_EMPTY_AFTER_PROBING", - 146: "R clearance plane unspecified in canned cycle", - 147: "Arc center unspecified (No R, I, J, or K words)", - 148: "R less than X in canned cycle in YZ plane", - 149: "R less than Y in canned cycle in XZ plane", - 150: "R less than Z in canned cycle in YX plane", - 151: "R word with G-code that does not use it", - 152: "Distance from center of arc to endpoints differs", - 153: "Arc radius too small to reach end point", - 154: "Required parameter missing", - 155: "Tool slot number too large", - 156: "Slash missing after first ATAN argument", - 157: "Spindle not turning clockwise in G84", - 158: "Spindle not turning in G86", - 159: "Spindle not turning in G87", - 160: "Spindle not turning in G88", - 161: "Non-number found where number expected (\"scanf()\" failed)", - 162: "Start pint too close to probe point", - 163: "Too many M codes on line", - 164: "Too length offset index too big", - 165: "Index in tool table file too large", - 166: "Tool radius index too big", - 167: "Tool radius must be less than arc radius with cutter compensation", - 168: "Two G codes from same modal group", - 169: "Two M codes from same modal group", - 170: "Unable to open file", - 171: "Unclosed comment", - 172: "Unclosed expresson", - 173: "Unknown G code", - 174: "Unknown M code", - 175: "Unknown operation", - 176: "Unknown operation name starting with A", - 177: "Unknown operation name starting with M", - 178: "Unknown operation name starting with O", - 179: "Unknown operation name starting with X", - 180: "Unknown word starting with A", - 181: "Unknown word starting with C", - 182: "Unknown word starting with E", - 183: "Unknown word starting with F", - 184: "Unknown word starting with L", - 185: "Unknown word starting with R", - 186: "Unknown word starting with S", - 187: "Unknown word starting with T", - 188: "Unknown word where unary operation could be", - 189: "X and Y words missing for arc in XY plane", - 190: "X and Z words missing for arc in XZ plane", - 191: "X value unspecified in YZ plane in a canned cycle", - 192: "X, Y, and Z words all missing with g38.2", - 193: "Y and Z words missing for arc in YZ plane", - 194: "Y value unspecified in XZ plane in a canned cycle", - 195: "Z value unspecified in XY plane in a canned cycle", - 196: "Zero or negative argument to LN", - 197: "Zero radius arc", - # 197: "RS274NGC_MAX_ERROR" -} -RS274NGC_MIN_ERROR=3 -RS274NGC_MAX_ERROR=197 +from gcode import strerror, RS274NGC_MAX_ERROR, RS274NGC_MIN_ERROR +errorlist = dict([(i, strerror(i)) for i in range(RS274NGC_MAX_ERROR)]) +del strerror Index: scripts/axis.py =================================================================== RCS file: /store/cvs/axis/scripts/axis.py,v retrieving revision 1.108 retrieving revision 1.108.2.2 diff -u -r1.108 -r1.108.2.2 --- scripts/axis.py 1 Jan 2006 15:12:07 -0000 1.108 +++ scripts/axis.py 11 Jan 2006 23:48:50 -0000 1.108.2.2 @@ -21,8 +21,8 @@ from __future__ import generators import string -__version__ = string.split('$Revision: 1.108 $')[1] -__date__ = string.join(string.split('$Date: 2006/01/01 15:12:07 $')[1:3], ' ') +__version__ = string.split('$Revision: 1.108.2.2 $')[1] +__date__ = string.join(string.split('$Date: 2006/01/11 23:48:50 $')[1:3], ' ') __author__ = 'Jeff Epler ' import sys, array, time, atexit, tempfile, shutil, os, errno @@ -315,7 +315,7 @@ glMatrixMode(GL_PROJECTION) glLoadIdentity() - gluPerspective(self.fovy, float(w)/float(h), self.near, self.far) + gluPerspective(self.fovy, float(w)/float(h), self.near, self.far + self.distance) gluLookAt(0, 0, self.distance, 0, 0, 0, @@ -353,7 +353,7 @@ l = k * h / w glOrtho(-k, k, -l, l, -1000, 1000.) - gluLookAt(0, 0, self.distance, + gluLookAt(0, 0, 1, 0, 0, 0, 0., 1., 0.) glMatrixMode(GL_MODELVIEW) @@ -832,7 +832,7 @@ error_str = rs274.errorlist.get(result, "Unknown error %s" % result) root_window.tk.call("nf_dialog", ".error", "G-Code error in %s" % os.path.basename(f), - "On line %d of %s:\n%s" % (seq+1, f, error_str), + "Near line %d of %s:\n%s" % (seq+1, f, error_str), "error",0,"OK") t.configure(state="disabled") Index: tcl/axis.nf =================================================================== RCS file: /store/cvs/axis/tcl/Attic/axis.nf,v retrieving revision 1.50 retrieving revision 1.50.2.4 diff -u -r1.50 -r1.50.2.4 --- tcl/axis.nf 1 Jan 2006 19:47:18 -0000 1.50 +++ tcl/axis.nf 11 Jan 2006 23:49:28 -0000 1.50.2.4 @@ -1267,7 +1267,7 @@ .about.message configure -cursor hand2 .about.message tag configure link -foreground red} .about.message tag bind link {launch_website} -.about.message insert end {AXIS version 1.1 +.about.message insert end {AXIS version 1.1.1rc4 Copyright (C) 2004, 2005, 2006 Jeff Epler and Chris Radek.