NML and GUI from Scratch?
13 Jan 2023 03:50 #261771
by JetForMe
NML and GUI from Scratch? was created by JetForMe
If I understand correctly, NML is the interface through which user interface code talks to the LinuxCNC controller. The NML interface is C++, with Python bindings. I think that means it should be possible to develop a GUI in just about any language or framework that runs on Linux, is that correct? I would like to play with developing a UI from scratch using
Dear ImGui
.
Am I correct, that the UI runs as a separate process invoked by LinuxCNC when it starts up, based on what's specified in the DISPLAY config parameter? I currently use Axis, but am not in front of my controller to see what exists where. My config is just DISPLAY=axis, but I'm not sure if that's a binary, or ends up pointing to the axis.py file somewhere, or how LinuxCNC finds it.
All the docs I've read so far just point me toward the existing GUIs and VCPs. Is there anything that describes how I might write a GUI from scratch? Assuming it is indeed a separate process, the I'd guess I'd write code with a C main() entry point, and link against libnml. But is it invoked with any command line options? Is there more?
Am I correct, that the UI runs as a separate process invoked by LinuxCNC when it starts up, based on what's specified in the DISPLAY config parameter? I currently use Axis, but am not in front of my controller to see what exists where. My config is just DISPLAY=axis, but I'm not sure if that's a binary, or ends up pointing to the axis.py file somewhere, or how LinuxCNC finds it.
All the docs I've read so far just point me toward the existing GUIs and VCPs. Is there anything that describes how I might write a GUI from scratch? Assuming it is indeed a separate process, the I'd guess I'd write code with a C main() entry point, and link against libnml. But is it invoked with any command line options? Is there more?
Please Log in or Create an account to join the conversation.
14 Jan 2023 11:29 #261921
by andypugh
Replied by andypugh on topic NML and GUI from Scratch?
Maybe emclcd is a good starting point.
github.com/LinuxCNC/linuxcnc/blob/master...c/usr_intf/emclcd.cc
I am pretty sure that it is bitrotted to uselessness by now, but it might serve as an example.
github.com/LinuxCNC/linuxcnc/blob/master...c/usr_intf/emclcd.cc
I am pretty sure that it is bitrotted to uselessness by now, but it might serve as an example.
Please Log in or Create an account to join the conversation.
14 Jan 2023 11:49 #261927
by JetForMe
Replied by JetForMe on topic NML and GUI from Scratch?
That's great, thank you!
Please Log in or Create an account to join the conversation.
22 Feb 2023 07:07 #265014
by udoS
Replied by udoS on topic NML and GUI from Scratch?
@JetForMe
Just have a look at:
github.com/grotius-cnc/linuxcnc/tree/main/cmake/projects
I think the most comprehensive nml reference/use case you can find;
best regards
Just have a look at:
github.com/grotius-cnc/linuxcnc/tree/main/cmake/projects
I think the most comprehensive nml reference/use case you can find;
best regards
Please Log in or Create an account to join the conversation.
22 Feb 2023 23:25 #265077
by Grotius
Replied by Grotius on topic NML and GUI from Scratch?
You could certainly combine "Dear imgui" with lcnc.
Best is to use the imgui verions wich uses the : #include <GLFW/glfw3.h>
Then graphics are quite easy to implement : example of opengl & opencascade graphics using glfw3.
If you add the "dear imgui source code" to a subdir in :
github.com/grotius-cnc/linuxcnc/tree/main/cmake/projects /imgui
You can edit everything by loading the cmakelist in a modern editor.
Good luck.
Best is to use the imgui verions wich uses the : #include <GLFW/glfw3.h>
Then graphics are quite easy to implement : example of opengl & opencascade graphics using glfw3.
If you add the "dear imgui source code" to a subdir in :
github.com/grotius-cnc/linuxcnc/tree/main/cmake/projects /imgui
You can edit everything by loading the cmakelist in a modern editor.
Good luck.
Please Log in or Create an account to join the conversation.
Time to create page: 0.066 seconds