Implementing Command Processing

There are two steps required to implement command processing:

  1. Generate command tables and "stub" command functions. A stub function outputs a message that says the command has been invoked and then returns, allowing you to verify that all commands are defined with correct syntax and that all command functions are associated with the correct command.
  2. The next step varies slightly, depending on the type of command.

Immediate Commands

The main command function needs to be changed to update the appropriate application variable and return.

Utility Commands

The main command function may make one or more function calls beyond setting application variables, but does not require user interaction. Setting up state functions is not required. Utility commands may do database access such as scanning the design file for specified elements. The stub function would typically have one top-level function call which in turn breaks down into several other compact, modular routines.

Primitive Commands

The main command function for primitive commands must set up the state machine to handle events such as data points, resets, and element selection. Do this by calling one or more of the mdlState_... or mdlDynamic_... routines. This implies that routines to handle the "state transitions" need to be coded.

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.