From 263401d40b2d9d2c1b36a24f33d45c5cb7192518 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期三, 23 十二月 2020 15:51:54 +0800
Subject: [PATCH] 20201223-6

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs |   46 +++++++++++++++++++++++++++++-----------------
 1 files changed, 29 insertions(+), 17 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs
old mode 100644
new mode 100755
index 56cdcc9..edf6086
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs
@@ -107,9 +107,9 @@
             var systeMinute = DateTime.Now.Minute;//鑾峰彇鍒嗛挓
             int systemHourIndex = 0;
             int systeMinuteIndex = 0;
-            for (int i = 0; i < timePointView.GethIntList0().Count; i++)
+            for (int i = 0; i < timePointView.GethIntList().Count; i++)
             {
-                var currhour = timePointView.GethIntList0()[i];
+                var currhour = timePointView.GethIntList()[i];
                 if (systemHour == currhour)
                 {
                     systemHourIndex = i;
@@ -160,7 +160,7 @@
                         int hIndex = timePointView.GetValueIndex(timeValue, 0, 1, timePointView.GethIntList());
                         int mIndex = timePointView.GetValueIndex(timeValue, 1, 0, timePointView.GetmIntList());
                         //鏇存柊鍒濆鐘舵��
-                        timePointView.mUIPickerView.setCurrentItems(hIndex - 1, mIndex, 0);
+                        timePointView.mUIPickerView.setCurrentItems(hIndex, mIndex, 0);
                         timepoint = timeValue;
                     }
                 }
@@ -230,11 +230,11 @@
             Button btnStartTimeText = new Button
             {
                 TextSize = LogicView.TextSize.text12,
-                Width = Application.GetRealWidth(32 + 3),
+                Width = Application.GetRealWidth(32 + 3+20),
                 Height = Application.GetRealHeight(17),
                 TextColor = CSS.CSS_Color.textCancelColor,
                 Y = Application.GetRealHeight(17),
-                X = Application.GetRealWidth(260),
+                X = Application.GetRealWidth(260-20),
                 Tag = "0",
             };
             startTimeView.frameLayout.AddChidren(btnStartTimeText);
@@ -253,11 +253,11 @@
             Button btnEndTimeText = new Button
             {
                 TextSize = LogicView.TextSize.text12,
-                Width = Application.GetRealWidth(32 + 3),
+                Width = Application.GetRealWidth(32 + 3+20),
                 Height = Application.GetRealHeight(17),
                 TextColor = CSS.CSS_Color.textCancelColor,
                 Y = Application.GetRealHeight(17),
-                X = Application.GetRealWidth(260),
+                X = Application.GetRealWidth(260-20),
                 Tag = "0",
             };
             endTimeView.frameLayout.AddChidren(btnEndTimeText);
@@ -282,24 +282,36 @@
             //纭畾鐐瑰嚮浜嬩欢
             timeHorizonView.btnConfirm.MouseUpEventHandler += (sender, e) =>
             {
+
+                if (btnStartTimeText.Tag.ToString() == "0"&& btnEndTimeText.Tag.ToString() == "0")
+                {
+                    //鎻愮ず锛氭椂闂存湭璁剧疆锛岃璁剧疆鏃堕棿銆�
+                    new LogicView.TipPopView().TipBox(StringId.tip, StringId.timeNoSet);
+                    return;
+                }
+
                 if (btnStartTimeText.Tag.ToString() == "0")
                 {
-                    //鎻愮ず锛氳閫変腑寮�濮嬫椂闂�
+                    //鎻愮ず锛氬紑濮嬫椂闂存湭璁剧疆锛岃璁剧疆寮�濮嬫椂闂淬��
+                    new LogicView.TipPopView().TipBox(StringId.tip,StringId.setStartTime);
                     return;
                 }
                 if (btnEndTimeText.Tag.ToString() == "0")
                 {
-                    //鎻愮ず锛氳閫変腑缁撴潫鏃堕棿
+                    //鎻愮ず锛氱粨鏉熸椂闂存湭璁剧疆锛岃璁剧疆缁撴潫鏃堕棿銆�
+                    new LogicView.TipPopView().TipBox(StringId.tip, StringId.setEndTime);
                     return;
                 }
                 if (btnStartTimeText.Tag.ToString() == btnEndTimeText.Tag.ToString())
                 {
-                    //鎻愮ず锛氭椂闂翠竴鏍风殑
+                    //鎻愮ず锛氬紑濮嬫椂闂村拰缁撴潫鏃堕棿涓嶈兘涓�鏍枫��
+                    new LogicView.TipPopView().TipBox(StringId.tip, StringId.unlikeTime);
                     return;
                 }
                 if (int.Parse(btnStartTimeText.Tag.ToString()) > int.Parse(btnEndTimeText.Tag.ToString()))
                 {
-                    //鎻愮ず锛氬紑濮嬫椂闂翠笉鑳藉ぇ浜庣粨鏉熸椂闂�
+                    //鎻愮ず锛氬紑濮嬫椂闂翠笉鑳藉ぇ浜庣粨鏉熸椂闂淬��
+                    new LogicView.TipPopView().TipBox(StringId.tip, StringId.startTimeLessThanEndTime);
                     return;
                 }
 
@@ -310,7 +322,7 @@
                 LogicMethod.dictionary(dic, "key", "timesection");
                 LogicMethod.dictionary(dic, "comparator", "=");
                 LogicMethod.dictionary(dic, "data_type", "string");
-                LogicMethod.dictionary(dic, "value", btnStartTimeText.Text + "~" + btnEndTimeText.Text);
+                LogicMethod.dictionary(dic, "value", btnStartTimeText.Text + "-" + btnEndTimeText.Text);
                 inputTime.condition.Add(dic);
                 if (edit)
                 {
@@ -344,8 +356,8 @@
                     foreach (var dic in dicList)
                     {
                         string value = dic["value"];
-                        string startTime = value.Split('~')[0];
-                        string endtTime = value.Split('~')[1];
+                        string startTime = value.Split('-')[0];
+                        string endtTime = value.Split('-')[1];
                         btnStartTimeText.Text = startTime;
                         btnStartTimeText.Tag = int.Parse(startTime.Split(':')[0]) * 60 + int.Parse(startTime.Split(':')[1]);
                         btnEndTimeText.Text = endtTime;
@@ -378,9 +390,9 @@
             var systeMinute = DateTime.Now.Minute;//鑾峰彇鍒嗛挓
             int systemHourIndex = 0;
             int systeMinuteIndex = 0;
-            for (int i = 0; i < timePointView.GethIntList0().Count; i++)
+            for (int i = 0; i < timePointView.GethIntList().Count; i++)
             {
-                var currhour = timePointView.GethIntList0()[i];
+                var currhour = timePointView.GethIntList()[i];
                 if (systemHour == currhour)
                 {
                     systemHourIndex = i;
@@ -447,7 +459,7 @@
                 int hourIndex = timePointView.GetValueIndex(timepoint, 0, 1, timePointView.GethIntList());
                 int minuteIndex = timePointView.GetValueIndex(timepoint, 1, 0, timePointView.GetmIntList());
                 //鏇存柊鐘舵��
-                timePointView.mUIPickerView.setCurrentItems(hourIndex - 1, minuteIndex, 0);
+                timePointView.mUIPickerView.setCurrentItems(hourIndex, minuteIndex, 0);
             }
 
             //閫変腑鏃堕棿鍥炶皟鏂规硶,鏃堕棿鍙樺寲涓�娆″洖璋冧竴娆�

--
Gitblit v1.8.0