How to make menu settings persistent? - General Discussion and Assistance - CHDK Forum  

How to make menu settings persistent?

  • 3 Replies
  • 3642 Views
How to make menu settings persistent?
« on: 24 / September / 2017, 13:46:27 »
Advertisements
Hi,

I finally found some time to do some further investigations in CHDK development.
Today I wanted to try to create an additional menu inside CHDK Settings-->Remote Parameters.
I already could making a submenu with two subitems (of type MENUITEM_BOOL) working.
I can see and toggle the subitems using the 'set' button of my camera.
But if I switch off the camera and on again these values are always enabled.
So for some reason my settings are not persistent.

What I did:
1. Added the menu and two submenus in gui.c:
Code: [Select]

static CMenuItem test_submenu_items[] = {
   MENU_ITEM   (0x2c, LANG_MENU_TEST1_ENABLE, MENUITEM_BOOL,     &conf.test1_enable, 0),
   MENU_ITEM   (0x2c, LANG_MENU_TEST2_ENABLE, MENUITEM_BOOL,     &conf.test2_enable, 0),
   MENU_ITEM   (0x51, LANG_MENU_BACK,                    MENUITEM_UP,       0, 0),
   {0}
};

static CMenu test_submenu = {0x86, LANG_MENU_TEST_TITLE, test_submenu_items };
2. Added the two int values to struct 'Conf' inside conf.h
3. Added following to conf.c:
Code: [Select]
   
    CONF_INFO(300, conf.test1_enable,             CONF_DEF_VALUE, i:0),
    CONF_INFO(301, conf.test2_enable,             CONF_DEF_VALUE, i:0),
4. Appended values to gui_lang.h and english.lng for the menuitems text

I see inside conf.c that there are functions config_save and save_config_file. But it seems that they don't care for my additional menuitems.
I also found out that the seetings are stored in CCHDK4.CFG. I used the Java tool chdkcfg.jar (from I think Dave Mitchell? -->Thanks :-)) to make these values readable, but my values are not in that file.

May someone from the experienced guys here can tell me how to make my values persistent?

Thanks a lot...
« Last Edit: 24 / September / 2017, 13:50:08 by mr.burns »
2 x IXUS 860IS 100c
2 x Powershot S110 103a

*

Offline reyalp

  • ******
  • 14118
Re: How to make menu settings persistent?
« Reply #1 on: 24 / September / 2017, 14:47:37 »
May someone from the experienced guys here can tell me how to make my values persistent?
It's been a long time since I added a conf entry, I don't see anything obviously missing in your description.

Quote
But if I switch off the camera and on again these values are always enabled.
Possibly a silly question, but are you exiting the CHDK menu or alt before turning the camera off? Those are the points when the conf file is actually saved.
« Last Edit: 24 / September / 2017, 18:09:03 by reyalp »
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: How to make menu settings persistent?
« Reply #2 on: 24 / September / 2017, 17:29:44 »
3. Added following to conf.c:
Code: [Select]
   
    CONF_INFO(300, conf.test1_enable,             CONF_DEF_VALUE, i:0),
    CONF_INFO(301, conf.test2_enable,             CONF_DEF_VALUE, i:0),


Did you add these before the '{0,0,0,0{0})' entry that terminates list?
If you added them after they will be ignored.


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: How to make menu settings persistent?
« Reply #3 on: 25 / September / 2017, 13:38:49 »
Hi reyalp and philmoz,


the 'silly question' did the trick ;-)

I did not press 'alt' or 'menu' I just switched off the camera so no data have been saved.


Problem solved - thanks!
2 x IXUS 860IS 100c
2 x Powershot S110 103a


 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal