From fffd8afca5b69a592e9ba8913204f83f478e2f17 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期三, 06 五月 2020 17:28:35 +0800
Subject: [PATCH] 增加获取颜色接口(请合并代码)

---
 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs                           |   26 +++
 ZigbeeApp/Home.Ios/Resources/Language.ini                                                  |    4 
 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs                             |   46 +++---
 ZigbeeApp/Home.Ios/Home.IOS.csproj                                                         |    2 
 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs |    2 
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs                  |   28 ++++
 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorPMTwoPointFiveForm.cs             |   95 +++++++++++++
 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AddDeviceTypeListForm.cs                |    5 
 ZigbeeApp/Shared/R.cs                                                                      |    8 +
 ZigbeeApp/Shared/Shared.projitems                                                          |    1 
 ZigbeeApp/Home.Ios/Resources/Phone/Instruct/SensorPMTwoPointFive.png                       |    0 
 ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorPMTwoPointFive.png                         |    0 
 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs          |  151 +++++++++++++-------
 13 files changed, 287 insertions(+), 81 deletions(-)

diff --git a/ZigbeeApp/Home.Ios/Home.IOS.csproj b/ZigbeeApp/Home.Ios/Home.IOS.csproj
index 3620641..26f4465 100644
--- a/ZigbeeApp/Home.Ios/Home.IOS.csproj
+++ b/ZigbeeApp/Home.Ios/Home.IOS.csproj
@@ -1015,6 +1015,8 @@
       <BundleResource Include="Resources\Phone\Gateway\WiredGateway.png" />
       <BundleResource Include="Resources\Phone\Gateway\WirelessGateway.png" />
       <BundleResource Include="Resources\Phone\Gateway\AddGatewaySuccess.png" />
+      <BundleResource Include="Resources\Phone\Device\SensorPMTwoPointFive.png" />
+      <BundleResource Include="Resources\Phone\Instruct\SensorPMTwoPointFive.png" />
     </ItemGroup>
     <Import Project="..\Shared\Shared.projitems" Label="Shared" Condition="Exists('..\Shared\Shared.projitems')" />
     <Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
diff --git a/ZigbeeApp/Home.Ios/Resources/Language.ini b/ZigbeeApp/Home.Ios/Resources/Language.ini
index 0a84035..832366c 100755
--- a/ZigbeeApp/Home.Ios/Resources/Language.ini
+++ b/ZigbeeApp/Home.Ios/Resources/Language.ini
@@ -313,6 +313,7 @@
 310=璇疯緭鍏ュ悎娉曠殑鏁板瓧
 311=鎵嬪姩
 312= 鑳屽厜鐏鑹�
+313=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝淇″彿鍥炬爣{0}蹇棯锛� 杩涘叆閰嶇綉鐘舵�併�備俊鍙峰浘鏍囧父浜垯閰嶇綉鎴愬姛
 
 5097=鍙栨秷
 5098=纭畾
@@ -2054,4 +2055,5 @@
 70021=闂ㄧ獥浼犳劅鍣�
 70022=娓╂箍搴︿紶鎰熷櫒
 70023=涓户鍣�
-70024=鏅鸿兘绌哄紑
\ No newline at end of file
+70024=鏅鸿兘绌哄紑
+70025=PM2.5绌烘皵璐ㄩ噺浼犳劅鍣�
\ No newline at end of file
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorPMTwoPointFive.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorPMTwoPointFive.png
new file mode 100644
index 0000000..32335b9
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorPMTwoPointFive.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Instruct/SensorPMTwoPointFive.png b/ZigbeeApp/Home.Ios/Resources/Phone/Instruct/SensorPMTwoPointFive.png
new file mode 100644
index 0000000..b0d1b8e
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Instruct/SensorPMTwoPointFive.png
Binary files differ
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs
index 1d6dd1b..e2bd15a 100644
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs
@@ -82,6 +82,34 @@
         }
 
         /// <summary>
+        /// 鑾峰彇闈㈡澘棰滆壊鐨勪俊鎭�(鍑洪敊浼氳繑鍥瀗ull)
+        /// </summary>
+        /// <param name="panel">鎸夐敭闈㈡澘鐨勬煇涓�涓洖璺�</param>
+        /// <returns></returns>
+        public async Task<Panel.KeyColorData> GetPanelColorInfo(Panel panel)
+        {
+            panel.DeviceEpoint = 1;
+            Panel.KeyNum keyNum = (Panel.KeyNum)panel.DeviceEpoint;
+            var result = await panel.GetPanelColorInfoAsync(keyNum);
+            //鍏遍�氶敊璇娴�
+            string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
+            if (error != null)
+            {
+                this.ShowErrorMsg(error);
+                return null;
+            }
+
+            if (result == null || result.keyColorData == null)
+            {
+                //鑾峰彇鎸夐敭闈㈡澘棰滆壊璋冭妭淇℃伅澶辫触
+                string msg = Language.StringByID(R.MyInternationalizationString.uGetPanelColorRegulationInfoFail);
+                this.ShowErrorMsg(msg);
+                return null;
+            }
+            return result.keyColorData;
+        }
+
+        /// <summary>
         /// 璁剧疆鎸夐敭闈㈡澘鎸囧畾绔偣鐨勩�愭寚绀虹伅寮�鍏抽鑹层�戠殑淇℃伅
         /// </summary>
         /// <param name="panel">鎸夐敭闈㈡澘鐨勬煇涓�涓洖璺�</param>
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AddDeviceTypeListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AddDeviceTypeListForm.cs
old mode 100755
new mode 100644
index c8e359d..8a983a6
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AddDeviceTypeListForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AddDeviceTypeListForm.cs
@@ -172,6 +172,11 @@
             unSelectPic = "Device/SensorTemperatureHumidity.png";
             this.AddMenuRow(objectText, unSelectPic, "SensorTemperatureHumidityForm");
 
+            //PM2.5绌烘皵璐ㄩ噺浼犳劅鍣�
+            objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName26);
+            unSelectPic = "Device/SensorPMTwoPointFive.png";
+            this.AddMenuRow(objectText, unSelectPic, "SensorPMTwoPointFiveForm");
+
             //涓户鍣�
             objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName24);
             unSelectPic = "Device/RepeaterZigbee.png";
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorPMTwoPointFiveForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorPMTwoPointFiveForm.cs
new file mode 100644
index 0000000..b9ee56c
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorPMTwoPointFiveForm.cs
@@ -0,0 +1,95 @@
+锘縰sing System;
+namespace Shared.Phone.UserCenter.DeviceDirection
+{
+    /// <summary>
+    /// PM2.5浼犳劅鍣ㄧ殑娣诲姞姝ラ鐣岄潰
+    /// </summary>
+    public class SensorPMTwoPointFiveForm : DirectionCommonForm
+    {
+        #region 鈻� 鍒濆鍖朹____________________________
+
+        /// <summary>
+        /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+        /// </summary>
+        public void ShowForm()
+        {
+            //璁剧疆澶撮儴淇℃伅
+            base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice));
+
+            //鍒濆鍖栦腑閮ㄤ俊鎭�
+            this.InitMiddleFrame();
+        }
+
+        /// <summary>
+        /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+        /// </summary>
+        private void InitMiddleFrame()
+        {
+            //鍥剧墖
+            var framePic = new FrameLayout();
+            framePic.Width = this.GetPictrueRealSize(897);
+            framePic.Height = this.GetPictrueRealSize(705);
+            framePic.Gravity = Gravity.CenterHorizontal;
+            framePic.Y = Application.GetRealHeight(130);
+            bodyFrameLayout.AddChidren(framePic);
+            var btnPic = new PicViewControl(framePic.Width, framePic.Height, false);
+            btnPic.UnSelectedImagePath = "Instruct/SensorPMTwoPointFive.png";
+            framePic.AddChidren(btnPic);
+
+            //淇″彿鍥炬爣蹇棯
+            var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(455), this.GetPictrueRealSize(45), false);
+            btnGreanLinght.X = this.GetPictrueRealSize(420);
+            btnGreanLinght.Y = this.GetPictrueRealSize(295);
+            btnGreanLinght.TextAlignment = TextAlignment.Center;
+            btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3;
+            btnGreanLinght.TextSize = 10;
+            btnGreanLinght.TextID = R.MyInternationalizationString.uSignalIconFlash;
+            framePic.AddChidren(btnGreanLinght);
+
+            //淇″彿鍥炬爣
+            var btnLinght = new NormalViewControl(this.GetPictrueRealSize(250), this.GetPictrueRealSize(45), false);
+            btnLinght.X = this.GetPictrueRealSize(550);
+            btnLinght.Y = this.GetPictrueRealSize(588);
+            btnLinght.TextColor = UserCenterColor.Current.TextGrayColor3;
+            btnLinght.TextSize = 10;
+            btnLinght.TextID = R.MyInternationalizationString.uSignalIcon;
+            framePic.AddChidren(btnLinght);
+
+            //闀挎寜5绉�(鎸夐敭)
+            string textMsg = Language.StringByID(R.MyInternationalizationString.uLongClickPanelSomeSecond);
+            if (textMsg.Contains("{0}") == true)
+            {
+                textMsg = string.Format(textMsg, "5");
+            }
+            var btnSecond = new NormalViewControl(this.GetPictrueRealSize(360), this.GetPictrueRealSize(45), false);
+            btnSecond.X = this.GetPictrueRealSize(48);
+            btnSecond.Y = this.GetPictrueRealSize(107);
+            btnSecond.TextColor = UserCenterColor.Current.TextGrayColor3;
+            btnSecond.TextSize = 10;
+            btnSecond.Text = textMsg;
+            framePic.AddChidren(btnSecond);
+
+            //闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝淇″彿鍥炬爣
+            //蹇棯锛� 杩涘叆閰嶇綉鐘舵�併�備俊鍙峰浘鏍囧父浜垯閰嶇綉鎴愬姛
+            string[] msgArry = Language.StringByID(R.MyInternationalizationString.AddSensorPMMsg).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
+
+            var msg1 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
+            msg1.Y = Application.GetRealHeight(1037);
+            msg1.Text = msgArry[0];
+            msg1.TextColor = UserCenterColor.Current.TextGrayColor3;
+            msg1.TextAlignment = TextAlignment.Center;
+            bodyFrameLayout.AddChidren(msg1);
+            var msg2 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
+            msg2.Y = msg1.Bottom;
+            if (msgArry.Length > 1)
+            {
+                msg2.Text = msgArry[1];
+            }
+            msg2.TextColor = UserCenterColor.Current.TextGrayColor3;
+            msg2.TextAlignment = TextAlignment.Center;
+            bodyFrameLayout.AddChidren(msg2);
+        }
+
+        #endregion
+    }
+}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs
index 10ad86e..569d187 100644
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs
@@ -514,7 +514,7 @@
                 this.CloseProgressBar(ShowReLoadMode.YES);
                 return false;
             }
-            keyColorData = await HdlDevicePanelLogic.Current.GetPanelEpointColorInfo(panelDevice);
+            keyColorData = await HdlDevicePanelLogic.Current.GetPanelColorInfo(panelDevice);
             if (this.keyColorData == null)
             {
                 //鍏抽棴杩涘害鏉�
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs
index b7a80c6..427baf6 100644
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs
@@ -274,9 +274,17 @@
             FrameLayout curentOldRoomFrameLayout = null;
             int index = 0;
             var roomTempList = GetSupportRoomList();
+            Room slectedRoom = null;
+
             for (int i = 0; i < roomTempList.Count; i++)
             {
                 var room = roomTempList[i];
+                bool canSelect = false;
+                if (curControlDev.currentSelectRoomId == room.Id)
+                {
+                    slectedRoom = room;
+                    canSelect = true;
+                }
                 //鎴块棿
                 var btnRoomFrameLayout = new FrameLayout
                 {
@@ -303,7 +311,7 @@
                 btnRoomFrameLayout.AddChidren(btnRoom);
 
                 btnRoom.IsSelected = false;
-                if (index == 0)
+                if (canSelect)
                 {
                     btnRoomFrameLayout.BackgroundImagePath = "Item/RoomIconBackgroundSelected.png";
                     btnRoom.TextColor = Shared.Common.ZigbeeColor.Current.XMWhite;
@@ -349,13 +357,20 @@
             }
             BindInfo.FinishDisplay(roomTempList, btnFinifh);
 
-            if (roomTempList.Count != 0)
+            if (roomTempList.Count == 0)
             {
-                curRoom = roomTempList[0];
+                curRoom = new Shared.Common.Room();
             }
             else
             {
-                curRoom = new Shared.Common.Room();
+                if (slectedRoom == null)
+                {
+                    curRoom = roomTempList[0];
+                }
+                else
+                {
+                    curRoom = slectedRoom;
+                }
             }
 
             RefreshDeviceList(curRoom);
@@ -452,38 +467,38 @@
                 }
 
                 EventHandler<MouseEventArgs> hander = (sender, e) =>
-               {
-                   btnChoose.IsSelected = !btnChoose.IsSelected;
-                   if (!btnChoose.IsSelected)
-                   {
-                       if (oldDevice != null)
-                       {
-                           oldDevice.IsSelected = false;
-                           oldDevice.Visible = false;
-                       }
-                       oldDevice = btnChoose;
-                       oldDevice.IsSelected = false;
-                       oldDevice.Visible = false;
-                       targetList.Clear();
-                   }
-                   else
-                   {
-                       if (oldDevice != null)
-                       {
-                           oldDevice.IsSelected = false;
-                           oldDevice.Visible = false;
-                       }
-                       oldDevice = btnChoose;
-                       oldDevice.IsSelected = true;
-                       oldDevice.Visible = true;
-                       targetList.Clear();
-                       targetList.Add(device);
-                   }
+                {
+                    btnChoose.IsSelected = !btnChoose.IsSelected;
+                    if (!btnChoose.IsSelected)
+                    {
+                        if (oldDevice != null)
+                        {
+                            oldDevice.IsSelected = false;
+                            oldDevice.Visible = false;
+                        }
+                        oldDevice = btnChoose;
+                        oldDevice.IsSelected = false;
+                        oldDevice.Visible = false;
+                        targetList.Clear();
+                    }
+                    else
+                    {
+                        if (oldDevice != null)
+                        {
+                            oldDevice.IsSelected = false;
+                            oldDevice.Visible = false;
+                        }
+                        oldDevice = btnChoose;
+                        oldDevice.IsSelected = true;
+                        oldDevice.Visible = true;
+                        targetList.Clear();
+                        targetList.Add(device);
+                    }
 
-                   //鏂伴闈㈡澘锛氱敱浜庣洰鏍囨病鏈夋彁渚涘垹闄ゆ帴鍙o紝鎵�浠ュ彲浠ュ彇娑堥�変腑鑳戒繚瀛�
-                   btnFinifh.Enable = true;
-                   btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
-               };
+                    //鏂伴闈㈡澘锛氱敱浜庣洰鏍囨病鏈夋彁渚涘垹闄ゆ帴鍙o紝鎵�浠ュ彲浠ュ彇娑堥�変腑鑳戒繚瀛�
+                    btnFinifh.Enable = true;
+                    btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+                };
                 rowLayout.MouseUpEventHandler += hander;
                 devicePic.MouseUpEventHandler += hander;
                 btnBindName.MouseUpEventHandler += hander;
@@ -593,7 +608,7 @@
                     btnFloorText.Text = dicFloorList[floorId];
 
                     //鑾峰彇妤煎眰涓埧闂村垪琛� 
-                    supportRoomList = GetFloorRoomList();
+                    supportRoomList = GetFloorRoomList(curFloorId);
                     if (!btnMethodText.IsSelected)
                     {
                         if (oldbutton != null)
@@ -653,21 +668,8 @@
 
                     //鑾峰彇妤煎眰
                     dicFloorList = HdlRoomLogic.Current.GetFloorSortList();
-                    curControlDev.currentSelectFloorId = BindInfo.GetCurrentSelectFloorId();
-                    if (BindInfo.GetCurrentSelectFloorIdName() != null)
-                    {
-                        Application.RunOnMainThread(() =>
-                        {
-                            btnFloorText.Text = BindInfo.GetCurrentSelectFloorIdName();
-                        });
-                    }
-
                     //鑾峰彇妤煎眰涓埧闂村垪琛�
-                    supportRoomList = GetFloorRoomList();
-                    if (supportRoomList.Count == 0)
-                    {
-                        return;
-                    }
+                    supportRoomList = GetFloorRoomList(curControlDev.currentSelectFloorId);
 
                     //鑾峰彇鎵�鏈夋埧闂翠腑鍖归厤鐨勮兘缁戠殑鐩爣
                     currentPanelSupportBindDeviceList = GetAllRoomSupportDeviceList();
@@ -752,21 +754,56 @@
                 {
                     Application.RunOnMainThread(() =>
                     {
-                        if (supportRoomList.Count != 0)
-                        {
-                            RefreshRoomList();
-                        }
 
                         //棣栨鏄惁鑳界偣鍑讳繚瀛�
                         if (targetList.Count == 0)
                         {
+                            curControlDev.currentSelectFloorId = BindInfo.GetCurrentSelectFloorId();
+                            if (BindInfo.GetCurrentSelectFloorIdName() != null)
+                            {
+                                Application.RunOnMainThread(() =>
+                                {
+                                    btnFloorText.Text = BindInfo.GetCurrentSelectFloorIdName();
+                                });
+                            }
                             btnFinifh.Enable = false;
                             btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
                         }
                         else
                         {
+                            foreach (var dev in targetList)
+                            {
+                                //鑾峰彇鏈湴璁惧鍒楄〃 
+                                var localDeviceList = Shared.Common.LocalDevice.Current.listAllDevice;
+                                var tempDev = localDeviceList.Find(obj => obj.DeviceAddr == dev.DeviceAddr && obj.DeviceEpoint == dev.DeviceEpoint);
+                                if (tempDev != null)
+                                {
+                                    //鑾峰彇璁惧鎵�灞炴埧闂�
+                                    var tempDevRoom = HdlRoomLogic.Current.GetRoomByDevice(tempDev);
+                                    if (tempDevRoom != null)
+                                    {
+                                        curControlDev.currentSelectRoomId = tempDevRoom.Id;
+                                        curControlDev.currentSelectFloorId = tempDevRoom.FloorId;
+                                    }
+                                }
+                            }
+                            if (!string.IsNullOrEmpty(curControlDev.currentSelectFloorId))
+                            {
+                                if (BindInfo.GetBindTargetsFloorIdName(curControlDev.currentSelectFloorId) != null)
+                                {
+                                    btnFloorText.Text = BindInfo.GetBindTargetsFloorIdName(curControlDev.currentSelectFloorId);
+                                }
+                            }
+
                             btnFinifh.Enable = true;
                             btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+                        }
+
+
+                        //鑾峰彇妤煎眰涓埧闂村垪琛�
+                        if (supportRoomList.Count != 0)
+                        {
+                            RefreshRoomList();
                         }
 
                         CommonPage.Loading.Hide();
@@ -1230,7 +1267,7 @@
         /// 鑾峰彇妤煎眰瀵瑰簲鐨勬埧闂村垪琛�
         /// </summary>
         /// <returns></returns>
-        private List<Room> GetFloorRoomList()
+        private List<Room> GetFloorRoomList(string floorId)
         {
             supportRoomList.Clear();
             var supportRoomListTemp = new List<Room>();
@@ -1242,6 +1279,10 @@
                 {
                     if (string.IsNullOrEmpty(room.FloorId))
                     {
+                        if (room.FloorId != floorId)
+                        {
+                            continue;
+                        }
                         if (room.IsLove)
                         {
                             continue;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs
index 3090b66..d312134 100644
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs
@@ -132,7 +132,7 @@
         /// 闂ㄩ攣鏄惁鏀寔甯稿紑[杩欓噷鏆傛椂鍙湁S-One闂ㄩ攣鏀寔锛孒06C涓嶆敮鎸�, 鍚庢湡閫氳繃鑳藉姏鍊兼敮鎸乚
         /// </summary>
         /// <param name="doorLock:褰撳墠闂ㄩ攣"></param> 
-        /// <returns></returns> 
+        /// <returns>true:鏀寔甯稿紑锛沠alse锛� 涓嶆敮鎸佸父寮�</returns> 
         public static bool CanNormallyOpen(ZigBee.Device.DoorLock doorLock)
         {
             var listDevice = new List<CommonDevice> { };
@@ -351,6 +351,30 @@
         }
 
         /// <summary>
+        /// 璁剧疆甯稿紑妯″紡
+        /// </summary>
+        /// <param name="doorLock">褰撳墠闂ㄩ攣</param>
+        /// <param name="action">鍥炶皟澶勭悊鏇存柊鍐呭</param>
+        /// <returns></returns>
+        public static async System.Threading.Tasks.Task<bool> SetNormallyOpenModeFuncAsync(ZigBee.Device.DoorLock doorLock)
+        {
+            //app璁剧疆鈥滃父寮�妯″紡鈥濆け璐� 
+            var result = await doorLock.SetNormallyOpenModeFuncAsync(false);
+            if (result == null || result.defaultControlResponseData == null || result.defaultControlResponseData.status != 0)
+            {
+                return false;
+            }
+
+            if (result.defaultControlResponseData.status == 0)
+            {
+                //app璁剧疆鈥滃父寮�妯″紡鈥濇垚鍔�  
+                NormallyOpenModeValue(doorLock, false);
+                return true;
+            }
+            return false;
+        }
+
+        /// <summary>
         /// 鍚姩甯稿紑妯″紡銆愬脊绐椼��
         /// </summary>
         /// <param name="doorLock">褰撳墠闂ㄩ攣</param>
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs
index d546c58..61f363c 100644
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs
@@ -1025,31 +1025,31 @@
         private async void NomallyOpenDialog()
         {
             #region 鍚庣画鐗堟湰
-            //if (UserCenterResourse.UserInfo.AuthorityNo != 1)
-            //{
-            //    this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.OnlyMasterOperate));
-            //    return;
-            //}
+            if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+            {
+                this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.OnlyMasterOperate));
+                return;
+            }
 
-            //if (!UserCenterResourse.AccountOption.DoorUnLockByRemote)
-            //{
-            //    SystemSecondAuthentication();
-            //    return;
-            //}
+            if (!UserCenterResourse.AccountOption.DoorUnLockByRemote)
+            {
+                SystemSecondAuthentication();
+                return;
+            }
 
-            //action = () =>
-            //{
-            //    //绯荤粺瀵嗙爜鏀寔鎿嶄綔闂ㄩ攣鍚庯紝璋冪敤娓╁眳鍩庣殑鐣岄潰銆愬父寮�鑷姩鍖栥��
-            //    var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(currentRoom, doorLock);
-            //    Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting);
-            //    Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
-            //    functionSetting.Show();
-            //    functionSetting.aaaAction = () =>
-            //   {
-            //       UpdateNomallyOpenStatus();
-            //   };
-            //};
-            //HdlCheckLogic.Current.CheckSecondarySecurity(action);
+            action = () =>
+            {
+                //绯荤粺瀵嗙爜鏀寔鎿嶄綔闂ㄩ攣鍚庯紝璋冪敤娓╁眳鍩庣殑鐣岄潰銆愬父寮�鑷姩鍖栥��
+                var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(currentRoom, doorLock);
+                Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting);
+                Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
+                functionSetting.Show();
+                // functionSetting.aaaAction = () =>
+                //{
+                //    UpdateNomallyOpenStatus();
+                //};
+            };
+            HdlCheckLogic.Current.CheckSecondarySecurity(action);
             #endregion 
 
             #region 鏆傛椂鐗堟湰 (鏈�缁堝幓鎺夛級
diff --git a/ZigbeeApp/Shared/R.cs b/ZigbeeApp/Shared/R.cs
index 3e656f6..7f9f8c6 100644
--- a/ZigbeeApp/Shared/R.cs
+++ b/ZigbeeApp/Shared/R.cs
@@ -562,6 +562,10 @@
         /// 鑳屽厜鐏鑹�
         /// </summary>
         public const int BackgroundLightColor = 312;
+        /// <summary>
+        /// PM2.5鎰熷櫒 -> 闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝淇″彿鍥炬爣{0}蹇棯锛� 杩涘叆閰嶇綉鐘舵�併�備俊鍙峰浘鏍囧父浜垯閰嶇綉鎴愬姛
+        /// </summary>
+        public const int AddSensorPMMsg = 313;
 
         public readonly static int cancel = 5097;
         public readonly static int confrim = 5098;
@@ -6307,5 +6311,9 @@
         /// 鏅鸿兘绌哄紑
         /// </summary>
         public const int uDeviceDirectionName25 = 70024;
+        /// <summary>
+        /// PM2.5绌烘皵璐ㄩ噺浼犳劅鍣�
+        /// </summary>
+        public const int uDeviceDirectionName26 = 70025;
     }
 }
diff --git a/ZigbeeApp/Shared/Shared.projitems b/ZigbeeApp/Shared/Shared.projitems
index 3d71b32..22a8f54 100644
--- a/ZigbeeApp/Shared/Shared.projitems
+++ b/ZigbeeApp/Shared/Shared.projitems
@@ -474,6 +474,7 @@
     <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\ShowDoorLockMsgControl.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\DoorLock.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceCard\DeviceFreshAirCardControl.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\SensorPMTwoPointFiveForm.cs" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="$(MSBuildThisFileDirectory)Phone\CommonForm\" />

--
Gitblit v1.8.0