Blueprint Help Send comments on this topic.
Browsing and Inserting User Code

Glossary Item Box

Overview

After having run the Blueprint translator (see Translating Circuitry), it is possible to begin adding your processing logic and data structures.  The translator generates a large number of files and places them in special Generated Base/Derived Header/Source folders within the project.  Attempting to navigate through these files from the solution explorer is not recommended.

Fortunately, you do not need to be concerned with which files contain particular methods that you want to override because you can browse directly to the appropriate source file using the circuit editor.  The circuit editor will never take you to a file in which modifications would be overwritten on a subsequent translation (i.e. base code).

Customizable Code

Once the code for a circuit has been generated, Blueprint allows users to access the relevant sections of the derived code files directly, by selecting the desired function/class from the right-click context menu for a particular object in the diagram.

 

The actual options available depend on the selected object :-

  1. Transient / Arbitrated Stores 
    • Data Class
    • Record Class
  2. Methods
    • State Data Class
    • State Object Class
    • Workspace Data Class
    • Workspace Object Class
    • Process
    • Create
    • Initialize
    • Activate
    • Connect
    • Integrate
    • Execute
    • Exit
  3. Threads
    • Workspace Data Class
    • Workspace Object Class
    • Process
    • Create
    • Initialize
    • Activate
    • Connect
    • Integrate
    • Execute
    • Exit
  4. Call back functions
    • Workspace Data Class
    • Workspace Object Class
    • Create
    • Initialize
    • Activate
    • Connect
    • Integrate
    • Execute
    • Exit
  5. Circuits
    • Workspace Data Class
    • Workspace Object Class
    • Create
    • Initialize
    • Activate
    • Connect
    • Integrate
    • Exit

However the most commonly used options are

  1. Transient / Arbitrated Stores
    • Data Class
    • Record Class
  2. Methods
    • State Data Class
    • State Object Class
    • Workspace Data Class
    • Workspace Object Class
    • Process
    • Initialize
    • Execute
    • Exit
  3. Threads
    • Workspace Data Class
    • Workspace Object Class
    • Process
    • Initialize
    • Execute
    • Exit
  4. Call back functions
    • Workspace Data Class
    • Workspace Object Class
    • Execute
  5. Circuits
    • Workspace Data Class
    • Workspace Object Class
    • Initialize

By selecting one of these options Blueprint will open the appropriate file in MS Visual Studio at the appropriate function/class.

If a file does not exist (file has not been code generated) the following dialog will be displayed.

 

 

NB. The ProjectHeader.hpp file must be opened manually from the solution explorer window. As must any other non-generated files added to the project.

Entering Code

For examples of code that can be entered into the various files see the following: 

Entering Harness Code

Active objects generally require user supplied code that manages their initialization, event handling, execution, exit and so on.  The translator will generate default logic, but in most cases this will need to over-ridden to reflect the application's specific requirements.  This section addresses this activity.

Entering Processing Code

Whilst harness code deals with infrastructure issues, processing code provides the application's algorithmic content.  If a legacy sequential application is parallelized, the processing code is typically re-used 'as-is' but the infrastructure that coordinates the execution of the processing code needs to be replaced with a concurrent equivalent.  Processing code is usually compiled into 'topic' libraries and then called from the user's harness code.

Entering Device Code

Device code is that part of the application that performs input/output.  As mentioned earlier, devices can often be replaced by 'stimulator' code as a means of simplifying development by allowing execution on non-specific hardware.  This section describes how to integrate with I/O devices such as sockets, sound cards etc.

Entering Store Records

The definition and creation of data objects is unlikely to depend on circuitry although it may depend on the particular way that the application's algorithms are parallelized.  Once defined and created data objects can be integrated with the circuitry.  This section explains how data objects are associated with arbitrated and transient stores.

Entering State and Workspace

This section explains how integral data objects are associated with active objects (threads, methods call-backs and circuits).

Entering GUI Code

This section explains how the GUI thread is created and integrated with the main body of the application.