ddl_utility  1.4.2
DDL Editor

The DDL Editor is an editor for description files. For detailed information about the Data Definition Language (DDL), please refer to the package ddl documentation.

DDL Editor GUI

DDL Editor GUI

The data of a description file is shown in a treeview window. The attributes of an item can be viewed and changed in the DDL Editor's Property Browser. Information, Warnings and Errors are shown in the console.

The title bar of the DDL Editor always shows, which of the loaded description files is being modified. It also sets a modify flag (..name.description*) behind the name of the description file, if the file was modified but not saved.

To create a new description file, click File in the menu bar and choose New. A dialog that let you change its name and the file location will then pop up. After saving the new file, it will be added to the treeview.

You can load several description files in the DDL Editor where you can edit them. To load an existing file, click File in the menu bar and choose Open. The new file appears in the treeview window.

To check if the description is valid, click in the treeview and select the description you want to check. Right-click and choose Check and in the console you can find some information about the correctness. If you find some warnings or errors in the console view, then fix the faults and check again. The Clear action in the console context menu allows to clear the console.

If you want to correct the byte order and the bit-size of the data types, you can do it on your own or you can calculate it automatically. The DDL Editor can calculate the byte positions and bit-size of an element in a structure based on the element size automatically. To calculate the byte position click in a struct and select in the context menu Set Byte Positions. The size is shown next to the name of the datatypes, enums, complex datatypes and streams items in the description file tree view.

Note: If you change a type of a struct element, please calculate

the byte position again.

It is possible to save the description Files on two ways. First you can select a file and choose in the menu bar Save or in the context menu. The second way is, to choose Save All in the menu bar and for all files which have not been saved, a dialog appears where you can select where the file should be saved.

A description File can be removed from the treeview by closing it. This can be done in two ways. You can right-click on the description file you want to close and then click Close. The same functionality is available by clicking on Close in the File*menu. If all description files should be closed at once, click *File in the menu bar and choose Close all. This will clear the treeview as well as the console.

Note: For a better usage, the description format provides several predefined baseunits,

prefixes, datatypes, enums, complex data types and streams. These predefined elements include the most common data types and structs which are used per default and therefore provide an easy and fast way to create or complete new description Files.

You can easily add your own units, datatypes, enums, etc with a right click on the desired category and then click Add.

Note: Units cannot by added in the first version of the DDL Editor, please use baseunits instead.

All elements of units, datatypes, enums, etc can be deleted via a right click on the desired element and click Delete. To rename a element double click on the element and replace the old name with a new one.

Note: It is not possible to add an element in a specific category (e.g. baseunits)

with a name that already exists in this category. A new name will be automatically created by appending "_x", with "x" being the next unused number.

All elements can be copied using drag-and-drop. Elements in a structure can also be moved inside this structure, a dialog opens itself when this option is available.

DDL Editor move Dialog

Note: When an element was moved or copied in a structure, the byte position and size are not automatically recalcultate, Set byte positions should be used after a structure was modified.

Header Import

The DDL Editor supports the import and export of complex data types within C-header files.

To import a C-header file, click File in the menu bar and choose New from Header. Several dialogs will allow you to specify the conversion:

  • dialogs to choose the header file(s) the description should be generated for the list of files will be finished, when you click Cancel at the last dialog
  • a dialog to choose were the new description file should be created
  • dialogs to specify additional include directories for the generation the list of directories will be finished, when you click Cancel at the last dialog

For detailed information about this conversion, please refer to documentation of header2ddl.

The first time when the feature New from Header is used, it has to be configured. The configuration will be stored in ddl_editor.settings in the directory of DDL Editor. At the first dialog, the location of the executable of castxml has to be specified. The second dialog is different depending on your system: Windows/MSVC: Specify the location of the 'Visual Studio Command Prompt' (e.g. C:/VS2019/Common7/Tools/VsDevCmd.bat) This will get some information about your compiler. LINUX/GCC: Specify the location of the 'GNU C++ Compiler' which is usually under '/usr/bin/gcc' The DDL Editor will automatically retrieve the information for the default include directories of this compiler instance.

The DDL Editor supports importing all description ddl types (like tUInt8, tFloat32 etc.) and all basic std types from stdint.h. If types from the stdint.h are used they will be kept automatically, except the commandline for header2ddl within the ddl_editor.settings is adapted to use a dedicated kind of types (--force-datatypes ddtypes or --force-datatypes stdtypes). In addition to that, the importer also understands typedefs mapping to these aforementioned basic types or any other type defined inside the header.

The import will fail if any other type used for a struct member is not defined in the header you are importing.

If a constant is defined inside the header, either with a #define VARNAME value or a const tTypename varName = value; the importer will recognize it as a constant and use its value to place an array member defined with tType member[VARNAME];. If the C-header file contains multidimensional arrays, only the first dimension will be added.

The importer will set alignment values according to the packing information inside the imported header. If no packing information is stated, the default value of the current system will be used:

  • Windows: 8
  • Linux 32 Bit: 4
  • Linux 64 Bit: 8.

To export a description file to a C-header file, click File in the menu bar and choose Save as Header. A dialog will appear to choose the location of the new header.

The exporter only supports exporting struct whose elements have an alignment value set according to the following rule: The alignment must be equal or smaller than its type's alignment (complex types) or size (basic type). If its smaller, it must match its parent struct's alignment value. So for example if you have set all alignment values to 1, the export will succeed.

Note: If the complex data type includes nested complex data types as elements, than all nested

complex data types will be exported to the C-header file.


Copyright © VW Group. All rights reserved.
Generated on Mon Sep 16 2024 by doxygen 1.9.1
GIT Commit Hash: 23c4fe0937d407e7ec8b56d3d3b7d74977f705c9