Hal Standalone and a Java gui
I know I could draw a simple gui using pyvcp or gladevcp or (never tried) qtvcp, but I need a more complex and custom Gui, and I'm good in doing this in Java, while as far as I try I cannot in python.
So, do you think there is a way to do all the Hal stuff as usual in python, and then control Hal pins in Java?
Thanks, Davide.
Please Log in or Create an account to join the conversation.
HAL is written in C and the python module hooks into the HAL C library to do the dirty work.
Can Java hook into C libraries?
Chris M
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
- Posts: 19219
- Thank you received: 6440
I do not like the overhead on the recourses.
Just my opinion.
Please Log in or Create an account to join the conversation.
Anyway, thanks for answering.
Please Log in or Create an account to join the conversation.
I'm using Processing here to make it simple..
I have created a siggen module and added to a thread.
then inside Processing just launched a system command like this (just the hint):
String[] cmd = {"halcmd", "setp", "siggen.0.frequency", "50"};
Runtime.getRuntime().exec(cmd, new String[0], new File("/"));
Do you think it can be enough to work with Hal standalone?
thanks, Davide
Please Log in or Create an account to join the conversation.
I think you should learn Python, and output the required motor parameters on HAL pins.
Please Log in or Create an account to join the conversation.
in the meanwhile i know i can have something working..
anyway thanks for the suggestion.
davide
Please Log in or Create an account to join the conversation.
Thanks Andy, i'm going on in studying python, because i would like to master that, but the most of the time it makes me angry.
in the meanwhile i know i can have something working..
anyway thanks for the suggestion.
davide
Find the Google tutorial for Python and you will be an expert in 2-3 days.
developers.google.com/edu/python/
The videos are awesome!
Please Log in or Create an account to join the conversation.
going to read them.
Please Log in or Create an account to join the conversation.
Those who don't know have an oppinion and they fight for itI would not use Java for ...... well anything ever ...
I do not like the overhead on the recourses.
Oh man ...
Seen that habbit uncounted times ...
I remember one project, where the customer wanted to replace a central system service, which became slow with the time being. Original service was coded in smalltalk ...
We built two replacement prototypes - one coded in C and one in java - and the result was, that the java service had the same client processing times as the C service (within microsecond resolution). Only drawback of the jave program was the initial startup time - but who cares on a system service running 24/7?
We had to code some tweaks to get the garbade collection work as fast as the client connections, but when that was done, the resources consumed stayed stable.
We let the services run several days and nights - with the result, that java was more stable than the C service. Reproducable.
With our prototypes we could beat every lie, like java is too slow, jave needs to many resources, java is not stable ...
At the end, the IT-commissary stated: we're not able to support java and its release cycles ...
I very like the idea of java working together with hal services. Java offers the most freedom on UI and has a very clean event system.
But using Runtime.exec is the worst possibility for IPC.
Don't know enuf about NML, but I guess its based on shared memory. To use that, java needs a little help of C - just like Python does too. JNI is the right javatask for that.
But if you're going to code java for linuxcnc - keep in mind, that there is really a lot of UI-stuff already worked out with python. Its pretty big job to code all that from scratch. Don't know, if you want to spend so much time on that item.
.
Same happens to mei'm going on in studying python, ... but the most of the time it makes me angry.
Every time I look at python sources
Cheers Reinhard
Please Log in or Create an account to join the conversation.