cleanup of Show OSD menu item - General Discussion and Assistance - CHDK Forum supplierdeeply

cleanup of Show OSD menu item

  • 15 Replies
  • 4632 Views
cleanup of Show OSD menu item
« on: 05 / October / 2013, 17:19:49 »
Advertisements
Attached is a small patch file that I believe cleans up a nagging issue with the OSD display.

Currently,  if the OSD Menu item "Show OSD" is set to disabled,  the "animated" icons for battery,  file space, USB remote and the clock will still display in <ALT> modes.  This is particularly annoying if a script is running and requires each icon to be disabled individually in order to hide them.

This fix add a quick check of conf.show_osd at the start of the osd_visible() routine.  I've tested it in all the modes I could think but I don't have a touchscreen camera so need philmoz or someone to verify it does not break that interface.

I also cleaned up the tabs / spacing in that routine ;)
« Last Edit: 05 / October / 2013, 17:25:56 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Online philmoz

  • *****
  • 3163
    • Photos
Re: cleanup of Show OSD menu item
« Reply #1 on: 05 / October / 2013, 19:36:14 »
Attached is a small patch file that I believe cleans up a nagging issue with the OSD display.

Currently,  if the OSD Menu item "Show OSD" is set to disabled,  the "animated" icons for battery,  file space, USB remote and the clock will still display in <ALT> modes.  This is particularly annoying if a script is running and requires each icon to be disabled individually in order to hide them.

This fix add a quick check of conf.show_osd at the start of the osd_visible() routine.  I've tested it in all the modes I could think but I don't have a touchscreen camera so need philmoz or someone to verify it does not break that interface.

I also cleaned up the tabs / spacing in that routine ;)

While this works, it also highlights that there are other things that are not consistent in the current display spaghetti.

Even when conf.show_osd is set to 0 the following OSD elements still display (in and out of ALT mode).
- RAW state & counter
- Edge state & overlay
- Histogram
- DOF calulator
- Override state display (Tv, Av, ISO, etc)
- Misc values
- Grid overlay

Whether all of these should be disabled by conf.show_osd is not clear to me - some of them could be argued either way. Whether they should show in ALT mode is also debatable - e.g. why does the edge overlay display in ALT mode when you half press the shutter.

Phil.
« Last Edit: 05 / October / 2013, 19:48:28 by philmoz »
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)

Re: cleanup of Show OSD menu item
« Reply #2 on: 05 / October / 2013, 20:27:40 »
While this works, it also highlights that there are other things that are not consistent in the current display spaghetti.
While I was looking into it, the term spaghetti was the kindest word I used.   What's there is typical of something built over time by various programmers who added just enough functionality to get the features they needed working.   Things get enabled & disabled in different parts of the code based on different conditional test and weird stuff "goes bump in the night".   The patch I posted just fixes the one that currently bugs me the most.

Quote
Whether all of these should be disabled by conf.show_osd is not clear to me - some of them could be argued either way. Whether they should show in ALT mode is also debatable - e.g. why does the edge overlay display in ALT mode when you half press the shutter.

So what to do?  Add the one or two things we seem to think we need now?  Or do nothing and live without useful functionality that we know how to implement but can't stomach adding "as is"?   Or do we seek a volunteer to clean up all the gui_xxxx.c code?
Ported :   A1200    SD940   G10    Powershot N    G16

*

Online philmoz

  • *****
  • 3163
    • Photos
Re: cleanup of Show OSD menu item
« Reply #3 on: 05 / October / 2013, 20:34:33 »
While this works, it also highlights that there are other things that are not consistent in the current display spaghetti.
While I was looking into it, the term spaghetti was the kindest word I used.   What's there is typical of something built over time by various programmers who added just enough functionality to get the features they needed working.   Things get enabled & disabled in different parts of the code based on different conditional test and weird stuff "goes bump in the night".   The patch I posted just fixes the one that currently bugs me the most.

Quote
Whether all of these should be disabled by conf.show_osd is not clear to me - some of them could be argued either way. Whether they should show in ALT mode is also debatable - e.g. why does the edge overlay display in ALT mode when you half press the shutter.

So what to do?  Add the one or two things we seem to think we need now?  Or do nothing and live without useful functionality that we know how to implement but can't stomach adding "as is"?   Or do we seek a volunteer to clean up all the gui_xxxx.c code?

I don't have a problem with this patch for now; but I'm leaning towards the 'nuke from orbit' approach to the current code :)

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)


Re: cleanup of Show OSD menu item
« Reply #4 on: 05 / October / 2013, 20:38:17 »
I don't have a problem with this patch for now; but I'm leaning towards the 'nuke from orbit' approach to the current code :)
So we have a volunteer?   If so, once again you are stepping in to fix the unglamorous parts of CHDK that need fixing.  The community owes you a big debt.

Ported :   A1200    SD940   G10    Powershot N    G16

Re: cleanup of Show OSD menu item
« Reply #5 on: 06 / October / 2013, 21:30:04 »
Even when conf.show_osd is set to 0 the following OSD elements still display (in and out of ALT mode).
- RAW state & counter
- Edge state & overlay
- Histogram
- DOF calulator
- Override state display (Tv, Av, ISO, etc)
- Misc values
- Grid overlay
Whether all of these should be disabled by conf.show_osd is not clear to me - some of them could be argued either way. Whether they should show in ALT mode is also debatable - e.g. why does the edge overlay display in ALT mode when you half press the shutter.

Not sure how we decide which of those (if any) to change,  but if they are updated to call osd_visible() with the change to look at conf.show_osd ,  then there is a single routine to call and verify if the OSD is active or not.   In other words,  I would like to see the patch added to the trunk regardless of future plans to refactor the OSD stuff.


Ported :   A1200    SD940   G10    Powershot N    G16

*

Online philmoz

  • *****
  • 3163
    • Photos
Re: cleanup of Show OSD menu item
« Reply #6 on: 09 / October / 2013, 06:40:04 »
Even when conf.show_osd is set to 0 the following OSD elements still display (in and out of ALT mode).
- RAW state & counter
- Edge state & overlay
- Histogram
- DOF calulator
- Override state display (Tv, Av, ISO, etc)
- Misc values
- Grid overlay
Whether all of these should be disabled by conf.show_osd is not clear to me - some of them could be argued either way. Whether they should show in ALT mode is also debatable - e.g. why does the edge overlay display in ALT mode when you half press the shutter.

Not sure how we decide which of those (if any) to change,  but if they are updated to call osd_visible() with the change to look at conf.show_osd ,  then there is a single routine to call and verify if the OSD is active or not.   In other words,  I would like to see the patch added to the trunk regardless of future plans to refactor the OSD stuff.

I've added this to trunk in revision 3144.
I fixed display of the RAW state and Misc values to be controlled by 'Show OSD'.

Also cleaned up the ALT string generation code.

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)

*

Online philmoz

  • *****
  • 3163
    • Photos
Re: cleanup of Show OSD menu item
« Reply #7 on: 16 / October / 2013, 22:17:08 »
Even when conf.show_osd is set to 0 the following OSD elements still display (in and out of ALT mode).
- RAW state & counter
- Edge state & overlay
- Histogram
- DOF calulator
- Override state display (Tv, Av, ISO, etc)
- Misc values
- Grid overlay
Whether all of these should be disabled by conf.show_osd is not clear to me - some of them could be argued either way. Whether they should show in ALT mode is also debatable - e.g. why does the edge overlay display in ALT mode when you half press the shutter.

Not sure how we decide which of those (if any) to change,  but if they are updated to call osd_visible() with the change to look at conf.show_osd ,  then there is a single routine to call and verify if the OSD is active or not.   In other words,  I would like to see the patch added to the trunk regardless of future plans to refactor the OSD stuff.

Initial patch to cleanup OSD code (for review).
Should only be minor changes to the way the OSD works (more items controlled by conf.show_osd).

Please test and report any issues here.

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)


Re: cleanup of Show OSD menu item
« Reply #8 on: 16 / October / 2013, 22:44:48 »
Initial patch to cleanup OSD code (for review).
Should only be minor changes to the way the OSD works (more items controlled by conf.show_osd).
Phew ... big patch file.   I thrown my "thanks" into the mix right now.

Doesn't seem to be any script changes - so far so good. 

Anything in particular you want us to look at - the patch file doesn't give me a great clue about what you were hoping for from a high level?  Everything should work the same or something should be different?

Update : okay - you comments say SSDD ..  got it.

I see you dug into the OSD items ... did you happen to add the debug data display to the OSD editor?

« Last Edit: 16 / October / 2013, 22:51:13 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Online philmoz

  • *****
  • 3163
    • Photos
Re: cleanup of Show OSD menu item
« Reply #9 on: 17 / October / 2013, 01:26:02 »
Initial patch to cleanup OSD code (for review).
Should only be minor changes to the way the OSD works (more items controlled by conf.show_osd).
Phew ... big patch file.   I thrown my "thanks" into the mix right now.

Doesn't seem to be any script changes - so far so good. 

Anything in particular you want us to look at - the patch file doesn't give me a great clue about what you were hoping for from a high level?  Everything should work the same or something should be different?

Update : okay - you comments say SSDD ..  got it.

I see you dug into the OSD items ... did you happen to add the debug data display to the OSD editor?

Hopefully it's functionally pretty much the same - mostly about reorganising the code so I can make some sense of it :)

Mainly concerned that nothing is substantially broken.

The debug display takes up most of the screen - not sure there's much point being able to move it?

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)

 

Related Topics