iscs ecs 调整

This commit is contained in:
xzb 2023-12-19 13:05:08 +08:00
parent 08e4d2f8e2
commit 86f3cf203d
2 changed files with 1 additions and 96 deletions

View File

@ -13,10 +13,9 @@ type CircuitBreaker struct {
}
// ThreePositionSwitch 三工位开关
// 对于三工位隔离开关规定ClosedPosition1-合闸到工作位ClosedPosition2-合闸到接地位
// 具体异常-异常、通信中断
type ThreePositionSwitch struct {
Position SwitchThreePosition //合闸到位置1与位置1线路导通;合闸到位置2与位置2线路导通;分闸,线路断开,未与任何位置接通
Position SwitchThreePosition
}
// SwitchThreePosition 三工位开关位置定义

View File

@ -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)