cancel
Showing results for 
Search instead for 
Did you mean: 

Inconsistent asset generation

SZano
Associate III

I can correctly convert the assets from inside the Designer, either with "Run simulator" or "Generate code" (which I assume are identical, as far as converting assets goes).

I selected "remap texts" from the config options in the Designer.

Indeed, the texts from all languages are merged in a single table.

However, when I compile and run the simulator using Visual Studio, the assets get regenerated automatically (which is very convenient), but with different options; in particular, texts are no longer remapped.

The problem seems to be that the auto-generated GCC and MSVS files completely lack the config options.

"generated\simulator\msvs\touchgfx_prebuild.targets": this file contains a command ""$(touchgfx_env)\MinGW\msys\1.0\ruby193\bin\ruby.exe" "$(TouchGFXReleasePath)\framework\tools\textconvert\main.rb" "$(ApplicationRoot)\assets\texts\texts.xlsx" "$(TouchGFXReleasePath)\framework\tools\fontconvert\build\win\fontconvert.out" "$(ApplicationRoot)\generated\fonts" "$(ApplicationRoot)\generated\texts" "$(ApplicationRoot)\assets\fonts" "$(ApplicationRoot)""

In this command, the final "remap", "A4", "binary_translations" options are missing.

If I add them manually, they work ok.

However, they are not overwritten by the Designer, so they won't be in sync anymore if I change the config in the Designer.

Shouldn't they be kept in sync automatically? When is this file generated/edited?

The same seems to be true for the GCC makefile "generated\simulator\gcc\Makefile", which lacks the options on this line

@ruby $(textconvert_script_path)/main.rb $(text_database) $(fontconvert_executable) $(asset_fonts_output) $(asset_texts_output) $(asset_fonts_input) .

I haven't tried fiddling with this file.

The MSVS and GCC files also include commands to convert the images, and those too seem to be lacking the options, but I haven't investigated them since I haven't experienced problems with images.

Related to this is another problematic behavior: the designer generates the file "generated\simulator\gcc\Makefile" with "WARN = error all extra [...]", which turns every warning into an error (including many pedantic ones).

This file is overwritten when clicking "Run simulator", so I can't just edit it.

The Designer should either allow you to change those settings through its GUI, or it should update the makefile only in the parts that are actually necessary.

By the way, the makefile contains a comment "### END OF USER SECTION. THE FOLLOWING SHOULD NOT BE MODIFIED ###", but the whole file gets regenerated, even the lines above this comment.

1 REPLY 1
Alexandre RENOUX
Principal

Hello,

In file "generated\simulator\gcc\Makefile", "WARN = error all extra [...]" might be indeed too restrictive, we will think if we should modify it in the future.

Nevertheless, you are right and everything that is in the generated/ folder is overwritten. However, you can still change the file "simulator\gcc\Makefile" because this one is not overwritten by TouchGFX. Actually "simulator\gcc\Makefile" is run and then you run the "generated\simulator\gcc\Makefile".

So one solution can be to modify "simulator\gcc\Makefile" and change the makefile you want to execute. You create your own Makefile and call this one instead like illustrated below.

all: $(filter assets,$(MAKECMDGOALS))
all assets: $(filter clean,$(MAKECMDGOALS))
all clean assets:
	@$(MAKE) -r -f test/gcc/Makefile -s $(MFLAGS) $@ -C "$(application_path)"
endif

/Alexandre