| | |
| | | { |
| | | List<string> devicetypelist = new List<string>(); |
| | | devicetypelist.Clear(); |
| | | |
| | | var lightjosn = devicelist.Find((device) => device.Type == DeviceType.DimmableLight || device.Type == DeviceType.OnOffOutput); |
| | | if (lightjosn != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.Lights)); |
| | | } |
| | | var iASZonejosn = devicelist.Find((device) => device.Type == DeviceType.IASZone || device.Type == DeviceType.TemperatureSensor); |
| | | if (iASZonejosn != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.sensor)); |
| | | } |
| | | var onOffSwitchjson = devicelist.Find((device) => device.Type == DeviceType.OnOffSwitch); |
| | | if (onOffSwitchjson != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.OnOffSwitch)); |
| | | } |
| | | var doorLock = devicelist.Find((device) => device.Type == DeviceType.DoorLock); |
| | | if (doorLock != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.doorLock)); |
| | | } |
| | | |
| | | var curtainjosn = devicelist.Find((device) => device.Type == DeviceType.WindowCoveringDevice); |
| | | if (curtainjosn != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.Curtains)); |
| | | } |
| | | |
| | | var ac = devicelist.Find((device) => device.Type == DeviceType.Thermostat); |
| | | if (ac != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.AC)); |
| | | } |
| | | |
| | | var onOffSwitchjson = devicelist.Find((device) => device.Type == DeviceType.OnOffSwitch); |
| | | if (onOffSwitchjson != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.OnOffSwitch)); |
| | | } |
| | | |
| | | var doorLock = devicelist.Find((device) => device.Type == DeviceType.DoorLock); |
| | | if (doorLock != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.doorLock)); |
| | | } |
| | | |
| | | var airSwitch = devicelist.Find((device) => device.Type == DeviceType.AirSwitch); |
| | | if (airSwitch != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.Airswitch)); |
| | | } |
| | | |
| | | var iASZonejosn = devicelist.Find((device) => device.Type == DeviceType.IASZone || device.Type == DeviceType.TemperatureSensor); |
| | | if (iASZonejosn != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.sensor)); |
| | | } |
| | | |
| | | return devicetypelist; |
| | |
| | | deviceTypeList.Add(DeviceType.Thermostat); |
| | | deviceTypeList.Add(DeviceType.AirSwitch); |
| | | ///门锁特殊 |
| | | deviceTypeList.Add(DeviceType.DoorLock); |
| | | // deviceTypeList.Add(DeviceType.DoorLock); |
| | | } |
| | | break; |
| | | case "condition_mould": |
| | |
| | | deviceTypeList.Add(DeviceType.Thermostat); |
| | | deviceTypeList.Add(DeviceType.AirSwitch); |
| | | ///门锁特殊 |
| | | deviceTypeList.Add(DeviceType.DoorLock); |
| | | // deviceTypeList.Add(DeviceType.DoorLock); |
| | | } |
| | | break; |
| | | |
| | |
| | | custompushview.iconBtn.Visible = true; |
| | | custompushview.iconBtn.UnSelectedImagePath = "ZigeeLogic/next.png"; |
| | | custompushview.titleBtn.TextID = MyInternationalizationString.custompush; |
| | | custompushview.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor; |
| | | middle.AddChidren(custompushview.AddDeviceView()); |
| | | |
| | | EventHandler<MouseEventArgs> customclick = (sender, e) => |
| | |
| | | LogicView.IfString.Tag = true; |
| | | custompushview.frameLayout.Height = Application.GetRealHeight(160); |
| | | Common.Logic.CurrentLogic.LogicIsCustomPushText = 1; |
| | | pushview.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor; |
| | | |
| | | } |
| | | else |
| | |
| | | LogicView.IfString.Tag = false; |
| | | custompushview.frameLayout.Height = Application.GetRealHeight(0); |
| | | Common.Logic.CurrentLogic.LogicIsCustomPushText = 0; |
| | | pushview.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor; |
| | | } |
| | | Send.Zj(LogicView.IfString.Tag, Common.Logic.CurrentLogic); |
| | | }; |
| | |
| | | LogicView.IfString.Tag = false; |
| | | pushview.switchBtn.IsSelected = false; |
| | | custompushview.frameLayout.Height = Application.GetRealHeight(0); |
| | | pushview.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor; |
| | | } |
| | | else |
| | | { |
| | | LogicView.IfString.Tag = true; |
| | | pushview.switchBtn.IsSelected = true; |
| | | custompushview.frameLayout.Height = Application.GetRealHeight(160); |
| | | pushview.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor; |
| | | } |
| | | } |
| | | /// <summary> |
| | |
| | | /// <param name="CurrentLogic">当前逻辑</param> |
| | | public async static void SaveLogic(string if_logic, string name, bool tag, Common.Logic CurrentLogic) |
| | | { |
| | | |
| | | if (CurrentLogic.Conditions.Count == 0 || CurrentLogic.Actions.Count == 0) |
| | | { |
| | | var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal, |
| | | Language.StringByID(MyInternationalizationString.addnull), |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | return; |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(name)) |
| | | { |
| | | var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal, |
| | |
| | | { |
| | | succeed = true; |
| | | CurrentLogic.LogicId = logicifon.LogicId; |
| | | Common.Logic.LogicList.Add(CurrentLogic); |
| | | if (LogicView.IfString._LockLogic == if_logic) |
| | | { |
| | | //门锁联动事件逻辑列表 |
| | | Common.Logic.LockLogicList.Add(CurrentLogic); |
| | | } |
| | | else |
| | | { |
| | | //自动化逻辑列表 |
| | | Common.Logic.LogicList.Add(CurrentLogic); |
| | | |
| | | } |
| | | if (tag) |
| | | { |
| | | Send.Zj(tag, CurrentLogic); |
| | |
| | | //TipView("添加自动化失败"); |
| | | //return; |
| | | } |
| | | UserView.HomePage.Instance.RemoveViewByTag("Logic"); |
| | | |
| | | |
| | | if (LogicView.IfString._Logic == if_logic) |
| | | { |
| | | Category.Category.instance?.RefreshBodyView(); |
| | | UserView.HomePage.Instance.RemoveViewByTag("Logic"); |
| | | if (CurrentLogic.LogicType == 0) |
| | | { |
| | | //只刷新分类上下滑动view; |
| | | Phone.Category.CategoryMainForm.instance?.RefreshBodyView(); |
| | | // Category.Category.instance?.RefreshBodyView(); |
| | | } |
| | | else if (CurrentLogic.LogicType == 2) |
| | | { |
| | | //刷新整个分类; |
| | | //门锁常开模式特殊; |
| | | UserView.UserPage.Instance.ShowCategoryAutoListForm(); |
| | | |
| | | } |
| | | } |
| | | else if (LogicView.IfString._LockLogic == if_logic) |
| | | { |
| | | UserView.HomePage.Instance.RemoveViewByTag("Logic");//移除所有标记Logic界面 |
| | | UserView.HomePage.Instance.RemoveViewByTag("LockListView");//移除所有标记LockListView界面 |
| | | var doorLockLogicList = new DoorLockLogic.LockLogicList(); |
| | | UserView.HomePage.Instance.AddChidren(doorLockLogicList); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | deviceTarget.Show(str1, str2); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |