rts-sim-testing-service/ts/simulation/wayside/memory/wayside_memory_relay.go
2023-12-14 13:04:48 +08:00

17 lines
398 B
Go

package memory
import (
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/rtsssimulation/fi"
)
// 继电器操作方法
func ChangeRelayState(sim *VerifySimulation, mapId int32, id uint32, td bool) error {
uid := QueryUidByMidAndComId(mapId, id, &graphicData.Relay{})
if td {
return fi.DriveRelayUp(sim.World, uid)
} else {
return fi.DriveRelayDown(sim.World, uid)
}
}