? emc2.diff Index: setup.py =================================================================== RCS file: /fs/c1/cvs/axis/setup.py,v retrieving revision 1.15 diff -u -r1.15 setup.py --- setup.py 13 Jun 2005 15:46:14 -0000 1.15 +++ setup.py 14 Jun 2005 03:34:10 -0000 @@ -33,35 +33,21 @@ DOCDIR="share/doc/%s-%s" % (name, version) SHAREDIR="share/%s" % (name) -emcroot = os.getenv("EMCROOT", find_emc_root()) -if emcroot is None: +emc2root = os.getenv("EMC2ROOT", find_emc_root()) +if emc2root is None: print """\ setup.py failed to locate the root directory of your emc installation. Determine the location of your emc installation and re-run setup.py with a commandline like this: - $ env EMCROOT=/usr/local/emc python setup.py install - -See the README file for more information. -""" - raise SystemExit, 1 -emcplat = os.getenv("PLAT", find_emc_plat(emcroot)) -if emcplat is None: - print """\ -setup.py failed to locate the (non-realtime) platform of your emc installation. -Determine the platform name and re-run setup.py with a commandline like this: - $ env PLAT=nonrealtime python setup.py install - -If you had to specify EMCSOURCEDIR, the commandline would look like - $ env EMCSOURCEDIR=/usr/local/emc PLAT=nonrealtime python setup.py install + $ env EMC2ROOT=/usr/local/emc python setup.py install See the README file for more information. """ raise SystemExit, 1 distutils.command.install.INSTALL_SCHEMES['unix_prefix']['scripts'] = \ - "%s/emc/plat/%s/bin" % (emcroot, emcplat) -print "Building for EMC in", emcroot -print "Non-realtime PLAT", emcplat + "%s/bin" % (emc2root) +print "Building for EMC2 in", emc2root togl = Extension("_togl", ["extensions/_toglmodule.c"], **get_togl_flags()) @@ -69,37 +55,31 @@ "extensions/gcodemodule.cc" ], include_dirs=[ - os.path.join(emcroot, "emc", "plat", emcplat, "include", - "rs274ngc_new"), - os.path.join(emcroot, "emc", "plat", emcplat, "include"), - os.path.join(emcroot, "rcslib", "plat", emcplat, "include") + os.path.join(emc2root, "include") ], library_dirs = [ - os.path.join(emcroot, "emc", "plat", emcplat, "lib"), - os.path.join(emcroot, "rcslib", "plat", emcplat, "lib") + os.path.join(emc2root, "lib") ], extra_link_args = [ '-DNEW_INTERPRETER', '-Wl,-rpath,%s' % - os.path.join(emcroot, "rcslib", "plat", emcplat, "lib"), - os.path.join(emcroot, "emc", "plat", emcplat, "lib", "rs274abc.o"), - '-lrcs', '-lm', '-lstdc++', + os.path.join(emc2root, "lib"), + os.path.join(emc2root, "src", ".tmp", "rs274.o"), + '-lnml', '-lm', '-lstdc++', ] ) emc = Extension("emc", ["extensions/emcmodule.cc"], - define_macros=[('DEFAULT_NMLFILE', '"%s/emc/emc.nml"' % emcroot)], + define_macros=[('DEFAULT_NMLFILE', '"%s/configs/emc.nml"' % emc2root)], include_dirs=[ - os.path.join(emcroot, "emc", "plat", emcplat, "include"), - os.path.join(emcroot, "rcslib", "plat", emcplat, "include") + os.path.join(emc2root, "include") ], library_dirs = [ - os.path.join(emcroot, "emc", "plat", emcplat, "lib"), - os.path.join(emcroot, "rcslib", "plat", emcplat, "lib") + os.path.join(emc2root, "lib") ], - libraries = ["emc", "rcs", "m", "stdc++"], + libraries = ["emc", "nml", "m", "stdc++"], extra_link_args = ['-Wl,-rpath,%s' % - os.path.join(emcroot, "rcslib", "plat", emcplat, "lib")] + os.path.join(emc2root, "lib")] ) glfixes = Extension("_glfixes", ["extensions/_glfixes.c"], libraries = ["GL"], Index: extensions/emcmodule.cc =================================================================== RCS file: /fs/c1/cvs/axis/extensions/emcmodule.cc,v retrieving revision 1.6 diff -u -r1.6 emcmodule.cc --- extensions/emcmodule.cc 9 Mar 2005 01:20:38 -0000 1.6 +++ extensions/emcmodule.cc 14 Jun 2005 03:34:14 -0000 @@ -20,6 +20,7 @@ #include #include "rcs.hh" #include "emc.hh" +#include "global_defs.h" #include "inifile.h" #include @@ -37,6 +38,11 @@ #define NUM_AXES (6) +#define EMC_OPERATOR_ERROR_LEN LINELEN +#define EMC_OPERATOR_TEXT_LEN LINELEN +#define EMC_OPERATOR_DISPLAY_LEN LINELEN + + #define LOCAL_SPINDLE_FORWARD (1) #define LOCAL_SPINDLE_REVERSE (-1) #define LOCAL_SPINDLE_OFF (0) @@ -430,15 +436,15 @@ } static PyObject *Stat_activegcodes(pyStatChannel *s) { - return int_array(s->status.task.activeGCodes, EMC_TASK_ACTIVE_G_CODES); + return int_array(s->status.task.activeGCodes, ACTIVE_G_CODES); } static PyObject *Stat_activemcodes(pyStatChannel *s) { - return int_array(s->status.task.activeMCodes, EMC_TASK_ACTIVE_M_CODES); + return int_array(s->status.task.activeMCodes, ACTIVE_M_CODES); } static PyObject *Stat_activesettings(pyStatChannel *s) { - return double_array(s->status.task.activeSettings, EMC_TASK_ACTIVE_SETTINGS); + return double_array(s->status.task.activeSettings, ACTIVE_SETTINGS); } static PyObject *Stat_din(pyStatChannel *s) { Index: extensions/gcodemodule.cc =================================================================== RCS file: /fs/c1/cvs/axis/extensions/gcodemodule.cc,v retrieving revision 1.9 diff -u -r1.9 gcodemodule.cc --- extensions/gcodemodule.cc 9 Mar 2005 01:20:38 -0000 1.9 +++ extensions/gcodemodule.cc 14 Jun 2005 03:34:17 -0000 @@ -36,6 +36,8 @@ #undef offsetof #define offsetof(T,x) (int)(-1+(char*)&(((T*)1)->x)) +char _parameter_file_name[LINELEN]; + static PyObject *pose(const EmcPose &p) { PyObject *res = PyTuple_New(6); @@ -61,16 +63,16 @@ typedef struct { PyObject_HEAD - double settings[RS274NGC_ACTIVE_SETTINGS]; - int gcodes[RS274NGC_ACTIVE_G_CODES]; - int mcodes[RS274NGC_ACTIVE_M_CODES]; + double settings[ACTIVE_SETTINGS]; + int gcodes[ACTIVE_G_CODES]; + int mcodes[ACTIVE_M_CODES]; } LineCode; PyObject *LineCode_gcodes(LineCode *l) { - return int_array(l->gcodes, RS274NGC_ACTIVE_G_CODES); + return int_array(l->gcodes, ACTIVE_G_CODES); } PyObject *LineCode_mcodes(LineCode *l) { - return int_array(l->mcodes, RS274NGC_ACTIVE_M_CODES); + return int_array(l->mcodes, ACTIVE_M_CODES); } PyGetSetDef LineCodeGetSet[] = { @@ -154,14 +156,15 @@ int last_sequence_number; int plane; bool metric; +Interp interp_new; void maybe_new_line() { if(interp_error) return; LineCode *new_line_code = (LineCode*)(PyObject_New(LineCode, &LineCodeType)); - rs274ngc_active_settings(new_line_code->settings); - rs274ngc_active_g_codes(new_line_code->gcodes); - rs274ngc_active_m_codes(new_line_code->mcodes); + interp_new.active_settings(new_line_code->settings); + interp_new.active_g_codes(new_line_code->gcodes); + interp_new.active_m_codes(new_line_code->mcodes); int sequence_number = new_line_code->gcodes[0]; if(sequence_number == last_sequence_number) { Py_DECREF(new_line_code); @@ -388,13 +391,13 @@ interp_error = 0; last_sequence_number = -1; - rs274ngc_init(); - rs274ngc_open(f); + interp_new.init(); + interp_new.open(f); int result = 0; while(!interp_error) { - result = rs274ngc_read(); + result = interp_new.read(); if(result != RS274NGC_OK) break; - result = rs274ngc_execute(); + result = interp_new.execute(); if(result != RS274NGC_OK) break; } if(interp_error || !result) return NULL; Index: scripts/gplot.py =================================================================== RCS file: /fs/c1/cvs/axis/scripts/gplot.py,v retrieving revision 1.7 diff -u -r1.7 gplot.py --- scripts/gplot.py 9 Mar 2005 01:20:38 -0000 1.7 +++ scripts/gplot.py 14 Jun 2005 03:34:17 -0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.3 # This is a component of AXIS, a front-end for emc # Copyright 2004, 2005 Jeff Epler and # Chris Radek