From 6eb21769c74cfcd10084f73ff3f212355849a3c7 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期一, 17 五月 2021 15:00:13 +0800
Subject: [PATCH] 2021-5-17-2
---
HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs | 149 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 149 insertions(+), 0 deletions(-)
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs
new file mode 100644
index 0000000..442dae4
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs
@@ -0,0 +1,149 @@
+锘縰sing System;
+using System.Collections.Generic;
+using Shared;
+namespace HDL_ON.UI.UI2.Intelligence.Automation
+{
+ public class Set:FrameLayout
+ {
+ public Set()
+ {
+ Tag = "Logic";
+ }
+
+ public void Show()
+ {
+
+ this.BackgroundColor = CSS.CSS_Color.viewMiddle;
+ LogicView.TopView topView = new LogicView.TopView();
+ this.AddChidren(topView.FLayoutView());
+ topView.clickBackBtn.MouseUpEventHandler += (e, sen) =>
+ {
+ RemoveFromParent();
+ };
+ topView.topNameBtn.TextID = StringId.setlogic;
+ FrameLayout viewLayout = new FrameLayout
+ {
+ Y = Application.GetRealHeight(64),
+ Width = Application.GetRealWidth(LogicView.TextSize.view375),
+ Height = Application.GetRealHeight(LogicView.TextSize.view667 - 64 - 76),
+ BackgroundColor = CSS.CSS_Color.viewMiddle,
+ };
+ this.AddChidren(viewLayout);
+
+ LogicView.SelectTypeView nameView = new LogicView.SelectTypeView();
+ nameView.btnText.X = Application.GetRealWidth(16);
+ nameView.btnText.Height = Application.GetRealHeight(22);
+ nameView.btnText.TextID = StringId.namelogic;
+ nameView.btnIcon.Visible = false;
+ nameView.btnNextIcon.Height = Application.GetRealWidth(28);
+ nameView.btnNextIcon.Width = Application.GetRealWidth(28);
+ nameView.btnNextIcon.UnSelectedImagePath = "LogicIcon/editname.png";
+ viewLayout.AddChidren(nameView.FLayoutView());
+
+ Button btnAutomationName = new Button
+ {
+ TextSize = LogicView.TextSize.text14,
+ Width = Application.GetRealWidth(375 - 40 - 52),
+ Height = Application.GetRealHeight(20),
+ TextColor = CSS.CSS_Color.textCancelColor,
+ X = Application.GetRealWidth(40),
+ Gravity = Gravity.CenterVertical,
+ TextAlignment = TextAlignment.CenterRight,
+ Text =Logic.currlogic.name,
+ };
+ nameView.frameLayout.AddChidren(btnAutomationName);
+
+
+ EventHandler<MouseEventArgs> editClick = (sender, e) =>
+ {
+ List<string> list = new List<string>();
+ foreach (var logic in Logic.LogicList) {
+ list.Add(logic.name);
+ }
+
+ new LogicView.TipPopView().InputBox(StringId.editName, Logic.currlogic.name, StringId.nameNull, StringId.NameAlreadyExists, list, (logicName,view
+ ) =>
+ {
+ btnAutomationName.Text = logicName;
+ Logic.currlogic.name = logicName;
+
+ },()=> { });
+ };
+ nameView.btnClick.MouseUpEventHandler += editClick;
+ btnAutomationName.MouseUpEventHandler += editClick;
+
+
+ #region 鍒犻櫎
+ FrameLayout frameLayout = new FrameLayout
+ {
+ Y = Application.GetRealHeight(LogicView.TextSize.view667 - 50),
+ Height = Application.GetRealHeight(50),
+ BackgroundColor = CSS.CSS_Color.view,
+ Gravity = Gravity.BottomCenter,//缃簳鐨勫睘鎬�
+ };
+ this.AddChidren(frameLayout);
+ Button btnDel = new Button
+ {
+ TextSize = LogicView.TextSize.text16,
+ Width = Application.GetRealWidth(50),
+ Height = Application.GetRealHeight(22),
+ TextColor = CSS.CSS_Color.textRedColor,
+ Gravity = Gravity.Center,
+ TextID = StringId.Del,
+ };
+ frameLayout.AddChidren(btnDel);
+
+
+ EventHandler<MouseEventArgs> delClick = (sender, e) =>
+ {
+ Loading loading = new Loading();
+ this.AddChidren(loading);
+ HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null;
+ new LogicView.TipPopView().TipBox(StringId.tip, StringId.delAutomation, () =>
+ {
+ loading.Start();
+ new System.Threading.Thread(() =>
+ {
+ try
+ {
+ //鍙戦�佸垹闄ら�昏緫鍛戒护锛�
+ responsePackNew = Send.DelLogic(Logic.currlogic);
+
+ }
+ catch { }
+ finally
+ {
+ Application.RunOnMainThread(() =>
+ {
+ loading.Hide();
+ if (responsePackNew != null && responsePackNew.Code == "0")
+ {
+ LogicMethod.RemoveAllView();
+ Logic.LogicList.Remove(Logic.currlogic);
+ MainView.MainShow();
+ //鍙戦�佸垹闄ら�昏緫鍛戒护锛�
+ }
+ else if (responsePackNew != null && responsePackNew.Code == "14005")
+ {
+ new LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.gatewayNotOnline));
+ }
+ else
+ {
+ new LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.delFail));
+ }
+ });
+ }
+
+ })
+ { IsBackground = true }.Start();
+
+ });
+
+ };
+ btnDel.MouseUpEventHandler += delClick;
+ frameLayout.MouseUpEventHandler += delClick;
+ #endregion
+
+ }
+ }
+}
--
Gitblit v1.8.0