2023-09-27 18:02:07 +08:00
|
|
|
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-09-27 18:02:07 +08:00
|
|
|
)
|
|
|
|
|
2023-10-07 17:48:39 +08:00
|
|
|
// 继电器操作方法
|
2023-11-06 14:30:09 +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 {
|
2023-11-06 14:30:09 +08:00
|
|
|
return fi.DriveRelayUp(sim.World, uid)
|
2023-10-08 10:35:40 +08:00
|
|
|
} else {
|
2023-11-06 14:30:09 +08:00
|
|
|
return fi.DriveRelayDown(sim.World, uid)
|
2023-10-07 17:48:39 +08:00
|
|
|
}
|
|
|
|
}
|