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

23 lines
740 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按钮
2023-10-20 13:50:22 +08:00
func ChangeIBPButtonState(sim *VerifySimulation, mapId int32, stationId, btnCode string, pressDown bool) {
stationUid := QueryUidByMidAndComId(mapId, stationId, &graphicData.Station{})
2023-10-18 13:53:17 +08:00
if pressDown {
2023-10-20 15:52:50 +08:00
fi.PressDownButton(sim.World, stationUid+"_button_"+btnCode)
2023-10-18 13:53:17 +08:00
} else {
2023-10-20 15:52:50 +08:00
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) {
stationUid := QueryUidByMidAndComId(mapId, stationId, &graphicData.Station{})
2023-10-20 15:52:50 +08:00
fi.SwitchKeyGear(sim.World, stationUid+"_key_"+keyCode, gear)
2023-10-20 13:50:22 +08:00
}