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

23 lines
773 B
Go

package memory
import (
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/rtsssimulation/fi"
)
// 操作IBP按钮
func ChangeIBPButtonState(sim *VerifySimulation, mapId int32, stationId, btnCode string, pressDown bool) error {
stationUid := QueryUidByMidAndComId(mapId, stationId, &graphicData.Station{})
if pressDown {
return fi.PressDownButton(sim.World, stationUid+"_button_"+btnCode)
} else {
return fi.PressUpButton(sim.World, stationUid+"_button_"+btnCode)
}
}
// 操作IBP按钮
func ChangeIBPKeyState(sim *VerifySimulation, mapId int32, stationId, keyCode string, gear int32) error {
stationUid := QueryUidByMidAndComId(mapId, stationId, &graphicData.Station{})
return fi.SwitchKeyGear(sim.World, stationUid+"_key_"+keyCode, gear)
}