- Posts: 168
GUI
- MatCat
- Topic Author
- Offline
I think a dynamic API for GUI is really the best, and can pave the way for much more functionality. What is the possibility of having 'plugins' that can be saved to the fat system and be dynamically incorperated into the firmware? Just ideas though for the future.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
There is no possibility of dynamic modules with the current code. You cannot access the SPI_Flash as if it is code. The only solution would be to load the code fro SPI_Flash into RAM and execute from there. I really wouldn't want to do that.
I'm pretty convinced that storing the widgets in ROM is the right approach, but it isn't that important at the moment. I'll continue building the Mixer pages for the time being. I think I have almost all the widgets I need for that now.
By the way, I think layering bitmap frames is going to be a bad idea. The performance is just too slow to overlap widgets. I think it will be worth while to just use different backgrounds wherever a layer would have been used.
Please Log in or Create an account to join the conversation.
- MatCat
- Topic Author
- Offline
- Posts: 168
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Currently we redraw whenever a widget is removed. That is probably unavoidable with the dialogs, but hopefully we won't use dialogs too often. With everything else, it can probably be avoided if we don't overlap widgets. If you allow widgets to overlap, it gets out of control very quickly.
Anyhow, as I said, I'll leave it alone for now. If we can get sufficient performance with the current system, and we don't need the extra RAM, we can leave it.
In any case, I just checked in a significant rework of gui.c. I didn't changememory handling or architecture in any way, but I switched to a linked-list of guiObjects rather than always traversing every object. I also switched from using indexes to pointers for the various widgets. This will make it easier to move to a ROM implementation if we ever need to, and it makes the code easier (for me) to follow. I also removed virtually all of the struct copies in favor of using pointers. That should reduce dynamic memory usage. It makes the GUI a lot easier to debug in gdb since the loops are all much shorter, i can actually step through them.
You definitely want to pull my changes before doing any significant GUI work as nearly every line in gui.c was changed. I hope you find the current code acceptable.
Please Log in or Create an account to join the conversation.
- MatCat
- Topic Author
- Offline
- Posts: 168
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
www.mail-archive.com/fltk@easysw.com/msg08023.html
with:
./configure --disable-gl --disable-largefile --enable-localjpeg --enable-localzlib --enable-localpng --disable-xinerama --disable-xft --disable-xdbe
And was able to successfully build an exe that runs on Windows with no other libraries
Edit: It turns out that cross-compiling FLTK is easy:
apt-get install mingw32 mingw32-binutils mingw32-runtime
Then unpack fltk and run:
./configure --disable-largefile --enable-localjpeg --enable-localzlib --enable-localpng --disable-gl --host=i586-mingw32msvc --prefix=/opt/fltk-w32
make
Please Log in or Create an account to join the conversation.
- FDR
- Offline
PhracturedBlue wrote: I just added the ability to cross-compile the emulator for Windows. That should make it easier to get feedback on the interface once we're a bit farther along.
Getting fltk to cross-compile on Linux is annoying, as it isn't trivially done, but I (more or less) followed the instructions here:
www.mail-archive.com/fltk@easysw.com/msg08023.html
with:
./configure --disable-gl --disable-largefile --enable-localjpeg --enable-localzlib --enable-localpng --disable-xinerama --disable-xft --disable-xdbe
And was able to successfully build an exe that runs on Windows with no other libraries
Edit: It turns out that cross-compiling FLTK is easy:
apt-get install mingw32 mingw32-binutils mingw32-runtime
Then unpack fltk and run:
./configure --disable-largefile --enable-localjpeg --enable-localzlib --enable-localpng --disable-gl --host=i586-mingw32msvc --prefix=/opt/fltk-w32
make
Cool!
Besides running it on Windows, is it possible to buid it on that?
Sooner or later (as my time allows) I would like to join in...
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
To build the emulator, you'd need mingw, fltk and python
To build the dfu, you'd need a working arm cross-compile chain and python
Please Log in or Create an account to join the conversation.
- FDR
- Offline
I will need more help, I'm afraid...
What is Python for? Is the emulator written in Python?
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Python is used to create the dfu file. I could probably rewrite the code in C, but I'm too lazy o do that now. You don't need python for the emulator. FLTK is the cross-platform GUI toolkit I'm using in the emulator. It has nothing to do with the actual firmware, it is just used on the PC to simulate the LCD.
If you just want to play around, I can provide an exe file.
Please Log in or Create an account to join the conversation.
- FDR
- Offline
I don't need the dfu so far, I just want to try to build the emulator, and getting familiar with the code.
By the way I've written a program to create dfu already, just need to implement the Walkera encoding while adding the binary to it...
EDIT: But I have to dig for the encoding, 'cause I do not find. Can you point me to it?
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Install MingW:
* Download the mingw installer from here: sourceforge.net/projects/mingw/files/Ins...0120426.exe/download
* Run the installer, and select 'C++', 'MSYS' and the 'Developer Toolkit'
Install fltk:
* Download fltk from here: www.fltk.org/software.php?VERSION=1.3.0&...-1.3.0-source.tar.gz
* Start msys (you should have an icon, but otherwise run C:\MingW\msys\1.0\msys.bat
* mkdir src
* cd src
* Untar fltk: tar -xzf <path to fltk download> (you can get to your C: drive in mingw using /c/Users/<user>/Downloads for example)
* cd fltk-1.3.0
* ./configure
* make
* make install
Install Deviation:
* Download the source code for deviation. You'll need mercurial to keep track of changes (which will require installing python), but you can manually download a zip of the source from bitbucket.org/PhracturedBlue/deviation
* cd ~/src
* cp -pf <path to deviation src code> deviation
* cd deviation/src
* make TARGET=emu_devo8 WINDOWS=1
If everything goes well, you can now do:
* ./emu_devo8.exe
MSYS notes:
your 'home' dir will be at C:\MinGW\msys\1.0\home\<user>
Please Log in or Create an account to join the conversation.
- FDR
- Offline
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Use '3' and '4' to switch to different pages. The default page is just a test-screen for various widgets. I believe that '1' will enter screen calibration mode, and q/a, w/s, e/d, and r/f should control the throttle, rudder, elevator and aileron. '1' will enable screen calibration (not very interesting for the emulator)
Please Log in or Create an account to join the conversation.
- FDR
- Offline
The message was:
gui/gui.c: In function 'GUI_DrawXYGraph':
gui/gui.c:689:19: warning: variable 'yval' set but not used [-Wunused-but-set-va
riable]
Please Log in or Create an account to join the conversation.
- FDR
- Offline
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- FDR
- Offline
PhracturedBlue wrote: You'll need some basic knowledge of using a bash shell vs a Windows Command shell, but here are step-by-step instructions:
Install MingW:
* Download the mingw installer from here: sourceforge.net/projects/mingw/files/Ins...0120426.exe/download
* Run the installer, and select 'C++', 'MSYS' and the 'Developer Toolkit'
Install fltk:
* Download fltk from here: www.fltk.org/software.php?VERSION=1.3.0&...-1.3.0-source.tar.gz
* Start msys (you should have an icon, but otherwise run C:\MingW\msys\1.0\msys.bat
* mkdir src
* cd src
* Untar fltk: tar -xzf <path to fltk download> (you can get to your C: drive in mingw using /c/Users/<user>/Downloads for example)
* cd fltk-1.3.0
* ./configure
* make
* make install
Install Deviation:
* Download the source code for deviation. You'll need mercurial to keep track of changes (which will require installing python), but you can manually download a zip of the source from bitbucket.org/PhracturedBlue/deviation
* cd ~/src
* cp -pf <path to deviation src code> deviation
* cd deviation/src
* make TARGET=emu_devo8 WINDOWS=1
If everything goes well, you can now do:
* ./emu_devo8.exe
MSYS notes:
your 'home' dir will be at C:\MinGW\msys\1.0\home\<user>
I have copied it to an article in your name, if you don't mind...
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- MatCat
- Topic Author
- Offline
- Posts: 168
Please Log in or Create an account to join the conversation.