gxc
2019-11-07 a4924de3136289d10cabbf2f61a228387d44ded7
ZigbeeApp/Shared/Phone/Device/Category/Category.cs
old mode 100755 new mode 100644
@@ -248,15 +248,15 @@
                                case DeviceType.Thermostat:
                                    //AC功能
                                    if (common.DeviceStatusReport.CluterID == 513)
                                    if ((common as ZigBee.Device.AC).DeviceStatusReport.CluterID == 513)
                                    {
                                        var attriButeList = common.DeviceStatusReport.AttriBute;
                                        var attriButeList = (common as ZigBee.Device.AC).DeviceStatusReport.AttriBute;
                                        if (attriButeList == null || attriButeList.Count == 0)
                                        {
                                            return;
                                        }
                                        var ac = deviceUI.CommonDevice as ZigBee.Device.AC;
                                        ac.DeviceStatusReport = common.DeviceStatusReport;
                                        ac.DeviceStatusReport = (common as ZigBee.Device.AC).DeviceStatusReport;
                                        switch (attriButeList[0].AttributeId)
                                        {
                                            case 0:
@@ -305,7 +305,7 @@
                                        }
                                    }
                                    if (common.DeviceStatusReport.CluterID == 3)
                                    if ((common as ZigBee.Device.AC).DeviceStatusReport.CluterID == 3)
                                    {
                                        var ac = deviceUI.CommonDevice as ZigBee.Device.AC;
                                        ac.IsOnline = 1;
@@ -450,7 +450,7 @@
        /// <param name="selectedBtn">选中那个界面 0--功能 1--场景 2--自动化 </param>
        public void Show(int selectedBtn = 1)
        {
            ZbGateway.StatusList.Add(this);
            RemoveAll();
@@ -714,6 +714,15 @@
            UserView.HomePage.Instance.PageIndex += 1;
            addLogicPage.Show();
        }
        /// <summary>
        /// HidenFloor
        /// </summary>
        /// <param name="statu"></param>
        private void HidenFloor(bool statu)
        {
            selectFloorBtn.Visible = !statu;
            floorBtn.Visible = !statu;
        }
        #endregion
@@ -726,14 +735,17 @@
            functionSceneAutoBodyView.RemoveAll();
            if (functionBtn.IsSelected)
            {
                HidenFloor(false);
                ShowFunction();
            }
            else if (sceneBtn.IsSelected)
            {
                HidenFloor(false);
                ShowScene();
            }
            else if (automationBtn.IsSelected)
            {
                HidenFloor(true);
                ShowAutotion();
            }
        }
@@ -945,13 +957,32 @@
                            deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
                            {
                                var lightControl = new Phone.Device.Light.LightControl();
                                UserView.HomePage.Instance.AddChidren(lightControl);
                                UserView.HomePage.Instance.PageIndex += 1;
                                //lightControl.action = RefreshBodyView;
                                lightControl.Show(deviceUI, room);
                                if (deviceUI.CommonDevice.DfunctionType == DeviceFunctionType.A开关)
                                {
                                    var lightControl = new Phone.Device.Light.OnOffControl();
                                    UserView.HomePage.Instance.AddChidren(lightControl);
                                    UserView.HomePage.Instance.PageIndex += 1;
                                    //lightControl.action = RefreshBodyView;
                                    lightControl.Show(deviceUI, room);
                                }
                                else if (deviceUI.CommonDevice.DfunctionType == DeviceFunctionType.A插座)
                                {
                                    var lightControl = new Phone.Device.Light.PlugControl();
                                    UserView.HomePage.Instance.AddChidren(lightControl);
                                    UserView.HomePage.Instance.PageIndex += 1;
                                    //lightControl.action = RefreshBodyView;
                                    lightControl.Show(deviceUI, room);
                                }
                                else
                                {
                                    var lightControl = new Phone.Device.Light.LightControl();
                                    UserView.HomePage.Instance.AddChidren(lightControl);
                                    UserView.HomePage.Instance.PageIndex += 1;
                                    //lightControl.action = RefreshBodyView;
                                    lightControl.Show(deviceUI, room);
                                }
                            };
                            var editBtn = new CommonForm.RowLayoutEditButton()
                            {
                                Tag = deviceUI,
@@ -1044,6 +1075,7 @@
                            deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
                            {
                                var lightControl = new Phone.Device.Light.AirSwitchControl();
                                UserView.HomePage.Instance.AddChidren(lightControl);
                                UserView.HomePage.Instance.PageIndex += 1;
@@ -1284,6 +1316,7 @@
                                UserHomeView.ReadStatus(rollerShade, () =>
                                {
                                    rollerShade.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch);
                                    rollerShade.ReadWcdCurrentPositionLiftPercentage();
                                });
                            }
                            else
@@ -1292,6 +1325,7 @@
                                if ((DateTime.Now - rollerShade.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
                                {
                                    rollerShade.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch);
                                    rollerShade.ReadWcdCurrentPositionLiftPercentage();
                                }
                            }
@@ -1452,7 +1486,7 @@
                    {
                        RefreshFunction(room);
                    }
                }
                roomBtn.MouseUpEventHandler += (sender, e) =>
                {
@@ -1473,7 +1507,7 @@
                    }
                };
            }
        }
        #endregion
@@ -1558,7 +1592,7 @@
                        Tag = scene
                    };
                    leftFL.AddChidren(collectionBtn);
                    var sceneNameBtn = new Button()
                    {
                        Width = Application.GetRealWidth(176),
@@ -1707,7 +1741,7 @@
                                }
                            };
                        }
                    };
                    deleteBtn.MouseUpEventHandler += delEvent;
                    //编辑场景
@@ -1763,6 +1797,7 @@
        #endregion
        #region ◆ 自动化__________________________
        /// <summary>
@@ -1772,6 +1807,7 @@
        {
            functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
            var bjFrameLayout = new FrameLayout
            {
                Width = Application.GetRealWidth(1080 - 58),
@@ -1933,7 +1969,7 @@
                var Idlist = await Logic.Send.GetLogicId(0);
                if (Idlist.Count != 0)
                {
                    var listlogic = await Logic.Send.ReadList(Idlist.Count,0);
                    var listlogic = await Logic.Send.ReadList(Idlist.Count, 0);
                    //foreach可能集合已被修改,枚举操作可能不会执行,可能出现崩溃(建议for)。
                    for (int j = 0; j < listlogic.Count; j++)
                    {
@@ -1949,7 +1985,7 @@
            //自动化
            Automationview(logicScrolView);
            CommonPage.Loading.Hide();
        }
        /// <summary>
@@ -2557,6 +2593,6 @@
        #endregion
    }
}