diff -u --recursive axis/extensions/emcmodule.cc axis-emc2/extensions/emcmodule.cc --- axis/extensions/emcmodule.cc 2005-05-11 06:22:08.000000000 +0300 +++ axis-emc2/extensions/emcmodule.cc 2005-06-05 13:18:45.000000000 +0300 @@ -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) { diff -u --recursive axis/extensions/gcodemodule.cc axis-emc2/extensions/gcodemodule.cc --- axis/extensions/gcodemodule.cc 2005-05-11 06:22:08.000000000 +0300 +++ axis-emc2/extensions/gcodemodule.cc 2005-06-14 21:27:59.000000000 +0300 @@ -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; diff -u --recursive axis/scripts/gplot.py axis-emc2/scripts/gplot.py --- axis/scripts/gplot.py 2005-05-11 06:22:09.000000000 +0300 +++ axis-emc2/scripts/gplot.py 2005-06-13 21:23:44.000000000 +0300 @@ -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 diff -u --recursive axis/setup.py axis-emc2/setup.py --- axis/setup.py 2005-05-11 06:22:07.000000000 +0300 +++ axis-emc2/setup.py 2005-06-07 00:47:33.000000000 +0300 @@ -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 - -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 - -If you had to specify EMCSOURCEDIR, the commandline would look like - $ env EMCSOURCEDIR=/usr/local/emc PLAT=nonrealtime python setup.py + $ env EMC2ROOT=/usr/local/emc python setup.py 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 EMC 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"],