コンテンツにスキップ
タイミング図

タイミング図

(Timing Diagram)

サンプル

@startuml
robust "スイッチ" as Switch
robust "ランプ" as Lamp
robust "モーター" as Motor
Switch is OFF
Lamp is OFF
Motor is STOPPED

@0
Switch -> Lamp : ON信号
Lamp is ON

@10
Lamp -> Motor : START信号
Motor is RUNNING

@20
Motor -> Lamp : STOP信号
Lamp is OFF
@enduml
PlantUML図
PlantUMLソース
@startuml
robust "スイッチ" as Switch
robust "ランプ" as Lamp
robust "モーター" as Motor
Switch is OFF
Lamp is OFF
Motor is STOPPED

@0
Switch -> Lamp : ON信号
Lamp is ON

@10
Lamp -> Motor : START信号
Motor is RUNNING

@20
Motor -> Lamp : STOP信号
Lamp is OFF
@enduml

全体の設定

タイトル

title タイトル
PlantUML図
PlantUMLソース
@startuml
title タイトル
robust "スイッチ" as Switch
robust "ランプ" as Lamp
robust "モーター" as Motor
Switch is OFF
Lamp is OFF
Motor is STOPPED
@0
Switch -> Lamp : ON信号
Lamp is ON
@10
Lamp -> Motor : START信号
Motor is RUNNING
@20
Motor -> Lamp : STOP信号
Lamp is OFF
@enduml

ヘッダ

ヘッダを定義できます。

header 新基盤構築計画
PlantUML図
PlantUMLソース
@startuml
header 新基盤構築計画
robust "スイッチ" as Switch
robust "ランプ" as Lamp
robust "モーター" as Motor
Switch is OFF
Lamp is OFF
Motor is STOPPED
@0
Switch -> Lamp : ON信号
Lamp is ON
@10
Lamp -> Motor : START信号
Motor is RUNNING
@20
Motor -> Lamp : STOP信号
Lamp is OFF
@enduml

フッタ

フッタを定義できます。

footer フッタ
PlantUML図
PlantUMLソース
@startuml
footer フッタ
robust "スイッチ" as Switch
robust "ランプ" as Lamp
robust "モーター" as Motor
Switch is OFF
Lamp is OFF
Motor is STOPPED
@0
Switch -> Lamp : ON信号
Lamp is ON
@10
Lamp -> Motor : START信号
Motor is RUNNING
@20
Motor -> Lamp : STOP信号
Lamp is OFF
@enduml

キャプション

キャプションを定義できます。

caption キャプション
PlantUML図
PlantUMLソース
@startuml
caption キャプション
robust "スイッチ" as Switch
robust "ランプ" as Lamp
robust "モーター" as Motor
Switch is OFF
Lamp is OFF
Motor is STOPPED
@0
Switch -> Lamp : ON信号
Lamp is ON
@10
Lamp -> Motor : START信号
Motor is RUNNING
@20
Motor -> Lamp : STOP信号
Lamp is OFF
@enduml

すべて組み合わせると…

PlantUML図
PlantUMLソース
title タイトル
header 新基盤構築計画
footer フッタ
caption キャプション
robust "スイッチ" as Switch
robust "ランプ" as Lamp
robust "モーター" as Motor
Switch is OFF
Lamp is OFF
Motor is STOPPED
@0
Switch -> Lamp : ON信号
Lamp is ON
@10
Lamp -> Motor : START信号
Motor is RUNNING
@20
Motor -> Lamp : STOP信号
Lamp is OFF
@enduml

オブジェクト

robust オブジェクト名の書式で書くことでオブジェクトを定義できます。

robust オブジェクト名
PlantUML図
PlantUMLソース
@startuml
robust オブジェクト名
@0
@10
@20
@enduml

時間

@時間で状態が変化するタイミングを定義できます。 なお、時間の箇所には数値のみ定義できるようです。

@0
@10
@20
PlantUML図
PlantUMLソース
@startuml
robust オブジェクト名
@0
@10
@20
@enduml

状態

@時間の後にオブジェクト名 is 状態名という記載を加えることで、オブジェクトの状態を定義できます。

@0
オブジェクト名 is ON
PlantUML図
PlantUMLソース
@startuml
robust オブジェクト名
オブジェクト名 is OFF
@0
オブジェクト名 is ON
@10
オブジェクト名 is OFF
@enduml

トリガー

同様に@時間の後にオブジェクト1 -> オブジェクト2という記載を加えることで、トリガーの定義ができます。

@20
オブジェクト1 -> オブジェクト2
PlantUML図
PlantUMLソース
@startuml
robust オブジェクト1
robust オブジェクト2
@0
@10
オブジェクト1 is OFF
オブジェクト2 is OFF
@20
オブジェクト1 is ON
オブジェクト1 -> オブジェクト2
@30
オブジェクト2 is ON
@30
@enduml

ラベル

トリガーの後に: ラベルを記載する事でラベルを定義できます。

@20
オブジェクト1 -> オブジェクト2 : ラベル
PlantUML図
PlantUMLソース
@startuml
robust オブジェクト1
robust オブジェクト2
@0
@10
オブジェクト1 is OFF
オブジェクト2 is OFF
@20
オブジェクト1 is ON
オブジェクト1 -> オブジェクト2 : ラベル
@30
オブジェクト2 is ON
@30
@enduml