- Posts: 253
Devo 10 - gui element Big-box not working
- WheresWaldo
- Topic Author
- Offline
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:
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.
Please note that the attached file is from the layout directory not a model configuration .ini file
Please Log in or Create an account to join the conversation.
- WheresWaldo
- Topic Author
- Offline
- Posts: 253
- Why are the dimensions of both boxes exactly the same? (main_page.c - lines 31,32)
- It appears the same SMALL_FONT is used for both boxes, am I reading this correctly?
- 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.
Please Log in or Create an account to join the conversation.
- WheresWaldo
- Topic Author
- Offline
- Posts: 253
case ELEM_BIGBOX:
str = _tr("BBox"); /* "BBox" to differentiate it from "Box" */
break;
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).
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
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.
Please Log in or Create an account to join the conversation.
- WheresWaldo
- Topic Author
- Offline
- Posts: 253
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.
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
This select-statement only sets a label if an element is already defined as BIGBOX.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;
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.
- vlad_vy
- Offline
- Posts: 3333
Please Log in or Create an account to join the conversation.
- WheresWaldo
- Topic Author
- Offline
- Posts: 253
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.
- WheresWaldo
- Topic Author
- Offline
- Posts: 253
rbe2012 wrote:
This select-statement only sets a label if an element is already defined as BIGBOX.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;
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.
Please Log in or Create an account to join the conversation.
- sbstnp
- Offline
- Posts: 649
Devo 10 + 4in1
FrSky Taranis + TBS Crossfire
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
I am still searching for the reason...
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
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 foundsbstnp 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.
#define ELEM_BIGBOX ELEM_SMALLBOX
This is the bug. The case is not that big boxes are not completely implemented but not completely deactivated!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.
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.
- WheresWaldo
- Topic Author
- Offline
- Posts: 253
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.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.
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
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);
}
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.
- WheresWaldo
- Topic Author
- Offline
- Posts: 253
I am sad
Please Log in or Create an account to join the conversation.
- WheresWaldo
- Topic Author
- Offline
- Posts: 253
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.
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
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.
- WheresWaldo
- Topic Author
- Offline
- Posts: 253
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
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:
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Development
- Devo 10 - gui element Big-box not working