单线图(SLD)

关于单线图

单线图(也称单相图)用一条线代替三相交流系统的全部三相,表示设施或变电站的电力系统。设备——变压器、断路器、母线、电动机、负荷——以标准化符号表示,电能流动路径从上到下由源到负荷连接。电气工程师、电力规划人员和设施管理人员将单线图作为每个电力系统项目的主要参考文件:它是任何并网申请、弧闪研究或调试资料包中的第一份交付物。

Schematex 遵循 IEEE Std 315(ANSI Y32.2) 图形符号规范,并扩展了 IEC 60617 绕组配置符号以涵盖变压器变体。本页记录解析器目前所接受的内容。

SLD·§ IEEE 315-1975
↘ preview
100%
13.8 kV Substation Single-line diagram with 10 nodes and 9 connections 13.8 kV Substation 138kV 138kV/13.8kV 13.8kV Grid 138 kV 138kV · HV Bus Δ Y Main Xfmr 15 MVA 138kV/13.8kV 13.8kV · MV Bus BKR-1 1200A BKR-2 1200A BKR-3 1200A Feeder 1 Feeder 2 Feeder 3
UTF-8 · LF · 20 lines · 646 chars✓ parsed·1.0 ms·7.3 KB SVG

1. 第一张单线图

最简单的 SLD:一个电源、一台变压器、一个断路器和一个负荷。

SLD·§ IEEE 315-1975
↘ preview
100%
Simple feeder Single-line diagram with 5 nodes and 4 connections Simple feeder 13.8kV/480V 480V Utility 13.8kV xfmr 500 kVA 13.8kV/480V 480V · 480V Bus cb1 200A Panel LP-1
UTF-8 · LF · 10 lines · 288 chars✓ parsed·0.6 ms·5.1 KB SVG

四条规则覆盖 80% 的用法:

  1. sld 开头,后跟可选的带引号标题。
  2. 每行用 id = 节点类型 [属性] 的形式声明设备,一行一条。
  3. from -> to 连接设备,可选附加 [cable: "…", label: "…"]
  4. ID 可包含字母、数字、下划线和连字符——但必须以字母开头。

注释可以 #// 或 Mermaid 风格的 %% 单独开头。


2. 节点类型

节点行格式为 id = 节点类型 [属性: 值, …],节点类型决定绘制的符号。

2.1 电源

类型符号典型用途
utility电源箭头无穷大母线/电网连接
generatorG 的圆圈柴油、燃气或水力发电机组
solar光伏板符号光伏阵列
wind风机符号风力发电机
ups带电池的方块不间断电源
SLD·§ IEEE 315-1975
↘ preview
100%
Generation sources Single-line diagram with 5 nodes and 4 connections Generation sources Grid 115 kV G Diesel Gen 2 MW PV Array 500 kW Wind Turbine 1 MW UPS UPS System 100 kVA
UTF-8 · LF · 10 lines · 316 chars✓ parsed·1.7 ms·5.1 KB SVG

2.2 变压器

类型绕组配置说明
transformer通用双绕组无绕组规格
transformer_dy三角形→接地星形(Δ-Yg)最常用的配电方式
transformer_yd接地星形→三角形(Yg-Δ)
transformer_yy星形-星形(均接地)
transformer_dd三角形-三角形
autotransformer带抽头的单绕组锯齿线圈符号
transformer_3winding三绕组高压/中压/低压抽头
SLD·§ IEEE 315-1975
↘ preview
100%
Transformer configurations Single-line diagram with 5 nodes and 4 connections Transformer configurations 138kV/13.8kV 138kV Grid Δ Y Δ-Yg (most common) 30 MVA 138kV/13.8kV Y Y Yg-Yg 10 MVA 138kV/13.8kV Autotransformer 50 MVA 138kV/69kV 3-Winding 40 MVA 138/13.8/4.16kV
UTF-8 · LF · 10 lines · 483 chars✓ parsed·0.6 ms·6.6 KB SVG

2.3 母线与节点

类型符号典型用途
bus粗水平线主电压母线
bus_tie母联断路器连接同电压等级的两条并列母线
hub宽矩形多路馈线汇合点

2.4 开关与保护

类型符号设备编号
breaker斜线+弧形52(交流断路器)
breaker_vacuum斜线+V形椭圆52 真空型
switch斜线(无弧形)89(隔离开关)
switch_load负荷开关
ground_switch斜线+接地符号接地隔离开关
ats转换开关符号自动转换开关
recloser斜线+弧形+箭头自动重合闸
sectionalizer斜线+S配电分段器
fuse椭圆加斜线熔断器
fuse_cl矩形加斜线限流熔断器
SLD·§ IEEE 315-1975
↘ preview
100%
Switching and protection Single-line diagram with 6 nodes and 5 connections Switching and protection Source Recloser S Sectionalizer Fuse Disconnect Ground SW
UTF-8 · LF · 12 lines · 317 chars✓ parsed·0.6 ms·5.5 KB SVG

2.5 保护与监测

类型符号典型用途
ct带穿线的小圆圈电流互感器
pt小圆圈电位/电压互感器
relay带设备编号的小圆圈保护继电器(通过 device: 设置 ANSI 编号)
surge_arrester箭头+接地避雷器
ground_faultGFI 符号接地故障检测器

2.6 负荷与设备

类型符号典型用途
motorM 的圆圈三相电动机
load矩形通用负荷或馈线
capacitor_bank两极板+开关功率因数补偿
harmonic_filterLC 符号无源谐波滤波器
vfd带 VFD 的矩形变频驱动器

2.7 计量

类型符号典型用途
watthour_meterWh 的圆圈电能表
demand_meterD 的圆圈需量表
SLD·§ IEEE 315-1975
↘ preview
100%
Equipment types Single-line diagram with 10 nodes and 9 connections Equipment types 13.8kV/480V 480V Grid 13.8kV G Emergency Gen 500kW Δ Y Main TX 1000 kVA 13.8kV/480V ATS ATS-1 800A Main Breaker 2000A 480V · 480V MV Bus CT CT-1 PF Cap 150 kVAR M Pump Motor 100HP 51 Overcurrent Relay
UTF-8 · LF · 20 lines · 631 chars✓ parsed·0.8 ms·8.5 KB SVG

3. 节点属性

属性写在节点类型后的 […] 内,用逗号分隔。

属性效果
label: "…"带引号字符串图表上的显示名称
voltage: "…"带引号字符串,如 "13.8kV""480V"电压等级标注
rating: "…"带引号字符串,如 "1000 kVA""200A"设备额定值标注
device: "…"ANSI 设备编号,如 "51""87"relay 节点配合使用
其他任意键带引号字符串作为铭牌数据存储(变压器 kVA、%Z 等)

包含所有常用属性的示例:

xfmr = transformer_dy [
  label: "Main Transformer",
  voltage: "13.8kV/480V",
  rating: "1000 kVA",
  impedance: "5.75%Z"
]

属性块可跨多行——解析器会合并各行直到 ] 配对。


4. 连接

连接行格式为 fromId -> toId,可选追加 [cable: "…", label: "…"]

bus1 -> cb1
bus1 -> cb1 [cable: "3#2/0 AWG"]
bus1 -> cb1 [cable: "3#2/0 AWG", label: "Feeder A"]

规则:

  • 两个 ID 可在连接之前或之后声明——所有连接在解析结束时统一验证。
  • 仅接受 ->(有向,从源到负荷)。连接方向用于布局。
  • 未知节点 ID 会抛出 SLDParseError: Connection references unknown node "…"
SLD·§ IEEE 315-1975
↘ preview
100%
ATS backup with cable labels Single-line diagram with 8 nodes and 7 connections ATS backup with cable labels 480V Normal source Emergency source 3#2/0 AWG 3#4 AWG 3#4 AWG Utility 480V G Emergency Gen 500 kW ATS ATS-1 800A 480V · Critical Bus CB-1 200A CB-2 200A Server Room Life Safety
UTF-8 · LF · 16 lines · 580 chars✓ parsed·5.8 ms·6.7 KB SVG

5. 标签与注释

  • 标题: sld "Substation One-Line" — 仅限第一行。
  • 节点标签: id = type [label: "…"] — 显示名称。
  • 连接标签: A -> B [label: "…"] — 显示在连接线旁。
  • 电缆标注: A -> B [cable: "3#2/0 AWG, 200ft"] — 导体规格。
  • 注释: 行首的 #。同一行中节点或连接后的行内 # 也会被去除。
  • 住宅别名: IEC / REBT 词汇,如 mcbrcdrcborccbpiaigamain_switchconsumer_unitdistribution_boardpanelpanelboard,均可作为输入并映射到现有的 SLD 原语。

6. 保留字与转义

行首保留字: sld(文件头)。

运算符符号——避免在节点 ID 中使用 ->。ID 可包含 [A-Za-z][A-Za-z0-9_-]*——连字符有效(如 CB-101 是合法 ID)。

属性块——[…] 括号可跨多个物理行。解析器合并后续行,直到括号深度回到零。

重复 ID 会抛出 SLDParseError: Duplicate node id "…"


7. 常见错误

你写的解析器提示修正方法
xfmr1 [type: transformer]SLDParseError: Cannot parse line使用 = 赋值:xfmr1 = transformer [...]
id = battery [...]SLDParseError: Unknown node type "battery"没有 battery 类型——使用 upsgenerator
id = breakerzSLDParseError: Unknown node type ... (did you mean 'breaker'?)使用建议的规范类型或别名
A -- B(双向)SLDParseError: Cannot parse line仅接受 ->;如需双向请用两行 ->
A -> B -> C(链式)SLDParseError: Cannot parse line每条连接单独一行 ->
relay [label: "OC"](无设备编号)继电器渲染时编号为空添加 device: "51" 以设置 ANSI 设备编号
voltage: 480V(无引号)属性值无法识别所有值加引号:voltage: "480V"
以数字开头的节点 ID:2BUSSLDParseError: Cannot parse lineID 必须以字母开头:BUS2
连接在节点声明之前SLDParseError: Connection references unknown node "…"节点可在连接之前或之后声明——在解析结束时统一验证,顺序灵活

8. 语法(EBNF)

document      = header NEWLINE ( blank | comment | node-def | connection )*

header        = "sld" ( WS quoted-string )? NEWLINE
quoted-string = '"' any-char-but-quote* '"'

node-def      = id WS "=" WS node-type ( WS "[" attr-list "]" )? NEWLINE
node-type     = "utility" | "generator" | "solar" | "wind" | "ups"
              | "transformer" | "transformer_dy" | "transformer_yd"
              | "transformer_yy" | "transformer_dd"
              | "autotransformer" | "transformer_3winding"
              | "bus" | "bus_tie" | "hub"
              | "breaker" | "breaker_vacuum" | "switch" | "switch_load"
              | "ground_switch" | "ats" | "recloser" | "sectionalizer"
              | "fuse" | "fuse_cl"
              | "ct" | "pt" | "relay" | "surge_arrester" | "ground_fault"
              | "motor" | "load" | "capacitor_bank" | "harmonic_filter" | "vfd"
              | "watthour_meter" | "demand_meter"
              | residential-alias

residential-alias
              = "mcb" | "mccb" | "rcd" | "rcbo" | "rccb"
              | "differential" | "diferencial" | "pia" | "iga"
              | "main_switch" | "isolator" | "disconnector"
              | "consumer_unit" | "distribution_board" | "panel" | "panelboard"

attr-list     = attr ( "," attr )*
attr          = key ":" WS quoted-string

connection    = id WS "->" WS id ( WS "[" conn-attrs "]" )? NEWLINE
conn-attrs    = conn-attr ( "," conn-attr )*
conn-attr     = "cable" ":" WS quoted-string
              | "label" ":" WS quoted-string

id            = [A-Za-z] [A-Za-z0-9_-]*
key           = [A-Za-z] [A-Za-z0-9_]*
comment       = ( "#" | "//" | "%%" ) any NEWLINE

属性块 […] 可跨多个物理行——解析器合并后续行,直到括号深度回到零。

权威来源:src/diagrams/sld/parser.ts。如与解析器有出入,以解析器为准——请提 issue。


9. 规范合规性

Schematex SLD 遵循 IEEE Std 315(ANSI Y32.2) 关于开关设备、变压器和电源的图形符号规范。变压器绕组配置变体(transformer_dytransformer_yy 等)使用 IEC 60617 的 Δ/Y 符号。保护继电器设备编号遵循 ANSI/IEEE C37.2

目前已实现:

  • ✅ 所有电源类型:电网、发电机、光伏、风电、UPS
  • ✅ 六种变压器变体及自耦变压器、三绕组变压器
  • ✅ 母线、母联、汇合点
  • ✅ IEC / REBT 住宅词汇别名映射到规范原语
  • ✅ 完整开关集:断路器、真空断路器、隔离开关、负荷开关、接地开关、自动转换开关、自动重合闸、分段器、熔断器、限流熔断器
  • ✅ 保护与监测:电流互感器、电压互感器、继电器(含 ANSI 设备编号)、避雷器、接地故障检测器
  • ✅ 负荷设备:电动机、负荷、电容器组、谐波滤波器、变频驱动器
  • ✅ 计量:电能表、需量表
  • ✅ 带电缆和标签标注的有向连接
  • labelvoltageratingdevice 节点属性;任意铭牌数据
  • ⏳ 带开合状态指示的母联开关
  • ⏳ 保护区域(包围继电器+电流互感器的虚线边界线)
  • ⏳ 弧闪标签块(入射能量、PPE 等级、工作距离)
  • ⏳ 电压等级色带(按 kV 等级自动着色的水平带)

参考文献:

  • IEEE Std 315-1975 / ANSI Y32.2-1975 — Graphic Symbols for Electrical and Electronics Diagrams
  • IEC 60617:2025(BS 3939)— Graphical symbols for diagrams
  • ANSI/IEEE C37.2 — Electrical Power System Device Function Numbers

10. 相关示例

sld·§ IEEE 315
Utility + Generator Backup Single-line diagram with 8 nodes and 7 connections Utility + Generator Backup 480V 480V Utility 480V G Emergency Gen 500 kW 480V ATS ATS-1 800A 480V · Critical Load Bus CB1 200A CB2 200A Critical Load 1 100A Critical Load 2 100A
Generator + ATS backup power
Single-line diagram for a utility + emergency generator ATS transfer system feeding critical loads on a 480 V bus — per IEEE 315 for facility design review.
industrial & process
sld·§ IEEE 315
13.8 kV Substation Single-line diagram with 10 nodes and 9 connections 13.8 kV Substation 138 13.8 Grid 138 kV 138 · bus_hv xfmr1 kva: 15000 primary: 138 secondary: 13.8 13.8 · bus_mv brk1 brk2 brk3 Feeder 1 Feeder 2 Feeder 3
13.8 kV utility substation
13.8 kV distribution substation single-line diagram with 138 kV grid input, 15 MVA step-down transformer, and three feeder breakers per IEEE 315.
industrial & process

11. 路线图

规划中——尚不可解析。 请勿在生成的 DSL 中使用以下功能,解析器会拒绝或忽略。

  • 母联开合状态bus_tie 带显式开/合属性,以便符号渲染在正确的开关位置。
  • 保护区域zone:boundary: 块,在一组节点(继电器+电流互感器+断路器)周围绘制虚线矩形,表示保护区域。
  • 弧闪标注块 — 按 IEEE 1584 规范:arc_flash: [incident_energy: "8 cal/cm²", ppe: "2", distance: "18in"]
  • 电压等级色带 — 按 kV 等级自动添加水平阴影带;节点自动置于对应电压层级。
  • 双向连接<->)— 用于方向不明确的母联或常开联络路径。

如需优先实现以上功能,请在 GitHub issues 中跟踪反馈。

Found this useful?

Schematex is free, fully open source, and zero-dependency. A star helps other developers discover it.