From 23fd8d4f2f0d72226eb1a84e0798fc7db7574817 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期三, 17 三月 2021 10:24:37 +0800
Subject: [PATCH] 2021-3-17-1

---
 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs                            |   22 ++++++++++++++++------
 HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs                   |    2 +-
 .vs/HDL_APP_Project/xs/UserPrefs.xml                                           |   14 +++++++++++---
 HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/AddMiniRemoteControlDirection4Page.cs |    2 +-
 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs                          |   14 ++++++++++++++
 5 files changed, 43 insertions(+), 11 deletions(-)

diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml
index 4e66cf7..a9ca446 100644
--- a/.vs/HDL_APP_Project/xs/UserPrefs.xml
+++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,5 +1,13 @@
 锘�<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default">
-  <MonoDevelop.Ide.Workbench>
+  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs">
+    <Files>
+      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs" Line="82" Column="1" />
+      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Pir.cs" Line="37" Column="16" />
+      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs" Line="18" Column="23" />
+      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs" Line="142" Column="53" />
+      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/AddMiniRemoteControlDirection4Page.cs" Line="221" Column="35" />
+      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs" Line="22" Column="20" />
+    </Files>
     <Pads>
       <Pad Id="ProjectPad">
         <State name="__root__">
@@ -8,10 +16,10 @@
               <Node name="UI" expanded="True">
                 <Node name="UI2" expanded="True">
                   <Node name="4-PersonalCenter" expanded="True">
+                    <Node name="AddDevice" expanded="True" />
                     <Node name="AddFunction" expanded="True" />
                     <Node name="PirDevice" expanded="True">
-                      <Node name="View" expanded="True" />
-                      <Node name="Method.cs" selected="True" />
+                      <Node name="DeviceSet.cs" selected="True" />
                     </Node>
                   </Node>
                 </Node>
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/AddMiniRemoteControlDirection4Page.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/AddMiniRemoteControlDirection4Page.cs
index 3d66b86..60a4762 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/AddMiniRemoteControlDirection4Page.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/AddMiniRemoteControlDirection4Page.cs
@@ -218,7 +218,7 @@
                     {
                         var page = new UI2.PersonalCenter.PirDevice.PirMain();
                         MainPage.BasePageView.AddChidren(page);
-                        page.Show();
+                        page.Show(null);
                         MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                     });
                 });
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs
index df95071..5a540a0 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs
@@ -139,7 +139,7 @@
                                 {
                                     var page = new UI2.PersonalCenter.PirDevice.PirMain();
                                     MainPage.BasePageView.AddChidren(page);
-                                    page.Show();
+                                    page.Show(device);
                                     MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                                 });
                             });
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs
index 6af3af1..2b4880b 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs
@@ -23,7 +23,9 @@
             {
                 action();
                 this.RemoveFromParent();
+
             };
+
             VerticalRefreshLayout vv = new VerticalRefreshLayout();
             vv.Height = Application.GetRealHeight(667 - 64);
             vv.Y = Application.GetRealHeight(64);
@@ -45,6 +47,18 @@
             };
             #endregion
             UIView(vv);
+            topView.topIconBtn.MouseUpEventHandler += (sender, e) =>
+            {
+                var form = new AddMiniRemoteControlDirection1Page();
+                form.AddForm();
+                form.AddDeviceEvent += (device) =>
+                {
+                    var pir = device as Pir;
+                    Pir.pirDeviceList.Add(pir);
+                    UIView(vv);
+                };
+
+            };
 
         }
         /// <summary>
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs
index 8f065de..626c205 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs
@@ -15,7 +15,7 @@
         /// 涓存椂鍌ㄥ瓨璁惧绫诲瀷鍒楄〃
         /// </summary>
         List<DeviceType> DeviceTypeList = new List<DeviceType>();
-        public void Show()
+        public void Show(Entity.Function function)
         {
             #region 鐣岄潰甯冨眬
             this.BackgroundColor = CSS.CSS_Color.viewMiddle;
@@ -79,18 +79,28 @@
 
             if (Pir.pirDeviceList.Count != 0)
             {
+
+                if (function != null)
+                {
+                    var pir = function as Pir;
+                    Pir.currPir = pir;
+                }
+                else
+                {
+                    Pir.currPir = Pir.pirDeviceList[0];
+                }
                 //榛樿绗竴涓孩澶栧疂
-                Pir.currPir = Pir.pirDeviceList[0];
                 int sum = 0;
                 for (int i = 0; i < Pir.pirDeviceList.Count; i++)
                 {
                     //鏌ユ壘
                     sum += Pir.pirDeviceList[i].FunctioList.Count;
                 }
-                deviceNameBtn.Text = Pir.pirDeviceList[0].name;
+                deviceNameBtn.Text = Pir.currPir.name;
                 mainView.numberDeviceBtn.Text = Pir.pirDeviceList.Count.ToString() + Language.StringByID(StringId.ge);
                 mainView.currDeviceNumberControlBtn.Text = sum.ToString() + Language.StringByID(StringId.ge);
             }
+
             ///璁惧绠$悊鐨勭偣鍑讳簨浠�
             mainView.clickBtn.MouseUpEventHandler += (sender, e) =>
             {
@@ -315,7 +325,7 @@
                 case 3:
                     {
                         //椋庢墖
-                       // type = "fan-" + SPK.ElectricFan;
+                        // type = "fan-" + SPK.ElectricFan;
                     }
                     break;
                 case 4:
@@ -405,7 +415,7 @@
         /// </summary>
         /// <param name="tag">鏍囪瘑瑕佷笉瑕佹彁绀猴紙true=鎻愮ず锛�</param>
         /// <param name="action">鍥炶皟鍑芥暟</param>
-        public  void GetDeviceTypeList(bool tag, Action action)
+        public void GetDeviceTypeList(bool tag, Action action)
         {
             PirSend.GetDeviceTypesList(this, (responsePackNew) =>
             {
@@ -443,7 +453,7 @@
         /// <summary>
         /// 璇诲彇绾㈠璁惧绫诲瀷鐨勫搧鐗屽垪琛�
         /// </summary>
-        public  void GetBrandList(string id, Action<List<Brand>> actionBrand)
+        public void GetBrandList(string id, Action<List<Brand>> actionBrand)
         {
             List<Brand> brandList = new List<Brand>();
             PirSend.GetDeviceTypesList(this, (responsePackNew) =>

--
Gitblit v1.8.0