Zoom to focal length - page 2 - General Help and Assistance on using CHDK stable releases - CHDK Forum

Zoom to focal length

  • 20 Replies
  • 3696 Views
Re: Zoom to focal length
« Reply #10 on: 16 / March / 2023, 02:33:53 »
Advertisements
Here's a g7x 100d test build

Great.  I’ll provide feedback as soon as I can, but not for a couple of days.

Cheers

Garry

*

Offline Caefix

  • *****
  • 947
  • Sorry, busy deleting test shots...
Re: Zoom to focal length
« Reply #11 on: 16 / March / 2023, 12:40:07 »
I'm not sure if ubasic can support optional arguments.
:) static void md_detect_motion_statement() has opt.args.
Edit: This factor looks  :-X
Code: [Select]
  case TOKENIZER_GET_USB_POWER:
    accept(TOKENIZER_GET_USB_POWER);
int usbpwr = 0 ;
if (tokenizer_token() != TOKENIZER_CR &&
        tokenizer_token() != TOKENIZER_ELSE ) {
        usbpwr = expr();
    }
    r = get_usb_power(usbpwr);
    break;

::)
Code: [Select]
static short is_opt()
{
short t = tokenizer_token();
if (t == TOKENIZER_NUMBER
|| t == TOKENIZER_LEFTPAREN
|| t == TOKENIZER_VARIABLE)
{ return 1; }
return 0;
}
Quote
AFAIK it does not have a way to get efl.
:(
« Last Edit: 16 / March / 2023, 15:49:39 by Caefix »
All lifetime is a loan from eternity.

Re: Zoom to focal length
« Reply #12 on: 16 / March / 2023, 16:06:23 »
Removed ;-)
« Last Edit: 16 / March / 2023, 16:17:05 by pigeonhill »

Re: Zoom to focal length
« Reply #13 on: 16 / March / 2023, 16:19:23 »
@reyalp

Sorry about the post above, worked it out by looking at the LuaLib ;-)

Works great.

Many thanks for such a quick implemenation

I assume it will get in the next trunk update?

Cheers

Garry


Re: Zoom to focal length
« Reply #14 on: 16 / March / 2023, 16:45:23 »
@reyalp

Just reporting progress as my test script is crashing when I attempt to use half press to focus after zooming.

Here is the part of the script that is relevant:

Code: [Select]
function check_buttons_etc()
    wait_click(50) -- check for a button press
    do
        if is_key("set") and get_alt_mode() then
            finish = true
        elseif is_key("right") and get_alt_mode() then
            fl_state = fl_state + 1
            if fl_state > 1 then fl_state = 0 end
            if fl_state == 0 then
                zu.set_zoom_fl(45000*132/670)
            elseif fl_state == 1 then
                zu.set_zoom_fl(150000*132/670)
            end
        elseif is_key("shoot_half") then
            set_mf(0)
            press("shoot_half")
            sleep(2000)
            set_mf(1)
        end
    end
end

I can zoom between the two zoom states OK, but as soon as I try a focus the script crashes.

What sill thing am I doing? Or is it the new functions?

Cheers

Garry

*

Offline Caefix

  • *****
  • 947
  • Sorry, busy deleting test shots...
Re: Zoom to focal length
« Reply #15 on: 16 / March / 2023, 16:58:57 »
          ;)  missing release ("shoot_half") ?
All lifetime is a loan from eternity.

*

Online reyalp

  • ******
  • 14121
Re: Zoom to focal length
« Reply #16 on: 16 / March / 2023, 16:59:17 »
I can zoom between the two zoom states OK, but as soon as I try a focus the script crashes.
If the camera crashes, please post the romlog. If there is some other error, please describe it and post any error messages.

Quote
What sill thing am I doing? Or is it the new functions?
I'd be surprised if it was related to the new the new functions, they use the regular old set_zoom under the hood, how they arrived at the value shouldn't matter.

I'm not really clear what your script is trying to do, but using set_mf(1) inside half press seems suspect, and I would not expect that to work.

On cameras like g7x, if you want to enter MF starting at the auto focus distance, you could use the native functionality, by clicking left on the d pad when half press is held. Note I would *not* recommend using set_aflock inside half press.
Don't forget what the H stands for.

Re: Zoom to focal length
« Reply #17 on: 16 / March / 2023, 17:14:33 »
@Caefix I'm an idiot. Of course!!!! Thank you.

Back on track now and @reyalp thanks for the other pointers.
« Last Edit: 16 / March / 2023, 18:14:57 by pigeonhill »


Re: Zoom to focal length
« Reply #18 on: 17 / March / 2023, 12:29:14 »
@reyalp

I hope you don't mind me asking, but is there any chance you could throw a G5x 101d build my way.

I've finished my 617 in-camera pano simulator, ie using the G5x or G7x as as viewfinder for my 617 stitching FF camera, but only have the G7x build at the moment.

Cheers

Garry

*

Online reyalp

  • ******
  • 14121
Re: Zoom to focal length
« Reply #19 on: 17 / March / 2023, 13:18:31 »
I hope you don't mind me asking, but is there any chance you could throw a G5x 101d build my way.
I checked the changes in, will be available from the trunk autobuilds soon as build 6227
Don't forget what the H stands for.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal