主要内容

本页采用了机器翻译。点击此处可查看最新英文版本。

同步序列图和架构模型

自 R2022a 起

此示例展示了如何保持序列图与架构模型之间的一致性。

打开模型。

model = systemcomposer.openModel("mRetargetElements");

打开架构视图库

openViews(model)

将更改从架构模型拉到序列图

1.在视图浏览器中,选择 RepairExample 序列图。检查名为 ChildComponent 的生命线。

View Browser of the Architecture Views Gallery with the RepairExample sequence diagram selected.

2.返回模型画布。选中 ChildComponent 组件。在省略号 (...) 菜单上暂停,然后选择 Create Architecture。将新组件的名称指定为 ComponentChildComponent 组件现在是 Component 组件的子组件。

Component named Component with a child component inside of it.

3.点击序列图 RepairExample 上的检查一致性。序列图已变得不一致,并且 ChildComponent 生命线被突出显示,因为它不再位于图的根级别。

The RepairExample sequence diagram with the ChildComponent lifeline highlighted in yellow.

4.选择 ChildComponent 生命线,然后在工具栏上点击修复。从架构模型 mRetargetElements 中提取更改后,序列图 RepairExample 也会随之更新。

The RepaitExample sequence diagram with the Component and ChildComponent lifelines.

将序列图中的更改推送到架构模型

1.在视图浏览器中,选择 CreateInArchitecture 序列图。

View Browser of the Architecture Views Gallery with the CreateInArchitecture sequence diagram selected.

2.选框选择序列图的内容,包括两条生命线和消息。

The CreateInArchitecture sequence diagram with the DoesNotExistSrc and DoesNotExistDst lifelines and a message selected.

3.在工具栏中,点击在架构中创建。从序列图推送更改后,架构模型 mRetargetElements 也会随之更新。

The DoesNotExistSrc and DoesNotExistDst components connected with the Src and Dst ports.

在架构模型中重新定位生命线并创建新连接

1.在视图浏览器中,选择 RetargetThenCocreate 序列图。

View Browser of the Architecture Views Gallery with the RetargetThenCocreate sequence diagram selected.

2.在序列图上选择 B 生命线,然后从架构元素菜单中选择列表中的 C。序列图变得不一致,消息被高亮显示。

The RetargetThenCocreate sequence diagram with the message between lifeline A and lifeline C highlighted in yellow.

3.选择消息,然后在工具栏中点击在架构中创建。在架构模型 mRetargetElements 中创建了一个新连接。

Two architecture models side by side. In the model on the left, Component A and Component B are connected. Component C has no connections. In the model on the right, Component A and Component B are connected. Component C is connected to Component A.

另请参阅

工具

函数

对象

主题