Discussion:
[Emc-users] Pyngcgui question on formatting parameters
t***@bgp.nu
2017-06-04 18:04:27 UTC
Permalink
I have an issue with Pyngcgui subroutine parameter entry. I am space/resolution constrained on the monitor I use on the lathe and this results in limited space in the display of Axis’ various panels. I am using pyngcgui as tabs in Axis as well as a Glade panel on the right and when pyngcgui displays the subroutine parameters some of those parameters are actually “under” the Glade panel and cannot be seen.

You can see an example in the image here: Loading Image...

Notice the circled “1” which is parameter 15 (Finish Direction). I can tab to it and enter a value but cannot see it on the screen. I have this problem with several of the routines here.

I have quite a bit of vertical space and am wondering if there is a way I can force the subroutine parameters to be displayed in only 2 columns. I don’t see where I would change this in the pyngcgui.ui glade config…or if that is even where it is?

-Tom
Dewey Garrett
2017-06-04 19:20:09 UTC
Permalink
Post by t***@bgp.nu
I have quite a bit of vertical space and am wondering if
there is a way I can force the subroutine parameters to
be displayed in only 2 columns
You would have to alter the logic for computing 'rowmax'
for the parameter entryboxes. The source file in the git
tree is:
git_root_dir/lib/python/pyngcgui.py

The logic for 'rowmax' is (ref git tree for 2.7):

http://git.linuxcnc.org/gitweb?p=linuxcnc.git;a=blob;f=lib/python/pyngcgui.py;h=bdb08e4d210c5b09c280d81a695d286f3e3a1c37;hb=refs/heads/2.7#l1652

For a deb install, root privs will be needed to edit the file;
the file location can be found using:

$ dpkg -L linuxcnc|grep pyngcgui.py
/usr/share/pyshared/pyngcgui.py
--
Dewey Garrett
t***@bgp.nu
2017-06-04 22:00:47 UTC
Permalink
Thanks Dewey! That did the trick.

Changed:
# try to use minimum height if less than 3 columns
1653 <http://git.linuxcnc.org/gitweb?p=linuxcnc.git;a=blob;f=lib/python/pyngcgui.py;h=bdb08e4d210c5b09c280d81a695d286f3e3a1c37;hb=refs/heads/2.7#l1653> if nparms > 20:
1654 <http://git.linuxcnc.org/gitweb?p=linuxcnc.git;a=blob;f=lib/python/pyngcgui.py;h=bdb08e4d210c5b09c280d81a695d286f3e3a1c37;hb=refs/heads/2.7#l1654> rowmax = 10
1655 <http://git.linuxcnc.org/gitweb?p=linuxcnc.git;a=blob;f=lib/python/pyngcgui.py;h=bdb08e4d210c5b09c280d81a695d286f3e3a1c37;hb=refs/heads/2.7#l1655> else:
1656 <http://git.linuxcnc.org/gitweb?p=linuxcnc.git;a=blob;f=lib/python/pyngcgui.py;h=bdb08e4d210c5b09c280d81a695d286f3e3a1c37;hb=refs/heads/2.7#l1656> rowmax = int(nparms/2 + 0.5)

To:
# try to use minimum height if less than 3 columns
1653 <http://git.linuxcnc.org/gitweb?p=linuxcnc.git;a=blob;f=lib/python/pyngcgui.py;h=bdb08e4d210c5b09c280d81a695d286f3e3a1c37;hb=refs/heads/2.7#l1653> if nparms > 20:
1654 <http://git.linuxcnc.org/gitweb?p=linuxcnc.git;a=blob;f=lib/python/pyngcgui.py;h=bdb08e4d210c5b09c280d81a695d286f3e3a1c37;hb=refs/heads/2.7#l1654> rowmax = 18
1655 <http://git.linuxcnc.org/gitweb?p=linuxcnc.git;a=blob;f=lib/python/pyngcgui.py;h=bdb08e4d210c5b09c280d81a695d286f3e3a1c37;hb=refs/heads/2.7#l1655> else:
1656 <http://git.linuxcnc.org/gitweb?p=linuxcnc.git;a=blob;f=lib/python/pyngcgui.py;h=bdb08e4d210c5b09c280d81a695d286f3e3a1c37;hb=refs/heads/2.7#l1656> rowmax = 18

And now it fills a column (up to 18 rows) before creating a second column, which is what I want.

-Tom
Post by Dewey Garrett
Post by t***@bgp.nu
I have quite a bit of vertical space and am wondering if
there is a way I can force the subroutine parameters to
be displayed in only 2 columns
You would have to alter the logic for computing 'rowmax'
for the parameter entryboxes. The source file in the git
git_root_dir/lib/python/pyngcgui.py
http://git.linuxcnc.org/gitweb?p=linuxcnc.git;a=blob;f=lib/python/pyngcgui.py;h=bdb08e4d210c5b09c280d81a695d286f3e3a1c37;hb=refs/heads/2.7#l1652
For a deb install, root privs will be needed to edit the file;
$ dpkg -L linuxcnc|grep pyngcgui.py
/usr/share/pyshared/pyngcgui.py
--
Dewey Garrett
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Emc-users mailing list
https://lists.sourceforge.net/lists/listinfo/emc-users
Loading...