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/PublicInterface.cs | 314 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 313 insertions(+), 1 deletions(-)
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs
old mode 100755
new mode 100644
index 16c87a0..18ec0c8
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs
@@ -253,6 +253,294 @@
}
/// <summary>
+ /// 瓒呭嚭5涓厓绱犺鐢ㄦ粦鍔ㄦ帶浠�
+ /// </summary>
+ /// <param name="frame">鏄剧ず鍦ㄥ摢涓晫闈㈢殑鐖舵帶浠�</param>
+ /// <param name="list">鏄剧ず鏁版嵁婧�</param>
+ /// <param name="titleText">鏍囬</param>
+ /// <param name="action">杩斿洖鍊肩储寮曞��</param>
+ public void FrameOrVv(FrameLayout frame, List<string>list, int titleText,Action<int> action) {
+
+ int line = 0;
+ if (list.Count == 0 || list.Count > 5)
+ {
+ //瓒呭嚭5涓彧鑳介粯璁�5涓�;
+ line = 5;
+ }
+ else
+ {
+ line = list.Count;
+ }
+
+ FrameLayout frameLayout = new FrameLayout
+ {
+ BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
+ };
+ frame.AddChidren(frameLayout);
+
+ LogicView.DateView view = new LogicView.DateView();
+ view.btnTitle.TextID = titleText;
+ view.FLayoutView(frameLayout, line);
+ view.btnCancel.MouseUpEventHandler += (sender, e) =>
+ {
+ //绉婚櫎fLayout鐣岄潰
+ frameLayout.RemoveFromParent();
+ };
+ //灏忎簬5浣跨敤
+ FrameLayout frameL = new FrameLayout
+ {
+ Y = Application.GetRealHeight(56),
+ Height = Application.GetRealHeight(50 * line),
+ };
+ //澶т簬5浣跨敤
+ VerticalRefreshLayout verticalRefresh = new VerticalRefreshLayout
+ {
+ Y = Application.GetRealHeight(56),
+ Height = Application.GetRealHeight(50 * 5),
+
+ };
+ verticalRefresh.BeginHeaderRefreshingAction += () =>
+ {
+ //鍏抽棴鍒锋柊View锛�
+ verticalRefresh.EndHeaderRefreshing();
+ };
+
+ if (list.Count == 0)
+ {
+ Button btnTipNot = new Button
+ {
+ X = Application.GetRealWidth(93),
+ Y = Application.GetRealHeight(80),
+ Width = Application.GetRealWidth(158),
+ Height = Application.GetRealWidth(158),
+ UnSelectedImagePath = "TipNot.png",
+
+ };
+ view.frameLayout.AddChidren(btnTipNot);
+
+ Button btnTipNotText = new Button()
+ {
+ Y = btnTipNot.Bottom + Application.GetRealHeight(16),
+ Height = Application.GetRealHeight(20),
+ TextID = StringId.secnenull,
+ TextColor = CSS.CSS_Color.textColor,
+ TextSize = LogicView.TextSize.text14,
+ TextAlignment = TextAlignment.Center,
+ };
+ view.frameLayout.AddChidren(btnTipNotText);
+ }
+ else if (list.Count > 0 && list.Count <= 5)
+ {
+ view.frameLayout.AddChidren(frameL);
+ }
+ else if (list.Count > 5)
+ {
+ view.frameLayout.AddChidren(verticalRefresh);
+
+ }
+ ///瀹氫箟涓�涓狟tn璁板綍閫変腑鐘舵��
+ Button checkBtn = new Button
+ {
+ Tag = "unknown",
+ };
+ for (int i = 0; i < list.Count; i++)
+ {
+ string strName = list[i];
+ LogicView.CheckView checkView = new LogicView.CheckView();
+ checkView.btnText.TextSize = LogicView.TextSize.text14;
+ if (list.Count <= 5)
+ {
+ checkView.frameLayout.Y = Application.GetRealWidth(i * 50);
+ frameL.AddChidren(checkView.FLayoutView());
+ if (line - 1 == i)
+ {
+ checkView.btnLine.BackgroundColor = CSS.CSS_Color.view;
+ }
+ }
+ else
+ {
+ verticalRefresh.AddChidren(checkView.FLayoutView());
+ }
+ checkView.btnText.Text = strName;
+ checkView.btnClick.Tag = i;//鏍囪
+ //鐐瑰嚮浜嬩欢
+ checkView.btnClick.MouseUpEventHandler += (sender1, e1) =>
+ {
+ checkBtn.IsSelected = false;
+ checkView.btnCheckIcon.IsSelected = true;
+ checkBtn = checkView.btnCheckIcon;
+ checkBtn.Tag = checkView.btnClick.Tag.ToString();
+ };
+
+ }
+ view.btnConfirm.MouseUpEventHandler += (sender1, e1) =>
+ {
+ if (checkBtn.Tag.ToString() == "unknown")
+ {
+ return;
+ }
+ //鍒楄〃绱㈠紩鍊�
+ int indexValue = int.Parse(checkBtn.Tag.ToString());
+ action(indexValue);
+ //绉婚櫎fLayout鐣岄潰
+ frameLayout.RemoveFromParent();
+ };
+
+ }
+
+ /// <summary>
+ /// 瓒呭嚭5涓厓绱犺鐢ㄦ粦鍔ㄦ帶浠�
+ /// </summary>
+ /// <param name="frame">鏄剧ず鍦ㄥ摢涓晫闈㈢殑鐖舵帶浠�</param>
+ /// <param name="list">鏄剧ず鏁版嵁婧�</param>
+ /// <param name="stateList">涔嬪墠鐘舵�佹暟鎹簮</param>
+ /// <param name="titleText">鏍囬</param>
+ /// <param name="action">杩斿洖鍊肩储寮曞��</param>
+ public void FrameOrVvList(FrameLayout frame, List<string> list,List<string>stateList, int titleText, Action<List<string>> action)
+ {
+
+ int line = 0;
+ if (list.Count == 0 || list.Count > 5)
+ {
+ //瓒呭嚭5涓彧鑳介粯璁�5涓�;
+ line = 5;
+ }
+ else
+ {
+ line = list.Count;
+ }
+
+ FrameLayout frameLayout = new FrameLayout
+ {
+ BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
+ };
+ frame.AddChidren(frameLayout);
+
+ LogicView.DateView view = new LogicView.DateView();
+ view.btnTitle.TextID = titleText;
+ view.FLayoutView(frameLayout, line);
+ view.btnCancel.MouseUpEventHandler += (sender, e) =>
+ {
+ //绉婚櫎fLayout鐣岄潰
+ frameLayout.RemoveFromParent();
+ };
+ //灏忎簬5浣跨敤
+ FrameLayout frameL = new FrameLayout
+ {
+ Y = Application.GetRealHeight(56),
+ Height = Application.GetRealHeight(50 * line),
+ };
+ //澶т簬5浣跨敤
+ VerticalRefreshLayout verticalRefresh = new VerticalRefreshLayout
+ {
+ Y = Application.GetRealHeight(56),
+ Height = Application.GetRealHeight(50 * 5),
+
+ };
+ verticalRefresh.BeginHeaderRefreshingAction += () =>
+ {
+ //鍏抽棴鍒锋柊View锛�
+ verticalRefresh.EndHeaderRefreshing();
+ };
+
+ if (list.Count == 0)
+ {
+ //Button btnTipNot = new Button
+ //{
+ // X = Application.GetRealWidth(93),
+ // Y = Application.GetRealHeight(80),
+ // Width = Application.GetRealWidth(158),
+ // Height = Application.GetRealWidth(158),
+ // UnSelectedImagePath = "TipNot.png",
+
+ //};
+ //view.frameLayout.AddChidren(btnTipNot);
+
+ //Button btnTipNotText = new Button()
+ //{
+ // Y = btnTipNot.Bottom + Application.GetRealHeight(16),
+ // Height = Application.GetRealHeight(20),
+ // TextID = StringId.secnenull,
+ // TextColor = CSS.CSS_Color.textColor,
+ // TextSize = LogicView.TextSize.text14,
+ // TextAlignment = TextAlignment.Center,
+ //};
+ //view.frameLayout.AddChidren(btnTipNotText);
+ }
+ else if (list.Count > 0 && list.Count <= 5)
+ {
+ view.frameLayout.AddChidren(frameL);
+ }
+ else if (list.Count > 5)
+ {
+ view.frameLayout.AddChidren(verticalRefresh);
+
+ }
+ List<string> selecetdList = new List<string>();
+ for (int i = 0; i < list.Count; i++)
+ {
+ string strName = list[i];
+ LogicView.CheckView checkView = new LogicView.CheckView();
+ checkView.btnText.TextSize = LogicView.TextSize.text14;
+ if (list.Count <= 5)
+ {
+ checkView.frameLayout.Y = Application.GetRealWidth(i * 50);
+ frameL.AddChidren(checkView.FLayoutView());
+ if (line - 1 == i)
+ {
+ checkView.btnLine.BackgroundColor = CSS.CSS_Color.view;
+ }
+ }
+ else
+ {
+ verticalRefresh.AddChidren(checkView.FLayoutView());
+ }
+ if (stateList.Contains(strName)) {
+ checkView.btnClick.IsSelected = true;
+ checkView.btnCheckIcon.IsSelected = true;
+ selecetdList.Add(strName);
+ }
+ checkView.btnText.Text = strName;
+ checkView.btnClick.Tag = strName;//鏍囪
+ //鐐瑰嚮浜嬩欢
+ checkView.btnClick.MouseUpEventHandler += (sender1, e1) =>
+ {
+ checkView.btnClick.IsSelected = !checkView.btnClick.IsSelected;
+ checkView.btnCheckIcon.IsSelected = checkView.btnClick.IsSelected;
+ if (checkView.btnClick.IsSelected)
+ {
+ if (!selecetdList.Contains(checkView.btnClick.Tag.ToString()))
+ {
+ selecetdList.Add(checkView.btnClick.Tag.ToString());
+ }
+
+ }
+ else
+ {
+ if (selecetdList.Contains(checkView.btnClick.Tag.ToString()))
+ {
+ selecetdList.Remove(checkView.btnClick.Tag.ToString());
+ }
+ }
+ };
+
+ }
+ view.btnConfirm.MouseUpEventHandler += (sender1, e1) =>
+ {
+ if (selecetdList.Count == 0)
+ {
+ return;
+ }
+ //鍒楄〃绱㈠紩鍊�
+ action(selecetdList);
+ //绉婚櫎fLayout鐣岄潰
+ frameLayout.RemoveFromParent();
+ };
+
+ }
+
+
+ /// <summary>
/// 鑾峰彇鐣岄潰鍒楄〃
/// </summary>
/// <param name="isStr">鑷繁瀹氫箟鑷繁鐢�</param>
@@ -314,6 +602,28 @@
};
}
break;
+ case "time":
+ {
+ list = new List<string> {
+ "30 s",
+ "1 min",
+ "2 min",
+ "3 min",
+ "5 min",
+ };
+ }
+ break;
+ case "pm2.5":
+ {
+ list = new List<string> {
+ Language.StringByID(StringId.pmyou),
+ Language.StringByID(StringId.pmliang),
+ Language.StringByID(StringId.pmqingdu),
+ Language.StringByID(StringId.pmzhongdu),
+ Language.StringByID(StringId.pmzhongduwuran),
+ };
+ }
+ break;
}
return list;
@@ -321,7 +631,7 @@
/// <summary>
/// 妯″紡/椋庨�熶簰鐩歌浆鎹㈠�肩殑鏂规硶
/// </summary>
- /// <param name="text"></param>
+ /// <param name="text">鏂囨湰</param>
/// <param name="type">鑷繁瀹氫箟鑷繁鐢�</param>
/// <returns></returns>
public string GetModeValueString(string text, string type)
@@ -488,5 +798,7 @@
return stateList;
}
+
+
}
}
--
Gitblit v1.8.0