Devo 10 - gui element Big-box not working

More
13 Oct 2013 15:39 - 13 Oct 2013 16:40 #14562 by WheresWaldo
Devo 10 - gui element Big-box not working was created by WheresWaldo
I have been playing around with templates and trying to match some of the features that were in the release 3.0.0 and I found another element not working. If you try to use the Big-box element it does not display anything, Small-box works as expected.

To test what I did was take the default.ini in /filesystem/devo10/layout and copy it to a new file. Made the following changes in the [gui-128x64] section:

  • [gui-128x64]
    V-trim=59,10,1
    H-trim=5,59,3
    V-trim=65,10,2
    H-trim=74,59,4
    Small-box=2,22,Ch3
    Small-box=2,31,timer1
    Small-box=2,39,timer2

    Big-box=2,22,Ch3
    Small-box=2,39,timer1
    Small-box=2,47,timer2

    Model=75,20

  • Small boxes still display in their new locations, but Big-box does nothing, of course the model icon is also gone since I removed that line. If someone can look at this code and with the fix for the Graph element from last week I can recreate some of the layouts that exist in the release version of 3.0.0.

    Since I am at work today I do not have access to my source files, so I can't look at the main config to see if it was a typo or not included like the graphs were.

    Thanks in advance.

    File Attachment:

    File Name: phoenix.ini
    File Size:1 KB

    Please note that the attached file is from the layout directory not a model configuration .ini file
    Attachments:
    Last edit: 13 Oct 2013 16:40 by WheresWaldo.

    Please Log in or Create an account to join the conversation.

    More
    13 Oct 2013 18:08 - 13 Oct 2013 18:18 #14567 by WheresWaldo
    Replied by WheresWaldo on topic Devo 10 - gui element Big-box not working
    I have a secondary question regarding Big-box vs. Small-box:
    1. Why are the dimensions of both boxes exactly the same? (main_page.c - lines 31,32)
    2. It appears the same SMALL_FONT is used for both boxes, am I reading this correctly?
    3. Would it make more sense to use TINY_FONT and shrink the dimensions of SMALLBOX_H slightly (maybe to 8 pixels) and increase the size of BIGBOX_H slightly (maybe to 10 or 11)?

    The observation above were made while looking at the code online in Firefox and not locally so I might have missed something moving between files and trying to remember what I was just looking at.

    BTW, I am more than happy to test any code changes, I do have the MinGW environment set up on my Windows box and it only takes about 3 minutes to compile a new version of the firmware or compile a new emu executable.

    Since I am still a noob to bitbucket I still haven't figured out how to migrate code changes from one repository to my own so I am re-editing the code on my local machine. I can update entire repositories but can't figure out how to pull a specific commit from somebody else into my own.
    Last edit: 13 Oct 2013 18:18 by WheresWaldo.

    Please Log in or Create an account to join the conversation.

    More
    13 Oct 2013 18:24 - 13 Oct 2013 18:41 #14569 by WheresWaldo
    Replied by WheresWaldo on topic Devo 10 - gui element Big-box not working
    I am starting to feel like I am talking to myself, I think the following three lines need to be added to the case statement in /deviation/src/pages/128x64x1/main_config.c somewhere between lines 86, 87:
    case ELEM_BIGBOX:
            str = _tr("BBox"); /* "BBox" to differentiate it from "Box" */
            break;
    I think this is the only part of the GUI left unimplemented in the Devo10/Devo7. If this is the case and it can be corrected, I can modify the layout files and come up with screens that more accurately match some of the model configs created for 3.0.0.

    I really like the direction used with layout files, keeping the screen stuff out of the model configs will allow making the models more generic and not needing to create three versions of each file, just include a layout .ini file that matches up with your model .ini files. It would be nice if the model .ini files then had a reference to the layout .ini file like it does with modelico .bmp files (that was a subtle attempt at a feature request).
    Last edit: 13 Oct 2013 18:41 by WheresWaldo. Reason: spelling

    Please Log in or Create an account to join the conversation.

    • rbe2012
    • rbe2012's Avatar
    • Offline
    • So much to do, so little time...
    More
    13 Oct 2013 19:53 - 13 Oct 2013 19:54 #14578 by rbe2012
    Replied by rbe2012 on topic Devo 10 - gui element Big-box not working
    I actually don't have enough time to read your posts completely, but the first thing what came into my mind is a missing font.
    I will look at this tomorrow. Could be interesting how your config.ini looks like (did you change anything in there? Works only manually...).

    EDIT: I will also look into the code you mentioned.
    Last edit: 13 Oct 2013 19:54 by rbe2012.

    Please Log in or Create an account to join the conversation.

    More
    13 Oct 2013 21:03 - 13 Oct 2013 21:05 #14580 by WheresWaldo
    Replied by WheresWaldo on topic Devo 10 - gui element Big-box not working
    No changes to config.ini, although will need to to specify the proper font file, It is still at the default 5x7.fon. Many of the options on the Devo10 use 5x7 although all fonts seem to be present in the filesysystem/devo10/media directory, just seems like a rush job when the GUI was translated to the Devo10. I will look at the code some more to see if I can figure out how it's written and maybe I can point you to some specific locations, or I might even get lucky and make it work!

    FYI, doesn't work on the emulator or on the Devo10 if you are using the PB nightly or your code or my hybrid code on my local machine.
    Last edit: 13 Oct 2013 21:05 by WheresWaldo.

    Please Log in or Create an account to join the conversation.

    • rbe2012
    • rbe2012's Avatar
    • Offline
    • So much to do, so little time...
    More
    14 Oct 2013 06:08 #14597 by rbe2012
    Replied by rbe2012 on topic Devo 10 - gui element Big-box not working

    WheresWaldo wrote: I think the following three lines need to be added to the case statement in /deviation/src/pages/128x64x1/main_config.c somewhere between lines 86, 87:

    case ELEM_BIGBOX:
            str = _tr("BBox"); /* "BBox" to differentiate it from "Box" */
            break;

    This select-statement only sets a label if an element is already defined as BIGBOX.
    I think this will not be enough to activate them.

    Obviously big boxes are not implemented - might be simply forgotten or there is a good reason for this.

    Please Log in or Create an account to join the conversation.

    More
    14 Oct 2013 06:22 #14598 by vlad_vy
    Replied by vlad_vy on topic Devo 10 - gui element Big-box not working
    Devo 10: If I try add 'Big-Box' at 'Main page config', nothing added, then if I scroll down at 'Main page config' emulator crashed.

    Please Log in or Create an account to join the conversation.

    More
    14 Oct 2013 06:41 #14599 by WheresWaldo
    Replied by WheresWaldo on topic Devo 10 - gui element Big-box not working

    vlad_vy wrote: Devo 10: If I try add 'Big-Box' at 'Main page config', nothing added, then if I scroll down at 'Main page config' emulator crashed.


    Exactly what I am getting in both the emulator or on the Devo10. It simply shows a blank line and when you scroll to the blank line the Devo10 resets.

    Please Log in or Create an account to join the conversation.

    More
    14 Oct 2013 06:45 - 14 Oct 2013 06:46 #14600 by WheresWaldo
    Replied by WheresWaldo on topic Devo 10 - gui element Big-box not working

    rbe2012 wrote:

    WheresWaldo wrote: I think the following three lines need to be added to the case statement in /deviation/src/pages/128x64x1/main_config.c somewhere between lines 86, 87:

    case ELEM_BIGBOX:
            str = _tr("BBox"); /* "BBox" to differentiate it from "Box" */
            break;

    This select-statement only sets a label if an element is already defined as BIGBOX.
    I think this will not be enough to activate them.

    Obviously big boxes are not implemented - might be simply forgotten or there is a good reason for this.


    Yeah not completely implemented, you can however select Big-box in the main screen config, just when you do it simply adds a blank line that when you scroll to set its source the firmware crashes back to the startup screen. The emulator dies a merciless and inelegant death.
    Last edit: 14 Oct 2013 06:46 by WheresWaldo.

    Please Log in or Create an account to join the conversation.

    More
    14 Oct 2013 07:00 #14602 by sbstnp
    Replied by sbstnp on topic Devo 10 - gui element Big-box not working
    Bigbox doesn't work on BW screens, resolution is too low to be of any use. Probably it should be removed altogether, unless there is a genuine need for a large font timer or something.

    Devo 10 + 4in1
    Spektrum Dx9
    FrSky Taranis + TBS Crossfire

    Please Log in or Create an account to join the conversation.

    • rbe2012
    • rbe2012's Avatar
    • Offline
    • So much to do, so little time...
    More
    14 Oct 2013 07:20 #14606 by rbe2012
    Replied by rbe2012 on topic Devo 10 - gui element Big-box not working
    I have seen some places in the code where the bigger boxes are treated different to other elements (like in main_config.c lines 159 and 164).
    I am still searching for the reason...

    Please Log in or Create an account to join the conversation.

    • rbe2012
    • rbe2012's Avatar
    • Offline
    • So much to do, so little time...
    More
    14 Oct 2013 07:26 #14608 by rbe2012
    Replied by rbe2012 on topic Devo 10 - gui element Big-box not working

    sbstnp wrote: Bigbox doesn't work on BW screens, resolution is too low to be of any use. Probably it should be removed altogether, unless there is a genuine need for a large font timer or something.

    This is what I had in mind all the time but it was more a guess than knowledge. But it will explain why big boxes are handled different... I also found
    #define ELEM_BIGBOX ELEM_SMALLBOX
    in main_page.c which forced big boxes to be threated as small ones.

    WheresWaldo wrote: Yeah not completely implemented, you can however select Big-box in the main screen config, just when you do it simply adds a blank line that when you scroll to set its source the firmware crashes back to the startup screen. The emulator dies a merciless and inelegant death.

    This is the bug. The case is not that big boxes are not completely implemented but not completely deactivated!
    I open a bug in my repo and solve it later in the evening...

    Please Log in or Create an account to join the conversation.

    More
    14 Oct 2013 07:46 #14610 by WheresWaldo
    Replied by WheresWaldo on topic Devo 10 - gui element Big-box not working

    sbstnp wrote: Bigbox doesn't work on BW screens, resolution is too low to be of any use. Probably it should be removed altogether, unless there is a genuine need for a large font timer or something.

    As I keep getting older and my arms are too short to see very small elements on the screen, I was excited to see Big-box in the source, but if no one else wants a slightly bigger text box then I guess it should be removed. Personally I would rather see it stay.

    Please Log in or Create an account to join the conversation.

    • rbe2012
    • rbe2012's Avatar
    • Offline
    • So much to do, so little time...
    More
    14 Oct 2013 08:37 #14612 by rbe2012
    Replied by rbe2012 on topic Devo 10 - gui element Big-box not working
    I changed the code to skip the big box for the little screen:
    diff -r 58e910fd57e6 src/pages/common/_main_config.c
    --- a/src/pages/common/_main_config.c	Tue Sep 03 11:57:08 2013 +0200
    +++ b/src/pages/common/_main_config.c	Mon Oct 14 10:28:40 2013 +0200
    @@ -81,6 +81,10 @@
         (void)data;
         (void)obj;
         lp.newelem = GUI_TextSelectHelper(lp.newelem, 0, ELEM_LAST-1, dir, 1, 1, NULL);
    +    if (LCD_WIDTH == 128 && lp.newelem == ELEM_BIGBOX) {    // skip ELEM_BIGBOX, not supported on 128x64-screen
    +        if (dir > 0) lp.newelem = lp.newelem == ELEM_LAST-1 ? ELEM_LAST-1 : lp.newelem+1;
    +        if (dir < 0) lp.newelem = lp.newelem == 0           ? 0           : lp.newelem-1;
    +    }
         return GetElemName(lp.newelem);
     }
    No way of selecting leads to no crashes...
    What about loading a config from a model file? Big boxes should be transformed to small:
    diff -r 58e910fd57e6 src/config/model.c
    --- a/src/config/model.c	Tue Sep 03 11:57:08 2013 +0200
    +++ b/src/config/model.c	Mon Oct 14 10:36:16 2013 +0200
    @@ -399,6 +399,7 @@
             printf("Could not parse coordinates from %s=%s\n", name,value);
             return 1;
         }
    +    if (LCD_WIDTH == 128 && type == ELEM_BIGBOX) type = ELEM_SMALLBOX; // translate big to small boxes on 128x64-screen
         switch(type) {
             //case ELEM_MODEL:  //x, y
             case ELEM_VTRIM:  //x, y, src

    Please Log in or Create an account to join the conversation.

    More
    14 Oct 2013 14:52 - 14 Oct 2013 14:53 #14636 by WheresWaldo
    Replied by WheresWaldo on topic Devo 10 - gui element Big-box not working
    If you take a config that has Big-box in it, with your changes, it displays as a Small-box. if you re-save it is a Small-box. So I guess it works as intended.

    I am sad :(
    Last edit: 14 Oct 2013 14:53 by WheresWaldo. Reason: spelling

    Please Log in or Create an account to join the conversation.

    More
    14 Oct 2013 19:26 - 14 Oct 2013 19:28 #14642 by WheresWaldo
    Replied by WheresWaldo on topic I would like this to be reconsidered
    rbe2012, I would like you to reconsider eliminating this. I was able to make a few code changes (remember I am not a programmer and know nothing of C code), and get the Big-box to display on the 128x64 screen.



    Here is what I tried out:

    128x64/main_page.c
    -#define BIGBOX_H 9
    +#define BIGBOX_H 18
    -#define ELEM_BIGBOX ELEM_SMALLBOX


    common/_main_page.c
    Removed every instance of #ifndef ELEM_BIGBOX .. #endif leaving the statements in between unchanged.

    Didn't know where to change this in the source so in filesystem\media\config.ini I changed the fonts for [font-smallbox] & [font-smallboxneg] to 04b03 and the fonts for [font-bigbox] & [font-bigboxneg] to 14bold.

    No errors compiling the emu_devo10.exe

    The issue is still the main screen configuration, when you select Big-box it shows a blank line you cannot scroll past the blank line or it will crash. You can hit the long-ENT button and move the Big-box wherever you want to and can exit out to save the model file. The resulting model file will have a Big-box= line with the proper coordinates but will have 'None' as the source. You can change the source manually to any of the defined sources and save the file, reload it in the emulator an you will have a screen like is attached to this message. It still does not show on the main page configuration screen so you still can't edit it in the emulator or on the Devo7/10 but it is almost fully functional.
    Attachments:
    Last edit: 14 Oct 2013 19:28 by WheresWaldo. Reason: spelling

    Please Log in or Create an account to join the conversation.

    • rbe2012
    • rbe2012's Avatar
    • Offline
    • So much to do, so little time...
    More
    14 Oct 2013 19:48 #14644 by rbe2012
    Replied by rbe2012 on topic I would like this to be reconsidered
    I will look at this tomorrow.
    I did not want to eliminate the big boxes, just the errors and crashes in connection with these. This is what I achieved with my quick changes.
    I am quite sure that it will be possible to implement them and waht I have seen from you looks really good.
    As said above, I'll take a deeper look tomorrow.

    Please Log in or Create an account to join the conversation.

    More
    14 Oct 2013 21:32 - 14 Oct 2013 21:33 #14648 by WheresWaldo
    Replied by WheresWaldo on topic I would like this to be reconsidered
    Just a quick note, it also works on emu_7e, but you can't actually select it to add. It already needs to be in the model.ini file.
    Last edit: 14 Oct 2013 21:33 by WheresWaldo.

    Please Log in or Create an account to join the conversation.

    • rbe2012
    • rbe2012's Avatar
    • Offline
    • So much to do, so little time...
    More
    17 Oct 2013 14:44 #14726 by rbe2012
    Replied by rbe2012 on topic Working to allow big boxes in Devo10

    WheresWaldo wrote: Didn't know where to change this in the source so in filesystem\media\config.ini I changed the fonts for [font-smallbox] & [font-smallboxneg] to 04b03 and the fonts for [font-bigbox] & [font-bigboxneg] to 14bold.


    A 14bold font is not included in the devo10/media folder. There are only 04b03.fon and 12normal.fon so only these two (5x7 for the first) can be used in the config.ini (or you get errors like "Couldn't open font file: media/14bold.fon"). If you had success with 14bold.fon you have probably copied the font file from somewhere else.
    But with 12normal the values are bigger than in a small box:

    Attachments:

    Please Log in or Create an account to join the conversation.

    • rbe2012
    • rbe2012's Avatar
    • Offline
    • So much to do, so little time...
    More
    17 Oct 2013 15:25 #14727 by rbe2012
    Replied by rbe2012 on topic Working to allow big boxes in Devo10
    Got them working. Still no idea why they were disabled... Same with the bars.

    Please Log in or Create an account to join the conversation.

    Time to create page: 0.111 seconds
    Powered by Kunena Forum