From c22dd59b10c482b9245034c6a0bd3b645c427d31 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期五, 14 一月 2022 13:39:25 +0800
Subject: [PATCH] 去掉禁止删除本地音乐文件权限

---
 HDL_ON/DAL/DriverLayer/Control.cs |   36 ++++++++++++++++++++++++++++++++----
 1 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs
index 4a6ad64..277b20b 100644
--- a/HDL_ON/DAL/DriverLayer/Control.cs
+++ b/HDL_ON/DAL/DriverLayer/Control.cs
@@ -503,11 +503,18 @@
             {
                 new System.Threading.Thread(() =>
                 {
-                    foreach (var temp in functions)
+                    foreach (var function in functions)
                     {
                         Dictionary<string, string> d1 = new Dictionary<string, string>();
                         d1.Add(FunctionAttributeKey.OnOff, open ? "on" : "off");
-                        SendWriteCommand(temp, d1);
+                         if (function.spk == SPK.PanelSocket)
+                        {
+                            if (function.attributes.Find((obj) => obj.key == "on_off_usb") != null)
+                            {
+                                d1.Add("on_off_usb", function.trait_on_off.curValue.ToString());
+                            }
+                        }
+                        SendWriteCommand(function, d1);
                         System.Threading.Thread.Sleep(100);
                     }
                 })
@@ -835,7 +842,7 @@
                             var revString = Encoding.UTF8.GetString(receiveBytes);
                             receiveObj.BodyDataString = revString;
                             MainPage.Log($"灞�鍩熺綉淇℃伅: 瑙e瘑鍚庯細" + receiveObj.BodyDataString);
-                            //if(receiveObj.Topic.EndsWith("/thing/property/up"))
+                            //if (receiveObj.Topic.EndsWith("/thing/property/up"))
                             //{
                             //    MsgInfoList.Add(revString + "\r\n");
                             //}
@@ -972,21 +979,35 @@
                         var localFunction = allLocalFuntion.Find((obj) => obj.sid == updateTemp.sid);
                         if (localFunction == null)
                         {
+                            Console.WriteLine("鎵句笉鍒伴煶涔愭挱鏀惧櫒娣�=======" + revString);
                             continue;
                         }
                         if (Ins.GatewayOnline_Local && isCloudData)//鏈湴閾炬帴锛岄櫎浜嗘秱楦﹁澶囨暟鎹箣澶栫殑浜戠鏁版嵁涓嶅鐞�
                         {
-                            if (!SPK.Get3tySpk(SPK.BrandType.All3tyBrand).Contains(localFunction.spk))
+                            if (!SPK.Get3tySpk(SPK.BrandType.All3tyBrand).Contains(localFunction.spk) && !SPK.MusicSpkList().Contains( localFunction.spk))
                             {
                                 //MainPage.Log($"A鍗忚鏇存柊鐘舵��:鏈湴閾炬帴锛岄櫎浜嗘秱楦﹁澶囨暟鎹箣澶栫殑浜戠鏁版嵁涓嶅鐞�........");
+
                                 return;
                             }
                         }
+
+                        //if (SPK.MusicSpkList().Contains(localFunction.spk))
+                        //{
+                        //    if (updateTemp.status.Count < 3)
+                        //    {
+                        //        ///鏄煶涔愬姛鑳界殑
+                        //        ///涓婃姤灞炴�у皯3鏉′笉鍋氬鐞�
+                        //        return;
+                        //    }
+                        //}
                         //MainPage.Log($"A鍗忚鏇存柊鐘舵��:{revString}");
                         foreach (var attr in updateTemp.status)
                         {
                             localFunction.time_stamp = temp.time_stamp;
                             localFunction.SetAttrState(attr.key, attr.value);
+                            Console.WriteLine("闊充箰鎾斁鍣ㄦ坊鍔犵紦瀛樻暟鎹�=======" + revString);
+
                         }
 
                         //鏇存柊鐣岄潰鐘舵��
@@ -1142,6 +1163,7 @@
                             case SPK.ElectricSocket:
                             case SPK.PanelSocket:
                                 SocketPage.UpdataState(localFunction);
+                                SocketPage_InstantaneousValue.UpdataView(localFunction);
                                 break;
                             case SPK.ElectricTV:
                                 break;
@@ -1167,6 +1189,12 @@
                                 //鐘舵�佹洿鏂�
                                 Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(updateTemp.sid, updateTemp.status);
                                 break;
+                            case SPK.AvMusic:
+                            case SPK.MusicStandard:
+                                //UI.Music.MusicMain.mMusicMain.RefreshView(updateTemp);
+                                Console.WriteLine("闊充箰鎾斁鍣ㄦ樉绀虹姸鎬�======="+ revString);
+                                //wjc
+                                break;
                         }
 
                         HomePage.UpdataFunctionStates(localFunction);

--
Gitblit v1.8.0