@range set to 0..1 boolean shows as - General Discussion and Assistance - CHDK Forum

@range set to 0..1 boolean shows as

  • 15 Replies
  • 5097 Views
*

Offline dvip

  • ****
  • 451
@range set to 0..1 boolean shows as
« on: 29 / December / 2012, 14:02:07 »
Advertisements
I know that If @range is set to 0..1 the parameter is displayed in the script menu as a boolean on/off toggle. But from time to time the same script shows as [1] and you can even change the numbers.

Here is what I got in lua:

@param b = on/off
@default b 0
@range b 0 1

Other times the lua script loads and is displayed as a boolean [.]
Am I missing something?


*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: @range set to 0..1 boolean shows as
« Reply #1 on: 29 / December / 2012, 14:58:43 »
This is a little bug when you copied the same script again to the sd card, because you have edited the script.

Load another script and then reload the script with this problem. Now you can see the correct menu entry.

msl
CHDK-DE:  CHDK-DE links

*

Offline dvip

  • ****
  • 451
Re: @range set to 0..1 boolean shows as
« Reply #2 on: 29 / December / 2012, 15:07:21 »
Thanks, msl, for confirming this little bug.
It also occurs when you turn the camera off/on and try to use the same script.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: @range set to 0..1 boolean shows as
« Reply #3 on: 29 / December / 2012, 15:16:44 »
Check the saved param set file - it may not have the '@range' info saved if the parameter type was changed at some point.

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: @range set to 0..1 boolean shows as
« Reply #4 on: 29 / December / 2012, 15:17:51 »
I've seen it too but can't narrow it down to anything in particular  (i.e. I don't think it just happens when I copy a new version of the script to the SD card).

First reported here :  http://chdk.setepontos.com/index.php?topic=8151.msg93753#msg93753 in the UI 2.0 thread.

Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline dvip

  • ****
  • 451
Re: @range set to 0..1 boolean shows as
« Reply #5 on: 29 / December / 2012, 15:31:56 »
>Check the saved param set file

@Phil, I just checked that with: Save param[.]
It doesn't make a difference, the bug is still there.
If I load another script and then load the buggy script again it shows as boolean [.] again.
It may be a problem with the interface or data interpretation in the script menu.


*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: @range set to 0..1 boolean shows as
« Reply #6 on: 29 / December / 2012, 15:44:06 »
The saving of the script parameters has no influence. The main reason is a new copy of a script.

Try a simple script with @range or @values. Load this script and all script menu entries are ok. Now edit this script (not the script header) and copy the script to the sd card. Open the script menu and you loose the boolean & values menu entries.

msl
« Last Edit: 29 / December / 2012, 15:46:38 by msl »
CHDK-DE:  CHDK-DE links

Re: @range set to 0..1 boolean shows as
« Reply #7 on: 29 / December / 2012, 15:47:52 »
The saving of the script parameters has no influence. The main reason is a new copy of a script.
This is consistent with what I reported on the thread I linked above.   I also  looked at the saved parameters file on the SD card but could not see anything wrong there.

Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: @range set to 0..1 boolean shows as
« Reply #8 on: 29 / December / 2012, 16:14:43 »
>Check the saved param set file

@Phil, I just checked that with: Save param[.]
It doesn't make a difference, the bug is still there.
If I load another script and then load the buggy script again it shows as boolean [.] again.
It may be a problem with the interface or data interpretation in the script menu.



Can you zip up and post the script and any files in the CHDK/DATA directory that begin with the script file name (there should be a .cfg file and one or more _0, _1, _2 etc files).

Also let me know which CHDK version.

Thanks,
Phil.
« Last Edit: 29 / December / 2012, 16:17:48 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)

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: @range set to 0..1 boolean shows as
« Reply #9 on: 29 / December / 2012, 16:46:37 »
@Phil
I noticed the error at the editing of twilight.lua. Saving script parameters was off. Tested with your 'philmoz-reorg' branch and trunk 1.2 (another script version with a lualib for cordic).

msl

CHDK-DE:  CHDK-DE links

 

Related Topics


SimplePortal © 2008-2014, SimplePortal