From ed2f4a97aa48cdb4a013d2a389877f52eb3eccdf Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期二, 29 十月 2019 13:15:59 +0800
Subject: [PATCH] Merge branch 'DEV_GXC' of http://172.16.1.23:6688/r/~xm/HomeApp into DEV_GXC

---
 ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs |  282 +++++---------------------------------------------------
 1 files changed, 25 insertions(+), 257 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs
index 18a0ee5..13af081 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs
@@ -96,12 +96,14 @@
             middle.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
             this.AddChidren(middle);
 
-            ///杩囨护鎺夌殑璁惧
+            ///鐩墠鏀寔鐨勮澶�
             List<DeviceType> deviceTypeList = new List<DeviceType> {
-                DeviceType.ColorDimmableLight,
-                 DeviceType.OnOffOutput,
-                  DeviceType.WindowCoveringDevice,
-                   DeviceType.AirSwitch,
+                DeviceType.IASZone,
+                DeviceType.OnOffSwitch,
+                //DeviceType.ColorDimmableLight,
+                // DeviceType.OnOffOutput,
+                //  DeviceType.WindowCoveringDevice,
+                //   DeviceType.AirSwitch,
             };
             ///鎴块棿鐐瑰嚮浜嬩欢
             roomname.MouseUpEventHandler += (sender, e) =>
@@ -168,8 +170,9 @@
                         {
                             if (!deviceTypeList.Contains(device.CommonDevice.Type))
                             {
-                                list.Add(device);
+                                continue;
                             }
+                            list.Add(device);
                         }
                         AllDeviceTypeView(list);
                     };
@@ -183,7 +186,7 @@
             foreach (var device in Common.Logic.LogicDviceList)
             {
                                
-                if (deviceTypeList.Contains(device.Type))
+                if (!deviceTypeList.Contains(device.Type))
                 {
                     continue;
                 }
@@ -961,6 +964,12 @@
                                     iASZonedevicefra.AddChidren(openrowlayout);
                                 }
                                 break;
+                            default:
+                                {
+                                    btnopen.TextID = MyInternationalizationString.callthepolice;
+                                    iASZonedevicefra.AddChidren(openrowlayout);
+                                }
+                                break;
                         }
                         if (edit && devices != null)
                         {
@@ -1061,250 +1070,7 @@
                         {
                             buttonSelected.Visible = true;
                         }
-
-                        /*
-                        #region  鎸夐敭View
-                       #region ---button1---
-                        devicefra.Y = Application.GetRealHeight(1920 - 30 - 720 - 360);
-                        devicefra.Height = Application.GetRealHeight(720 + 360);
-                        var OnOffOutputfra = new FrameLayout
-                        {
-                            Y = Application.GetRealHeight(180),
-                            Height = Application.GetRealHeight(180 * 4 + 30),
-                        };
-                        devicefra.AddChidren(OnOffOutputfra);
-
-                        var button1Row = new RowLayout
-                        {
-                            Height = Application.GetRealHeight(180),
-                        };
-                        OnOffOutputfra.AddChidren(button1Row);
-
-                        var button1 = new Button
-                        {
-                            TextID = MyInternationalizationString.button1,
-                            TextAlignment = TextAlignment.CenterLeft,
-                            X = Application.GetRealWidth(40),
-                            Width = Application.GetRealWidth(300),
-                            Height = Application.GetRealHeight(180),
-                            //SelectedBackgroundColor = 0xfffe5e00,
-                            TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                        };
-                        button1Row.AddChidren(button1);
-
-                        var button1Selected = new Button
-                        {
-                            X = Application.GetRealWidth(1000 - 150),
-                            Width = Application.GetMinRealAverage(110),
-                            Height = Application.GetMinRealAverage(110),
-                            UnSelectedImagePath = "Item/YesSelected.png",
-                            Visible = false,
-                            Gravity = Gravity.CenterVertical
-                        };
-                        button1Row.AddChidren(button1Selected);
-                        #endregion
-
-                        #region ---button2---
-                        var button2Row = new RowLayout
-                        {
-                            Y = button1Row.Bottom,
-                            Height = Application.GetRealHeight(180),
-                        };
-                        OnOffOutputfra.AddChidren(button2Row);
-
-                        var button2 = new Button
-                        {
-                            TextID = MyInternationalizationString.button2,
-                            TextAlignment = TextAlignment.CenterLeft,
-                            X = Application.GetRealWidth(40),
-                            Width = Application.GetRealWidth(300),
-                            Height = Application.GetRealHeight(180),
-                            TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                        };
-                        button2Row.AddChidren(button2);
-
-                        var button2Selected = new Button
-                        {
-                            X = Application.GetRealWidth(1000 - 150),
-                            Width = Application.GetMinRealAverage(110),
-                            Height = Application.GetMinRealAverage(110),
-                            UnSelectedImagePath = "Item/YesSelected.png",
-                            Visible = false,
-                            Gravity = Gravity.CenterVertical,
-                        };
-                        button2Row.AddChidren(button2Selected);
-                        #endregion
-
-                        #region ---button3---
-                        var button3Row = new RowLayout
-                        {
-                            Y = button2Row.Bottom,
-                            Height = Application.GetRealHeight(180),
-                        };
-                        OnOffOutputfra.AddChidren(button3Row);
-
-                        var button3 = new Button
-                        {
-                            TextID = MyInternationalizationString.button3,
-                            TextAlignment = TextAlignment.CenterLeft,
-                            X = Application.GetRealWidth(40),
-                            Width = Application.GetRealWidth(300),
-                            Height = Application.GetRealHeight(180),
-                            //SelectedBackgroundColor = 0xfffe5e00,
-                            TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                        };
-                        button3Row.AddChidren(button3);
-
-                        var button3Selected = new Button
-                        {
-                            X = Application.GetRealWidth(1000 - 150),
-                            Width = Application.GetMinRealAverage(110),
-                            Height = Application.GetMinRealAverage(110),
-                            UnSelectedImagePath = "Item/YesSelected.png",
-                            Visible = false,
-                            Gravity = Gravity.CenterVertical
-                        };
-                        button3Row.AddChidren(button3Selected);
-                        #endregion
-
-                        #region ---button4---
-
-                        var button4Row = new RowLayout
-                        {
-                            Height = Application.GetRealHeight(180),
-                            Y = button3Row.Bottom,
-                        };
-                        OnOffOutputfra.AddChidren(button4Row);
-
-                        var button4 = new Button
-                        {
-                            TextID = MyInternationalizationString.button4,
-                            TextAlignment = TextAlignment.CenterLeft,
-                            X = Application.GetRealWidth(40),
-                            Width = Application.GetRealWidth(300),
-                            Height = Application.GetRealHeight(180),
-                            //SelectedBackgroundColor = 0xfffe5e00,
-                            TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                        };
-                        button4Row.AddChidren(button4);
-
-                        var button4Selected = new Button
-                        {
-                            X = Application.GetRealWidth(1000 - 150),
-                            Width = Application.GetMinRealAverage(110),
-                            Height = Application.GetMinRealAverage(110),
-                            UnSelectedImagePath = "Item/YesSelected.png",
-                            Visible = false,
-                            Gravity = Gravity.CenterVertical
-                        };
-                        button4Row.AddChidren(button4Selected);
-                        #endregion
-                        #endregion
-
-                        EventHandler<MouseEventArgs> button1click = (sender, e) =>
-                        {
-                            button1Selected.Visible = true;
-                            button2Selected.Visible = false;
-                            button3Selected.Visible = false;
-                            button4Selected.Visible = false;
-                            SelectedDeviceStatuscondition = "yes";
-                            //榛樿鍊�
-                            if (deviceConditionsInfo.ContainsKey("Epoint"))
-                            {
-                                deviceConditionsInfo.Remove("Epoint");
-                            }
-                            deviceConditionsInfo.Add("Epoint", "1");
-
-                        };
-                        button1Row.MouseUpEventHandler += button1click;
-                        button1.MouseUpEventHandler += button1click;
-                        button1Selected.MouseUpEventHandler += button1click;
-                        EventHandler<MouseEventArgs> button2click = (sender, e) =>
-                        {
-                            button1Selected.Visible = false;
-                            button2Selected.Visible = true;
-                            button3Selected.Visible = false;
-                            button4Selected.Visible = false;
-                            SelectedDeviceStatuscondition = "yes";
-                            if (deviceConditionsInfo.ContainsKey("Epoint"))
-                            {
-                                deviceConditionsInfo.Remove("Epoint");
-                            }
-                            deviceConditionsInfo.Add("Epoint", "2");//榛樿鍊�
-
-                        };
-                        button2Row.MouseUpEventHandler += button2click;
-                        button2.MouseUpEventHandler += button2click;
-                        button2Selected.MouseUpEventHandler += button2click;
-                        EventHandler<MouseEventArgs> button3click = (sender, e) =>
-                        {
-                            button1Selected.Visible = false;
-                            button2Selected.Visible = false;
-                            button3Selected.Visible = true;
-                            button4Selected.Visible = false;
-                            SelectedDeviceStatuscondition = "yes";
-                            if (deviceConditionsInfo.ContainsKey("Epoint"))
-                            {
-                                deviceConditionsInfo.Remove("Epoint");
-                            }
-                            deviceConditionsInfo.Add("Epoint", "3");//榛樿鍊�
-
-                        };
-                        button3Row.MouseUpEventHandler += button3click;
-                        button3.MouseUpEventHandler += button3click;
-                        button3Selected.MouseUpEventHandler += button3click;
-                        EventHandler<MouseEventArgs> button4click = (sender, e) =>
-                        {
-                            button1Selected.Visible = false;
-                            button2Selected.Visible = false;
-                            button3Selected.Visible = false;
-                            button4Selected.Visible = true;
-                            SelectedDeviceStatuscondition = "yes";
-                            if (deviceConditionsInfo.ContainsKey("Epoint"))
-                            {
-                                deviceConditionsInfo.Remove("Epoint");
-                            }
-                            deviceConditionsInfo.Add("Epoint", "4");//榛樿鍊�
-
-                        };
-                        button4Row.MouseUpEventHandler += button4click;
-                        button4.MouseUpEventHandler += button4click;
-                        button4Selected.MouseUpEventHandler += button4click;
-                        if (edit && devices != null)
-                        {
-                            if (devices["Epoint"] == "1")
-                            {
-                                button1Selected.Visible = true;
-                                button2Selected.Visible = false;
-                                button3Selected.Visible = false;
-                                button4Selected.Visible = false;
-                            }
-                            else if (devices["Epoint"] == "2")
-                            {
-                                button1Selected.Visible = false;
-                                button2Selected.Visible = true;
-                                button3Selected.Visible = false;
-                                button4Selected.Visible = false;
-
-                            }
-                            else if (devices["Epoint"] == "3")
-                            {
-                                button1Selected.Visible = false;
-                                button2Selected.Visible = false;
-                                button3Selected.Visible = true;
-                                button4Selected.Visible = false;
-
-                            }
-                            else if (devices["Epoint"] == "4")
-                            {
-                                button1Selected.Visible = false;
-                                button2Selected.Visible = false;
-                                button3Selected.Visible = false;
-                                button4Selected.Visible = true;
-                            }
-
-                        }
-                        */
+                                            
                     }
                     break;
 
@@ -1348,12 +1114,14 @@
                 }
                 else
                 {
-
-                    var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt),
-                                           Language.StringByID(MyInternationalizationString.selectdevicestatuscondition),
-                                           Language.StringByID(MyInternationalizationString.complete));
-                    alert.Show();
-                    return;
+                    if (!edit)
+                    {
+                        var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt),
+                                               Language.StringByID(MyInternationalizationString.selectdevicestatuscondition),
+                                               Language.StringByID(MyInternationalizationString.complete));
+                        alert.Show();
+                        return;
+                    }
 
                 }
                 flMain.RemoveFromParent();

--
Gitblit v1.8.0