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

23 lines
773 B
Go
Raw Normal View History

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