Suggestion for CHDK configuration file saving. - page 3 - General Discussion and Assistance - CHDK Forum

Suggestion for CHDK configuration file saving.

  • 38 Replies
  • 20540 Views
*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Suggestion for CHDK configuration file saving.
« Reply #20 on: 09 / August / 2013, 23:08:40 »
Advertisements
Final patch before I commit this to SVN.

This version now only saves config files if there is an actual change to values in the file - instead of updating all the files every time. It saves a bit of memory as well since it no longer needs a complete copy of the entire 'conf' structure.

There is a chance I may have the logic wrong so please test and make sure config files are being updated correctly.

Phil.

Edit: Patch updated to fix EOL issues with some files (make sure to get latest from SVN first). Also fixes issue when loading old CCHDK3.CFG file not always saving all new config files.
« Last Edit: 12 / August / 2013, 04:23:34 by philmoz »
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: Suggestion for CHDK configuration file saving.
« Reply #21 on: 10 / August / 2013, 12:00:55 »
Final patch before I commit this to SVN.

This version now only saves config files if there is an actual change to values in the file - instead of updating all the files every time. It saves a bit of memory as well since it no longer needs a complete copy of the entire 'conf' structure.

There is a chance I may have the logic wrong so please test and make sure config files are being updated correctly.

Patch file does not apply cleanly to the latest 1.3.0 svn version - reject files looks like this :
Code: [Select]
--- modules/user_menu_edit.c    (revision 3017)
+++ modules/user_menu_edit.c    (working copy)
@@ -813,7 +813,7 @@

 int _module_unload()
 {
-    conf_save_new_settings_if_changed();
+    conf_save();
     return 0;
 }


so I edited user_menu_edit.c to this

Code: [Select]
int _module_unload()
{
    conf_save();
    return 0;
}

That must have been wrong - the user menu editor now "hangs" up with just the menu title line visible - unresponsive to key presses.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Suggestion for CHDK configuration file saving.
« Reply #22 on: 10 / August / 2013, 19:01:35 »
Final patch before I commit this to SVN.

This version now only saves config files if there is an actual change to values in the file - instead of updating all the files every time. It saves a bit of memory as well since it no longer needs a complete copy of the entire 'conf' structure.

There is a chance I may have the logic wrong so please test and make sure config files are being updated correctly.

Patch file does not apply cleanly to the latest 1.3.0 svn version - reject files looks like this :
Code: [Select]
--- modules/user_menu_edit.c    (revision 3017)
+++ modules/user_menu_edit.c    (working copy)
@@ -813,7 +813,7 @@

 int _module_unload()
 {
-    conf_save_new_settings_if_changed();
+    conf_save();
     return 0;
 }


so I edited user_menu_edit.c to this

Code: [Select]
int _module_unload()
{
    conf_save();
    return 0;
}

Don't know why the patch would fail there - it applies ok for me on a clean copy of trunk.
The change you made is correct though.

Quote
That must have been wrong - the user menu editor now "hangs" up with just the menu title line visible - unresponsive to key presses.

Not seeing this behaviour either.

Since the module_exportlist changed in this patch you need to do a clean build and copy all the updated module files.

It could also be a bad (or incompatible) UMENU4.CFG file from a previous patch version - try deleting CCHDK4.CFG, OSD__4.CFG and UMENU4.CFG from the card then restarting. This will then reload the previous CCHDK3.CFG config.

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: Suggestion for CHDK configuration file saving.
« Reply #23 on: 10 / August / 2013, 19:12:54 »
Don't know why the patch would fail there - it applies ok for me on a clean copy of trunk.
The change you made is correct though.
Tried again :   
svn -R revert chdk   (where the 1.3.0 trunk is in the chdk directory)
svn up chdk

still get the same error.  The greek.lng file also fails to patch - forgot to mention that before.

patch also doesn't like your patch file - but that's normal I've learned "(Stripping trailing CRs from patch.)"
Quote
It could also be a bad (or incompatible) UMENU4.CFG file from a previous patch version - try deleting CCHDK4.CFG, OSD__4.CFG and UMENU4.CFG from the card then restarting. This will then reload the previous CCHDK3.CFG config.
First time I've tried the patch file so there were no existing "4" files. The CCHDK4.CFG and OSD__4.CFG were created correctly.  The user menu editor error prevented a UMENU4.CFG from being created.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 14128
Re: Suggestion for CHDK configuration file saving.
« Reply #24 on: 11 / August / 2013, 23:53:07 »
Played around with this a bit. Mostly looks good.

One issue I noticed is that the "reset options to default" seems broken, the options get reset but not saved. At first I thought it was reloading my CCHDK3.CFG on reboot, but even after I deleted all my old cfgs it still doesn't work. Changing an item after resetting seems cause whatever file that setting is in to get updated correctly.
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Suggestion for CHDK configuration file saving.
« Reply #25 on: 12 / August / 2013, 04:24:59 »
Played around with this a bit. Mostly looks good.

One issue I noticed is that the "reset options to default" seems broken, the options get reset but not saved. At first I thought it was reloading my CCHDK3.CFG on reboot, but even after I deleted all my old cfgs it still doesn't work. Changing an item after resetting seems cause whatever file that setting is in to get updated correctly.

This patch should fix the options reset.

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: Suggestion for CHDK configuration file saving.
« Reply #26 on: 16 / August / 2013, 21:51:22 »
Rebuilt tonight with latest svn update.   Camera came up in "default" mode - old CCHDKx.CFG settings from yesterday gone.

No big deal - just thought I'd report it.

Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Suggestion for CHDK configuration file saving.
« Reply #27 on: 16 / August / 2013, 21:56:57 »
Rebuilt tonight with latest svn update.   Camera came up in "default" mode - old CCHDKx.CFG settings from yesterday gone.

No big deal - just thought I'd report it.

What config files were on the card, what files are there now?
If there was no CCHDK4.CFG it should have loaded CCHDK3.CFG and then created CCHDK4.CFG, UMENU4.CFG and OSD__4.CFG.

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: Suggestion for CHDK configuration file saving.
« Reply #28 on: 16 / August / 2013, 22:03:57 »
What config files were on the card, what files are there now?
If there was no CCHDK4.CFG it should have loaded CCHDK3.CFG and then created CCHDK4.CFG, UMENU4.CFG and OSD__4.CFG.
Screen shot - the cursor line is at the bottom - next down click goes back to the top.



Camera date is 08/16/2013.  No idea what was there before - sorry.  It would have been an svn snapshot from earlier this week.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Suggestion for CHDK configuration file saving.
« Reply #29 on: 16 / August / 2013, 22:15:50 »
What config files were on the card, what files are there now?
If there was no CCHDK4.CFG it should have loaded CCHDK3.CFG and then created CCHDK4.CFG, UMENU4.CFG and OSD__4.CFG.
Screen shot - the cursor line is at the bottom - next down click goes back to the top.



Camera date is 08/16/2013.  No idea what was there before - sorry.  It would have been an svn snapshot from earlier this week.

You probably had an old CCHDK4.CFG file (from patch testing) and no OSD__4.CFG - so it defaulted all the OSD settings.

If you delete the CCHDK4.CFG and OSD__4.CFG then reboot it should reload all your settings from CCHDK3.CFG.

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


SimplePortal © 2008-2014, SimplePortal