This function is essential to be able to enact the whole shoot&download sequence in one command, and in that sense would replicate the basic functionality of RemoteCapture (which is necessary, not better or worse) as a standard feature of your firmware/software system. To me it's a question of best-of-both-worlds rather than a competitive posture.
function myshoot(tv, av, sv, destdir) cli:execute('shoot -tv='..tv..' -av='..av..' -sv='..sv..'') cli:execute('mdl -fmatch=%.[JDC][PNR][G2]$ DCIM '..destdir..'') --cli:execute('rm -fmatch=%.[JDC][PNR][G2]$ -nodirs DCIM') end
Directory is created // in this case it is unwanted
... also CANONMSC\ directory is created unnecessarily and is empty.
I suppose you are referring to the fact it doesn't recurse ??
Beyond me at this stage -- I'd like to learn how to work with lua but the priority right now is to pass integration tests with the equipment. I'll see what I can do with what I have.
con> !return con:listdir('A/DCIM')={ [1]="100CANON",}
con 12> !destdir='c:/';dcim=con:listdir('A/DCIM');for i,dname in ipairs(dcim) do cli:print_status(cli:execute('mdl -pretend -fmatch=%.[JDC][PNR][G2]$ DCIM/'..dname..' '..destdir)) endA/DCIM/100CANON/IMG_4062.JPG->c:/IMG_4062.JPGA/DCIM/100CANON/IMG_4063.JPG->c:/IMG_4063.JPGA/DCIM/100CANON/IMG_4064.JPG->c:/IMG_4064.JPGA/DCIM/100CANON/IMG_4065.JPG->c:/IMG_4065.JPGA/DCIM/100CANON/IMG_4072.JPG->c:/IMG_4072.JPG
function dcimdl(destdir,del,pretend) if pretend then pretend = '-pretend ' else pretend = '' end local dcim,err=con:listdir('A/DCIM') if not dcim then printf('error listing directory %s\n',tostring(err)) return end for i,dname in ipairs(dcim) do if dname ~= 'CANONMSC' then cli:print_status(cli:execute('mdl '..pretend..' -fmatch=%.[JDC][PNR][G2]$ DCIM/'..dname..' '..destdir)) if del then cli:print_status(cli:execute('rm '..pretend..' -nodirs -fmatch=%.[JDC][PNR][G2]$ DCIM/'..dname)) end end endend
con> !require'extras/dcimdl'con> !dcimdl('d:/temp',true,true)A/DCIM/100CANON/IMG_4062.JPG->d:/temp/IMG_4062.JPGA/DCIM/100CANON/IMG_4063.JPG->d:/temp/IMG_4063.JPGA/DCIM/100CANON/IMG_4064.JPG->d:/temp/IMG_4064.JPGA/DCIM/100CANON/IMG_4065.JPG->d:/temp/IMG_4065.JPGA/DCIM/100CANON/IMG_4072.JPG->d:/temp/IMG_4072.JPGA/DCIM/100CANON/IMG_4062.JPG: OKA/DCIM/100CANON/IMG_4063.JPG: OKA/DCIM/100CANON/IMG_4064.JPG: OKA/DCIM/100CANON/IMG_4065.JPG: OKA/DCIM/100CANON/IMG_4072.JPG: OK
What *I* really need to start with is ... Lua for Dummies, if it exists.
When I wanted to make friends with this language the first thing I looked up in the manual was this unusual syntax '..var..' and could not even find it.
To test that I do need the single call that does everything (ie shoot & transfer) and it does not have to be elegant or generic // it just has to work.
Is there a script debugger you use that can help me step through code? A lua editor too?
Started by smilem General Help and Assistance on using CHDK stable releases
Started by SticK « 1 2 ... 70 71 » Creative Uses of CHDK
Started by SticK CHDK Releases
Started by andrew.stephens.754365 General Help and Assistance on using CHDK stable releases
Started by reyalp RAW Shooting and Processing