| | |
| | | "fmt" |
| | | "io/ioutil" |
| | | "net" |
| | | "strings" |
| | | "time" |
| | | |
| | | "gat1400Exchange/config" |
| | |
| | | type ElevatorData struct { |
| | | Elevator []Elevator `json:"Elevator"` |
| | | } |
| | | |
| | | const ( |
| | | RunStop = iota |
| | | RunUp |
| | | RunDown |
| | | ) |
| | | |
| | | // 对接网络视频字符叠加器,接收udp发送的楼层信息, 更新device地址 |
| | | func NVCSA1UDPServer() { |
| | |
| | | continue |
| | | } |
| | | |
| | | // 设置osd 格式 "1F 固 枪" |
| | | if config.NVCSConf.OSD != "" { |
| | | floorText := data.Elevator[0].Status.FloorName |
| | | //if data.Elevator[0].Status.RunDir == RunStop { |
| | | // floorText = floorText + "停" |
| | | //} else if data.Elevator[0].Status.RunDir == RunUp { |
| | | // floorText = floorText + "上" |
| | | //} else { |
| | | // floorText = floorText + "下" |
| | | //} |
| | | |
| | | floorText = floorText + " " + config.NVCSConf.OSD |
| | | |
| | | // 调用hik api 将文字添加到osd的左下角 |
| | | AddFloorToOSD(floorText) |
| | | } |
| | | |
| | | if data.Elevator[0].Status.RunDir > 0 { |
| | | continue |
| | | } |
| | |
| | | elevator := data.Elevator[0] |
| | | |
| | | // 程序部署在设备端, 字符叠加器上报的名称允许为空. 在云端, 名称必须与摄像机相同 |
| | | if config.ServeConf.Role != "agent" { |
| | | elevator.Name = strings.Trim(elevator.Name, " ") |
| | | if elevator.Name == "" { |
| | | continue |
| | | } |
| | | if elevator.Name == "" { |
| | | elevator.Name = "1" |
| | | } |
| | | |
| | | var d = models.Positions{ |