Overview of customizing ACS Code Generator DLLs - TDK Legacy model (TDK)
This topic provides information for customizing a
TDK Legacy model -
TDK Legacy models were provided with
TDK 6.2 and earlier.
Tell me more...
ACS uses a selected Code Generator DLL to generate code files.
TDK generates an ACS Code Generator DLL from a TDK model.
If you want to change how the code files are generated, you customize a copy of the TDK Legacy model from which the ACS Code Generator DLL was generated, and then use TDK to generate a new ACS Code Generator DLL.
A TDK Legacy model contains a set of generation templates that control how code is generated by ACS. To customize the generation of code, you change the generation templates that are stored in a TDK Legacy model. Each generation template is stored as an Operation in the TDK Legacy model - the Operation is stereotyped by the GenModule stereotype and the content of the generation template is stored in the Body property of the Operation.
|
When creating a new ACS Code Generator DLL, ensure that you change the name of the ACS Code Generator DLL that will be generated, else you may overwrite an existing ACS Code Generator DLL. You specify the name of the Code Generator DLL that will be generated through the TemplateList tag definition of the Generator stereotype that is applied to the model.
|
ACS calls the Generate.sdl template for each item selected (either directly or indirectly) for generation through ACS. The Generate.sdl generation template calls other generation templates through the %load keyword, and in turn those generation templates can call other generation templates. To determine which generation template files are called by a generation template, search for %load in the generation template.
Before customizing the generation templates in a TDK Legacy model you should familiarize yourself with the keywords, substitution tokens and operators they use. The generation templates can contain the following information:
• Text that is generated to the code files.
• Keywords for:
|
The generation templates use the Modeler automation interface to extract information about the model items and properties. The automation interface names of items and properties are occasionally different from the names displayed in Modeler. The Dictionary Item and Property topics in the Reference section of the Help have links to their associated automation interface topics. The reference topics indicate when the automation interface name is different from that used in Modeler.
|
State machine generation
Some ACS Code Generator DLLs generate code for State Diagrams defined in the model. The names of the generation templates associated with the state machine generation begin with SMG, such as SMGParameters.sdl. When generating state machines, ACS creates virtual model items to implement the state diagrams, before generating code using the real and virtual model items. The structure and properties of the virtual model items are the same as real model items, except that the type of a virtual model item is prefixed with SMG. The generation templates navigate virtual items and interrogate their properties through the following system variables:
• sysSMGClassObjects — lists virtual classes and their virtual items.
• sysSMGStateMachines — lists virtual state diagrams.
• sysSMGStates — lists virtual states on the virtual state diagrams.
• sysSMGTypeDefVectors — lists virtual type definitions and their virtual enumeration literals.