38 lines
965 B
Go
38 lines
965 B
Go
package fi
|
|
|
|
import (
|
|
"joylink.club/ecs"
|
|
"joylink.club/rtsssimulation/component"
|
|
"joylink.club/rtsssimulation/entity"
|
|
)
|
|
|
|
// signal dcxh 接口:开通调车信号、开通禁止信号
|
|
|
|
// DriveSignalDCXHDx 开通调车信号(白灯亮)
|
|
func DriveSignalDCXHDx(w ecs.World, signalId string) {
|
|
w.Execute(func() {
|
|
wd := entity.GetWorldData(w)
|
|
signalEntry, ok := wd.EntityMap[signalId]
|
|
if ok {
|
|
state := component.SignalDCXHElectronicType.Get(signalEntry)
|
|
driveDx := component.RelayDriveType.Get(state.DCXH_DXJ)
|
|
driveDx.Td = true
|
|
driveDx.Xq = true
|
|
}
|
|
})
|
|
}
|
|
|
|
// DriveSignalDCXHNon 开通禁止信号(蓝灯亮)
|
|
func DriveSignalDCXHNon(w ecs.World, signalId string) {
|
|
w.Execute(func() {
|
|
wd := entity.GetWorldData(w)
|
|
signalEntry, ok := wd.EntityMap[signalId]
|
|
if ok {
|
|
state := component.SignalDCXHElectronicType.Get(signalEntry)
|
|
driveDx := component.RelayDriveType.Get(state.DCXH_DXJ)
|
|
driveDx.Td = false
|
|
driveDx.Xq = false
|
|
}
|
|
})
|
|
}
|