The Design mode of a project is where you layout and define your component-based system. The Navigator on the left displays a list/tree of your components. The Stage on the right is where you interact with components and other objects to model your system.
Changes you make to the design are saved automatically.
Working with Components
Components are the main building blocks of your system. They represent pieces of software, each with their own interface specifications. After a component object is added to the stage, you'll be able to define which messages it sends and receives, and connect it to other design objects.
From the design, which acts a model of your system, interface code can be automatically generated in Build mode.
New components can be placed anywhere in the design stage, and moved around as needed. The interface specifications (or messages) of the component can be defined after its added to the stage.
A component's name can be changed at any time by editing the component and going to the Info tab. The name must contain alphanumeric characters and underscores only.
Components can be deleted at any time by pressing the delete key or clicking the trash button. This will remove the component from the project, and remove its associated connections. A warning dialog will display to confirm deletion.
Define Component Interfaces
When you connect two unlocked components, their interfaces (see below for more info) are automatically updated to support the new connection. You can also update a component's interface individually by editing it and clicking the Interface tab.
The Interface Package dropdown includes any Flex Packages that you've added to the project.
The Message API determines the format of code generated from Tangram Pro. The Tangram Pro Default API option suits most scenarios, and others may be used for special cases.
The following options affect generated component software interface code:
- Tangram Pro Default API
- OMS – Select this option when working with the OMS package
The following options only affect generated transform code, which makes it compatible with the selected option:
- OMS 2.0
The Interface Package determines which set of messages can be applied to a component. The packages shown in the dropdown menu originate from the FlexLang area. There are many built-in packages, and you can also add your own or fork existing ones. For more information see Flex Package Management.
One or more messages from the selected package can be applied to a component. For each message, you can set the direction to be Input, Output, or Input/Output.
Lock Component Interfaces
You can prevent changes to a component's interface specification by locking it. Edit the component, go to Interface, and click the Unlocked/Locked button.
You can create a copy of a component by clicking the Duplicate button. This will copy an existing component's interface specifications to a new component. It will also copy nested designs, so all of the subsystems inside of the source component (its subcomponents and their connections) will be included in the copy.
Connecting components allows you to define which messages are sent and received between them, and which transport they communicate over.
The selectable messages originate from the Flex Code Editor. There are many built-in messages, but you can also add your own or customize existing ones. For more information see Flex Package Management.
To connect components:
- Click the Connect button
- Select a sender and a receiver component
- Choose a Transport
- Choose a Message Set from the dropdown
- Choose one or more Messages from the dropdown
- Click anywhere on the stage to close the Connections panel. Changes are saved automatically
Change Connection Direction
A connection is added in one-direction by default. You can specify the other direction by clicking the Switch Directions button.
See Message Flow
You can view the flow of any particular message in your design. To do this, select a component in the Navigator and hover over any of its messages.
Connect with Transforms
You can also make a connection with a transform. Transforms allow you to connect components that do not share a common message. They do the job of converting message A to message B.
A Flex Package must exist and contain a Transform definition for the two different messages you wish to connect.
To connect with a transform:
- First you'll need two objects on the Design Stage (Components, Projects, Inputs or Outputs)
- Go to Flex Packages and add the package that contains the desired Transform code
- Click the Add Transform button, and click anywhere to add it
- Select the sender and receiver components
- Choose the input and output Messages
- Optionally, choose which Transports to use
- Click Apply Transform for the desired Transform
- Transports are required for the Transform if you wish to generate Transform Code with Interface Code. (The Build option Generate Transform with CSIs)
- Transports can be left blank if you only need to generate the Transform Code with no Interface Code. (The Build option Generate Transform)
All of the transforms that satisfy the conversion between your messages will be shown with the transform's name, package name and file name to help you differentiate between the options. You can also view a transform's Flex code definition by clicking the fx icon.
Working with Transports
A Transport is a property of a connection in Tangram Pro that designates which message delivery service to communicate over. As you design a system and connect components and transforms together, you can choose which transport to use for each connection. All connections in your design can use the same transport (e.g. ZeroMQ), or for more complex systems, you can assign different transports to different connections.
Add a transport to your design by clicking the Transports button at the top of the Navigator, and choosing a type:
You can add multiple transports. The first transport that you add is set as the default.
Transports can be renamed at any time by selecting it in the Navigator, changing the name, and clicking Update. Transport names must be unique.
Transports can be deleted at any time by selecting it in the Navigator and clicking Delete. Any connections referencing the deleted transport will be changed to the default transport. If the default transport is deleted, all connections referencing it will change to the next transport listed in the Navigator.
The default transport is shown in the Navigator with an asterisk * beside it. All new connections will default to this transport. You can change the default by selecting another transport in the Navigator and clicking Use as default Transport.
Projects can be added to your design by clicking the Add Project button. They represent subsystems in your design. They look and act similar to components, except that they must have an Input object and Output object defined within them in order to connect to other objects.
Define Inputs and Outputs
Input and output specifications can be defined and act like an interface for your project. Inputs are the messages that the project requires, and outputs are the messages that the project provides. A project with defined inputs and outputs can be used like a component in other projects. As your project library grows, the more interchangeable parts you'll have at your disposal.
To add them, use the Define Input and Define Output buttons in the toolbar. Connect the input or output object to a component and select the desired messages.
If more granular specifications are needed for a component, you can open it and build a system within it.
To design a subsystem:
- Select a component
- Click the Open Component button. You'll see an empty stage
- Design your system
- Include an Output object, and define a connection so that the output message matches the message the main component is sending
- Click on the project in the Navigator to return to the top-level system view
For example, if the top-level component ("Sender" in the screenshot below) is sending an "AirVehicleState" message, then the output of the nested design should include an "AirVehicleState" message.
If the output of the subsystem doesn't satify the requirements of the main component, the design will be highlighted red and indicate which message isn't satisfied. In the screenshot below, "AirVehicleConfiguration" needs to be added to the output of the subsystem.
A subsystem designed inside a component sure looks a lot like a separate project. Instead of designing a subsystem, you can swap a component and replace it with an existing project.
To swap a component for a project:
- Select a component
- Click the Swap Component button
- Select a project. A Green Swap button means the inputs and outputs are satisfied. A Yellow Swap button means they are not satisfied. You can still add the project, but you'll need to update its inputs and outputs later for a valid design.
- You'll see the project with a magenta highlight. The color helps differentiate it from components
Export your Design
Save design image
You can save a snapshot of your design by clicking the Export button in the view toolbar. Select either PNG or PDF.
Export as AADL
You can export your project design as AADL files by going to Settings. Exported projects can be imported by going to Projects > New Project and clicking Import Project from AADL.