CHDK PTP interface - page 8 - General Discussion and Assistance - CHDK Forum

CHDK PTP interface

  • 1241 Replies
  • 491353 Views
*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: CHDK PTP interface
« Reply #70 on: 01 / November / 2009, 16:45:51 »
Advertisements
set_levent_script_mode() is only half the solution. The other half is set_levent_active("ModeDailTo...",false) on all the mode dial position events *except* the one you want to use, and  set_levent_active("ModeDailToMovie",true)

Ah, of course. I put that stuff in a library so that I wouldn't need to paste it to the PTP interface and it now works fine:

Code: [Select]
set_levent_script_mode(true)
set_mode_exclusive(modename)
post_levent_to_ui(modename)
sleep(ModeSwDelay)
set_levent_script_mode(false)

ModeSwDelay above is necessary, otherwise mode will bounce right back to the original dialmode position (even if previously overrided mode was something else) just like it did without set_mode_exlusive(). The delay required is probably fairly equal to the length of mode switching animations that happen on screen. In my short experiments 400 ms was sometimes not enough and 500 ms was always enough (I'd probably use no less than 1000 ms unless it's critical to optimize this... and usually it isn't since you probably don't have to exit levent_script_mode until the end of your Lua script).

*

Offline reyalp

  • ******
  • 14082
Re: CHDK PTP interface
« Reply #71 on: 01 / November / 2009, 17:19:38 »
FWIW, as far as I can tell, there's no particular need to turn off script mode. You probably want to turn it off before you return to manual operation, but I haven't noticed any problems just turning it on at the start of the script and off at the end.
Don't forget what the H stands for.

*

Offline ADamb

  • **
  • 65
  • sx200is
Re: CHDK PTP interface
« Reply #72 on: 02 / November / 2009, 14:53:49 »
src&bin for Win, a710 and sx10 1.01a (pre-alpha) here - http://ewavr.nm.ru/chdk/for_test/
Support for sx200is 100c, wrong aspect for overlay...
SX200 IS-100C

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: CHDK PTP interface
« Reply #73 on: 02 / November / 2009, 16:26:20 »
Support for sx200is 100c, wrong aspect for overlay...

Ok, I found in gui_draw.c this comment for SX200:

>we have a 720x240 efective memory buffer (in a 960x270 physical memory buffer)

and try to make corrections in my code tomorrow.


*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: CHDK PTP interface
« Reply #74 on: 03 / November / 2009, 07:31:42 »
and try to make corrections in my code tomorrow.
Done. But I can't test how it works on SX200 :).

Re: CHDK PTP interface
« Reply #75 on: 03 / November / 2009, 08:48:00 »
>we have a 720x240 efective memory buffer (in a 960x270 physical memory buffer)

Does that mean we have to write a pixel to the bitmap buffer twice in the 'x' direction to memory locations (y*960)+(x*2)  and (y*960)+(x*2)+1 ?

Is the size of the live viewport buffer 360x240x3  bytes ?


*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: CHDK PTP interface
« Reply #76 on: 03 / November / 2009, 09:32:19 »
Does that mean we have to write a pixel to the bitmap buffer twice in the 'x' direction to memory locations (y*960)+(x*2)  and (y*960)+(x*2)+1 ?
Maybe this question is for 'SX200 porting' thread. Maybe yes, but drawing functions for sx200 in dui_draw.c are not too easy to understang  :).
Quote
Is the size of the live viewport buffer 360x240x3  bytes ?
More precisely, 720*240*6/4 (in playback mode).
In record mode, actual image width and height depends on shooting mode and digital zoom value, buffer width always is 720.
« Last Edit: 03 / November / 2009, 09:33:53 by ewavr »

Re: CHDK PTP interface
« Reply #77 on: 03 / November / 2009, 09:40:02 »
drawing functions for sx200 in dui_draw.c are not too easy to understang  

No, I am not convinced they are correct.

Later this week I will try the procedure that I suggested.



*

Offline ADamb

  • **
  • 65
  • sx200is
Re: CHDK PTP interface
« Reply #78 on: 03 / November / 2009, 14:30:57 »
@ewavr
Thanks for your work, but there is no improvement...
Tried to patch source, but ptp.c is missing in your patch.
Binary version gave this (the same picture as previous).
SX200 IS-100C

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: CHDK PTP interface
« Reply #79 on: 03 / November / 2009, 16:08:16 »
Tried to patch source, but ptp.c is missing in your patch.

Oops! I also missed this file :(.
Could you upload ptp.c from my previous patch?

Quote
but there is no improvement...
It seems this was error in PC client program. Corrected now.

 

Related Topics