GUI

More
11 Jun 2012 01:46 #383 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
Ok, after some delay, I'm going again.
I added a new 'trim' settings page, as well as a 'main page'.
New features:
* support for very large fonts
* Initial menu for setting up trim values
* Main page will show live trim and throttle values

I've decided that rather than implementing everything that we'll eventually need, that I'm going to start working on getting basic functionality to the point I can actually control a model from the transmitter.

So my next step is to start work on a radio interface. I'll probably start with a protocol I already know (likely the FlySky protocol) since the effort to reverse engineer the DEVO protocol is substantial, and this is not my field of expertise). With any luck, rcH4x0r will come back at some point to help with that.

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

More
11 Jun 2012 15:33 #384 by FDR
Replied by FDR on topic Re: GUI
Welcome back! :)

I have started the testing.
How ready is it supposed to be?

Minor bug: I cannot step throw the trim page with "5", only if I open and close one of them.
Probably there is some memory leakage, because the app crashes after some window opening. It crashed after 42 trim window opening, or 19 channel settings window.

More coming later... ;)

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

More
11 Jun 2012 16:37 - 11 Jun 2012 16:42 #385 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
Well, it is only lightly tested. I just added a quick change to let you change the steps from the main trim window rather than entering the edit window. Once configured, it is unlikely you'll ever need to change the trim buttons for a given channel.

The trims are not actually connected yet, so they won't affect the outputs you see (except for the heli-mix controls where they will affect the output, but not in the proper way.

If you didn't figure it out:
use caps 'A'/'Q' for changing the throttle trim, and 'S'/'W', 'D'/'E', 'F'/'R' for the other corresponding channels. You should see the trim bars move on the main page.
keys '5' and '6' move through the different pages now (that will likely change soon)

Edit: And I fixed the problem with not being able to cycle past the trim page. The memory leaks will need to wait until later for me to look at.
Last edit: 11 Jun 2012 16:42 by PhracturedBlue.

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

More
11 Jun 2012 18:31 #386 by FDR
Replied by FDR on topic Re: GUI
I don't see the trim bars moving at all.
The values on the right pane and the throttle value on the main window do change, but not the trim bars. Furthermore, the trim steps seem to be always 20%, not the value set on the trim window. Actually whatever channel's trim settings I open, it always show the throttle trim settings.

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

More
12 Jun 2012 00:54 #387 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
Entering edit mode on the trim page should work now.
I haven't been able to reproduce a crash, and I ran within valgrind and didn't see any memory leaks

the trms work for me. use shift-a, shift-q to move the throttle trim. It won't woirk with caps-lock for some reaosn, you need to actually hold the shift key.

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

More
12 Jun 2012 05:18 #388 by FDR
Replied by FDR on topic Re: GUI
Sorry, it's my bad, I somehow missed the word "caps". :oops:

Now the trim bars are working, but I have two observations:
1. If the trim step is not a divider for 100, and I step throw the range comletely, then in the last step it makes a half step to 100%, but then going back it goes throw different values and never hit the 0%.
2. Long press doesn't work like on other numeric spin buttons.

It still hangs for me if I open too many windows. It doesn't actually crash, but don't refresh the screen and the controls won't work. It always happen sooner or later, while I am testing...

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

More
12 Jun 2012 13:41 #389 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
for the hang, the easiest way is to use gdb to provide me more info:

from the console:
gdb ./emu_devo8
r
<test the emulator until it hangs>
in the console again:
ctrl-c
bt full

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

More
12 Jun 2012 14:02 #390 by FDR
Replied by FDR on topic Re: GUI
At the last step it says:

sh: bt: command not found

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

More
12 Jun 2012 14:09 - 12 Jun 2012 14:10 #391 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
then you aren't in gdb.
Assuming you are using MSYS for your console, you should have gotten a prompt that looks similar to (but probably not identical to):
Program received signal SIGINT, Interrupt.
__mpn_cmp (op1_ptr=0x7fffffffdb90, op2_ptr=0x7fffffffdb50, size=2) at cmp.c:46
46	cmp.c: No such file or directory.
	in cmp.c
(gdb) 
when you hit ctrl-c within the gdb window

I can't easily give you instructions on how to get gdb working (it should just work) but some searching on the web will hopefully help.
Last edit: 12 Jun 2012 14:10 by PhracturedBlue.

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

More
12 Jun 2012 14:35 #392 by FDR
Replied by FDR on topic Re: GUI
You are right: when I hit ctrl+c, it quits gdb.
Instead I killed the app, and the "bt full" gave this output:
$ gdb ./emu_devo8
GNU gdb (GDB) 7.4
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from C:\deviation\MinGW\msys\1.0\home\LFodor\src\deviation\src\e
mu_devo8.exe...done.
(gdb) r
Starting program: C:\deviation\MinGW\msys\1.0\home\LFodor\src\deviation\src\emu_
devo8.exe
[New Thread 5860.0x15b8]

Program received signal SIGSEGV, Segmentation fault.
0x004109c5 in XRectangleRegion(int, int, int, int) ()
(gdb) bt full
#0  0x004109c5 in XRectangleRegion(int, int, int, int) ()
No symbol table info available.
#1  0x00410c04 in Fl_Widget::damage(unsigned char, int, int, int, int) ()
No symbol table info available.
#2  0x00410d8c in Fl_Widget::redraw() ()
No symbol table info available.
#3  0x0040b8fa in LCD_DrawStop () at target/emu_devo8/fltk.cpp:286
No locals.
#4  0x00403b6a in LCD_FillRect (x=10, y=164, w=65535, h=112, color=0)
    at screen/qvga/lcd_gfx.c:242
No locals.
#5  0x004045a7 in LCD_DrawWindowedImageFromFile (x=10, y=164,
    file=0x454d9c "images/btn48_16.bmp", w=300, h=112, x_off=0, y_off=0)
    at screen/qvga/lcd_gfx.c:419
        i = 64
        j = 19687
        fh = 0x0
        transparent = 0 '\000'
        row_has_transparency = 0 '\000'
        buf = "\000\000­", '\000' <repeats 11 times>, "\020\000\000\000\000\000\
000\000 \000\000\000\001", '\000' <repeats 11 times>, "­\000\"\000@\001\000\000\
000\000\"\000\000\000D~0\210A~\377\377\377\377*\210A~═ëA~\000\000\000\000<¸@\000
\230\006\203\000\001\002\000\000\001\000\000\000ÚôA~ĘôA~DYJ", '\000' <repeats 13
 times>, "\001\000\000\000@ö\177\000\000Óř\177\210■\"\000\070ű\"\000\002öA~DYJ\0
00\000\000\000\000\000\000\000\000Ť`˝w─­ř\177\000Óř\177", '\000' <repeats 12 tim
es>, "­\000\000\000Xű\"\000Ów˝w\002", '\000' <repeats 11 times>, "Ť`˝w─­ř\177\00
0Óř\177", '\000' <repeats 12 times>...
        img_w = 101
        img_h = 4214017
        offset = 6356992
        compression = 2293064
#6  0x0040591f in GUI_DrawObject (obj=0x4ab2a0) at gui/gui.c:356
        button = 0x4aa5a0
        box = 0x4ab2a4
#7  0x00405bbf in GUI_DrawObjects () at gui/gui.c:417
        obj = 0x4ab2a0
#8  0x00405fde in GUI_DrawScreen () at gui/gui.c:568
No locals.
#9  0x00408481 in PAGE_MixerInit (page=0) at pages/mixer_page.c:62
        init_y = 8
        i = 9
        mix = 0x4aa0e0
#10 0x0040a1e6 in okcancel_cb (obj=0x4ab0a8, data=0x0)
    at pages/mixer_setup.c:520
No locals.
#11 0x0040626e in GUI_CheckTouch (coords=0x22ff20, long_press=0 '\000')
    at gui/gui.c:652
        button = 0x4aa480
        modalActive = 0 '\000'
        obj = 0x4ab0a8
#12 0x00401bca in event_loop (param=0x0) at main.c:116
        t = {x = 173, y = 15, z1 = 0, z2 = 0}
        last_buttons = 4294967295
        touch_down = 0 '\000'
        last_redraw = 3776632382
        i = 32
#13 0x00401ab4 in main () at main.c:66
No locals.
Warning: the current language does not match this frame.
(gdb)

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

More
12 Jun 2012 17:35 #393 by FDR
Replied by FDR on topic Re: GUI
Does it help, or should I provide some additional info?

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

More
12 Jun 2012 18:03 #394 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
It is what I was looking for. I need to go through it though to see if it is actually helpful.

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

More
12 Jun 2012 21:59 #396 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
The backtrace was interesting.
It shows that the code was unable to find the file "images/btn48_16.bmp" which shouldn't happen.
In any case, it tried to just draw a black rectangle, but the requested size was > a 16bit value which caused an overflow that hung the system.

I've committed a fix for that specific issue, but it doesn't explain the underlying problem. Please build the latest code and see what happens now. If you see a similar crash or hang, you can send another gdb trace.

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

More
13 Jun 2012 05:02 #397 by FDR
Replied by FDR on topic Re: GUI
Yes it hangs again at the same time, but with a bit different screen contents...
(gdb) r
Starting program: C:\MinGW\msys\1.0\home\FDR\src\deviation\src\emu_devo8.exe
[New Thread 6208.0x1e78]

Program received signal SIGSEGV, Segmentation fault.
0x004109a1 in XRectangleRegion(int, int, int, int) ()
(gdb) bt full
#0  0x004109a1 in XRectangleRegion(int, int, int, int) ()
No symbol table info available.
#1  0x00410be0 in Fl_Widget::damage(unsigned char, int, int, int, int) ()
No symbol table info available.
#2  0x00410d68 in Fl_Widget::redraw() ()
No symbol table info available.
#3  0x0040b8d6 in LCD_DrawStop () at target/emu_devo8/fltk.cpp:286
No locals.
#4  0x00403b62 in LCD_FillRect (x=10, y=164, w=300, h=112, color=0)
    at screen/qvga/lcd_gfx.c:242
        bytes = 4294967295
#5  0x00404583 in LCD_DrawWindowedImageFromFile (x=10, y=164,
    file=0x454d9c "images/btn48_16.bmp", w=300, h=112, x_off=0, y_off=0)
    at screen/qvga/lcd_gfx.c:417
        i = 64
        j = 19651
        fh = 0x0
        transparent = 0 '\000'
        row_has_transparency = 0 '\000'
        buf = "\000\000đ\000\000\000\000\000\000\000óý\037w\241ţ\037wÜú\"", '\00
0' <repeats 15 times>, "\"\000đ\000w@\001\"\000\000\000$w\000\000OQţ\377\377\377
aţ\037wŤ\001 w\000\000\000\000\030÷@\000ş\003u\000\001\002\000\000\001\000\000\0
00°\000\020\000Â\005 w\201\005 wDYJ", '\000' <repeats 13 times>, "\001\000\000\0
00\230ľu\000Ěöý\177Xţ\"\000\bű\"\000M\005 wDYJ\000\000\000\000\000\000\000\000\0
00&e\031wÄpý\177\000đý\177", '\000' <repeats 12 times>, "đ\000\000\000(ű\"\000a\
177\031w\002", '\000' <repeats 11 times>, "&e\031wÄpý\177\000đý\177", '\000' <re
peats 12 times>...
        img_w = 101
        img_h = 4213981
        offset = 0
        compression = 2293016
#6  0x004058fb in GUI_DrawObject (obj=0x4ab2a0) at gui/gui.c:356
        button = 0x4aa5a0
        box = 0x4ab2a4
#7  0x00405b9b in GUI_DrawObjects () at gui/gui.c:417
        obj = 0x4ab2a0
#8  0x00405fba in GUI_DrawScreen () at gui/gui.c:568
No locals.
#9  0x0040845d in PAGE_MixerInit (page=0) at pages/mixer_page.c:62
        init_y = 8
        i = 9
        mix = 0x4aa0e0
#10 0x0040a1c2 in okcancel_cb (obj=0x4ab0a8, data=0x0)
    at pages/mixer_setup.c:520
No locals.
#11 0x0040624a in GUI_CheckTouch (coords=0x22fef0, long_press=0 '\000')
    at gui/gui.c:652
        button = 0x4aa480
        modalActive = 0 '\000'
        obj = 0x4ab0a8
#12 0x00401bca in event_loop (param=0x0) at main.c:116
        t = {x = 176, y = 16, z1 = 0, z2 = 0}
        last_buttons = 4294967295
        touch_down = 0 '\000'
        last_redraw = 3828653932
        i = 32
#13 0x00401ab4 in main () at main.c:66
No locals.
Warning: the current language does not match this frame.
(gdb)

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

More
13 Jun 2012 13:18 #398 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
Ok, I finally figured out what was going on and was able to fix it. There was a file-handle leak which was resulting in too many files being open at once. That caused it to appear that one of the images wasn't present which triggered a different bug which resulted in the crash.

By the way, how did you kill the app such that you could get back to gdb? I tried it in windows, and gdb does not work as it does in Linux. I was unable to get back to gdb after triggering the hang.

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

More
13 Jun 2012 13:25 - 13 Jun 2012 13:26 #399 by FDR
Replied by FDR on topic Re: GUI
Great!

Well, I went one step further the first symptom of hanging (clicked on the already not visible button again), and then it crashed even more (while still visible) and returned to the prompt.
Then it wrote the "Program received signal SIGSEGV, Segmentation fault." message. You can see it in the output I gave.

P.S.: How do you like the modded design and larger editing font?
(You have to refresh to see it...)
Last edit: 13 Jun 2012 13:26 by FDR.

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

More
13 Jun 2012 13:29 #400 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
I didn't/don't notice a design change, but I do appreciate the larger editing font.

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

More
13 Jun 2012 13:39 #401 by FDR
Replied by FDR on topic Re: GUI
Well, there is not too much:
- the header image (deviation) background is now across the whole header;
- the link and heading colors of the portal now match the forum engine, i.e. blue;
- larger editing font in the forum message edit window.

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

More
27 Jun 2012 08:31 #423 by FDR
Replied by FDR on topic Re: GUI
Tried to compile, got his:
$ make TARGET=emu_devo8 WINDOWS=1
 + Compiling 'target/emu_devo8/channels.c'
 + Compiling 'target/emu_devo8/stubs.c'
 + Compiling 'target/emu_devo8/tx.c'
 + Compiling 'curves.c'
 + Compiling 'main.c'
 + Compiling 'misc.c'
 + Compiling 'mixer.c'
 + Compiling 'radio.c'
 + Compiling 'screen/qvga/lcd_calibrate.c'
 + Compiling 'screen/qvga/lcd_gfx.c'
 + Compiling 'screen/qvga/lcd_string.c'
 + Compiling 'gui/gui.c'
 + Compiling 'pages/chantest_page.c'
 + Compiling 'pages/main_page.c'
 + Compiling 'pages/mixer_curves.c'
 + Compiling 'pages/mixer_limits.c'
 + Compiling 'pages/mixer_page.c'
 + Compiling 'pages/mixer_setup.c'
 + Compiling 'pages/pages.c'
 + Compiling 'pages/scanner_page.c'
 + Compiling 'pages/test_page.c'
 + Compiling 'pages/trim_page.c'
 + Compiling 'pages/usb_page.c'
 + Compiling 'protocol/devo.c'
 + Compiling 'protocol/flysky_a7105.c'
 + Compiling 'protocol/protocol.c'
 + Compiling 'target/emu_devo8/fltk.cpp'
target/emu_devo8/fltk.cpp: In function 'void CLOCK_StartTimer(u16, void (*)())':

target/emu_devo8/fltk.cpp:392:47: error: declaration of C function 'void CLOCK_S
tartTimer(u16, void (*)())' conflicts with
./target.h:101:6: error: previous declaration 'void CLOCK_StartTimer(u16, u16 (*
)())' here
target/emu_devo8/fltk.cpp: In function 'void CLOCK_StartTimer(u16, void (*)())':

target/emu_devo8/fltk.cpp:398:22: error: invalid conversion from 'void (*)()' to
 'u16 (*)() {aka short unsigned int (*)()}' [-fpermissive]
make: *** [objs/emu_devo8-w32/fltk.o] Error 1

By the way: how can I switch now to the config and mixer screens?

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

More
27 Jun 2012 13:01 #425 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
Thanks, it should be fixed now.
I have been implementing the interrupt code that controls the radio. I need the code to work in the emulator so I can verify that the code sequences are correct. Unfortunately the code I use in Linux doesn't work in Windows, so now I need to compile 3 times: linux, windows, devo8. It is getting more challenging to keep the compile clean everywhere.

As you noticed, I changed the keys again. the new keys match the devo8 buttons. So now you use left/right/up/down/enter/escape to control everything

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

Time to create page: 0.101 seconds
Powered by Kunena Forum