| | |
| | | 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(); |
| | |
| | | refresview.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor; |
| | | } |
| | | } |
| | | |
| | | int i = 1;//局部变量,默认是第一条逻辑; |
| | | foreach (var logic in Common.Logic.LogicList) |
| | | { |
| | | |
| | | |
| | | var fLayout = new FrameLayout |
| | | { |
| | | Height = Application.GetRealHeight(190 + 30), |
| | |
| | | BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, |
| | | }; |
| | | refresview.AddChidren(fLayout); |
| | | |
| | | |
| | | var logicRowlayout = new RowLayout |
| | | { |
| | | Height = Application.GetRealHeight(190 + 30), |
| | |
| | | |
| | | }; |
| | | fLayout.AddChidren(logicRowlayout); |
| | | |
| | | if (i == 1) |
| | | { |
| | | //实现android显示逻辑列表的圆角; |
| | | fLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft); |
| | | logicRowlayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft); |
| | | i = 2; |
| | | } |
| | | |
| | | var logicnameBtn = new Button |
| | | { |
| | | Height = Application.GetRealHeight(58), |
| | |
| | | |
| | | var logicswitchBtn = new Button |
| | | { |
| | | Width = Application.GetRealWidth(104), |
| | | Height = Application.GetRealHeight(63), |
| | | Width = Application.GetMinRealAverage(104), |
| | | Height = Application.GetMinRealAverage(63), |
| | | UnSelectedImagePath = "ZigeeLogic/logicclose.png", |
| | | SelectedImagePath = "ZigeeLogic/logicopen.png", |
| | | X = logicRowlayout.Width - Application.GetRealWidth(104 + 58), |
| | |
| | | logic.IsEnable = 0; |
| | | StatusColor(logic, logicRowlayout, 0); |
| | | } |
| | | Device.Logic.Send.LogicControlSwitch(logic); |
| | | Send.LogicControlSwitch(logic); |
| | | //Logic.Send.AddModifyLogic(logic); |
| | | }; |
| | | if (logic.IsEnable == 1) |
| | |
| | | logicRowlayout.AddChidren(logictimeBtn); |
| | | |
| | | ///显示执行周期 |
| | | Device.Logic.Method.UpdateWeek(logictimeBtn, logic); |
| | | Method.UpdateWeek(logictimeBtn, logic); |
| | | |
| | | |
| | | List<string> indexlist = new List<string>(); |
| | |
| | | indexlist.Add(linkType); |
| | | } |
| | | } |
| | | if (indexlist.Contains("0")) |
| | | //排列图标顺序; |
| | | if (indexlist.Contains("0")|| indexlist.Contains("8")) |
| | | { |
| | | iconIndexlist.Add("0"); |
| | | } |
| | |
| | | Height = Application.GetMinRealAverage(82), |
| | | X = Application.GetRealWidth(58) + Application.GetRealWidth(12 + (12 + 82 + 45 + 12) * i), |
| | | Y = Application.GetRealHeight(58 + 30 + 30), |
| | | Radius = (uint)Application.GetRealHeight(41), |
| | | Radius = (uint)Application.GetMinRealAverage(41), |
| | | BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | | }; |
| | | logicRowlayout.AddChidren(typebjBtn); |
| | |
| | | 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); |