97 lines
2.0 KiB
Go
97 lines
2.0 KiB
Go
package component
|
|
|
|
import "joylink.club/ecs"
|
|
|
|
// 按钮标签
|
|
var (
|
|
// IBP
|
|
IBP = ecs.NewTag()
|
|
// 按钮标签
|
|
ButtonTag = ecs.NewTag()
|
|
// 未知按钮
|
|
UnknowBtn = ecs.NewTag()
|
|
// 非自复式按下接通式按钮
|
|
NoResetPressBtn = ecs.NewTag()
|
|
// 非自复式拉起接通式按钮
|
|
NoResetUpBtn = ecs.NewTag()
|
|
// 自复式按下接通式按钮
|
|
ResetPressBtn = ecs.NewTag()
|
|
// 自复式拉起接通式按钮
|
|
ResetUpBtn = ecs.NewTag()
|
|
// 钥匙旋钮
|
|
KeyKnob = ecs.NewTag()
|
|
// 警铃标签
|
|
AlarmTag = ecs.NewTag()
|
|
// 灯标签
|
|
LightTag = ecs.NewTag()
|
|
// 钥匙标签
|
|
KeyTag = ecs.NewTag()
|
|
)
|
|
|
|
// 带单灯设备
|
|
type SingleLight struct {
|
|
Light *ecs.Entry
|
|
}
|
|
|
|
var SingleLightType = ecs.NewComponentType[SingleLight]()
|
|
|
|
// 蜂鸣器驱动
|
|
type AlarmDrive struct {
|
|
Td bool
|
|
}
|
|
|
|
// 蜂鸣器驱动组件
|
|
var AlarmDriveType = ecs.NewComponentType[AlarmDrive]()
|
|
|
|
// 挡位组件
|
|
type GearState struct {
|
|
Val int32
|
|
}
|
|
|
|
var GearStateType = ecs.NewComponentType[GearState]()
|
|
|
|
// SPK继电器控制电路
|
|
type SpkElectronic struct {
|
|
// 控制区
|
|
SPKSXPLA_BTN *ecs.Entry
|
|
SPKSX1J_KEY *ecs.Entry
|
|
SPKSX3J_KEY *ecs.Entry
|
|
SPKSSPLA_BTN *ecs.Entry
|
|
SPKSS2J_KEY *ecs.Entry
|
|
SPKSS4J_KEY *ecs.Entry
|
|
|
|
// 表示区
|
|
SPKSX1J *ecs.Entry
|
|
SPKSX3J *ecs.Entry
|
|
SPKSS2J *ecs.Entry
|
|
SPKSS4J *ecs.Entry
|
|
SPKSXPLAJ *ecs.Entry
|
|
SPKSSPLAJ *ecs.Entry
|
|
SPKSX1D *ecs.Entry
|
|
SPKSX3D *ecs.Entry
|
|
SPKSS2D *ecs.Entry
|
|
SPKSS4D *ecs.Entry
|
|
SDA *ecs.Entry
|
|
}
|
|
|
|
// SPK继电器元器件组件
|
|
var SpkElectronicType = ecs.NewComponentType[SpkElectronic]()
|
|
|
|
// EMP 电路设备
|
|
type EmpDeviceElectronic struct {
|
|
EMP_BTNS []*ecs.Entry // 紧急关闭按钮
|
|
EMPFA_BTN *ecs.Entry // 复原按钮
|
|
EMPD *ecs.Entry // 指示灯
|
|
EMPJ *ecs.Entry // 继电器
|
|
}
|
|
|
|
// EMP 电路
|
|
type EmpElectronic struct {
|
|
EMPJMap map[string]*EmpDeviceElectronic
|
|
SDA *ecs.Entry // 按钮
|
|
QBA *ecs.Entry // 非自复位按钮
|
|
Alarm *ecs.Entry // 蜂鸣器
|
|
}
|
|
|
|
var EmpElectronicType = ecs.NewComponentType[EmpElectronic]()
|