wxr
2022-12-01 132dc0402e0c5e22a7d54cdddc1700a1842304bd
Merge branch 'wjc' into dev--wxr
8个文件已修改
233 ■■■■ 已修改文件
HDL-ON_Android/Assets/Language.ini 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Language.ini 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/R.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs 55 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs 53 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Language.ini
@@ -1115,6 +1115,11 @@
7162=Face to open the door
7163=Video call
7164=Manipulator
7165=Area intrusion alarm
7166=camera
7167=main switch
@@ -2332,6 +2337,10 @@
7162=人脸开门
7163=视频通话呼叫
7164=机械手
7165=区域入侵告警
7166=摄像头
7167=总控开关
 
HDL-ON_iOS/Resources/Language.ini
@@ -1115,6 +1115,10 @@
7162=Face to open the door
7163=Video call
7164=Manipulator
7165=Area intrusion alarm
7166=camera
7167=main switch
@@ -2332,6 +2336,9 @@
7162=人脸开门
7163=视频通话呼叫
7164=机械手
7165=区域入侵告警
7166=摄像头
7167=总控开关
 
HDL_ON/Common/R.cs
@@ -3038,7 +3038,19 @@
        /// 机械手
        /// </summary>
        public const int jixieshou = 7164;
        /// <summary>
        /// 区域入侵告警
        /// </summary>
        public const int quyuruqingaojing = 7165;
        /// <summary>
        /// 摄像头
        /// </summary>
        public const int shexiangtou = 7166;
        /// <summary>
        /// 总控开关
        /// </summary>
        public const int zongkogkaiguan = 7167;
        #region LE新增
HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
@@ -540,8 +540,8 @@
                        fLayout.AddChidren(view1.FLayoutView());
                        view1.btnClick.MouseUpEventHandler += (sender, e) =>
                        {
                            identifier = "door_call_cloud_event";
                            DeviceView(device, view1.btnState, StringId.shi, StringId.offLogic, 1);
                            this.identifier = "door_call_cloud_event";
                            this.DeviceView(device, view1.btnState, StringId.shi, StringId.offLogic, 1);
                        };
                        LogicView.FunTypeView view2 = new LogicView.FunTypeView();
@@ -550,7 +550,7 @@
                        fLayout.AddChidren(view2.FLayoutView());
                        view2.btnClick.MouseUpEventHandler += (sender, e) =>
                        {
                            identifier = "door_pedestrian_records";
                            this.identifier = "door_pedestrian_records";
                            this.FaceAction(this, device, view2.btnState);
                        };
@@ -580,10 +580,30 @@
                        }
                        if (edit)
                        {
                            GetEditState(device, index, view1.btnState, view2.btnState, null, null);
                            this.GetEditState(device, index, view1.btnState, view2.btnState, null, null);
                        }
                    }
                    break;
                //大华摄像头
                case SPK.IpCam_Imou:
                    {
                        LogicView.FunTypeView view = new LogicView.FunTypeView();
                        view.btnText.TextID = StringId.quyuruqingaojing;
                        view.btnText.Name = Language.StringByID(StringId.shipintonghuahujiao);
                        fLayout.AddChidren(view.FLayoutView());
                        view.btnClick.MouseUpEventHandler += (sender, e) =>
                        {
                            this.identifier = "ipcam_region_alram_event";
                            this.DeviceView(device, view.btnState, StringId.shi, StringId.offLogic, 1);
                        };
                        if (edit)
                        {
                            this.GetEditState(device, index, view.btnState, null, null, null);
                        }
                    }
                    break;
            }
            #region  保存
            ///保存View
@@ -593,7 +613,7 @@
            this.AddChidren(saveView.FLayoutView());
            saveView.btnClick.MouseUpEventHandler += (sen, e) =>
            {
                Save(device,index, edit);
                this.SaveInput(device,index, edit);
            };
            #endregion
@@ -604,7 +624,7 @@
        /// </summary>
        /// <param name="index">索引值</param>
        /// <param name="edit"></param>
        private void Save(Entity.Function device,int index, bool edit)
        private void SaveInput(Entity.Function device,int index, bool edit)
        {
            
            if (selectedState != "unknown")
@@ -623,8 +643,19 @@
                        inputDevice.condition = new List<Dictionary<string, string>>();
                    }
                }
                else if (device.spk == SPK.IpCam_Imou)
                {
                    //大华摄像头
                    inputDevice.condition_type = "9";
                    inputDevice.identifier = this.identifier;
                    if (this.identifier == "ipcam_region_alram_event")
                    {
                        //condition默认[]
                        inputDevice.condition = new List<Dictionary<string, string>>();
                    }
                }
                if (edit)
                {
                    //移除旧数据
@@ -855,11 +886,11 @@
                    || (button.Name == Language.StringByID(StringId.diedaobaojing)))
                    {
                        //只有毫米波传感器(自研)
                        Save(device, mIndex, mEdit);
                        SaveInput(device, mIndex, mEdit);
                    }
                    else if (button.Name == Language.StringByID(StringId.shipintonghuahujiao)) {
                        //只有毫米波传感器(自研)
                        Save(device, mIndex, mEdit);
                        SaveInput(device, mIndex, mEdit);
                    }
                }
            
@@ -921,7 +952,7 @@
                }
                selectedState = device.spk + "_" + value;
                AddDictionary(keyValue, value, data_type, comparator);
                Save(device,index, edit);
                SaveInput(device,index, edit);
            });
        }
        /// PM2.5,Co2,Tvoc设置值
@@ -979,7 +1010,7 @@
                           break;
                   }
                   AddDictionary(key, values, "integer", "in");
                   Save(device, index, edit);
                   SaveInput(device, index, edit);
               });
        }
        /// <summary>
HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs
@@ -275,9 +275,10 @@
                        funView.btnLine.X = Application.GetRealWidth(16);
                        funView.btnLine.Width = Application.GetRealWidth(343);
                        verticalScrolView.AddChidren(funView.FLayoutView());
                        funView.btnIcon.UnSelectedImagePath = LogicMethod.Current.GetIconPath(dev.spk);
                        funView.btnIcon.UnSelectedImagePath = LogicMethod.Current.GetDeviceIconPath(dev);
                        funView.btnDeviceName.Text = dev.name;
                        funView.btnRoomName.Text = dev.GetRoomListName();
                        funView.btnClick.MouseUpEventHandler += (sen, e) =>
                        {
                            if (if_Type == LogicMethod.condition_if)
HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
@@ -140,7 +140,7 @@
                            //用sid找到设备;
                            var device = LogicMethod.Current.GetDevice(inputCondition.sid);
                            //用设备的functionType类型找到对应图标;
                            inputView.btnIcon.UnSelectedImagePath = LogicMethod.Current.GetIconPath(device.spk);
                            inputView.btnIcon.UnSelectedImagePath = LogicMethod.Current.GetDeviceIconPath(device);
                            //显示设备名称
                            inputView.btnText.Text = device.name;
                            //改变设备名称显示控件宽度
@@ -417,6 +417,15 @@
                                            var FaceItem = this.GetFaceItem(userId, device.deviceId);
                                            inputView.btnState.Text = FaceItem.userName;
                                        }
                                    }
                                    break;
                                case SPK.IpCam_Imou:
                                    {
                                        if (inputCondition.identifier == "door_caipcam_region_alram_eventll_cloud_event")
                                        {
                                            inputView.btnState.Text = Language.StringByID(StringId.quyuruqingaojing);
                                        }
                                    }
                                    break;
                            }
@@ -914,7 +923,7 @@
                            //用sid找到设备;
                            var device = LogicMethod.Current.GetDevice(outputTarget.sid);
                            //用设备的functionType类型找到对应图标;
                            targetView.btnIcon.UnSelectedImagePath = LogicMethod.Current.GetIconPath(device.spk);
                            targetView.btnIcon.UnSelectedImagePath = LogicMethod.Current.GetDeviceIconPath(device);
                            //显示设备名称
                            targetView.btnText.Text = device.name;
                            //改变设备名称显示控件宽度
@@ -923,11 +932,24 @@
                            //区别不同设备,显示不同设备状态
                            switch (device.spk)
                            {
                                //插座(有USB)
                                case SPK.PanelSocket:
                                    {
                                        string on_off = GetKeyValue("on_off_master", dicList);
                                        if (on_off == "on")
                                        {
                                            stateStr = Language.StringByID(StringId.onLogic);
                                        }
                                        else
                                        {
                                            stateStr = stateStr = Language.StringByID(StringId.offLogic);
                                        }
                                    }
                                    break;
                                case SPK.AirSwitch:
                                case SPK.LightSwitch:
                                //插座
                                case SPK.PanelSocket:
                                case SPK.ElectricSocket:
                                //机械手
                                case SPK.MechanicalArm:
@@ -1441,8 +1463,23 @@
        {
            switch (device.spk)
            {
                //插座
                //插座(有USB)
                case SPK.PanelSocket:
                    {
                        foreach (var dic in dicList)
                        {
                            string value = dic["value"];
                            if (value == "on")
                            {
                                button1.Text = Language.StringByID(StringId.onLogic);
                            }
                            else
                            {
                                button1.Text = Language.StringByID(StringId.offLogic);
                            }
                        }
                    }
                    break;
                case SPK.ElectricSocket:
                //开关灯光
                case SPK.AirSwitch:
@@ -2106,6 +2143,7 @@
                        button2.Text = this.GetFaceItem(value, device.deviceId).userName;
                    }
                    break;
            }
        }
        /// <summary>
@@ -2399,7 +2437,9 @@
        /// <returns></returns>
        private string GetTimeText(string strTimeValue)
        {
            var timeValue = int.Parse(strTimeValue);
            //因为调试软件上传为空过;
            string intTimeValue = string.IsNullOrEmpty(strTimeValue) ? "0" : strTimeValue;
            var timeValue = int.Parse(intTimeValue);
            string state = "";
            var minutes = timeValue / 60;
            var seconds = timeValue % 60;
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
@@ -187,7 +187,7 @@
            var list2 = this.GetVideoDeviceList();
            list.AddRange(list1);
            list.AddRange(list2);
            GetTestDevice(ref list, false);
            GetTestDevice(ref list, true);
            return list;
        }
        /// <summary>
@@ -343,17 +343,39 @@
            return roomName.TrimEnd(',');
        }
        #region   动一改四
        /// <summary>
        /// 获取设备类型图标
        /// </summary>
        /// <param name="device">设备</param>
        /// <returns></returns>
        public string GetDeviceIconPath(Function device)
        {
            if (SPK.MusicStandard == device.spk
                || SPK.AvMusic == device.spk)
            {
                return "MusicIcon/localMusic.png";
            }
            //LogicIcon/heatlogic.png"
            return $"FunctionIcon/Icon/{device.IconName}.png";
        }
        /// <summary>
        /// 获取设备类型图标(已弃用 2022年11月25日14:07:30)
        /// </summary>
        /// <param name="functionType">设备类型</param>
        /// <returns></returns>
        public string GetIconPath(string functionType)
        public string GetIconPath(string spk)
        {
            string strPath = "";
            switch (functionType)
            switch (spk)
            {
                case SPK.IpCam_Imou:
                    {
                        strPath = $"FunctionIcon/Icon/{SPK.IpCam_Imou.Replace(".", "")}.png";
                    }
                    break;
                case SPK.MechanicalArm:
                    {
                        strPath = "LogicIcon/lightloguc.png";
@@ -451,10 +473,10 @@
                        strPath = "MusicIcon/localMusic.png";
                    }
                    break;
            }
            return strPath;
        }
        #region   动一改三
        /// <summary>
        /// 设备类型的列表(灯光类,窗帘类。。。)
        /// </summary>
@@ -570,6 +592,13 @@
            {
                deviceStrTypeList.Add(Language.StringByID(StringId.jixieshou));
            }
            ///摄像头类
            var camera = deviceList.Find((device) =>
            device.spk == SPK.IpCam_Imou);
            if (camera != null)
            {
                deviceStrTypeList.Add(Language.StringByID(StringId.shexiangtou));
            }
            return deviceStrTypeList;
        }
@@ -669,10 +698,16 @@
            else if (deviceType == Language.StringByID(StringId.VideoIntercom))
            {
                functionTypeList.Add(SPK.doorgate);
            }  ///机械手类
            }
            ///机械手类
            else  if (deviceType == Language.StringByID(StringId.jixieshou))
            {
                functionTypeList.Add(SPK.MechanicalArm);
            }
            ///摄像头类
            else if (deviceType == Language.StringByID(StringId.shexiangtou))
            {
                functionTypeList.Add(SPK.IpCam_Imou);
            }
            else
            {
@@ -727,6 +762,7 @@
                functionTypeList.Add(SPK.AvMusic);
                functionTypeList.Add(SPK.doorgate);
                functionTypeList.Add(SPK.MechanicalArm);
                functionTypeList.Add(SPK.IpCam_Imou);
            }
@@ -784,6 +820,7 @@
                        deviceTypeList.Add(SPK.SensorHelp);
                        deviceTypeList.Add(SPK.DoorLock);
                        deviceTypeList.Add(SPK.doorgate);
                        deviceTypeList.Add(SPK.IpCam_Imou);
                    }
                    break;
@@ -851,7 +888,7 @@
            return list;
        }
        /// <summary>
        /// 网关ID(获取嘉乐网关ID)
        /// 网关ID(获取网关ID)
        /// </summary>
        public string GatewayId
        {
@@ -1126,7 +1163,7 @@
                 // new Entity.Function { sid = "1234567891", name = "温度传感器", spk = Entity.SPK.SensorTemperature },
                 //  new Entity.Function { sid = "1234567892", name = "湿度传感器", spk = Entity.SPK.SensorHumidity },
                    new Entity.Function { sid = "12345678933456", name = "调光灯", spk = Entity.SPK.LightDimming },
                      new Entity.Function { sid = "1234567895444", name = "cct", spk = Entity.SPK.LightCCT },
                      new Entity.Function { sid = "1234567895444", name = "面板", spk = Entity.SPK.PanelSocket },
                      //new Entity.Function { sid = "1234567896", name = "毫米波传感器", spk = Entity.SPK.SenesorMegahealth },
                      //  new Entity.Function { sid = "1234567897", name = "毫米波传感器1", spk = Entity.SPK.SenesorMegahealth2 },
                      // new Entity.Function { sid = "1234567899", name = "门磁传感器", spk = Entity.SPK.SensorDoorWindow },
HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
@@ -55,12 +55,35 @@
            #region  编辑设备状态
            switch (device.spk)
            {
                //插座(有USB)
                case SPK.PanelSocket:
                    {
                        #region 界面
                        ///总控开关
                        LogicView.FunTypeView view1 = new LogicView.FunTypeView();
                        view1.btnText.TextID = StringId.zongkogkaiguan;
                        view1.btnState.Name = "总控开关";
                        fLayout.AddChidren(view1.FLayoutView());
                        ///设备延时iewv
                        DelayView(fLayout, view1.frameLayout.Bottom);
                        #endregion
                        #region 点击事件
                        ///总控开关点击事件
                        view1.btnClick.MouseUpEventHandler += (sender, e) =>
                        {
                            SwitchViewMethod(device, view1.btnState, 2);
                        };
                        if (edit)
                        {
                            //显示编辑之前的设备状态
                            GetEditDeviceState(device, index, view1.btnState, null, null, null);
                        }
                        #endregion
                    }
                    break;
                //开关灯光 
                case SPK.AirSwitch:
                case SPK.LightSwitch:
                //插座
                case SPK.PanelSocket:
                case SPK.ElectricSocket:
                //机械手
                case SPK.MechanicalArm:
@@ -820,6 +843,17 @@
                selectedState = device.spk + "_" + strValue;
                //设备属性值,云雀上定义好的;
                string keyVlaue = "on_off";
                switch (device.spk)
                {
                    case SPK.PanelSocket:
                        {
                            if (button.Name == "总控开关")
                            {
                                keyVlaue = "on_off_master";
                            }
                        }
                        break;
                }
                //数据封装
                AddDictionary(keyVlaue, strValue);
            });