String lib! - page 2 - LUA Scripting - CHDK Forum  

String lib!

  • 17 Replies
  • 5595 Views
*

Offline reyalp

  • ******
  • 11900
Re: String lib!
« Reply #10 on: 01 / December / 2008, 22:28:17 »
Advertisements

In my webcam thingie from yesterday (http://chdk.setepontos.com/index.php/topic,2696.0.html) it seemed to me that post shoot() USB transmission started before the aperture was reset after shoot(), before jpeg file was written, and certainly before the aperture/display/sensor sounded their usual rec->play mode clicking sounds...
Yup, shoot() waits for the values used by get_shooting to go false, but this does not appear to be the end of the process.

i couldn't get the file created/modified date though.
Get it where ? Do you mean it's not set when when it is transferred from wifi ?
Don't forget what the H stands for.

Re: String lib!
« Reply #11 on: 01 / December / 2008, 22:53:42 »
calling os.stat(currentFile).ctime directly after shoot(). i never did try putting a sleep() command in there.

i wanted to get the creation date from the file because i wanted the time shutter was opened, not when it was closed (there's a difference with longer exposures) but if the file is saved after the full exposure then i guess it doesn't make a difference.

*

Offline reyalp

  • ******
  • 11900
Re: String lib!
« Reply #12 on: 02 / December / 2008, 00:17:17 »
If you use press "shoot_half" and "shoot_full" (like some of the other scripts do) you could get the time right before you do shoot_full, which will be within a small fraction of a second of the actual exposure time.

Stealing a bit from CarLapse - LUA Script for timelapse out of a driving car
Code: [Select]
  press("shoot_half")
  repeat
    sleep(1)
  until get_shooting() == true
  set_focus(subjdist)
-- reyalp added
  shot_time=os.time()   
  press("shoot_full")
  release("shoot_full")
  release("shoot_half")
  -- wait for shooting to finish
  repeat
    sleep(1)
  until get_shooting() ~= true
Don't forget what the H stands for.

Re: String lib!
« Reply #13 on: 02 / December / 2008, 00:24:26 »
out of curiosity - why??

also, i'm thinking about pitching the idea for a wiki reorg. there's a wealth of great information there but i keep getting lost. (am i the only one?)


*

Offline reyalp

  • ******
  • 11900
Re: String lib!
« Reply #14 on: 02 / December / 2008, 00:49:33 »
out of curiosity - why??
I thought you wanted the exact time the exposure started ?
Quote
also, i'm thinking about pitching the idea for a wiki reorg. there's a wealth of great information there but i keep getting lost. (am i the only one?)
The idea doesn't need pitching, the need is obvious. What is missing is people with the time to do it.

You don't have to do the whole thing, every little bit helps. If you plan to do major structural changes, you should probably float it in Help making CHDK and the forum better first, but basically, have at it.

If you are looking for someone else to do it, well... join the club :D
Don't forget what the H stands for.

Re: String lib!
« Reply #15 on: 02 / December / 2008, 07:08:06 »
>>I thought you wanted the exact time the exposure started ?

Yes, I do!

Let me rephrase the question - Why does it produce the desired result?

I'll try to pitch in on the wiki as soon as i can.

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: String lib!
« Reply #16 on: 02 / December / 2008, 13:51:09 »
Let me rephrase the question - Why does it produce the desired result?

Now you got me puzzled, why wouldn't it? In reyalp's example current time is saved by shot_time=os.time() right before exposure starts with press("shoot_full"). Obviously it's up to you to decide what to do with that date (like writing it to a log file so that it can be touched on the PC or touching the file with that date if we have that kind of capability in CHDK).

*

Offline reyalp

  • ******
  • 11900
Re: String lib!
« Reply #17 on: 02 / December / 2008, 22:56:22 »
>>I thought you wanted the exact time the exposure started ?

Yes, I do!

Let me rephrase the question - Why does it produce the desired result?

I'll try to pitch in on the wiki as soon as i can.
shoot() blocks for most of the shooting process, including any autofocus/pre-flash. Button presses do not.

Shoot does roughly the same thing as the lua code I posted, except that it's all in the C code so you can't change it from script.
Don't forget what the H stands for.


 

Related Topics