Integrations (PTC products, 3rd party products and code) > Code integration (Ada, ARINC 653, C, C#, C++, IDL, Java, SQL and VB) > Transformation Development Kit (TDK) > Customizing an ACS Code Generator DLL > Customizing a TDK 3G model > Overview of customizing ACS Code Generator DLLs - TDK 3G model (TDK)
  
Overview of customizing ACS Code Generator DLLs - TDK 3G model (TDK)
This topic provides information for customizing a TDK 3G model - TDK 3G models were previously provided for generating the ACS Code Generator DLLs, but now TDK code generation transformation patterns modes are used. Tell me more...
ACS uses a selected Code Generator DLL to generate code files. An ACS Code Generator DLL includes a Generate.sdl file and sometimes a linker and project 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 the TDK 3G model from which the ACS Code Generator DLL was generated, and then use TDK to generate a new ACS Code Generator DLL.
A TDK 3G 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 3G model. Each generation template is stored as a Class scoped Operation in the TDK 3G Model - each Operation is stereotyped by the GenModule stereotype and the content of the generation template is stored in the Body property of the Operation.
The Classes that own the generation template Operations determine which generation templates are used to generate an ACS Code Generator DLL through inheritance. The diagrams in the Generator::Model2Text package show how the Classes inherit generation templates from their super-Classes - the leaf sub-Classes represent the ACS Code Generator DLLs that can be generated.
If a TDK 3G model can generate multiple ACS Code Generator DLLs, you must set up the TDK model to generate the ACS Code Generator DLL you want to use. You do this in Modeler by right-clicking the model, and then clicking the appropriate Build Settings command
To create a new ACS Code Generator DLL that overwrites a provided ACS Code Generator DLL:
Right-click the TheGenerator package, point to Build Settings, and then click the command for the ACS Code Generator DLL you want to overwrite.
To create a new ACS Code Generator DLL that does not overwrite a provided ACS Code Generator DLL:
Right-click the TheGenerator package, point to Build Settings, and then click the command for the ACS Code Generator DLL type you want to generate. After setting up the TDK model for the ACS Code Generator DLL type you want to generate, right-click the TheGenerator package, point to Build Settings, and then click Custom Generator so that the name of the generated ACS Code Generator DLL is based on the name of the model.
The script for the Build Settings command sets up the following properties in the model:
TemplateList tag definition (applied to Model by Generator stereotype) - sets to the default ACS Code Generator DLL names for each configuration.
Body property of the SelectGenerator operation (scoped to Generator::Model2Text::GeneratorRoot class) - sets to specify which GenClass class is the root class for generating the ACS Code Generator DLL.
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 3G 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:
working with item properties. Tell me more...
working with variables. Tell me more...
working with item lists. Tell me more...
performing conditional execution of statements (if...then...else statements and while loops). Tell me more...
iterating through linked items (For loops). Tell me more...
System Variables that are replaced with information that is set through Launch ACS/TDK dialog. Tell me more...
Operators that are used to evaluate conditions, add and subtract, concatenate text and evaluate list intersections and unions. Tell me more...
Substitution tokens that are replaced with information such as the current Modeler user. Tell me more...
Formatting and special characters that control the format of generated files. Tell me more...
SDL script and SDL script extensions for TDK that you can used in TDK models. Tell me more...
* 
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.