fi signal 2xh1
This commit is contained in:
parent
de8b470ed3
commit
f514c1efdd
@ -9,7 +9,7 @@ import (
|
|||||||
// 2xh1信号机功能接口
|
// 2xh1信号机功能接口
|
||||||
|
|
||||||
// Drive2XH1Dd 点灯操作
|
// Drive2XH1Dd 点灯操作
|
||||||
// dd : true-点灯,false-灭灯
|
// dd : true-物理点灯,false-物理灭灯
|
||||||
func Drive2XH1Dd(w ecs.World, signalId string, dd bool) {
|
func Drive2XH1Dd(w ecs.World, signalId string, dd bool) {
|
||||||
w.Execute(func() {
|
w.Execute(func() {
|
||||||
wd := entity.GetWorldData(w)
|
wd := entity.GetWorldData(w)
|
||||||
@ -23,17 +23,30 @@ func Drive2XH1Dd(w ecs.World, signalId string, dd bool) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Drive2XH1Lx 列车信号操作
|
// Drive2XH1Lx 开通列车信号(绿灯亮)
|
||||||
// lx : true-允许列车通过信号,false-禁止列车通过信号
|
func Drive2XH1Lx(w ecs.World, signalId string) {
|
||||||
func Drive2XH1Lx(w ecs.World, signalId string, lx bool) {
|
|
||||||
w.Execute(func() {
|
w.Execute(func() {
|
||||||
wd := entity.GetWorldData(w)
|
wd := entity.GetWorldData(w)
|
||||||
signalEntry, ok := wd.EntityMap[signalId]
|
signalEntry, ok := wd.EntityMap[signalId]
|
||||||
if ok {
|
if ok {
|
||||||
state := component.Signal2XH1ElectronicType.Get(signalEntry)
|
state := component.Signal2XH1ElectronicType.Get(signalEntry)
|
||||||
drive := component.RelayDriveType.Get(state.Z2XH1_LXJ)
|
drive := component.RelayDriveType.Get(state.Z2XH1_LXJ)
|
||||||
drive.Td = lx
|
drive.Td = true
|
||||||
drive.Xq = lx
|
drive.Xq = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Drive2XH1Non 开通禁止信号(红灯亮)
|
||||||
|
func Drive2XH1Non(w ecs.World, signalId string) {
|
||||||
|
w.Execute(func() {
|
||||||
|
wd := entity.GetWorldData(w)
|
||||||
|
signalEntry, ok := wd.EntityMap[signalId]
|
||||||
|
if ok {
|
||||||
|
state := component.Signal2XH1ElectronicType.Get(signalEntry)
|
||||||
|
drive := component.RelayDriveType.Get(state.Z2XH1_LXJ)
|
||||||
|
drive.Td = false
|
||||||
|
drive.Xq = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user