CHDK UI version 2.0 ? - page 54 - General Discussion and Assistance - CHDK Forum  

CHDK UI version 2.0 ?

  • 542 Replies
  • 144808 Views
*

Online philmoz

  • *****
  • 3450
    • Photos
Re: CHDK UI version 2.0 ?
« Reply #530 on: 14 / May / 2013, 19:42:12 »
Advertisements
Next idea.

I'm thinking about enabling (simple) modules to draw on the screen while inactive.

To accomplish this, I'm using a function pointer which has a setter function. The setter function is exported, a module can use it to set a callback function (and un-set it prior to unloading).

The function pointer is checked and executed if not NULL in gui_draw_debug_vals_osd(). I'm using the existing gui_debug_display_modes[] array (core/gui.c) with an additional setting ("plugin") to enable/disable this display callback.

Potential uses are
- displaying special information about something the core doesn't support (example: my s1is port provides extra information about the movie frames while recording)
- enabling background display for my memory browser mod, so I can watch it while using the Canon UI
- I plan to port the EDMAC viewer from ML, it seems to be more useful when one can adjust camera settings while watching it
- ... ?

Proof of concept seems to work.

Seems reasonable.

What is the likelihood of multiple modules wanting to register? Do you need to allow more than one registration?

Is gui_draw_debug_vals_osd the best place to call it? Your change might even allow the debug code to be moved to a module using this hook.

How do you control the module once its loaded and 'run' has been called? The other simple modules take over the gui and kbd while running; but it seems these types of modules would not be able to trap any button presses, so how do you shut down the module when your done with 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)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline srsa_4c

  • ******
  • 4451
Re: CHDK UI version 2.0 ?
« Reply #531 on: 14 / May / 2013, 22:00:31 »
I'm also seeing menu glitches sometimes, it's not exclusive to user menu.
Just to be clear,  do you have the user menu enabled and you are seeing glitches in other menus?  Or is it disabled and you are seeing glitches?     (I only spent a little time looking at the code but I believe that what I saw is related to how the MENU key is handled in different menu modes)
On a camera where the Miscellaneous -> SD card menu has only one entry, clicking "make card bootable" pops up a messagebox. Dismissing that box only makes the menu redraw, but nothing is redrawn outside the menu. Not related to user menu.

What is the likelihood of multiple modules wanting to register? Do you need to allow more than one registration?
I've been thinking about this, but the current code can only handle one such pointer. The registration is done by the module, in its init function, and it resets this pointer (to NULL) right before unloading. Since I have listed 3 examples above, handling multiple modules would not be bad.

Quote
Is gui_draw_debug_vals_osd the best place to call it?
Maybe not, but it was my first idea, and it works almost the way it should (i.e. it respects the CHDK menu).
Quote
Your change might even allow the debug code to be moved to a module using this hook.
Yes, that was obvious, although the keyboard handling would need some thoughts.

Quote
How do you control the module once its loaded and 'run' has been called? The other simple modules take over the gui and kbd while running; but it seems these types of modules would not be able to trap any button presses, so how do you shut down the module when your done with it?
The module registers one of its own draw functions as the callback. I simply start it again (which calls the already loaded instance), and use its functions to make it unload (by pressing MENU).

*

Online philmoz

  • *****
  • 3450
    • Photos
Re: CHDK UI version 2.0 ?
« Reply #532 on: 14 / May / 2013, 22:12:45 »
Quote
Your change might even allow the debug code to be moved to a module using this hook.
Yes, that was obvious, although the keyboard handling would need some thoughts.

Extending the idea to the kbd task by allowing the module to register a callback there as well might work.

The module would then get a chance to intercept the buttons before the core code did - the return value could be used to tell the core not to continue with the normal button processing.

Another possibility would be to detect a long press of a button (e.g. MENU) to activate an interactive mode where you could alter module settings or force an exit. Not sure how this would work if multiple modules all wanted to do the same thing though.

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)

*

Offline srsa_4c

  • ******
  • 4451
Re: CHDK UI version 2.0 ?
« Reply #533 on: 14 / May / 2013, 22:32:37 »
Extending the idea to the kbd task by allowing the module to register a callback there as well might work.

The module would then get a chance to intercept the buttons before the core code did - the return value could be used to tell the core not to continue with the normal button processing.
Sounds good. If you have suggestions about any details (or even an implementation), they are welcome.

Quote
Another possibility would be to detect a long press of a button (e.g. MENU) to activate an interactive mode where you could alter module settings or force an exit. Not sure how this would work if multiple modules all wanted to do the same thing though.
I've been thinking about using the "debug shortcut" for one more thing (chosen by the user): it could pop up some sort of "task switcher" for modules. Not sure how this could work together with keyboard processing handed over to a module.


*

Online philmoz

  • *****
  • 3450
    • Photos
Re: CHDK UI version 2.0 ?
« Reply #534 on: 14 / May / 2013, 22:36:55 »
I'm also seeing menu glitches sometimes, it's not exclusive to user menu.
Just to be clear,  do you have the user menu enabled and you are seeing glitches in other menus?  Or is it disabled and you are seeing glitches?     (I only spent a little time looking at the code but I believe that what I saw is related to how the MENU key is handled in different menu modes)
On a camera where the Miscellaneous -> SD card menu has only one entry, clicking "make card bootable" pops up a messagebox. Dismissing that box only makes the menu redraw, but nothing is redrawn outside the menu. Not related to user menu.

If the message box ends up larger than the underlying menu then it needs MBOX_FUNC_RESTORE added to the flags in gui_mbox_init. This will force a full screen erase & redraw rather than just a redraw of the menu.

There seems to be some cases where this needs to be added - I'll take a look at some point, unless someone else wants to do 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)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: CHDK UI version 2.0 ?
« Reply #535 on: 14 / May / 2013, 22:43:49 »
If the message box ends up larger than the underlying menu then it needs MBOX_FUNC_RESTORE added to the flags in gui_mbox_init. This will force a full screen erase & redraw rather than just a redraw of the menu.

There seems to be some cases where this needs to be added - I'll take a look at some point, unless someone else wants to do it.
Maybe we can play the game of who has the slowest "roundtuit" ?   

I've assumed that the redraw when using the user menu to enter the regular menus and then trying to exit by pressing MENU again (documented here several posts ago) is something similar.   I'll look at it eventually if you get tied up - although my experience is that you chew through this at least 5x faster than I do  ;)
Ported :   A1200    SD940   G10    Powershot N    G16

*

Online philmoz

  • *****
  • 3450
    • Photos
Re: CHDK UI version 2.0 ?
« Reply #536 on: 14 / May / 2013, 22:54:12 »
I've assumed that the redraw when using the user menu to enter the regular menus and then trying to exit by pressing MENU again (documented here several posts ago) is something similar.

No that's another bug altogether - I missed that post earlier so haven't looked at it (yet).

Phil.

Edit:
Ok, the code is a bit weird. When the user menu is set to 'On Direct' it causes CHDK to open the user menu as soon as the ALT button is pressed, instead of when the MENU button is pressed.

The code is attempting to change the MENU button behaviour so that pressing menu will take you to the normal CHDK menu instead of exiting the User menu. If you use the SET button to get to the main menu instead the flag doesn't get cleared so when you next press MENU it reloads the main menu instead of leaving the menu altogether.

I would suggest getting rid of this completely so that the MENU button behaviour is always the same.
« Last Edit: 14 / May / 2013, 23:22:03 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)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: CHDK UI version 2.0 ?
« Reply #537 on: 16 / May / 2013, 00:44:34 »
I posted a few thoughts in the User Menu Editor module thread that really belong here :

Somewhat unrelated question / concern.   Some of the 1.2.0 menu seems unbalanced (best word I could come up with).  Some random thoughts (and at least one of these is my "fault") :

1) Edge overlay, Zebra & Histogram are really just fancy OSD stuff.   Is there a better way to roll them into the OSD menu? (like Grid, Misc values, state display, ...  and colored icons)

2) There seems to be a bit of cross over between CHDK settings and Miscellaneous Stuff?  Should Console be in the Scripting menu ? And Games go to the main menu?  Enable half-press shortcut keys should be in Misc rather than CHDK settings?  As should "Enable Splash Screen on Load"?

3) Remote Parameters is very buried in the middle of CHDK Settings (personal bias here ....).  Thank goodness for the User Menu.

You get the idea.  Even I have to click for a while to find things I know are there.  A newbie or casual user is definitely going to struggle.    But how to go from here?   Propose some new menu arrangements and vote?  Say "to heck with it ... its a hack" and leave things where they lie?

Are there other things that people have found after using 1.2.0 for while that we need to discuss here?
Ported :   A1200    SD940   G10    Powershot N    G16


Re: CHDK UI version 2.0 ?
« Reply #538 on: 23 / June / 2013, 15:26:45 »
As we appear to be headed for a "feature lock" on 1.2.0 pending a few cleanups of ptp by reyalp,  I have one final UI change suggestion.

It seems that the "Dark Frame Subtraction" menu item is in the wrong place.  It really has nothing to do with RAW.   

I'm thinking it would be much better placed in the Enhanced Photo Operations section - right after the Override Tv entries.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: CHDK UI version 2.0 ?
« Reply #539 on: 23 / June / 2013, 16:05:36 »
I'm thinking it would be much better placed in the Enhanced Photo Operations section - right after the Override Tv entries.

Good suggestion! But better placed below ND filter status entry

msl
« Last Edit: 23 / June / 2013, 16:07:14 by msl »
CHDK-DE:  CHDK-DE links

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal