| | |
| | | { |
| | | case 0: |
| | | { |
| | | |
| | | |
| | | ////new一个新逻辑对象; |
| | | ////新增正常自动化入口 |
| | | //new一个新逻辑对象; |
| | | //新增正常自动化入口 |
| | | Common.Logic.CurrentLogic = new Common.Logic(); |
| | | Common.Logic.CurrentLogic.IsEnable = 1;//默认为开 |
| | | Common.Logic.CurrentLogic.LogicType = 0;//标记逻辑类型 |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | #region ◆ 自动化__________________________ |
| | | /// <summary> |
| | | /// 自动化功能代码入口 |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | |
| | | /// <param name="refresview">Refresview.</param> |
| | | private static async void Automationview(VerticalRefreshLayout refresview, bool no) |
| | | { |
| | | |
| | | refresview.RemoveAll(); |
| | | if (Common.Logic.LogicList.Count == 0 && no == false) |
| | | { |
| | |
| | | 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) |
| | |
| | | { |
| | | Common.Logic.LogicList.Remove(logic); |
| | | Automationview(refresview, no); |
| | | Send.DelLogic(logic.LogicId); |
| | | if (!Config.Instance.Home.IsVirtually) |
| | | { |
| | | Send.DelLogic(logic.LogicId); |
| | | } |
| | | }; |
| | | |
| | | }; |