PlantUML 绘图

官网

示例

绘制时序图

USB 枚举过程 PlantUML 源码

c 复制代码
@startuml
host   <-- device : device insert host
note right        : step 1
host   ->  device : get speed, reset, speed check
note right        : step 2
host   ->  device : get device descriptors
note right        : step 3
device --> host   : return device descriptors
note right        : step 4
host   ->  device : reset again
note right        : step 5
host   ->  device : set device address
note right        : step 6
host   ->  device : use new address get device descriptors(real get)
note right        : step 7
device --> host   : return device descriptors
note right        : step 8
host   ->  device : get config descriptors or get config descriptors sets
note right        : step 9
device --> host   : return config descriptors or config descriptors sets
note right        : step 10
host   ->  device : get string descriptors
note right        : step 11
device --> host   : return string descriptors
note right        : step 12
host   ->  device : get class special descriptors
note right        : step 13
device --> host   : return class special descriptors
note right        : step 14
@enduml

效果

绘制定时图片

USB 字节序 PlantUML 源码

c 复制代码
@startuml
header Page 1
footer Page 1 of 1

<style>
timingDiagram {
  .red
  {
    Linecolor red
  }
  .blue 
  {
    Linecolor blue
  }
 
}
</style>

concise "status" as status
concise "DATA" as data 
binary "DP" as DP  <<red>>
binary "DM" as DM  <<blue>>

@0
data is "SE0"
DP is low
DM is low

@2
data is "idle"
DP is high
DM is low

@6
data is "0"
status is "SYNC 0x80"
DP is low
DM is high

@7
data is "0"
DP is high
DM is low

@8
data is "0"
DP is low
DM is high

@9
data is "0"
DP is high
DM is low

@10
data is "0"
DP is low
DM is high

@11
data is "0"
DP is high
DM is low

@12
data is "0"
DP is low
DM is high

@13
data is "1"
DP is low
DM is high


@14
data is "1"
status is "PID SETUP 0x2D"
DP is low
DM is high

@15
data is "0"
DP is high
DM is low

@16
data is "1"
DP is high
DM is low

@17
data is "1"
DP is high
DM is low


@18
data is "0"
DP is low
DM is high

@19
data is "1"
DP is low
DM is high

@20
data is "0"
DP is high
DM is low

@21
data is "0"
DP is low
DM is high


@22
data is "0"
status is "other"
DP is high
DM is low

@enduml

效果

相关推荐
黑塞12319 天前
Vscode 编写Markdown支持 plantuml书写
ide·vscode·编辑器·markdown·plantuml
EQ-雪梨蛋花汤2 个月前
【如何做好一份技术文档?】用Javadoc与PlantUML构建高质量技术文档(API文档自动化部署)
java·api·ci·plantuml·doc
斗转星移33 个月前
Ubuntu20.04 中使用vscode中编辑查看PlantUML
linux·vscode·uml·plantuml
北冥有鱼被烹4 个月前
【微知】plantuml在泳道图中如何将多个泳道框起来分组并且设置颜色?(box “浏览器“ #LightGreen endbox)
plantuml
小沈同学呀6 个月前
Java UML 类图绘制解析:结构与工具类型详解
java·开发语言·uml·plantuml
Just_Paranoid6 个月前
PlantUML 入门使用指南
uml·建模·plantuml·类图·用例图·序列图
geocat6 个月前
plantuml的picoweb无法渲染分页图表的问题
vscode·plantuml
morning_judger7 个月前
【PlantUML系列】状态图(六)
plantuml
morning_judger7 个月前
【PlantUML系列】流程图(四)
流程图·plantuml
巽星石9 个月前
PlantUML中的实体关系图
uml·plantuml·er图