| | |
| | | { |
| | | case 0: |
| | | { |
| | | ///Sone门锁主入口 |
| | | if (doorLock == null) |
| | | { |
| | | ///防止抛异常 |
| | | doorLock = new DoorLock(); |
| | | } |
| | | Send.CurrentDoorLock = doorLock; |
| | | ///进来刷新一次设备列表; |
| | | Common.Logic.LogicDviceList.Clear(); |
| | | if (Common.Logic.LogicDviceList.Count == 0) |
| | | { |
| | | Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray()); |
| | | } |
| | | var addLogicPage = new SoneLogicList(); |
| | | //new一个新逻辑对象; |
| | | //新增正常自动化入口 |
| | | Common.Logic.CurrentLogic = new Common.Logic(); |
| | | Common.Logic.CurrentLogic.IsEnable = 1;//默认为开 |
| | | Common.Logic.CurrentLogic.LogicType = 0;//标记逻辑类型 |
| | | Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.automation1); |
| | | var addLogicPage = new AddLogicPage(); |
| | | UserView.HomePage.Instance.AddChidren(addLogicPage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | addLogicPage.Show(()=> { },false); |
| | | |
| | | ////new一个新逻辑对象; |
| | | ////新增正常自动化入口 |
| | | //Common.Logic.CurrentLogic = new Common.Logic(); |
| | | //Common.Logic.CurrentLogic.IsEnable = 1;//默认为开 |
| | | //Common.Logic.CurrentLogic.LogicType = 0;//标记逻辑类型 |
| | | //Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.automation1); |
| | | //var addLogicPage = new AddLogicPage(); |
| | | //UserView.HomePage.Instance.AddChidren(addLogicPage); |
| | | //UserView.HomePage.Instance.PageIndex += 1; |
| | | //addLogicPage.Show(); |
| | | addLogicPage.Show(); |
| | | |
| | | } |
| | | break; |
| | |
| | | CommonPage.Loading.Start(); |
| | | try |
| | | { |
| | | if (!Config.Instance.Home.IsVirtually)//虚拟的不获取网关逻辑列表 |
| | | { |
| | | if (Common.Logic.LogicList.Count == 0) |
| | | { |
| | | var Idlist1 = await Send.GetLogicId(0);// |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | var dd = e.Message; |
| | |
| | | /// <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); |
| | | } |
| | | if (!Config.Instance.Home.IsVirtually) |
| | | { |
| | | Send.LogicControlSwitch(logic); |
| | | } |
| | | //Logic.Send.AddModifyLogic(logic); |
| | | }; |
| | | if (logic.IsEnable == 1) |
| | |
| | | { |
| | | Common.Logic.LogicList.Remove(logic); |
| | | Automationview(refresview, no); |
| | | if (!Config.Instance.Home.IsVirtually) |
| | | { |
| | | Send.DelLogic(logic.LogicId); |
| | | } |
| | | }; |
| | | |
| | | }; |