cancel
Showing results for 
Search instead for 
Did you mean: 

How can I force TouchGFX Designer to generate texts?

Jon Enz
Associate III

After adding many text fields, resources, and typographies to a screen, I went to compile and was met with errors that generated base classes were using text IDs that did not exist. The text ID's had been added to the source files for the containers they were used in, but not to the header file or TEXTS enum.

In an attempt to "clean" the project I deleted the contents of the TouchGFX/generated folder. The designer regenerates source files, but generated/texts/include/texts is empty. I have tried to add/remove resources in the designer so it would detect changes in the spreadsheet without any luck. With an empty folder my compile errors are now:

../TouchGFX/target/generated/TouchGFXConfiguration.cpp:17:10: fatal error: texts/TypedTextDatabase.hpp: No such file or directory
 #include <texts/TypedTextDatabase.hpp>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

How can I force the designer to regenerate these files?

6 REPLIES 6
Martin KJELDSEN
Chief III

When you "generate code" from the designer, you should get everything that's supposed to be in the "generated" folder back.

I've never seen this behavior before - can you share the project?

/Martin

Unfortunately I'm not able to share the project in the forum.

After deleting the generated folder here is the output from the generator when run on the console.

C:\src\throttle_h7\mainapp\Debug>rmdir ..\TouchGFX\generated /s
..\TouchGFX\generated, Are you sure (Y/N)? Y
 
C:\src\throttle_h7\mainapp\Debug>C:\TouchGFX\4.15.0\designer\tgfx.exe generate --path=..\TouchGFX\throttle_mainapp.touchgfx -v
Generate Code
 
Wrote generated/gui_generated/include/gui_generated/betascreen_screen/BetaScreenViewBase.hpp
 
Wrote generated/gui_generated/include/gui_generated/common/FrontendApplicationBase.hpp
 
Wrote generated/gui_generated/include/gui_generated/common/FrontendHeapBase.hpp
 
Wrote generated/gui_generated/include/gui_generated/common/SimConstants.hpp
 
Wrote generated/gui_generated/include/gui_generated/containers/Container_BatterySummaryBase.hpp
 
Wrote generated/gui_generated/include/gui_generated/containers/Container_CompassBase.hpp
 
Wrote generated/gui_generated/include/gui_generated/containers/Container_GearSelectorBase.hpp
 
Wrote generated/gui_generated/include/gui_generated/containers/Container_MotorSummaryBase.hpp
 
Wrote generated/gui_generated/include/gui_generated/containers/Container_SpeedAndPowerBase.hpp
 
Wrote generated/gui_generated/include/gui_generated/devscreen_screen/DevScreenViewBase.hpp
 
Wrote generated/gui_generated/include/gui_generated/home_screen/HomeViewBase.hpp
 
Wrote generated/gui_generated/include/gui_generated/motorcontrollerdebug_screen/MotorControllerDebugViewBase.hpp
 
Wrote generated/gui_generated/include/gui_generated/throttlescreen_screen/ThrottleScreenViewBase.hpp
 
Wrote generated/gui_generated/src/betascreen_screen/BetaScreenViewBase.cpp
 
Wrote generated/gui_generated/src/common/FrontendApplicationBase.cpp
 
Wrote generated/gui_generated/src/containers/Container_BatterySummaryBase.cpp
 
Wrote generated/gui_generated/src/containers/Container_CompassBase.cpp
 
Wrote generated/gui_generated/src/containers/Container_GearSelectorBase.cpp
 
Wrote generated/gui_generated/src/containers/Container_MotorSummaryBase.cpp
 
Wrote generated/gui_generated/src/containers/Container_SpeedAndPowerBase.cpp
 
Wrote generated/gui_generated/src/devscreen_screen/DevScreenViewBase.cpp
 
Wrote generated/gui_generated/src/home_screen/HomeViewBase.cpp
 
Wrote generated/gui_generated/src/motorcontrollerdebug_screen/MotorControllerDebugViewBase.cpp
 
Wrote generated/gui_generated/src/throttlescreen_screen/ThrottleScreenViewBase.cpp
 
Wrote generated/simulator/gcc/Makefile
 
Wrote generated/simulator/include/simulator/mainBase.hpp
 
Wrote generated/simulator/msvs/touchgfx.props
 
Wrote generated/simulator/msvs/touchgfx_prebuild.targets
 
Wrote generated/simulator/msvs/touchgfx_sdl2.props
 
Wrote generated/simulator/src/mainBase.cpp
 
Wrote generated/simulator/touchgfx.ico
 
Wrote generated/simulator/touchgfx.rc
 
Wrote generated/simulator/touchgfx.res
 
Done
 
Generate Assets
 
make -f simulator/gcc/Makefile assets -j8
 
Reading ./application.config
 
Generating generated/images/src/image_cropped-Pure-Watercraft-Logo_250.cpp
 
Generating generated/images/src/image_Icon_Battery_1x.cpp
 
Generating generated/images/src/image_Icon_Battery_4x.cpp
 
Generating generated/images/include/BitmapDatabase.hpp
 
Generating generated/images/src/BitmapDatabase.cpp
 
The fallback character differs for typography "Speed_Units" and typography "Battery_Percentage_Symbol"
 
 
Cleaning generated files from generated/texts and generated/fonts.
Generating generated/fonts/include/fonts/GeneratedFont.hpp
Generating generated/fonts/src/GeneratedFont.cpp
Generating generated/fonts/include/fonts/UnmappedDataFont.hpp
Generating generated/fonts/src/UnmappedDataFont.cpp
Generating generated/fonts/include/fonts/CachedFont.hpp
Generating generated/fonts/src/CachedFont.cpp
Generating generated/fonts/include/fonts/FontCache.hpp
Generating generated/fonts/src/FontCache.cpp
 
Done
 
Post Generate
 
touchgfx update_project --project-file=simulator/msvs/Application.vcxproj
 
Done
 
Post Generate Target
 
touchgfx update_project --project-file=../h7_mainapp.ioc --platform=m7
 
Done
 
Generation & Update complete

This still leaves me with generated/texts folder that only contains options.cache and an empty include/texts folder.

0693W000005BsNWQA0.png 

I also tried re-cloneing the project from a clean state and only copying over the .touchgfx and texts.xlsx files, but that produced the same result.

​Odd, i just created a blank project, generated from the designer and have two files "TextKeysAndLanguages.hpp" and "TypedTextDatabase.hpp". Can you try from the designer? If that works, then maybe it's an issue with tgfx.exe.

/Martin

I usually use the designer to generate the files, but used tgfx.exe here since I thought the output may have been useful.

I was able to eventually get it to generate files by re-cloning the project in a different directory and adding my changes back in one-by-one, but that's not a very sustainable workflow.

HTD
Senior III

I had the same problem just an hour ago. It costed me like 4 hours of work I deleted just trying to get it work.

Here's why: I had an "unexpected character" in a wildcard range. TouchGFX allows you enter a character it cannot process. And it's practically any character that is not alphanumeric. For those use hex codes, so to select range of all printable ASCII use 0x20-0x7e.

Anyways, I changed the offending wildcard range and it started to generate texts correctly. It's clearly TouchGFX bug and a big one.

We could avoid loss of data / work if we read the console messages on generate code.

dkkif.1
Associate

I think I discovered my problem: a Zigbee-type wi-fi hub become nearby. After transferring that, my problems to get service from wetwash went away! (At least so far. Never realize with intermittent issues!)