One thing, if I set Override Subj. Di. from the chdk menu

to 52 in rec mode, take a shot, then switch to play mode,

the 52 now becomes 101.

No big deal but I find this odd.

How you can see override values in play mode? 101 is the subject distance from plane equivalent from 52 on zoom(0).

some comments for subject distance:

1. canon internal _GetFocusLensSubjectDistance() equal to PROPCASE_SUBJECT_DIST1 and PROPCASE_SUBJECT_DIST2 (here named SD_Plane for subject distance from plane)

2. for camera user _GetFocusLensSubjectDistanceFromLens() for script commands get_focus(), set_focus(), distance overrides and DOF calculator equal to MF gauge (here named SD_Lens for subject distance from lens)

The difference between SD_Plane and SD_Lens is shooting_get_lens_to_focal_plane_width() (here named LP_Width). This value is dependent from zoom position.

history:

- trunk 295: add MAX_DIST as infinity distance for SD_Plane

- trunk 1570: add INFINITY_DIST to mark infinity for sd override

- Find MIN_DIST, MAX_DIST in context SD_Plane

MIN_DIST = lowest possible value for SD_Plane on zoom(0)

MAX_DIST = greatest possible value for SD_Plane on zoom(zoom_steps-1) for detect INFINITY_DIST

see

http://chdk.setepontos.com/index.php?topic=2509.msg79886#msg79886 and

http://forum.chdk-treff.de/viewtopic.php?f=7&t=2632- trunk 1690: add new DOF calculator by using SD_Lens context. MAX_DIST and sd override are in SD_Plane context.

- trunk 1719: switch sd override from SD_Plane to SD_Lens context

current:

A590 use MIN_DIST=51 in SD_Lens context, MAX_DIST=65535 in SD_Plane context and no infinity detection possible

code in SD_Plane context

- MAX_DIST, INFINITY_DIST on generic/wrapper.c lens_set_focus_pos()

- gui.c > line 2453: conf.subj_dist_override_value = MAX_DIST, need SD_Plane context for shooting_get_subject_distance_override_value()

code in SD_Lens context

- MAX_DIST on DOF calculator

- MIN_DIST, MAX_DIST on shooting_subject_distance_bracketing()

- MIN_DIST on gui_subj_dist_override_value_enum()

A good solution is using MIN_DIST, MAX_DIST in SD_Lens context. For SD_Plane context we add LP_Width -> MIN_PLANE_DIST = MIN_DIST + LP_Width, MAX_PLANE_DIST = MAX_DIST + LP_Width. The infinity detection is not perfect for small zoom positions, but in any case there is a valid maximum for SD_Plane context.