logo

Chapter 5. Interface

Main Window

Editor

Editor

The central part of the ACGUI window is the schema editor. From here, schema files can be viewed and edited. To begin editing an ASN.1 schema, create a new file or open an existing file via the toolbar or menu. The file will be added to the current project and shown in the editor.

The editor window is also used to display a schema browser for navigating a validated schema. To display the browser after validating a schema, click on an item in the ASN.1 Tree window. The browser will display a hyperlinked version of the schema, centered on the definition of the selected item. Clicking the names of other defined types in the browser will cause their definitions to be shown.

By default, documents are displayed in tabs in the editor. Tabs "Text" and "Browser" at the bottom of the window are for schema editing and hyperlinked schema browsing, respectively. At the top of the "Text" tab, each schema file currently being edited has a tab.

Alternatively, ACGUI can display documents in separate subwindows. To change this, select "Tools->Options..." from the menus. In the "General" tab of the options window, change "Open files" from "In tabs" to "In MDI windows". Click "OK" and restart ACGUI. Now, open files will be displayed as separate windows within the main ACGUI window. This option is useful for viewing two files simultaneously, for example.

Project Window

Project Window

The project window allows the user to interact with project assets.

Schema/ASN.1 files

Files containing the current project's ASN.1 schema definitions.

Include directories

Directories containing auxiliary ASN.1 schema files. The current project's schema may import definitions from modules defined in an included directory.

Configuration file

An ASN1C compiler configuration file.

Generated Items

A listing of the files generated by the compiler, separated by target language.

Clicking on a schema file or configuration file in the project window will open that file in the editor. A right-click context menu is also provided for schema files, include directories, and configuration file for adding or removing these assets from the project.

ASN.1 Tree Window

ASN1 Tree Window

Once a schema has been validated or compiled in ACGUI, the ASN.1 Tree window provides an interactive view of the ASN.1 types defined in it. At the top level of the tree, the modules of the schema are shown. Each of these modules can be expanded to reveal branches for the types, values, information objects, etc. defined in each of them. Clicking on any node of the tree will show the relevant ASN.1 definition in a built-in browser in the editor window.

Error Log Window

Error Log Window

The Error Log window displays messages related to schema validation and compilation. Whenever a schema is successfully validated or compiled, the Error Log will report a success. If an error occurs, an error message will be displayed.

In many cases, an error will be associated with a particular portion of the schema being compiled. In these cases, clicking on an error will open the schema editor to the location that the error occurred. If more than one error is reported, clicking the "Next Error" and "Previous Error" buttons in the toolbar will move the editor window to the part of the schema where the next or previous error occurred.

When the reported errors are no longer needed, they can be cleared by clicking the "Clear" button in the Error Log window.

Project Settings

The project settings window is where details such as encoding rules, target language, and code features to generate are modified.

Output tab

Project Settings Output

The "Output" tab contains options for selecting a target language, encoding rules, output directory. In order to compile a schema, a target language must be selected under "Application Language Type". For C++ and Java, more specific targets are available, as well.

"Additional Translations" contains several options for generating transformed versions of the input schema, such as HTML or pretty-printed.

"Encoding Rules" allows for one or more encoding rule set to be selected for generated code.

"Input Options" affect how strict the compiler is when parsing the ASN.1 schema. Enabling these options can cause unpredictable behavior in generated code, but they may be useful under certain circumstances.

Depending on the target language selected, additional options are shown.

Project Settings C++ Output

For C or C++ target languages, "C/C++ Output Options" controls how generated code is distributed across source files.

Project Settings Cs Output

For C#, "C# Code Organization" controls how generated code is distributed across source files and how files are organized into directories.

Project Settings Java Output

For Java, "Java Code Organization" allows generated code to be organized into directories based on the ASN.1 module for which they were generated. Alternatively, generated files will be placed directly into the output directory.

Function Generation tab

Project Settings Function Generation

The "Function Generation" tab provides settings for what functionality to include in generated code. Options under "Generated Function Types" provide granular control of what functions to generate. The printing functions allow for various printing schemes to be generated, such as print-to-string and print-to-standard-output, and how the printed data should be formatted.

"Sample Program Generation" allows simple encoding and decoding programs, which demonstrate using the generated code, to be generated. The sample writer program can optionally encode randomly-generated test data.

Depending on the target language selected, additional options may be shown here.

Project Settings C++ Function Generation

For C and C++, additional functions for memory management and macros for dealing with named bits in BIT STRINGs can be generated.

Project Settings Java Function Generation

For Java, get and set methods can be generated for members of generated classes.

Constraints and Debugging tab

Project Settings Constraints And Debugging

The "Constraints and Debugging" tab holds settings related to constraint handling, event handling, and logging in generated code. Under "Constraints", various types of constraint checks can be added or removed from generated code.

In "Debugging and Event Handling", settings for adding debug tracing and event hooks are available. In addition to enabling event callbacks, generation of type structures can also be disabled, in which case generated decode functionality will simply call user-created event handlers and not perform its own decoding operation.

Code Modifications tab

Project Settings Code Modifications

Under the "Code Modifications" tab are a number of options for generating simplified code. In "Space Optimizations", these mainly regard the removal of unwanted or unneeded functionality and shortening names of generated types.

"Other Options" provide several miscellaneous settings, including the option of generating code for types that have been imported into the current schema.

Depending on the target language selected, additional options are shown at the bottom of the tab.

Project Settings C++ Code Modifications

In the case of C or C++ as the target language, code modifications include several settings for adjusting how ASN.1 types are mapped to native C/C++ types.

Project Settings Cs Code Modifications

For C#, modifications allow for manipulating the namespace into which code is generated.

Project Settings Java Code Modifications

Similarly for Java, the package name for generated code can be changed.

Build Options tab

When a target language other than "None" is selected, an additional "Build Options" tab contains language environment-specific settings for generating makefiles and build scripts.

Project Settings C++ Build

For C and C++, a makefile can be generated in either Windows or GNU format. For Windows, a Visual Studio project can also be generated. Under "Build Libraries", which will generate the build script to build a library rather than an executable, the desired variety of library can be selected.

Project Settings Cs Build

Similarly for C#, a makefile or Visual Studio project can be created, optionally including a *.mk file listing the files generated.

Project Settings Java Build

Java can also provide a *.mk generated file list, as well as Ant build script and a batch or shell script.