タイミング図
(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
@endumlPlantUMLソース
@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ソース
@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ソース
@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ソース
@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ソース
@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ソース
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ソース
@startuml
robust オブジェクト名
@0
@10
@20
@enduml時間
@時間で状態が変化するタイミングを定義できます。
なお、時間の箇所には数値のみ定義できるようです。
@0
@10
@20PlantUMLソース
@startuml
robust オブジェクト名
@0
@10
@20
@enduml状態
@時間の後にオブジェクト名 is 状態名という記載を加えることで、オブジェクトの状態を定義できます。
@0
オブジェクト名 is ONPlantUMLソース
@startuml
robust オブジェクト名
オブジェクト名 is OFF
@0
オブジェクト名 is ON
@10
オブジェクト名 is OFF
@endumlトリガー
同様に@時間の後にオブジェクト1 -> オブジェクト2という記載を加えることで、トリガーの定義ができます。
@20
オブジェクト1 -> オブジェクト2PlantUMLソース
@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ソース
@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