Adding new cameras, applying patches into trunk (with source code prepared) - page 50 - General Discussion and Assistance - CHDK Forum supplierdeeply

Adding new cameras, applying patches into trunk (with source code prepared)

  • 1654 Replies
  • 580880 Views
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #490 on: 26 / October / 2011, 19:19:42 »
Advertisements
Correction to English .lng file to match a default menu value in the embedded in core files.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline philmoz

  • *****
  • 3320
    • Photos
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #491 on: 27 / October / 2011, 03:35:26 »
Correction to English .lng file to match a default menu value in the embedded in core files.


Added in changeset 1388.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #492 on: 01 / November / 2011, 04:55:07 »
1) Language library optimization. It save 2.5kb of chdk size always and about 15kb of heap if no language file loaded.
Second attachment contain simple tool (source and executable) to convert gui_lang.c and/or apply to it any .lng file (to avoid load .lng file and so extend saving to native language).

2) Also small fix done in russian.lng

Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #493 on: 02 / November / 2011, 21:10:21 »
Patch for G10,  G11 & G12 - all firmware versions -  that enables the adjustable ALT button option.  ALT button can be changed from the default PRINT button to the AE_Lock/Microphone,  DISP or Jump/Metering button.

Tested on the G10. Should work on G11 as is.  Code change on G12 probably warrants a little testing (philmoz?).



Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline philmoz

  • *****
  • 3320
    • Photos
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #494 on: 02 / November / 2011, 21:36:29 »
Patch for G10,  G11 & G12 - all firmware versions -  that enables the adjustable ALT button option.  ALT button can be changed from the default PRINT button to the AE_Lock/Microphone,  DISP or Jump/Metering button.

Tested on the G10. Should work on G11 as is.  Code change on G12 probably warrants a little testing (philmoz?).


I'll test and submit it tonight.

One suggestion - the 'alt_mode_key_mask' variable is not needed and the 'kbd_set_alt_mode_key_mask' function can actually be empty.
The variable is set; but never used, on any of these cameras.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #495 on: 02 / November / 2011, 22:23:45 »
One suggestion - the 'alt_mode_key_mask' variable is not needed and the 'kbd_set_alt_mode_key_mask' function can actually be empty.
The variable is set; but never used, on any of these cameras.
Yup - a few minutes of clicking with grepWin now tells me the same thing. Not sure I want to go cleanup the 44 files that reference it though.  Maybe when I get the rest of kdb.c straighened out,  I'll add the changes at the same time ?

Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline philmoz

  • *****
  • 3320
    • Photos
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #496 on: 03 / November / 2011, 03:04:36 »
Patch for G10,  G11 & G12 - all firmware versions -  that enables the adjustable ALT button option.  ALT button can be changed from the default PRINT button to the AE_Lock/Microphone,  DISP or Jump/Metering button.

Tested on the G10. Should work on G11 as is.  Code change on G12 probably warrants a little testing (philmoz?).


Added in changeset 1392.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline philmoz

  • *****
  • 3320
    • Photos
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #497 on: 03 / November / 2011, 04:15:04 »
1) Language library optimization. It save 2.5kb of chdk size always and about 15kb of heap if no language file loaded.
Second attachment contain simple tool (source and executable) to convert gui_lang.c and/or apply to it any .lng file (to avoid load .lng file and so extend saving to native language).

2) Also small fix done in russian.lng

Added in changeset 1393.

I have changed the layout slightly to keep the string numbers at the start of each line in gui_lang.c
This better matches the layout in the .lng files.
I also added some comments for anyone updating the language strings in the future.

Generating a custom 'gui_lang_default' variable from a .lng file is a nice idea.
It would be good if this were integrated into the build as an option. It might be easier to do if 'gui_lang_default' were moved to a .h file that was included in gui_lang.c. The convertor program would then only need to re-build the .h file instead of the entire gui_lang.c file.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)


Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #498 on: 04 / November / 2011, 05:02:52 »
Its even better.
I also would like to integrate language choice to building process, but I don't know how. I do prepare all required components and ask you to integrate them into ChdkShell.

I see one more benefit of this: now developer shouldn't care about consistency build-in language list with english.lng. String list in header file will be created automatically even for english language.
But I propose to keep this new .h file (though it will be created automatically on build) in repository for non-windows hosted developers and for autobuild-server.

Below are two files:
* patch.zip - consist patch (separate strings to different .h file, add missed strings to english.lng )
* make_gui_lang.zip - consist source and compiled executable of convertor, which make strings header file for any language

How to use this convertor:
make_gui_lang.exe path_to_english.lng [path_to_secondary.lng] > path_to_trunk/core/gui_lang_str.h

Please fill free to change remarks in gui_lang.c, because english is not my strongest point.

*

Offline philmoz

  • *****
  • 3320
    • Photos
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #499 on: 04 / November / 2011, 05:23:38 »
Its even better.
I also would like to integrate language choice to building process, but I don't know how. I do prepare all required components and ask you to integrate them into ChdkShell.

I see one more benefit of this: now developer shouldn't care about consistency build-in language list with english.lng. String list in header file will be created automatically even for english language.
But I propose to keep this new .h file (though it will be created automatically on build) in repository for non-windows hosted developers and for autobuild-server.

Below are two files:
* patch.zip - consist patch (separate strings to different .h file, add missed strings to english.lng )
* make_gui_lang.zip - consist source and compiled executable of convertor, which make strings header file for any language

How to use this convertor:
make_gui_lang.exe path_to_english.lng [path_to_secondary.lng] > path_to_trunk/core/gui_lang_str.h

Please fill free to change remarks in gui_lang.c, because english is not my strongest point.

First step is that the 'make_gui_lang' program used to generate the .h file needs to be compilable using GCC.
Look at the current programs and Makefile in the Tools directory.
I tried compiling your program with GCC; but it failed.
All of the current tools are C not C++, so the makefile rules may also need to be adjusted.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

 

Related Topics