Kirk Wallace | 9 Feb 18:30
Gravatar

Modbus 3

Should libmodbus 3 be included in the normal build of LinuxCNC? How are
third party libraries handled in LinuxCNC? What happens when the third
party library changes and the dependent component doesn't? Or is it that
the compiled component is all the user end of LinuxCNC needs? Basically,
I'm just trying to understand what needs to be done to create a formal
LinuxCNC C component. Maybe analyzing .comp would spell this out?
--

-- 
Kirk Wallace
http://www.wallacecompany.com/machine_shop/
http://www.wallacecompany.com/E45/index.html
California, USA

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
Kirk Wallace | 8 Feb 21:02
Gravatar

Copying Find Files

I'd like to copy Michael's Modbus "find..." files from:
http://git.mah.priv.at/gitweb/vfs11-vfd.git/tree/master 

to the ModIO wiki page:
http://wiki.linuxcnc.org/cgi-bin/wiki.pl?ModIO 

Would you mind Micheal? If not, would it be appropriate to add a
copyrights to them? If so, what should they contain? Thanks.

--

-- 
Kirk Wallace
http://www.wallacecompany.com/machine_shop/
http://www.wallacecompany.com/E45/index.html
California, USA

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
Chris Morley | 7 Feb 00:36
Picon

docs - output-offset needs clarity

I've been meaning to bring this up ...

output_offset  found in the INI section under servo needs some clarification.

Not all components / boards  use this feature.
For instance hostmot2 has no provision for output_offset on it's pwmgen.

In fact it seems only servo to go and motenc honors this setting.

I guess that should be noted.
since there is quite a write up about it - it seems important yet in fact
the common used boards don't use it.

This problem is surely in every version on our docs.

Chris M

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Emc-developers mailing list
Emc-developers@...
https://lists.sourceforge.net/lists/listinfo/emc-developers
Chris Morley | 3 Feb 05:18
Picon

PATCH - gremlin for 2.5

Hi here is a patch that I wish to add to 2.5
I consider it a bug fix.

It adds ability to select options in gremlin that are common
such as setting the units of the DRO.
in AXIS and allows clearing the display, though that may need an EMC action added.
It also allows you to reload the program be calling load without the filename.
There maybe a better way.

There is a turned off option called show_offsets that will
show tool and coordinate offsets on the DRO but I will submit a different patch
later as it touches glcannon affects AXIS and should go in master.

Michael, Pavel what do you think?

Chris M
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Emc-developers mailing list
Emc-developers@...
https://lists.sourceforge.net/lists/listinfo/emc-developers
Chris Morley | 3 Feb 05:09
Picon

Re: gladevcp patch -please review



From: chrisinnanaimo-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org
To: mah-Hlu4VFpx/Azk7+2FdBfRIA@public.gmane.org
Subject: RE: gladevcp patch -please review
Date: Fri, 3 Feb 2012 04:08:25 +0000

.ExternalClass .ecxhmmessage P {padding:0px;} .ExternalClass body.ecxhmmessage {font-size:10pt;font-family:Tahoma;}

> can I ask you to have a look at this patch before I add it to v2.5_branch?
>
> It works around a Gtk bug where Gladedbuilder files havent set their name properly which is needed to properly support themes/gtkrc
>
>
> http://git.linuxcnc.org/gitweb?p=emc2.git;a=commit;h=f62708319375ce2f26dccd686692c270b495f4d3
>
> please see also the example posted here:
>
> http://www.linuxcnc.org/index.php/english/component/kunena/?func=view&catid=48&id=16439&limit=6&start=18#17332
>
> thanks
>
> Michael
>
>

I tried your patch and it seemed to work fine. -pretty cool!
But looking at the code I wonder if the -R option should be run before the -t theme change since
themes have rc files. It might not matter I didn't test this.

Also the docs should mention that your example will not work with all themes.
themes using pixmap engine render the states of (eg.) labels with different images.
You must have different colored images.
I am not an theme expert so there may be away around this - in fact in the Blue-Joy theme
there is an option written for some widgets:       recolorable        = TRUE
Though it does't seen to allow recoloring - If i add Blue-Joy them to your example it doesn't work.

I really wish you would change back the printed info about changing themes.
I had a them problem and could not find out if gladevcp was trying to change the theme or not.
I can see this as a common user problem and I see no reason to hide it from them.
by the way how do you enable debug messages?

Chris M

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Emc-developers mailing list
Emc-developers@...
https://lists.sourceforge.net/lists/listinfo/emc-developers
Jon Elson | 31 Jan 19:03

release dates wrong ?

On the News page of the LinuxCNC site, it shows a release date of
23 March 2011 for BOTH 2.4.6 and 2.4.7
There is no listing for 2.4.5
Is this a typo?

Jon

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
Kirk Wallace | 30 Jan 23:57
Gravatar

make Not

Can anyone find the problem with the Makefile shown below? The last
command loops.

...

kwallace <at> 104:~/emc2/mvx9000$ make
Makefile:27: warning: overriding commands for target `install'
/usr/share/emc/Makefile.modinc:66: warning: ignoring old commands for
target `install'
Makefile:42: warning: overriding commands for target `clean'
/usr/share/emc/Makefile.modinc:63: warning: ignoring old commands for
target `clean'
make: Warning: File `mvx9000rtu.c' has modification time 2.5e+04 s in
the future
mkdir -p .o
gcc -Os -g -I. -I/usr/realtime-2.6.32-122-rtai/include -I.
-I/usr/realtime-2.6.32-122-rtai/include -D_FORTIFY_SOURCE=0 -ffast-math
-mhard-float -DRTAI=3  -DRTAPI -D_GNU_SOURCE -Drealtime
-D_FORTIFY_SOURCE=0 -D__MODULE__ -I/usr/include/emc2 -I/usr/include/emc2
-URTAPI -U__MODULE__ -DULAPI -Os -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include   -MM -MT ".o/mvx9000rtu.d .o/mvx9000rtu.o"
mvx9000rtu.c -o .o/mvx9000rtu.d.tmp \
			&& mv .o/mvx9000rtu.d.tmp .o/mvx9000rtu.d
Makefile:27: warning: overriding commands for target `install'
/usr/share/emc/Makefile.modinc:66: warning: ignoring old commands for
target `install'
Makefile:42: warning: overriding commands for target `clean'
/usr/share/emc/Makefile.modinc:63: warning: ignoring old commands for
target `clean'
make: Warning: File `mvx9000rtu.c' has modification time 2.5e+04 s in
the future
mkdir -p .o
gcc -Os -g -I. -I/usr/realtime-2.6.32-122-rtai/include -I.
-I/usr/realtime-2.6.32-122-rtai/include -D_FORTIFY_SOURCE=0 -ffast-math
-mhard-float -DRTAI=3  -DRTAPI -D_GNU_SOURCE -Drealtime
-D_FORTIFY_SOURCE=0 -D__MODULE__ -I/usr/include/emc2 -I/usr/include/emc2
-URTAPI -U__MODULE__ -DULAPI -Os -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include   -MM -MT ".o/mvx9000rtu.d .o/mvx9000rtu.o"
mvx9000rtu.c -o .o/mvx9000rtu.d.tmp \
			&& mv .o/mvx9000rtu.d.tmp .o/mvx9000rtu.d
Makefile:27: warning: overriding commands for target `install'
/usr/share/emc/Makefile.modinc:66: warning: ignoring old commands for
target `install'
Makefile:42: warning: overriding commands for target `clean'
/usr/share/emc/Makefile.modinc:63: warning: ignoring old commands for
target `clean'
make: Warning: File `mvx9000rtu.c' has modification time 2.5e+04 s in
the future
mkdir -p .o
... ad infinitum

~~~~~~~~~~~~~
Makefile
~~~~~~~~~~~~~
default: mvx9000rtu

MODINC := $(shell ./find-modinc)
BINDIR := $(shell ./find-bindir)

ifeq "$(MODINC)" ""
$(error Required files for building components not present.  Install
emc2-dev)
endif
include $(MODINC)

ifeq ($(RUN_IN_PLACE),no)
EXTRA_CFLAGS += -I$(EMC2_HOME)/include/emc2
LIBDIR := $(shell ./find-libdir)
ifeq "$(LIBDIR)" ""
$(error LIBDIR not found)
endif
endif

CFLAGS := $(EXTRA_CFLAGS) -URTAPI -U__MODULE__ -DULAPI -Os
CFLAGS += $(shell pkg-config --cflags glib-2.0)
LFLAGS := -Wl,-rpath,$(LIBDIR) -L$(LIBDIR) -lemchal
LFLAGS += $(shell pkg-config --libs glib-2.0)

include .o/mvx9000rtu.d .o/modbus.d

install: mvx9000rtu
	cp mvx9000rtu $(BINDIR)

mvx9000rtu: .o/mvx9000rtu.o .o/modbus.o
	$(CC) -o $@ $^ $(LFLAGS)

.o/%.o: %.c
	mkdir -p .o
	$(CC) $(CFLAGS) -o $@ -c $<

.o/%.d: %.c
	mkdir -p .o
	$(CC) $(CFLAGS) -MM -MT "$@ $(patsubst %.d,%.o,$@)" $< -o $@.tmp \
			&& mv $@.tmp $@

clean:
	-rm -f mvx9000rtu
	-rm -rf .o

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
Chris Morley | 29 Jan 15:13
Picon

gremlin patch to look at

Here is a patch to expose more functionality to gremlin.
it goes against 2.5

Things like displaying only metric units was hard coded.
There was no way to clear the plotter of feed / rapid moves
I imagine there should be a EMC_ACTION for clearing the plot?

One problem i haven't figure out is how to get gremlin
to redraw the program after a origin change (touch-off)

I can call gremlin.load() and this reload the file but
it doesn't redraw it based on the new tool position.
Strangely it seems if I cause an linuxcnc error message to print
then reload it does seem to plot it in the new position!

I am using gremlin in a prototype frontend for linuxcnc
but much of this is needed to display properly regardless of
what you are using it for.

Feedback would be welcome.

Chris M

PS Linuxcnc is too long to type :)
From 939d1078b7d6154017c1161d2e3cbc7c489f7f87 Mon Sep 17 00:00:00 2001
From: cmorley <chrisinnanaimo <at> hotmail.com>
Date: Tue, 17 Jan 2012 17:58:39 -0800
Subject: [PATCH] gladevcp -expose more functionality to hal_gremlin

can select such things as displaying in metric or imperial

Signed-off-by: cmorley <chrisinnanaimo <at> hotmail.com>
---
 lib/python/gladevcp/hal_gremlin.py  |   32 +++++++++++++++++-
 src/emc/usr_intf/gremlin/gremlin.py |   63 ++++++++++++++++++++++++-----------
 2 files changed, 74 insertions(+), 21 deletions(-)

diff --git a/lib/python/gladevcp/hal_gremlin.py b/lib/python/gladevcp/hal_gremlin.py
index d221f36..a559673 100644
--- a/lib/python/gladevcp/hal_gremlin.py
+++ b/lib/python/gladevcp/hal_gremlin.py
@@ -29,8 +29,36 @@ class HAL_Gremlin(gremlin.Gremlin, _EMC_ActionBase):
     __gproperties__ = {
         'view' : ( gobject.TYPE_STRING, 'View type', 'Default view: x, y, z, p',
                     'z', gobject.PARAM_READWRITE | gobject.PARAM_CONSTRUCT),
-        'enable_dro' : ( gobject.TYPE_BOOLEAN, 'Enable DRO', 'Draw DRO on plot or not',
+        'enable_dro' : ( gobject.TYPE_BOOLEAN, 'Enable DRO', 'Show DRO on graphics',
                     True, gobject.PARAM_READWRITE | gobject.PARAM_CONSTRUCT),
+        'use_metric' : ( gobject.TYPE_BOOLEAN, 'Use Metric', 'Show DRO in metric or imperial units',
+                    True, gobject.PARAM_READWRITE | gobject.PARAM_CONSTRUCT),
+        'use_relative' : ( gobject.TYPE_BOOLEAN, 'Show Relative', 'Show DRO relative to active system or
actual machine',
+                    True, gobject.PARAM_READWRITE | gobject.PARAM_CONSTRUCT),
+        'use_commanded' : ( gobject.TYPE_BOOLEAN, 'Show Commanded', 'Show commanded or actual position',
+                    True, gobject.PARAM_READWRITE | gobject.PARAM_CONSTRUCT),
+        'show_extents_option' : ( gobject.TYPE_BOOLEAN, 'Show Extents', 'Show machine extents',
+                    True, gobject.PARAM_READWRITE | gobject.PARAM_CONSTRUCT),
+        'show_limits' : ( gobject.TYPE_BOOLEAN, 'Show limits', 'Show machine limits',
+                    True, gobject.PARAM_READWRITE | gobject.PARAM_CONSTRUCT),
+        'show_offsets' : ( gobject.TYPE_BOOLEAN, 'Show Offsets', 'Show offsets',
+                    False, gobject.PARAM_READWRITE | gobject.PARAM_CONSTRUCT),
+        'show_live_plot' : ( gobject.TYPE_BOOLEAN, 'Show live plot', 'Show machine plot',
+                    True, gobject.PARAM_READWRITE | gobject.PARAM_CONSTRUCT),
+        'show_velocity' : ( gobject.TYPE_BOOLEAN, 'Show tool speed', 'Show tool velocity',
+                    True, gobject.PARAM_READWRITE | gobject.PARAM_CONSTRUCT),
+        'show_program' : ( gobject.TYPE_BOOLEAN, 'Show program', 'Show program',
+                    True, gobject.PARAM_READWRITE | gobject.PARAM_CONSTRUCT),
+        'show_rapids' : ( gobject.TYPE_BOOLEAN, 'Show rapids', 'Show rapid moves',
+                    True, gobject.PARAM_READWRITE | gobject.PARAM_CONSTRUCT),
+        'show_tool' : ( gobject.TYPE_BOOLEAN, 'Show tool', 'Show tool',
+                    True, gobject.PARAM_READWRITE | gobject.PARAM_CONSTRUCT),
+        'show_dtg' : ( gobject.TYPE_BOOLEAN, 'Show DTG', 'Show Distance To Go',
+                    True, gobject.PARAM_READWRITE | gobject.PARAM_CONSTRUCT),
+        'is_lathe_option' : ( gobject.TYPE_BOOLEAN, 'Show as lathe', 'Show as a lathe layout',
+                    False, gobject.PARAM_READWRITE | gobject.PARAM_CONSTRUCT),
+        'use_joints_mode' : ( gobject.TYPE_BOOLEAN, 'Use joints mode', 'Use joints mode',
+                    False, gobject.PARAM_READWRITE | gobject.PARAM_CONSTRUCT),
     }
     __gproperties = __gproperties__
     def __init__(self, *a, **kw):
@@ -64,6 +92,8 @@ class HAL_Gremlin(gremlin.Gremlin, _EMC_ActionBase):

         elif name == 'enable_dro':
             self.enable_dro = value
+        elif name == 'use_metric':
+            self.use_metric = value
         elif name in self.__gproperties.keys():
             setattr(self, name, value)
         else:
diff --git a/src/emc/usr_intf/gremlin/gremlin.py b/src/emc/usr_intf/gremlin/gremlin.py
index 0871aae..6a490b5 100755
--- a/src/emc/usr_intf/gremlin/gremlin.py
+++ b/src/emc/usr_intf/gremlin/gremlin.py
@@ -51,8 +51,7 @@ class Gremlin(gtk.gtkgl.widget.DrawingArea, glnav.GlNavBase,
             a = self.colors[s + "_alpha"]
             s = self.colors[s]
             return [int(x * 255) for x in s + (a,)]
-
-
+        self.inifile = inifile
         self.logger = linuxcnc.positionlogger(linuxcnc.stat(),
             C('backplotjog'),
             C('backplottraverse'),
@@ -65,7 +64,6 @@ class Gremlin(gtk.gtkgl.widget.DrawingArea, glnav.GlNavBase,
         thread.start_new_thread(self.logger.start, (.01,))

         rs274.glcanon.GlCanonDraw.__init__(self, linuxcnc.stat(), self.logger)
-        self.inifile = inifile

         self.current_view = 'z'

@@ -94,6 +92,21 @@ class Gremlin(gtk.gtkgl.widget.DrawingArea, glnav.GlNavBase,
         self.maxlat = 90

         self.highlight_line = None
+        self.program_alpha = False
+        self.use_joints_mode = False
+        self.use_commanded = True
+        self.show_limits = True
+        self.show_extents_option = True
+        self.show_live_plot = True
+        self.show_velocity = True
+        self.use_metric = True
+        self.show_program = True
+        self.show_rapids = True
+        self.use_relative = True
+        self.show_tool = True
+        self.show_dtg = True
+        self.lathe_option = False
+        self.show_offsets = False

 	self.a_axis_wrapped = inifile.find("AXIS_3", "WRAPPED_ROTARY")
 	self.b_axis_wrapped = inifile.find("AXIS_4", "WRAPPED_ROTARY")
@@ -138,6 +151,9 @@ class Gremlin(gtk.gtkgl.widget.DrawingArea, glnav.GlNavBase,

     def _redraw(self): self.expose()

+    def clear_live_plotter(self):
+        self.logger.clear()
+
     def map(self, *args):
         gobject.timeout_add(50, self.poll)

@@ -169,16 +185,17 @@ class Gremlin(gtk.gtkgl.widget.DrawingArea, glnav.GlNavBase,
         self.font_charwidth = width
         rs274.glcanon.GlCanonDraw.realize(self)

-        if s.file: self.load(s.file)
+        if s.file: self.load()

     def set_current_view(self):
         if self.current_view not in ['x', 'y', 'z', 'p']:
             return
         return getattr(self, 'set_view_%s' % self.current_view)()

-    def load(self, filename):
+    def load(self,filename = None):
         s = self.stat
         s.poll()
+        if not filename and s.file: filename = s.file

         td = tempfile.mkdtemp()
         self._current_file = filename
@@ -199,27 +216,33 @@ class Gremlin(gtk.gtkgl.widget.DrawingArea, glnav.GlNavBase,

         self.set_current_view()

-    def get_program_alpha(self): return False
+    def get_program_alpha(self): return self.program_alpha
     def get_num_joints(self): return self.num_joints
-    def get_geometry(self): return 'XYZ'
-    def get_joints_mode(self): return False
-    def get_show_commanded(self): return True
-    def get_show_extents(self): return True
-    def get_show_limits(self): return True
-    def get_show_live_plot(self): return True
-    def get_show_machine_speed(self): return True
-    def get_show_metric(self): return True
-    def get_show_program(self): return True
-    def get_show_rapids(self): return True
-    def get_show_relative(self): return True
-    def get_show_tool(self): return True
-    def get_show_distance_to_go(self): return True
+    def get_geometry(self): 
+        temp = self.inifile.find("DISPLAY", "GEOMETRY")
+        if temp:
+            self.geometry = temp.upper()
+        else:
+            self.geometry = 'XYZ'
+        return self.geometry
+    def get_joints_mode(self): return self.use_joints_mode
+    def get_show_commanded(self): return self.use_commanded
+    def get_show_extents(self): return self.show_extents_option
+    def get_show_limits(self): return self.show_limits
+    def get_show_live_plot(self): return self.show_live_plot
+    def get_show_machine_speed(self): return self.show_velocity
+    def get_show_metric(self): return self.use_metric
+    def get_show_program(self): return self.show_program
+    def get_show_rapids(self): return self.show_rapids
+    def get_show_relative(self): return self.use_relative
+    def get_show_tool(self): return self.show_tool
+    def get_show_distance_to_go(self): return self.show_dtg

     def get_view(self):
         view_dict = {'x':0, 'y':1, 'z':2, 'p':3}
         return view_dict.get(self.current_view, 3)

-    def is_lathe(self): return False
+    def is_lathe(self): return self.lathe_option
     def get_current_tool(self):
         for i in self.stat.tool_table:
             if i[0] == self.stat.tool_in_spindle:
--

-- 
1.7.0.4

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Emc-developers mailing list
Emc-developers@...
https://lists.sourceforge.net/lists/listinfo/emc-developers
Jon Elson | 29 Jan 05:50

having problem with loadrt options

Hello, all,

I have just discovered a bug in the 2.5 hal/drivers/hal_ppmc.c driver.
There are several
optional features that are activated by options on the loadrt line.
These are the extradac="0x00" and the timestamp="0x00" options.
They appear to work separately, but when they both appear on the
same loadrt line, then the timestamp option seems to be ignored.
I detect this because the hal parameter ppmc.0.encoder.00.min-speed-estimate
is not exported if both options are requested.

One other thing I noted is if I give an incorrect "slot code", I get an 
error
mesaage saying no board is at that address for the extradac option, but
none for the timestamp option.  I have
tried specifying the options in either order, same result.

I have also noticed that if you give an incorrect slot code for the extradac
option, you get a specific error message, but an incorrect slot code
for the timestamp option gives no message, but the option is not enabled
in that case.

If you request both extradac and extradout it gives a specific message for
that from line 637.

I wonder if anyone would be willing to take a look at the code.  I know
this will be hard to debug without a UPC board, so I hope maybe somebody
can see an obvious goof in the code.

Thanks,

Jon

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
jeremy youngs | 29 Jan 04:03
Picon
Gravatar

Re: Emc-developers Digest, Vol 69, Issue 50


hello is anyone else having problems connecting to the embedded irc? also im finally getting to play with the sim feature in hal and im curiuos to know how to load an external nc program into it? im trying to work out post processing bugs before commiting money to steppers and controller also how many lines of code will linux cnc run? ie is the memory cap defined by software or hardware constrictive thank you jeremy
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Emc-developers mailing list
Emc-developers@...
https://lists.sourceforge.net/lists/listinfo/emc-developers
Sammel Lothar | 28 Jan 22:59
Picon
Picon

Foam Cutting EMC almost perfect patch againsst 2.6-pre

Hi this is the new almost perfect patch  for xyuv foamcutting mashines
Now Highlighting is implemented
code is reduced to a minimum
maybe liveplotting data can be shorten some more OR i need a trigger for 
States.gcodes 171 in LivePlotter.updade
otherwise the list is gone be huge and not used
maybe i can fill this also in GlcanonDraw that woudt be best then there 
is the the trigger in redraw !
there will be the problem to clean it up. therefor i choos to use 
liveplotter with clean to be pressed on the broom of the axis frame

so its done and working

feel free to comment !
Sammel Lothar Germany
>From f605fc571f913bf24ac8ff22b9a40007b4a0b0eb Mon Sep 17 00:00:00 2001
From: SammelLothar <SammelLothar@...>
Date: Tue, 24 Jan 2012 21:41:51 +0100
Subject: [PATCH] foam-xyuv-Modification-2.6-pre

---
 lib/python/hershey.py                 |   10 +-
 lib/python/rs274/glcanon.py           |  287 +++++++++++++++++++++++++++++----
 nc_files/foam-xyuv.ngc                |   25 +++
 share/axis/tcl/axis.tcl               |    5 +
 src/emc/usr_intf/axis/scripts/axis.py |   52 ++++++-
 5 files changed, 339 insertions(+), 40 deletions(-)
 create mode 100644 nc_files/foam-xyuv.ngc

diff --git a/lib/python/hershey.py b/lib/python/hershey.py
index 16bb02a..6a07a3d 100644
--- a/lib/python/hershey.py
+++ b/lib/python/hershey.py
@@ -17,7 +17,7 @@

 from minigl import *

-translate = {'0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '-': 10, '.': 11, 'X':
12, 'Y': 13, 'Z': 14, 'G': 15}
+translate = {'0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '-': 10, '.': 11, 'X':
12, 'Y': 13, 'Z': 14, 'G': 15,'V':16,'U':17}

 class Hershey:
     def __init__(self):
@@ -92,8 +92,12 @@ class Hershey:
           (160.0, 380.0), (200.0, 420.0), (260.0, 440.0), (280.0, 440.0),
           (340.0, 420.0), (380.0, 380.0), (400.0, 320.0),
           (400.0, 280.0), (270.0, 280.0)
-
-          ]]
+          ]],
+    # V
+        [[(60, 20), (200, 440)], [(340, 20), (200, 440)]], 
+    # U
+        [[(60, 20), (60, 400),(95,410),(130,420),(165,430),(200,440)],
+        [(340, 20),(340, 400),(305, 410),(270, 420),(235, 430),(200, 440)]] 

        ) 

diff --git a/lib/python/rs274/glcanon.py b/lib/python/rs274/glcanon.py
index 75322bb..d704446 100644
--- a/lib/python/rs274/glcanon.py
+++ b/lib/python/rs274/glcanon.py
@@ -78,6 +78,10 @@ class GLCanon(Translated, ArcsToSegmentsMixin):
         self.g5x_offset_u = 0.0
         self.g5x_offset_v = 0.0
         self.g5x_offset_w = 0.0
+        self.xyuv_live_plot_data = []
+        self.grid_space = 10.0
+        self.xy_plane_z_position = 5.0
+        self.uv_plane_z_position = 30.0

     def comment(self, arg):
         if arg.startswith("AXIS,"):
@@ -86,7 +90,35 @@ class GLCanon(Translated, ArcsToSegmentsMixin):
             if command == "stop": raise KeyboardInterrupt
             if command == "hide": self.suppress += 1
             if command == "show": self.suppress -= 1
-
+            if command == "XY_Z_POS": 
+                if len(parts) > 2 :
+                    try:
+                        self.xy_plane_z_position = float(parts[2])
+                        if 210 in self.state.gcodes:
+                            self.xy_plane_z_position = self.xy_plane_z_position / 25.4
+                    except:
+                        self.xy_plane_z_position = 5.0/25.4
+            if command == "UV_Z_POS": 
+                if len(parts) > 2 :
+                    try:
+                        self.uv_plane_z_position = float(parts[2])
+                        if 210 in self.state.gcodes:
+                            self.uv_plane_z_position = self.uv_plane_z_position / 25.4
+                    except:
+                        self.uv_plane_z_position = 30.0
+            if command == "GRID":
+                if len(parts) > 2 :
+                    try:
+                        self.grid_space = float(parts[2])
+                        if 210 in self.state.gcodes:
+                            self.grid_space=self.grid_space / 25.4
+                    except:
+                        self.grid_space = 5.0/25.4
+                
+    def get_grid_space(self):return self.grid_space
+    def get_xy_plane_z_position(self):return self.xy_plane_z_position
+    def get_uv_plane_z_position(self):return self.uv_plane_z_position
+ 
     def message(self, message): pass

     def check_abort(self): pass
@@ -96,7 +128,21 @@ class GLCanon(Translated, ArcsToSegmentsMixin):
         self.lineno = self.state.sequence_number

     def draw_lines(self, lines, for_selection, j=0):
-        return linuxcnc.draw_lines(self.geometry, lines, for_selection)
+        if 171 in self.state.gcodes:
+            glPushMatrix()
+            c = self.colors['axis_x']
+            glColor3f(*c)
+            glTranslatef(0,0,self.get_xy_plane_z_position())
+            linuxcnc.draw_lines("XY", lines, for_selection)
+            glPopMatrix()
+            glPushMatrix()
+            ca = self.colors['axis_z']
+            glColor3f(*ca)
+            glTranslatef(0,0,self.get_uv_plane_z_position())
+            linuxcnc.draw_lines("UV", lines, for_selection)
+            glPopMatrix()
+        else:
+            return linuxcnc.draw_lines(self.geometry, lines, for_selection)

     def draw_dwells(self, dwells, alpha, for_selection, j0=0):
         return linuxcnc.draw_dwells(self.geometry, dwells, alpha, for_selection, self.is_lathe())
@@ -202,9 +248,15 @@ class GLCanon(Translated, ArcsToSegmentsMixin):
             coords.append(line[2][:3])
         for line in self.feed:
             if line[0] != lineno: continue
-            linuxcnc.line9(geometry, line[1], line[2])
-            coords.append(line[1][:3])
-            coords.append(line[2][:3])
+            if 171 in self.state.gcodes:
+                glVertex3f(line[1][0],line[1][1],self.get_xy_plane_z_position())
+                glVertex3f(line[2][0],line[2][1],self.get_xy_plane_z_position())
+                glVertex3f(line[1][6],line[1][7],self.get_uv_plane_z_position())
+                glVertex3f(line[2][6],line[2][7],self.get_uv_plane_z_position())
+            else:
+                linuxcnc.line9(geometry, line[1], line[2])
+                coords.append(line[1][:3])
+                coords.append(line[2][:3])
         glEnd()
         for line in self.dwells:
             if line[0] != lineno: continue
@@ -241,7 +293,6 @@ class GLCanon(Translated, ArcsToSegmentsMixin):
             else:
                 self.color_with_alpha('straight_feed')
             self.draw_lines(self.feed, for_selection, len(self.traverse))
-
             if for_selection:
                 self.color('arc_feed')
             else:
@@ -320,6 +371,27 @@ class GlCanonDraw:
         self.select_buffer_size = 100
         self.cached_tool = -1
         self.initialised = 0
+        self.redraw_count = 0
+        self.xyuv_live_plot_data = []
+        self.xyuv_view = False
+
+    def draw_xyuv_live_plot(self, n):
+        xy_plane_z_position= self.canon.get_xy_plane_z_position() 
+        uv_plane_z_position= self.canon.get_uv_plane_z_position() 
+        glNewList(n, GL_COMPILE)
+        s = self.stat
+        view = self.get_view()
+        glColor3f(1.0,0.0,0.0)
+        glBegin(GL_LINES)
+        if len(self.xyuv_live_plot_data) >0:
+            for line in self.xyuv_live_plot_data:
+                glVertex3f(line[0],line[1],xy_plane_z_position)
+                glVertex3f(line[2],line[3],uv_plane_z_position)
+        else:
+            glVertex3f(0.0,0.0,0.0)
+            glVertex3f(0.0,0.0,0.001)
+        glEnd()
+        glEndList()

     def realize(self):
         self.hershey = hershey.Hershey()
@@ -327,6 +399,9 @@ class GlCanonDraw:
         self.basic_lighting()
         self.initialised = 1

+    def set_xyuv_live_plot_data(self,data):
+        self.xyuv_live_plot_data = data
+
     def set_canon(self, canon):
         self.canon = canon

@@ -363,7 +438,9 @@ class GlCanonDraw:
             if self.get_show_rapids():
                 glCallList(self.dlist('select_rapids', gen=self.make_selection_list))
             glCallList(self.dlist('select_norapids', gen=self.make_selection_list))
-
+            if self.xyuv_view:
+                glCallList(self.dlist('select_xy_plane', gen=self.make_selection_list))
+                glCallList(self.dlist('select_uv_plane', gen=self.make_selection_list))
             try:
                 buffer = list(glRenderMode(GL_RENDER))
             except OverflowError:
@@ -547,6 +624,23 @@ class GlCanonDraw:
             glVertex3f(x_pos - dashwidth, y_pos - zdashwidth, g.max_extents[z])
             glVertex3f(x_pos + dashwidth, y_pos + zdashwidth, g.max_extents[z])

+        # z dimension xyuv view
+        if self.xyuv_view:
+            xy_z= self.canon.get_xy_plane_z_position() 
+            uv_z= self.canon.get_uv_plane_z_position() 
+            
+            if view != z and uv_z > xy_z :
+                x_pos = g.min_extents[x] - pullback
+                y_pos = g.min_extents[y] - pullback
+                glVertex3f(x_pos, y_pos, xy_z)
+                glVertex3f(x_pos, y_pos, uv_z)
+
+                glVertex3f(x_pos - dashwidth, y_pos - zdashwidth, xy_z)
+                glVertex3f(x_pos + dashwidth, y_pos + zdashwidth, xy_z)
+
+                glVertex3f(x_pos - dashwidth, y_pos - zdashwidth, uv_z)
+                glVertex3f(x_pos + dashwidth, y_pos + zdashwidth, uv_z)
+        
         glEnd()

         # Labels
@@ -554,7 +648,12 @@ class GlCanonDraw:
             offset = self.to_internal_units(s.g5x_offset + s.g92_offset)
         else:
             offset = 0, 0, 0
-        if view != z and g.max_extents[z] > g.min_extents[z]:
+        z_max = g.max_extents[z] 
+        z_min = g.min_extents[z] 
+        if self.xyuv_view:  # Z label at EDN/Foam 
+            z_max = self.canon.get_uv_plane_z_position()
+            z_min = self.canon.get_xy_plane_z_position()
+        if view != z and z_max > z_min:
             if view == x:
                 x_pos = g.min_extents[x] - pullback
                 y_pos = g.min_extents[y] - 6.0*dashwidth
@@ -562,10 +661,10 @@ class GlCanonDraw:
                 x_pos = g.min_extents[x] - 6.0*dashwidth
                 y_pos = g.min_extents[y] - pullback

-            bbox = self.color_limit(g.min_extents[z] < machine_limit_min[z])
+            bbox = self.color_limit(z_min < machine_limit_min[z])
             glPushMatrix()
-            f = fmt % ((g.min_extents[z]-offset[z]) * dimscale)
-            glTranslatef(x_pos, y_pos, g.min_extents[z] - halfchar)
+            f = fmt % ((z_min-offset[z]) * dimscale)
+            glTranslatef(x_pos, y_pos, z_min - halfchar)
             glScalef(charsize, charsize, charsize)
             glRotatef(-90, 0, 1, 0)
             glRotatef(-90, 0, 0, 1)
@@ -574,10 +673,10 @@ class GlCanonDraw:
             self.hershey.plot_string(f, 0, bbox)
             glPopMatrix()

-            bbox = self.color_limit(g.max_extents[z] > machine_limit_max[z])
+            bbox = self.color_limit(z_max > machine_limit_max[z])
             glPushMatrix()
-            f = fmt % ((g.max_extents[z]-offset[z]) * dimscale)
-            glTranslatef(x_pos, y_pos, g.max_extents[z] - halfchar)
+            f = fmt % ((z_max-offset[z]) * dimscale)
+            glTranslatef(x_pos, y_pos, z_max - halfchar)
             glScalef(charsize, charsize, charsize)
             glRotatef(-90, 0, 1, 0)
             glRotatef(-90, 0, 0, 1)
@@ -588,8 +687,8 @@ class GlCanonDraw:

             self.color_limit(0)
             glPushMatrix()
-            f = fmt % ((g.max_extents[z] - g.min_extents[z]) * dimscale)
-            glTranslatef(x_pos, y_pos, (g.max_extents[z] + g.min_extents[z])/2)
+            f = fmt % ((z_max - z_min) * dimscale)
+            glTranslatef(x_pos, y_pos, (z_max + z_min)/2)
             glScalef(charsize, charsize, charsize)
             if view != x:
                 glRotatef(-90, 0, 0, 1)
@@ -691,7 +790,6 @@ class GlCanonDraw:
         if unit is None:
             unit = self.stat.linear_units
         lu = (unit or 1) * 25.4
-
         lus = [lu, lu, lu, 1, 1, 1, lu, lu, lu]
         return [a/b for a, b in zip(pos, lus)]

@@ -707,15 +805,63 @@ class GlCanonDraw:
             self.to_internal_units([fudge(ax[i]['max_position_limit'])
                 for i in range(3)]))

-
     def redraw(self):
         s = self.stat
         s.poll()
-
         machine_limit_min, machine_limit_max = self.soft_limits()
-
+        if 171 in self.canon.state.gcodes: # XYUV enabled
+            self.xyuv_view = True
+        else:
+            self.xyuv_view = False
         glDisable(GL_LIGHTING)
         glMatrixMode(GL_MODELVIEW)
+        # show grid
+        if self.get_view() == 2 and self.get_show_grid():
+            grid_space_read = self.canon.get_grid_space()
+            if type(grid_space_read).__name__=='tuple':
+                grid_space = 10.0
+            else:
+                grid_space = grid_space_read
+            glLineWidth(1)
+            glColor3f(0.15,0.15,0.15)
+            glBegin(GL_LINES)
+            #x-grid
+            if machine_limit_min[0] < (s.g5x_offset[0]-grid_space):
+                grid_lines = int(((machine_limit_min[0]) - s.g5x_offset[0])/ grid_space)+1
+                x = s.g5x_offset[0]
+                if grid_lines < 0:grid_lines=(grid_lines * (-1))+1
+                for i in range(0,grid_lines):
+                    glVertex3f(x,machine_limit_min[1],-0.05)
+                    glVertex3f(x,machine_limit_max[1],-0.05)
+                    x=x-grid_space
+            #x+grid
+            if machine_limit_max[0] > (s.g5x_offset[0] + grid_space):
+                grid_lines = int(((machine_limit_max[0]) - s.g5x_offset[0])/ grid_space)+1
+                x = s.g5x_offset[0]
+                if grid_lines < 0:grid_lines=(grid_lines * (-1))+1
+                for i in range(0,grid_lines):
+                    glVertex3f(x,machine_limit_min[1],-0.05)
+                    glVertex3f(x,machine_limit_max[1],-0.05)
+                    x=x+grid_space
+            #y-grid
+            if machine_limit_min[1] < (s.g5x_offset[1] - grid_space):
+                grid_lines = int(((machine_limit_min[1]) - s.g5x_offset[1])/ grid_space)+1
+                y = s.g5x_offset[1]
+                if grid_lines < 0:grid_lines=(grid_lines * (-1))+1
+                for i in range(0,grid_lines):
+                    glVertex3f(machine_limit_min[0],y,-0.05)
+                    glVertex3f(machine_limit_max[0],y,-0.05)
+                    y=y-grid_space
+            #y+grid
+            if machine_limit_max[1] > (s.g5x_offset[1] + grid_space):
+                grid_lines = int(((machine_limit_max[1]) - s.g5x_offset[1])/ grid_space)+1
+                y = s.g5x_offset[1]
+                if grid_lines < 0:grid_lines=(grid_lines * (-1))+1
+                for i in range(0,grid_lines):
+                    glVertex3f(machine_limit_min[0],y,-0.05)
+                    glVertex3f(machine_limit_max[0],y,-0.05)
+                    y=y+grid_space
+            glEnd() # end Grid Generator 

         if self.get_show_program():
             if self.get_program_alpha():
@@ -728,10 +874,12 @@ class GlCanonDraw:
             glCallList(self.dlist('program_norapids', gen=self.make_main_list))
             glCallList(self.dlist('highlight'))

+            if self.xyuv_view:
+                glCallList(self.dlist('XY', gen=self.make_main_list))
+                glCallList(self.dlist('UV', gen=self.make_main_list))
             if self.get_program_alpha():
                 glDisable(GL_BLEND)
                 glEnable(GL_DEPTH_TEST)
-
             if self.get_show_extents():
                 self.show_extents()

@@ -798,7 +946,6 @@ class GlCanonDraw:

                 glTranslatef(*g92_offset)
                 glCallList(alist)
-
                 glPopMatrix()
             else:
                 glCallList(alist)
@@ -852,7 +999,7 @@ class GlCanonDraw:
             glDisable(GL_LINE_STIPPLE)
             glLineStipple(2, 0xffff)

-        if self.get_show_live_plot():
+        if (self.get_show_live_plot() and (not self.xyuv_view)) :
             glDepthFunc(GL_LEQUAL)
             glLineWidth(3)
             glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
@@ -873,7 +1020,7 @@ class GlCanonDraw:
             glLineWidth(1)
             glDepthFunc(GL_LESS)

-        if self.get_show_tool():
+        if self.get_show_tool() and (not self.xyuv_view):
             pos = self.lp.last(self.get_show_live_plot())
             if pos is None: pos = [0] * 6
             rx, ry, rz = pos[3:6]
@@ -919,6 +1066,47 @@ class GlCanonDraw:
                 glCallList(self.dlist('tool'))
             glPopMatrix()

+        if self.xyuv_view:
+            pos = self.to_internal_units(s.joint_actual_position)
+            pos_xy = (pos[0],pos[1],self.canon.get_xy_plane_z_position()-0.25)
+            xy_plane_z_position = self.canon.get_xy_plane_z_position() 
+            uv_plane_z_position = self.canon.get_uv_plane_z_position() 
+            # xy plane cone 
+            glPushMatrix()
+            glTranslatef(*pos_xy)
+            cone_xy = self.dlist("xy_cone", gen=self.make_xy_cone)
+            glCallList(cone_xy)
+            glPopMatrix()
+            # uv plane cone 
+            glPushMatrix()
+            pos_uv = (pos[6],pos[7],self.canon.get_uv_plane_z_position())
+            glTranslatef(*pos_uv)
+            cone_uv = self.dlist("uv_cone", gen=self.make_uv_cone)
+            glCallList(cone_uv)
+            glPopMatrix()
+            #xyuv_live_plot
+            self.xyuv_live_plot_data = self.get_live_data()
+            glPushMatrix()
+            xyuv_live_plot_list=(self.dlist(('xyuv_live', self.get_view()), gen=self.draw_xyuv_live_plot))
+            glCallList(xyuv_live_plot_list)
+            glPopMatrix()
+            glNewList(xyuv_live_plot_list, GL_COMPILE)
+            s = self.stat
+            view = self.get_view()
+            glColor3f(1.0,0.0,0.0)
+            glBegin(GL_LINES)
+            if len(self.xyuv_live_plot_data) >0:
+                for line in self.xyuv_live_plot_data:
+                    glVertex3f(line[0],line[1],xy_plane_z_position+0.001)
+                    glVertex3f(line[2],line[3],uv_plane_z_position-0.001)
+            else:
+                glVertex3f(0.0,0.0,0.0)
+                glVertex3f(0.0,0.0,0.001)
+            glEnd()
+            glEndList()
+            if self.get_show_extents():
+                self.show_extents()
+
         glMatrixMode(GL_PROJECTION)
         glPushMatrix()
         glLoadIdentity()
@@ -1170,14 +1358,11 @@ class GlCanonDraw:
         x,y,z,p = 0,1,2,3
         s = self.stat
         view = self.get_view()
-
-
         glColor3f(*self.colors['axis_x'])
         glBegin(GL_LINES)
         glVertex3f(1.0,0.0,0.0)
         glVertex3f(0.0,0.0,0.0)
         glEnd()
-
         if view != x:
             glPushMatrix()
             if self.is_lathe():
@@ -1217,7 +1402,6 @@ class GlCanonDraw:
         glVertex3f(0.0,0.0,0.0)
         glVertex3f(0.0,0.0,1.0)
         glEnd()
-
         if view != z:
             glPushMatrix()
             glTranslatef(0, 0, 1.2)
@@ -1233,7 +1417,6 @@ class GlCanonDraw:
             glScalef(0.2, 0.2, 0.2)
             self.hershey.plot_string("Z", 0.5)
             glPopMatrix()
-
         glEndList()

     def make_cone(self, n):
@@ -1250,6 +1433,42 @@ class GlCanonDraw:
         glEndList()
         gluDeleteQuadric(q)

+    def make_xy_cone(self, n):
+        q = gluNewQuadric()
+        glNewList(n, GL_COMPILE)
+        #glEnable(GL_LIGHTING)
+        glColor3f(*self.colors['axis_x'])
+        gluCylinder(q, 0.1, 0, .25, 32, 1)
+        glPushMatrix()
+        glTranslatef(0,0,.25)
+        gluDisk(q, 0.25, .1, 32, 1)
+        glPopMatrix()
+        glTranslatef(0,-0.12,0.2)
+        glRotatef(0, 0, 1, 0)
+        glScalef(0.2, 0.2, 0.2)
+        self.hershey.plot_string("XY", 0.5)
+
+        #glDisable(GL_LIGHTING)
+        glEndList()
+        gluDeleteQuadric(q)
+
+    def make_uv_cone(self, n):
+        q = gluNewQuadric()
+        glNewList(n, GL_COMPILE)
+        #glEnable(GL_LIGHTING)
+        glColor3f(*self.colors['axis_z'])
+        gluCylinder(q, 0, 0.1, .25, 32, 1)
+        glPushMatrix()
+        glTranslatef(0,0,.25)
+        gluDisk(q, 0, .1, 32, 1)
+        glPopMatrix()
+        glTranslatef(0.0,-0.12,0.05)
+        glRotatef(0, 0, 1, 0)
+        glScalef(0.2, 0.2, 0.2)
+        self.hershey.plot_string("UV", 0.5)
+        #glDisable(GL_LIGHTING)
+        glEndList()
+        gluDeleteQuadric(q)

     lathe_shapes = [
         None,                           # 0
@@ -1330,12 +1549,20 @@ class GlCanonDraw:
     def make_selection_list(self, unused=None):
         select_rapids = self.dlist('select_rapids')
         select_program = self.dlist('select_norapids')
+        select_xy_plane = self.dlist('select_xy_plane')
+        select_uv_plane = self.dlist('select_uv_plane')
         glNewList(select_rapids, GL_COMPILE)
         if self.canon: self.canon.draw(1, False)
         glEndList()
         glNewList(select_program, GL_COMPILE)
         if self.canon: self.canon.draw(1, True)
         glEndList()
+        glNewList(select_xy_plane, GL_COMPILE)
+        if self.canon: self.canon.draw(1, True)
+        glEndList()
+        glNewList(select_uv_plane, GL_COMPILE)
+        if self.canon: self.canon.draw(1, True)
+        glEndList()

     def make_main_list(self, unused=None):
         program = self.dlist('program_norapids')
@@ -1343,7 +1570,6 @@ class GlCanonDraw:
         glNewList(program, GL_COMPILE)
         if self.canon: self.canon.draw(0, True)
         glEndList()
-
         glNewList(rapids, GL_COMPILE)
         if self.canon: self.canon.draw(0, False)
         glEndList()
@@ -1359,7 +1585,6 @@ class GlCanonDraw:
             self.stale_dlist('program_norapids')
             self.stale_dlist('select_rapids')
             self.stale_dlist('select_norapids')
-
         return result, seq

     def from_internal_units(self, pos, unit=None):
diff --git a/nc_files/foam-xyuv.ngc b/nc_files/foam-xyuv.ngc
new file mode 100644
index 0000000..82633a9
--- /dev/null
+++ b/nc_files/foam-xyuv.ngc
@@ -0,0 +1,25 @@
+(test this with axis_9axis sim mashine )
+G17.1 G21 G90 G61 G54
+(AXIS,XY_Z_POS,5)
+(AXIS,UV_Z_POS,30)
+(AXIS,GRID,5)
+
+G0 x0 y0 u0 v0
+
+(square uv 45 deg turned offset 10mm to zero )
+G0 x5 y5
+G0 x10 y10  u22.5 v22.5 
+G1 x10 y35 u10 v35 F200
+G1 x10 y60 u22.5 v47.5
+G1 x35 y60 u35 v60
+G1 x60 y60 u47.5 v47.5
+G1 x60 y35 u60 v35
+G1 x60 y10 u47.5 v22.5
+G1 x35 y10 u35 v10
+G1 X10 Y10 u22.5 v22.5
+G1 X5 Y5 U5 V5 
+G0 x0 u0
+
+G0 x0 y0 u0 v0
+M30
+%
diff --git a/share/axis/tcl/axis.tcl b/share/axis/tcl/axis.tcl
index a478b30..fed3622 100644
--- a/share/axis/tcl/axis.tcl
+++ b/share/axis/tcl/axis.tcl
@@ -343,6 +343,11 @@ setup_menu_accel .menu.view end [_ "Show e_xtents"]
 setup_menu_accel .menu.view end [_ "Show o_ffsets"]

 .menu.view add checkbutton \
+	-variable show_grid \
+	-command toggle_show_grid
+setup_menu_accel .menu.view end [_ "Show Grid"]
+
+.menu.view add checkbutton \
 	-variable show_machine_limits \
 	-command toggle_show_machine_limits
 setup_menu_accel .menu.view end [_ "Sh_ow machine limits"]
diff --git a/src/emc/usr_intf/axis/scripts/axis.py b/src/emc/usr_intf/axis/scripts/axis.py
index 6e83b91..ae1baa9 100755
--- a/src/emc/usr_intf/axis/scripts/axis.py
+++ b/src/emc/usr_intf/axis/scripts/axis.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/python
 #    This is a component of AXIS, a front-end for LinuxCNC
 #    Copyright 2004, 2005, 2006, 2007, 2008, 2009
 #    Jeff Epler <jepler@...> and Chris Radek <chris@...>
@@ -366,6 +366,14 @@ class MyOpengl(GlCanonDraw, Opengl):
         self.set_eyepoint(5.)
         self.get_resources()
         self.realize()
+        self.xyuv_plane_view_available = False   
+        self.xyuv_start = 0
+        self.xyuv_stop = 0
+        self.xyuv_live_draw = False
+        self.xyuv_live_plot_data = []
+
+    def get_live_data(self):
+        return live_plotter.get_xyuv_live_plot_data()

     def getRotateMode(self):
         return vars.rotate_mode.get()
@@ -528,7 +536,7 @@ class MyOpengl(GlCanonDraw, Opengl):
     def get_show_live_plot(self): return vars.show_live_plot.get()
     def get_show_machine_speed(self): return vars.show_machine_speed.get()
     def get_show_distance_to_go(self): return vars.show_distance_to_go.get()
-
+    def get_show_grid(self): return vars.show_grid.get()
     def get_view(self):
         x,y,z,p = 0,1,2,3
         if str(widgets.view_x['relief']) == "sunken":
@@ -542,7 +550,6 @@ class MyOpengl(GlCanonDraw, Opengl):
             view = p
         return view

-
     def get_show_relative(self): return vars.coord_type.get()
     def get_show_limits(self): return vars.show_machine_limits.get()
     def get_show_tool(self): return vars.show_tool.get()
@@ -553,7 +560,7 @@ class MyOpengl(GlCanonDraw, Opengl):
         if self.select_event:
             self.select(self.select_event)
             self.select_event = None
-
+        GlCanonDraw.set_xyuv_live_plot_data(self,self.xyuv_live_plot_data)
         GlCanonDraw.redraw(self)

     def redraw_dro(self):
@@ -671,7 +678,11 @@ class LivePlotter:
         self.notifications_clear = False
         self.notifications_clear_info = False
         self.notifications_clear_error = False
-
+        self.xyuv_live_plot=[]
+    
+    def get_xyuv_live_plot_data(self):
+        return self.xyuv_live_plot
+    
     def start(self):
         if self.running.get(): return
         if not os.path.exists(linuxcnc.nmlfile):
@@ -817,6 +828,9 @@ class LivePlotter:
             root_window.tk.call("update_maxvel_slider")
         vupdate(vars.override_limits, self.stat.axis[0]['override_limits'])
         on_any_limit = 0
+        if self.stat.motion_line > 1 :
+            actual_xyuv=self.stat.actual_position
+            self.xyuv_live_plot.append((actual_xyuv[0],actual_xyuv[1],actual_xyuv[6],actual_xyuv[7]))
         for i, l in enumerate(self.stat.limit):
             if self.stat.axis_mask & (1<<i) and l:
                 on_any_limit = True
@@ -860,6 +874,7 @@ class LivePlotter:

     def clear(self):
         self.logger.clear()
+        self.xyuv_live_plot=[]
         o.redraw_soon()

 def running(do_poll=True):
@@ -971,6 +986,10 @@ class AxisCanon(GLCanon, StatMixin):
         self.progress = progress
         self.aborted = False
         self.arcdivision = arcdivision
+        self.xyuv_live_plot_data=[]
+
+    def set_xyuv_live_plot_data(self,data):
+        self.xyuv_live_plot_data=data

     def change_tool(self, pocket):
         GLCanon.change_tool(self, pocket)
@@ -1049,7 +1068,7 @@ def add_recent_file(f):
 def cancel_open(event=None):
     if o.canon is not None:
         o.canon.aborted = True
-
+    
 loaded_file = None
 def open_file_guts(f, filtered=False, addrecent=True):
     if addrecent:
@@ -1092,7 +1111,11 @@ def open_file_guts(f, filtered=False, addrecent=True):
         t.tk.call("delete_all", t)
         code = []
         i = 0
+        xyuv = 0
+        grid_view_declared = False
         for i, l in enumerate(lines):
+            if 'GRID' in l:grid_view_declared = True
+            if ('G17.1' in l):xyuv = 1
             l = l.expandtabs().replace("\r", "")
             #t.insert("end", "%6d: " % (i+1), "lineno", l)
             code.extend(["%6d: " % (i+1), "lineno", l, ""])
@@ -1105,6 +1128,16 @@ def open_file_guts(f, filtered=False, addrecent=True):
         progress.nextphase(len(lines))
         f = os.path.abspath(f)
         o.canon = canon = AxisCanon(o, widgets.text, i, progress, arcdivision)
+        if xyuv == 1:
+            vupdate(vars.show_live_plot,False)
+        else:
+            vupdate(vars.show_live_plot,True)
+        if not grid_view_declared: # enable Disable grid view
+            vupdate(vars.show_grid,False)
+            widgets.menu_view.entryconfigure("Show Grid",state=DISABLED)
+        else:
+            vupdate(vars.show_grid,True)
+            widgets.menu_view.entryconfigure("Show Grid",state=NORMAL)
         root_window.bind_class(".info.progress", "<Escape>", cancel_open)

         parameter = inifile.find("RS274NGC", "PARAMETER_FILE")
@@ -2177,6 +2210,10 @@ class TclCommands(nf.TclCommands):
     def toggle_program_alpha(*event):
         ap.putpref("program_alpha", vars.program_alpha.get())
         o.tkRedraw()
+        
+    def toggle_show_grid(*event):
+        ap.putpref("show_grid", vars.show_grid.get())
+        o.tkRedraw()

     def toggle_show_live_plot(*event):
         ap.putpref("show_live_plot", vars.show_live_plot.get())
@@ -2538,6 +2575,8 @@ vars = nf.Variables(root_window,
     ("touch_off_system", StringVar),
     ("machine", StringVar),
     ("on_any_limit", BooleanVar),
+    ("show_grid", IntVar),
+
 )
 vars.linuxcnctop_command.set(os.path.join(os.path.dirname(sys.argv[0]), "linuxcnctop"))
 vars.highlight_line.set(-1)
@@ -2556,6 +2595,7 @@ vars.show_distance_to_go.set(ap.getpref("show_distance_to_go", False))
 vars.dro_large_font.set(ap.getpref("dro_large_font", False))
 vars.block_delete.set(ap.getpref("block_delete", True))
 vars.optional_stop.set(ap.getpref("optional_stop", True))
+vars.show_grid.set(ap.getpref("show_grid", True))

 # placeholder function for LivePlotter.update():
 def user_live_update():
--

-- 
1.7.0.4

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Emc-developers mailing list
Emc-developers@...
https://lists.sourceforge.net/lists/listinfo/emc-developers

Gmane