Propcase help - General Help and Assistance on using CHDK stable releases - CHDK Forum

Propcase help

  • 7 Replies
  • 2594 Views
Propcase help
« on: 01 / February / 2020, 04:13:46 »
Advertisements
@reyalp

I'm currently using get_prop(props.ISO_MODE) in my script, but can't seem to get
get_prop(props.TIMER_SHOTS) to work. I get a nil based error.

I've tried the above on my G5X and G1X.

As you can see, all I'm trying to do is access the Canon side number of custom shots that are set, and maybe even change them.

Any thoughts on the error of my ways ?
« Last Edit: 01 / February / 2020, 04:47:25 by pigeonhill »

Re: Propcase help
« Reply #1 on: 01 / February / 2020, 05:29:18 »
OK worked it out  ::)

That prop is not uncovered in propcase 4 version, despite it being a feature in the camera.

Need to check a few things  ;)
« Last Edit: 01 / February / 2020, 06:17:44 by pigeonhill »

Re: Propcase help
« Reply #2 on: 01 / February / 2020, 06:15:34 »
Need to add the following into propset4

Code: [Select]
TIMER_SHOTS=378,        -- Number of shots for TIMER_MODE=Custom
Confirmed to work on a G1X
« Last Edit: 01 / February / 2020, 06:36:08 by pigeonhill »

*

Offline reyalp

  • ******
  • 14126
Re: Propcase help
« Reply #3 on: 01 / February / 2020, 18:23:51 »
Need to add the following into propset4

Code: [Select]
TIMER_SHOTS=378,        -- Number of shots for TIMER_MODE=Custom
Confirmed to work on a G1X
Thanks. Added in autobuild 5413.

FWIW, regarding:
Note: you need to add the following into the lualib for propset4, as it is currently missing:
Code: [Select]
TIMER_SHOTS=378,        -- Number of shots for TIMER_MODE=Custom
A safe, portable way to deal with this kind of case is
Code: [Select]
if get_propset() == 4 and not props.TIMER_SHOTS then
 props.TIMER_SHOTS = 378
Don't forget what the H stands for.

Re: Propcase help
« Reply #4 on: 02 / February / 2020, 02:01:24 »
@reyalp

Great minds :-)

I've already added such a test in the latest version.

Re: Propcase help
« Reply #5 on: 02 / February / 2020, 02:58:10 »
@reyalp

I you do have a minute, maybe you could clarify a few things to do with propcase.

I believe although you can read the propcases, you may not be able to write to all of them.

The code I'm playing with looks like this:

Code: [Select]
if is_key("up") then
        local g = get_prop(props.TIMER_SHOTS)
        g = g + 1
        set_prop(props.TIMER_SHOTS,g)
    elseif is_key("down") then
        local g = get_prop(props.TIMER_SHOTS)
        g = g - 1
        set_prop(props.TIMER_SHOTS,g)
    end

That is I'm seeing if my script can change the customer timer. Which doesn't seem to work at the moment.

When I read about propcase usage, it's not clear if I use it as above or not, ie g = get_prop(props.TIMER_SHOTS) vs get_prop(props.TIMER_SHOTS,g), or set_prop(props.TIMER_SHOTS,g) vs set_prop(props.TIMER_SHOTS) = g

Also, if one is able to set a propcase and that propcase is outside the Canon range, I assume that is bad  :)


*

Offline reyalp

  • ******
  • 14126
Re: Propcase help
« Reply #6 on: 02 / February / 2020, 03:13:28 »
The syntax you have in the code snippet is correct for both get and set.

However, I think this propcase is read-only. Technically, you can usually set the value of propcases we call read-only, but it doesn't control whatever thing the value is associated with.

Quote
Also, if one is able to set a propcase and that propcase is outside the Canon range, I assume that is bad
Depends on the propcase. Some let you use values outside the normal range (shutter speed, for example) some do nothing, and some break something.
Don't forget what the H stands for.

Re: Propcase help
« Reply #7 on: 02 / February / 2020, 03:29:11 »
Cheers

 

Related Topics


SimplePortal © 2008-2014, SimplePortal