Author Topic: Application GUI as Embedded Interface  (Read 17123 times)

0 Members and 1 Guest are viewing this topic.

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2117
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Application GUI as Embedded Interface
« Reply #25 on: June 14, 2015, 12:05:36 am »
I've developed a number of PC applications (for headless USB connected instruments) using PureBasic.  I use Windows, but it will compile the application for Linux and Mac. Forum support is good and finished apps (including FFT's and scopes) seem to run very fast (I think it compiles down to assembler and is used by a number of games designers).

www.purebasic.com

Perhaps I'm a dinosaur - but I find basic far more simple to program, and really hate complex IDE's, toolchains etc...

https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Application GUI as Embedded Interface
« Reply #26 on: June 14, 2015, 02:11:55 am »
IMHO the biggest problem with MFC is that Microsoft has dropped it about 20 years ago in favor of VB and when that didn't caught on C#. MFC is most definitely not the way to go. On the other hand there are several GUI design tools for Qt and WxWidgets which allow to create an application quickly.

Last version I think it was 2013 (MFC 12), and I have not looked at what is new in 2015 yet but they do seem to give preference to the .Net framework using C# and I forget what other two languages but not C++. Maybe Java and Basic, or python?

The current MFC (12) of course includes ribbons and all kinds of UI widgets Add some ActiveX components or what have you. I think it gives you more choices than the rest, unless you want your typical buttons and sliders and simple graphs.
You can embed Videos via D2D very easily an offers more advance UIs, but of course at a price, and that price is that it has a steeper learning curve for the complex things.

Other than that is trivial to make a compelling UI. But I'm not sure I would use it for an embedded device, or if it actually can be used that way at all.

For IoT stuff sure but the GUI would be running on a PC not on the device.

 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11612
  • Country: my
  • reassessing directives...
Re: Application GUI as Embedded Interface
« Reply #27 on: June 14, 2015, 04:07:21 am »
Other than that is trivial to make a compelling UI. But I'm not sure I would use it for an embedded device, or if it actually can be used that way at all.
embedded connectivity has nothing to do with GUI library. GUI library is just that, for building GUI. for embedded connectivity you need to include/install the device driver and dll/API, things like ftdi.dll etc and call that from your GUI.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline MrAureliusRTopic starter

  • Supporter
  • ****
  • Posts: 373
  • Country: ca
Re: Application GUI as Embedded Interface
« Reply #28 on: June 14, 2015, 06:05:42 am »
 :-+

It did indeed explode! But that's what I was looking for, a wide range of opinions and experience. First off, thanks again for being a wonderful community with great feedback and lots of info!

To follow up on a few points, cost is indeed an issue -- I'm still doing my EE at school and money is, of course, tight. I'd rather use a free and open-source toolchain, not only to save money but to be able to submit bug reports, etc. I really enjoy feeding back into projects that I use and where the developers are nice.

I've used GTK+ in Fedora a little bit before, though I found it hard to find documentation (in book form) about GTK+. It's a very interesting framework, they took C and basically tried to force OOP concepts up its rear end. It actually kind of worked! I liked the hierarchical structure, etc, but I did find initial setup a bit tedious.

I'm hearing a fairly resounding tie between qt, Visual Basic/C#, and WxWidgets. I've only had a cursory glance at WX, and it looks pretty good. If I remember correctly, the version of Fedora I installed had a built-in IDE for it? Or is it an implementation of qt? I'm a little confused on that point, I'll have to Google it. I've heard a lot about qt -- that it's powerful, portable, and used in a lot of software on many OSes. The negatives I've heard are it can be a bit clunky and/or clumsy to use, but that was a while ago. I know that GTK+ is kind of halfway between two versions, and IIRC I think qt is as well? (not to mention Python! that's one of the few reasons I haven't dived into it yet -- which version should I use?!)

And Visual Basic... or C#. I'm a bit wary of C#, not entirely sure why. I think because it's a Microsoft invention, (as is VB) and for some unvoiced ethical reason my mind kind of goes "Ew...". However, way back in Grade 10 I did use VB (version 5 I think?) and I do remember that it was easy to spin up GUIs quickly. I also remember (I think it was Mike from mikeselectricstuff) someone mentioning that they use it to spin up programs to access their boards with. Mike (if it was him) said he had to keep an antiquated version around as some of the support had been dropped and/or superceded with newer libraries or something? I also remember someone else saying that Turbo Pascal was the holy grail of these types of projects.

To give a little more detail, I'd like to (depending on the project) have a small serial terminal, some buttons to turn things on and off, sliders, "LEDs" to show the state of pins, and some other widget to show A/D results. It would be nice to also have a few other bells and whistles like multiple windows and/or windows inside windows (whatever those are called these days, tabbed or not). I'd try and keep things basic because it's nice to be able to change things quickly without throwing out a ton of code. I think the easiest way to implement this would be to have a button click send a serial command which the micro then reads and carries out the associated task. These applications won't be going to any client any time soon, just for personal use and growth at this point. I'd also like to be able to tap into the PC's computing power now and then in order to crunch a bunch of numbers and then send the results back (though this isn't a requirement). I'd mostly like to just have something be quick and easy (though typically to have those two you need to spend money!).

Thanks for all the input guys! Looks like I have a bunch more research to do. (If anyone can recommend good books that will definitely be a big plus for that solution. I like to have a book in my technical library for each language/framework that I use.)
--------------------------------------
Canadian hacker
 

Offline MrAureliusRTopic starter

  • Supporter
  • ****
  • Posts: 373
  • Country: ca
Re: Application GUI as Embedded Interface
« Reply #29 on: June 14, 2015, 08:19:17 am »

To setup a programming environment for Qt  is peace of cake and you don't need to download gigabytes of software.


Installing QT for Windows right now to give it a try and it says it'll take up 1.5GB or so when downloaded...
--------------------------------------
Canadian hacker
 

Offline dom0

  • Super Contributor
  • ***
  • Posts: 1483
  • Country: 00
Re: Application GUI as Embedded Interface
« Reply #30 on: June 14, 2015, 08:32:10 am »
The MSVC, VS and SDK installation on my development Windows is (just checked) about 13 GB...

edit: Just checked a Qt 5.3 install on Windows. Is about 2 GB (with all Qt modules installed for 'VC 13). As expected most of it are binaries (few hundred MB docs and examples), and most of that pertains to the PDB debugging files (about one GB alone). About 500 MB in Qtxxx.dll binaries, bute note that we're talking about Windows here, so you have everything twice (one debug binary, one release binary). Debugging binaries are 400 MB, so that leaves 100 MB for the actual release binaries.
« Last Edit: June 14, 2015, 09:12:53 am by dom0 »
,
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2217
  • Country: 00
Re: Application GUI as Embedded Interface
« Reply #31 on: June 14, 2015, 08:53:34 am »

To setup a programming environment for Qt  is peace of cake and you don't need to download gigabytes of software.


Installing QT for Windows right now to give it a try and it says it'll take up 1.5GB or so when downloaded...

One of the many reasons why we do all hard- and software development on Linux.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19448
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Application GUI as Embedded Interface
« Reply #32 on: June 14, 2015, 09:12:27 am »
To give a little more detail, I'd like to (depending on the project) have a small serial terminal, some buttons to turn things on and off, sliders, "LEDs" to show the state of pins, and some other widget to show A/D results. It would be nice to also have a few other bells and whistles like multiple windows and/or windows inside windows (whatever those are called these days, tabbed or not). I'd try and keep things basic because it's nice to be able to change things quickly without throwing out a ton of code. I think the easiest way to implement this would be to have a button click send a serial command which the micro then reads and carries out the associated task. These applications won't be going to any client any time soon, just for personal use and growth at this point. I'd also like to be able to tap into the PC's computing power now and then in order to crunch a bunch of numbers and then send the results back (though this isn't a requirement). I'd mostly like to just have something be quick and easy (though typically to have those two you need to spend money!).

All that should be trivial in virtually any framework.

An example of a modelling exercise I threw together in Java + Java Swing/JFC + JavaFX is shown below. I used those since they are free, have many many widgets, it is easy to combine widgets into composite panels, have excellent IDE (including GUI builders), and I was familiar with everything except JavaFX.

The "CRT" is a custom JavaFX component, which I found easy to use - especially since the program expresses the X and Y coordinates in ns and V respectively, and I don't have to worry how many/few pixels are represented by each scope sample.

But largely it will come down to whatever you are comfortable with, which libraries have the most useful widgets, and possibly which is easiest for extending with custom widgets.

Have fun.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2217
  • Country: 00
Re: Application GUI as Embedded Interface
« Reply #33 on: June 14, 2015, 10:11:19 am »
The MSVC, VS and SDK installation on my development Windows is (just checked) about 13 GB...

edit: Just checked a Qt 5.3 install on Windows. Is about 2 GB (with all Qt modules installed for 'VC 13). As expected most of it are binaries (few hundred MB docs and examples), and most of that pertains to the PDB debugging files (about one GB alone). About 500 MB in Qtxxx.dll binaries, bute note that we're talking about Windows here, so you have everything twice (one debug binary, one release binary). Debugging binaries are 400 MB, so that leaves 100 MB for the actual release binaries.

I never had to download such amount of data. But I don't use Qt Creator. I prefer to use Kate,
one of the best editors for programmers.

Simply enter the following commands:

OpenSuse: zypper in libqt4-devel

Ubuntu: sudo apt-get install libqt4-dev libqt4-core g++

That's all you need to develop with Qt, no need to download gigabytes of software.

Personally, I always compile Qt from source. This way I can configure it the way I want and remove all modules I don't need.

This is what I do on OpenSuse:

some prerequisites:

zypper in gcc-c++ xorg-x11-devel cups-devel

Download and unpack: http://download.qt.io/official_releases/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz

Just 230 MB!

enter the following command to configure:

./configure -prefix-install -release -static -fast -opensource -largefile -no-exceptions -no-accessibility -no-stl -no-qt3support -no-xmlpatterns -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-svg -no-webkit -no-javascript-jit -no-script -no-scripttools -no-declarative -no-declarative-debug -qt-zlib -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg -no-openssl -no-nis -cups -no-dbus -no-gtkstyle -no-nas-sound -no-opengl -no-openvg  -nomake demos -nomake examples -nomake tools

(I removed a lot of shit I never use)

make -j12

(takes only 5 minutes on a six-core AMD)

sudo make install

now you can compile whatever Qt project.

If you try to do this on windows, bring your sleepingbag...





 

Offline Lukas

  • Frequent Contributor
  • **
  • Posts: 412
  • Country: de
    • carrotIndustries.net
Re: Application GUI as Embedded Interface
« Reply #34 on: June 14, 2015, 10:11:43 am »
Others may disagree, but I've found GTK+ to be my preferred toolkit. It's got a straightforward API, documentation is good and has by far the best GUI designer (Glade). I use Gtk almost exclusively from python, since the GObject stuff requires way too much boilerplate.

Unfortunately, support for other platforms than linux is lacking (there's code in gtk to support windows, but there are no builds) and there's nothing like qwt for easy data visualisation.
 

Offline Xenon Photon

  • Supporter
  • ****
  • Posts: 39
  • Country: eg
Re: Application GUI as Embedded Interface
« Reply #35 on: June 14, 2015, 07:10:02 pm »
C#.NET ftw!
If I have the power to make everything programmed in one language I'll select C#, except for web servers PHP is better than ASP.
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: Application GUI as Embedded Interface
« Reply #36 on: June 14, 2015, 07:24:38 pm »
C#.NET ftw!
If I have the power to make everything programmed in one language I'll select C#, except for web servers PHP is better than ASP.

I would brute-force Ada. :)
 

Offline dom0

  • Super Contributor
  • ***
  • Posts: 1483
  • Country: 00
Re: Application GUI as Embedded Interface
« Reply #37 on: June 14, 2015, 07:29:16 pm »
PHP is probably the most horrid language of all languages conceived seriously (especially considering the date of, uhm, "invention"), it becomes barely bearable with a good framework and is complete and utter nonsense - widespread nonetheless, for 'simple' deployment (actually not wrong - for very simple sites deployment is very easy, but becomes very cumbersome and complicated for larger sites. The word unmanageable comes to mind...) 
,
 

Offline eneuro

  • Super Contributor
  • ***
  • Posts: 1528
  • Country: 00
Re: Application GUI as Embedded Interface
« Reply #38 on: June 14, 2015, 07:49:51 pm »
I've been programming in C for years and years now -- I would say I'm at the 'advanced' level, but probably not 'guru'.
Use libusb with small dongles with small MPUs attached to PC USB port ;)

http://sourceforge.net/projects/libusb/files/

Thare are Linux & Window$ versions of this library.
As simple as it is and even small AVR Attiny85 can be used as MPU attached via USB, so you can whatever you want-use 2 MPU pins and have I2C via USB, or other registers and GPIOs available if you MPU of choice has small amount of pins, etc.

I see no reason not to use C programming, while it is very easy check assembler output and optimize your code or add asm inline statements, etc.

Messing with other higher level languages or... Arduino's...  :palm: if you are good in C/C++ programming like me  ;)
« Last Edit: June 14, 2015, 07:52:52 pm by eneuro »
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
“Let the future tell the truth, and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I have really worked, is mine”  - Nikola Tesla
-||-|-
 

Offline codeboy2k

  • Super Contributor
  • ***
  • Posts: 1836
  • Country: ca
Re: Application GUI as Embedded Interface
« Reply #39 on: June 14, 2015, 11:36:20 pm »
Good notes @Karel for downloading and installing qt.  However, you should be using qt5 now. :)

I usually do the apt-get install just when I need  qt4 or qt5, and I don't need anything special, but sometimes I need to use it with an older version of gcc, say 3.8, so then I need to build it from source, but it builds easily and you can strip what you don't need as shown.

Qt is, in my opinion, the absolute best cross platform native app builder available. It truly is a cross-platform C++ framework with classes for threads, thread message passing, networking (servers/clients), application message passing (i.e. IPC), filesytem access, graphics, fonts and text, sql db,

Youtube Channel VoidRealms has a long playlist of Qt tutorials here
https://www.youtube.com/playlist?list=PL2D1942A4688E9D63

He also has other programming tutorials, like Java, C# , C++, HTML, etc... but the Qt Tutorial is the most extensive and covers many of the Qt Framework classes.

 

Offline MrAureliusRTopic starter

  • Supporter
  • ****
  • Posts: 373
  • Country: ca
Re: Application GUI as Embedded Interface
« Reply #40 on: June 15, 2015, 01:35:19 am »
The Python/TkInter method looks pretty appealing as well... I'm probably even more indecisive than before I posted this, now that I've got so many strong answers pulling in all directions!

Again, if someone can recommend a good reference book on one of these solutions, that would be GREATLY appreciated!

*sigh* sometimes, you get what you wish for! :-//
--------------------------------------
Canadian hacker
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19448
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Application GUI as Embedded Interface
« Reply #41 on: June 15, 2015, 07:29:25 am »
Qt is, in my opinion, the absolute best cross platform native app builder available. It truly is a cross-platform C++ framework with classes for threads, thread message passing, networking (servers/clients), application message passing (i.e. IPC), filesytem access, graphics, fonts and text, sql db,

I find it surprising that a GUI framework needs to include those facilities - I would have expected that there were standard libraries for them. Do those facilties in QT "play nicely" with similar facilities in other libraries in an application that contains QT?

I ask because that kind of thing always used to be a pain with C/C++.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26870
  • Country: nl
    • NCT Developments
Re: Application GUI as Embedded Interface
« Reply #42 on: June 15, 2015, 08:53:36 am »
Qt is, in my opinion, the absolute best cross platform native app builder available. It truly is a cross-platform C++ framework with classes for threads, thread message passing, networking (servers/clients), application message passing (i.e. IPC), filesytem access, graphics, fonts and text, sql db,
I find it surprising that a GUI framework needs to include those facilities - I would have expected that there were standard libraries for them.
Cross platform is the keyword here and the GUI is just a small part of what a cross platform framework offers. Qt and wxWidgets provide convenient C++ classes which hide and smooth over the underlying OS and associated libraries idiosyncrasies. So even if you never use a different OS it may be benificial to use these frameworks.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Fungus

  • Super Contributor
  • ***
  • Posts: 16627
  • Country: 00
Re: Application GUI as Embedded Interface
« Reply #43 on: June 15, 2015, 08:53:48 am »
Qt is, in my opinion, the absolute best cross platform native app builder available. It truly is a cross-platform C++ framework with classes for threads, thread message passing, networking (servers/clients), application message passing (i.e. IPC), filesytem access, graphics, fonts and text, sql db,
I find it surprising that a GUI framework needs to include those facilities - I would have expected that there were standard libraries for them.
QT is a standard library for those things.

Do those facilties in QT "play nicely" with similar facilities in other libraries in an application that contains QT?
Yep.

I ask because that kind of thing always used to be a pain with C/C++.
That's why they put them in QT.
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2217
  • Country: 00
Re: Application GUI as Embedded Interface
« Reply #44 on: June 15, 2015, 09:02:17 am »
I ask because that kind of thing always used to be a pain with C/C++.

One of the reasons Qt includes them, is to make it easier to do cross-platform development.

The C and C++ standards don't include api descriptions for networking or serial ports.
But the biggest problem is, there is the way microsoft does things and there's the way the rest of the world is doing things.
Microsoft has always been (and still are) trying to be incompatibel as possible. Either by slowing down standardization, specially the kind that makes
cross-platform development easier, or by patents. Lockin is there businessmodel.

Qt tries to overcome those burdens.

 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19448
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Application GUI as Embedded Interface
« Reply #45 on: June 15, 2015, 09:58:34 am »
It appears I didn't make myself clear. The pain I was referring to was the difficulty of getting multiple libraries (each duplicating some features found in the others) to play nicely with each other without conflict.

Sure, if an application only needs one library, e.g. QT, then that isn't a problem.

As for Fungus' statement "QT is a standard library for those things", I'd put the emphasis on  "QT is a standard library for those things".
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline Fungus

  • Super Contributor
  • ***
  • Posts: 16627
  • Country: 00
Re: Application GUI as Embedded Interface
« Reply #46 on: June 15, 2015, 10:03:10 am »
As for Fungus' statement "QT is a standard library for those things", I'd put the emphasis on  "QT is a standard library for those things".
If you're using QT for the GUI then it makes sense to use it for the serial ports as well (assuming it's up to the job).

If it isn't, then... let's hope everybody involved knows about C++ namespaces.
« Last Edit: June 15, 2015, 10:21:55 am by Fungus »
 

Offline dom0

  • Super Contributor
  • ***
  • Posts: 1483
  • Country: 00
Re: Application GUI as Embedded Interface
« Reply #47 on: June 15, 2015, 10:29:33 am »
It appears I didn't make myself clear. The pain I was referring to was the difficulty of getting multiple libraries (each duplicating some features found in the others) to play nicely with each other without conflict.

Libraries bringing their own string/list/vector implementations to the table (Qt does that, but they are designed so as to be compatible and convertible to std:: ) which don't interop with std:: will always be troublesome, although it has become less of an issue (library vendors don't do it that often anymore and it's easier with C++11+ to build bridges).

Name clashes have never been an issue with C++, at least for me. With Qt not anyways, everything has a prefix (at least Q) and if necessary you can put Qt in a namespace.
,
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11612
  • Country: my
  • reassessing directives...
Re: Application GUI as Embedded Interface
« Reply #48 on: June 15, 2015, 11:44:15 am »
Qt is, in my opinion, the absolute best cross platform native app builder available. It truly is a cross-platform C++ framework with classes for threads, thread message passing, networking (servers/clients), application message passing (i.e. IPC), filesytem access, graphics, fonts and text, sql db,
I find it surprising that a GUI framework needs to include those facilities - I would have expected that there were standard libraries for them.
Cross platform is the keyword here and the GUI is just a small part of what a cross platform framework offers. Qt and wxWidgets provide convenient C++ classes which hide and smooth over the underlying OS and associated libraries idiosyncrasies. So even if you never use a different OS it may be benificial to use these frameworks.
+1. those facilities are so typical in everyday real life Apps, with the current Windowed (not console) programming environment, they've became highly correlated with the GUI. leaving out those facilities to programmers to code OS specific API in their Apps seems to defeat the purpose of the cross platformness of it. perhaps GUI framework is misleading or not the right word for it. maybe we should call them OS API wrapper or simplifier or encapsulator. with exception to "hardware specific facilities" (drivers/API) i dont believe currently there is a single OS, API or class framework that can cover every hardwares/embedded systems on this world.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline dom0

  • Super Contributor
  • ***
  • Posts: 1483
  • Country: 00
Re: Application GUI as Embedded Interface
« Reply #49 on: June 15, 2015, 11:55:56 am »
Qt is, in my opinion, the absolute best cross platform native app builder available. It truly is a cross-platform C++ framework with classes for threads, thread message passing, networking (servers/clients), application message passing (i.e. IPC), filesytem access, graphics, fonts and text, sql db,
I find it surprising that a GUI framework needs to include those facilities - I would have expected that there were standard libraries for them.
Cross platform is the keyword here and the GUI is just a small part of what a cross platform framework offers. Qt and wxWidgets provide convenient C++ classes which hide and smooth over the underlying OS and associated libraries idiosyncrasies. So even if you never use a different OS it may be benificial to use these frameworks.
+1. those facilities are so typical in everyday real life Apps, with the current Windowed (not console) programming environment, they've became highly correlated with the GUI. leaving out those facilities to programmers to code OS specific API in their Apps seems to defeat the purpose of the cross platformness of it. perhaps GUI framework is misleading or not the right word for it. maybe we should call them OS API wrapper or simplifier or encapsulator. with exception to "hardware specific facilities" (drivers/API) i dont believe currently there is a single OS, API or class framework that can cover every hardwares/embedded systems on this world.
The term is "application framework".
,
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf