Fractional shutter speeds above 1 second - Feature Requests - CHDK Forum

Fractional shutter speeds above 1 second

  • 7 Replies
  • 5187 Views
Fractional shutter speeds above 1 second
« on: 23 / July / 2014, 20:56:54 »
Advertisements
Would it be possible to either allow the short exposure shutter setting to go up to 9.99999 seconds or add a fractional seconds part to the long exposure shutter setting? At the moment I can't set, for example, 1.5 seconds, which used to be possible on older CHDK versions.

Re: Fractional shutter speeds above 1 second
« Reply #1 on: 23 / July / 2014, 21:14:21 »
I can take a look.

Meanwhile, you can get 1.0  1.3  1.6  2.0  2.5  3.2 seconds using the [ Ev Step ] option.

Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Fractional shutter speeds above 1 second
« Reply #2 on: 23 / July / 2014, 21:40:18 »
Untested - in gui.c, function gui_decimal_enum(), change the max value from 100,000 to 999,999.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: Fractional shutter speeds above 1 second
« Reply #3 on: 23 / July / 2014, 21:51:46 »
Untested - in gui.c, function gui_decimal_enum(), change the max value from 100,000 to 999,999.
Was working on this when you posted.  Two changes needed - this is tested and works ( I picked 5 seconds arbitrarily) :
Code: [Select]
Index: core/gui.c
===================================================================
--- core/gui.c  (revision 3539)
+++ core/gui.c  (working copy)
@@ -1423,7 +1423,7 @@

     *v += change;
     if (*v < 0) *v = 0;
-    if (*v > 100000) *v = 100000;
+    if (*v > 500000) *v = 500000;

     sprintf(buf, "%01d.%05d", (int)(*v / 100000), (int)(*v % 100000));

Index: core/gui_menu.c
===================================================================
--- core/gui_menu.c     (revision 3539)
+++ core/gui_menu.c     (working copy)
@@ -106,7 +106,7 @@

     // Calculate max allowed value for int_incr
     // Default is 10000 for positive int values, 1000 for negative values or 1 otherwise
-    int max = ((item_type == MENUITEM_INT) || (item_flags & MENUITEM_DECIMAL)) ? ((item_val<0)?1000:10000) : 1;
+    int max = ((item_type == MENUITEM_INT) || (item_flags & MENUITEM_DECIMAL)) ? ((item_val<0)?1000:100000) : 1;

     // If an int value has a defined MIN / MAX range then adjust int_incr max to fit the range
     int vmax = 0;
~                       

Well, it works except for one bit of ugliness.  When you use the zoom key to change digits,  it stops at the decimal point. Using the left & right keys at that point increment the value to the left of the decimal point. It works but it's not exactly 100% intuitive,  and cleaning that up will be a bit of coding work.  Fortunately, I believe that this input type is only used for Tv short values (based on a bit of grepping).

« Last Edit: 23 / July / 2014, 21:53:23 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Fractional shutter speeds above 1 second
« Reply #4 on: 23 / July / 2014, 22:23:35 »
Well, it works except for one bit of ugliness.  When you use the zoom key to change digits,  it stops at the decimal point. Using the left & right keys at that point increment the value to the left of the decimal point. It works but it's not exactly 100% intuitive,  and cleaning that up will be a bit of coding work.  Fortunately, I believe that this input type is only used for Tv short values (based on a bit of grepping).

In gui_menu.c function increment_factor(), this line sets the max increment factor.
Code: [Select]
    int max = ((item_type == MENUITEM_INT) || (item_flags & MENUITEM_DECIMAL)) ? ((item_val < 0)?1000:10000) : 1;

Something like this might work.
Code: [Select]
    int max = (item_flags & MENUITEM_DECIMAL) ? 100000 : (item_type == MENUITEM_INT) ? ((item_val < 0)?1000:10000) : 1;

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: Fractional shutter speeds above 1 second
« Reply #5 on: 23 / July / 2014, 22:53:30 »
Something like this might work.
Code: [Select]
    int max = (item_flags & MENUITEM_DECIMAL) ? 100000 : (item_type == MENUITEM_INT) ? ((item_val < 0)?1000:10000) : 1;
I think that gets you the same thing as my patch, where I changed the line to
Code: [Select]
+    int max = ((item_type == MENUITEM_INT) || (item_flags & MENUITEM_DECIMAL)) ? ((item_val<0)?1000:100000) : 1;
although yours is better because it limits MENUITEM_INT to 10000 and mine lets it go to 100000.  But they still both have the same problem of getting stuck at the decimal point when you used the zoom lever to move left.

I think that's going to take some special handling on the code that manages the zoom lever  digit position select.
« Last Edit: 23 / July / 2014, 22:59:25 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Fractional shutter speeds above 1 second
« Reply #6 on: 24 / July / 2014, 04:38:09 »
I've added this in revision 3540 (trunk only).

If there are no issues I'll add it to the release_1.2 branch as well.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: Fractional shutter speeds above 1 second
« Reply #7 on: 24 / July / 2014, 05:49:22 »
I've added this in revision 3540 (trunk only). If there are no issues I'll add it to the release_1.2 branch as well.
Tested on the A1200 - works well.  Thanks for fixing the decimal place thing - would have taken me a couple of hours to find that part of the code.   

I guess it's technically a "bug" enough to add it to 1.2 ?  And the fix is low risk. 
Ported :   A1200    SD940   G10    Powershot N    G16


 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal