2023-10-12 17:55:40 +08:00
|
|
|
|
package component
|
|
|
|
|
|
2023-10-13 18:20:15 +08:00
|
|
|
|
import (
|
|
|
|
|
"joylink.club/ecs"
|
|
|
|
|
"joylink.club/rtsssimulation/component/component_proto"
|
|
|
|
|
"joylink.club/rtsssimulation/consts"
|
|
|
|
|
)
|
2023-10-12 17:55:40 +08:00
|
|
|
|
|
|
|
|
|
var PsdTag = ecs.NewTag()
|
2023-10-13 18:20:15 +08:00
|
|
|
|
var PsdStateType = ecs.NewComponentType[component_proto.PsdState]()
|
2023-10-12 17:55:40 +08:00
|
|
|
|
|
2023-10-19 17:09:47 +08:00
|
|
|
|
var PsdInfoType = ecs.NewComponentType[PsdInfo]()
|
|
|
|
|
|
|
|
|
|
type PsdInfo struct {
|
|
|
|
|
PlatformId string
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-12 17:55:40 +08:00
|
|
|
|
var PsdCircuitType = ecs.NewComponentType[PsdCircuit]()
|
|
|
|
|
|
|
|
|
|
type PsdCircuit struct {
|
|
|
|
|
//屏蔽门驱动继电器
|
|
|
|
|
GMJ *ecs.Entry
|
|
|
|
|
KMJ4 *ecs.Entry
|
|
|
|
|
KMJ8 *ecs.Entry
|
|
|
|
|
//屏蔽门表示继电器
|
|
|
|
|
MGJ *ecs.Entry
|
|
|
|
|
MPLJ *ecs.Entry
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-13 18:20:15 +08:00
|
|
|
|
var PsdMotorType = ecs.NewComponentType[ecs.Entry]()
|
2023-10-12 17:55:40 +08:00
|
|
|
|
var PsdMotorStateType = ecs.NewComponentType[PsdMotorState]()
|
|
|
|
|
|
|
|
|
|
// PsdMotorState 屏蔽门电机状态
|
|
|
|
|
type PsdMotorState struct {
|
|
|
|
|
//4编组开门通电
|
2023-10-13 18:20:15 +08:00
|
|
|
|
Km4_Td bool
|
2023-10-12 17:55:40 +08:00
|
|
|
|
//8编组开门通电
|
2023-10-13 18:20:15 +08:00
|
|
|
|
Km8_Td bool
|
2023-10-12 17:55:40 +08:00
|
|
|
|
//关门通电
|
2023-10-13 18:20:15 +08:00
|
|
|
|
Gm_Td bool
|
|
|
|
|
//4编组开门进度
|
|
|
|
|
Km4 int32
|
|
|
|
|
//8编组与4编组差集的门的开门进度
|
|
|
|
|
Km8_4 int32
|
|
|
|
|
//开关门速度
|
|
|
|
|
Speed int32
|
2023-10-12 17:55:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-10-13 18:20:15 +08:00
|
|
|
|
// Is4Km 是否4编组开门(不用开到位)
|
|
|
|
|
func (p *PsdMotorState) Is4Km() bool {
|
|
|
|
|
return p.Km4 != consts.TwoPosMin && p.Km8_4 == consts.TwoPosMin
|
|
|
|
|
}
|
2023-10-12 17:55:40 +08:00
|
|
|
|
|
2023-10-13 18:20:15 +08:00
|
|
|
|
// Is4Km 是否4编组开门(不用开到位)
|
|
|
|
|
func (p *PsdMotorState) Is8Km() bool {
|
|
|
|
|
return p.Km4 != consts.TwoPosMin && p.Km8_4 != consts.TwoPosMin
|
2023-10-12 17:55:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var PsdDriveCircuitType = ecs.NewComponentType[PsdDriveCircuit]()
|
|
|
|
|
|
|
|
|
|
// PsdDriveCircuit 屏蔽门驱动电路
|
|
|
|
|
type PsdDriveCircuit struct {
|
|
|
|
|
//屏蔽门驱动继电器接通状态
|
|
|
|
|
GMJ bool
|
|
|
|
|
KMJ4 bool
|
|
|
|
|
KMJ8 bool
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var PsdCollectionCircuitType = ecs.NewComponentType[PsdCollectionCircuit]()
|
|
|
|
|
|
|
|
|
|
type PsdCollectionCircuit struct {
|
|
|
|
|
GMJ bool
|
|
|
|
|
KMJ4 bool
|
|
|
|
|
KMJ8 bool
|
|
|
|
|
//MGJ吸起
|
|
|
|
|
MGJ_X bool
|
|
|
|
|
//MGJ落下
|
|
|
|
|
MGJ_L bool
|
|
|
|
|
MPLJ_X bool
|
|
|
|
|
MPLJ_L bool
|
|
|
|
|
}
|