- Posts: 233
- Thank you received: 0
METRIC / SAE Indicator for pyVCP
I want to make a pyVCP graphic... yellow with "METRIC" or blue with "INCH" that is pretty easy to see... I know how to make graphos. net them... etc... just looking for something like halui.mode.is-mm or similar that will give me a true/false.
Exists???
Jerry
Please Log in to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
- Posts: 4739
- Thank you received: 2
Please Log in to join the conversation.
Thanks,
Jerry
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
The python component info is somewhat explained here:
www.linuxcnc.org/docs/2.7/html/hal/halmodule.html
name it metric_status , add it into an appropriate folder ($PATH in a terminal should show you)
and make it executable
One caveat, displayed Gode in a running linuxcnc program, can be wrong because of read ahead.
This one is fairly safe as not too many people change the units mid program.
Hope that helps!
Chris M
Please Log in to join the conversation.
Update of the display is not an issue... the main impetus for this was that I went to move the bit 10mm the other day during a job so I typed in G0 X10 expecting the bit to move slightly... as it continued way past where expected and scratched the surface... I realized by buddy had typed in G20 because he prefers inches.
I thought it would be good to have some obvious icon in the pyVCP panel to catch my eye... more than just the text in the little display box that is easily missed. I was hoping for a more "stock" solution... something I could just share with others like, "paste this into your pyVCP panel and you are good." But perhaps this is better... it may force me to learn new tools... new skills, and get a bit deeper into the system.
I'll give it a try sometime this week and report back.
Thanks!
Jerry
Please Log in to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
- Posts: 4739
- Thank you received: 2
cmorley wrote: Here is working sample code of a python component for metric (G20/21) status
The python component info is somewhat explained here:
www.linuxcnc.org/docs/2.7/html/hal/halmodule.html
name it metric_status , add it into an appropriate folder ($PATH in a terminal should show you)
and make it executable
One caveat, displayed Gode in a running linuxcnc program, can be wrong because of read ahead.
This one is fairly safe as not too many people change the units mid program.
Wouldn't it make more sense to pole the stat.program_units rather than trying to pick out the active g-code something like this?
Please Log in to join the conversation.
For example, there is a signal I use called halui.program.is-running which lights up a red bar where the jog buttons of my panel are... at a glance, I can tell that I have some background task running, and that I have to wait. Really simple to implement.
I was hoping there would have been something like halui.units.mm and/or halui.units.inch that I could look for and react to. Generally... to share my advanced pyVCP panels with others. (Doing a YouTube series on LinuxCNC currently.)
So mostly... looking for something a neophyte could easily do. Still wondering if I can somehow hook the #<_metric> variable.
Jerry
Please Log in to join the conversation.
Askjerry wrote: Ultimately, it would be nice if this were a signal standard in HAL.
I was hoping there would have been something like halui.units.mm and/or halui.units.inch that I could look for and react to.
I would assume that because of the read ahead problem - these type of signals were not made.
There is a branch in development that tries to fix the read ahead problem. If this gets merged in the future then pins with this kind of
info would make much more sense.
Chris M
Please Log in to join the conversation.
