Connection between linuxcnc and GUI

More
25 Apr 2021 16:32 #207031 by Bocnc
Hi,

I would like to build a rather minimal GUI for an automated saw. As I am quite comfortable with GTK and C/C++, I would like to skip the python part most included GUIs use.

Is there some documentation or example available?

Specific questions are:

- Where/how is the GUI actually started? Could you point me to the source code where des DISPLAY entry of the ini is evaluated and the GUI started?

- Interface between the GUI and linuxcnc: Is the halui.cc file (using RCS_CMD_CHANNEL) a good example?

- Regarding the visualization of the path: Is there some OpenGL widget which could be used?


Many thanks for any help ;)

David

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

More
25 Apr 2021 21:31 #207043 by cmorley
1) no
2) the bash script scripts/linuxcnc starts the display
3) yes halui is a pretty good example in c++
4) are you using GTK 2 or 3?
GTK2 is on the way out and GTK3 has not been finished yet (both in python)

I always find it strange when people decide to not use python for screens.
It's a much easier hill to climb - unless the challenge is part of the fun :)

Chris

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

More
26 Apr 2021 05:46 #207077 by Bocnc
Thank you very much for your fast and helpful response.

4): I would like to use GTK 3, is there a work in progress example of an OpenGL path preview?

Might have to adopt, if python is so much easier in combination with linuxcnc ;)

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

More
26 Apr 2021 14:37 #207123 by cmorley
There is people working on gtk3 code but I'm not sure it's in linuxcnc's repo.
Check the issues section in linuxcnc's github repo.

Well python is easier, mostly because all the linuxcnc/widget detail work is done and there is pretty good docs and sample code - even complete screens.

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

More
26 Apr 2021 18:52 #207151 by Bocnc
with your answers I was able to dig much deeper in the code and the internals of linuxcnc.
One thing I could not figure out is: How does the GUI get the data to construct the preview. For python it seems the gremlin module is used, but I couldn't figure out where the actual data is received from.
Could you help me out again?

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

More
26 Apr 2021 22:45 #207179 by cmorley
look at the python linuxcnc module.
src/emc/usr_intf/axis/extensitions/emcmodule.cc
'logger' tracks current position.
There are other functions in the file used by glcanonn.py for plotting the program.

Chris
The following user(s) said Thank You: arvidb

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

More
26 Apr 2021 23:25 - 26 Apr 2021 23:32 #207184 by Grotius
Hi,

I would like to build a rather minimal GUI for an automated saw.
As I am quite comfortable with GTK and C/C++

For a automated saw i should only use the linuxcnc hal interface to connect hardware like motors, encoders etc.
To clearify, you then have a .hal file wich is loaded by a halcmd, without actually starting lcnc.

A opengl gremlin gcode preview screen is kind of useless and complex. Do you need gcode anyway for a saw?
I think you need a smart data input. Can be touch screen, or can be visualised by c++ opencascade cad wich is quite
easy to use in c++.

If you know c++ then it's easy to write some code for the saw. You can send calculated position's to the stepgen component
who takes care as a pid controller.

If you want to program in c++ with linuxcnc hal and make a nice saw preview in 3d. This is possible.
I don't know how much time you wanna spent to build the program?

There is also a new qml app to look at. This is a quite simple coding format. I don't use it myself. Qml is more for dummy's, but it is very responsive. Building a web browser is 5 minutes of work in Qml.

I agree with mr. Morley. Python is the easyest way to go. In the past i started also with python gtk2 for cnc gui's.

with your answers I was able to dig much deeper in the code and the internals of linuxcnc.
With all respect, you don't have to dig this deep. Just stay at the floorlevel for now. Then you are much more productive in
creating a solution.
Last edit: 26 Apr 2021 23:32 by Grotius.

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

More
27 Apr 2021 07:27 #207202 by db1981
this is an rest api interface for linuxcnc. you can create an local webserver with an in and out rest structure for your halpins. We have used this to connect java-guis to lcnc.

github.com/sittner/linuxcnc-rest
The following user(s) said Thank You: vmihalca

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

More
27 Apr 2021 10:22 #207209 by FranseFrikandel
I don't really see any good reason to go for manually programming a new UI. A couple of the UI framekworks already allow you to make custom UIs. I personally am only familiar with QtPyVCP, but QtVCP and GladeVCP are also options.

With QtPyVCP a simple UI doesn't require any real programming either, so no real need to learn Python. Don't know about the other options.

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

More
27 Apr 2021 14:08 #207229 by andypugh

I would like to build a rather minimal GUI for an automated saw.


How minimal? 4 x 20 LCD display minmal? ( github.com/LinuxCNC/linuxcnc/blob/master...c/usr_intf/emclcd.cc )

I am playing about with a minimal GUI for a press brake in another thread . It's interesting that the GUI tends not to remain minimal.
The unusual thing about that setup is that it does not use The LinuxCNC Motion module, Task Module or an interpreter. Though as time goes on I am starting to question the value of this approach.

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

Time to create page: 0.161 seconds
Powered by Kunena Forum