My modifications to CHDK - page 3 - General Discussion and Assistance - CHDK Forum  

My modifications to CHDK

  • 28 Replies
  • 16146 Views
*

Offline cyril42e

  • ***
  • 111
  • SD1000/Ixus70 1.02a
    • CR-TEKnologies
Re: My modifications to CHDK
« Reply #20 on: 29 / June / 2008, 14:32:45 »
Advertisements
Tried to add tweak 11 (with sets), didn't quite succeed yet (cam doesn't start properly). :I
Maybe I'll try again some other day.

Arf, I'll do it again directly on the latest SVN, see if I forgot something in my "manual" diff, and provide a true diff.

*

Offline cyril42e

  • ***
  • 111
  • SD1000/Ixus70 1.02a
    • CR-TEKnologies
Re: My modifications to CHDK
« Reply #21 on: 29 / June / 2008, 19:21:35 »
Ok, it was just a stupid programmation error. I was using strrchr(fn, '/')+1, so when '/' was not found, strrchr was returning NULL, and I was playing with address 1. When the camera starts the function was called with empty string => buffer overflow sometimes when the resulting string is too long, as I wasn't taking any precaution. So now it's fixed, and I took precautions. Should be ok. I attached the svn-diff (I'm learning...) against juciphox-427 (I also included the script-title menu modification).

Sorry for this...

*

Offline Jucifer

  • *****
  • 251
  • [A710IS]
Re: My modifications to CHDK
« Reply #22 on: 30 / June / 2008, 01:30:46 »
How about doing save_params_values() (if necessary) when changing sets? (Does the necessity really have to be checked?)

*

Offline cyril42e

  • ***
  • 111
  • SD1000/Ixus70 1.02a
    • CR-TEKnologies
Re: My modifications to CHDK
« Reply #23 on: 30 / June / 2008, 05:55:30 »
How about doing save_params_values() (if necessary) when changing sets? (Does the necessity really have to be checked?)

Well, I was trying to limit writing to card, so I didn't want save each time a param is changed. But I missed the "when changing set", you're right. If we raise a flag when the params have changed and only write to the card when the params have changed, it won't write a lot more to the card, and will probably be more intuitive. Good point Jucipher, it's better like that :).

New diff attached. I also save params when a new script is loaded, so there shouldn't be any surprise anymore about whether it saves or not, it always saves :) (except if the camera is shutdown when a param was just modified and the script menu still open, but that's because CHDK doesn't save the values to its config file in this case).


*

Offline Jucifer

  • *****
  • 251
  • [A710IS]
Re: My modifications to CHDK
« Reply #24 on: 30 / June / 2008, 06:30:14 »
(Still at least) one little thing:
maybe the set should also be saved after loading default param values.

Now, if you
- switch to a set
- change a param to non-default value
- load default param values
- switch to another set
- and back to the first set,
the param doesn't have the default value

*

Offline cyril42e

  • ***
  • 111
  • SD1000/Ixus70 1.02a
    • CR-TEKnologies
Re: My modifications to CHDK
« Reply #25 on: 30 / June / 2008, 07:47:56 »
Yes, I missed that. That's because when default params are loaded, there is no difference with... what was loaded, so it thinks that params have not changed. Fixed.

*

Offline Velo

  • *
  • 30
Re: My modifications to CHDK
« Reply #26 on: 03 / July / 2008, 13:26:35 »
Oh, concerning the mess in scripts, I had another idea: being able to call scripts from inside scripts. Something like:
script <scriptname> [param1] [param2] ...
Some work to do to save the context (maybe allowing only one degree of inclusion), but it would be more readable and reliable than including them manually, having to change variable names, and propagate changes etc...

Do you know about my Lua patch? There you can define functions in different files and call then after you require'd the file. For require'd files there is also no file size limit of 8 kb. Only for the main file.


*

Offline cyril42e

  • ***
  • 111
  • SD1000/Ixus70 1.02a
    • CR-TEKnologies
Re: My modifications to CHDK
« Reply #27 on: 03 / July / 2008, 13:59:16 »
Do you know about my Lua patch? There you can define functions in different files and call then after you require'd the file. For require'd files there is also no file size limit of 8 kb. Only for the main file.
Yes I heard about it, but haven't tried yet... But this feature is an excellent point in favor of Lua, I will try it soon!


*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: My modifications to CHDK
« Reply #28 on: 16 / August / 2008, 16:01:33 »
heya cyril42e, wrote a lil something about your 12th feature here.

just wanted to ask you if you can examine your save params and save sets (ubasic and lua?) functions in order to find some bugs. we have a few user reports that came in claiming that using your feature fubared the cfg file (thus people had to delete it because chdk was behaving mad after a restart, which is understandable if the cfg is fuxxored) - which is why i integrated a switch to enable/disable this feature (as a workaround). maybe you can have a look into this otherwise great feature. seems to happen in big scripts which use a lot of params for example.

thanks in advance, PhoX

 

Related Topics