Overview of Transformation Development Kit (TDK)
TDK generates the ACS Code Generator DLL that ACS uses to generate code files.
TDK generates an ACS Code Generator DLL from a TDK model. You can create the TDK models from which the provided ACS Code Generator DLLs were generated by adding a TDK Code Generator profile to a model.
There are three types of TDK models:
• A TDK Code Generation Transformation Patterns model is the next generation of TDK model and it defines code generation through Classes that contain generation rules and operations.
TDK Code Generation Transformation Patterns models are used to generate the ACS Code Generator DLLs for Ada, C, C#, C++, IDL, Java, SQL and VB.
• A TDK 3G model contains a set of generation templates, each of which is stored in the TDK 3G model as a Class scoped operation that is stereotyped by the GenModule stereotype. The SDL script of the generation template is stored in the operation's Body property. There is one TDK model for each code language.
TDK 3G models are not provided in Modeler, but they were used for generating the ACS Code Generator DLLs in early versions of Modeler.
• A TDK Legacy model contains a set of generation templates, each of which is stored in the TDK legacy model as a Package scoped operation that is stereotyped by the GenModule stereotype. The SDL script of the generation template is stored in the operation's Body property. There was one TDK model for each ACS Code Generator DLL.
TDK Legacy models are not provided in Modeler, but they were used for generating the ACS Code Generator DLLs in Studio 6.2 and earlier versions.
A provided model may make use of code generation techniques seen in both TDK Code Generation Transformation Pattern models and TDK 3G models.
If you want to customize an ACS Code Generator DLL, you change the associated TDK model, and then through TDK generate a new ACS Code Generator DLL.
To use TDK you require the following:
• Modeler.
• Microsoft Visual C++ or GNU Compiler Collection (GCC). For information about which versions of Visual C++ and GNU Compiler Collection are supported, see the Modeler Release Notes.
• An ACS Transformation Development Kit license, an ACS license and a Modeler license.
Learning to use TDK
If you are learning to use Modeler and TDK, you may find the PTC Modeler tutorials useful.
For information about downloading and opening the Modeler Tutorials, see
PTC Modeler tutorials.
If you are learning to use Modeler and TDK, you may find the PTC Modeler tutorials useful.
For information about downloading and opening the Modeler Tutorials, see
PTC Modeler tutorials.
Provided TDK models
The ACS Code Generator DLLs that are provided with ACS are generated from TDK models. You can recreate the TDK models that are used to generate the provided ACS Code Generator DLLs by adding a TDK Code Generator profile to a model, which is useful if you want to customize a provided ACS Code Generator DLL.
Through the New Profiles dialog (when creating a new model) or the Add Profiles dialog (when adding a profile to a model), you can add a TDK Code Generator profile for Ada, C, C#, C++, IDL, Java, SQL or VB.
If you create a TDK model that can generate more than one ACS Code Generator DLL, you must configure the TDK model for the ACS Code Generator DLL you want to generate - you do this in Modeler by right-clicking the model, and then clicking the appropriate Build Settings commands:
• 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.
A TDK model includes the TDK Generator Framework profile:
• Do not make changes to a PTC profile. Any changes you make will be lost when the profile is updated.
|
You can create Tag Definitions outside of the PTC profile, and link those Tag Definitions to Stereotypes in the PTC profile. When the PTC profile is updated, the links will not be broken.
|
• Do not create copies of a PTC profile within a model, or create copies of a PTC profile through XMI Import/Export. The copies of the PTC profile will not work correctly and you will not be able to update the copies through the Update All Profiles command
ACS/TDK Control tab
In Modeler, you use the ACS/TDK Control tab to control TDK.
Tell me more…
Generation Settings Schemes
TDK uses Generation Settings Scheme to define how a TDK model is generated.
You can create many Generation Settings Schemes for the Model and each Package in the model. For TDK Models, you create a Generation Settings Scheme for the TheGenerator package. When you select the TheGenerator package in Modeler, the Generation Settings Schemes that have been created for the TheGenerator package are listed in the drop-down list on the ACS/TDK Control tab.
To generate an ACS Code Generator DLL using a Generation Settings Scheme and select the
TheGenerator package in Modeler, select the Generation Settings Scheme you want to use on the ACS/TDK Control tab, and then click the
Start button.
TDK Status
The ACS/TDK Control tab shows the current status of TDK. The status can be as follows:
Types | Status |
---|
Connected | TDK is loaded, but has not been started using a Generation Settings Scheme. |
First Generation | TDK is generating to cache. After TDK has finished generating to cache, you can generate an ACS Code Generator DLL through the Force Generate button. |
Loading Model | TDK is loading the TDK model. |
Not Connected | TDK is not loaded. Load TDK through the Load button. |
Ready | TDK is waiting for changes to generate or reverse. |
Updating Code | TDK is generating. |
Updating Model | TDK is reverse engineering. |
Customizing ACS Code Generator DLLs
Sometimes you will want to change the way that ACS generates code. You do this by changing the TDK model from which the ACS Code Generator DLL was generated, and then generating a new ACS Code Generator DLL.
After generating an ACS Code Generator DLL from a TDK model, TDK can detect changes you make to the TDK and automatically update the ACS Code Generator DLL.
Furthermore, if you have ACS running at the same time and it is set up to use the ACS Code Generator DLL that TDK generated, ACS will detect the updated Code Generator DLL and regenerate all the code files. This makes maintaining the TDK models much easier, because you can immediately see the results of any changes you make in the TDK model - you change the TDK model, and the code files are automatically regenerated using the changes you have made.
For more information about customizing ACS Code Generator DLLs, see:
Refreshing the TDK cache
On occasions, changes may be made to the model for which TDK is not sent notification calls, such as, other user's changes made in a multi-user environment. Should this happen and you want to TDK to detect these changes, on the ACS/TDK Control tab, click
Force Refresh.
TDK Configurations
Before generating an ACS Code Generator DLL, you set the TDK configuration to specify how the Code Generator DLL is going to be built, and whether it is going to be build in release or debug mode on the second drop-down list on the ACS/TDK Control tab, select the TDK Configuration you want to use:
• VS2015Release — to build using Microsoft Visual C++ 2015 (Visual C++ 14.0), including the Express version, in Release mode.
• VS2015Debug — to build using Microsoft Visual C++ 2015 (Visual C++ 14.0), including the Express version, in Debug mode.
• VS2017Release — to build using Microsoft Visual C++ 2017 (Visual C++ 15.0), including the Express version, in Release mode.
• VS2017Debug — to build using Microsoft Visual C++ 2017 (Visual C++ 15.0), including the Express version, in Debug mode.
• VS2019Release — to build using Microsoft Visual C++ 2019 (Visual C++ 16.0), including the Express version, in Release mode.
• VS2019Debug — to build using Microsoft Visual C++ 2019 (Visual C++ 16.0), including the Express version, in Debug mode.
• GccRelease — to build using GNU GCC compiler version 3.4.4 in Release mode.
• GccDebug — build using GNU GCC compiler version 3.4.4 in Debug mode.
A debug build will provide more diagnostics information that a release build, which is useful when developing an ACS Code Generator DLL. However, a debug build will take longer to generate code than a release build.
Windows.h file
When you build an ACS Code Generator DLL, TDK may prompt you for the location of the Windows.h file. If so, this file can normally be found in the following folder.
For 64-bit versions of Windows:
• C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include
For 32-bit versions of Windows:
• C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include
If after selecting a Windows.h file you need to change to an alternative Windows.h file, open a Command Prompt window and then run the following command:
SDKLocator –d VC<visual studio version number> SDK
Where <visual studio version number> is the main version number of the Visual Studio you are using.
| If you are using Visual Studio 2008 the version number is 9: SDKLocator –d VC9 SDK |
Visual C++ nmake command
TDK uses the Visual C++ nmake command or the GNU Compiler Collection (GCC) make command to build the Code Generator DLL.