wxr
2023-02-15 7ff70bc7c9460c395b59952d55df6e5d6a12a718
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>
@@ -197,7 +197,8 @@
        public List<HDL_ON.Entity.Function> GetVideoDeviceList()
        {
            var functionList = new List<Function>();
            foreach (var videoDevice in FunctionList.List.videoIntercom) {
            foreach (var videoDevice in FunctionList.List.videoIntercom)
            {
                Function function = new Function();
                function.spk = videoDevice.spk;
                function.name = videoDevice.deviceName;
@@ -205,7 +206,8 @@
                function.online = videoDevice.status== "online";
                function.sid = videoDevice.sid;
                var video = functionList.Find((o) => o.deviceId == function.deviceId);
                if (video == null) {
                if (video == null)
                {
                    functionList.Add(function);
                }
@@ -341,17 +343,51 @@
            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";
            }
            else if (SPK.SensorPm10 == device.spk)
            {
                return "LogicIcon/sensor.png";
            }
            else if (SPK.DoorLock == device.spk)
            {
                return "FunctionIcon/DoorLock/DoorLock.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";
                    }
                    break;
                case SPK.doorgate:
                    {
                        strPath = "VideoIcon/keshiduijiang.png";
@@ -444,10 +480,10 @@
                        strPath = "MusicIcon/localMusic.png";
                    }
                    break;
            }
            return strPath;
        }
        #region   动一改三
        /// <summary>
        /// 设备类型的列表(灯光类,窗帘类。。。)
        /// </summary>
@@ -457,6 +493,7 @@
        {
            List<string> deviceStrTypeList = new List<string>();
            deviceStrTypeList.Clear();
            ///灯光类
            var lightjosn = deviceList.Find((device) =>
            device.spk == SPK.LightSwitch
@@ -522,6 +559,7 @@
                        || device.spk == SPK.SensorTVOC
                          || device.spk == SPK.SensorHcho
                          || device.spk == SPK.SensorHelp
                          || device.spk == SPK.SensorPm10
            );
            if (sensor != null)
            {
@@ -555,6 +593,20 @@
            {
                deviceStrTypeList.Add(Language.StringByID(StringId.VideoIntercom));
            }
            ///机械手类
            var MechanicalArm = deviceList.Find((device) =>
            device.spk == SPK.MechanicalArm);
            if (MechanicalArm != null)
            {
                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;
        }
@@ -566,6 +618,7 @@
        public List<string> GetDeviceTypeFunctionList(string deviceType)
        {
            List<string> functionTypeList = new List<string>();
            ///灯光类
            if (deviceType == Language.StringByID(StringId.Lights))
            {
@@ -628,6 +681,7 @@
                functionTypeList.Add(SPK.SensorTVOC);
                functionTypeList.Add(SPK.SensorHcho);
                functionTypeList.Add(SPK.SensorHelp);
                functionTypeList.Add(SPK.SensorPm10);
            }
@@ -653,6 +707,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
            {
@@ -706,6 +770,9 @@
                functionTypeList.Add(SPK.MusicStandard);
                functionTypeList.Add(SPK.AvMusic);
                functionTypeList.Add(SPK.doorgate);
                functionTypeList.Add(SPK.MechanicalArm);
                functionTypeList.Add(SPK.IpCam_Imou);
                functionTypeList.Add(SPK.SensorPm10);
            }
@@ -763,6 +830,8 @@
                        deviceTypeList.Add(SPK.SensorHelp);
                        deviceTypeList.Add(SPK.DoorLock);
                        deviceTypeList.Add(SPK.doorgate); 
                        deviceTypeList.Add(SPK.IpCam_Imou);
                        deviceTypeList.Add(SPK.SensorPm10);
                    }
                    break;
@@ -785,6 +854,7 @@
                        deviceTypeList.Add(SPK.CurtainDream);
                        deviceTypeList.Add(SPK.MusicStandard);
                        deviceTypeList.Add(SPK.AvMusic);
                        deviceTypeList.Add(SPK.MechanicalArm);
                    }
                    break;
            }
@@ -821,15 +891,15 @@
        /// <returns></returns>
        public List<Entity.Function> GetFunctionDeviceList(Entity.Room room, string str)
        {
            List<string> functionTypeList = GetSupportEquipment(str);
            List<string> functionTypeList = this.GetSupportEquipment(str);
            //返回房间设备列表
            var roomDeviceList = GetRoomDevice(room);
            var roomDeviceList = this.GetRoomDevice(room);
            //返回最终支持显示出来的设备列表
            var list = GetShowDeviceList(functionTypeList, roomDeviceList);
            var list =this.GetShowDeviceList(functionTypeList, roomDeviceList);
            return list;
        }
        /// <summary>
        /// 网关ID(获取嘉乐网关ID)
        /// 网关ID(获取网关ID)
        /// </summary>
        public string GatewayId
        {
@@ -1103,11 +1173,14 @@
                 //new Entity.Function { sid = "1234567890", name = "超声波传感器", spk = Entity.SPK.SensorUtrasonic },
                 // new Entity.Function { sid = "1234567891", name = "温度传感器", spk = Entity.SPK.SensorTemperature },
                 //  new Entity.Function { sid = "1234567892", name = "湿度传感器", spk = Entity.SPK.SensorHumidity },
                 //   new Entity.Function { sid = "1234567893", name = "红外对射传感器", spk = Entity.SPK.SensorDuiShe },
                 //     new Entity.Function { sid = "1234567895", name = "超声波传感器", spk = Entity.SPK.SensorUtrasonic },
                      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 },
                    new Entity.Function { sid = "12345678933456", name = "调光灯", spk = Entity.SPK.LightDimming },
                      new Entity.Function { sid = "1234567895444", name = "面板", spk = Entity.SPK.PanelSocket },
                      new Entity.Function { sid = "12345678968888", name = "pm10", spk = Entity.SPK.SensorPm10 },
                      //  new Entity.Function { sid = "1234567897", name = "毫米波传感器1", spk = Entity.SPK.SenesorMegahealth2 },
                      // new Entity.Function { sid = "1234567899", name = "门磁传感器", spk = Entity.SPK.SensorDoorWindow },
                      //  new Entity.Function { sid = "12345678991234", name = "HDL机械手", spk = Entity.SPK.MechanicalArm },
                      //    new Entity.Function { sid = "123456789912345", name = "海曼机械手", spk = Entity.SPK.MechanicalArm },
                      //        new Entity.Function { sid = "12345678991234566", name = "海曼机械手", spk = Entity.SPK.MechanicalArm },
            };
                foreach (var function in functions)
                {