SavLog "Snapshot in time" report script - Script Writing - CHDK Forum

SavLog "Snapshot in time" report script

  • 4 Replies
  • 3816 Views
*

Offline SkyWalker9

  • ****
  • 301
  • SX20 IS (fw 1.02b)
SavLog "Snapshot in time" report script
« on: 14 / June / 2010, 09:38:46 »
Advertisements
I wrote a script that perhaps others may find useful. This script generates a "snapshot in time" report of camera settings using the currently available "get" statements in CHDK uBasic - with the exception of "get_platform_id" and "get_tv". I was unable to get the two statements to work, but I included "get_platform_id" and "get_tv" in the script as "rem" statements in case someone wants to experiment. Although all of the uBasic statements run error free on my SX20IS, I wasn't able to check if all will work on other cameras.

There is only one paramater - "FilNum". It allows you generate multiple reports (from LOG_0000.TXT through LOG_9999.TXT) for comparison, documentation, etc. The script generates the report(s) on the SD card in the CHDK/LOGS folder.

Here's a portion of the report so that you can see what it looks like (using WordPad rather than Notepad to view TXT file). I put a timestamp at the beginning and end so you can see how long it takes to generate the report.
Quote
Log of Current Settings
Date: 13/6/2010  Time: 19:12:43
----------------------------------------
 
Autostart: 0
  0=off, 1=on, 2=once
 
Display_mode: 0
  0=show icons
  1=do not show
  2=LCD off
  3=EVF
 
Drive_mode: 0
  0=single
  1=continuous
  2=timer on Digic II
  3=timer on Digic III
 
Ev: 0
  propcase 25/107 for Digic II/Digic III
 
Exp_count: 602
  number of shots in a session
 
Flash_mode: 2
  0, 1, 2 = flash auto, on, off
If you'd like a copy of the script and the report I ran you can download it here (5 KB): http://rapidshare.com/files/398727363/CHDK_SavLog_script.zip
« Last Edit: 14 / June / 2010, 10:38:13 by SkyWalker9 »

*

Offline f_m_b

  • **
  • 71
Re: SavLog "Snapshot in time" report script
« Reply #1 on: 14 / June / 2010, 17:56:24 »
Hey SkyWalker9

i tryed out your script with sx20 and it works fine.

Only one thing i can't understand:
Why the time/date-stamp of the logfiles other than "log-1" is 1.1.2000?
After writing the logfile i shot a picture and time/date of it was correct.

Bye Frank
Greetings Frank
SX20 (1.02b)

*

Offline SkyWalker9

  • ****
  • 301
  • SX20 IS (fw 1.02b)
Re: SavLog "Snapshot in time" report script
« Reply #2 on: 14 / June / 2010, 19:38:37 »
Only one thing i can't understand:
Why the time/date-stamp of the logfiles other than "log-1" is 1.1.2000?
After writing the logfile i shot a picture and time/date of it was correct.
I'm not sure how certain files on the SD card get the 1/1/2000 datestamp. I checked the other folders/files on one of my SD cards and discovered there were a number of files with that datestamp. For example, the DCIM folder, 100CANON folder, 3 out 20 DNGs in the 100CANON folder, as well as the CHDK EDGE, LOGS and many files in the DATA folder had the 1/1/2000 datestamp. I didn't do a forum search to see if anyone has already reported this anomaly, but perhaps someone else has an explanation. Thankfully, at least the script captures and records the date correctly so that the report dates will be accurate.

*

Offline reyalp

  • ******
  • 14079
Re: SavLog "Snapshot in time" report script
« Reply #3 on: 15 / June / 2010, 00:31:16 »
With the function we use for file IO, you have to explicitly set the timestamp. See os.utime in http://chdk.wikia.com/wiki/LUA#LUA_standard_libraries:_io.2C_os_and_string
Don't forget what the H stands for.


*

Offline SkyWalker9

  • ****
  • 301
  • SX20 IS (fw 1.02b)
Re: SavLog "Snapshot in time" report script
« Reply #4 on: 15 / June / 2010, 10:06:54 »
With the function we use for file IO, you have to explicitly set the timestamp. See os.utime in http://chdk.wikia.com/wiki/LUA#LUA_standard_libraries:_io.2C_os_and_string
Thanks for the info @reyalp.

When I initially started writing this script I decided to use BAS because I was a little more familiar coding the statements in BAS. Now, I'm ready to try something similar using LUA (for my experience). I initially wrote this script for two reasons: I wanted more experience on some of the scripting statements and I wanted to be able to save setup info between photo sessions. Now, instead of writing lots of notes on how I had the camera setup, I just look at the LOG files and compare the LOG date/time stamps to the photo EXIF date/time stamps - simpler, easier and more accurate. I really like CHDK!!!

The posting you mentioned applied to LUA so now I'm interested in trying LUA. I didn't find the same capability (to set the file datestamp) in BAS, so I'm looking forward to trying the same script using LUA and maybe improving the script in the process.
« Last Edit: 15 / June / 2010, 10:08:44 by SkyWalker9 »

 

Related Topics