| | |
| | | |
| | | namespace Shared.Phone.Device.Logic |
| | | { |
| | | public class SkipView |
| | | public class SkipView:FrameLayout |
| | | { |
| | | /// <summary> |
| | | /// 其它界面跳进来的入口 |
| | |
| | | /// 0.正常自动化;1.门锁自动化;2.Sone门锁; |
| | | switch (intvalue) |
| | | { |
| | | case 0:
|
| | | { |
| | | //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(); |
| | | |
| | | }
|
| | | break; |
| | | case 1:
|
| | | { |
| | | //进入门锁联动事件入口 |
| | | Send.UserMemberInfoRes = accountObj;
|
| | | Send.CurrentDoorLock = doorLock;
|
| | | if (accountObj == null)
|
| | | {
|
| | | ///防止抛异常
|
| | | Send.UserMemberInfoRes = new UserCenter.MemberInfoRes();
|
| | | }
|
| | | if (doorLock == null)
|
| | | {
|
| | | ///防止抛异常
|
| | | Send.CurrentDoorLock = new DoorLock();
|
| | | }
|
| | | ///进来刷新一次设备列表;
|
| | | Common.Logic.LogicDviceList.Clear();
|
| | | if (Common.Logic.LogicDviceList.Count == 0)
|
| | | {
|
| | | Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray());
|
| | | }
|
| | | var doorLockLogicList = new DoorLockLogic.LockLogicList();
|
| | | UserView.HomePage.Instance.AddChidren(doorLockLogicList);
|
| | | UserView.HomePage.Instance.PageIndex += 1;
|
| | | doorLockLogicList.Show(); |
| | | }
|
| | | break; |
| | | case 2:
|
| | | 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());
|
| | | ///进来刷新一次设备列表; |
| | | Common.Logic.LogicDviceList.Clear(); |
| | | if (Common.Logic.LogicDviceList.Count == 0) |
| | | { |
| | | Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray()); |
| | | } |
| | | var addLogicPage = new SoneLogicList(); |
| | | UserView.HomePage.Instance.AddChidren(addLogicPage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | addLogicPage.Show();
|
| | | addLogicPage.Show(); |
| | | |
| | | ////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(); |
| | | |
| | | } |
| | | break; |
| | | case 1: |
| | | { |
| | | //进入门锁联动事件入口 |
| | | Send.UserMemberInfoRes = accountObj; |
| | | Send.CurrentDoorLock = doorLock; |
| | | if (accountObj == null) |
| | | { |
| | | ///防止抛异常 |
| | | Send.UserMemberInfoRes = new UserCenter.MemberInfoRes(); |
| | | } |
| | | if (doorLock == null) |
| | | { |
| | | ///防止抛异常 |
| | | Send.CurrentDoorLock = new DoorLock(); |
| | | } |
| | | ///进来刷新一次设备列表; |
| | | Common.Logic.LogicDviceList.Clear(); |
| | | if (Common.Logic.LogicDviceList.Count == 0) |
| | | { |
| | | Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray()); |
| | | } |
| | | var doorLockLogicList = new DoorLockLogic.LockLogicList(); |
| | | UserView.HomePage.Instance.AddChidren(doorLockLogicList); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | doorLockLogicList.Show(); |
| | | } |
| | | break; |
| | | case 2: |
| | | { |
| | | ///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(); |
| | | UserView.HomePage.Instance.AddChidren(addLogicPage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | addLogicPage.Show(); |
| | | |
| | | }
|
| | | } |
| | | break; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | #region ◆ 自动化__________________________ |
| | | /// <summary> |
| | |
| | | X = Application.GetRealWidth(58), |
| | | Y = scenehorizontalScrol.Bottom, |
| | | }; |
| | | functionSceneAutoBodyView.AddChidren(logicScrolView);
|
| | |
|
| | | functionSceneAutoBodyView.AddChidren(logicScrolView); |
| | | |
| | | logicScrolView.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft); |
| | | bool no = false; |
| | | //显示默认模板的界面事件 |
| | |
| | | Read(logicScrolView, no); |
| | | //关闭刷新View; |
| | | logicScrolView.EndHeaderRefreshing(); |
| | | };
|
| | |
|
| | | //自动化
|
| | | }; |
| | | |
| | | //自动化 |
| | | Read(logicScrolView, no); |
| | | |
| | | } |
| | |
| | | fLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft); |
| | | logicRowlayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft); |
| | | |
| | | }
|
| | | i++;
|
| | | } |
| | | i++; |
| | | var logicnameBtn = new Button |
| | | { |
| | | Height = Application.GetRealHeight(58), |
| | |
| | | { |
| | | var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm, |
| | | Language.StringByID(MyInternationalizationString.doyouwanttodelete), |
| | | Language.StringByID(MyInternationalizationString.confrim));
|
| | | alert.Show();
|
| | | alert.ConfirmClickEvent += () =>
|
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | alert.ConfirmClickEvent += () => |
| | | { |
| | | Common.Logic.LogicList.Remove(logic); |
| | | Automationview(refresview, no); |
| | | Send.DelLogic(logic.LogicId);
|
| | | Send.DelLogic(logic.LogicId); |
| | | }; |
| | | |
| | | }; |
| | |
| | | Width = Application.GetRealWidth(1080 - 58), |
| | | BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor, |
| | | }; |
| | | fLayout.AddChidren(line);
|
| | |
|
| | |
|
| | | fLayout.AddChidren(line); |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | { |
| | | indexlist.Add(linkType); |
| | | } |
| | | }
|
| | | //排列图标顺序;
|
| | | } |
| | | //排列图标顺序; |
| | | if (indexlist.Contains("0") || indexlist.Contains("8")) |
| | | { |
| | | iconIndexlist.Add("0"); |
| | |
| | | currentLogic.Conditions.Add(timeConditionsInfo); |
| | | currentLogic.Actions.Add(actionsInfo); |
| | | var logicIfon = await Send.AddModifyLogic(currentLogic); |
| | | if (logicIfon != null && logicIfon.LogicId != 0)
|
| | | {
|
| | | //添加门锁失效时间的历史记录
|
| | | UserCenter.HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog((DoorLock)common, 9003, timeVlaue.ToString());
|
| | | if (logicIfon != null && logicIfon.LogicId != 0) |
| | | { |
| | | //添加门锁失效时间的历史记录 |
| | | UserCenter.HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog((DoorLock)common, 9003, timeVlaue.ToString()); |
| | | return true;//表示添加成功; |
| | | } |
| | | return false;//表示添加失败; |
| | | |
| | | } |
| | | |
| | | ///<summary>
|
| | | /// s-one门锁是否存在自动化的方法;
|
| | | /// 注意(参数:2-自动化;3-失效时间自动化);
|
| | | ///<summary> |
| | | /// s-one门锁是否存在自动化的方法; |
| | | /// 注意(参数:2-常开自动化;3-失效时间自动化); |
| | | /// 返回值:0不存在;其它值都存在; |
| | | /// </summary>
|
| | | public static async System.Threading.Tasks.Task<int> Exist(int valueInt=2)
|
| | | {
|
| | | /// </summary> |
| | | public static async System.Threading.Tasks.Task<int> Exist(int valueInt) |
| | | { |
| | | int exist = 0; |
| | | var Idlist = await Send.GetLogicId(valueInt);
|
| | | if (Idlist.Count != 0)
|
| | | var Idlist = await Send.GetLogicId(valueInt); |
| | | if (Idlist.Count != 0) |
| | | { |
| | | //默认取第一个逻辑ID |
| | | exist = Idlist[0]; |
| | |
| | | return exist; |
| | | } |
| | | |
| | | ///<summary>
|
| | | ///<summary> |
| | | ///获取逻辑信息 |
| | | /// 返回值:null不存在;其它值都存在; |
| | | /// </summary>
|
| | | public static async System.Threading.Tasks.Task<Common.Logic> GetLogicIfon()
|
| | | {
|
| | | /// </summary> |
| | | public static async System.Threading.Tasks.Task<Common.Logic> GetLogicIfon() |
| | | { |
| | | Common.Logic logic = null; |
| | | var Idlist = await Send.GetLogicId(3);
|
| | | if (Idlist.Count != 0)
|
| | | var Idlist = await Send.GetLogicId(3); |
| | | if (Idlist.Count != 0) |
| | | { |
| | | //默认取第一个逻辑ID(时效性只有一条逻辑) |
| | | int exist = Idlist[0]; |
| | |
| | | } |
| | | return logic; |
| | | } |
| | | |
| | | ///<summary> |
| | | ///删除所有时效性自动化 |
| | | /// 返回值:true成功;false失败; |
| | | /// </summary> |
| | | public static async System.Threading.Tasks.Task<bool> GetLogicAll() |
| | | { |
| | | bool _if = false; |
| | | var Idlist = await Send.GetLogicId(3); |
| | | if (Idlist.Count != 0) |
| | | { |
| | | _if = true; |
| | | |
| | | for (int i = 0; i < Idlist.Count; i++) |
| | | { |
| | | int id = Idlist[i]; |
| | | //本来只有一条时效性自动化, |
| | | //防止特殊情况,找到就删除掉; |
| | | Send.DelLogic(id); |
| | | } |
| | | } |
| | | return _if; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |