Best Practice Session Design

This guide covers the design of ADTF Session's.

Makro, variable and path settings

Following section will hand out some advices about how to use macros, variables and paths. This part is devided into three tips:

  • Setting and retrieving user-specific macros
  • Usage of OS environment variables
  • Generic solution to refer external files
  • Setting and retrieving user-specific macros

    User-specific macros are needed, if you want to use resources which are not included within the ADTF addons folder. For that purpose the ADTF Configuration Editor provides the possiblity to define user specific macros. Lets say, you are willing to use a macro for a filepath. For that use case the specific defined macro fits its best.

    To set up the path as macro, you have to follow these steps:

  • Choose the Environment Variables tab of the ADTF Session Editor
  • The context menu of this will give you the possiblity to open the Add... dialog
  • Type in the unique name of your macro and the corresponding path:
  • Add an Environment Variable
  • After adding the macro the ADTF Configuration Editor will use it to resolve paths inheriting the before defined path value:
  • Resolving path

    Generic solution to refer external files

    The exchange of ADTF Projects with dependencies to external files (descriptionfile, A2L, DBC, etc.) often leads to initialization problems of ADTF Sessions. In most cases, that issue is caused by setting paths incorrectly to the coressponding files. In order to avoid this issue, we recommend not to use absolute or local paths specifing external files. Relative paths have to be independent from the machine's file ADTF System in use. Therefore ADTF provides the ability to resolve abolute paths with the help of the file dialog. In file dialogs you can see the "M"-Button. This button use the list of environment variables to replace a path with the best matching macro. The usage of the relative paths provides the possiblity to exchange ADTF Projects without the path adaption for external files.

    Resolving a absolute path

    Where to go next?

    ADTF should work the same on different machines - this is the next setp of Macros and Environment Variables. Let's dive in deeper and have a look at guide to set up an adtfenvironment to learn creating generic solutions and how to adapt them.