- Posts: 268
- Forum
- News, Announcements and Feedback
- Feedback & Questions
- PB, request for code review and merge back(2)
PB, request for code review and merge back(2)
- suvsuv
- Topic Author
- Offline
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.
- suvsuv
- Topic Author
- Offline
- Posts: 268
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.
- suvsuv
- Topic Author
- Offline
- Posts: 268
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.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
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:
- font-height (in pixels) (8bit)
- 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
- 00 00 (ends the array)
- 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)
- 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
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.
- suvsuv
- Topic Author
- Offline
- Posts: 268
Please Log in or Create an account to join the conversation.
- suvsuv
- Topic Author
- Offline
- Posts: 268
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
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.suvsuv wrote: Please check out attach zip files, The fonts are stored in 2 C-arrays' files.
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.
- PhracturedBlue
- Offline
- Posts: 4402
I'll work to fill out the font, and replace the characters I don't like, and post an update in the future.
Please Log in or Create an account to join the conversation.
- suvsuv
- Topic Author
- Offline
- Posts: 268
Thanks PB for your quick response, I will stick to this font in Devo10's GUI page design
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
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.
- suvsuv
- Topic Author
- Offline
- Posts: 268
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.
- PhracturedBlue
- Offline
- Posts: 4402
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.
- suvsuv
- Topic Author
- Offline
- Posts: 268
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.
- suvsuv
- Topic Author
- Offline
- Posts: 268
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.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.
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
Please Log in or Create an account to join the conversation.
- sbstnp
- Offline
- Posts: 649
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
FrSky Taranis + TBS Crossfire
Please Log in or Create an account to join the conversation.
- suvsuv
- Topic Author
- Offline
- Posts: 268
I agree above are good suggestions. Will do it after finishing all the porting jobs and integration testing with Devo10sbstnp 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.
Please Log in or Create an account to join the conversation.
- sbstnp
- Offline
- Posts: 649
what could cause this?
Devo 10 + 4in1
FrSky Taranis + TBS Crossfire
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
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.
- Forum
- News, Announcements and Feedback
- Feedback & Questions
- PB, request for code review and merge back(2)
- Home
- Forum
- News, Announcements and Feedback
- Feedback & Questions
- PB, request for code review and merge back(2)