| | |
| | | action(); |
| | | RemoveFromParent(); |
| | | }; |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | var middle = new VerticalScrolViewLayout |
| | | { |
| | |
| | | BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | | }; |
| | | this.AddChidren(middle); |
| | | var saveFrameLayout = new FrameLayout |
| | | { |
| | | Y = middle.Bottom, |
| | | Height = Application.GetRealHeight(180), |
| | | BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | | }; |
| | | this.AddChidren(saveFrameLayout); |
| | | |
| | | var btnsave = new Button |
| | | { |
| | | X = Application.GetRealWidth(85), |
| | | Height = Application.GetRealHeight(130),//194 |
| | | Width = Application.GetRealWidth(910), |
| | | Radius = (uint)Application.GetRealHeight(60), |
| | | BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor, |
| | | TextID = MyInternationalizationString.Save, |
| | | TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor, |
| | | TextSize = 16, |
| | | }; |
| | | saveFrameLayout.AddChidren(btnsave); |
| | | |
| | | #region -----自动化名称 设置名称----- |
| | | var logicnamefl = new FrameLayout |
| | |
| | | int second = int.Parse(conditions["IgnoreTime"]) % 60; |
| | | if (minute != 0 && second != 0) |
| | | { |
| | | devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.minute) + second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.closetime); |
| | | devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.minute) + second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.unattendedtime1); |
| | | |
| | | } |
| | | else |
| | | { |
| | | if (minute == 0 && second != 0) |
| | | { |
| | | devicestatus.Text = second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.closetime); |
| | | devicestatus.Text = second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.unattendedtime1); |
| | | |
| | | } |
| | | if (minute != 0 && second == 0) |
| | | { |
| | | devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.Minute) + Language.StringByID(MyInternationalizationString.closetime); |
| | | devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.Minute) + Language.StringByID(MyInternationalizationString.unattendedtime1); |
| | | |
| | | } |
| | | |
| | |
| | | }; |
| | | conditionsRowLayout.AddChidren(securitystatus); |
| | | |
| | | if (conditions["EnOrWithdrawMode"] == "1") |
| | | switch (conditions["EnOrWithdrawMode"]) |
| | | { |
| | | conditionIcon.UnSelectedImagePath = "ZigeeLogic/withdrawal.png"; |
| | | securitystatus.Text = Language.StringByID(MyInternationalizationString.withdrawal); |
| | | } |
| | | else |
| | | { |
| | | if (conditions["ModeId"] == "1") |
| | | { |
| | | conditionIcon.UnSelectedImagePath = "ZigeeLogic/athome.png"; |
| | | securitystatus.Text = Language.StringByID(MyInternationalizationString.logicathomegarrison); |
| | | case "0": |
| | | { |
| | | if (conditions["ModeId"] == "1") |
| | | { |
| | | conditionIcon.UnSelectedImagePath = "ZigeeLogic/athome.png"; |
| | | securitystatus.Text = Language.StringByID(MyInternationalizationString.logicathomegarrison); |
| | | |
| | | } |
| | | else |
| | | { |
| | | conditionIcon.UnSelectedImagePath = "ZigeeLogic/leavehome.png"; |
| | | securitystatus.Text = Language.StringByID(MyInternationalizationString.logicremovehomegarrison); |
| | | |
| | | } |
| | | } |
| | | else |
| | | { |
| | | conditionIcon.UnSelectedImagePath = "ZigeeLogic/leavehome.png"; |
| | | securitystatus.Text = Language.StringByID(MyInternationalizationString.logicremovehomegarrison); |
| | | } |
| | | } |
| | | break; |
| | | case "1": |
| | | { |
| | | conditionIcon.UnSelectedImagePath = "ZigeeLogic/withdrawal.png"; |
| | | securitystatus.Text = Language.StringByID(MyInternationalizationString.withdrawal); |
| | | } |
| | | break; |
| | | case "2": |
| | | { |
| | | conditionIcon.UnSelectedImagePath = "ZigeeLogic/withdrawal.png"; |
| | | securitystatus.Text = Language.StringByID(MyInternationalizationString.urgentwithdrawal); |
| | | } |
| | | break; |
| | | } |
| | | |
| | | } |
| | | break; |
| | | case 7: |
| | |
| | | conditionIcon.UnSelectedImagePath = "ZigeeLogic/position.png"; |
| | | var btnlocation = new Button |
| | | { |
| | | Width = Application.GetRealWidth(700), |
| | | Width = Application.GetRealWidth(250), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Gravity = Gravity.CenterVertical, |
| | | TextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | |
| | | |
| | | var locationstatus = new Button |
| | | { |
| | | Width = Application.GetRealWidth(300), |
| | | Width = Application.GetRealWidth(550), |
| | | Height = Application.GetRealHeight(130), |
| | | Gravity = Gravity.CenterVertical, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | X = Application.GetRealWidth(500), |
| | | X = Application.GetRealWidth(250), |
| | | TextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | TextSize = 14, |
| | | }; |
| | |
| | | //本地没有存在; |
| | | if (sceneinof == null) |
| | | { |
| | | //在网关查找该场景; |
| | | sceneinof =await Send.GetScene(int.Parse(actions["DeviceAddr"].ToString())); |
| | | //网关没有存在; |
| | | if (sceneinof == null) |
| | | { |
| | | |
| | | //注解:本地和网关都不存在该场景,界面将不会显示该场景; |
| | | //sceneinof = new SceneUI(); |
| | | //移除该场景数据; |
| | | Common.Logic.CurrentLogic.Actions.Remove(actions); |
| | | //移除该场景视图; |
| | | devicesFrameLayout.RemoveFromParent(); |
| | | 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"; |
| | |
| | | btncustompush.MouseUpEventHandler += customclick; |
| | | custompushback.MouseUpEventHandler += customclick; |
| | | custompushRowLayout.MouseUpEventHandler += customclick; |
| | | bool tag = false;//标记开关状态; |
| | | btnswitch.MouseUpEventHandler += (sender1, e1) => |
| | | { |
| | | btnswitch.IsSelected = !btnswitch.IsSelected; |
| | | if (btnswitch.IsSelected) |
| | | { |
| | | custompushFrameLayout.Height = Application.GetRealHeight(160); |
| | | } |
| | | else |
| | | { |
| | | custompushFrameLayout.Height = Application.GetRealHeight(0); |
| | | } |
| | | }; |
| | | { |
| | | btnswitch.IsSelected = !btnswitch.IsSelected; |
| | | if (btnswitch.IsSelected) |
| | | { |
| | | tag = true; |
| | | custompushFrameLayout.Height = Application.GetRealHeight(160); |
| | | if (Common.Logic.CurrentLogic.LogicId != 0) |
| | | { |
| | | Send.Data("添加/更新", "/App/HomeLogicConfig", "POST"); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | tag = false; |
| | | custompushFrameLayout.Height = Application.GetRealHeight(0); |
| | | if (Common.Logic.CurrentLogic.LogicId != 0) |
| | | { |
| | | Send.Data("删除", "/App/DelHomeLogicConfig", "POST"); |
| | | } |
| | | |
| | | } |
| | | }; |
| | | #endregion |
| | | |
| | | |
| | | var saveFrameLayout = new FrameLayout |
| | | { |
| | | Y = middle.Bottom, |
| | | Height = Application.GetRealHeight(180), |
| | | BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | | }; |
| | | this.AddChidren(saveFrameLayout); |
| | | |
| | | var btnsave = new Button |
| | | { |
| | | X = Application.GetRealWidth(85), |
| | | Height = Application.GetRealHeight(130),//194 |
| | | Width = Application.GetRealWidth(910), |
| | | Radius = (uint)Application.GetRealHeight(60), |
| | | BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor, |
| | | TextID = MyInternationalizationString.Save, |
| | | TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor, |
| | | TextSize=16, |
| | | }; |
| | | saveFrameLayout.AddChidren(btnsave); |
| | | |
| | | btnsave.MouseUpEventHandler += async (sender, e) => |
| | | { |
| | | var name = logicTextBox.Text.Trim(); |
| | |
| | | new Alert(Language.StringByID(MyInternationalizationString.Tip), Language.StringByID(MyInternationalizationString.PleaseEnterLogicName), Language.StringByID(MyInternationalizationString.Close)).Show(); |
| | | return; |
| | | } |
| | | var logicname = Common.Logic.LogicList.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.LogicList.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; |
| | | bool succeed = false; |
| | |
| | | succeed = true; |
| | | Common.Logic.CurrentLogic.LogicId = logicifon.LogicId; |
| | | Common.Logic.LogicList.Add(Common.Logic.CurrentLogic); |
| | | if (tag) |
| | | { |
| | | Send.Data("添加/更新", "/App/HomeLogicConfig", "POST"); |
| | | } |
| | | } |
| | | } |
| | | else |
| | |
| | | { IsBackground = true }.Start(); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |