| | |
| | | topView.setBtn.Visible = true; |
| | | topView.clickSetBtn.Visible = true; |
| | | } |
| | | |
| | | |
| | | |
| | | VerticalScrolViewLayout viewLayout = new VerticalScrolViewLayout |
| | | { |
| | |
| | | titleCondition.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight); |
| | | titleCondition.btnText.TextID = StringId.andCondition; |
| | | viewLayout.AddChidren(titleCondition.FLayoutView()); |
| | | |
| | | |
| | | if (Logic.currlogic.relation == "and") |
| | | { |
| | | titleCondition.btnText.Text = Language.StringByID(StringId.andCondition); |
| | |
| | | LogicView.LogicAddView addOutputIcon = new LogicView.LogicAddView(); |
| | | addOutputIcon.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerBottomRight); |
| | | viewLayout.AddChidren(addOutputIcon.FLayoutView()); |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region 循环方式 |
| | |
| | | cyclicTitle.frameLayout.Radius = (uint)Application.GetRealHeight(12); |
| | | cyclicTitle.btnText.Text = MainView.GetWeekText(Logic.currlogic); |
| | | viewLayout.AddChidren(cyclicTitle.FLayoutView()); |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region 执行推送 发送通知 |
| | |
| | | this.AddChidren(saveView.FLayoutView()); |
| | | |
| | | #endregion |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region 界面各种点击事件 |
| | | ///设置图标点击事件 |
| | |
| | | ///保存点击事件 |
| | | saveView.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | Loading loading = new Loading(); |
| | | this.AddChidren(loading); |
| | | HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null; |
| | | if (string.IsNullOrEmpty(Logic.currlogic.userLogicId)) |
| | | { |
| | | List<string> list = new List<string>(); |
| | |
| | | { |
| | | Logic.currlogic.name = logicName; |
| | | Logic.currlogic.sid = LogicMethod.NewSid(); |
| | | //发送新加修改逻辑命令; |
| | | var responsePackNew = Send.AddLogic(Logic.currlogic); |
| | | if (responsePackNew.Code == "0") |
| | | loading.Start(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | Logic.LogicList.Add(Logic.currlogic); |
| | | LogicMethod.RemoveAllView(); |
| | | MainView.MainShow(); |
| | | } |
| | | else |
| | | { |
| | | new LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.saveFail)); |
| | | } |
| | | |
| | | try |
| | | { |
| | | //发送新加逻辑命令; |
| | | responsePackNew = Send.AddLogic(Logic.currlogic); |
| | | |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | loading.Hide(); |
| | | if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") |
| | | { |
| | | |
| | | |
| | | //获取逻辑详细返回是一个数组(object类型转换为数组); |
| | | var jArray = Newtonsoft.Json.Linq.JArray.Parse(responsePackNew.Data.ToString()); |
| | | for (int a = 0; a < jArray.Count; a++) |
| | | { |
| | | var jay = jArray[a]; |
| | | //数据返序列化为Logic对象 |
| | | var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay); |
| | | var logic = Newtonsoft.Json.JsonConvert.DeserializeObject<Logic>(str); |
| | | if (logic.userLogicId!="") |
| | | { |
| | | //更新云端唯一自动化id; |
| | | Logic.currlogic.userLogicId = logic.userLogicId; |
| | | } |
| | | else |
| | | { |
| | | //自己看的所以不需要支持中英文 |
| | | new LogicView.TipPopView().FlashingBox("没有返回云端唯一自动化id"); |
| | | } |
| | | |
| | | } |
| | | |
| | | Logic.LogicList.Add(Logic.currlogic); |
| | | LogicMethod.RemoveAllView(); |
| | | MainView.MainShow(); |
| | | } |
| | | else |
| | | { |
| | | new LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.saveFail)); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | }); |
| | | |
| | | } |
| | | else |
| | | { |
| | | //发送新加修改逻辑命令; |
| | | var responsePackNew = Send.updateLogic(Logic.currlogic); |
| | | if (responsePackNew.Code == "0") |
| | | loading.Start(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | LogicMethod.RemoveAllView(); |
| | | MainView.MainShow(); |
| | | } |
| | | else |
| | | { |
| | | new LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.saveFail)); |
| | | } |
| | | |
| | | try |
| | | { |
| | | //发送修改逻辑命令; |
| | | responsePackNew = Send.updateLogic(Logic.currlogic); |
| | | |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | loading.Hide(); |
| | | if (responsePackNew != null && responsePackNew.Code == "0") |
| | | { |
| | | LogicMethod.RemoveAllView(); |
| | | MainView.MainShow(); |
| | | } |
| | | else |
| | | { |
| | | new LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.saveFail)); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | } |
| | | |
| | | }; |