[Logo] TCC discussion forum
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Top Downloads] Top Downloads   [Groups] Back to home page 
[Register] Register /  [Login] Login 

Early preview of differences in tcMenu 2.0 RSS feed
Forum Index » tcMenu Arduinio library
Author Message
davetcc


Joined: Jan 19, 2019
Messages: 492
Offline
We are now quite a way through the development effort for tcMenu 2.0, it improves the rendering onto graphical displays (and even LCD to a lesser extent) with some significant new functionality. For most apps, there will be no need to change anything, and even if changes are needed, they are small. We'll continue to support 1.7 for 6 months from the release date, which we think is about a month away.

We won't be releasing it directly like prior release as it's quite a large release. Instead, we'll start with a beta version that will be available soon.

Some of the major highlights will be:

1. All the renderers now share a common base, meaning they all share far more of the code than before, this means we've been able to invest far more time into the core renderer than we could previously.
2. The U8G2 renderer will have a custom byte function for I2C displays, it yields more frequently to taskmanager, making the app feel more fluid.
3. We've reworked the way you work with graphics, it's now more like an embedded UI with grids, font, color and padding overrides.
4. It is possible to present actionable items with icons.
5. Touch screens are now supported, the first version will support resistive touch screens, with additional options following later.
5. We will support TFT_eSPI for much faster rendering, and massively improved double-buffered rendering.
6. Dialogs are now based directly on menu items and you can add additional menu items to them (you can also style / skin them like everything else too).

Most of the work is already in the repo on the master branch.



[Thumb - mono-u8g2-example.jpg]
 Filename mono-u8g2-example.jpg [Disk] Download
 Description No description given
 Filesize 33 Kbytes
 Downloaded:  17863 time(s)

[Thumb - color-rendering.jpg]
 Filename color-rendering.jpg [Disk] Download
 Description No description given
 Filesize 88 Kbytes
 Downloaded:  17683 time(s)

davetcc


Joined: Jan 19, 2019
Messages: 492
Offline
Here's an example of how we configure the grids and rendering in 2.0, taken from this example: https://github.com/davetcc/tcMenuLib/tree/master/examples/esp32Amplifier

// first we get the graphics factory
    auto & factory = renderer.getGraphicsPropertiesFactory();

    // now we add the icons that we want to use with certain menu items
    const Coord iconSize(APPICONS_WIDTH, APPICONS_HEIGHT);
    factory.addImageToCache(DrawableIcon(menuSettings.getId(), iconSize, DrawableIcon::ICON_XBITMAP, settingsIcon40Bits));
    factory.addImageToCache(DrawableIcon(menuStatus.getId(), iconSize, DrawableIcon::ICON_XBITMAP, statusIcon40Bits));
    factory.addImageToCache(DrawableIcon(menuMute.getId(), iconSize, DrawableIcon::ICON_XBITMAP, muteOffIcon40Bits, muteOnIcon40Bits));

    // and now we define that row 3 of the main menu will have three columns, drawn as icons
    factory.addGridPosition(&menuSettings, GridPosition(GridPosition::DRAW_AS_ICON_ONLY,
                                                        GridPosition::JUSTIFY_CENTER_NO_VALUE, 3, 1, 4, 45));
    factory.addGridPosition(&menuStatus, GridPosition(GridPosition::DRAW_AS_ICON_ONLY,
                                                      GridPosition::JUSTIFY_CENTER_NO_VALUE, 3, 2, 4, 45));
    factory.addGridPosition(&menuMute, GridPosition(GridPosition::DRAW_AS_ICON_ONLY,
                                                    GridPosition::JUSTIFY_CENTER_NO_VALUE, 3, 3, 4, 45));

    // here is how we completely redefine the drawing of a specific item, you can also define for submenu or default
    color_t specialPalette[] { ILI9341_WHITE, ILI9341_RED, ILI9341_BLACK, ILI9341_BLUE};
    factory.setDrawingPropertiesForItem(ItemDisplayProperties::COMPTYPE_TITLE, menuStatus.getId(), specialPalette,
                                        MenuPadding(4), nullptr, 4, 10, 30,
                                        GridPosition::JUSTIFY_CENTER_WITH_VALUE );
davetcc


Joined: Jan 19, 2019
Messages: 492
Offline
We've reversed the way that renderers are written, 90% of the code is now in the core, the outer rendering classes for U8G2, Adafruit, TFT_eSPI, mbed OLED, and STM32 display buffer are minimal, containing only code for drwaing on that display.

This means that going forward we can support many more displays with less duplication, the displays can have unprecedented levels of configuration, bringing the rendering support up to the levels of simple UI toolkits (grids, icons, custom fonts, color palettes and spacing).

We've also rebuilt the dialog on the top of the new menu support, meaning that you'll even be able to generate custom dialogs with your own buttons, sliders, and most other types of menu-item in them.

The drawing items can be configured globally, for a submenu, or for a specific item.

As we said before, the changes are large, and we want to introduce them slowly, so we'll be starting with a BETA and building up from there. The BETA will be announced here once we've done more internal testing.
davetcc


Joined: Jan 19, 2019
Messages: 492
Offline
Testing so far:

* ESP32 with ILI9341 320x240 display using TFT_eSPI library with double buffering.

Previously tested on, but interfaces need very minor work:

* ESP32 with ILI9341 320x240 display using AdafruitGFX library
* ESP8266 with SH1106 132x64 unit using the u8g2 driver.
* Mega2560 AVR using 20x4 display
* Arduino Uno using 16x2 display

Next steps:

* Support for editing of multi-edit items such as Text, IpAddress, Large numbers, and date-time values.
* Write a renderer for STM32 built-in LCD driver with a 320x240 touch screen.
* Fix up all renderers to match TFT_eSPI
* Test on all our known configurations
* Fix negative values bug
* Release early beta version - that will be for evaluation purposes only
* Update the documentation on the site
davetcc


Joined: Jan 19, 2019
Messages: 492
Offline
Updates this week on tcMenu 2.0, now tested and working on a wider range of displays:

UI fixes and changes for 2.0:

* Make a property editor for the menu item variable name and don't auto-update the variable name after the first publish (just Mac UI left to do).
* Ensure that Divisor and Unit are always sensibly defaulted on Analog items.
* Java - allow user to easily set the Arduino directory, and turn off global libraries.

Library and plugins:

* Resistive touch screen plugin ready and will be bundled in the next release.
* TFTeSPI plugin now tested extensively and will be bundled in the next plugin release
* AdafruitGFX plugin now updated and will be bundled in the next plugin release.

In progress:

* U8G2 and LiquidCrystalIO are in progress
* mbed testing
* runtime menu item editor
* esp32 touch buttons

Unit test coverage

With this release, more of tcmenu, designer, taskmanager and IoAbstraction are covered with unit tests, the embedded code, the Java API and UI, the Xamarin API and designer. Every designer UI release is heavily tested, with some of it now automated.
davetcc


Joined: Jan 19, 2019
Messages: 492
Offline
Here's the rendering running on Adafruit_GFX library, ILI9341, ST7735 and Nokia5110:

[Thumb - tcmenu2-st7735.jpg]
 Filename tcmenu2-st7735.jpg [Disk] Download
 Description No description given
 Filesize 35 Kbytes
 Downloaded:  17199 time(s)

[Thumb - tcmenu2-5110-adafruit.jpg]
 Filename tcmenu2-5110-adafruit.jpg [Disk] Download
 Description No description given
 Filesize 38 Kbytes
 Downloaded:  17329 time(s)

[Thumb - tcMenu2-ili-adafruit.jpg]
 Filename tcMenu2-ili-adafruit.jpg [Disk] Download
 Description No description given
 Filesize 26 Kbytes
 Downloaded:  16069 time(s)

davetcc


Joined: Jan 19, 2019
Messages: 492
Offline
Here's what the new menu item variable name field looks on Windows UWP, it automatically follows the item's name on new items until you either manually change the variable name, run code generation or save the menu structure. At any time you can manually edit the variable name, and pressing "regenerate" causes it to re-calculate the name immeditaely. If you are using recursive naming, and have overridden the name of a submenu, it will use that overridden value by default. Again, you can manually change it at will. It is fully backward compatible, and if the variable name wasn't previously set, it picks the traditional default.

[Thumb - tcmenu-designer-name-field.png]
 Filename tcmenu-designer-name-field.png [Disk] Download
 Description No description given
 Filesize 20 Kbytes
 Downloaded:  16760 time(s)

davetcc


Joined: Jan 19, 2019
Messages: 492
Offline
We've made some large strides in the 2.0 release, it's not so much about the size of the release, it's more about going back and making things right. More unit testing across the board, starting to put automated testing on the Windows UWP UI, and trying to ensure that things are sustainable for us going forward.

As of now, we have beta versions of all the designer UIs being tested. We consider them feature complete, and once testing is finished, they will be promoted to release status.

A couple of points for 2.0:

* We now have an "Uno" mode for liquidcrystal plugin that uses about 23K FLASH for our Uno dfrobot example. It's astonishing that the full power of our libraries can be utilized on such a small device.
* The Linux and Win7/8 UI has now caught up with the App store versions and is very close in functionality. They are both packaged and very easily installed.
* We've managed to make tcMenu lib 2.0 backward compatible in 99% of cases without even a designer round trip. We've tested the major plugins in all version combinations.
jaudo


Joined: Mar 19, 2021
Messages: 4
Offline
Is TFT e_SPI available as of today? How hard is it to migrate the Adafruit's library to the TFT e_SPI from version 1.7 code generator? Just delete the gfx calls and replace the adafruit object for the TFT e_SPI object?
davetcc


Joined: Jan 19, 2019
Messages: 492
Offline
TFT_eSPI is working on master, but master is not yet fully tested for all cases, we are about to do a large commit onto master within the next day or so. At that point, it will be feature complete for 2.0 and many of the in-flight issues will be fixed. Changing from one renderer to another is almost automatic in the designer UI. In 2.0, the biggest change will be the way the rendering classes work, they are skinnable at the cost of a little more memory. We need to go back and optimise this a bit for AVR, but for ESP32 it will be absolutely fine.

For ESP32 it's been through a number of tests as we have two boards and it's one of two core dev envs for me. 1. A AZdelivery DevKit dual core with an ESPprog debugger, touch screen, 320x240 display using TFT_eSPI. We also have another single core board with a similar display, rotary encoder and Adafruit for rendering. Be aware that documentation (other than Doxygen comments in code) is not ready for 2.0 yet.

You can easily switch to the 2.0 plugins in designer, change the library version stream from stable to beta from the settings. However, at that point, you'll need to get the master branch of tcMenu. And that needs 1.7.5 of IoAbstraction minimum.

I will announce here once the new beta UI is built and the tcMenu library beta code is done. It may be worth waiting a day or two for that to be honest.
jaudo


Joined: Mar 19, 2021
Messages: 4
Offline
davetcc wrote:TFT_eSPI is working on master, but master is not yet fully tested for all cases, we are about to do a large commit onto master within the next day or so. At that point, it will be feature complete for 2.0 and many of the in-flight issues will be fixed. Changing from one renderer to another is almost automatic in the designer UI. In 2.0, the biggest change will be the way the rendering classes work, they are skinnable at the cost of a little more memory. We need to go back and optimise this a bit for AVR, but for ESP32 it will be absolutely fine.

For ESP32 it's been through a number of tests as we have two boards and it's one of two core dev envs for me. 1. A AZdelivery DevKit dual core with an ESPprog debugger, touch screen, 320x240 display using TFT_eSPI. We also have another single core board with a similar display, rotary encoder and Adafruit for rendering. Be aware that documentation (other than Doxygen comments in code) is not ready for 2.0 yet.

You can easily switch to the 2.0 plugins in designer, change the library version stream from stable to beta from the settings. However, at that point, you'll need to get the master branch of tcMenu. And that needs 1.7.5 of IoAbstraction minimum.

I will announce here once the new beta UI is built and the tcMenu library beta code is done. It may be worth waiting a day or two for that to be honest.


Hi Dave, thank you for the early answer. Then I'll wait for the update and work with the stable 1.7 version for a few days. I really like this framework, you are doing an amazing job!

PD: Yesterday I tested the Beta 2.0 version with TFT e_SPI, I was able to test it successfully! There's a minor bug in the code generator, since it displays a "gfx" object by default when it should be "tft" as: TFT_eSPI tft;
davetcc


Joined: Jan 19, 2019
Messages: 492
Offline
We have released the first public beta of 2.0 including libraries and everything needed to try it. There is a Linux, Win7, and Win10 build available now. Up until now, most Mac users have not requested a BETA version so we usually just test these internally.

FIRST NOTE that this is a BETA version and is for evaluation only, never bake in a beta version and expect to find issues.

To try the beta version:

Step 1 - download the BETA UI and library from https://www.thecoderscorner.com/products/apps/tcmenu-designer/

Step 2 - Java version, when the root item is selected switch the stream to BETA, choose update plugins
Step 2a - UWP/Win 10 - open settings, switch stream to BETA, choose update plugins

Step 3 - replace your tcMenu library with the beta version of tcMenu that is on the above-linked page.

The expectation is that there are a few issues still in there, please report anything found here. Currently tested to some extent:

- AVR (Uno, MEGA2560)
- SAMD (MKR1300)
- ESP (Heltek Wifi ESP32, AZ Delivery DevKit ESP32, Node MCU ESP8266)
- ST mbed (STM32F439, STM32F429)
- Nano 33 BLE

Known issues:

* The new renderer is sometimes redrawing too much screen area.
* Scrolling on a list item sometimes exceeds the list range.
* Touch screen manager not respecting read-only flag on items.
* Memory footprint not yet optimized, using > 15K more than before for graphical displays, fixes will feed through during beta.
 
Forum Index » tcMenu Arduinio library
Go to:   
Mobile view
Powered by JForum 2.7.0 © 2020 JForum Team • Maintained by Andowson Chang and Ulf Dittmer

This site uses cookies to analyse traffic, serve ads by Google AdSense (non-personalized in EEA/UK), and to record consent. We also embed Twitter, Youtube and Disqus content on some pages, these companies have their own privacy policies.

Our privacy policy applies to all pages on our site

Should you need further guidance on how to proceed: External link for information about cookie management.