From 29dbb82ed5d96ade6baddde05ec8536e298bb595 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期二, 21 五月 2024 23:43:47 +0800
Subject: [PATCH] 添加osd设置功能

---
 service/nvcs.go |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/service/nvcs.go b/service/nvcs.go
index 7af51b1..64464fa 100644
--- a/service/nvcs.go
+++ b/service/nvcs.go
@@ -36,6 +36,12 @@
 	Elevator []Elevator `json:"Elevator"`
 }
 
+const (
+	RunStop = iota
+	RunUp
+	RunDown
+)
+
 // 瀵规帴缃戠粶瑙嗛瀛楃鍙犲姞鍣�,鎺ユ敹udp鍙戦�佺殑妤煎眰淇℃伅, 鏇存柊device鍦板潃
 func NVCSA1UDPServer() {
 	// 鎸囧畾鐩戝惉鐨勭鍙�
@@ -87,6 +93,23 @@
 			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
 		}

--
Gitblit v1.8.0