xm
2020-05-08 6bca8fcd37a48808a0b9c9342fc1be0adddfece6
ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs
@@ -20,10 +20,8 @@
            {
                case 0:
                    {
                        ////new一个新逻辑对象;
                        ////新增正常自动化入口
                        //new一个新逻辑对象;
                        //新增正常自动化入口
                        Common.Logic.CurrentLogic = new Common.Logic();
                        Common.Logic.CurrentLogic.IsEnable = 1;//默认为开
                        Common.Logic.CurrentLogic.LogicType = 0;//标记逻辑类型
@@ -62,12 +60,12 @@
                        doorLockLogicList.Show();
                    }
                    break;
            }
        }
        #region ◆ 自动化__________________________
        /// <summary>
        /// 自动化功能代码入口
@@ -263,34 +261,37 @@
            CommonPage.Loading.Start();
            try
            {
                if (Common.Logic.LogicList.Count == 0)
                if (!Config.Instance.Home.IsVirtually)//虚拟的不获取网关逻辑列表
                {
                    var Idlist1 = await Send.GetLogicId(0);//
                    var Idlist2 = await Send.GetLogicId(2);//门锁常开模式
                    if (Idlist1.Count != 0)
                    if (Common.Logic.LogicList.Count == 0)
                    {
                        var listlogic1 = await Send.ReadList(Idlist1.Count, 0);
                        for (int j = 0; j < listlogic1.Count; j++)
                        var Idlist1 = await Send.GetLogicId(0);//
                        var Idlist2 = await Send.GetLogicId(2);//门锁常开模式
                        if (Idlist1.Count != 0)
                        {
                            var logic = listlogic1[j];
                            if (logic.LogicType != 0)
                            var listlogic1 = await Send.ReadList(Idlist1.Count, 0);
                            for (int j = 0; j < listlogic1.Count; j++)
                            {
                                continue;
                                var logic = listlogic1[j];
                                if (logic.LogicType != 0)
                                {
                                    continue;
                                }
                                Common.Logic.LogicList.Add(logic);
                            }
                            Common.Logic.LogicList.Add(logic);
                        }
                    }
                    if (Idlist2.Count != 0)
                    {
                        var listlogic2 = await Send.ReadList(Idlist2.Count, 2);
                        for (int j = 0; j < listlogic2.Count; j++)
                        if (Idlist2.Count != 0)
                        {
                            var logic = listlogic2[j];
                            if (logic.LogicType != 2)
                            var listlogic2 = await Send.ReadList(Idlist2.Count, 2);
                            for (int j = 0; j < listlogic2.Count; j++)
                            {
                                continue;
                                var logic = listlogic2[j];
                                if (logic.LogicType != 2)
                                {
                                    continue;
                                }
                                Common.Logic.LogicList.Add(logic);
                            }
                            Common.Logic.LogicList.Add(logic);
                        }
                    }
                }
@@ -310,6 +311,7 @@
        /// <param name="refresview">Refresview.</param>
        private static async void Automationview(VerticalRefreshLayout refresview, bool no)
        {
            refresview.RemoveAll();
            if (Common.Logic.LogicList.Count == 0 && no == false)
            {
@@ -398,7 +400,7 @@
                    //实现android显示逻辑列表的圆角;
                    fLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
                    logicRowlayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
                }
                i++;
                var logicnameBtn = new Button
@@ -441,7 +443,10 @@
                        logic.IsEnable = 0;
                        StatusColor(logic, logicRowlayout, 0);
                    }
                    Send.LogicControlSwitch(logic);
                    if (!Config.Instance.Home.IsVirtually)
                    {
                        Send.LogicControlSwitch(logic);
                    }
                    //Logic.Send.AddModifyLogic(logic);
                };
                if (logic.IsEnable == 1)
@@ -503,7 +508,10 @@
                    {
                        Common.Logic.LogicList.Remove(logic);
                        Automationview(refresview, no);
                        Send.DelLogic(logic.LogicId);
                        if (!Config.Instance.Home.IsVirtually)
                        {
                            Send.DelLogic(logic.LogicId);
                        }
                    };
                };
@@ -780,6 +788,7 @@
            }
            return _if;
        }
    }
}