GUI

More
29 Apr 2012 22:43 #94 by MatCat
Replied by MatCat on topic Re: GUI
I can tell you this much... it's a memory leak going to swap... I just installed a task manager and python is using 16777216tb of VM space and nearly 300 megs of ram... NO CPU

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

More
29 Apr 2012 22:55 - 29 Apr 2012 23:01 #95 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
hmm.

Can you pull the latest code (hg pull -u) and give it a shot?
I changed to a double-buffering scheme. It seems to mess with the mouse, but behaves better on my machines.

FYI, your binary works fine on my machine. I wonder if it has something to do with Gnome vs XFCE

I have no idea what is going on with your swap (or python which is probably unrelated to my code).

Edit: I have a feeling my fltk code is crap. I played some tricks to prevent having a separate drawing thread, and maybe it isn't very robust. If the current code also doesn't work, I'll rewrite the GUI in its own thread (or maybe just do it in gtk...I dunno)
Last edit: 29 Apr 2012 23:01 by PhracturedBlue.

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

More
29 Apr 2012 23:08 #96 by MatCat
Replied by MatCat on topic Re: GUI
Ok it seems to be working for me now after that pull.

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

More
29 Apr 2012 23:11 #97 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
Phew.
Note that the current code will use 100% CPU. That is expected because it is in an infinite loop at the moment. Something we'll likely need to fix in the GUI design.

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

More
29 Apr 2012 23:15 #98 by MatCat
Replied by MatCat on topic Re: GUI
I agree, now that it is working I am going to start experimenting with it... I noticed the analogs go from F005 to FFFF in 10 steps... Is that the real analog range? (I saw in code it is 10% steps)

We need to think about what we want in a GUI...

Is the fl library only good for the emu? Are we going to have to make GUI components from scratch for the firmware or are there libraries we can use?

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

More
30 Apr 2012 00:14 #99 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI

MatCat wrote: I agree, now that it is working I am going to start experimenting with it... I noticed the analogs go from F005 to FFFF in 10 steps... Is that the real analog range? (I saw in code it is 10% steps)

no. that is just because I inverted the value, which is wrong. The actual range is 12bits, but practically 0x1d0 - 0xdf0. The throttle has a 'low' value at max value, all others are as you expect (larger to the right/top).

We need to think about what we want in a GUI...

Is the fl library only good for the emu? Are we going to have to make GUI components from scratch for the firmware or are there libraries we can use?

We need to do everything from scratch. Fltk is just being used as the backend for the PC. The available routines are all in scren/qvga/ and at the moment they are only primitives. I've seen one GPLed GUI framework suitable for embedded applications, but honestly it was really ugly, and I'm pretty sure we don't need a windowing system.

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

More
30 Apr 2012 01:50 #100 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
FYI, I just checked in support for BMP images. When using the emulator, you can load 16bit BMP files There is also support for loading 'window' out of a bmp file. This allows you to store multiple images in a single file which reduces overhead of the filesystem and BMP header

The example just loads a BMP as the background image

I haven't yet got filesystem support working on the STM32, so for now, this is Emulator only, but hopefully I'll have the filesystem working on the Devo8 soon so the same code should work there as well.

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

More
30 Apr 2012 03:39 #101 by MatCat
Replied by MatCat on topic Re: GUI
IS there a resource I can look at to figure out the color coding used, it is not RGB because it is a 4 bit hex number...

I have been playing around with the source, sofar all I have done is make it draw a line up of circles, I tried: 0xf900+(i*20) to give a line of circles in a loop to go up in color, however it did not do what I expected, and instead only gives 3 colors in an alternating pattern... I can't printf to the console either to do some debugging :P.

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

More
30 Apr 2012 03:41 #102 by MatCat
Replied by MatCat on topic Re: GUI
Ahh just saw the post about bmp's. I am going to start working on routines for things like buttons and stuff then and make some rudimentry GUI to get us going.

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

More
30 Apr 2012 03:58 #103 by MatCat
Replied by MatCat on topic Re: GUI
BMP routine doesn't seem to be working...

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

More
30 Apr 2012 04:17 #104 by MatCat
Replied by MatCat on topic Re: GUI
I just did some debugging, it is failing on checking the bit depth, compression, and plane info.

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

More
30 Apr 2012 04:37 #105 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
I fixed the issue with the BMP code. I wasn't reading enough bytes, and just got lucky that they were all zeroed out when I examined them. It should be fine now.

As for the color code, it is rgb565.

so to convert to 24bit color:
    r = (color >> 8) & 0xf8;
    g = (color >> 3) & 0xfc;
    b = (color << 3) & 0xf8;

if you save BMP to 16bit, you will get rgb565, so you only care about this if you are using the primitive gfx functions.

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

More
30 Apr 2012 04:58 #106 by MatCat
Replied by MatCat on topic Re: GUI
IT's working but wrapping over a little... Can I get commit access?

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

More
30 Apr 2012 05:45 #107 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
I've added additional checking to ensure that the BMP is in rgb565
I also think I've fixed the wrapping issue.

I don't have any issues with printf. They work fine for me when I put them in.

Note that the font drawing currently has a hard-coded background color. The LCD doesn't have a convenient way to skip a pixel when drawing. I added support for transparent backgrounds on the fonts, but you need to repaint the background before changing any text if you use it, so it is disabled for now. Look in lcd_string.c for more info.

As for commit access, I'd rather start with you using your own repository and issuing pull requests. Mercurial, like Git is a distributed VCS, so there is no 'master' repository, just a bunch of peers. You can create an hg repository on bitbucket or wherever you like and publish your changes there, and I can pull them into my repository. Once I'm convinced we're on the same page, I'll provide commit access

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

More
30 Apr 2012 06:13 #108 by MatCat
Replied by MatCat on topic Re: GUI
Quite understandable.

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

More
30 Apr 2012 06:19 #109 by MatCat
Replied by MatCat on topic Re: GUI
Ok I have it here: bitbucket.org/MatCat/deviation/overview

Is there a way to get it to always pull changes from the master?

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

More
30 Apr 2012 09:06 #110 by MatCat
Replied by MatCat on topic Re: GUI
Why is the touch structure an 8 bit integer but every over coordinate 16 bit?

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

More
30 Apr 2012 11:01 #111 by MatCat
Replied by MatCat on topic Re: GUI
This site can be VERY SLOW at times...

I am working on putting together an event system with callbacks so there can be a true GUI api.

First I will do buttons since they are the easiest to implament.

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

More
30 Apr 2012 13:31 #112 by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
1) You need to make your repository public. It is an option under admin (un-select 'private'). Alternatively you need to invite me to see it, but better to just keep everything open

2) You can look at the instructions here to have a different 'pull' and 'push' path:
wiki.alliedmods.net/Mercurial_Tutorial

3) The LCD module produces either 8 or 12bit ADC data. I currently have it configured in 8-bit mode. We should definitely change the struct to be 16bits for coordinates (regardless of whether the values are 8 bit or not), but be aware that the values will not correspond to pixel location. We need to write a calibration and mapping routine to convert the raw data into pixels. This is something that will need to go into scren/qvga/lcd_calibration.c or something. It is on my to-do list, as I already found an open-source calibration routine (though it shouldn't be too hard to write one from scratch)

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

More
30 Apr 2012 18:22 #113 by MatCat
Replied by MatCat on topic Re: GUI
Ok got ya, I have my local system set to pull from your repo, and push to mine. It is also public now.

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

Time to create page: 0.108 seconds
Powered by Kunena Forum