fi signal dcxh
This commit is contained in:
parent
92c1f38ff1
commit
19eee6acfd
37
fi/signal_dcxh.go
Normal file
37
fi/signal_dcxh.go
Normal 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
3
fi/signal_jdxh.go
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
package fi
|
||||||
|
|
||||||
|
// signal jdxh 接口:
|
Loading…
Reference in New Issue
Block a user