Lathe Macros

More
10 Jun 2022 16:12 #244882 by DoWerna
Replied by DoWerna on topic Lathe Macros
added the macros to Gmoccapy on my Padovani today.

added the files:
LatheMacro.svg
boring.ngc
chamfer.ngc
facing.ngc
lathehandler.py
lathehandler.pyc
lathemacro.ui
radius.ngc
savestate.sav
threading.ngc
turning.ngc

i changed:
padovani.ini

there was added the lines:

EMBED_TAB_NAME = Cycles
EMBED_TAB_LOCATION = ntb_preview
#EMBED_TAB_LOCATION = ntb_user_tabs
EMBED_TAB_COMMAND = halcmd loadusr -Wn gladevcp gladevcp -c gladevcp -u lathehandler.py -x {XID} lathemacro.ui

SUBROUTINE_PATH = macros:./

seems to work.
I got the turning macro running.

the optical representation is unfortunately not very comfortable
you don't see what you have entered in the input windows.


can you change that,
 

Thanks
W
Attachments:
The following user(s) said Thank You: arvidb, Muzzer

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

More
12 Jun 2022 06:52 #244973 by DoWerna
Replied by DoWerna on topic Lathe Macros
sometimes the solution is so close.
It just seems to be the resolution.

If I set the preview in gmoccapy to fullscreen, all inputs are displayed.

:-)

thanks to andy, the macros are a real added value for such a cycle lathe like mine
The following user(s) said Thank You: Muzzer

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

More
12 Jun 2022 15:09 - 12 Jun 2022 18:14 #244998 by Muzzer
Replied by Muzzer on topic Lathe Macros
Wow - many thanks for fixing this! That seems to be running on my machine, although I haven't actually used it to make swarf yet.

Very pleased to be able to use Any's macro finally. Hopefully at some point, it will also be able to install them in Probe Basic Lathe too.

EDIT - I find that the dialog box for changing the dimensions is a popup that will get hidden behind the main window if you accidentally click outside of it before you are done. The only way I could find to recover was by going to my second monitor and minimising all windows, then selecting the dialog window, before finally maximising gmoccapy again. That's a PITA - is there a way to make it stay on top at all times? Also. the actual up/down rollers for the values seem to be partly hidden, making it difficult to increment / decrement the value.
Last edit: 12 Jun 2022 18:14 by Muzzer.

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

More
12 Jun 2022 18:34 #245014 by DoWerna
Replied by DoWerna on topic Lathe Macros
I use cinnamon as desktop, so not sure if it works on xfce to but try
alt + tab if you have a keyboard connected.

unix.stackexchange.com/questions/190697/...tab-to-use-list-mode

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

More
12 Jun 2022 19:27 #245019 by Muzzer
Replied by Muzzer on topic Lathe Macros
I'll try that. Sounds like the same shortcut as Windows, so I may actually be able to remember it..

Thought I was on a roll there, so tried to add the probing window too by pasting this into my INI file:
EMBED_TAB_NAME=Probe Screen
EMBED_TAB_LOCATION = ntb_user_tabs

as per this post
The only effect it had was to kill off the cycles and preview tabs. Does anyone have any idea what the issue is? Probing would be good!

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

More
13 Jun 2022 09:10 #245060 by DoWerna
Replied by DoWerna on topic Lathe Macros
take a lock at my link above
i think the "alt+tab" function has to be activated in xfce

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

More
15 Jun 2022 10:53 #245179 by andypugh
Replied by andypugh on topic Lathe Macros
The macros are going to need reworking for GTK3, so I will try to look at keeping the popup on top at the same time.

I will probably re-visit the box positioning method at the same time. Currently they are in a transparent, and largely empty, table. Which is a lazy way to handle resizing but does cause problems at smaller sizes.
The following user(s) said Thank You: Muzzer

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

More
16 Jun 2022 21:38 #245289 by Muzzer
Replied by Muzzer on topic Lathe Macros
Does anyone have any idea why the attempt to add the probe tab didn't work - and in fact even killed off the macros tab?

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

More
12 Jul 2022 23:17 - 13 Nov 2022 19:32 #247195 by andypugh
Replied by andypugh on topic Lathe Macros
[EDIT 13/11/22 The files are now published on my Github: github.com/andypugh/LatheMacros/releases ]

I have re-vamped the lathe macros for use with GTK3.It now uses features only usable in Python 3.7 , so Buster is fine, but nothing much before that.

Rather than attach a zip file, I think it makes sense to grab the up-to-date version from the repository.

You will need these files:
boring.ngc
chamfer.ngc
drilling.ngc
facing.ngc
grooving.ngc
lathehandler.py
LatheMacro.svg
lathemacro.ui
radius.ngc
threading.ngc
turning.ngc

Then add a line to the INI something like:
[DISPLAY]EMBED_TAB_COMMAND = halcmd loadusr -Wn gladevcp gladevcp -c gladevcp -U notouch=1 -U norun=0 -u lathehandler.py -x {XID} lathemacro.ui

From the README:

The "lathemacro" config offers a number of simple macros to perform the most common lathe operations. The GUI that controls the macros can be viewed by clicking the "Cycles"tab top left of the graphical preview window.
There are two load-time options to control the tab behaviour:
1) norun will hide the action button, use this if you want to use only a physical button (connected to gladevcp.cycle-start) to start the macros (Strongly recommended, especially with Touchy)
2) notouch will allow keyboard editing of the spinboxes. Otherwise the custom numeric keyboard will be shown. An example loadrt line, as used here in the Gmoccapy demo is:
[code][DISPLAY]
EMBED_TAB_COMMAND = halcmd loadusr -Wn gladevcp gladevcp -c gladevcp -U notouch=1 -U norun=0 -u lathehandler.py -x {XID} lathemacro.ui
The window will resize slowly if you grab the corner and move the mouse inside the window. It's not as bad as it was, but still needs work. You may need to click the unmaximise button in the toolbar to get a window border to be able to use the resize handles. If this is troublesome then you can replace alloc.height and alloc.width in line 53 of lathehander.py with a fixed size

Notes on the keyboard:
As well as the obvious functions and unit conversions, it can be used to enter fractions. For example if you type 1.1/2 it will automatically update to display 1.5000 and 16.17/64 will show 16.2656. This can be used in a limited way to halve the onscreen value eg for entering radius instead of diameter. However it only works for whole numbers: 100/2 will become 50 but 3.14149/2 is interpreted as 3 and 14 thousand halves so won't work.

Notes on adding your own cycles:
Create a new G-code subroutine in the same format as the existing ones.
In Glade add a new tab to the 'tabs1' notebook and give it a name matching the new cycle.
Edit the action button (inside an eventbox) to call the new G-code sub.
Rename the action button to match the tab name and append '.action' eg MyCycle.action
Create new artwork. I used Fusion360, the models are here:
a360.co/3uFPZNv
and the drawings are here:
a360.co/3uFPZNv
Export the drawing page as PDF and import into the lathemacro.svg file in Inkscape. You will need to resize. Add your own arrows and annotations. Save the new layer in a layer named "layerN" (lower case) where N is the tab number, starting at zero. You will need to invoke the XML editor for this (Shift-Cmd-X on Mac) The entry boxes are positioned relative to a 1500 x 1000 image; the original size of the SVG. So you can hover your mouse over the image in Inkscape to determine the coordinates. In the case of on-drawing controls the coordinates are entered as an XML comment in the Tooltip for the control in x,y format (The surface speed, tool and coolant do not need this, they are in a fixed table) An example:[code]<!--300,711-->Peck distance Make sure the comment has "use markup" selected for the tooltip. Also ensure that the control has the "show_keyb" function allocated for the Widget -> button_press event. If you copy-paste a tab and copy-pasteextra controls this should be automatic. _All_ your new spinboxes will need their own new Adjustment, or they will change value when you alter the original spinbox that they are a copy of.



 
Attachments:
Last edit: 13 Nov 2022 19:32 by andypugh.
The following user(s) said Thank You: phillc54, arvidb, Фрезер

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

More
12 Jul 2022 23:32 #247196 by andypugh
Attachments:
The following user(s) said Thank You: arvidb, tommylight, Hodge, Masiwood123, Фрезер

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

Time to create page: 0.283 seconds
Powered by Kunena Forum