Common Desktop Environment: Application Builder User's Guide

Making and Running an Application

Two scenarios are described below. In the first scenario, you build and run an application in one step. In the second scenario, you generate code, compile the code, and run the application in separate steps.

In either case, if you have made changes to the project that have not been saved, a message dialog box will be displayed, telling you that you have unsaved edits and giving you the choice of cancelling the generate code process or saving the project. If you choose to save the project, you will have to specify where to save the project if it has not been saved before.

To Make and Run in One Step

  1. Choose Code Generator from the File menu of the App Builder primary window.

    The Code Generator is displayed.

  2. Click Make & Run to generate code, build the application, and run it.

    If you have saved the project and all goes well, a number of messages will be displayed in the output pane at the top of the Code Generator. The final message will be "Running: ./[projectname]" and the application will run.

    At the least, the application primary window will be displayed. Any windows whose visibility is not set to yes at application startup will be hidden. Depending on what functionality you included that does not require user code, the application might do a variety of things. Menus can be displayed, some connections can be tested, On Item help can be displayed, and so on.


    Note -

    Ultimately, you must write some code to complete the application. For example, any Call Function callbacks specified in the Connections Editor will have to be substituted for. See "Adding User Code to Generated Code" for more information.


To Generate Code, Make, and Run Separately

  1. Click Generate Code to generate code for the current project.

    As the code generator runs, messages are displayed in the output pane at the top of the Code Generator window. The final message should be "Completed successfully." A number of files will be created, including Makefiles, project files, module files, and two dtb_utils files. You can look at the files in the term pane at the bottom of the Code Generator window.

  2. Click Make to build the application.

    More messages will be displayed in the Output Pane as the application is compiled. The final message again should be "Completed successfully." A few more files will be created, including object files and the executable application file, which has the name you gave the project.

  3. Click Run to run the application.

    The application will be started--as if you had typed the name of the executable at the command line.

  4. Click Abort to quit the application.

    This will terminate the application, closing all windows. You can also click Abort to terminate code generation or make operations started in the Code Generator window.

To Set Code Generator Options

To change the options that determine what code is generated and other Code Generator functions:

  1. Choose Code Generator from the File menu of the App Builder primary window to display the Code Generator window.

  2. Choose Generator from the Options menu to display the Code Generator Options dialog box.

  3. Select one of the Generate Code For options (Entire Project, Main Only, Specific Modules Only, Specific Modules and Main).

    If you select Specific Modules or Specific Modules and Main, the list of modules is active. Select the names of the modules you want to generate code for in the list.

  4. Click Don't Merge if you do not want your hand-edited code merged with the generated code.


    Note -

    Do not select Don't Merge unless you are sure you want to destroy the user code.


  5. Choose a different message reporting option if you wish.

    Choices are Report Normal Messages, Be Silent, and Be Verbose.

  6. Type Make Arguments, if appropriate.

    These arguments will be included when you click Make or Make & Run.

  7. Type Run Time Arguments, if appropriate.

    These arguments will be included when you click Run or Make & Run.

  8. Click Reset to Defaults to set all fields to their default values.

    Default values are Generate Code For Entire Project, Merge user code with generated code, and Report Normal Messages.

  9. Click OK or Apply to make the changes.

    The Options dialog box will be dismissed if you click OK.

To Set Environment Options

  1. Choose Code Generator from the File menu of the App Builder primary window to display the Code Generator window.

  2. Choose Environment from the Options menu to display the Environment Options dialog box.

  3. Type a variable in the Variable Name text field.

    You might want to change PATH, for instance.

  4. Click Get to display the current value for the variable in Variable Name.

    The value of the variable will be displayed in the Value pane.

  5. Make a change to Value and click Set to change the value of the variable.

    This change is made for this App Builder session only.

  6. Click Reset to reset Value to its value outside this session of App Builder.

  7. Click Cancel to dismiss the dialog box.

To Generate Code From the Command Line

To generate App Builder code from the command line, run dtcodegen. Usage is described below.

Usage: dtcodegen [options] [project-file] [module-file [module-file] ...]

Code is generated for each module specified on the command line, or for all modules in the project, if no modules are specified. If no project file is specified, a project file containing the specified module(s) is searched for in the current directory.

Files with extension .bip are assumend to be BIL project files, files with .bix extension are assumed to be encapsulated BIL files, and files with a .bil extension are assumed to be BIL module files.

Options (* = default, + = default with no project file)
-help (-h)

Print out this help message

-main

Write file containing main()

-changed

Only generate files that have changed

* -merge

Merge generated _stubs.c files with previous version

-nomerge

Don't merge existing and new stubs file

* -project (-p)

Specify a project to generate code for

-noproject (-np)

Use default project settings, ignore project file

+ -showall

Application shows (maps) all windows at startup

* -noshowall

Application shows (maps) only initially-visible windows

-silent (-s)

Silent mode, no messages written

-verbose (-v)

Verbose mode, detailed progress messages