rts-sim-testing-service/ts/simulation/wayside/memory/wayside_memory_relay.go

17 lines
398 B
Go
Raw Normal View History

package memory
import (
2023-10-26 17:16:07 +08:00
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
2023-10-08 10:35:40 +08:00
"joylink.club/rtsssimulation/fi"
)
2023-10-07 17:48:39 +08:00
// 继电器操作方法
func ChangeRelayState(sim *VerifySimulation, mapId int32, id string, td bool) error {
2023-10-07 17:48:39 +08:00
uid := QueryUidByMidAndComId(mapId, id, &graphicData.Relay{})
2023-10-08 10:35:40 +08:00
if td {
return fi.DriveRelayUp(sim.World, uid)
2023-10-08 10:35:40 +08:00
} else {
return fi.DriveRelayDown(sim.World, uid)
2023-10-07 17:48:39 +08:00
}
}