exposurses

Check-in [506ba48833]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:I am King of Fail I mean, just how? I think I need a few years more sleep or something
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 506ba488339a7a99d5d702a25ad21892be4d16ceead08ad2de7083bc2046eedd
User & Date: base@atomicules.co.uk 2013-09-02 09:47:34
Context
2013-09-02
10:20
Implement exposure equations and matching for Aperture menu Also: More evidence I am in a continual half-daze - Need to define shutter value as double in `aperture` as otherwise both arguments will be integers and I'm guessing it'd not going to work out well. Plus... need to use `fraction_to_double` anyway to feed the value in. - Had done the "substring" thing wrong in `strncpy` and was one decimal place off in getting the paerture value. I.e. would have got "1." instead of "1.4" from "f/1.4" - Like the fool I am, in the loop and the copy and paste I'd done, I'd not changed from `aperture_array[0]` to `aperture_array[n]` check-in: 845d8653eb user: base@atomicules.co.uk tags: origin/master, trunk
09:47
I am King of Fail I mean, just how? I think I need a few years more sleep or something check-in: 506ba48833 user: base@atomicules.co.uk tags: origin/master, trunk
09:29
Actually make it work this time. See this commit: 8d3e66b5ecffa8bcf7691c3f0600840b934beb1a I'm such an idiot. - Remove `set_top_row` when setting the shutter menu to the correct value. Leaving this in fooled me into thinking I had things working because I just happened to test on the matching ISO/Aperture values. Plonker. And then it turns out, there was loads wrong. - Need to include stdlib.h for `strtod` function, otherwise it uses some kind of stub function (no complaints in compile or use, but it just doesn't work). - Wasn't passing right kind of values to `shutter` anyway! Need to convert these to numeric - Need to use `fabs` not `abs` for doubles. - In `nearest_match` wasn't using the correct arrays, had copied over `iso_array` and forgotten to change them - Use `strstr` instead `strchr` as couldn't get the former to work and was probably the wrong one to be using - Leave some commented out stuff at the bottom that I've been using for debugging - check-in: 68919dca22 user: base@atomicules.co.uk tags: origin/master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to exposurses.c.

246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
						/* Test finding nearest matching value in array? */
						char aperture_sel_[4] = "";
						strncpy(aperture_sel_, aperture_sel+2, 3);
						/* There is probably a nicer way to format the below */
						set_menu_pattern(
							shutter_menu,
							shutter_array[nearest_match(
								shutter(strtod(aperture_sel_, NULL), exposure(atoi(iso_sel))),
								2
							)]
						);
						menu_driver(shutter_menu, REQ_DOWN_ITEM);
						menu_driver(shutter_menu, REQ_UP_ITEM);
						wrefresh(shutter_win);
					}







|







246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
						/* Test finding nearest matching value in array? */
						char aperture_sel_[4] = "";
						strncpy(aperture_sel_, aperture_sel+2, 3);
						/* There is probably a nicer way to format the below */
						set_menu_pattern(
							shutter_menu,
							shutter_array[nearest_match(
								shutter(exposure(atoi(iso_sel)), strtod(aperture_sel_, NULL)),
								2
							)]
						);
						menu_driver(shutter_menu, REQ_DOWN_ITEM);
						menu_driver(shutter_menu, REQ_UP_ITEM);
						wrefresh(shutter_win);
					}