【bug】车库门强制开关门无效;洗车机取消故障后依然有紧急停车
All checks were successful
local-test分支打包构建docker并发布运行 / Docker-Build (push) Successful in 1m38s

This commit is contained in:
thesai 2024-04-07 13:38:30 +08:00
parent 3ef9f59184
commit 1facbfeb2b
2 changed files with 14 additions and 1 deletions

@ -1 +1 @@
Subproject commit 4371dad391e895abcbe7a13fdcd60f74bd5c5677 Subproject commit 8ccd46aa6c97a933fd12c7b308da929115c9aa8e

View File

@ -29,11 +29,24 @@ func setParam(simulation *VerifySimulation, req *request_proto.CkmOperationReq)
entry, ok := wd.EntityMap[uid] entry, ok := wd.EntityMap[uid]
if ok { if ok {
entry.AddComponent(appcomponent.CkmParamType, unsafe.Pointer(req.Param)) entry.AddComponent(appcomponent.CkmParamType, unsafe.Pointer(req.Param))
//故障
if req.Param.Fault == request_proto.Ckm_FA_State_Loss { if req.Param.Fault == request_proto.Ckm_FA_State_Loss {
setRelayStateLoss(entry) setRelayStateLoss(entry)
} else { } else {
clearRelayStateLoss(entry) clearRelayStateLoss(entry)
} }
//强制
switch req.Param.Force {
case request_proto.Ckm_F_NONE:
entry.RemoveComponent(component.CkmForceCloseTag)
entry.RemoveComponent(component.CkmForceOpenTag)
case request_proto.Ckm_F_KM:
entry.AddComponent(component.CkmForceOpenTag)
entry.RemoveComponent(component.CkmForceCloseTag)
case request_proto.Ckm_F_GM:
entry.AddComponent(component.CkmForceCloseTag)
entry.RemoveComponent(component.CkmForceOpenTag)
}
} else { } else {
return ecs.NewErrResult(fmt.Errorf("未找到id=%s的实体", uid)) return ecs.NewErrResult(fmt.Errorf("未找到id=%s的实体", uid))
} }