Shop OBEX P1 Docs P2 Docs Learn Events
Design your own GUI - Prop Plug & PST — Parallax Forums

Design your own GUI - Prop Plug & PST

JBWolfJBWolf Posts: 405
edited 2014-04-06 19:24 in Propeller 1
Hello,
I was wondering how I would go about designing my own neato GUI to replace the PST for use with prop plug.
The PST works great for basic text display, but I would like to be able to design a neat GUI display with images and such that I can click on and have it send data to the prop via prop plug via 'parallax serial terminal.spin' or 'fullduplexserial.spin'.

What language should I use (VB?) and are there any basic tutorials for approaching this?
Thanks

Comments

  • Heater.Heater. Posts: 21,230
    edited 2014-04-02 13:37
    There are many.

    If you want to share your work with others and perhaps attract contributors I would suggest using C++ and the Qt GUI tool kit. Then anyone with Windows or Mac or Linux can play along.

    Google will find you many tutorials and example codes.
  • JBWolfJBWolf Posts: 405
    edited 2014-04-02 14:05
    I guess im mostly wondering how I go about the communication protocol for sending data from the PC software to the prop, and then receiving data back.
    I have a little C+ experience, more with VB

    For example how would i go about emulating the PST with VB instead?
    Hoping this is something atleast a few others have asked.... just need a good starting point on the communication between the prop plug and VB or c+
  • Heater.Heater. Posts: 21,230
    edited 2014-04-02 14:12
    A serial link from the Prop. A serial/USB adapter into your PC. Qt has libraries for serial port handling. See the SimpleIDE or PropellerIDE threads that use this for programming props from Qt.

    As for "protocol" that's up to you to invent. The libraries just make it possible to exchange streams of bytes.
  • JBWolfJBWolf Posts: 405
    edited 2014-04-02 14:19
    cool ill look up those threads.
    just started reading about qt
  • JBWolfJBWolf Posts: 405
    edited 2014-04-02 14:26
    after looking up the IDE threads, this seems like just programming and code related purposes.
    I need something to create a super basic graphics panel with icons you can click on to make the prop perform functions (pre programmed methods).
    For example the gui has 3 icons, each icon is an image of an led, one image of a red led, one of green led and the thirs is blue led.
    clicking on one of the led images sends a PST type command to the prop, and it turns on that led.
    I want all the code manipulation and data handling done in the background... just need a spiffy graphics interface.
    We still on same page or are we talking about different things?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-04-02 14:36
    You might also consider a local Perl- or Python-scripted server which acts as the glue between your browser and the serial port. I recently completed such a project here:

    It's just a way to get serially-downloaded PropCAM images to display in the browser. But the same technique can be used for a variety of apps. I'm not familiar with the Python libraries, but the available Perl modules make server apps a snap to write.

    -Phil
  • Heater.Heater. Posts: 21,230
    edited 2014-04-02 14:43
    Same thing.
    User, keyboard, mouse at one end. Propeller at the other. Serial link from Propeller to PC. Qt program between serial link and user.

    In Qt you can create buttons and sliders and icons and menus and...well pretty much any kind of widget you can imagine. There is even a tool to let you lay this stuff out graphically in the Qt IDE.

    Your job then is to connect those GUI widgets to commands and responses sent over the serial connection. With of course some custom Spin or C code in the Propeller that understands whatever you are doing.

    Where we might be stuck is "I want all the code manipulation and data handling done in the background.." I don't know of such an infrastructure.

    I don't think it's any harder, for what you have described, than the GUI part itself.
  • KeithEKeithE Posts: 957
    edited 2014-04-02 16:49
    Has anyone tried livecode for this sort of thing? I've got to try out that program sometime - there are references to people using the serial port with it.

    The community edition is free due to a kickstarter, and it's multiplatform.
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2014-04-02 17:03
    AN018: Communication with a PC Application
    Keywords:
    VB.NET, Visual BASIC, Communication, Serial, Protocol, Packet, PC, QuickStart, P8X32A
    Abstract:
    Abstract: Many embedded applications share information with external devices, and the preferred connection between devices is asynchronous serial communications. The multi-core architecture of the P8X32A enables the designer to create and deploy device-to-device communications strategies with no impact on the primary application code. In this example a deployed communications support cog manages data between the main application and the serial I/O firmware, usingVB.NET and the P8X32A QuickStart board.

    http://www.parallaxsemiconductor.com/an018
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2014-04-02 18:19
    The application note Bob Lawrence refers to is a great starting point, also check this link if your into VB or C#

    http://forums.parallax.com/showthread.php/96973-VB-Express-to-Stamp-Template


    EDIT: try the following for excellent tutorial/reference

    http://www.homeandlearn.co.uk/NET/vbNet.html
  • JBWolfJBWolf Posts: 405
    edited 2014-04-03 16:41
    awesome, very good info :)
    I appreciate your help guys, right now I'm reading through the parallax tutorial Bob linked.
    But all the links you guys provided are great, just a matter of choosing one.... im most familiar with VB and the an08 tutorial does very well explaining this in a manner that I can follow, so im going to start there.

    Sorry if i confused u heater... what I meant was I need all the code and such to not be seen while the gui is running (this is what i meant by background, not that all the coding is already done for me).
  • Heater.Heater. Posts: 21,230
    edited 2014-04-04 01:03
    JBWolf,
    what I meant was I need all the code and such to not be seen while the gui is running
    But that is the normal situation with Qt programs. You create a program, perhaps using the Qt Creator IDE, perhaps just using any old editor. You compile it. You then have an executable. When your users run your executable all they see is what you programmed for them to see.

    Just as it is with VB executables or many other programming systems.

    I'm curious as to why you think it would be any different?

    VB is no doubt easy to work with, but if you want to share your work and/or attract collaborators it's pretty useless. If that's not the case then use whatever works best for yourself.
  • ErNaErNa Posts: 1,752
    edited 2014-04-04 04:05
    I would second to do the job in Qt. I am about learning and solve exactly the same problem. So we can collaborate!
  • T ChapT Chap Posts: 4,223
    edited 2014-04-04 05:35
    I find that it does not get much easier that Xojo (formerly Real Basic). Multiplatform builds, plus a great forum to get immediate help, I have quite a few GUI's that communicate with the prop via usb and it allows you design an interface quickly and easily. There are serial examples with the demo, and you would be talking to the prop in minutes after getting the demo installed.
  • LoopyonionLoopyonion Posts: 24
    edited 2014-04-04 14:52
    T Chap wrote: »
    I find that it does not get much easier that Xojo (formerly Real Basic). Multiplatform builds, plus a great forum to get immediate help, I have quite a few GUI's that communicate with the prop via usb and it allows you design an interface quickly and easily. There are serial examples with the demo, and you would be talking to the prop in minutes after getting the demo installed.

    I downloaded this a few hours ago, it seems so much more user friendly than VB2010. The overall interface is smoother, and intuitive.

    Ill have to have a more in depth play over the weekend, and as I was about to start an interface to send data to my prop after loading from a file in VB, I may just work with this :)

    Any snippets you could share to speed the process would be welcome. :)

    Thanks for the heads up on this software too, id never of known about it.
  • frank freedmanfrank freedman Posts: 1,983
    edited 2014-04-04 15:35
    You might also consider a local Perl- or Python-scripted server which acts as the glue between your browser and the serial port. I recently completed such a project here:
    It's just a way to get serially-downloaded PropCAM images to display in the browser. But the same technique can be used for a variety of apps. I'm not familiar with the Python libraries, but the available Perl modules make server apps a snap to write.

    -Phil
    And with Perl Tk module the only limit on the GUI is your own imagination..... Well not really, but there are sooooo many Tk modules on CPAN

    www.cpan.org
  • jazzedjazzed Posts: 11,803
    edited 2014-04-04 16:14
    My favorite part of using CPAN was waiting an hour for the download ;-) Maybe that has gotten better, but PERL certainly hasn't.

    Pretty clear that the OP is interested in some VB-like thing.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-04-04 16:28
    And with Perl Tk module the only limit on the GUI is your own imagination.....
    I do love Perl/Tk and use it for Windows and Linux apps. It's not natively compatible with OS/X, though, needing X11 to run. That fact is mainly what keeps the S2 GUI off of the MAC, sadly.
    jazzed wrote:
    My favorite part of using CPAN was waiting an hour for the download
    I haven't had that problem, but I don't have to download directly from CPAN very often. I use ActivePerl and their Perl Package Manager, which is brain-dead simple and quick when the desired module is available from one of their repositories.

    -Phil
  • KeithEKeithE Posts: 957
    edited 2014-04-04 16:46
    I do love Perl/Tk and use it for Windows and Linux apps. It's not natively compatible with OS/X, though, needing X11 to run. That fact is mainly what keeps the S2 GUI off of the MAC, sadly.

    -Phil

    XQuartz didn't work out for you? Or you figured it would be a problem for users to install it?

    Edited to add: I've had no problems running the free Mathematica on a Raspberry Pi with the display sent to a Mac. (ssh -X …)
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-04-04 17:56
    KeithE wrote:
    XQuartz didn't work out for you? Or you figured it would be a problem for users to install it?
    The latter, especially considering the IT bureaucracies faced by many school districts. And Apple apparently doesn't own XQuartz anymore, so that was another consideration.

    -Phil
  • T ChapT Chap Posts: 4,223
    edited 2014-04-04 18:20
    Loopyonion, send me your email and I will try to send you a file to get started with. Forget VB, Xojo is the coolest thing ever.
  • frank freedmanfrank freedman Posts: 1,983
    edited 2014-04-04 23:09
    jazzed wrote: »
    My favorite part of using CPAN was waiting an hour for the download ;-) Maybe that has gotten better, but PERL certainly hasn't.

    Pretty clear that the OP is interested in some VB-like thing.

    You still using 14.4 modem? I have always had fast downloads. Perl is not a pretty language for certain, But if you recall, a few years ago, there used to be "contests" to see who could come up with the most obfuscated code that performed useful functions.

    While I understand he was looking at VB, VB sorta limits his options. Sounded more like OP was open to other methods as well.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-04-04 23:17
    Perl is not a pretty language for certain,
    Perl is messy, chaotic, the paradigm of "there's more than one way to do it." For those who are hidebound by a straightjacket sense of order, it must seem horribly confusing. But that would be to ignore the inherent expressiveness and consequent terseness of a very flexible language. Anyway, it suits my programming style, but it's definitely not for everyone.

    -Phil
  • T ChapT Chap Posts: 4,223
    edited 2014-04-05 05:19
    Some years back after hearing Phil talk about Perl for about the same number of years on here, I finally got it and spent a number of hours and finally came to the conclusion that this is one platform that I will absolutely never spend another minute on.

    Xojo is the way to go for making apps.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-04-05 11:10
    T Chap wrote:
    Some years back after hearing Phil talk about Perl for about the same number of years on here, I finally got it and spent a number of hours and finally came to the conclusion that this is one platform that I will absolutely never spend another minute on.
    LOL! Believe me, you're not alone. Perl is one of those things you either get -- and like it -- or you don't. I've never seen anyone who's neutral on the subject. :)

    -Phil
  • msrobotsmsrobots Posts: 3,709
    edited 2014-04-06 18:28
    Phil,
    LOL! Believe me, you're not alone. Perl is one of those things you either get -- and like it -- or you don't. I've never seen anyone who's neutral on the subject. :smile:

    So it is some kind of FORTH?

    Enjoy!

    Mike
  • mindrobotsmindrobots Posts: 6,506
    edited 2014-04-06 18:36
    msrobots wrote: »
    Phil,


    Hey, hey ! Watch it there!!! :0)

    Perl and I came to terms finally. Something jus clicked in my head all of a sudden after many years of struggling. Now Perl an I get along fine.

    In the respect of either get it or don't get it, they are similar.




    So it is some kind of FORTH?

    Enjoy!

    Mike
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-04-06 19:07
    msrobots wrote:
    So it is some kind of FORTH?
    In terms of brevity, expressiveness, and ultimate obfuscability, yes.

    -Phil
  • mindrobotsmindrobots Posts: 6,506
    edited 2014-04-06 19:24
    In terms of brevity, expressiveness, and ultimate obfuscability, yes.

    -Phil

    Perl has more users than implementations; Forth has more implementations than users! :0)
Sign In or Register to comment.