| | |
| | | Tag = "Logic"; |
| | | } |
| | | 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) |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | { |
| | | int minute = int.Parse(conditions["IgnoreTime"]) / 60; |
| | | int second = int.Parse(conditions["IgnoreTime"]) % 60; |
| | | if (second != 0) |
| | | if (minute != 0 && second != 0) |
| | | { |
| | | devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.minute) + second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.unattendedtime1); |
| | | |
| | | } |
| | | else |
| | | { |
| | | devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.Minute) + Language.StringByID(MyInternationalizationString.unattendedtime1); |
| | | if (minute == 0 && second != 0) |
| | | { |
| | | 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.unattendedtime1); |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | case 21: |
| | | case 22: |
| | | { |
| | | conditionIcon.UnSelectedImagePath = "ZigeeLogic/doormagnetism.png"; |
| | | if (intvalue == "1") |
| | | { |
| | | devicestatus.TextID = MyInternationalizationString.logicopen; |
| | |
| | | |
| | | int minute = int.Parse(conditions["IgnoreTime"]) / 60; |
| | | int second = int.Parse(conditions["IgnoreTime"]) % 60; |
| | | if (second != 0) |
| | | if (minute != 0 && second != 0) |
| | | { |
| | | devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.minute) + second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.closetime); |
| | | |
| | | } |
| | | else |
| | | { |
| | | devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.Minute) + Language.StringByID(MyInternationalizationString.closetime); |
| | | if (minute == 0 && second != 0) |
| | | { |
| | | devicestatus.Text = second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.closetime); |
| | | |
| | | } |
| | | if (minute != 0 && second == 0) |
| | | { |
| | | devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.Minute) + Language.StringByID(MyInternationalizationString.closetime); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | break; |
| | | case 40: |
| | | { |
| | | conditionIcon.UnSelectedImagePath = "ZigeeLogic/smoke.png"; |
| | | if (intvalue == "1") |
| | | { |
| | | devicestatus.TextID = MyInternationalizationString.smokescreen; |
| | |
| | | break; |
| | | case 42: |
| | | { |
| | | conditionIcon.UnSelectedImagePath = "ZigeeLogic/waterleakage.png"; |
| | | if (intvalue == "1") |
| | | { |
| | | devicestatus.TextID = MyInternationalizationString.waterleakage; |
| | |
| | | break; |
| | | case 43: |
| | | { |
| | | conditionIcon.UnSelectedImagePath = "ZigeeLogic/gas.png"; |
| | | if (intvalue == "1") |
| | | { |
| | | devicestatus.TextID = MyInternationalizationString.gas; |
| | |
| | | break; |
| | | case 277: |
| | | { |
| | | conditionIcon.UnSelectedImagePath = "ZigeeLogic/waterleakage.png"; |
| | | if (intvalue == "1") |
| | | { |
| | | devicestatus.TextID = MyInternationalizationString.callthepolice; |
| | |
| | | break; |
| | | default: |
| | | { |
| | | conditionIcon.UnSelectedImagePath = "ZigeeLogic/infraredsensor.png"; |
| | | if (intvalue == "1") |
| | | { |
| | | devicestatus.TextID = MyInternationalizationString.callthepolice; |
| | |
| | | } |
| | | break; |
| | | case DeviceType.TemperatureSensor: |
| | | // conditionIcon.UnSelectedImagePath = "ZigeeLogic/temperature.png"; |
| | | // conditionIcon.UnSelectedImagePath = "ZigeeLogic/temperature.png"; |
| | | var dev = deviceinof as TemperatureSensor; |
| | | if (conditions["Cluster_ID"]=="1026") { |
| | | if (conditions["Cluster_ID"] == "1026") |
| | | { |
| | | dev.SensorDiv = 1; |
| | | } else { |
| | | } |
| | | else |
| | | { |
| | | dev.SensorDiv = 2; |
| | | } |
| | | string s = ""; |
| | | switch (conditions["Range"]) |
| | | { |
| | | case "0": |
| | | { |
| | | s = ">"; |
| | | } |
| | | break; |
| | | case "1": |
| | | { |
| | | s = "="; |
| | | } |
| | | break; |
| | | case "2": |
| | | { |
| | | s = "<"; |
| | | } |
| | | break; |
| | | case "6": |
| | | { |
| | | s = "≥"; |
| | | } |
| | | break; |
| | | case "7": |
| | | { |
| | | s = "≤"; |
| | | } |
| | | break; |
| | | } |
| | | if (conditions["Cluster_ID"] == "1026") |
| | | { |
| | | conditionIcon.UnSelectedImagePath = "ZigeeLogic/temperature.png"; |
| | | devicestatus.Text = ">" + conditions["AttriButeData1"] + "℃"; |
| | | devicestatus.Text = s + conditions["AttriButeData1"] + "℃"; |
| | | } |
| | | else |
| | | { |
| | | conditionIcon.UnSelectedImagePath = "ZigeeLogic/humidity.png"; |
| | | devicestatus.Text = "<" + conditions["AttriButeData1"] + "%"; |
| | | devicestatus.Text = s + conditions["AttriButeData1"] + "%"; |
| | | } |
| | | break; |
| | | |
| | |
| | | }; |
| | | 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, |
| | | }; |
| | |
| | | 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 logicCommunalPage = new LogicCommunalPage(); |
| | | UserView.HomePage.Instance.AddChidren(logicCommunalPage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | logicCommunalPage.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 logicCommunalPage = new LogicCommunalPage(); |
| | | UserView.HomePage.Instance.AddChidren(logicCommunalPage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | logicCommunalPage.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 |
| | | var btndevicename = new Button |
| | | { |
| | |
| | | { |
| | | continue; |
| | | } |
| | | string modetext = "", temperaturetext="", speedtext = ""; |
| | | string modetext = "", temperaturetext = "", speedtext = ""; |
| | | 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; |
| | | //如果空调状态是关;直接跳出for循坏; |
| | | break; |
| | | } |
| | | 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:除湿) |
| | |
| | | break; |
| | | 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"; |
| | |
| | | Common.Room room = new Common.Room(); |
| | | btnregionname.Text = room.GetRoomNameBySceneId(sceneinof.Id); |
| | | //Send.RoomNmae(btnregionname, deviceinof); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | 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) => |
| | | var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm, |
| | | Language.StringByID(MyInternationalizationString.doyouwanttodelete), |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | alert.ConfirmClickEvent += () => |
| | | { |
| | | if (e1) |
| | | { |
| | | Common.Logic.CurrentLogic.Actions.Remove(actions); |
| | | var logicCommunalPage = new LogicCommunalPage(); |
| | | UserView.HomePage.Instance.AddChidren(logicCommunalPage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | logicCommunalPage.Show(() => { }); |
| | | } |
| | | Common.Logic.CurrentLogic.Actions.Remove(actions); |
| | | // devicesFrameLayout.RemoveFromParent(); |
| | | var logicCommunalPage = new LogicCommunalPage(); |
| | | UserView.HomePage.Instance.AddChidren(logicCommunalPage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | logicCommunalPage.Show(() => { }); |
| | | }; |
| | | alert.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); |
| | |
| | | btncustompush.MouseUpEventHandler += customclick; |
| | | custompushback.MouseUpEventHandler += customclick; |
| | | custompushRowLayout.MouseUpEventHandler += customclick; |
| | | 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; |
| | | if (Common.Logic.CurrentLogic.LogicId != 0) |
| | | { |
| | | Send.Data("添加/更新", "/App/HomeLogicConfig", "POST"); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | tag = false; |
| | | custompushFrameLayout.Height = Application.GetRealHeight(0); |
| | | Common.Logic.CurrentLogic.LogicIsCustomPushText = 0; |
| | | if (Common.Logic.CurrentLogic.LogicId != 0) |
| | | { |
| | | Send.Data("删除", "/App/DelHomeLogicConfig", "POST"); |
| | | } |
| | | |
| | | } |
| | | }; |
| | | if (Common.Logic.CurrentLogic.LogicIsCustomPushText == 0) |
| | | { |
| | | btnswitch.IsSelected = false; |
| | | } |
| | | else |
| | | { |
| | | btnswitch.IsSelected = true; |
| | | } |
| | | #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(); |
| | | 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.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; |
| | | //判断是新添加逻辑(默认0)还是修改逻辑 |
| | | CommonPage.Loading.Start(); |
| | | if (Common.Logic.CurrentLogic.LogicId == 0) |
| | |
| | | var logicifon = await Send.AddModifyLogic(Common.Logic.CurrentLogic); |
| | | if (logicifon != null && logicifon.LogicId != 0) |
| | | { |
| | | succeed = true; |
| | | Common.Logic.CurrentLogic.LogicId = logicifon.LogicId; |
| | | Common.Logic.LogicList.Add(Common.Logic.CurrentLogic); |
| | | if (tag) |
| | | { |
| | | Send.Data("添加/更新", "/App/HomeLogicConfig", "POST"); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //发送修改逻辑命令 |
| | | Send.AddModifyLogic(Common.Logic.CurrentLogic); |
| | | var modlogic=Send.AddModifyLogic(Common.Logic.CurrentLogic); |
| | | //编辑默认成功(不考虑网络情况); |
| | | succeed = true; |
| | | } |
| | | |
| | | CommonPage.Loading.Hide(); |
| | | |
| | | if (!succeed)//succeed标记是添加成功还是失败 |
| | | { |
| | | //网关回复失败,不关闭界面,让它停留当前界面; |
| | | //(原因:考虑到失败重新编辑原来数据给用户带来了麻烦) |
| | | ///提示:添加自动化失败; |
| | | //TipView("添加自动化失败"); |
| | | //return; |
| | | } |
| | | UserView.HomePage.Instance.RemoveViewByTag("Logic"); |
| | | Category.Category.instance?.RefreshBodyView(); |
| | | |
| | |
| | | Radius = (uint)Application.GetRealHeight(60), |
| | | }; |
| | | flMain.AddChidren(framelayout); |
| | | framelayout.SetCornerWithSameRadius(20,HDLUtils.RectCornerTopLeft|HDLUtils.RectCornerTopRight); |
| | | framelayout.SetCornerWithSameRadius(Application.GetRealHeight(58),HDLUtils.RectCornerTopLeft|HDLUtils.RectCornerTopRight); |
| | | |
| | | #region -------取消 完成 |
| | | var timetype = new RowLayout |
| | |
| | | }; |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 闪现式提示框的方法 |
| | | /// </summary> |
| | | /// <param name="tipText">提示内容</param> |
| | | /// <param name="second">停留时间单位为s</param> |
| | | public void TipView(string tipText, int second = 1) |
| | | { |
| | | |
| | | var frameLayout = new FrameLayout { BackgroundColor = 0x50000000 }; |
| | | this.AddChidren(frameLayout); |
| | | |
| | | var btn = new Button |
| | | { |
| | | Gravity = Gravity.Center, |
| | | Text = tipText, |
| | | BackgroundColor = 0xff1f1f1f, |
| | | Width = Application.GetRealWidth(500), |
| | | Height = Application.GetRealHeight(100), |
| | | Radius = (uint)Application.GetRealHeight(50), |
| | | }; |
| | | frameLayout.AddChidren(btn); |
| | | |
| | | var dateTime1 = DateTime.Now; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | while (true) |
| | | { |
| | | if ((DateTime.Now - dateTime1).TotalMilliseconds > second * 1000) |
| | | { |
| | | //默认一秒关闭 |
| | | frameLayout.RemoveFromParent(); |
| | | break; |
| | | } |
| | | } |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |