GUI's

More
27 Jul 2010 12:53 #3496 by BigJohnT
GUI's was created by BigJohnT
What would be a good language to write a new GUI for EMC?

What are the basic steps to "connect" your GUI to EMC?

Thanks
John

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

More
29 Jul 2010 01:46 #3514 by cmorley
Replied by cmorley on topic Re:GUI's
C
C++
python

It needs to be a main stream language so a bigger base of people can maintain it.
For instance Mocca is pretty damn cool but if the originators stop maintaining it
how many people know pascal (I think it's pascal) well enough to update it?

Boy wouldn't a small manual dedicated to GUI developers be Handy.
probably see a few more GUI come along.

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

More
29 Jul 2010 15:21 #3517 by step4linux
Replied by step4linux on topic Re:GUI's
I would not focus that much on language.
From my point of view there are (at least) two other more important points:

- good documentation of the interface to EMC
- modular design with reusable elements

GUIs are often a matter of taste, and depending on the machine.
Which buttons are useful, which icons do you like, etc
But there are also common elements like 3D preview, g-code properties etc
Instead of starting the 17th GUI, maybe someone starts creating a toolchest, from which it could be more or less easy to design your own GUI.

regards, Gerd

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

More
29 Jul 2010 22:35 #3520 by BigJohnT
Replied by BigJohnT on topic Re:GUI's

Boy wouldn't a small manual dedicated to GUI developers be Handy.
probably see a few more GUI come along.

- good documentation of the interface to EMC


I think these two are the same and a possible good place to start.

I know very little about how the interface communicates with the core EMC except something about NML messages are passed back and forth in userspace or something like that. I looked at the simple interfaces but they are in tcl and that is not easy to read. A small road map would be a big help in something like this.

John

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

More
30 Jul 2010 14:07 #3525 by BigJohnT
Replied by BigJohnT on topic Re:GUI's
Looks like keystick.cc might be a good place to start the search for how the connections are made to EMC.

John

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

More
01 Aug 2010 17:01 #3547 by step4linux
Replied by step4linux on topic Re:GUI's
A GUI for EMC2 is by its nature a graphical human machine interface.
For this reason, it must be considered both the programming language plus a graphical designtool.
Unfortunately axis is written without a graphical tool as pure python text (AFAIK).
Other EMC related programs like stepconf, pncconf are created using glade + python.
This seems to be a nice combination.
Of course the Qt-Designer is also nice, but why introduce new libraries and widgets.
So natural choices could be really glade+python or glade+C++

Gerd

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

More
01 Aug 2010 19:24 #3551 by BigJohnT
Replied by BigJohnT on topic Re:GUI's
Thanks for the info. I tried Glade in the past and didn't get very far with it. I'll take another look at it. Is it much different than wxWidgets? I did get Code::Blocks up and going on the last computer and made some progress with it. QT seemed ok too.

John

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

More
04 Aug 2010 13:14 #3575 by gtom
Replied by gtom on topic Re:GUI's
Well, there are other reasons NOT to program in common (linux) languages...
If you take a look at windows, nobody will use pure C/C++ Python or similar except for small Applications.
About 95% of the Windows software is written in RAD (Rapid Application Development) languages.
Think that Mach (a popular Windows CNC App) is written in BASIC (Visual Basic)
Also you have to think about the TIME you need to write a Application and to learn about the operating systems API.

When i started mocca i was looking for a RAD Tool that works under linux. i found Lazarus/Freepascal the most powerful combination to write a GUI for emc.

1.) The LCL (the Lazarus Visual Components) are well documented and are available for all Widget-Sets and OS
(Gtk2,Gtk,Carbon,WinCE,MacOS etc...)
2.) The Editor and Form-Designer are perfect for writing big applications.
3.) The generated code is nearly 1:1 C Code
4) Pascal can directly link / be linked to C-Code and C librarys
5.) Pascal is available since the early 70s and is avaliable for all OS
6.) time-saving: you do not have to care about writing Dialogs, writing code for Events (keyboard,mouse ect)
Just click on the property, drop a control on a Form, move it, color it etc...
7.) Code is portable between OS
8.) If you are lost in your code just right-click on a function and you can follow the declaration / calling order
9) if you dont remember the params of a function just place the mouse over it and it will show you the params and the
file where this function was declared.

regards, Thomas

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

More
04 Aug 2010 13:41 #3576 by BigJohnT
Replied by BigJohnT on topic Re:GUI's
Thomas,

Thanks for the good explanation on freepascal. As for windows I don't even care if it runs on windows at this point as I only have one windoz machine and 4 computers running Ubuntu. So it looks like the Gtk family of widgets kinda work for most rad applications.

What are the "connections" needed for mocca to communicate with EMC?

I would move your thread over here to this area but I'm afraid I might mess it up.

Thanks
John

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

More
04 Aug 2010 17:31 #3577 by gtom
Replied by gtom on topic Re:GUI's
Well, the "connections" for Emc are just 2 Files:

emcpas.cc is the C-Interface between emc and mocca.
emc2pas.pas are the pascal declarations.

These 2 files will be linked to emc's libemcini.so, libemchal.so, libemc.a, libnml.so

simcanon.cc is the C- interface to the RS274 interpreter for the preview.
glcanon.pas is the pascal code for the preview.

Those 2 were translated from the python code (gcodemodule.cc, glcanon.py,interpreter.py) to pascal.

Lazarus (the LCL component classes) implements the gui.

moccapkg is a custom "component - package":
Normaly on a linux system the theme-manager is involved in painting the visible controls.
This makes every gui dependend on the installed theme and window-manager. Take a look at your scrollbars. They will change in size,color,contrast etc depending on your theme. As mocca is intended to be used on "real" machines i wrote my own compnents (Button,Slider,Lister,Led)

TSlider is a kind of Scrollbar but does not depend on the theme. TLister is a Listbox where the selected line of GCode is centered in the control so you always see the next lines and the already executed lines. TMocButton is a Button that can show Bitmaps and Multiline-Text. This Button does not depend on the Theme Manager also to avoid those "modern", nearly unreadable Buttons. MocLed is a simple LED Control.

simulator.pas is a 3D Preview of the milled part (only for XYZ Machines). The idea itself came from Jeff Epplers gdepth.py, was translated to pascal and integrated in mocca. (This took just 6 Hrs of programming)

configreader.pas reads the mocca config file (a xml-file)
stylereader.pas reads for each visible window (Dialog) the style and appearance of the window (user can edit the design without touching the code itself)

regards Thomas

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

Time to create page: 0.106 seconds
Powered by Kunena Forum