黄学彪
2020-12-17 9f326f4000847e6167d8166fa2f6a66f53cb3734
ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs
@@ -47,7 +47,7 @@
            view.toptitleNameBtn.TextID = MyInternationalizationString.openmode;
            view.clickBtn.MouseDownEventHandler += (sender, e) =>
            {
                UserView.HomePage.Instance.ScrollEnabled = true;
                UserView.HomePage.Instance.ScrollEnabled = true;
                //把静态变量的这个东西置空
                soneLogicList = null;
                this.RemoveFromParent();
@@ -76,7 +76,7 @@
                    try
                    {
                        //进来更新一次值
                        logicId = logic.LogicId;
                        logicId = logic.LogicId;
                        timeValue = int.Parse(logic.Conditions[0]["DoorLockOpenDelayTime"]) / 3600;
                        timeLong = int.Parse(logic.Conditions[0]["TriggerTime"]);
                    }
@@ -169,10 +169,10 @@
                actionsInfo.Add("LinkType", 8);
                actionsInfo.Add("DeviceAddr", Send.CurrentDoorLock.DeviceAddr);
                actionsInfo.Add("Epoint", "200");
                actionsInfo.Add("PassData", "055704010113");//默认门锁常关
                Dictionary<string, string> accounts = new Dictionary<string, string>();
                actionsInfo.Add("PassData", "055704010113");//默认门锁常关
                Dictionary<string, string> accounts = new Dictionary<string, string>();
                accounts.Add("Type", "8");
                accounts.Add("Option4", Send.CurrentDoorLock.DeviceAddr.ToString());//用于判断识别是哪个门锁;
                accounts.Add("Option4", Send.CurrentDoorLock.DeviceAddr.ToString());//用于判断识别是哪个门锁;
                accounts.Add("Option2", Send.CurrentDoorLock.DeviceEpoint.ToString());
                //new一个新逻辑对象;
                //新增门锁常开模式自动化入口;
@@ -181,7 +181,7 @@
                Common.Logic.CurrentLogic.LogicType = 2;//标记逻辑类型
                Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.openmode);
                Common.Logic.CurrentLogic.Conditions.Add(timeConditionsInfo);//添加条件
                Common.Logic.CurrentLogic.Actions.Add(actionsInfo);//添加目标
                Common.Logic.CurrentLogic.Actions.Add(actionsInfo);//添加目标
                Common.Logic.CurrentLogic.Accounts.Add(accounts);
                var oneLogic = new OneLogic();
                UserView.HomePage.Instance.AddChidren(oneLogic);
@@ -225,6 +225,7 @@
            updateCurrentDoorlockActionTemp = (DoorlockKey, _bool) =>
            {
                var key = Send.CurrentDoorLock.DeviceAddr;
                if (DoorlockKey == key)
                {
@@ -350,12 +351,10 @@
                        ///有时效性常开才显示时间条件文本
                        year = datetime.Year.ToString();//那一年
                        month = datetime.Month.ToString();//那一月
                        var d = int.Parse(datetime.ToString("dd"));//那一天
                        var h = int.Parse(datetime.ToString("HH"));//小时
                        int dayInt = (h + timeValue) / 24;//设置时间+当前系统时间是否超出24小时
                        hour = (h + timeValue) % 24;//设置时间+当前系统时间是否超出24小时剩下多少小时
                        days = d + dayInt;//当前系统天数+执行后天数
                        days = int.Parse(datetime.ToString("dd"));//那一天
                        hour = int.Parse(datetime.ToString("HH"));//小时
                        minute = datetime.Minute;//分钟
                        timeLong = 0;
                    }
                    else
                    {
@@ -459,9 +458,9 @@
                                        logicId = addResult;
                                        timeValue = int.Parse(str);
                                        Send.CurrentDoorLock.IsDoorLockNormallyMode = true;
                                        ModeView();
                                        ///添加APP开启常开模式的历史记录
                                        UserCenter.HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog(Send.CurrentDoorLock, 9001, string.Empty);
                                        ModeView();
                                        ///添加APP开启常开模式的历史记录
                                        HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog(Send.CurrentDoorLock, 9001, string.Empty);
                                    }
@@ -520,10 +519,10 @@
                            if (logic.LogicType != 2)
                            {
                                continue;
                            }
                            if (SkipView.ExistLogic(logic, Send.CurrentDoorLock))
                            {
                                Common.Logic.SoneLogicList.Add(logic);
                            }
                            if (SkipView.ExistLogic(logic, Send.CurrentDoorLock))
                            {
                                Common.Logic.SoneLogicList.Add(logic);
                            }
                        }
                    }
@@ -592,7 +591,7 @@
                    selectedRow = logicRow;
                };
                a++;
                ///显示逻辑名称的控件
                ///显示逻辑名称的控件
                var nameBtn = new Button
                {
                    Height = Application.GetRealHeight(58),
@@ -708,19 +707,19 @@
                ///删除点击事件
                del.MouseUpEventHandler += (sender, e) =>
                {
                    var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm,
                    var alert = new ShowMsgControl(ShowMsgType.Confirm,
                    Language.StringByID(MyInternationalizationString.doyouwanttodelete),
                    Language.StringByID(MyInternationalizationString.confrim));
                    alert.Show();
                    alert.ConfirmClickEvent += () =>
                    Language.StringByID(MyInternationalizationString.confrim));
                    alert.Show();
                    alert.ConfirmClickEvent += () =>
                    {
                        Common.Logic.SoneLogicList.Remove(logic);
                        //logicRow.Parent.RemoveFromParent();
                        fLayoutLogic.RemoveFromParent();
                        Send.DelLogic(logic.LogicId);
                        Send.DelLogic(logic.LogicId);
                    };
                };
                };
            }
        }
        /// <summary>