From a46cd0adb5af29e8a9cf47c219475acaedfcf839 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 01 十二月 2020 17:09:00 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/WJC' --- HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TimeView.cs | 269 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 269 insertions(+), 0 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TimeView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TimeView.cs new file mode 100644 index 0000000..0fd5f05 --- /dev/null +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TimeView.cs @@ -0,0 +1,269 @@ +锘縰sing System; +using Shared; +using System.Collections.Generic; +namespace HDL_ON.UI.UI2.Intelligence.Automation.LogicView +{ + public class TimeView + { + /// <summary> + /// 涓绘帶浠� + /// </summary> + public FrameLayout frameLayout = new FrameLayout + { + Y = Application.GetRealHeight(350), + Height = Application.GetRealHeight(297), + Width = Application.GetRealWidth(343), + X = Application.GetRealWidth(16), + BackgroundColor = CSS.CSS_Color.view, + Radius=(uint)Application.GetRealHeight(12), + }; + /// <summary> + /// 鏃堕棿鎺т欢UIPickerView + /// </summary> + public UIPickerView mUIPickerView = new UIPickerView + { + //Y = Application.GetRealHeight(44), + Height = Application.GetRealHeight(297), + Width = Application.GetRealWidth(343), + BackgroundColor = CSS.CSS_Color.viewTranslucence, + + }; + /// <summary> + /// 鍙栨秷Btn + /// </summary> + public Button btnCancel = new Button + { + TextID = StringId.cancelSelected, + TextSize = TextSize.text14, + TextColor = CSS.CSS_Color.textCancelColor, + Width = Application.GetRealWidth(52), + Height = Application.GetRealHeight(32), + Y = Application.GetRealHeight(6), + X = Application.GetRealWidth(8) + }; + /// <summary> + /// 纭畾Btn + /// </summary> + public Button btnConfirm = new Button + { + TextID = StringId.confirmSelected, + TextSize = TextSize.text14, + TextColor = CSS.CSS_Color.textConfirmColor, + Width = Application.GetRealWidth(52), + Height = Application.GetRealHeight(32), + X = Application.GetRealWidth(283), + Y = Application.GetRealHeight(6), + }; + /// <summary> + /// 绾� + /// </summary> + public Button btnLine = new Button + { + BackgroundColor = CSS.CSS_Color.viewLine, + Width = Application.GetRealWidth(343), + Height = 1, + Y = Application.GetRealWidth(44) + }; + /// <summary> + /// 鏃堕棿View鐨勬柟娉� + /// </summary> + /// <returns></returns> + public void FLayoutView(FrameLayout fLayout) + { + frameLayout.AddChidren(mUIPickerView); + frameLayout.AddChidren(btnCancel); + frameLayout.AddChidren(btnConfirm); + frameLayout.AddChidren(btnLine); + fLayout.AddChidren(frameLayout); + } + /// <summary> + /// 鑾峰彇1-24灏忔椂鍒楄〃 + /// </summary> + /// <returns></returns> + public List<string> GethStringList() + { + //鍒濆鍖栧垪琛� + var hList = new List<string>(); + for (int i = 1; i < 24; i++) + { + if (i < 10) + { + var a = "0" + i.ToString(); + //娣诲姞鏁版嵁 + hList.Add(a + " " + Language.StringByID(StringId.h)); + } + else + { + //娣诲姞鏁版嵁 + hList.Add(i.ToString() + " " + Language.StringByID(StringId.h)); + } + + } + return hList; + + + } + /// <summary> + /// 鑾峰彇0-23灏忔椂鍒楄〃 + /// </summary> + /// <returns></returns> + public List<string> GethStringList0() + { + //鍒濆鍖栧垪琛� + var hList = new List<string>(); + for (int i = 0; i < 23; i++) + { + if (i < 10) + { + var a = "0" + i.ToString(); + //娣诲姞鏁版嵁 + hList.Add(a + " " + Language.StringByID(StringId.h)); + } + else + { + //娣诲姞鏁版嵁 + hList.Add(i.ToString() + " " + Language.StringByID(StringId.h)); + } + + } + return hList; + + + } + /// <summary> + /// 鑾峰彇60鍒嗛挓鍒楄〃 + /// </summary> + /// <returns></returns> + public List<string> GetmStringList() + { + //鍒濆鍖栧垪琛� + var mList = new List<string>(); + for (int i = 0; i < 60; i++) + { + if (i < 10) + { + var a = "0" + i.ToString(); + //娣诲姞鏁版嵁 + mList.Add(a + " " + Language.StringByID(StringId.m)); + } + else + { + //娣诲姞鏁版嵁 + mList.Add(i.ToString() + " " + Language.StringByID(StringId.m)); + } + + } + + return mList; + } + + /// <summary> + /// 鑾峰彇023灏忔椂鍒楄〃 + /// </summary> + /// <returns></returns> + public List<int> GethIntList0() + { + //鍒濆鍖栧垪琛� + var hList = new List<int>(); + for (int i = 1; i < 24; i++) + { + //娣诲姞鏁版嵁 + hList.Add(i); + } + return hList; + + + } + /// <summary> + /// 鑾峰彇24灏忔椂鍒楄〃 + /// </summary> + /// <returns></returns> + public List<int> GethIntList() + { + //鍒濆鍖栧垪琛� + var hList = new List<int>(); + for (int i = 1; i < 24; i++) + { + //娣诲姞鏁版嵁 + hList.Add(i); + } + return hList; + + + } + /// <summary> + /// 鑾峰彇60鍒嗛挓鍒楄〃 + /// </summary> + /// <returns></returns> + public List<int> GetmIntList() + { + //鍒濆鍖栧垪琛� + var mList = new List<int>(); + for (int i = 0; i < 60; i++) + { + //娣诲姞鏁版嵁 + mList.Add(i); + } + return mList; + } + + /// <summary> + /// 杩斿洖鎸囧畾鍗曚綅鍒楄〃 + /// </summary> + /// <param name="min">鏈�灏忓��</param> + /// <param name="max">鏈�澶у��</param> + /// <param name="name">鍗曚綅(鏃讹紝鍒嗭紝绉�)</param> + /// <param name="digit">浣嶆暟(10浠ヤ笅鐢�(1浣嶈繕鏄�2浣�)鏄剧ず)</param> + /// <returns></returns> + public List<string> GetStringList(int min, int max, string name, int digit) + { + //鍒濆鍖栧垪琛� + var list = new List<string>(); + + for (int i = min; i < max; i++) + { + if (i < 10 && digit == 2) + { + var a = "0" + i.ToString(); + //娣诲姞鏁版嵁 + list.Add(a + " " + name); + } + else + { + //娣诲姞鏁版嵁 + list.Add(i.ToString() + " " + name); + } + + } + return list; + } + + /// <summary> + /// 鑾峰彇鏃堕棿鍊� + /// </summary> + /// <param name="str">婧愭暟鎹�</param> + /// <param name="digit">杩斿洖婧愭暟鎹暟缁勯噷闈㈡煇涓�肩储寮�</param> + /// <param name="startIndex"></param> + /// <param name="list"></param> + /// <returns></returns> + public int GetValueIndex(string str, int digit, int startIndex, List<int> list) + { + int index = 0; + int value = 0; + if (str.Contains(":")) + { + value = int.Parse(str.Split(':')[digit]); + } + for (int i = startIndex; i < list.Count; i++) + { + if (value == i) + { + index = i; + break; + } + } + return index; + } + + } +} -- Gitblit v1.8.0