Flexible info screen

Started by g3gg0, January 10, 2013, 12:34:19 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Greg

On the 550D works loading config?

nicxor

Is it possible to add hyperfocal info and focus distance ?
I'm on 500d

Flexinfo is really awesome !!


g3gg0

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

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

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

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

update:

flexinfo now supports LiveView too.
just add your configuration there.

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

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:


#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

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

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:
../../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.

scrax

I've tried to enable the flexinfo full menu too but got same error as aprofiti so had to edit old way for finding right Kelvin positions for 600D

Error is:
../../src/flexinfo.c:3141:44: error: initializer element is not constant
         .children =  (struct menu_entry[]) {
                                            ^
../../src/flexinfo.c:3141:44: note: (near initialization for 'info_menus[0]')
make[1]: *** [flexinfo.o] Error 1
make[1]: *** Waiting for unfinished jobs....

when compiling with
#define FEATURE_FLEXINFO_FULL
I'm using ML2.3 for photography with:
EOS 600DML | EOS 400Dplus | EOS 5D MLbeta5- EF 100mm f/2.8 USM Macro  - EF-S 17-85mm f4-5.6 IS USM - EF 70-200mm f/4 L USM - 580EXII - OsX, PS, LR, RawTherapee, LightZone -no video experience-