PB, request for code review and merge back(2)

More
29 Oct 2012 16:12 #2468 by suvsuv
PB, all existing mixer pages are ported to devo10, and I would like you to take some time to review the codes and decide whether they could be merge to your repo.
Change descriptions:
1. mixer_page, mixer_limit, mixer_setup, mixer_curves are separated into 2 sections: UI pages and callback methods. Both devo8 and devo10 share almost the same callback methods with different UI pages. The devo8 should work exactly the same as your current build. And the devo10's mixer configuration is almost the same as devo8's, except that the devo10's limits are saved in live
2. I introduced a logical view concept in devo10, which simplified the GUI page design a lot. Now we can draw at a time all UI objects in a view, whose size can be bigger than 128x64, and then scroll up/down the viewpoint to show required objects. I believe the devo8's LCD resolution is big enough, so this view logic is not added to devo8&6
3. Other misc changes: Add a flag in the model_template.ini to support traditional mixers in the future. Fix bugs in lcd_gfx.c and devo10's channels.c

The codes of my repo has been synced with your latest codes, and build successfully with all emu and devo targes without warnings

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

More
29 Oct 2012 16:37 #2469 by suvsuv
BTW, I start to port the configure page, however, it is named as calibrate_page.c/h, which is kind of misleading :( . I would rename it to tx_configure.c/h, are you fine with it?

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

More
29 Oct 2012 18:10 #2470 by PhracturedBlue
Replied by PhracturedBlue on topic PB, request for code review and merge back(2)
sure. That is just left over from when the only info on that page was the screen calibration stuff

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

More
30 Oct 2012 09:05 - 30 Oct 2012 09:05 #2484 by suvsuv
The porting of TX configure page is also done, please take time to do code review.
You can play with it from Main Menu -> Tx Conf -> Basic Config
The only issue is we don't have 12x12 Chinese fonts . I have 12x12 fonts for Simplified/Traditional Chinese, but it is in BMP format(from left to right, from top to bottom) and I have no idea how to convert to your format yet.


Attachments:
Last edit: 30 Oct 2012 09:05 by suvsuv.

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

More
30 Oct 2012 12:57 #2492 by PhracturedBlue
Replied by PhracturedBlue on topic PB, request for code review and merge back(2)
Awesome. I'll take a look.
If you want to provide the fonts, I can probably convert them (assuming they are in unicode)
I have not documented the font-format, very well, but it isn't very complicated. You can see lcd_string.c for some info.

basically, each font is comprised of the following. 16bit and 24bit values are stored little-endian:
  1. font-height (in pixels) (8bit)
  2. ranges of characters supported by this font. each range constists of a 16bit start and 16bit end value corresponding to a continuous range of unicode characters. There can be as many of these ranges as needed. They must be in ascending order
  3. 00 00 (ends the array)
  4. offset in file (from the beginning) where each character begins (24 bit). This table is defined to be #chars*3 + 3 bytes in size. The extra 3 bytes are because the table is ended by the total size of the file (1 pastthe last character)
  5. character data. the character data is defined as a bitfield, with each chunk representing a column in the font. the size of a chunk can be 1,2,3, or 4 bytes, and is defined as the minimum number of bytes that can hold 'font height' bits. This is fully documented in lcd_screen.c
I generally write the font in 2 stages:
1) write out a c-file corresponding to the font using convert_xglcd_to_font.pl. Because I'm using variable height fonts, I use this script to generate directories (each for a specific font size) containing each individual character. I then use the merge_font.pl script to create a single directory with constant-height fonts, and then convert_xglcd_to_font.pl again to build the final combined fint (as a 'c' file). These c files are in the format we used for builtin fonts originally.

2) use convert_c_fonts.c to convert the c.file into a compiled font.

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

More
30 Oct 2012 13:08 #2494 by suvsuv
Please check out attach zip files, The fonts are stored in 2 C-arrays' files.
Attachments:

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

More
30 Oct 2012 15:48 #2501 by suvsuv
More to come, the model configue items are also done, please take time to review my lastest codes, sorry to bring so many codes for you ;)



Attachments:

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

More
30 Oct 2012 17:09 #2507 by PhracturedBlue
Replied by PhracturedBlue on topic PB, request for code review and merge back(2)

suvsuv wrote: Please check out attach zip files, The fonts are stored in 2 C-arrays' files.

Do you know anything about these fonts? The numbers don't make much sense to me. They don't seem to be in any codepage I recognize, nor are they in unicode.
For instance, there is a character defined as '8152', but this does not appear to be the unicode index of the character. Most of the characters in the list appear to be using decimal indexes, but then there are some like 'a1af' that seem to be hexadecimal

I found a package 'HZK12_HZK16_for_ucgu' which seems to be a superset of what you have above, but I don't have the password to unpack the zip file.

regardless, since I can't read Chinese, I have no hope of translating this data into a usable font at the moment.

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

More
31 Oct 2012 01:42 #2516 by PhracturedBlue
Replied by PhracturedBlue on topic PB, request for code review and merge back(2)
Ok, I've written a font converter to convert bdf bitmap fonts to deviation's format. here is a 12pixel font with English and (most?) CJK characters. I don't like serif fonts, and it is missing a bunch of European and Cyrillic characters, but if you want to test a 12px font, it is a starting place.

I'll work to fill out the font, and replace the characters I don't like, and post an update in the future.
Attachments:

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

More
31 Oct 2012 03:07 - 31 Oct 2012 03:09 #2518 by suvsuv
just did a quicktest with the 12x12serif.fon, it works for both Simplified and Traditional Chinese with current 12px-height GUI pages. And Chinese symbols from the 12x12serif is much better than the current 12narrow font
Thanks PB for your quick response, I will stick to this font in Devo10's GUI page design




Attachments:
Last edit: 31 Oct 2012 03:09 by suvsuv.

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

More
31 Oct 2012 04:19 #2523 by PhracturedBlue
Replied by PhracturedBlue on topic PB, request for code review and merge back(2)
Glad it works. The worst-case language appears to be russian, as it is very verbose, and the characters are not very compact. We may need to splice a narrower font into the firefly font (which is what 12x12serif is) for the cyrillic characters.
I found I can use FontForge to generate BDF files, and then convert them directly into Deviation fonts, simplifying the process significantly.

FYI, It may be a few days before I start merging your code back...I'm in the middle of some telemetry work, and other stuff is keeping me busy.

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

More
31 Oct 2012 04:52 #2530 by suvsuv
No hurry, the code review and merge is just not high-priority issues. I now have more time to refactor the file-structure under the Pages folder
PB, Here is one question looking for your reply: currently in the pages folder, I name all common files with a prefix of "_" to store callback/logic codes (e.g. _mixer_setup.c ), and their corresponding GUI page codes are inside the page/$(SCREEN_SIZE) folder using their current name(e.g. mixer_setup.c). Should I name them reversely? It is just because in the GUI folder, common files has no prefix of "_"

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

More
31 Oct 2012 05:03 #2531 by PhracturedBlue
Replied by PhracturedBlue on topic PB, request for code review and merge back(2)
Well, the build system has a rule that says that no 2 c files can have the same name. Strictly speaking, if you #include them, this won't be an issue, but I'd prefer to avoid confusion.
For the GUI, the vast majority of code is in the 'gui' dir,with only small amounts in the screen dirs. For the pages it probablyisn't quite as cut and dry.
Here is a reasonable rule (I think):
If you are #including a c file from another c file, the included file should be prefixed with '_'
If you are not #including it, the files should not have '_' and should just be given unique names.

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

More
31 Oct 2012 05:21 #2532 by suvsuv
That makes sense, so my current naming for page files is ok

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

More
31 Oct 2012 18:07 #2547 by PhracturedBlue
Replied by PhracturedBlue on topic PB, request for code review and merge back(2)
I have checked in a bunch of telemetry updates that affect a bunch of different files. Please resync with the latest deviation code, and let me know when you are ready and I'll start going through your changes and merging them.

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

More
01 Nov 2012 10:46 - 01 Nov 2012 11:28 #2562 by suvsuv

PhracturedBlue wrote: I have checked in a bunch of telemetry updates that affect a bunch of different files. Please resync with the latest deviation code, and let me know when you are ready and I'll start going through your changes and merging them.

Already syncedwith your lastest codes. Please take time to do code review, and the merge got to be manually since most page files are separated into 2 parts for maximal method-sharing purpose.
Currently, 90% pages are done(page-files directly under the page folder are ported to devo10 already). I used the Mixer to setup model in real devo10, then flew with my Minicp, all works.
We are almost there :lol:
Last edit: 01 Nov 2012 11:28 by suvsuv.

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

More
01 Nov 2012 13:20 #2566 by sbstnp
What do you guys think about moving USB and Monitor to main menu? Currently I saw they are in TX Config.

And, currently there is a big black box placeholder on main screen, probably for model icon or aircraft type on Devo 10, what if this rectangle would hold telemetry data? We could have a small symbol for the aircraft type on the top status bar, or next to the model name, or even letters like H or P, or probably nothing at all, in the end everybody knows what model they loaded up.

Devo 10 + 4in1
Spektrum Dx9
FrSky Taranis + TBS Crossfire

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

More
01 Nov 2012 14:04 #2569 by suvsuv

sbstnp wrote: What do you guys think about moving USB and Monitor to main menu? Currently I saw they are in TX Config.

And, currently there is a big black box placeholder on main screen, probably for model icon or aircraft type on Devo 10, what if this rectangle would hold telemetry data? We could have a small symbol for the aircraft type on the top status bar, or next to the model name, or even letters like H or P, or probably nothing at all, in the end everybody knows what model they loaded up.

I agree above are good suggestions. Will do it after finishing all the porting jobs and integration testing with Devo10

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

More
01 Nov 2012 17:11 #2582 by sbstnp
by the way, any special build procedure for devo 10? I built a dfu earlier and after transferred to my devo10 it doesn't start, shows just a corrupted screen, so I returned to walkera's firmware.

what could cause this?

Devo 10 + 4in1
Spektrum Dx9
FrSky Taranis + TBS Crossfire

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

More
01 Nov 2012 17:43 #2584 by PhracturedBlue
Replied by PhracturedBlue on topic PB, request for code review and merge back(2)
I've started the merge process. It will take me some time to go through the 'pages' changes so I'll likely do those page-by-page, but I've merged all of the GUI and misc code already. Everything looked pretty good so I made very few changes so far.

It would be helpful if you change Eclipse to use spaces rather than tabs in the future. I keep needing to remember to remove all the tabs as I do the import.

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

Time to create page: 0.163 seconds
Powered by Kunena Forum