Author Topic: Flexible info screen  (Read 17354 times)

Greg

  • Hero Member
  • *****
  • Posts: 550
Re: Flexible info screen
« Reply #25 on: May 31, 2013, 12:54:44 AM »
On the 550D works loading config?

nicxor

  • Just arrived
  • *
  • Posts: 2
Re: Flexible info screen
« Reply #26 on: June 02, 2013, 11:47:06 AM »
Is it possible to add hyperfocal info and focus distance ?
I'm on 500d

Flexinfo is really awesome !!

pravdomil

  • Member
  • ***
  • Posts: 166
Re: Flexible info screen
« Reply #27 on: July 29, 2013, 03:54:24 AM »

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 3061
Re: Flexible info screen
« Reply #28 on: July 29, 2013, 08:01:19 PM »
there is no 5D2 version yet?
sure, create a pull req then.
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

pravdomil

  • Member
  • ***
  • Posts: 166
Re: Flexible info screen
« Reply #29 on: July 29, 2013, 08:27:32 PM »

pravdomil

  • Member
  • ***
  • Posts: 166
Re: Flexible info screen
« Reply #30 on: July 29, 2013, 08:30:39 PM »
hours too

pravdomil

  • Member
  • ***
  • Posts: 166
Re: Flexible info screen
« Reply #31 on: July 29, 2013, 09:16:20 PM »
it caused by
bfnt_puts(str, pos_x, pos_y, COLOR_RED, COLOR_GREEN1);
this will not print green bg, but only red text, thats why the previous screenshot
I will use INFO_FONT_LARGE

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 3061
Re: Flexible info screen
« Reply #32 on: July 29, 2013, 09:32:56 PM »
hmm true, but it works on 7D without any issue.
can you try to add a filled rectangle right before printing the text?
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

pravdomil

  • Member
  • ***
  • Posts: 166
Re: Flexible info screen
« Reply #33 on: July 29, 2013, 09:35:39 PM »
yes, I tried add some bg rect, but it was flickering sometimes
font_large is cleanest sollution or how to fix bfnt_puts func?
nice info screen
https://bitbucket.org/hudson/magic-lantern/issue/1577/bfnt_puts-doesnt-print-bg

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 3061
Re: Flexible info screen
« Reply #34 on: September 29, 2013, 12:16:17 AM »
update:

flexinfo now supports LiveView too.
just add your configuration there.
Code: [Select]
info_elem_t info_config_liveview[] =
{
    { .config = { { INFO_TYPE_CONFIG } } },
    { .text = { { INFO_TYPE_TEXT, { 150, 20, 2, .name = "Note" }}, "<FlexInfo unconfigured>", COLOR_CYAN, INFO_COL_PEEK, INFO_FONT_SMALL } },
    { .type = INFO_TYPE_END },
};

we now have dynamic configuration

just register a element using
Code: [Select]
info_elem_t *info_add_item();

you get a info_elem_t* back, that you can set up exactly like the static configuration in flexinfo.c
set its type e.g. to INFO_TYPE_STRING and fill the fields and it will print the specified string

we now have dynamic items

register a new item using info_add_item(), set its type to INFO_TYPE_DYNAMIC and register a print() function.
whenever flexinfo redraws, your code gets called and has to:
 - always update element->pos.x, y, w, h
 - paint ONLY when (run_type == INFO_PRINT)

here some example:
Code: [Select]

#include <flexinfo.h>
uint32_t dyn_print(info_elem_t *element, uint32_t run_type)
{
    element->hdr.pos.w = 200;
    element->hdr.pos.h = 40;
   
    switch(run_type)
    {
        case INFO_PRERUN:
            break;
        case INFO_PRINT:
            bmp_printf(FONT_LARGE, element->hdr.pos.x, element->hdr.pos.y, "TEST");
            break;
    }
   
    element->hdr.pos.x++;
    element->hdr.pos.x %= 600;
   
    return 0;
}

static void run_test()
{
    info_elem_t *item = info_add_item();
   
    item->dynamic.print = &dyn_print;
    item->dynamic.hdr.pos.x = 0;
    item->dynamic.hdr.pos.y = 40;
    item->dynamic.hdr.pos.z = 2;
    strcpy(item->dynamic.hdr.pos.name, "Test");

    /* set the type as last, to make sure it is not being used before in the other tasks */
    item->dynamic.hdr.type = INFO_TYPE_DYNAMIC;
   
    return;
}

Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

pravdomil

  • Member
  • ***
  • Posts: 166
Re: Flexible info screen
« Reply #35 on: September 29, 2013, 10:21:35 AM »
and what about button assigment? like the canon info screen?
You can select items and invoke custom callback function and give a pressed key as arg0.ยจ
http://www.magiclantern.fm/forum/index.php?topic=7816.0

aprofiti

  • New to the forum
  • *
  • Posts: 19
Re: Flexible info screen
« Reply #36 on: December 13, 2017, 11:09:23 PM »
I'm triyng to port flexinfo to 50D.

I enabled "FEATURE_FLEXINFO" in "features.h", copied a test configuration from 7D or 5D2 in "flexinfo.c" and used "CONFIG_50D" instead, but it doesn't show up on camera.
How can I debug it?

Also I have found a compilation error when "FEATURE_FLEXINFO_FULL" is defined:
Code: [Select]
../../src/flexinfo.c:3137:44: error: initializer element is not constant
         .children =  (struct menu_entry[]) {
                                            ^
../../src/flexinfo.c:3137:44: note: (near initialization for 'info_menus[0]')
make: *** [flexinfo.o] Error 1
Checking syntax from other sources seems coherent to this one. Solving it will maybe help understanding if is loaded but not showed.