GUI's

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.

More
05 Aug 2010 06:03 #3586 by cmorley
Replied by cmorley on topic Re:GUI's
Did you know pascal much before you started?
What made you decide to take on such a project?
Whats next for it Lathe support?
I really like the touch off screen by the way.

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

More
05 Aug 2010 10:57 #3588 by gtom
Replied by gtom on topic Re:GUI's
cmorley wrote:

Did you know pascal much before you started?


Yes, i knew pascal before i started this project cause in school we worked with VisualBasic, VisualC++ and Borland Delphi.

cmorley wrote:

What made you decide to take on such a project?


There have been several reasons to write a new Gui.
1) I liked the appearance of TkEmc but i missed the preview.
2.) I wanted a Gui that is similar to professional CNC Controls.
3.) i wanted a designable Gui

cmorley wrote:

Whats next for it Lathe support?


Lathe Support was started with Rev 142 of mocca, still some bugs in Lathe mode but we are working on it.

cmorley wrote:

I really like the touch off screen by the way.


Thanks, as mocca is designable you can place the controls where you want. You can size the buttons, change the command that will be executed on a button click etc. Mocca can also be run fullscreen (There are still problems caused by the window manager on some systems)

regards, Thomas

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

More
05 Aug 2010 12:53 - 05 Aug 2010 13:07 #3591 by ynneb
Replied by ynneb on topic Re:GUI's
Hey BigJohn, I am watching your questions about GUIs with interest.
I am keen to know when you have found a way that regular users can easily design thier own screens.
I have tried Mocca but now EMC will not open up without crashes. Possibly because I am booting it under wubi within winows, although it did boot when I hadn't installed Mocca.
Anyway keep asking questions as I am keen to see what you can dig up.

gtom wrote:

Think that Mach (a popular Windows CNC App) is written in BASIC (Visual Basic)

Art Fenerty is a BIG C++ fan. I know that Mach is not written in VB, however the guy who has bought out Artsoft was a VB fan, although I doubt he has changed the Mach3 code to VB either.
Last edit: 05 Aug 2010 13:07 by ynneb.

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

More
05 Aug 2010 15:08 #3594 by gtom
Replied by gtom on topic Re:GUI's
You are right, just took a closer look on the Mach3 directory structure, ist was build with Microsoft VisualC++ and uses some OCX Controls and the mfc...
The Mach3 Script dialect is something like Pascal, and the code itself contains lot of emc related stuff... StraightTraverse etc...
Maybe the interpreter is a emc RS274 interpreter ??? :-)

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

More
09 Aug 2010 00:37 - 09 Aug 2010 00:40 #3639 by ynneb
Replied by ynneb on topic Re:GUI's
Hey Big John, I have re read this thread and had a better look at Mocca too.
Even though I have had limited success with Mocca I can see that it is definately the way to go.
You should be able to achieve any design you want using it. If you do the main design as one big picture and have it as the background, you can then assign buttons, dros, sliders, etc over the top of the background picture.
I imagine the more users of Mocca, the more motive to develop it further.
Can I suggest you start doing a pictorial design using your favorite drawing software, and then we can worry about getting it all working next.
I think you will find Realdraw Pro a great program for creating your screen designs.
www.mediachance.com/realdraw/index.html

PS I have started to work on a design based soley on the graphics. Once done it will be only a matter of assigning the buttons etc over the top of it.
www.linuxcnc.org/component/option,com_ku...d,3637/lang,english/
Last edit: 09 Aug 2010 00:40 by ynneb.

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

More
09 Aug 2010 03:27 #3640 by cmorley
Replied by cmorley on topic Re:GUI's
Yes Mach used some work from EMC way back. Though I'm sure it's very different now.
I remember some talk on the EMC maillist about it.

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

Time to create page: 0.161 seconds
Powered by Kunena Forum