2023-12-07 16:28:29 +08:00
|
|
|
|
package component
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"joylink.club/ecs"
|
|
|
|
|
"joylink.club/rtsssimulation/consts"
|
|
|
|
|
)
|
|
|
|
|
|
2023-12-08 17:44:25 +08:00
|
|
|
|
//ISCS 电力系统相关组件定义
|
|
|
|
|
|
|
|
|
|
// IscsWireCabinetState ISCS线柜状态
|
|
|
|
|
//
|
|
|
|
|
// 状态由该设备的其他组件运算得到,该状态组件对外为只读组件,面向用户
|
|
|
|
|
type IscsWireCabinetState struct {
|
2023-12-11 11:09:07 +08:00
|
|
|
|
State consts.WireCabinetStateEnum
|
2023-12-08 17:44:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// IscsCircuitBreakerState ISCS断路器状态
|
|
|
|
|
//
|
|
|
|
|
// 状态由该设备的其他组件运算得到,该状态组件对外为只读组件,面向用户
|
|
|
|
|
//
|
|
|
|
|
// 断路器;PT、负极柜隔离开关、轨电位、上网隔离开关、隔离开关
|
|
|
|
|
type IscsCircuitBreakerState struct {
|
2023-12-11 11:09:07 +08:00
|
|
|
|
State consts.CircuitBreakerStateEnum
|
2023-12-08 17:44:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// IscsRectifierState ISCS整流器状态
|
|
|
|
|
//
|
|
|
|
|
// 状态由该设备的其他组件运算得到,该状态组件对外为只读组件,面向用户
|
|
|
|
|
type IscsRectifierState struct {
|
2023-12-11 11:09:07 +08:00
|
|
|
|
State consts.RectifierStateEnum
|
2023-12-08 17:44:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// IscsHandcartSwitchState ISCS手车状态
|
|
|
|
|
//
|
|
|
|
|
// 状态由该设备的其他组件运算得到,该状态组件对外为只读组件,面向用户
|
|
|
|
|
type IscsHandcartSwitchState struct {
|
2023-12-11 11:09:07 +08:00
|
|
|
|
State consts.HandcartSwitchStateEnum
|
2023-12-08 17:44:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// IscsVoltageTransformerState ISCS变压器状态
|
|
|
|
|
//
|
|
|
|
|
// 状态由该设备的其他组件运算得到,该状态组件对外为只读组件,面向用户
|
|
|
|
|
type IscsVoltageTransformerState struct {
|
2023-12-11 11:09:07 +08:00
|
|
|
|
State consts.VoltageTransformerStateEnum
|
2023-12-08 17:44:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// IscsThreePositionSwitchState ISCS三工位隔离开关状态
|
|
|
|
|
//
|
|
|
|
|
// 状态由该设备的其他组件运算得到,该状态组件对外为只读组件,面向用户
|
|
|
|
|
type IscsThreePositionSwitchState struct {
|
2023-12-11 11:09:07 +08:00
|
|
|
|
State consts.ThreePositionSwitchStateEnum
|
2023-12-08 17:44:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-12-11 11:09:07 +08:00
|
|
|
|
// IscsTransBusbarState ISCS母联备自投状态
|
2023-12-08 17:44:25 +08:00
|
|
|
|
//
|
|
|
|
|
// 状态由该设备的其他组件运算得到,该状态组件对外为只读组件,面向用户
|
2023-12-11 11:09:07 +08:00
|
|
|
|
type IscsTransBusbarState struct {
|
|
|
|
|
State consts.TransBusbarZiTouStateEnum
|
2023-12-08 17:44:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ISCS 相关设备状态组件
|
|
|
|
|
var (
|
|
|
|
|
IscsWireCabinetStateType = ecs.NewComponentType[IscsWireCabinetState]()
|
|
|
|
|
IscsCircuitBreakerStateType = ecs.NewComponentType[IscsCircuitBreakerState]()
|
|
|
|
|
IscsRectifierStateType = ecs.NewComponentType[IscsRectifierState]()
|
|
|
|
|
IscsHandcartSwitchStateType = ecs.NewComponentType[IscsHandcartSwitchState]()
|
|
|
|
|
IscsVoltageTransformerStateType = ecs.NewComponentType[IscsVoltageTransformerState]()
|
|
|
|
|
IscsIscsThreePositionSwitchStateType = ecs.NewComponentType[IscsThreePositionSwitchState]()
|
2023-12-11 11:09:07 +08:00
|
|
|
|
IscsTransBackupZiTouStateType = ecs.NewComponentType[IscsTransBusbarState]()
|
2023-12-08 17:44:25 +08:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////
|
2023-12-07 16:28:29 +08:00
|
|
|
|
|
|
|
|
|
// TransBusbar 输电母线
|
|
|
|
|
type TransBusbar struct {
|
2023-12-11 11:09:07 +08:00
|
|
|
|
Vl VoltageLevel //电压等级
|
|
|
|
|
Elec ElecYwEnum
|
2023-12-07 16:28:29 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-12-11 11:09:07 +08:00
|
|
|
|
// VoltageLevel 电压等级定义
|
|
|
|
|
type VoltageLevel = uint8
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
VlNon VoltageLevel = iota //未知电压等级
|
|
|
|
|
VlAc110Kv //110kV交流电 红色
|
|
|
|
|
VlAc35Kv //35kV交流电 黄色
|
|
|
|
|
VlAc400V //400V交流电 浅蓝色
|
|
|
|
|
VlDc1500V //1500V直流电
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// ElecYwEnum 电的有无定义
|
|
|
|
|
type ElecYwEnum = uint8
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
EywLossing ElecYwEnum = iota //失电,未受电
|
|
|
|
|
EywReceiving //受电
|
|
|
|
|
EywStatic //静态
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////
|
|
|
|
|
|
2023-12-07 16:28:29 +08:00
|
|
|
|
// TwoPositionSwitch 对一条路通-断控制的开关状态
|
|
|
|
|
// 如断路器
|
|
|
|
|
// 如PT、负极柜隔离开关、轨电位、上网隔离开关、隔离开关
|
|
|
|
|
type TwoPositionSwitch struct {
|
2023-12-08 17:44:25 +08:00
|
|
|
|
Closed bool //true-合闸,线路导通;false-分闸,线路断开
|
2023-12-07 16:28:29 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// /////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
// ThreePositionSwitch 三工位开关
|
|
|
|
|
// 对于三工位隔离开关,规定:ClosedPosition1-合闸到工作位,ClosedPosition2-合闸到接地位
|
|
|
|
|
type ThreePositionSwitch struct {
|
2023-12-11 11:09:07 +08:00
|
|
|
|
Position SwitchThreePosition //合闸到位置1,与位置1线路导通;合闸到位置2,与位置2线路导通;分闸,线路断开,未与任何位置接通
|
2023-12-07 16:28:29 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-12-11 11:09:07 +08:00
|
|
|
|
// SwitchThreePosition 三工位开关位置定义
|
|
|
|
|
type SwitchThreePosition = uint8
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
StpOpened SwitchThreePosition = iota //开关分闸,线路断开,未与任何位置接通
|
|
|
|
|
StpClosedPosition1 //开关合闸到位置1,与位置1线路导通
|
|
|
|
|
StpClosedPosition2 //开关合闸到位置2,与位置2线路导通
|
|
|
|
|
)
|
|
|
|
|
|
2023-12-07 16:28:29 +08:00
|
|
|
|
/////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
// HandcartSwitch 手车式开关
|
|
|
|
|
type HandcartSwitch struct {
|
2023-12-11 11:09:07 +08:00
|
|
|
|
Position HandcarPosition
|
2023-12-07 16:28:29 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-12-11 11:09:07 +08:00
|
|
|
|
// HandcarPosition 手车式开关位置定义
|
|
|
|
|
type HandcarPosition = uint8
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
HpOpened HandcarPosition = iota //工作位分闸
|
|
|
|
|
HpClosed //工作位合闸
|
|
|
|
|
HpTest //实验位
|
|
|
|
|
)
|
|
|
|
|
|
2023-12-07 16:28:29 +08:00
|
|
|
|
//////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
// ElecDevice 一般电力设备
|
|
|
|
|
// 如:变压器、整流器
|
|
|
|
|
// Epu所有状态如:35kV进线柜、35kV出线柜、1500V直流进线柜、配电变馈线柜、整流变馈线柜、35kV母联柜、500V直流馈线柜、1500V直流馈线柜、1500V直流负极柜
|
|
|
|
|
// Epu状态中除去报警,如:400V进线柜、400V母联柜、三级负荷总开关、上网隔离开关柜、接口柜
|
|
|
|
|
type ElecDevice struct {
|
2023-12-08 17:44:25 +08:00
|
|
|
|
Normal bool //true-正常
|
2023-12-07 16:28:29 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-12-08 17:44:25 +08:00
|
|
|
|
// 电力设备组件
|
2023-12-07 16:28:29 +08:00
|
|
|
|
var (
|
|
|
|
|
ElecDeviceType = ecs.NewComponentType[ElecDevice]()
|
|
|
|
|
HandcartSwitchType = ecs.NewComponentType[HandcartSwitch]()
|
|
|
|
|
ThreePositionSwitchType = ecs.NewComponentType[ThreePositionSwitch]()
|
|
|
|
|
TwoPositionSwitchType = ecs.NewComponentType[TwoPositionSwitch]()
|
|
|
|
|
TransBusbarType = ecs.NewComponentType[TransBusbar]()
|
|
|
|
|
)
|
2023-12-08 17:44:25 +08:00
|
|
|
|
|
|
|
|
|
// 设备例外标签定义
|
|
|
|
|
var (
|
|
|
|
|
DeviceCommunicationInterruptTag = ecs.NewTag() //通信中断
|
|
|
|
|
DeviceAbnormalTag = ecs.NewTag() //异常
|
|
|
|
|
DeviceFaultTag = ecs.NewTag() //故障 有预告信号产生
|
|
|
|
|
DeviceAlarmTag = ecs.NewTag() //报警 有事故信号产生
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// 设备置牌标签定义
|
|
|
|
|
var (
|
|
|
|
|
DevicePlacingOverhaulCardTag = ecs.NewTag() //设备置牌:检修
|
|
|
|
|
DevicePlacingLandingCardTag = ecs.NewTag() //设备置牌:接地
|
|
|
|
|
DevicePlacingOtherCardTag = ecs.NewTag() //设备置牌:其他
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// BackupZiTouInputTag 备自投投入、退出标签
|
|
|
|
|
var BackupZiTouInputTag = ecs.NewTag() //备自投投入标签
|