exposurses

All files named "exposurses.c"
Login

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

History for exposurses.c

2013-09-18
14:21
Tweak menu widths, make future adjustment more flexible file: [e87ae533c1] check-in: [338867e3ed] user: base@atomicules.co.uk branch: origin/master, size: 12589
13:34
Remove some spurious trailing tabs file: [fe45387438] check-in: [fee7533a30] user: base@atomicules.co.uk branch: origin/master, size: 12388
12:51
I never noticed it originated in DOS format. Poop file: [252831858c] check-in: [0b2d1fbf49] user: base@atomicules.co.uk branch: origin/master, size: 12432
12:49
Clean up comments file: [c2c2744417] check-in: [946bdcbbb6] user: base@atomicules.co.uk branch: origin/master, size: 12931
12:49
Split out ITEM creation into separate func so can clean on exit

I still hadn't got things quite right from when I'd split out the menu
and window creation functions. The segfault on exit was due to the item
pointers I thought existed not actually existing.

Need to make sure they exist as expected as otherwise I can't free up
the memory, etc.

Yay, pretty much done. file: [c60faa0626] check-in: [d39151ac51] user: base@atomicules.co.uk branch: origin/master, size: 13201

12:49
Ignore selection of OVER/UNDER in shutter/aperture menus

Since this seems easier than trying to prevent selection. file: [b83c1efdbb] check-in: [4cc8e33f3c] user: base@atomicules.co.uk branch: origin/master, size: 12861

12:48
Add under/over exposure indication in to the shutter/aperture menus

Keeping the NULLs in makes array indices very confusing, but this seems
to be the right thing to do. file: [6df7670132] check-in: [7312ab2b6f] user: base@atomicules.co.uk branch: origin/master, size: 12137

11:01
Fix menu numbering (from adding exposure menu in)

Didn't change functionality (it was still working), but just gives
better consistency to the code. file: [a6a32e4841] check-in: [4a3cabadc2] user: base@atomicules.co.uk branch: origin/master, size: 10939

11:01
Make the add_menu and add_win subs work

I was still using the "variable pointers" technique, well trying to, and
it wasn't working for things like `set_menu_win` so pull this back out
into main.

Seg faults on exit, but haven't fixed that bit yet. file: [7d4000ba2d] check-in: [c2741c67e7] user: base@atomicules.co.uk branch: origin/master, size: 11195

11:01
Try separate win and menu functions

instead of trying to wrap everything in one. This way I know I can
return the correct thing and I know I'm setting things as expected.

As opposed to previous attempt where I was (trying) to use variable
pointers, but with pointers to pointers, etc. And was obviously a bit
beyond me. file: [1fbc889f09] check-in: [e4268c4b4e] user: base@atomicules.co.uk branch: origin/master, size: 10784

2013-09-17
22:43
Split out ITEM creation into separate func so can clean on exit

As otherwise can't free up the memory, etc. This makes clean up work

Yay, pretty much done. file: [3641283e71] check-in: [cf92beadf9] user: base@atomicules.co.uk branch: temp, size: 13101

2013-09-15
21:25
Ignore selection of OVER/UNDER file: [1d9f261d1f] check-in: [d4b0749e89] user: base@atomicules.co.uk branch: temp, size: 12885
17:22
Add under/over exposure indication in file: [a117288f66] check-in: [216708513b] user: base@atomicules.co.uk branch: temp, size: 12161
2013-09-13
09:31
Fix menu numbering (from adding exposure menu in) file: [fc6b20b0aa] check-in: [b12e9bb5c7] user: base@atomicules.co.uk branch: temp, size: 10989
2013-09-12
12:02
For ref: That should have always been a pointer

Although this version still no worky file: [95d8229153] check-in: [b786f69eac] user: base@atomicules.co.uk branch: temp2, size: 10468

11:59
Make the add_menu and add_win subs work

Seg faults on exit, but haven't fixed that bit yet. file: [1a85fe6722] check-in: [ecdc9d9bca] user: base@atomicules.co.uk branch: temp, size: 11245

2013-09-11
21:33
WIP on temp: bafe457 For ref file: [51c682ab30] check-in: [b1a123e70a] user: base@atomicules.co.uk branch: refs/stash, size: 10833
2013-09-10
13:40
For ref file: [1495b819ac] check-in: [de620ef542] user: base@atomicules.co.uk branch: refs/stash, size: 10467
08:51
Make exposure menu functional

- Make it function so that user is constrained to exposure menu
initially and must select value there.
- Once selected, the ISO menu becomes active and user must select value
there
- Finally make both shutter and aperture menus actives (switch between
them with left/right arrow keys). Whichever is selected, the other
will be calculated.

This is not very pretty:

- I don't like having both the selection_counter and menu_counter. Seems
almost redundant. Made sense before I constrained selections and
stepped through the menu's etc (and therefore you could re-select),
but now seems annoying to have to keep it only for how last two menus
work.
- I don't like the repetitive menu creation stuff. That should be DRY-ed
up. file: [519009a683] check-in: [580afe6ab4] user: base@atomicules.co.uk branch: origin/master, size: 12716

2013-09-03
12:38
Add in EV menu, doesn't function yet though

- Add in free memory bits, also missed some for the other menus file: [ae4e3659ee] check-in: [6c315c3200] user: base@atomicules.co.uk branch: origin/master, size: 12677

2013-09-02
14:32
Learning notes and better forced refreshing of menus

- Add learning notes
- Use scroll page up/down and item up/down to force refresh and stop
two items showing as selected file: [82aebcb54e] check-in: [dd2fc74444] user: base@atomicules.co.uk branch: origin/master, size: 11196

13:27
Enable exit key, change help text to suit file: [b32d12fb23] check-in: [2dc1212485] user: base@atomicules.co.uk branch: origin/master, size: 10840
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]` file: [77daf0d603] check-in: [845d8653eb] user: base@atomicules.co.uk branch: origin/master, size: 10796

09:47
I am King of Fail

I mean, just how? I think I need a few years more sleep or something file: [1537cc47cc] check-in: [506ba48833] user: base@atomicules.co.uk branch: origin/master, size: 10733

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
- file: [b4271e267b] check-in: [68919dca22] user: base@atomicules.co.uk branch: origin/master, size: 10733

2013-08-31
07:50
Try to standardise on a string length

Since it doesn't matter if it's longer.
And I'm only using short strings. file: [bd9849a6f1] check-in: [99eba10b76] user: base@atomicules.co.uk branch: origin/master, size: 10614

07:47
Remove extraneous line that came from menu_scroll.c file: [48a95ed6e4] check-in: [ed161d4179] user: base@atomicules.co.uk branch: origin/master, size: 10568
2013-08-29
23:24
Implement functionality to calc req'd and then sel nearest match in menu

So far only implemented on Shutter menu, i.e. have to select ISO and
Aperture, it will then use the equations to calculate the exact required
shutter speed, but then select the nearest value in the menu.

In order to do that added these two functions:

- nearest_match
- fraction_to_double

The latter needed, because need to convert "1/1000", etc into float. For
Aperture menu items can just strip off the "f/".

Seems to work for Sunny 16. file: [35b1eab5db] check-in: [6513b427e7] user: base@atomicules.co.uk branch: origin/master, size: 10586

2013-08-27
12:00
Fix order of arguements in exposure functions file: [5e63bd051e] check-in: [c663824d67] user: base@atomicules.co.uk branch: origin/master, size: 8361
11:37
Whoopsie! Can't re-arrange equations it seems. file: [6362f5ff0b] check-in: [1e61137082] user: base@atomicules.co.uk branch: origin/master, size: 8355
2013-08-26
22:02
More whitespace changes (mainly). What the hell?! file: [6d5ba5174c] check-in: [a7ef007409] user: base@atomicules.co.uk branch: origin/master, size: 8355
2013-08-25
22:02
Whitespace / retabbing changes file: [771e16a957] check-in: [de652712ec] user: base@atomicules.co.uk branch: origin/master, size: 8351
21:50
Makes the basic menu interaction work (select 2, set other)

Track the selected values, but for now still do the dummy row shift
thing. file: [3224c31d31] check-in: [10d5131043] user: base@atomicules.co.uk branch: origin/master, size: 8948

2013-08-24
15:53
Whitespace changes for consistent formatting file: [e85065501d] check-in: [8669035245] user: base@atomicules.co.uk branch: origin/master, size: 8738
15:52
Ensure two different menus have been selected before executing file: [95e2271e83] check-in: [5f0ed62195] user: base@atomicules.co.uk branch: origin/master, size: 8730
2013-08-17
19:35
Add initial left/right menu navigation

not at all DRY though at the moment. file: [09d2291528] check-in: [0ecf3fd90c] user: base@atomicules.co.uk branch: origin/master, size: 8288

12:23
Add exposure equations (don't do anything yet though) file: [bff24b36c1] check-in: [2264820974] user: base@atomicules.co.uk branch: origin/master, size: 7070
12:18
Rename arrays to free up name for functions file: [17102123bf] check-in: [bd27f3bed9] user: base@atomicules.co.uk branch: origin/master, size: 6038
2013-07-11
12:06
Test using the User Pointer to change another menu

Requires the Window and Menu variables to be global(?) in scope. I.e.
move outside of main routine.

Interesting thing about the refreshing of the other menu... file: [532e98b06f] check-in: [328662366f] user: atomicules@lavabit.com branch: origin/master, size: 5966

2013-07-10
13:14
Add initial usage of the User Pointer

Still need a way to get to the third menu and also need to actually do
something with the User Pointer function.

Baby steps though. file: [2714035e0a] check-in: [b4468458f4] user: atomicules@lavabit.com branch: origin/master, size: 5780

13:13
Identation changes only

Was meant to be like this in the first place file: [2c21b9d30c] check-in: [b5ca845268] user: atomicules@lavabit.com branch: origin/master, size: 5197

13:12
Remove unnecessary items from arrays

At least I don't think these are needed? file: [51415149f3] check-in: [e4e256f8b0] user: atomicules@lavabit.com branch: origin/master, size: 5193

12:29
Fix pointer types

Or whatever the hell they are called. Inadvertently set these wrong when
adding in the third menu. file: [85ec447a29] check-in: [18f4d20e48] user: atomicules@lavabit.com branch: origin/master, size: 5244

2013-07-08
08:55
Add in values for the three menus file: [dae7542196] check-in: [4b63a4b0a2] user: atomicules@lavabit.com branch: origin/master, size: 5246
08:55
Enable switching between windows with left/right keys

- Oh my, I've ended up using pointers to pointers already! Use this so
can switch the menu/win "pointing" at with left and right keys and
then scroll up down the active one.
- Also means need to just use plain getch and not wgetch as don't want
to limit input to one window.

I still don't get what determines an active window. Is it just cursor
position? file: [c404445cec] check-in: [db667542ca] user: atomicules@lavabit.com branch: origin/master, size: 4113

08:55
First attempt at getting two menus side by side

Tricky bit was that have to re-create my_items. I thought I'd be able to
re-use that for the sake of this test. But without recreating it the
second menu is blank. file: [70bdf368d7] check-in: [8fab8d5ebf] user: atomicules@lavabit.com branch: origin/master, size: 4020

08:55
Re-ident, fix comment typo, slight re-format file: [1b109adf5c] check-in: [18fbc02037] user: atomicules@lavabit.com branch: origin/master, size: 3045
08:55
Add note about where file is from/based on file: [1198495c8b] check-in: [a7bd8579c0] user: atomicules@lavabit.com branch: origin/master, size: 3412
08:54
Added: Rename file file: [07303baa9a] check-in: [40ac3fa835] user: atomicules@lavabit.com branch: origin/master, size: 3303