wxr
2021-07-01 b409ece9569247d7e7b44fc15e8a02556ca05a57
合并温居城代码
9个文件已修改
278 ■■■■ 已修改文件
HDL_ON/DAL/Server/HttpUtil.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs 148 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputView.cs 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TimeView.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/HttpUtil.cs
@@ -18,8 +18,8 @@
        /// 公共域名就近解析
        /// 
        /// </summary>
        public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
        //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm
        //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
        public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm
        /// <summary>
        /// RegionMark
        /// </summary>
HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
@@ -69,6 +69,7 @@
                        }
                    }
                    break;
                //水浸传感器
                case SPK.SensorWater:
                    {
                        LogicView.FunTypeView view = new LogicView.FunTypeView();
@@ -85,7 +86,9 @@
                    }
                    break;
                //烟雾传感器
                case SPK.SensorSmoke:
                //燃气传感器
                case SPK.SensorGas:
                    {
                        LogicView.FunTypeView view = new LogicView.FunTypeView();
@@ -102,6 +105,7 @@
                    }
                    break;
                //干接点
                case SPK.SensorDryContact:
                    {
                        LogicView.FunTypeView view = new LogicView.FunTypeView();
@@ -118,8 +122,11 @@
                    }
                    break;
                //红外珊栏传感器
                case SPK.SensorShanLan:
                //红外对射传感器
                case SPK.SensorDuiShe:
                //红外移动传感器
                case SPK.SensorPir:
                    {
                        LogicView.FunTypeView view = new LogicView.FunTypeView();
@@ -135,6 +142,7 @@
                        }
                    }
                    break;
                //门窗传感器
                case SPK.SensorDoorWindow:
                    {
                        LogicView.FunTypeView view = new LogicView.FunTypeView();
@@ -150,6 +158,7 @@
                        }
                    }
                    break;
                //超声波传感器
                case SPK.SensoruUtrasonic:
                    {
@@ -175,6 +184,7 @@
                        }
                    }
                    break;
                //毫米波传感器
                case SPK.SenesorMegahealth:
                    {
                        LogicView.FunTypeView view = new LogicView.FunTypeView();
@@ -359,7 +369,7 @@
                //显示文本
                button.TextID = intValue;
                selectedState = device.spk + "_" + value;
                AddDictionary(keyVlaue, value);
                AddDictionary(keyVlaue, value, "string");
            });
@@ -391,29 +401,34 @@
        /// </summary>
        /// <param name="KeyValue">设备属性值,云雀上定义好的</param>
        /// <param name="selectedValue">状态值</param>
        private void AddDictionary(string KeyValue, string selectedValue)
        /// <param name="data_type">类型</param>
        /// <param name="comparator">比较关系</param>
        private void AddDictionary(string KeyValue, string selectedValue,string data_type,string comparator="=")
        {
            //数据封装
            Dictionary<string, string> dic = new Dictionary<string, string>();
            LogicMethod.dictionary(dic, "key", KeyValue);
            LogicMethod.dictionary(dic, "comparator", "=");
            LogicMethod.dictionary(dic, "data_type", "string");
            LogicMethod.dictionary(dic, "comparator", comparator);
            LogicMethod.dictionary(dic, "data_type", data_type);
            LogicMethod.dictionary(dic, "value", selectedValue);
            AddDictionaryList(KeyValue, dic);
            AddDictionaryList(KeyValue, comparator,dic);
        }
        /// <summary>
        /// 更新数据列表
        /// </summary>
        /// <param name="keyValue">设备属性值,云雀上定义好的</param>
        /// <param name="keyValue">设备属性值,云雀上定义好的</param>
        /// <param name="comparator">比较关系</param>
        /// <param name="dictionary">添加选中数据</param>
        /// <returns></returns>
        private void AddDictionaryList(string keyValue, Dictionary<string, string> dictionary)
        private void AddDictionaryList(string keyValue,string comparator, Dictionary<string, string> dictionary)
        {
            int indexValue = -1;
            for (int i = 0; i < dicSateteList.Count; i++)
            {
                var dic = dicSateteList[i];
                if (dic.ContainsValue(keyValue))
                string key = dic["key"];
                string comparatorValue = dic["comparator"];
                if (key == keyValue && comparatorValue == comparator)
                {
                    //判断是否存在
                    indexValue = i;
HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
@@ -639,6 +639,8 @@
                targetView.btnClick.Tag = outputTarget.sid;
                ///条件状态数组
                List<Dictionary<string, string>> dicList = outputTarget.status as List<Dictionary<string, string>>;
                //显示状态值
                string stateStr = "";
                //显示输出条件各种类型状态
                switch (outputTarget.target_type)
                {
@@ -652,8 +654,7 @@
                            targetView.btnText.Text = device.name;
                            //改变设备名称显示控件宽度
                            targetView.btnText.Width = Application.GetRealWidth(80);
                            //第一个变量显示状态值
                            string stateStr = "";
                            //区别不同设备,显示不同设备状态
                            switch (device.spk)
                            {
@@ -673,7 +674,6 @@
                                                stateStr = Language.StringByID(StringId.offLogic);
                                            }
                                        }
                                        targetView.btnState.Text = stateStr;
                                    }
                                    break;
                                case SPK.LightRGB:
@@ -699,7 +699,7 @@
                                        {
                                            stateStr = brightness + "%";
                                        }
                                        targetView.btnState.Text = stateStr;
                                    }
                                    break;
                                case SPK.CurtainSwitch:
@@ -728,7 +728,6 @@
                                                    break;
                                            }
                                        }
                                        targetView.btnState.Text = stateStr;
                                    }
                                    break;
                                case SPK.AcStandard:
@@ -820,11 +819,11 @@
                                        }
                                        if (on_off != "" && on_off == "off")
                                        {
                                            targetView.btnState.Text = Language.StringByID(StringId.offLogic);
                                            stateStr = Language.StringByID(StringId.offLogic);
                                        }
                                        else
                                        {
                                            targetView.btnState.Text = stateStr.TrimEnd(',');
                                            stateStr = stateStr.TrimEnd(',');
                                        }
@@ -918,11 +917,11 @@
                                        }
                                        if (on_off != "" && on_off == "off")
                                        {
                                            targetView.btnState.Text = Language.StringByID(StringId.offLogic);
                                            stateStr = Language.StringByID(StringId.offLogic);
                                        }
                                        else
                                        {
                                            targetView.btnState.Text = stateStr.TrimEnd(',');
                                            stateStr = stateStr.TrimEnd(',');
                                        }
                                    }
@@ -937,7 +936,7 @@
                            targetView.btnIcon.UnSelectedImagePath = "LogicIcon/scene.png";
                            targetView.btnNextIcon.Visible = false;
                            //显示场景名称
                            targetView.btnText.Text = scene.name;
                            stateStr = scene.name;
                        }
                        break;
                    case "3":
@@ -946,10 +945,19 @@
                            foreach (var dic in dicList)
                            {
                                string value = dic["value"];
                                targetView.btnText.Text = value;
                                stateStr = value;
                            }
                        }
                        break;
                }
                if (outputTarget.target_type == "1")
                {
                    targetView.btnState.Text =new InpOrOutLogicMethod { }.GetTimeText(outputTarget.delay) + stateStr;
                }
                else
                {
                    targetView.btnText.Text = new InpOrOutLogicMethod { }.GetTimeText(outputTarget.delay)+ stateStr;
                }
                //再次编辑条件状态点击事件
                targetView.btnClick.MouseUpEventHandler += (sen, e) =>
@@ -997,6 +1005,25 @@
                            }
                            break;
                    }
                };
                //延时点击事件
                targetView.btnDelay.MouseUpEventHandler += (sen, e) =>
                {
                    InpOrOutLogicMethod inpOrOutLogicMethod = new InpOrOutLogicMethod();
                    inpOrOutLogicMethod.Delayed(thisView, outputTarget, (value) =>
                    {
                        outputTarget.delay = value.ToString();
                        if (outputTarget.target_type == "1")
                        {
                            targetView.btnState.Text = new InpOrOutLogicMethod { }.GetTimeText(outputTarget.delay) + stateStr;
                        }
                        else
                        {
                            targetView.btnText.Text = new InpOrOutLogicMethod { }.GetTimeText(outputTarget.delay) + stateStr;
                        }
                    });
                };
                ///删除控件
                targetView.btnDel.MouseUpEventHandler += (sender, e) =>
@@ -1585,5 +1612,104 @@
            catch { }
            return name;
        }
        /// <summary>
        /// 延时时间方法
        /// </summary>
        /// <param name="fLayout">在哪个界面显示</param>
        /// <param name="edit">(true=编辑;false=新建)</param>
        /// <param name="index">编辑条件的索引</param>
        private void Delayed(FrameLayout thisFLayout, Output output,Action<int>action)
        {
            FrameLayout fLayout = new FrameLayout
            {
                BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
            };
            thisFLayout.AddChidren(fLayout);
            LogicView.TimeView timePointView = new LogicView.TimeView();
            timePointView.FLayoutView(fLayout);
            EventHandler<MouseEventArgs> RemovefLayout = (sender, e1) =>
            {
                //移除fLayout界面
                fLayout.RemoveFromParent();
            };
            //取消点击事件
            timePointView.btnCancel.MouseUpEventHandler += RemovefLayout;
            //加载数据界面的设置方法(列表互不联动)
            timePointView.mUIPickerView.setNPicker(timePointView.GetmStringList(), timePointView.GetsStringList(), null);
            //默认初始选中状态
            timePointView.mUIPickerView.setCurrentItems(0, 5, 0);
            //定义一个局部变量记录选中时间
            int timepoint = 5;
            if (output.delay != "0")
            {
                int intValue = int.Parse(output.delay);
                var m = intValue / 60;
                var s = intValue % 60;
                string timeValue = m.ToString() + ":" + s.ToString();
                int mIndex = timePointView.GetValueIndex(timeValue, 0, 1, timePointView.GetmIntList());
                int sIndex = timePointView.GetValueIndex(timeValue, 1, 0, timePointView.GetmIntList());
                //更新初始状态
                timePointView.mUIPickerView.setCurrentItems(mIndex, sIndex, 0);
                timepoint = intValue;
            }
            //选中时间回调方法,时间变化一次回调一次
            timePointView.mUIPickerView.OnSelectChangeEvent += (index1, index2, index3) =>
            {
                string minuet = timePointView.GethStringList0()[index1].Split(' ')[0];
                string second = timePointView.GetmStringList()[index2].Split(' ')[0];
                int minuetIntValue = int.Parse(minuet);
                int secondIntValue = int.Parse(second);
                timepoint = minuetIntValue*60+secondIntValue;
            };
            //确定点击事件
            timePointView.btnConfirm.MouseUpEventHandler += (sender, e3) =>
            {
                if (timepoint==0)
                {
                    //提示
                    return;
                }
                fLayout.RemoveFromParent();
                action(timepoint);
            };
        }
        /// <summary>
        /// 获取时间文本描述
        /// </summary>
        /// <param name="strTimeValue">时间值(单位s秒)</param>
        /// <returns></returns>
        private string GetTimeText(string strTimeValue)
        {
            var timeValue = int.Parse(strTimeValue);
            string state = "";
            var minutes = timeValue / 60;
            var seconds = timeValue % 60;
            if (minutes != 0)
            {
                if (seconds == 0)
                {
                    state = minutes.ToString() + Language.StringByID(StringId.minute);
                }
                else
                {
                    state = minutes.ToString() + Language.StringByID(StringId.minute) + seconds.ToString() + Language.StringByID(StringId.s);
                }
            }
            else
            {
                if (seconds != 0)
                {
                    state = seconds.ToString() + Language.StringByID(StringId.s);
                }
            }
            return state;
        }
    }
}
HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs
@@ -112,6 +112,10 @@
        /// </summary>
        public string sid = "";
        /// <summary>
        /// 逻辑输出目标延时间(单位用秒)
        /// </summary>
        public string delay = "0";
        /// <summary>
        /// 逻辑输出目标类型
        /// 设备=1;
        /// 场景=2;
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputView.cs
@@ -7,11 +7,11 @@
        /// <summary>
        /// 主控件View
        /// </summary>
        public FrameLayout frameLayout= new FrameLayout
        public FrameLayout frameLayout = new FrameLayout
        {
            Height = Application.GetRealHeight(44),
            Width = Application.GetRealWidth(343),
           BackgroundColor= CSS.CSS_Color.view,
            BackgroundColor = CSS.CSS_Color.view,
            X = Application.GetRealWidth(LogicView.TextSize.left16),
        };
@@ -23,28 +23,28 @@
            Height = Application.GetRealHeight(43),
            Width = Application.GetRealWidth(343),
            LineColor = CSS.CSS_Color.viewTranslucence,
            SubViewWidth=Application.GetRealWidth(68),
            SubViewWidth = Application.GetRealWidth(68),
        };
        /// <summary>
        /// (条件或者目标)图标
        /// </summary>
        public Button btnIcon= new Button
        public Button btnIcon = new Button
        {
            Width= Application.GetRealWidth(28),
            Height =Application.GetRealWidth(28),
            Width = Application.GetRealWidth(28),
            Height = Application.GetRealWidth(28),
            //Y = Application.GetRealHeight(8),
            X = Application.GetRealWidth(TextSize.left12),
        };
        /// <summary>
        /// (条件或者目标)文本描述
        /// </summary>
        public Button btnText= new Button
        public Button btnText = new Button
        {
            TextSize = TextSize.text14,
            Width = Application.GetRealWidth(250),
            Height = Application.GetRealHeight(20),
            TextColor= CSS.CSS_Color.textColor,
            TextColor = CSS.CSS_Color.textColor,
            //Y=Application.GetRealHeight(12),
            X = Application.GetRealWidth(52),
        };
@@ -58,9 +58,9 @@
            Width = Application.GetRealWidth(130),
            Height = Application.GetRealHeight(17),
            TextColor = CSS.CSS_Color.textCancelColor,
            Y=Application.GetRealHeight(14),
            Y = Application.GetRealHeight(14),
            X = Application.GetRealWidth(165),
            TextAlignment=TextAlignment.CenterRight,
            TextAlignment = TextAlignment.CenterRight,
        };
        /// <summary>
@@ -81,13 +81,26 @@
        /// </summary>
        public Button btnLine = new Button
        {
            Width=Application.GetRealWidth(279),
            Y = Application.GetRealHeight(44-1),
            Width = Application.GetRealWidth(279),
            Y = Application.GetRealHeight(44 - 1),
            X = Application.GetRealWidth(52),
            Height = 1,
            BackgroundColor = CSS.CSS_Color.viewLine,
        };
        /// <summary>
        /// 延时
        /// </summary>
        public Button btnDelay = new Button
        {
            BackgroundColor = CSS.CSS_Color.AuxiliaryColor1,
            TextID = StringId.delayLogic,
            TextSize = LogicView.TextSize.text16,
            TextColor = CSS.CSS_Color.view,
        };
        /// <summary>
        /// 删除
        /// </summary>
        public Button btnDel = new Button
        {
            BackgroundColor = CSS.CSS_Color.textRedColor,
@@ -95,7 +108,6 @@
            TextSize = LogicView.TextSize.text16,
            TextColor = CSS.CSS_Color.view,
        };
        public Button btnClick = new Button
        {
            Height = Application.GetRealHeight(44),
@@ -117,12 +129,13 @@
            rowLayout.AddChidren(btnText);
            rowLayout.AddChidren(btnState);
            rowLayout.AddChidren(btnNextIcon);
            rowLayout.AddRightView(btnDelay);
            rowLayout.AddRightView(btnDel);
            rowLayout.AddChidren(btnClick);
            btnLine.Y = frameLayout.Height - 1;
            frameLayout.AddChidren(btnLine);
        }
    }
}
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TimeView.cs
@@ -72,7 +72,6 @@
        /// </summary>
        /// <returns></returns>
        public void FLayoutView(FrameLayout fLayout)
        //public void FLayoutView(FrameLayout fLayout, string currState, Action<string> action)
        {
           
            fLayout.AddChidren(frameLayout);
@@ -80,7 +79,6 @@
            frameLayout.AddChidren(btnCancel);
            frameLayout.AddChidren(btnConfirm);
            frameLayout.AddChidren(btnLine);
            //TimePoint(fLayout, action,currState);
        }
        /// <summary>
        /// 选中时间的方法
@@ -248,6 +246,32 @@
            return mList;
        }
        /// <summary>
        /// 获取60秒列表
        /// </summary>
        /// <returns></returns>
        public List<string> GetsStringList()
        {
            //初始化列表
            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.s));
                }
                else
                {
                    //添加数据
                    mList.Add(i.ToString() + " " + Language.StringByID(StringId.s));
                }
            }
            return mList;
        }
        /// <summary>
        /// 获取023小时列表
HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs
@@ -75,7 +75,7 @@
            pmhigherView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16);
            pmhigherView.btnText.TextID = StringId.PM25;
            viewLayout.AddChidren(pmhigherView.FLayoutView());
            #endregion
@@ -110,7 +110,7 @@
                PmAction(this);
            };
            #endregion
        }
@@ -119,7 +119,7 @@
        /// </summary>
        /// <param name="textInt">文本</param>
        /// <param name="stateValue">编辑之前的状态值,默认为20</param>
        public void InputBoxAction(int textInt,string stateValue="20")
        public void InputBoxAction(int textInt, string stateValue = "20")
        {
            new LogicView.TipPopView { }.InputBox(textInt, stateValue, (value) =>
            {
@@ -217,7 +217,7 @@
        /// <param name="input"></param>
        /// <param name="keyValue"></param>
        /// <param name="comparator">比较关系</param>
        private void AddCondition(Input input, string keyValue,string comparator)
        private void AddCondition(Input input, string keyValue, string comparator)
        {
            ///记录索引值
            int index = -1;
@@ -261,7 +261,7 @@
        /// <param name="keyValue"></param>
        /// <param name="comparator">比较关系</param>
        /// <returns></returns>
        private bool ExistKey(List<Dictionary<string, string>> dicList, string keyValue, string comparator)
        private bool ExistKey(List<Dictionary<string, string>> dicList, string keyValue, string comparator)
        {
            for (int i = 0; i < dicList.Count; i++)
            {
@@ -277,7 +277,11 @@
            return false;
        }
        /// <summary>
        /// 数值返回文本
        /// </summary>
        /// <param name="strValue">值</param>
        /// <returns></returns>
        public string GetString(string strValue)
        {
            string text = "";
HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
@@ -114,6 +114,7 @@
                {
                    var outputTypeJOb = new JObject { };
                    outputTypeJOb.Add("sid", dictionary.sid);
                    outputTypeJOb.Add("delay", dictionary.delay);
                    outputTypeJOb.Add("target_type", dictionary.target_type);
                    var statusArray = new JArray { };
                    foreach (var dic in dictionary.status)
@@ -226,6 +227,7 @@
                {
                    var outputTypeJOb = new JObject { };
                    outputTypeJOb.Add("sid", dictionary.sid);
                    outputTypeJOb.Add("delay", dictionary.delay);
                    outputTypeJOb.Add("target_type", dictionary.target_type);
                    var statusArray = new JArray { };
                    foreach (var dic in dictionary.status)
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs
@@ -61,7 +61,7 @@
                        {
                            if (libraryList.Count < 60)
                            {
                                //限制40个库;
                                //限制60个库;
                                libraryList.Add(library);
                            }
                        }