From 86f3cf203d8829cc8647266f52e8576120cb3770 Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Tue, 19 Dec 2023 13:05:08 +0800 Subject: [PATCH] =?UTF-8?q?iscs=20=20ecs=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- component/iscs_pscada.go | 3 +- entity/iscs_pscada.go | 94 ---------------------------------------- 2 files changed, 1 insertion(+), 96 deletions(-) diff --git a/component/iscs_pscada.go b/component/iscs_pscada.go index fe6f3f4..b3a80f1 100644 --- a/component/iscs_pscada.go +++ b/component/iscs_pscada.go @@ -13,10 +13,9 @@ type CircuitBreaker struct { } // ThreePositionSwitch 三工位开关 -// 对于三工位隔离开关,规定:ClosedPosition1-合闸到工作位,ClosedPosition2-合闸到接地位 // 具体异常-异常、通信中断 type ThreePositionSwitch struct { - Position SwitchThreePosition //合闸到位置1,与位置1线路导通;合闸到位置2,与位置2线路导通;分闸,线路断开,未与任何位置接通 + Position SwitchThreePosition } // SwitchThreePosition 三工位开关位置定义 diff --git a/entity/iscs_pscada.go b/entity/iscs_pscada.go index 9f119f3..c4c5dbe 100644 --- a/entity/iscs_pscada.go +++ b/entity/iscs_pscada.go @@ -5,84 +5,6 @@ import ( "joylink.club/rtsssimulation/component" ) -// 电力监控系统相关实体创建 - -// NewIscsWireCabinetEntity ISCS创建线柜实体 -// -// 35kV进线柜、35kV出线柜、1500V直流进线柜、配电变馈线柜、整流变馈线柜、35kV母联柜、500V直流馈线柜、1500V直流馈线柜、1500V直流负极柜 -// 400V进线柜、400V母联柜、三级负荷总开关、上网隔离开关柜、接口柜 -func NewIscsWireCabinetEntity(w ecs.World, id string) *ecs.Entry { - entry := NewElectricPowerDeviceEntity(w, id) - entry.AddComponent(component.IscsWireCabinetStateType) - return entry -} - -// NewIscsCircuitBreakerEntity ISCS创建断路器实体 -// 断路器;PT、负极柜隔离开关、轨电位、上网隔离开关、隔离开关 -func NewIscsCircuitBreakerEntity(w ecs.World, id string) *ecs.Entry { - entry := NewTwoPositionSwitchEntity(w, id) - entry.AddComponent(component.IscsCircuitBreakerStateType) - return entry -} - -// NewIscsRectifierEntity ISCS创建整流器实体 -func NewIscsRectifierEntity(w ecs.World, id string) *ecs.Entry { - entry := NewElectricPowerDeviceEntity(w, id) - entry.AddComponent(component.IscsRectifierStateType) - return entry -} - -// NewIscsHandcartSwitchEntity ISCS创建手车实体 -func NewIscsHandcartSwitchEntity(w ecs.World, id string) *ecs.Entry { - entry := NewHandcartSwitchEntity(w, id) - entry.AddComponent(component.IscsHandcartSwitchStateType) - return entry -} - -// NewIscsVoltageTransformerEntity ISCS创建变压器实体 -func NewIscsVoltageTransformerEntity(w ecs.World, id string) *ecs.Entry { - entry := NewElectricPowerDeviceEntity(w, id) - entry.AddComponent(component.IscsVoltageTransformerStateType) - return entry -} - -// NewIscsThreePositionSwitchEntity ISCS创建三工位开关实体 -func NewIscsThreePositionSwitchEntity(w ecs.World, id string) *ecs.Entry { - entry := NewThreePositionSwitchEntity(w, id) - entry.AddComponent(component.IscsIscsThreePositionSwitchStateType) - return entry -} - -// NewIscsTransBusbarEntity 创建输电母线实体 -func NewIscsTransBusbarEntity(w ecs.World, id string) *ecs.Entry { - wd := GetWorldData(w) - e, ok := wd.EntityMap[id] - if !ok { - e := w.Entry(w.Create(component.UidType, component.TransBusbarType)) - component.UidType.SetValue(e, component.Uid{Id: id}) - component.TransBusbarType.Set(e, &component.TransBusbar{Vl: component.VlNon, Elec: component.EywLossing}) - wd.EntityMap[id] = e - } - return e -} - -///////////////////////////////////////////通用///////////////////////////////////////////////////////// - -// NewTwoPositionSwitchEntity 创建两工位开关实体 -// 如断路器 -// 如PT、负极柜隔离开关、轨电位、上网隔离开关、隔离开关 -func NewTwoPositionSwitchEntity(w ecs.World, id string) *ecs.Entry { - wd := GetWorldData(w) - e, ok := wd.EntityMap[id] - if !ok { - e := w.Entry(w.Create(component.UidType, component.TwoPositionSwitchType)) - component.UidType.SetValue(e, component.Uid{Id: id}) - component.TwoPositionSwitchType.Set(e, &component.TwoPositionSwitch{Closed: false}) - wd.EntityMap[id] = e - } - return e -} - // NewThreePositionSwitchEntity 创建三工位隔离开关实体 func NewThreePositionSwitchEntity(w ecs.World, id string) *ecs.Entry { wd := GetWorldData(w) @@ -96,22 +18,6 @@ func NewThreePositionSwitchEntity(w ecs.World, id string) *ecs.Entry { return e } -// NewElectricPowerDeviceEntity 创建一般电力设备实体 -// 如:变压器、整流器 -// Epu所有状态如:35kV进线柜、35kV出线柜、1500V直流进线柜、配电变馈线柜、整流变馈线柜、35kV母联柜、500V直流馈线柜、1500V直流馈线柜、1500V直流负极柜 -// Epu状态中除去报警,如:400V进线柜、400V母联柜、三级负荷总开关、上网隔离开关柜、接口柜 -func NewElectricPowerDeviceEntity(w ecs.World, id string) *ecs.Entry { - wd := GetWorldData(w) - e, ok := wd.EntityMap[id] - if !ok { - e := w.Entry(w.Create(component.UidType, component.ElecDeviceType)) - component.UidType.SetValue(e, component.Uid{Id: id}) - component.ElecDeviceType.Set(e, &component.ElecDevice{Normal: true}) - wd.EntityMap[id] = e - } - return e -} - // NewHandcartSwitchEntity 创建手车实体 func NewHandcartSwitchEntity(w ecs.World, id string) *ecs.Entry { wd := GetWorldData(w)