rts-sim-module/entity/iscs_pscada.go
2023-12-11 11:09:07 +08:00

115 lines
4.7 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package entity
import (
"joylink.club/ecs"
"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 ISCS创建输电母线
func NewIscsTransBusbarEntity(w ecs.World, id string, haveBackupZiTou bool) *ecs.Entry {
entry := w.Entry(w.Create(component.UidType, component.TransBusbarType))
component.UidType.SetValue(entry, component.Uid{Id: id})
component.TransBusbarType.Set(entry, &component.TransBusbar{Vl: component.VlNon, Elec: component.EywLossing})
//
if haveBackupZiTou {
entry.AddComponent(component.IscsTransBackupZiTouStateType)
}
//
return entry
}
///////////////////////////////////////////通用/////////////////////////////////////////////////////////
// NewTwoPositionSwitchEntity 创建两工位开关实体
// 如断路器
// 如PT、负极柜隔离开关、轨电位、上网隔离开关、隔离开关
func NewTwoPositionSwitchEntity(w ecs.World, id string) *ecs.Entry {
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})
return e
}
// NewThreePositionSwitchEntity 创建三工位隔离开关实体
func NewThreePositionSwitchEntity(w ecs.World, id string) *ecs.Entry {
e := w.Entry(w.Create(component.UidType, component.ThreePositionSwitchType))
component.UidType.SetValue(e, component.Uid{Id: id})
component.ThreePositionSwitchType.Set(e, &component.ThreePositionSwitch{Position: component.StpOpened})
return e
}
// NewElectricPowerDeviceEntity 创建一般电力设备实体
// 如:变压器、整流器
// Epu所有状态如35kV进线柜、35kV出线柜、1500V直流进线柜、配电变馈线柜、整流变馈线柜、35kV母联柜、500V直流馈线柜、1500V直流馈线柜、1500V直流负极柜
// Epu状态中除去报警400V进线柜、400V母联柜、三级负荷总开关、上网隔离开关柜、接口柜
func NewElectricPowerDeviceEntity(w ecs.World, id string) *ecs.Entry {
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})
return e
}
// NewHandcartSwitchEntity 创建手车实体
func NewHandcartSwitchEntity(w ecs.World, id string) *ecs.Entry {
e := w.Entry(w.Create(component.UidType, component.HandcartSwitchType))
component.UidType.SetValue(e, component.Uid{Id: id})
component.HandcartSwitchType.Set(e, &component.HandcartSwitch{Position: component.HpOpened})
return e
}
// NewTransBusbarEntity 创建输电母线实体
func NewTransBusbarEntity(w ecs.World, id string) *ecs.Entry {
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})
return e
}