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

加线程发送数据
4个文件已修改
181 ■■■■ 已修改文件
.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 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs 130 ●●●● 补丁 | 查看 | 原始文档 | 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,21 +95,43 @@
            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(() =>
                    {
                        LogicMethod.RemoveAllView();
                        Logic.LogicList.Remove(Logic.currlogic);
                        MainView.MainShow();
                        //发送删除逻辑命令;
                    }
                    else
                    {
                        new LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.delFail));
                    }
                        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);
                                    MainView.MainShow();
                                    //发送删除逻辑命令;
                                }
                                else
                                {
                                    new LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.delFail));
                                }
                            });
                        }
                    })
                    { IsBackground = true }.Start();
                });
            };
HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs
@@ -94,19 +94,60 @@
            timePointView.FLayoutView(fLayout);
            EventHandler<MouseEventArgs> removefLayout = (sender, e1) =>
             {
                //移除fLayout界面
                fLayout.RemoveFromParent();
                 //移除fLayout界面
                 fLayout.RemoveFromParent();
             };
            //取消点击事件
            timePointView.btnCancel.MouseUpEventHandler += removefLayout;
            //加载数据界面的设置方法(列表互不联动)
            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) =>
@@ -171,7 +211,7 @@
        /// <param name="fLayout">在哪个界面显示</param>
        /// <param name="edit">(true=编辑;false=新建)</param>
        /// <param name="index">编辑条件的索引</param>
        public void TimeHorizon(FrameLayout fLayout,bool edit,int index)
        public void TimeHorizon(FrameLayout fLayout, bool edit, int index)
        {
            #region 界面布局
            LogicView.TimeHorizonView timeHorizonView = new LogicView.TimeHorizonView();
@@ -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) =>
            {
@@ -266,7 +310,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)
                {
@@ -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")
            {
@@ -367,7 +453,7 @@
            //选中时间回调方法,时间变化一次回调一次
            timePointView.mUIPickerView.OnSelectChangeEvent += (index1, index2, index3) =>
            {
                string hour = timePointView.GethStringList()[index1].Split(' ')[0];
                string minuet = timePointView.GetmStringList()[index2].Split(' ')[0];
                timepoint = hour + ":" + minuet;
@@ -384,8 +470,6 @@
                timePointView.frameLayout.RemoveFromParent();
            };
        }
        /// <summary>
        /// 灰色弹框父控件
        /// </summary>
@@ -401,16 +485,16 @@
                    fra.RemoveFromParent();
                }
            }
            FrameLayout fLayout = new FrameLayout()
            {
                BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
            };
            frame.AddChidren(fLayout);
            return fLayout;
        }
    }