From 7b96ea115d51fb721130fef8622500740dea7b08 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期四, 25 八月 2022 18:06:29 +0800
Subject: [PATCH] 2022年08月25日18:06:27

---
 HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs |   85 +++++++++++++++++++++++++++++++++++++++---
 1 files changed, 78 insertions(+), 7 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs
index 5c5590d..d37b603 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs
@@ -12,16 +12,16 @@
 {
     public class SendMethod
     {
-        private static SendMethod sMethod = null;
-        public static SendMethod mMethod
+        private static SendMethod s_Current= null; 
+        public static SendMethod Current
         {
             get
             {
-                if (sMethod == null)
+                if (s_Current == null)
                 {
-                    sMethod = new SendMethod();
+                    s_Current = new SendMethod();
                 }
-                return sMethod;
+                return s_Current;
             }
 
         }
@@ -44,7 +44,7 @@
         {
             new System.Threading.Thread(() =>
             {
-                DriverLayer.Control.Ins.SendWriteCommand(function, dic);
+                DriverLayer.Control.Ins.SendWriteCommand(function, dic,false,0);
             })
             { IsBackground = true }.Start();
         }
@@ -60,7 +60,7 @@
             {
                 //RefreshDeviceStatus(functionIds);
                 //a31Music.LastDateTime = DateTime.Now;
-                ///浠庣紦瀛橀噷闈㈡煡鎵鹃煶涔愭挱鏀惧櫒瀵硅薄<缂撳瓨鏁版嵁鏀跺埌鎺ㄩ�佽繃鏉ョ殑鐘舵�佷細鏇存柊缂撳瓨鏁版嵁>
+                ///浠庣紦瀛橀噷闈㈡煡鎵鹃煶涔愭挱鏀惧櫒瀵硅薄<鏀跺埌鎺ㄩ�佽繃鏉ョ殑鐘舵�佷細鏇存柊缂撳瓨鏁版嵁>
                 var allLocalFuntion = FunctionList.List.GetDeviceFunctionList();
                 var localFunction = allLocalFuntion.Find((obj) => obj.sid == sid);
                 if (localFunction == null)
@@ -152,6 +152,77 @@
             }
 
         }
+        /// <summary>
+        /// 鑾峰彇鍒楄〃鍚嶅垪琛�
+        /// </summary>
+        /// <param name="music"></param>
+        /// <returns></returns>
+        public List<GroupList> GetListName(Function music)
+        {
+            try
+            {
+                Dictionary<string, object> d = new Dictionary<string, object>();
+                d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+                d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
+                d.Add("deviceIds", new List<string> { music.deviceId });
+                var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_GroupList);
+                if (responsePackNew.Code != "0" || responsePackNew.Data == null || responsePackNew.Data.ToString() == "")
+                {
+                    return new List<GroupList>();
+                }
+                //鏁版嵁杩斿簭鍒楀寲涓篎unction瀵硅薄
+                var str = Newtonsoft.Json.JsonConvert.SerializeObject(responsePackNew.Data);
+                var groupLists = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GroupList>>(str);
+                if (groupLists == null)
+                {
+                    groupLists = new List<GroupList>();
+                }
+                return groupLists;
+            }
+            catch
+            {
+                return new List<GroupList>();
+            }
+        }
+        /// <summary>
+        /// 鑾峰彇鍒楄〃闊充箰
+        /// </summary>
+        /// <param name="music"></param>
+        /// <param name="listName">鍒楄〃鍚�</param>
+        /// <returns></returns>
+        public PalyList GetListMusic(Function music, string listName)
+        {
+            try
+            {
+                Dictionary<string, object> d = new Dictionary<string, object>();
+                Dictionary<string, object> d1 = new Dictionary<string, object>();
+                Dictionary<string, object> d2 = new Dictionary<string, object>();
+                d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+                d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
+                d2.Add("group", listName);
+                d1.Add("sid", music.sid);
+                d1.Add("groupList", new List<Dictionary<string, object>> { d2 });
+                d.Add("sidGroups", new List<Dictionary<string, object>> { d1 });
+
+                var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_GroupPlayerList);
+                if (responsePackNew.Code != "0" || responsePackNew.Data == null || responsePackNew.Data.ToString() == "")
+                {
+                    return new PalyList();
+                }
+                //鏁版嵁杩斿簭鍒楀寲涓篎unction瀵硅薄
+                var str = Newtonsoft.Json.JsonConvert.SerializeObject(responsePackNew.Data);
+                var palyLists = Newtonsoft.Json.JsonConvert.DeserializeObject<PalyList>(str);
+                if (palyLists == null)
+                {
+                    palyLists = new PalyList();
+                }
+                return palyLists;
+            }
+            catch
+            {
+                return new PalyList();
+            }
+        }
 
         /// <summary>
         ///璇锋眰鏈嶅姟鍣紙涓庝綇瀹呮湁鍏�:渚嬪锛沨omeId锛� 

--
Gitblit v1.8.0