Project members: Profile
With profile members you specify the configuration parameters for your project. Primarily these are the Platform Package to use for the code generation, the location where generated files should be stored and the display (LCD) size. As such, profiles can exist only at the root level of the project. Profile members are represented in Composer by following bricks:
With multiple profiles and the optionally enclosed macros you can manage several device/product variant configurations within one and the same project. You can simply switch between profiles and then use the active profile for code generation or prototyping.
Add new profile
★First switch to the Composer containing the project main page.
★Then, in the Gallery window, ensure that the folder Chora is opened.
★Look in the folder for the template named Profile.
★With the mouse, select the template and drag it into the Composer.
★Drop the template within the Composer.
Adding a new profile member.
Name the profile
★First ensure, that the profile member is selected.
★Press the key F2 or select the menu item .
★Enter the new profile name in the Inspector window.
The assigned name identifies globally the profile within your project. The name appears in the profiles selection list and determines implicitly the sub-directory where generated files are stored. Moreover, you can involve the profile name in expressions to conditionally build your application or manage project variants.
Select the Platform Package
Through the choice of the Platform Packages you determine the target system to generate the code for. It also affects the conversion of colors, bitmap and font resources. As such, the right choice is obligatory for generating the correct code for your particular target device.
★First ensure, that the profile member is selected.
★In the middle area of the Inspector window locate and adapt the attribute PlatformPackage.
Specify display resolution and orientation
Every profile should be configured with resolution and orientation parameters corresponding to the display, you intend to use in the target device. For this purpose:
★First ensure, that the profile member is selected.
★In the middle area of the Inspector window locate and adapt the attribute ScreenSize.
★Accordingly locate and adapt the attribute ScreenOrientation.
Specify the application class
The choice of the application class determines the root component, the code generation should start with. Accordingly, all other project members referenced (directly or indirectly) from the application class are involved in the build process. Not referenced members, in turn, are excluded from the code generation.
★First ensure, that the profile member is selected.
★In the middle area of the Inspector window locate and adapt the attribute ApplicationClass.
Specify the output directory
Per default, Embedded Wizard stores generated files within a folder named after the profile name and located directly below the folder of your project. With the attribute OutputDirectory you can determine another location where to store the files.
★First ensure, that the profile member is selected.
★In the middle area of the Inspector window locate and adapt the attribute OutputDirectory.
If the selected Platform Package it supports, you can specify individual directories for the include (e.g. *.h), source (e.g. *.c) and resource (e.g. *.png) files. See the attributes OutputIncDirectory, OutputSrcDirectory and OutputResDirectory.
With the further attribute CleanOutputDirectories you can control how Embedded Wizard should treat outdated, superfluous files existing in the specified output directories.
Specify the output source files extension
When generating C code, Embedded Wizard uses per default the file extension .c for all created C source files. With the attribute OutputFileNameExtension you can determine another file extension as expected by your C compiler.
Configure the mode how to generated bitmap resources
Per default, Embedded Wizard generates all bitmap resources in compressed format requiring the bitmaps being decompressed when used at the runtime. You can override this behavior and generate bitmap resources directly in the color format used natively in the target system allowing the pixel information being accessed directly from the ROM code (e.g. flash memory).
★First ensure, that the profile member is selected.
★In the middle area of the Inspector window locate and adapt the attribute ModeOfBitmapResources.
Depending on your Platform Package you will eventually also need to specify how target system expects the pixel data to be stored:
★Again in Inspector window locate and adapt the attribute ColorChannelsOrder.
★Similarly locate and adapt the attribute ColorPremultipliedAlpha.
★If you are using the RGB565 color format for bitmap resources also adapt the attribute ColorChannelsOrderOfRGB565.
TIP
With the attribute ModeOfBitmapResources you determine the global mode affecting per default all bitmap resources. This setting can be overridden for each bitmap resource individually by using its attribute Mode.
Configure the mode how to generate strings
Per default, Embedded Wizard generates all string literals in compressed format requiring the strings being decompressed when used at the runtime. You can override this behavior and generate strings uncompressed allowing the information being accessed directly from the ROM code (e.g. flash memory).
★First ensure, that the profile member is selected.
★In the middle area of the Inspector window locate and adapt the attribute ModeOfStringConstants.
Configure the mode how to convert font resources
Per default, Embedded Wizard converts all font resources by using the Windows own font engine. This includes the glyph rasterization and font metrics calculation. You can override this behavior and convert the fonts by using another engine (e.g. FreeType):
★First ensure, that the profile member is selected.
★In the middle area of the Inspector window locate and adapt the attribute FontConversion.
Configure the storage location for constants and resources
Starting with version 14 you can configure the location where data belonging to constants, bitmap resources, font resources and svg resources should be stored. The data is stored either in the generated code or in so-called Blob file. Following are the steps to configure the storage location globally affecting so all or a set of constants or resources:
★First ensure, that the profile member is selected.
★In the middle area of the Inspector window locate and adapt the attribute StorageOfConstants if you want to configure the storage location for constants.
★In the middle area of the Inspector window locate and adapt the attribute StorageOfResources if you want to configure the storage location for resources.
Please note, in addition to the possibility to configure the storage location globally, each member can be configured individually where to store its data. For this purpose the members provide the attribute Storage.
Edit profile macros
Every profile can contain any arbitrary number of macro members. To add a new macro or edit existing macros open the profile in a new Composer page:
★First ensure, that the profile member is selected.
★Press the key ENTER ...
★... or double click on the profile member with the mouse.
Duplicate an existing profile
You can create any number of copies of an already existing profile member.
★First ensure, that the profile member is selected.
★Press the keys CtrlC and CtrlV in succession ...
★... or hold the key Ctrl pressed while you drag and drop the selected profile member.
★Finally rename the just duplicated profile member.
Select the current profile
The selection of the current profile affects directly the build process and the prototyping. In particular, the colors you see in the Composer or Prototyper window result from the Platform Package specified in the currently selected profile. You can easily switch between several profiles by using the profile selection combobox. Additionally when generating code in batch mode, you can select any arbitrary combination of profiles to generate the code for.
Profiles and conditional compilation
Profiles and the enclosed macro members can be evaluated in expressions and conditions allowing particular components or code fragments being compiled conditionally depending on the selected profile. Moreover, you can use the name of a profile in the Generator and VariantCond attribute of any other member in your project to control its code generation.
Delete a profile
★First ensure, that the profile member is selected.
★Press the key DEL or select the menu item .
Attributes of a profile
The following table shows the complete list of attributes provided by the profile member. Please note, depending on the Platform Package selected in the attribute PlatformPackage, some of the below listed attributes may be not available:
Attribute name |
Short description |
---|---|
Determines the name of the application class to use when generating code for a particular profile member. |
|
Determines an optional name of the application when generating code for a particular profile member. |
|
Determines an optional title of the application when generating code for a particular profile member. |
|
Determines the position and the size of a profile member brick within the Composer window. |
|
Controls how superfluous, outdated files found in output directories should be treated. |
|
Determines a CLUT (color lookup table) file to use when generating code for a particular profile member. |
|
Controls the color conversion of bitmap resources when generating code for a particular profile member. |
|
Controls the color conversion of bitmap resources when generating code for a particular profile member. Affects the RGB565 bitmaps only. |
|
Controls the color conversion of bitmap resources when generating code for a particular profile member. |
|
Contains the description for the profile member. |
|
Determines the TrueType font engine to be used for the conversion of font resources. |
|
Controls the conversion of all bitmap resources when generating code for a particular profile member. |
|
Controls the conversion of all strings when generating code for a particular profile member. |
|
Controls the format of the generated code. |
|
Optimization (Deprecated) |
Controls the optimization level when generating code for a particular profile member. |
Determines the destination directory default for all generated files. |
|
Determines the file extension for the generated C source files. |
|
Determines the destination directory particular for generated include files (e.g. *.h). |
|
Determines the destination directory particular for generated source files (e.g. *.c). |
|
Determines the destination directory particular for generated resource files (e.g. *.png). |
|
Specifies a name prefix for the generated code files. |
|
Determines the Platform Package to use when generating code for a particular profile member. |
|
Determines a command to execute at the end of the build process. |
|
Determines the actual installation orientation of the display in your target device. |
|
Determines the actual resolution of the display in your target device. |
|
Controls globally the storage location of constants when generating code for a particular profile member. Affects only constants configured with value Auto in their own Storage attribute. |
|
Controls globally the storage of bitmap resources, font resources and svg resources when generating code for a particular profile member. Affects only resources configured with value Auto in their own Storage attribute. |
|
Controls the amount of inline comments included into the generated code. |
Chora syntax of a profile
This section describes the Chora syntax of how profiles are stored inside Embedded Wizard project files. The knowledge about the syntax can be helpful when you plan to process the project contents by third party tools. In particular, the general purpose Export and Import functionality introduced in version 14 requires a good understanding of how project members are represented in Chora syntax to correctly interpret the exported members and synthesize the Chora code for members to import. Please note, Embedded Wizard project files (and thus Chora code) are encoded as text in UTF-8 format.
In Chora syntax, profile definition is always introduced with the keyword profile, followed by the name of the profile, the name of the associated Platform Package and a list of profile relevant attributes and user defined macros. The profile name and platform package name are separated by : colon sign. The attributes and subordinated macros are enclosed between a pair of following curly braces {..}. The Platform Package name corresponds to the value of the attribute PlatformPackage.
Each attribute starts with the keyword attr, followed by the name of the attribute and its value. The name and the value are separated by an assignment operator = and the complete attribute definition terminates with ; semicolon sign. Wherever necessary, the tokens are separated by whitespace signs. For the complete list of attributes please see the section Attributes of a profile. Concerning the syntax of macros, please see Chora syntax of a macro.
The definition of a profile can be initiated by a comment block providing optional description for the profile. The content of this comment corresponds to the value of the profile's attribute Description. Furthermore the directive $rect can be specified providing value for the corresponding attribute Brick. The following example demonstrates the described syntax:
// This is a profile to control the code generation for the target system \ // 'Windows.Software.RGBA8888'. // // $rect determines the position of the brick inside Composer window. $rect <10,10,210,50> profile Profile : Windows.Software.RGBA8888 { attr Verbose = false; attr ScreenSize = <800,480>; attr ApplicationClass = Application::Application; attr CleanOutputDirectories = false; attr FontConversion = Windows; attr OutputFileNameExtension = c; attr ScreenOrientation = Normal; attr StorageOfResources = Code; attr StorageOfConstants = Code; attr OutputDirectory = GeneratedCode; }
Each Chora file (or text exchanged with an external Export and/or Import tool) can be (or even should be) prefixed with $version directive. This directive determines the version number of the included Chora code. For details concerning the syntax of the version please see the chapter $version macro.