wei
2020-12-23 263401d40b2d9d2c1b36a24f33d45c5cb7192518
HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs
old mode 100644 new mode 100755
@@ -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;
                }
@@ -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);
            }
            //选中时间回调方法,时间变化一次回调一次