| | |
| | | Tag = "LockLogic"; |
| | | } |
| | | EditText logicTextBox; |
| | | public void Show(Action action) |
| | | public async void Show(Action action) |
| | | { |
| | | |
| | | #region 最上面的布局代码 |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.selection, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | if (Common.Logic.CurrentLogic.LogicId != 0) |
| | |
| | | var deviceinof = Common.Logic.LogicDviceList.Find((obj) => { return obj.DeviceAddr == conditions["MacAddr"] && obj.DeviceEpoint.ToString() == conditions["Epoint"]; }); |
| | | if (deviceinof == null) |
| | | { |
| | | continue; |
| | | deviceinof = new ZigBee.Device.CommonDevice(); |
| | | //continue; |
| | | } |
| | | ///显示设备名称 |
| | | var btndevice = new Button |
| | |
| | | conditionsRowLayout.AddRightView(del); |
| | | del.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var alert = new Alert(Language.StringByID(MyInternationalizationString.tip), Language.StringByID(MyInternationalizationString.doyouwanttodelete), |
| | | Language.StringByID(MyInternationalizationString.cancel), Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.ResultEventHandler += (sender1, e1) => |
| | | { |
| | | if (e1) |
| | | { |
| | | Common.Logic.CurrentLogic.Conditions.Remove(conditions); |
| | | var lockLogicCommunalPage = new LockLogicCommunalPage(); |
| | | UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | lockLogicCommunalPage.Show(() => { }); |
| | | } |
| | | }; |
| | | var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm, |
| | | Language.StringByID(MyInternationalizationString.doyouwanttodelete), |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | alert.ConfirmClickEvent += () => |
| | | { |
| | | Common.Logic.CurrentLogic.Conditions.Remove(conditions); |
| | | var lockLogicCommunalPage = new LockLogicCommunalPage(); |
| | | UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | lockLogicCommunalPage.Show(() => { }); |
| | | }; |
| | | |
| | | }; |
| | | |
| | |
| | | var deviceinof = Common.Logic.LogicDviceList.Find((obj) => { return ((obj.DeviceAddr == obj1) && (obj.DeviceEpoint.ToString() == obj2)); }); |
| | | if (deviceinof == null) |
| | | { |
| | | continue; |
| | | deviceinof = new ZigBee.Device.CommonDevice(); |
| | | //continue; |
| | | } |
| | | |
| | | ///设备名称Button |
| | |
| | | bool ifclose = false; |
| | | foreach (var status in TaskList) |
| | | { |
| | | if (status["TaskType"].ToString() == "1") |
| | | if (TaskList.Count == 1) |
| | | { |
| | | if (status["Data1"].ToString() == "0") |
| | | { |
| | | // devicestatus.Text = Language.StringByID(MyInternationalizationString.close); |
| | | |
| | | ifclose = false; |
| | | } |
| | | else if (status["Data1"].ToString() == "1") |
| | | { |
| | | //devicestatus.Text = Language.StringByID(MyInternationalizationString.open); |
| | | ifclose = true; |
| | | } |
| | | |
| | | //数组只有一个元素说明当前空调状态为关; |
| | | ifclose = false; |
| | | //如果空调状态是关;直接跳出for循坏; |
| | | break; |
| | | } |
| | | else if (status["TaskType"].ToString() == "5") |
| | | else |
| | | { |
| | | ifclose = true; |
| | | } |
| | | |
| | | if (status["TaskType"].ToString() == "5") |
| | | { |
| | | if (status["Data1"] == "3") |
| | | {//3---设置工作模式(1:自动;3:制冷;4:制热;7:送风;8:除湿) |
| | |
| | | case 2: |
| | | { |
| | | |
| | | //在本地查找该场景; |
| | | var sceneinof = Common.Room.AllRoomSceneUIList.Find((obj) => { return obj.Id.ToString() == actions["DeviceAddr"].ToString(); }); |
| | | //本地没有存在; |
| | | if (sceneinof == null) |
| | | { |
| | | continue; |
| | | //实现目的:显示出来让可以自己是否删除 |
| | | sceneinof = new SceneUI(); |
| | | #region ----- |
| | | ////在网关查找该场景; |
| | | ////标记问题:网络请求,存在视图加载快慢的问题; |
| | | //sceneinof = await Send.GetScene(int.Parse(actions["DeviceAddr"].ToString())); |
| | | ////网关没有存在; |
| | | //if (sceneinof == null) |
| | | //{ |
| | | // //注解:本地和网关都不存在该场景,界面将不会显示该场景; |
| | | // //sceneinof = new SceneUI(); |
| | | // //移除该场景数据; |
| | | // Common.Logic.CurrentLogic.Actions.Remove(actions); |
| | | // //移除该场景视图; |
| | | // devicesFrameLayout.RemoveFromParent(); |
| | | // continue; |
| | | //} |
| | | #endregion |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | actionsIcon.UnSelectedImagePath = "ZigeeLogic/scene.png"; |
| | | ///设备名称Button |
| | |
| | | |
| | | del.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var alert = new Alert(Language.StringByID(MyInternationalizationString.tip), Language.StringByID(MyInternationalizationString.doyouwanttodelete), |
| | | Language.StringByID(MyInternationalizationString.cancel), Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.ResultEventHandler += (sender1, e1) => |
| | | { |
| | | if (e1) |
| | | { |
| | | Common.Logic.CurrentLogic.Actions.Remove(actions); |
| | | var lockLogicCommunalPage = new LockLogicCommunalPage(); |
| | | UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | lockLogicCommunalPage.Show(() => { }); |
| | | } |
| | | }; |
| | | var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm, |
| | | Language.StringByID(MyInternationalizationString.doyouwanttodelete), |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | |
| | | alert.ConfirmClickEvent += () => |
| | | { |
| | | Common.Logic.CurrentLogic.Actions.Remove(actions); |
| | | var lockLogicCommunalPage = new LockLogicCommunalPage(); |
| | | UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | lockLogicCommunalPage.Show(() => { }); |
| | | }; |
| | | |
| | | }; |
| | | |
| | |
| | | Gravity = Gravity.CenterVertical, |
| | | }; |
| | | pushswitchRowlayout.AddChidren(btnswitch); |
| | | btnswitch.MouseUpEventHandler += (sender1, e1) => |
| | | { |
| | | btnswitch.IsSelected = !btnswitch.IsSelected; |
| | | if (btnswitch.IsSelected) |
| | | { |
| | | |
| | | } |
| | | else |
| | | { |
| | | |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | var custompushFrameLayout = new FrameLayout |
| | | { |
| | | Height = Application.GetRealHeight(160), |
| | | Height = Application.GetRealHeight(0), |
| | | BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, |
| | | }; |
| | | middle.AddChidren(custompushFrameLayout); |
| | |
| | | |
| | | #endregion |
| | | |
| | | bool tag = false;//标记开关状态; |
| | | btnswitch.MouseUpEventHandler += (sender1, e1) => |
| | | { |
| | | btnswitch.IsSelected = !btnswitch.IsSelected; |
| | | if (btnswitch.IsSelected) |
| | | { |
| | | tag = true; |
| | | custompushFrameLayout.Height = Application.GetRealHeight(160); |
| | | Common.Logic.CurrentLogic.LogicIsCustomPushText = 1; |
| | | |
| | | } |
| | | else |
| | | { |
| | | tag = false; |
| | | custompushFrameLayout.Height = Application.GetRealHeight(0); |
| | | Common.Logic.CurrentLogic.LogicIsCustomPushText = 0; |
| | | } |
| | | Send.Zj(tag, Common.Logic.CurrentLogic); |
| | | }; |
| | | if (Common.Logic.CurrentLogic.LogicIsCustomPushText == 0) |
| | | { |
| | | tag = false; |
| | | btnswitch.IsSelected = false; |
| | | custompushFrameLayout.Height = Application.GetRealHeight(0); |
| | | } |
| | | else |
| | | { |
| | | tag = true; |
| | | btnswitch.IsSelected = true; |
| | | custompushFrameLayout.Height = Application.GetRealHeight(160); |
| | | } |
| | | var saveFrameLayout = new FrameLayout |
| | | { |
| | | Y = middle.Bottom, |
| | |
| | | var name = logicTextBox.Text.Trim(); |
| | | if (string.IsNullOrEmpty(logicTextBox.Text.Trim())) |
| | | { |
| | | new Alert(Language.StringByID(MyInternationalizationString.Tip), Language.StringByID(MyInternationalizationString.PleaseEnterLogicName), Language.StringByID(MyInternationalizationString.Close)).Show(); |
| | | var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal, |
| | | Language.StringByID(MyInternationalizationString.PleaseEnterLogicName), |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | return; |
| | | } |
| | | var logicname = Common.Logic.LockLogicList.Find((logic) => Common.Logic.CurrentLogic.LogicId != logic.LogicId && logic.LogicName == name); |
| | | if (logicname != null) |
| | | { |
| | | new Alert(Language.StringByID(MyInternationalizationString.Tip), Language.StringByID(MyInternationalizationString.Rename), Language.StringByID(MyInternationalizationString.Close)).Show(); |
| | | return; |
| | | } |
| | | //var logicname = Common.Logic.LockLogicList.Find((logic) => Common.Logic.CurrentLogic.LogicId != logic.LogicId && logic.LogicName == name); |
| | | //if (logicname != null) |
| | | //{ |
| | | // new Alert(Language.StringByID(MyInternationalizationString.Tip), Language.StringByID(MyInternationalizationString.Rename), Language.StringByID(MyInternationalizationString.Close)).Show(); |
| | | // return; |
| | | //} |
| | | |
| | | Common.Logic.CurrentLogic.LogicName = name; |
| | | |
| | |
| | | { |
| | | Common.Logic.CurrentLogic.LogicId = logicifon.LogicId; |
| | | Common.Logic.LockLogicList.Add(Common.Logic.CurrentLogic); |
| | | if (tag) |
| | | { |
| | | Send.Zj(tag, Common.Logic.CurrentLogic); |
| | | } |
| | | } |
| | | } |
| | | else |