Fast MD && Multiple zones. - Script Writing - CHDK Forum  

Fast MD && Multiple zones.

  • 3 Replies
  • 3018 Views
Fast MD && Multiple zones.
« on: 26 / March / 2011, 21:46:04 »
Advertisements
Hello,
I'm somewhat new to CHDK scripting and was wondering if it was possible without modifying the CHDK source (e.g. just modify the Fast MD script) to script multiple motion detection zones on an A480 (but in away that would allow the zone triggering to control the flow of the script)?

Example: 
Zone A is area top center of LCD; zone B is area bottom left corner and zone C is area bottom right corner of LCD.
What I'd like to be able to to is, when the script starts off with Zone A active.  When Zone A is "triggered"; zone B then becomes active (unless Zone A is triggered).  When Zone B is "triggered"; zone C becomes active (unless Zone a is triggered).  Zone C then remains in effect until Zone A is triggered.
In short, anytime Zone A triggers then Zone B, C sequence occurs assuming there is no zone A reset.

Thanks,
Craig

*

Offline reyalp

  • ******
  • 14121
Re: Fast MD && Multiple zones.
« Reply #1 on: 26 / March / 2011, 23:10:03 »
You should be able to reset the MD parameters in script based on the previous md trigger (using md_get_cell_diff).

I'm not really clear if this would meet your needs.
Don't forget what the H stands for.

Re: Fast MD && Multiple zones.
« Reply #2 on: 26 / March / 2011, 23:44:08 »
Ummm.. ok, I guess I could try setting up each grid pattern under a different save settings option, then within the script switch to the different saved settings option based on the md_get_cell_diff.
Thanks!

The only issue unresolved is the grid cell has to be contiguous e.g. single square/rectangle and/or sequenial set of squares/rectangles.  Solves the a to b to c issues, but not the non-contiguous issues e.g. grid area A in upper left corner being used at the same time as grid area B in lower right. (with the center && surrounding areas as non-motion sensitive)
or once B has "triggered" switch to using (not shown with an example) grid A in upper left and grid C in lower left.
I kinda suspect this would require modifying CHDK's source to be able to support.

Example: * represents motion grid lines area

First example below is supported, but second example with 2 non-contiguous areas, doesn't seem to be (with or without different actions being associated with the different grid areas).

Where, with each defined area  top left, bottom right could be associated with a different script action.
______                                            ______
|**    |    but wanted to be able to do |**     |
|**    |                                            |**     |
|       |                                            |     **|
|       |                                            |     **|
-- -------                                            ----------                                                        
« Last Edit: 26 / March / 2011, 23:51:50 by sargon »

*

Offline reyalp

  • ******
  • 14121
Re: Fast MD && Multiple zones.
« Reply #3 on: 27 / March / 2011, 00:44:51 »
With md_get_cell_diff you should be able to do MD on an area that covers all the cells you might be interested in, and ignore triggers in the ones you don't care about. If you want to shoot in response to md in those cells, doing the shot from script will probably hurt reaction time at bit.

To do md in arbitrary disconnected regions, you'd need to hack the md code.
Don't forget what the H stands for.


 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal