GUI

More
17 May 2012 20:53 #312 by MatCat
Replied by MatCat on topic Re: GUI
What is the current RAM usage of the GUI? It shouldn't grow very much with use as structure arrays are static in size, and we can adjust those array sizes once we have most of the interface in place and we know what we will need.

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.

More
17 May 2012 21:27 #314 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
Memory usage is around 12kB right now of static memory. I don't know what they dynamic memory need is but probably at least 4k. The memory usage without the GUI is < 1k, so that memory is almost entirely for the GUI. We haven't yet dealt with storing Model data or anything actually related to the radio yet.

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.

More
17 May 2012 21:31 #315 by MatCat
Replied by MatCat on topic Re: GUI
Well with the dirty/transparent checks, I don't forsee a whole lot of redraw issue anyway, most elements just need to be redrawn as is then and not worry about whats below (which exception of labels and such)

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

More
18 May 2012 02:10 #316 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
I think you need to see how bad it is on the transmitter. It is much worse than in the emulator.

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.

More
18 May 2012 02:16 #317 by MatCat
Replied by MatCat on topic Re: GUI
K, I will pull and check it out shortly.

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

More
18 May 2012 03:34 - 18 May 2012 03:58 #318 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
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
Last edit: 18 May 2012 03:58 by PhracturedBlue.

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

More
18 May 2012 09:13 #319 by FDR
Replied by FDR on topic Re: GUI

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.

More
18 May 2012 12:59 #320 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
It should work.

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.

More
18 May 2012 15:02 #321 by FDR
Replied by FDR on topic Re: GUI
Thanks!
I will need more help, I'm afraid... :oops:
What is Python for? Is the emulator written in Python?

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

More
18 May 2012 15:30 #322 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
If you actually want to try it, I can probably give you more detailed instructions.

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.

More
18 May 2012 17:07 - 18 May 2012 17:18 #323 by FDR
Replied by FDR on topic Re: GUI
I see.
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?
Last edit: 18 May 2012 17:18 by FDR.

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

More
18 May 2012 17:51 #324 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
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>

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

More
18 May 2012 20:25 #325 by FDR
Replied by FDR on topic Re: GUI
Thank you!
I followed your instructions, and now I have something, but I don't know is it right:









Is that what is should be like?
There were quite a few "unused" warnings in the fltk and some in the deviation too...
Attachments:

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

More
18 May 2012 20:30 #326 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
It looks fine, but I'd like to see your compile messages fro deviation. I don't think I get many warnings. For the fltk build you should be able to ignore the warnings.

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.

More
18 May 2012 20:59 #327 by FDR
Replied by FDR on topic Re: GUI
OK, I will play with that.

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.

More
18 May 2012 21:11 #328 by FDR
Replied by FDR on topic Re: GUI
It crashes if I click into the spin button on the mixer page. It works on the arrows, but crashes immediately if I click on the text portion...

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

More
18 May 2012 22:26 #329 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
That crash is because it is what I am working on now.When you click on the text it will soon pop up a set of configuration options, but that isn't actually implemented yet. That is my task for this weekend.

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

More
22 May 2012 08:43 #336 by FDR
Replied by FDR on topic Re: GUI

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.

More
22 May 2012 13:24 #342 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
That is fine. It is also in the README for the code itself now

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

More
28 May 2012 19:53 #379 by MatCat
Replied by MatCat on topic Re: GUI
Just a FYI, I have not dissappeared, just been busy with work, you will find I tend to be busy for a week or 2 at a time, then will have a week or 2 with a bit more free time, but I am still here :).

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

Time to create page: 0.162 seconds
Powered by Kunena Forum