NGCGUI and GCMC from the PyNgcGui GladeVCP widget

More
16 Jun 2016 08:37 #76136 by phillc54
I am attempting to use GCMC scripts through the PyNgcGui GladeVCP widget in a custom python GUI running LCNC 2.7.4.

In my ini file I have
[DISPLAY]
GCMC_INCLUDE_PATH = ../ngcgui/gcmc_lib
as noted here plus I have
[RS274NGC]
SUBROUTINE_PATH = ../ngcgui/gcmc_lib
as noted in the sample configuration. (this path IS the correct path for my installation)

All NGCGUI subs run as expected and the result appears correctly in the Gremlin display with the following message in the terminal
pyngcgui:SENT: /home/phill/linuxcnc/nc_files/0.auto.ngc
pyngcgui:SENT:using: default_send
however when I try a GCMC script I get the following output in the terminal when I click 'Create Feature'
xcmd= [None, '--include', '../ngcgui/gcmc_lib', '--output', '/home/phill/linuxcnc/nc_files/tmpgcmc_01.ngc', '--gcode-function', 'tmpgcmc_01', '--define=umode=1.0', '--define=D=100.0', '--define=HD=6.0', '--define=N=9.0', '--define=PA=20.0', '--define=frate=600.0', '--define=xoffset=0.0', '--define=yoffset=0.0', '--define=howmany=1.0', '--define=verbose=0.0', '/home/phill/linuxcnc/configs/mill/ngcgui/gcmc_lib/involute-gear.gcmc']
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/pyngcgui.py", line 1924, in <lambda>
    if g_alive: bcreate.connect("clicked", lambda x: self.create_feature())
  File "/usr/lib/pymodules/python2.7/pyngcgui.py", line 2094, in create_feature
    stat = self.savesection_gcmc()
  File "/usr/lib/pymodules/python2.7/pyngcgui.py", line 2209, in savesection_gcmc
    ,stderr=subprocess.PIPE
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child
    raise child_exception
AttributeError: 'NoneType' object has no attribute 'rfind'
and then after I click 'Finalize' a dialog box appears with 'No features specified on this page' as the message.

Is this a limitation of the PyNgcGui widget or am I doing something wrong?

Please Log in or Create an account to join the conversation.

More
16 Jun 2016 09:48 #76141 by cncbasher
see if pyngcgui.py is infact located at /usr/lib/pymodules/python2.7/pyngcgui.py"

i have a feeling that it could be set up to use python2.6 and your using 2.7 etc .
or at least it thinks it want to use 2.7 etc .

Please Log in or Create an account to join the conversation.

More
16 Jun 2016 10:02 #76143 by phillc54
Yes it is.

GCMC via NGCGUI does work when I run the sample called pyngcgui-gcmc-demo which uses the Axis GUI but that doesn't use the PyNgcGui widget, it uses an embedded tab.

Please Log in or Create an account to join the conversation.

More
16 Jun 2016 18:43 #76182 by dgarrett

I run the sample called pyngcgui-gcmc-demo

I see no sim config with that name, please give exact name.

Please post more information:
1) What linuxcnc version?
2) How was linuxcnc installed (deb or run-in-place)?
3) What gcmc version?
4) Try this sim config and report:
Sample Configurations/sim/gscreen/ngcgui/pyngcgui_gscreen_gcmc
5) Attach a tar or zip file of the complete configuration you
are testing
6) Attach a complete transcript of the shell command sequence and
the errors

Please Log in or Create an account to join the conversation.

More
17 Jun 2016 00:18 #76190 by phillc54
Sorry, I just read the sample config name from the desktop icon, I should have said:
Sample Configurations/sim/axis/ngcgui/pyngcgui_gcmc
LinuxCNC is version 2.7.4 originally installed the from linuxcnc-2.7-wheezy.iso and allowed to do updates.
phill@lcnc:~$ uname -a
Linux lcnc 3.4-9-rtai-686-pae #1 SMP PREEMPT Debian 3.4.55-4linuxcnc i686 GNU/Linux
GCMC version is 1.7.2
phill@lcnc:~$ gcmc --version
G-Code Meta Compiler - gcmc version 1.7.2
Distributed under GPLv3+
Running the sample config you suggested works fine, as does the sample config above.
I tried removing the PyNgcGui widget from my Glade file and just running pyngcgui as an embedded tab in my GUI and it comes up with exactly the same error message so I guess I have something not right in my GUI.
The session went as follows:
phill@lcnc:~$ linuxcnc /home/phill/linuxcnc/configs/mill/mill-pc/mill-pc-lui.iniLINUXCNC - 2.7.4
Machine configuration directory is '/home/phill/linuxcnc/configs/mill/mill-pc'
Machine configuration file is 'mill-pc-lui.ini.expanded'
Starting LinuxCNC...
.
twopass:invoked with <> options
twopass:found ./mill.hal
twopass:found /usr/share/linuxcnc/hallib/xhc-hb04.tcl
xhc-hb04.tcl: suppressing messages in twopass pass0
xhc-hb04: waiting for XHC-HB04 device
xhc-hb04: found XHC-HB04 device
xhc-hb04.tcl: using std_start_pause_button
APP: xhc-hb04-accels found: </usr/bin/xhc-hb04-accels>
APP: monitor-xhc-hb04 found: </usr/bin/monitor-xhc-hb04>
Issuing ESTOP RESET
Xlib.protocol.request.QueryExtension
Waiting for component 'probe' to become ready.pyngcgui:INTFC:linuxcnc running=1
pyngcgui:INTFC:ini_file=</home/phill/linuxcnc/configs/mill/mill-pc/mill-pc-lui.ini.expanded>
.....Xlib.protocol.request.QueryExtension
.
xcmd= [None, '--include', '../ngcgui/gcmc_lib', '--output', '/home/phill/linuxcnc/nc_files/tmpgcmc_01.ngc', '--gcode-function', 'tmpgcmc_01', '--define=umode=1.0', '--define=xctr=0.0', '--define=yctr=0.0', '--define=diameter=10.0', '--define=tool_diameter=2.0', '--define=step=1.0', '--define=cutdepth=-1.0', '--define=xfinal=0.0', '--define=yfinal=0.0', '--define=zfinal=1.0', '--define=verbose=0.0', '/home/phill/linuxcnc/configs/mill/ngcgui/gcmc_lib/cpocket.gcmc']
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/pyngcgui.py", line 1924, in <lambda>
    if g_alive: bcreate.connect("clicked", lambda x: self.create_feature())
  File "/usr/lib/pymodules/python2.7/pyngcgui.py", line 2094, in create_feature
    stat = self.savesection_gcmc()
  File "/usr/lib/pymodules/python2.7/pyngcgui.py", line 2209, in savesection_gcmc
    ,stderr=subprocess.PIPE
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child
    raise child_exception
AttributeError: 'NoneType' object has no attribute 'rfind'
pyngcgui:SENT: /home/phill/linuxcnc/nc_files/0.auto.ngc
pyngcgui:SENT:using: default_send
The last two lines are a NGCGUI sub that was successfully sent after the GCMC scipt faulted which happened as soon as I clicked 'Create Feature' in the NGCGUI dialog.
Full config is attached

Please Log in or Create an account to join the conversation.

More
17 Jun 2016 01:36 #76192 by dgarrett
Thanks for including the complete config. I've tested using
gcmc 1.7.2, debian jessie, 64bit, uspace with current 2.7 in
a RIP build (commit 01e4bb6 2016-06-08) and with a recent
deb: linuxcnc-uspace_2.7.4.105.gf281232_amd64.deb (commit
f281232 is 6/16/16) but have not been able to reproduce the
problem.

I have not ruled out some system dependency as your system
is different than mine (32bit rtai, wheezy vs 64bit uspace,jessie)

I tested the following way:
$ cp mill-pc-lui.ini.expanded dng.ini
# edit dng.ini (to include cpocket.gcmc)
$ diff mill-pc-lui.ini.expanded dng.ini
42a43,46
> 
> #dng:
> NGCGUI_SUBFILE = cpocket.gcmc
> 
56a61
> 
77c82
< HALFILE = mill.hal
---
> HALFILE = dngmill.hal

$ cp mill.hal dngmill.hal
# edit dngmill.hal (to use sim_parport)
$ diff mill.hal dngmill.hal
9c9,10
< loadrt hal_parport cfg="0x378 out"
---
> #dng loadrt hal_parport cfg="0x378 out"
> loadrt sim_parport names=parport.0

I tested with the cpocket tab i added and by specifying
cpocket using the custom tab to find the same cpocket.gcmc
file.

So i'm not sure what is different. Your config is very
complicated so you might try making a much simpler sim
config to isolate the problem.


Attachments:
The following user(s) said Thank You: phillc54

Please Log in or Create an account to join the conversation.

More
17 Jun 2016 03:59 #76196 by phillc54
Thanks for checking this for me.

In my setup I didn't have a GCMC script as a NGCGUI_SUBFILE in the ini file so after looking at your results I added one and observed the following:

If I add any GCMC script as a NGCGUI_SUBFILE in the ini file it works.

If I don't have a GCMC script as a NGCGUI_SUBFILE in the in file it errors as described previously.

Omitting any or all NGC files as a NGCGUI_SUBFILE in the ini file makes no difference at all.

So all I need to do is leave at least one GCMC script as a NGCGUI_SUBFILE in the ini file. :)

Please Log in or Create an account to join the conversation.

More
17 Jun 2016 14:59 #76223 by dgarrett
This was a bug, should be fixed for next 2.7 release with this commit:
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...08d624f52e292497b34b

Thanks for the bug report.

Nice work on your custom gui !

Please Log in or Create an account to join the conversation.

More
17 Jun 2016 23:11 #76235 by phillc54
Thanks again for you prompt assistance.

Please Log in or Create an account to join the conversation.

Time to create page: 0.115 seconds
Powered by Kunena Forum