Noob question, how to run multicam.lua on chdkptp - page 4 - General Help and Assistance on using CHDK stable releases - CHDK Forum

Noob question, how to run multicam.lua on chdkptp

  • 32 Replies
  • 26146 Views
Re: Noob question, how to run multicam.lua on chdkptp
« Reply #30 on: 12 / May / 2016, 10:21:15 »
Advertisements

I'd actually commented out the relevant section of serialize_r yesterday to get to what your update provides, i.e: 
Code: [Select]
{
 ["9A952438E0A647E9AC0179DDC30582D5"]={
  ["id"]=1,
 },
 ["689D5005104943C09E988E4EA8301E22"]={
  ["id"]=2,
 },
 ["449A58C8297A4CCDAD05327C6BDD6FC2"]={
  ["id"]=4,
 },
 ["E21B7D737E5D4291B5DD048230963CF6"]={
  ["id"]=3,
 },
}

Unfortunately, as it stands, the Autoit splitter code:
Code: [Select]
$aArray = StringRegExp($sData, '((?<=").*(?=")|id=\d+)', 3) ; Split into array
now recognises both the serial number & "id" (i.e. the text itself) as array elements so I still have some work to do - can't imagine it'll be too difficult to fix though.

If i'd thought you'd be as quick off the mark i'd have provided feedback sooner...apologies.

Thanks for doing this.

*

Offline reyalp

  • ******
  • 14125
Re: Noob question, how to run multicam.lua on chdkptp
« Reply #31 on: 12 / May / 2016, 13:17:53 »
Unfortunately, as it stands, the Autoit splitter code:
Code: [Select]
$aArray = StringRegExp($sData, '((?<=").*(?=")|id=\d+)', 3) ; Split into array
now recognises both the serial number & "id" (i.e. the text itself) as array elements so I still have some work to do - can't imagine it'll be too difficult to fix though.
One way to identify the difference would be that serial always ends with something like ]={
while the ID ends with ]=digits

You could also modify save_list to output an additional file in some simpler format, something like
Code: [Select]
fh=io.open('autoit_list.txt','wb')
for k,v in pairs(t) do
 fh:write(string.format('%d=%s\n',v.id,k))
end
fh:close()
This should give you lines of
id=serial
(above is off top top of my head, untested)

I didn't really intend the saved list to be used externally, I used serialize because it makes it easy to save and load from Lua, and is reasonably human readable.
Don't forget what the H stands for.

Re: Noob question, how to run multicam.lua on chdkptp
« Reply #32 on: 16 / May / 2016, 06:32:47 »
You could also modify save_list to output an additional file in some simpler format
Wish i'd thought like that prior to my query.

I've now just kept the old util.lua and added this to multicam r692 mc:save_list:
Code: [Select]
local path = "C:\\CHDKPTP\\autoit_list.txt"
   fh=io.open(path,'wb')
   for k,v in pairs(t) do
   --fh:write(string.format('%s|%d\n',k,v.id))
   fh:write(string.format('"%s"id=%d\n',k,v.id))
   end
   fh:close()   
   --added above

I direct the original autoit splitter code to autoit_list.txt to create the editable gui list then edit that on screen and save it to both autoit_list.txt and listfile (listfile padded to conform to the equivalent of your new util.lua code).
I didn't really intend the saved list to be used externally, I used serialize because it makes it easy to save and load from Lua, and is reasonably human readable.
I understand this much better now.

Sorry for the hassle and hope somebody sometime can make use of the change.

Thanks again for the hand and especially the hint.

Working Autoit GUI screenshot for the record
« Last Edit: 19 / May / 2016, 14:27:02 by andrew.stephens.754365 »

 

Related Topics


SimplePortal © 2008-2014, SimplePortal