| | |
| | | /// </summary> |
| | | public static void SkipAddLogic(int intvalue, DoorLock doorLock = null, UserCenter.MemberInfoRes accountObj = null) |
| | | { |
| | | /// 0.正常自动化;1.门锁自动化;2.门锁常开.关; |
| | | /// 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(); |
| | | |
| | | |
| | | var addLogicPage = new SoneLogicList(); |
| | | 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; |
| | |
| | | }
|
| | | break; |
| | | case 2:
|
| | | {
|
| | | |
| | | if (doorLock == null)
|
| | | {
|
| | | ///防止抛异常
|
| | | doorLock = new DoorLock();
|
| | | { |
| | | ///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 h = DateTime.Now.ToString("HH"); |
| | | var m = DateTime.Now.ToString("mm"); |
| | | Dictionary<string, string> timeConditionsInfo = new Dictionary<string, string>(); |
| | | timeConditionsInfo.Add("Type", "0"); |
| | | timeConditionsInfo.Add("IsValid", "1"); |
| | | timeConditionsInfo.Add("DateType", "0"); |
| | | timeConditionsInfo.Add("RemindTime", "0"); |
| | | timeConditionsInfo.Add("EnDelay", "0"); |
| | | timeConditionsInfo.Add("DelayTime", "0"); |
| | | timeConditionsInfo.Add("DoorLockOpenDelayTime", "0"); |
| | | timeConditionsInfo.Add("StartHour", h); |
| | | timeConditionsInfo.Add("StartMin", m); |
| | | Dictionary<string, object> actionsInfo = new Dictionary<string, object>(); |
| | | actionsInfo.Add("LinkType", 8); |
| | | actionsInfo.Add("DeviceAddr", doorLock.DeviceAddr); |
| | | actionsInfo.Add("Epoint", "200"); |
| | | actionsInfo.Add("PassData", "055704010113");//默认门锁常关 |
| | | |
| | | //new一个新逻辑对象; |
| | | //新增门锁常开模式自动化入口; |
| | | Common.Logic.CurrentLogic = new Common.Logic(); |
| | | Common.Logic.CurrentLogic.IsEnable = 1;//默认为开 |
| | | 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);//添加目标 |
| | | var oneLogic = new OneLogic(); |
| | | UserView.HomePage.Instance.AddChidren(oneLogic); |
| | | var addLogicPage = new SoneLogicList(); |
| | | UserView.HomePage.Instance.AddChidren(addLogicPage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | oneLogic.Show(false); |
| | | addLogicPage.Show();
|
| | | |
| | | }
|
| | | break; |
| | | } |
| | |
| | | |
| | | |
| | | #region ◆ 自动化__________________________ |
| | | |
| | | /// <summary> |
| | | /// 自动化功能代码入口 |
| | | /// </summary> |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | /// <summary> |
| | |
| | | actionsInfo.Add("LinkType", 8); |
| | | actionsInfo.Add("DeviceAddr", common.DeviceAddr); |
| | | actionsInfo.Add("Epoint", common.DeviceEpoint); |
| | | actionsInfo.Add("PassData", "055704010113");//默认门锁常关e |
| | | actionsInfo.Add("PassData", "055704010113");//默认门锁常关 |
| | | |
| | | Common.Logic currentLogic = new Common.Logic(); |
| | | currentLogic.IsEnable = 1;//默认为开 |