wei
2021-08-27 eda3fb873e59544ff36301b51e05aef64f87b0f9
HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs
@@ -52,6 +52,9 @@
            viewLayout.AddChidren(addInputTextView.FLayoutView(46, 12));
            ///满足以下条件的View
            LogicView.LogicTypeTitleView titleCondition = new LogicView.LogicTypeTitleView();
            titleCondition.btnText.Width = Application.GetRealWidth(300);
            titleCondition.btnText.Height = Application.GetRealHeight(28);
            titleCondition.btnText.IsMoreLines = true;
            titleCondition.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
            titleCondition.btnText.TextID = StringId.andCondition;
            viewLayout.AddChidren(titleCondition.FLayoutView());
@@ -235,6 +238,10 @@
                    new LogicView.TipPopView().TipBox(StringId.tip, StringId.targetNull);
                    return;
                }
                Loading loading = new Loading();
                this.AddChidren(loading);
                HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null;
@@ -249,15 +256,17 @@
                        ) =>
                    {
                        Logic.currlogic.name = logicName;
                        Logic.currlogic.sid = LogicMethod.NewSid();
                        Logic.currlogic.sid = LogicMethod.CurrLogicMethod.NewSid();
                        loading.Start();
                        new System.Threading.Thread(() =>
                        {
                            try
                            {
                                //发送新加逻辑命令;
                                responsePackNew = Send.AddLogic(Logic.currlogic);
                                if (!MainPage.NoLoginMode)
                                {
                                    //发送新加逻辑命令;
                                    responsePackNew = Send.AddLogic(Logic.currlogic);
                                }
                            }
                            catch { }
@@ -266,10 +275,16 @@
                                Application.RunOnMainThread(() =>
                                {
                                    loading.Hide();
                                    if(MainPage.NoLoginMode)
                                    {
                                        Logic.LogicList.Add(Logic.currlogic);
                                        LogicMethod.CurrLogicMethod.RemoveAllView();
                                        MainView.MainShow();
                                        return;
                                    }
                                    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++)
@@ -292,7 +307,7 @@
                                        }
                                        Logic.LogicList.Add(Logic.currlogic);
                                        LogicMethod.RemoveAllView();
                                        LogicMethod.CurrLogicMethod.RemoveAllView();
                                        MainView.MainShow();
                                    }
                                    else if (responsePackNew != null && responsePackNew.Code == "14005")
@@ -332,7 +347,7 @@
                                loading.Hide();
                                if (responsePackNew != null && responsePackNew.Code == "0")
                                {
                                    LogicMethod.RemoveAllView();
                                    LogicMethod.CurrLogicMethod.RemoveAllView();
                                    MainView.MainShow();
                                }
                                else if (responsePackNew != null && responsePackNew.Code == "14005")