2023-10-12 17:55:40 +08:00
|
|
|
|
package component
|
|
|
|
|
|
2023-10-13 18:20:15 +08:00
|
|
|
|
import (
|
2023-11-06 10:52:57 +08:00
|
|
|
|
"fmt"
|
2023-10-13 18:20:15 +08:00
|
|
|
|
"joylink.club/ecs"
|
|
|
|
|
"joylink.club/rtsssimulation/component/component_proto"
|
|
|
|
|
)
|
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
|
|
|
|
|
|
|
|
|
var PsdCircuitType = ecs.NewComponentType[PsdCircuit]()
|
|
|
|
|
|
|
|
|
|
type PsdCircuit struct {
|
|
|
|
|
//屏蔽门驱动继电器
|
2023-12-08 16:46:49 +08:00
|
|
|
|
GMJ *ecs.Entry
|
|
|
|
|
//KMJ4 *ecs.Entry
|
|
|
|
|
//KMJ8 *ecs.Entry
|
|
|
|
|
KMJMap map[int32]*ecs.Entry //开门继电器,k-编组
|
2023-10-12 17:55:40 +08:00
|
|
|
|
//屏蔽门表示继电器
|
|
|
|
|
MGJ *ecs.Entry
|
|
|
|
|
MPLJ *ecs.Entry
|
2023-11-09 10:53:18 +08:00
|
|
|
|
//启动探测继电器
|
|
|
|
|
QDTCJ *ecs.Entry
|
|
|
|
|
//停止探测继电器
|
|
|
|
|
TZTCJ *ecs.Entry
|
|
|
|
|
//大概就是表示探测过程中出现异常
|
|
|
|
|
ZAWJ *ecs.Entry
|
|
|
|
|
//间隙探测旁路继电器
|
|
|
|
|
JXTCPLJ *ecs.Entry
|
2023-11-07 14:30:07 +08:00
|
|
|
|
//一些不知道如何使用的继电器,为了使得采集、驱动逻辑正常,先构建出来
|
|
|
|
|
UnusedJ []*ecs.Entry
|
2023-10-12 17:55:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-11-06 10:52:57 +08:00
|
|
|
|
var AsdCannotOpenTag = ecs.NewTag()
|
|
|
|
|
var AsdCannotCloseTag = ecs.NewTag()
|
|
|
|
|
|
|
|
|
|
func GetAsdFaultTag(fault component_proto.Psd_Fault) (ecs.IComponentType, error) {
|
|
|
|
|
switch fault {
|
|
|
|
|
case component_proto.Psd_AsdCannotClose:
|
|
|
|
|
return AsdCannotCloseTag, nil
|
|
|
|
|
case component_proto.Psd_AsdCannotOpen:
|
|
|
|
|
return AsdCannotOpenTag, nil
|
|
|
|
|
default:
|
|
|
|
|
return nil, fmt.Errorf("未知的屏蔽门故障类型[%s]", fault)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-01 16:52:03 +08:00
|
|
|
|
var AsdTag = ecs.NewTag()
|
2023-10-23 17:35:57 +08:00
|
|
|
|
var AsdListType = ecs.NewComponentType[AsdList]()
|
|
|
|
|
|
|
|
|
|
// AsdList 滑动门列表
|
|
|
|
|
type AsdList struct {
|
|
|
|
|
List []*ecs.Entry
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var AsdMotorStateType = ecs.NewComponentType[AsdMotorState]()
|
|
|
|
|
|
|
|
|
|
// AsdMotorState 滑动门电机状态
|
|
|
|
|
type AsdMotorState struct {
|
2023-11-01 16:52:03 +08:00
|
|
|
|
TD bool //电机通电
|
2023-10-23 17:35:57 +08:00
|
|
|
|
KM bool //向开门方向转动
|
2023-11-01 16:52:03 +08:00
|
|
|
|
MG bool //门是否关闭(继电器状态)
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-03 10:41:47 +08:00
|
|
|
|
var AsdStateType = ecs.NewComponentType[component_proto.AsdState]()
|
|
|
|
|
|
2024-01-23 18:02:31 +08:00
|
|
|
|
// AsdForceType ture强制开门 false强制关门
|
|
|
|
|
var AsdForceType = ecs.NewComponentType[BitState]()
|
|
|
|
|
|
|
|
|
|
// AsdHasObstacleTag 滑动门有障碍物
|
|
|
|
|
var AsdHasObstacleTag = ecs.NewTag()
|
|
|
|
|
|
2023-11-01 16:52:03 +08:00
|
|
|
|
var PlatformMkxCircuitType = ecs.NewComponentType[PlatformMkxCircuit]()
|
|
|
|
|
|
|
|
|
|
// PlatformMkxCircuit 站台门控箱电路
|
|
|
|
|
type PlatformMkxCircuit struct {
|
|
|
|
|
MkxList []*ecs.Entry
|
|
|
|
|
PCBJ *ecs.Entry
|
|
|
|
|
POBJ *ecs.Entry
|
|
|
|
|
PABJ *ecs.Entry
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var MkxType = ecs.NewComponentType[Mkx]()
|
|
|
|
|
|
|
|
|
|
type Mkx struct {
|
|
|
|
|
PCB *ecs.Entry
|
|
|
|
|
POB *ecs.Entry
|
|
|
|
|
PAB *ecs.Entry
|
|
|
|
|
MPL *ecs.Entry
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var PscType = ecs.NewComponentType[Psc]()
|
|
|
|
|
|
|
|
|
|
type Psc struct {
|
2023-12-08 16:46:49 +08:00
|
|
|
|
//InterlockKM4 bool
|
|
|
|
|
//InterlockKM8 bool
|
|
|
|
|
InterlockKmGroup map[int32]bool //开门编组。k-编组 v-设置开门
|
|
|
|
|
InterlockGM bool
|
|
|
|
|
InterlockMPL bool
|
2023-11-01 16:52:03 +08:00
|
|
|
|
|
|
|
|
|
MkxKM bool
|
|
|
|
|
MkxGM bool
|
2023-11-02 15:49:52 +08:00
|
|
|
|
MkxPL bool
|
2023-11-09 10:53:18 +08:00
|
|
|
|
|
2024-01-24 09:59:17 +08:00
|
|
|
|
QDTC bool
|
|
|
|
|
TZTC bool
|
|
|
|
|
//ZAW bool
|
2023-11-09 10:53:18 +08:00
|
|
|
|
JXTCPL bool
|
2023-10-23 17:35:57 +08:00
|
|
|
|
}
|