Python interface states of the home switches?

More
25 Mar 2018 10:11 - 25 Mar 2018 10:18 #107803 by newbynobi
If you do use GStat (/lib/python/hal_glib.py) you can connect your GUI to the signal "homed" of gstat and react to the change of the homing state of each joint.
from hal_glib import GStat
self.gstat = GStat()
self.gstat.connect('homed', self._homed)
self.gstat.connect('not-all-homed', self._not_homed)

def _homed(self, object, joint):
    print("Joint {0} has been homed".format(joint))

def _not_homed(self, object, unhomed_joints):
    print("Joints {0} are not homed".format(unhomed_joints))
Norbert
Last edit: 25 Mar 2018 10:18 by newbynobi.
More
02 Apr 2018 12:02 #108257 by mungkie

cmorley wrote: Sorry i wasn't clear - I haven't pushed the code to master yet.
If you are using 2.7.x then this will never work.
If you are using master I could cherry pick the code and push to master in a day or so.

Chris M


I do not follow linuxcnc dev so not sure how this is going, but a very brief search found no 2.8(do you mean machinkit?) and no cherry pick of this code into master.

Would it be possible for someone to post the code for direct control of hal with python, I have been doing it through
Popen(halcmd .....
for the last 5 years, the new system sounds very useful (could just drop in the file in lib/python/? ).
More
02 Apr 2018 15:00 #108260 by cmorley
2.8 will be the next major release of linuxcnc, there actually is no 2.8 right now.
any reference to 2.8 probably meant the master branch, as that will be 2.8 in the future.

I did not cherry pick the code - It wasn't going to be a solution for anyone using 2.7.
It will be added to master when I merge my QTvcp/QTscreen work.

But if you are using a compiled version of linuxcnc you could cherry pick it in to 2.7.
Or if you intend to use master I can cherry pick it in to master.

The code I added only adds the ability to read pins/signals without connecting to them.
The python module is not a complete replacement for halcmd.
Though it can still do quite a bit.

Chris M
More
03 Apr 2018 01:11 #108277 by mungkie

cmorley wrote: 2.8 will be the next major release of linuxcnc, there actually is no 2.8 right now.
any reference to 2.8 probably meant the master branch, as that will be 2.8 in the future.

I did not cherry pick the code - It wasn't going to be a solution for anyone using 2.7.
It will be added to master when I merge my QTvcp/QTscreen work.
Chris M


Is there a roadmap of possible feature list for 2.8 yet?

if you could easily dump the relevant python code for
hal.get_value()
r any other functions you may have implemented that would be very nice to peruse.

I have never bothered to check the files in lib/python/ to see how the low level implementation is done for the hal.py interface but may do that eventually.

How did you implement your hal access are you using ctypes or an alternative?

I did some work on a web based hal interface that was very much an axis ripoff but only 80% feature complete, I got other projects that became more important and so its been in a drawer for almost 2 years now, but when I get back to it would be very interested to simplify some of the stuff that was implemented with popen calls to halcmd.
More
03 Apr 2018 05:22 #108289 by cmorley
here is a patch file that will apply to 2.7 if you wish.

Chris M
Attachments:
More
04 Apr 2018 12:01 #108369 by mungkie

cmorley wrote: here is a patch file that will apply to 2.7 if you wish.

Chris M


Many thanks for posting code, I appreciate your effort though unfortunately not sure it was what I was hoping for.

I did find 2.8 on git, seems it is a tag not a branch??? github.com/LinuxCNC/linuxcnc/tree/v2.8.0-pre1

Anyways I posted 10 years ago about what future of cnc maybe, but seems the post is erased from the forum?

I know it is too easy to chitchat bluesky and I am doubtful going to do the required to implement thoughts.

But would be nice if linuxcnc 2.8 had some sort of roadmap and maybe push ideas to the college kids to implement as final projects.

I have been sort of hoping that hal could be implemented as some standard C api/abi library as that would simplify other language bindings to hal control (compile halcmd as position independant code).

Lots of other ideas, maybe I should start a wiki page, though I doubt my ideas are worth mentioning, last one that google finds is wiki.linuxcnc.org/cgi-bin/wiki.pl?Topics...sionAt_EMC_Fest_2005

Machinekit did some amazing work, but I hate for see linuxcnc fork, and I am not certain machinekit is optimal, I wonder where everything is going?
More
04 Apr 2018 12:06 #108370 by mungkie
Oooh wait google sucks, its already in the wiki....

wiki.linuxcnc.org/cgi-bin/wiki.pl?Lncnc_3_Idea_Whiteboard
More
05 Apr 2018 12:48 #108445 by andypugh
Quite a lot of that wish-list has happened. (Or was already there).

I think we have had loadable interpreters for quite a long time, it is just that nobody seems to ever use the feature.

Joint-Axes has been merged.

We have many-line lookahead.

I have a patch that supports multiple spindles, I will merge it _after_ 2.8 is out.

We chose Asciidoc rather than Doxygen. But the effect is much the same.
Time to create page: 0.077 seconds
Powered by Kunena Forum