Une image contenant texte, signe

Description générée automatiquement

Parametric Constraint Editor

 

Overview

This helper provides a bespoke editor for Constraint Blocks and Constraint Properties.

 

Applicable To

Constraint Block, Constraint Property

Menu Entry

Power Pack Edit Constraint Block

Power Pack Edit Constraint Property

Demonstration

Watch the Video

 

Operation

The helper presents a UI with any existing constraint parameters and any existing constraints:

A screenshot of a computer

AI-generated content may be incorrect.

Editing Parameters

Change the name of the parameter by typing into the name field. Hitting the Enter key will apply the change and automatically refactor the constraints to use the new name. This operation is undoable using the Undo menu or Ctrl-Z.

Change the type of the parameter using the Type combo box (see Available Types below).

Navigation

Click the Locate () button next to the combo box to locate the parameter in the Rhapsody browser.

Editing Constraints

·       Select a constraint by clicking its tab.

·       Double-click the tab name to edit the constraint name.

Constraint specifications are written in the Parametric Constraint Expression Language [PCEL].

Specifications are automatically syntax highlighted (See Constraint Specification Syntax Highlighting) and may be edited directly.

Changes are applied as you type.

Creating Parameters

To create any (missing) parameters, type/edit  a specification and then click Extract Parameters. New parameters are created using the default type (see Default Type below)

Creating Constraints

To add a new constraint simply click Add Constraint.

Available Types

The Type combo box is populated automatically:

·       From any existing parameters.

·       From properties.

·       The default type.

Populating Available Types from Properties

The following package-level properties may be used to control the types presented in the Type combo box:

RhapsodyPowerPack.ConstraintEditor.AvailableTypes

RhapsodyPowerPack.ConstraintEditor.AvailableTypesPackages

RhapsodyPowerPack.ConstraintEditor.AvailableTypesQueries

The final presented list is an accumulation of all these property results (detailed below). Full paths are easily obtained using the Get Full Path helper.

Available Types

This property is a comma-separated list of types to include. These may be simply names of types from the PredefinedTypes package (e.g. float,double) or full paths to Classifiers e.g.

MyTypesPkg::MyType

Available Types Packages

This property is a comma-separated list of full paths to Packages to include. All Classifiers found in such packages are included. e.g.

MyTypesPkg, SysML::SIDefinitions::DerivedSIUnits

Available Types Queries

This property is a comma-separated list of full paths to Queries to include. All Classifiers returned by such queries are included, e.g.

QueriesPkg::AllTypes

 Since queries cannot define scope, this option is more useful if you have your own profiles with new terms that you use as types.

Default Type

The following property defines the initial type for any new parameters. This may be a name of a type from the PredefinedTypes package (e.g. float) or the full path to a Classifier. If the default type is not already included in available types using any of the properties described above, then it is automatically added.