陈嘉乐
2020-12-15 a35617eb62b317bf3ed92b1462018cf67c920411
2020-12-15-2

加线程发送数据
4个文件已修改
145 ■■■■ 已修改文件
.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs 112 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal
Binary files differ
HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs
@@ -51,6 +51,7 @@
            #endregion
            #region  所有点击事件
            //功能点击事件
            functionView.btnClick.MouseUpEventHandler += (sen, e) =>
            {
                FunTpye funTpye = new FunTpye();
@@ -59,7 +60,7 @@
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
            //场景点击事件
            sceneView.btnClick.MouseUpEventHandler += (sen, e) =>
            {
@@ -70,7 +71,7 @@
                this.AddChidren(fLayout);
                SceneMethod(fLayout);
            };
            //延时点击事件
            delayView.btnClick.MouseUpEventHandler += (sen, e) =>
            {
HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs
@@ -95,11 +95,27 @@
            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, () =>
                {
                  var responsePackNew=  Send.delLogic(Logic.currlogic);
                    if (responsePackNew.Code == "0")
                    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);
@@ -111,6 +127,12 @@
                        new LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.delFail));
                    }
                });
                        }
                    })
                    { IsBackground = true }.Start();
                });
            };
            btnDel.MouseUpEventHandler += delClick;
HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs
@@ -102,11 +102,52 @@
            //加载数据界面的设置方法(列表互不联动)
            timePointView.mUIPickerView.setNPicker(timePointView.GethStringList(), timePointView.GetmStringList(), null);
            //默认初始选中状态
            timePointView.mUIPickerView.setCurrentItems(0, 30, 0);
            //定义一个局部变量记录选中时间
            string timepoint = "01:30";
            var systemHour = DateTime.Now.Hour; //获取小时
            var systeMinute = DateTime.Now.Minute;//获取分钟
            int systemHourIndex = 0;
            int systeMinuteIndex = 0;
            for (int i = 0; i < timePointView.GethIntList0().Count; i++)
            {
                var currhour = timePointView.GethIntList0()[i];
                if (systemHour == currhour)
                {
                    systemHourIndex = i;
                    break;
                }
            }
            for (int i = 0; i < timePointView.GetmIntList().Count; i++)
            {
                var currminute = timePointView.GetmIntList()[i];
                if (systeMinute == currminute)
                {
                    systeMinuteIndex = i;
                    break;
                }
            }
            //默认初始选中状态
            timePointView.mUIPickerView.setCurrentItems(systemHourIndex, systeMinuteIndex, 0);
            string currH = "";
            string currM = "";
            if (systemHour < 10)
            {
                currH = "0" + systemHour.ToString();
            }
            else
            {
                currH = systemHour.ToString();
            }
            if (systeMinute < 10)
            {
                currM = "0" + systeMinute.ToString();
            }
            else
            {
                currM = systeMinute.ToString();
            }
            //定义一个局部变量记录选中时间
            string timepoint = currH + ":" + currM;
            if (edit)
            {
                Input inputs = Logic.currlogic.input[index];
@@ -124,7 +165,6 @@
                    }
                }
            }
            //选中时间回调方法,时间变化一次回调一次
            timePointView.mUIPickerView.OnSelectChangeEvent += (index1, index2, index3) =>
@@ -226,15 +266,19 @@
            #region 点击事件
            //开始时间点击事件
            startTimeView.btnClick.MouseUpEventHandler += (sender, e) =>
            {
            EventHandler<MouseEventArgs> StartTimeClick = (sender,e) => {
                SelectedTimeHorizon(fLayout, btnStartTimeText);
            };
            startTimeView.btnClick.MouseUpEventHandler += StartTimeClick;
            btnStartTimeText.MouseUpEventHandler += StartTimeClick;
            //结束时间点击事件
            endTimeView.btnClick.MouseUpEventHandler += (sender, e) =>
            {
            EventHandler<MouseEventArgs> EndTimeClick = (sender, e) => {
                SelectedTimeHorizon(fLayout, btnEndTimeText);
            };
            endTimeView.btnClick.MouseUpEventHandler += EndTimeClick;
            btnEndTimeText.MouseUpEventHandler += EndTimeClick;
            //确定点击事件
            timeHorizonView.btnConfirm.MouseUpEventHandler += (sender, e) =>
            {
@@ -329,11 +373,53 @@
            timePointView.btnCancel.MouseUpEventHandler += RemovefLayout;
            //加载数据界面的设置方法(列表互不联动)
            timePointView.mUIPickerView.setNPicker(timePointView.GethStringList(), timePointView.GetmStringList(), null);
            var systemHour = DateTime.Now.Hour; //获取小时
            var systeMinute = DateTime.Now.Minute;//获取分钟
            int systemHourIndex = 0;
            int systeMinuteIndex = 0;
            for (int i = 0; i < timePointView.GethIntList0().Count; i++)
            {
                var currhour = timePointView.GethIntList0()[i];
                if (systemHour == currhour)
                {
                    systemHourIndex = i;
                    break;
                }
            }
            for (int i = 0; i < timePointView.GetmIntList().Count; i++)
            {
                var currminute = timePointView.GetmIntList()[i];
                if (systeMinute == currminute)
                {
                    systeMinuteIndex = i;
                    break;
                }
            }
            //默认初始选中状态
            timePointView.mUIPickerView.setCurrentItems(0, 30, 0);
            timePointView.mUIPickerView.setCurrentItems(systemHourIndex, systeMinuteIndex, 0);
            string currH = "";
            string currM = "";
            if (systemHour < 10)
            {
                currH = "0" + systemHour.ToString();
            }
            else
            {
                currH = systemHour.ToString();
            }
            if (systeMinute < 10)
            {
                currM = "0" + systeMinute.ToString();
            }
            else
            {
                currM = systeMinute.ToString();
            }
            //定义一个局部变量记录选中时间
            string timepoint = "01:30";
            int sumTime = 90;
            string timepoint = currH + ":" + currM;
            int sumTime = systemHour*60+ systeMinute;
            if (btn.Tag.ToString() != "0")
            {
@@ -384,8 +470,6 @@
                timePointView.frameLayout.RemoveFromParent();
            };
        }
        /// <summary>
        /// 灰色弹框父控件
        /// </summary>