New tool QFlexProp
pullmoll
Posts: 817
in Propeller 2
I started writing a tool to wrap Total Spectrum Software Inc.'s flexspin
in a GUI with editor and VT220 terminal emulator. Find the current development at https://github.com/pullmoll/qflexprop
Some parts, notably the serial port stuff and terminal emulation, were lifted from other projects of mine and need some more polishing.
As always there's a lot of things left to do, yet it works to some extent under Linux. Most notably the upload to the prop2 is currently using only the standard methods, i.e. Prop_Hex or Prop_Txt and no hi speed loader.
I'm also trying to build it on Windows as time permits.
Thanks @ersmith for the great tools.
Comments
Thanks, @pullmoll , I look forward to trying it out.
You mentioned that you're re-implementing the upload to the P2. Any particular reason you didn't just call out to loadp2 or proploader? I think those have been ported to all of the major platforms now. Just curious.
Cheers,
Eric
Ideally I wanted to use the
QSerialPort
abstraction that is in Qt5 to not have to deal with different platforms.As it is now the serial port to the prop2 is open all the time, once configured, and the also the integrated terminal is active. Then, for the time of the upload, only the function forwarding any data read from the serial port to the terminal is skipped, because the loader uses the data for checksum confirmation etc.
You know, for a Qt application a serial port is just another i/o device class derived from
QIODevice
plus some additional functions. In order to run an external tool likeloadp2
I would have to close this serial port during the system call which is certainly possible, while I wanted to try to avoid it. After all it's not that much code which is required to get the job done, read: I wanted to re-implement what loadp2 does in C++ / Qt.FWIW: I tried the build of
qflexprop
on Windows now using your flexptools.zip for the binaries (version 2.5.0). It seems thatflexspin.exe
doesn't find the include path, even with explicit-I "C:/path to/include"
included in double quotes in case of embedded spaces. The exe is on the same directory level as the./include
and I wonder if it should be in a./bin
directory? Anyway currentlyspin/SmartSerial.spin
isn't found and trying to build something fails with an error. I'm sure I'll find out why that is, though.The automatic search for include files does use $PATH_TO_EXECUTABLE/../include as the default. But an explicit -I path should always work. Does it work if there are no spaces in your path?
My bad. I tried to compile
fibo.spin
from the flexprop samples not realizing it is for the P1. It prints an error on Linux as well:So also the Windows build basically works and v0.1.0 is attached as a ZIP.
It includes the Qt5 files (libraries and plugins) which are required just once.
Edit: Attachment does not seem to work so here is an alternate download location
If you have a Windows w/o Qt5 installed I'd be interested if this ZIP contains everything required to make
qflexprop.exe
work. On my systems I always have Qt5 + QtCreator installed and cannot test it easily.Windows problems solved - sort of. As usual, even though Qt5 is a platform agnostic environment, Windows is different... sigh
On Windows the QProcess::setArguments() call does not work as expected. This is how you pass a list of arguments to a process, in this case to
flexspin.exe
. Instead of passing a QStringList, you are forced to use the QProcess::setNativeArguments() function and pass the options as a single string. Fortunatelyargs.join(QChar::Space)
makes that easy, but the code is clobbered with#if defined(Q_OS_WIN)
nowUpdated the Windows archive to qflexprop-0.2.0-win64.zip
I'd be really glad to hear from anyone who tests this whether it works for them.
I am basically not a diplomat, so I am not sure if I will be offending you. Have you considered, maybe, building a GUI from some existing code?
Since you are using Qt5, you might get a head start if you developed from SimpleIDE or PropellerIDE, I believe both of those are developed using Qt3 or maybe Qt4, not sure. Since SimpleIDE is owned by Parallax, that will be a problem, but PropellerIDE is not. In fact if I remember correctly when jazzed(Steve Denson) was developing SimpleIDE, he had an open source basic version also, the name escapes me now. Maybe one of the moderators will remember where the source is located.
I just looked at PropellerIDE, again, and noticed he added access to PropBASIC, so it might be easy enough to add Flexspin, FlexC, FlexBASIC, and maybe micropython, and whatever else pops up. And of course it might be easier to address the WiFi access also.
Since the mentioned software has been used by people on this forum, the existing UI might be an easier starting point for the Parallax users. And, as you have mentioned, it will be easier to develop for Linux, Raspberry Pi, Windows, and maybe the Mac. Just something to think about.
Ray
Hey Ray, you won't offend me in any way by asking questions
I haven't looked around too much for whether or not something exists which may be usable as a starting point.
But then this is not my first Qt5 project and I love to write code also because at the same time I get some (more) insight into what the underlying tools, libraries and interfaces do and how they do it.
The problem with starting off of software written by someone else is you first have to understand it. Then, if you understood it, you need to get an overview and eventually insight of where things are and how to modify them, if that is required for adding or changing something. I may exaggerate a bit but by the time it'd take me to understand a third party's code base like that of PropellerIDE I could (probably) have written it myself. And then I know where everything is...
In case of QFlexProp I was happy to find flexspin doing almost everything I need on the translation side. It would have been even nicer if flexspin would provide a library interface - perhaps I'm going to try to add that at some point.
The VT220 terminal emulation code in QFlexProp was already in good shape with just some minor issues. It was used in other projects of mine where a serial terminal was required. The syntax highlighting for the editor is something that needs more work, but it's essentially already useful. Mostly it needs more tokens and classifications for the language(s) where they are valid. Some color palette configuration may be nice also... So I'm almost done for what I really need to work with the P2 on Linux.
Since I myself don't speak Python too well, I won't be adding support for it in the first step(s), perhaps later.
My intent is to have a working, documented (using Doxygen) and easy to contribute to (through github.com issues + pull requests) tool for myself and perhaps others to develop for the Prop2 on Linux. I really don't like Windows and try to avoid it wherever possible, which is why Parallax's official tool is nothing for me. The nice side effect that QFlexProp will work or already works on Windows, RasPI, Mac is just a that, a side effect and nice-to-have.
I hope to start coding for the P2 soon (p2z80 probably) in the spare time that's left beside my day job and working on Void Linux.
Jürgen
While you are progressing with QFlexProp, I hope that you will consider ending up with a UI that gets closer to a PropellerIDE/SimpleIDE looking UI, as I mentioned, people are probably used to that UI.
I did try QFlexProp 0.2.0 on Windows, and I know it is only 0.2.0, but....
It did start up, in terminal mode, not sure if that is supposed to be occurring. It was not finding any of FlexProp stuff, so I guess you have to pre-load a version of FlexProp. It also started with a com port of USB tty, it took a while to figure out how to find the port on the Windows machine.
This might be as far as I can go, since you will only be using flexspin, I try not to get involved with Spin. At the moment I am using FlexBASIC, to see how that works. When FlexC gets more mature, then I will probably be using that also. Again. keep in mind the WiFi access, that is really helpful scenario.
Ray
I for example am used to QtCreator and use it as an example design I'd like to resemble.
In fact I thought about writing a plugin for QtCreator to deal with spin and flexspin, but that would lack a terminal.
I'm open to any kind of design criticism and suggestions regarding the UI as long as they don't go into the opposite direction of what I need. I haven't used PropellerIDE too much because I avoid Windows.
Starting in terminal mode is intended as you may want to just enter the Monitor or TAQOZ and send a file.
Usually the first thing is Ctrl+O (or File -> Open) and select what you want to edit or compile and run.
I do not (yet) automatically open a previous file, which I will implement, or create a new file w/o asking.
Oh, and
flexspin
does not only compile spin, but also Basic and C. The name may be misleading.And yes, you need to install the
flexspin
executable and headers etc. somewhere beforehand.I thought that was clear by my comments above which mentioned @ersmith 's windows binaries.
My choice of a default location for Windows to look at as
C:/Program Files (x86)/p2tools/
is probably not the best...Issues on github are welcome and I'll change it (for Windows) to what you think is best.