24 lines
622 B
Go
24 lines
622 B
Go
package memory
|
|
|
|
import (
|
|
"joylink.club/bj-rtsts-server/sys_error"
|
|
"joylink.club/rtsssimulation/fi"
|
|
)
|
|
|
|
// 操作PSL按钮
|
|
func ChangePSLButtonState(sim *VerifySimulation, mapId int32, gateBoxId uint32, btnCode string, pressDown bool) *sys_error.BusinessError {
|
|
uid := QueryUidStructure[*StationUidStructure](mapId)
|
|
gateBoxUid := uid.PslIds[gateBoxId].Uid
|
|
var err error
|
|
if pressDown {
|
|
err = fi.PressDownButton(sim.World, gateBoxUid+"_"+btnCode)
|
|
} else {
|
|
err = fi.PressUpButton(sim.World, gateBoxUid+"_"+btnCode)
|
|
}
|
|
if err != nil {
|
|
return sys_error.New("操作PSL按钮出错", err)
|
|
} else {
|
|
return nil
|
|
}
|
|
}
|