Making scripting support optional - page 5 - General Discussion and Assistance - CHDK Forum supplierdeeply

Making scripting support optional

  • 83 Replies
  • 30906 Views
*

Offline ultimA

  • ***
  • 137
Re: Making scripting support optional
« Reply #40 on: 03 / January / 2011, 23:26:44 »
Advertisements
It seems desirable to produce an error or warning when this happens.
But the error/warning was already missing for lua.

Lua and ubasic cannot run at the same time ???
Sometimes I feel like I'm brain-dead (yep, even i make mistakes sometimes :D ). I guess I'd better add correct error-handling for lua too instead. I'll revise the patch.

*

Offline reyalp

  • ******
  • 14080
Re: Making scripting support optional
« Reply #41 on: 03 / January / 2011, 23:33:36 »
I guess I'd better add correct error-handling for lua too instead. I'll revise the patch.
Don't worry about it right now, you can make another patch to fix it up later.  Or someone else can do it.

I'd rather get this patch in now, since I've spent the time going through it.

edit:
In fact, luaCB_keyfunc should does already produce an error.
« Last Edit: 03 / January / 2011, 23:38:37 by reyalp »
Don't forget what the H stands for.

*

Offline ultimA

  • ***
  • 137
Re: Making scripting support optional
« Reply #42 on: 03 / January / 2011, 23:53:42 »
Ok, I'll make sure to clean up my mess in an upcoming patch. But even though luaCB_keyfunc handles invalid key names for click, press and release (I could have sworn I saw them being called from lua), I couldn't find lua error handling for is_pressed and is_clicked.

*

Offline reyalp

  • ******
  • 14080
Re: Making scripting support optional
« Reply #43 on: 03 / January / 2011, 23:59:03 »
Ok, I'll make sure to clean up my mess in an upcoming patch. But even though luaCB_keyfunc handles invalid key names for click, press and release (I could have sworn I saw them being called from lua), I couldn't find lua error handling for is_pressed and is_clicked.
Yeah you are right, is_pressed and is_clicked do not check in lua. My mistake, I only tested click :-[

edit:
For now, I'm going to leave it as it was (ubasic error gets set)

edit:
committed as changeset 1020
The only other change I made is where lstate.h is included.

There's a couple of other things I noticed (mostly not specific to your code) I'm going to try to clean up.

edit:
OK, did one minor one - changeset 1021, the other thing I wanted to clean up was the ptp lua result stuff but that's more hairy than I want to get into right now.
« Last Edit: 04 / January / 2011, 00:33:34 by reyalp »
Don't forget what the H stands for.


*

Offline ultimA

  • ***
  • 137
Re: Making scripting support optional
« Reply #44 on: 05 / January / 2011, 16:09:58 »
And here is the patch that everybody has been waiting for: lua checks for the buttons! Just kidding. But it is also included, as promised :)

This is actually a set four patches, finally providing what frequent visitors of this thread have all been waiting for: Optional scripting and scriptless badpixel.bin creation! The patches are based on rev. 1023 and are numbered 00-03, they should apply cleanly if applied in order.

00 - the button stuff :)
01 - optional scripting - build system part
02 - optional scripting - sources part (mostly just ifdefs, with a few cleanups)
03 - badpixel.bin creation

I've done basic testing, everything seems to be fine. Enjoy.

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: Making scripting support optional
« Reply #45 on: 06 / January / 2011, 04:15:08 »
Thanks ultimA,

The badpixel 03, can be applied independently of the other 3?


*

Offline ultimA

  • ***
  • 137
Re: Making scripting support optional
« Reply #46 on: 07 / January / 2011, 02:22:39 »
The badpixel 03, can be applied independently of the other 3?

03 modifies gui.c, and 02 also has quite a few modifications to the same file, so 03 probably does not apply alone (though not actually tested). But what keeps you from applying all of them? They are relatively harmless, especially if you keep the scripting languages enabled.

*

Offline hwntw

  • ***
  • 159
Re: Making scripting support optional
« Reply #47 on: 07 / January / 2011, 05:31:19 »
And here is the patch that everybody has been waiting for: lua checks for the buttons! Just kidding. But it is also included, as promised :)

This is actually a set four patches, finally providing what frequent visitors of this thread have all been waiting for: Optional scripting and scriptless badpixel.bin creation! The patches are based on rev. 1023 and are numbered 00-03, they should apply cleanly if applied in order.

00 - the button stuff :)
01 - optional scripting - build system part
02 - optional scripting - sources part (mostly just ifdefs, with a few cleanups)
03 - badpixel.bin creation

I've done basic testing, everything seems to be fine. Enjoy.
This works well on my Ixus 960, compile options disabled (CHDK size 160K), but my Ixus 95 will not start with these patches applied (build 1023).

The patches do not run cleanly using CHDK-Shell patch tool. File paths have to be entered manually

Colin
« Last Edit: 07 / January / 2011, 08:00:47 by hwntw »
Ixus 300HS S100


Windows 10


*

Offline c10ud

  • ***
  • 245
Re: Making scripting support optional
« Reply #48 on: 07 / January / 2011, 10:43:23 »
edit2: was definitely my fault, sorry for this :)

edit3: maybe i was right, there's an issue with the shoot() action (if using luar) if it's too long e.g. 10" exp time or HDR (tested with g12) otherwise a normal shoot works fine.. i need to investigate if it's camera fault or scripting..because all this codechanging between releases is making my head spin :)

edit4: i was assuming it was this patch's fault because of some post above stating it broke luar a bit, but really i am wondering if there's some issue with shooting_progress for g12..atm the only camera i own, so i can't test with others :(

edit5: i had a friend testing with another camera on latest svn and the issue persists (wasn't happening pre-script-refactor)!

edit6: seems like with long shots (hdr, 10"exptime) state_shooting_progress isn't set as SHOOTING_PROGRESS_PROCESSING.. so it stays NONE forever (!)... while shooting_in_progress() correctly changes
« Last Edit: 07 / January / 2011, 12:14:46 by c10ud »

*

Offline c10ud

  • ***
  • 245
Re: Making scripting support optional
« Reply #49 on: 07 / January / 2011, 12:30:54 »
well, this issue is very nice:
if i shoot() without any modification, it works. (state_shooting_progress becomes correctly 3 at the end of the shoot)

if i shoot in Tv, HDR or CHDK Tv override mode, it shows up (state_shooting_progress always remains 0.. of course this is only "visible" when doing luar, but the issue affects also the raw_need_postprocess thing..)

 

Related Topics