| | |
| | | doorLockLogicList.Show(); |
| | | } break; |
| | | case 2: { |
| | | ///进来刷新一次设备列表;
|
| | | Common.Logic.LogicDviceList.Clear();
|
| | | if (Common.Logic.LogicDviceList.Count == 0)
|
| | | {
|
| | | Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray());
|
| | | } |
| | | //new一个新逻辑对象; |
| | | //新增门锁常开模式自动化入口; |
| | | Common.Logic.CurrentLogic = new Common.Logic(); |
| | |
| | | indexlist.Add(linkType); |
| | | } |
| | | } |
| | | if (indexlist.Contains("0")) |
| | | //排列图标顺序; |
| | | if (indexlist.Contains("0")|| indexlist.Contains("8")) |
| | | { |
| | | iconIndexlist.Add("0"); |
| | | } |
| | |
| | | public static void LockAddModifyLogic(int timeVlaue, CommonDevice common) |
| | | { |
| | | |
| | | int hour = timeVlaue / 60; |
| | | int min = timeVlaue % 60; |
| | | 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("DelayTime", "0"); |
| | | timeConditionsInfo.Add("StartHour", hour.ToString()); |
| | | timeConditionsInfo.Add("StartMin", min.ToString()); |
| | | timeConditionsInfo.Add("EnDelay", "0"); |
| | | timeConditionsInfo.Add("DelayTime", "0"); |
| | | timeConditionsInfo.Add("StartHour", timeVlaue.ToString()); |
| | | timeConditionsInfo.Add("StartMin", "0"); |
| | | Dictionary<string, object> actionsInfo = new Dictionary<string, object>(); |
| | | actionsInfo.Add("LinkType", 8); |
| | | actionsInfo.Add("DeviceAddr", common.DeviceAddr); |
| | |
| | | actionsInfo.Add("PassData", "055704010112");//默认门锁常开 |
| | | |
| | | Common.Logic currentLogic = new Common.Logic(); |
| | | currentLogic.IsEnable = 0;//默认禁用 |
| | | currentLogic.IsEnable = 1;//默认为开 |
| | | currentLogic.TimeAttribute.Repeat = 0;//执行一次 |
| | | currentLogic.LogicType = 2;//标记逻辑类型 |
| | | currentLogic.LogicName = Language.StringByID(R.MyInternationalizationString.openmode); |
| | | currentLogic.Conditions.Add(timeConditionsInfo); |
| | | currentLogic.Actions.Add(actionsInfo); |