| | |
| | | } |
| | | |
| | | // 处理梯控填写的楼层信息 暂时使用otherFeature字段 |
| | | if face.OtherFeature != "" { |
| | | if face.OtherFeature != "" && pd.CameraFloor == "" { |
| | | pd.CameraFloor, _ = pkg.RestoreFloor(face.OtherFeature) |
| | | } |
| | | |
| | |
| | | |
| | | func NVCSA2WebServer() { |
| | | // 先获取总楼层数, 记录最高层 |
| | | GetA2ElevatorConfig() |
| | | var runState string |
| | | var iRunState int |
| | | //GetA2ElevatorConfig() |
| | | |
| | | r := gin.Default() |
| | | |
| | | r.POST("/", func(c *gin.Context) { |
| | | var req A2ElevatorData |
| | | var runState string |
| | | var iRunState int |
| | | |
| | | err := c.BindJSON(&req) |
| | | if err != nil { |
| | | c.JSON(http.StatusBadRequest, nil) |
| | |
| | | iRunState = RunDown |
| | | } |
| | | |
| | | // 已到最下层 |
| | | if req.State.Floor == A2BottomFloor { |
| | | runState = "上" |
| | | iRunState = RunUp |
| | | } |
| | | if req.State.Floor == A2TopFloor { |
| | | runState = "下" |
| | | iRunState = RunDown |
| | | } |
| | | //// 已到最下层 |
| | | //if req.State.Floor == A2BottomFloor { |
| | | // runState = "上" |
| | | // iRunState = RunUp |
| | | //} |
| | | //if req.State.Floor == A2TopFloor { |
| | | // runState = "下" |
| | | // iRunState = RunDown |
| | | //} |
| | | |
| | | if config.NVCSConf.OSD != "" { |
| | | floorText := fmt.Sprintf("%s%s %s", req.State.Floor, runState, config.NVCSConf.OSD) |