2023-10-10 16:15:56 +08:00
|
|
|
package component
|
|
|
|
|
|
|
|
import "joylink.club/ecs"
|
|
|
|
|
2023-10-11 15:43:48 +08:00
|
|
|
// 按钮标签
|
|
|
|
var (
|
2023-10-12 13:47:57 +08:00
|
|
|
// IBP
|
|
|
|
IBP = ecs.NewTag()
|
2023-10-18 11:17:08 +08:00
|
|
|
// 按钮标签
|
|
|
|
ButtonTag = ecs.NewTag()
|
2023-10-12 13:47:57 +08:00
|
|
|
// 未知按钮
|
|
|
|
UnknowBtn = ecs.NewTag()
|
2023-10-11 15:43:48 +08:00
|
|
|
// 非自复式按下接通式按钮
|
|
|
|
NoResetPressBtn = ecs.NewTag()
|
|
|
|
// 非自复式拉起接通式按钮
|
|
|
|
NoResetUpBtn = ecs.NewTag()
|
|
|
|
// 自复式按下接通式按钮
|
|
|
|
ResetPressBtn = ecs.NewTag()
|
|
|
|
// 自复式拉起接通式按钮
|
|
|
|
ResetUpBtn = ecs.NewTag()
|
2023-10-12 13:47:57 +08:00
|
|
|
// 钥匙旋钮
|
2023-10-12 15:03:11 +08:00
|
|
|
KeyKnob = ecs.NewTag()
|
2023-10-18 11:17:08 +08:00
|
|
|
// 警铃标签
|
|
|
|
AlarmTag = ecs.NewTag()
|
|
|
|
// 灯标签
|
|
|
|
LightTag = ecs.NewTag()
|
2023-10-20 13:13:44 +08:00
|
|
|
// 钥匙标签
|
|
|
|
KeyTag = ecs.NewTag()
|
2023-10-11 15:43:48 +08:00
|
|
|
)
|
|
|
|
|
2023-10-18 11:17:08 +08:00
|
|
|
// 带单灯设备
|
|
|
|
type SingleLight struct {
|
|
|
|
Light *ecs.Entry
|
|
|
|
}
|
|
|
|
|
|
|
|
var SingleLightType = ecs.NewComponentType[SingleLight]()
|
|
|
|
|
2023-10-11 15:43:48 +08:00
|
|
|
// 蜂鸣器驱动
|
2023-10-12 17:46:43 +08:00
|
|
|
type AlarmDrive struct {
|
2023-10-11 15:43:48 +08:00
|
|
|
Td bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// 蜂鸣器驱动组件
|
2023-10-12 17:46:43 +08:00
|
|
|
var AlarmDriveType = ecs.NewComponentType[AlarmDrive]()
|
2023-10-11 15:43:48 +08:00
|
|
|
|
2023-10-20 13:13:44 +08:00
|
|
|
// 挡位组件
|
|
|
|
type GearState struct {
|
|
|
|
Val int
|
|
|
|
}
|
|
|
|
|
|
|
|
var GearStateType = ecs.NewComponentType[GearState]()
|
|
|
|
|
2023-10-10 16:15:56 +08:00
|
|
|
// SPK继电器控制电路
|
2023-10-12 13:47:57 +08:00
|
|
|
type SpkElectronic struct {
|
|
|
|
// 控制区
|
2023-10-10 16:15:56 +08:00
|
|
|
SPKSXPLA_BTN *ecs.Entry
|
2023-10-12 15:03:11 +08:00
|
|
|
SPKSX1J_KEY *ecs.Entry
|
|
|
|
SPKSX3J_KEY *ecs.Entry
|
2023-10-10 16:15:56 +08:00
|
|
|
SPKSSPLA_BTN *ecs.Entry
|
2023-10-12 15:03:11 +08:00
|
|
|
SPKSS2J_KEY *ecs.Entry
|
|
|
|
SPKSS4J_KEY *ecs.Entry
|
2023-10-10 16:15:56 +08:00
|
|
|
|
2023-10-12 13:47:57 +08:00
|
|
|
// 表示区
|
|
|
|
SPKSX1J *ecs.Entry
|
|
|
|
SPKSX3J *ecs.Entry
|
|
|
|
SPKSS2J *ecs.Entry
|
|
|
|
SPKSS4J *ecs.Entry
|
2023-10-10 16:15:56 +08:00
|
|
|
SPKSXPLAJ *ecs.Entry
|
|
|
|
SPKSSPLAJ *ecs.Entry
|
2023-10-11 15:43:48 +08:00
|
|
|
SPKSX1D *ecs.Entry
|
|
|
|
SPKSX3D *ecs.Entry
|
|
|
|
SPKSS2D *ecs.Entry
|
|
|
|
SPKSS4D *ecs.Entry
|
2023-10-12 13:47:57 +08:00
|
|
|
SDA *ecs.Entry
|
2023-10-10 16:15:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// SPK继电器元器件组件
|
2023-10-12 13:47:57 +08:00
|
|
|
var SpkElectronicType = ecs.NewComponentType[SpkElectronic]()
|
2023-10-10 16:15:56 +08:00
|
|
|
|
2023-10-12 10:25:01 +08:00
|
|
|
// SPK采集电路吸起、落下接通状态
|
|
|
|
type SpkCollectState struct {
|
|
|
|
SPKSX1J_XQ bool
|
|
|
|
SPKSX3J_XQ bool
|
|
|
|
SPKSS2J_XQ bool
|
|
|
|
SPKSS4J_XQ bool
|
|
|
|
SPKSXPLA_XQ bool
|
|
|
|
SPKSSPLA_XQ bool
|
|
|
|
}
|
|
|
|
|
|
|
|
var SpkCollectStateType = ecs.NewComponentType[SpkCollectState]()
|
|
|
|
|
2023-10-12 13:47:57 +08:00
|
|
|
// EMP 电路
|
|
|
|
type EmpElectronic struct {
|
|
|
|
// 控制区
|
2023-10-10 16:15:56 +08:00
|
|
|
EMP1_BTN *ecs.Entry
|
|
|
|
EMP3_BTN *ecs.Entry
|
|
|
|
EMP5_BTN *ecs.Entry
|
|
|
|
EMPX_BTN *ecs.Entry
|
|
|
|
XEMPFA_BTN *ecs.Entry
|
|
|
|
EMP2_BTN *ecs.Entry
|
|
|
|
EMP4_BTN *ecs.Entry
|
|
|
|
EMP6_BTN *ecs.Entry
|
|
|
|
EMPS_BTN *ecs.Entry
|
|
|
|
SEMPFA_BTN *ecs.Entry
|
2023-10-12 13:47:57 +08:00
|
|
|
// 表示区
|
2023-10-11 15:43:48 +08:00
|
|
|
XEMPJ *ecs.Entry // 继电器
|
|
|
|
XEMPD *ecs.Entry
|
|
|
|
SEMPJ *ecs.Entry // 继电器
|
|
|
|
SEMPD *ecs.Entry
|
2023-10-12 13:47:57 +08:00
|
|
|
SDA *ecs.Entry // 按钮
|
|
|
|
QBA *ecs.Entry // 非自复位按钮
|
2023-10-12 17:46:43 +08:00
|
|
|
Alarm *ecs.Entry // 蜂鸣器
|
2023-10-10 16:15:56 +08:00
|
|
|
}
|
|
|
|
|
2023-10-12 13:47:57 +08:00
|
|
|
var EmpElectronicType = ecs.NewComponentType[EmpElectronic]()
|
2023-10-12 10:25:01 +08:00
|
|
|
|
|
|
|
// EMP 采集电路吸起、落下接通状态
|
|
|
|
type EmpCollectState struct {
|
|
|
|
XEMPJ_XQ bool
|
|
|
|
SEMPJ_XQ bool
|
|
|
|
}
|
|
|
|
|
|
|
|
var EmpCollectStateType = ecs.NewComponentType[EmpCollectState]()
|