fi signal dcxh

This commit is contained in:
xzb 2023-10-09 17:13:16 +08:00
parent 92c1f38ff1
commit 19eee6acfd
2 changed files with 40 additions and 0 deletions

37
fi/signal_dcxh.go Normal file
View File

@ -0,0 +1,37 @@
package fi
import (
"joylink.club/ecs"
"joylink.club/rtsssimulation/component"
"joylink.club/rtsssimulation/entity"
)
// signal dcxh 接口:开通调车信号、开通禁止信号
// DriveDCXHDx 开通调车信号(白灯亮)
func DriveDCXHDx(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
}
})
}
// DriveDCXHNon 开通禁止信号(蓝灯亮)
func DriveDCXHNon(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
}
})
}

3
fi/signal_jdxh.go Normal file
View File

@ -0,0 +1,3 @@
package fi
// signal jdxh 接口: